diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-11-30 10:56:16 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-11-30 10:56:16 +0000 |
commit | b69600940692d11967b2ae8ceabed2c6c2474c37 (patch) | |
tree | d6b88df7123e7340631685d782fe3f87310793e7 /gdb/config | |
parent | 8743fc885f33a57c09d1822b6fd5d6f6cc99ec9b (diff) | |
download | binutils-gdb-b69600940692d11967b2ae8ceabed2c6c2474c37.tar.gz |
CARP:
Cleanup FRAME_CHAIN_VALID. Replace all macro's with functions.
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/a29k/tm-vx29k.h | 8 | ||||
-rw-r--r-- | gdb/config/arc/tm-arc.h | 2 | ||||
-rw-r--r-- | gdb/config/d10v/tm-d10v.h | 4 | ||||
-rw-r--r-- | gdb/config/d30v/tm-d30v.h | 9 | ||||
-rw-r--r-- | gdb/config/h8300/tm-h8300.h | 2 | ||||
-rw-r--r-- | gdb/config/i386/tm-i386nw.h | 2 | ||||
-rw-r--r-- | gdb/config/i386/tm-i386v4.h | 2 | ||||
-rw-r--r-- | gdb/config/i960/tm-mon960.h | 11 | ||||
-rw-r--r-- | gdb/config/i960/tm-nindy960.h | 9 | ||||
-rw-r--r-- | gdb/config/i960/tm-vx960.h | 2 | ||||
-rw-r--r-- | gdb/config/m68k/tm-apollo68b.h | 2 | ||||
-rw-r--r-- | gdb/config/m68k/tm-m68kv4.h | 2 | ||||
-rw-r--r-- | gdb/config/m68k/tm-vx68.h | 9 | ||||
-rw-r--r-- | gdb/config/m88k/tm-delta88v4.h | 2 | ||||
-rw-r--r-- | gdb/config/mips/tm-mipsv4.h | 2 | ||||
-rw-r--r-- | gdb/config/sparc/tm-sparclite.h | 2 |
16 files changed, 34 insertions, 36 deletions
diff --git a/gdb/config/a29k/tm-vx29k.h b/gdb/config/a29k/tm-vx29k.h index d85d9b2f0ce..487df82df86 100644 --- a/gdb/config/a29k/tm-vx29k.h +++ b/gdb/config/a29k/tm-vx29k.h @@ -209,12 +209,8 @@ extern int get_longjmp_target PARAMS ((CORE_ADDR *)); val = value_cast (builtin_type_int, val); \ } while (0) -#define SPECIAL_FRAME_CHAIN_FP get_fp_contents -#undef FRAME_CHAIN_VALID -#define FRAME_CHAIN_VALID(chain, thisframe) \ - (SPECIAL_FRAME_CHAIN_FP (chain, thisframe)) - -extern int SPECIAL_FRAME_CHAIN_FP (); +extern int vx29k_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +#define FRAME_CHAIN_VALID(chain, thisframe) vx29k_frame_chain_valid (chain, thisframe) extern CORE_ADDR frame_saved_call_site (); diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h index 043ead61037..e964bef1645 100644 --- a/gdb/config/arc/tm-arc.h +++ b/gdb/config/arc/tm-arc.h @@ -265,7 +265,7 @@ extern void arc_software_single_step PARAMS ((unsigned int, int)); /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one and has no caller. */ -#define FRAME_CHAIN_VALID(chain, thisframe) ((chain) != 0) +#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) /* A macro that tells us whether the function invocation represented by FI does not have a frame on the stack associated with it. If it diff --git a/gdb/config/d10v/tm-d10v.h b/gdb/config/d10v/tm-d10v.h index 1fc5052bc88..ef75bc5307f 100644 --- a/gdb/config/d10v/tm-d10v.h +++ b/gdb/config/d10v/tm-d10v.h @@ -213,8 +213,8 @@ extern void d10v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info (FRAMELESS) = frameless_look_for_prologue(FI) #define FRAME_CHAIN(FRAME) d10v_frame_chain(FRAME) -#define FRAME_CHAIN_VALID(chain,frame) \ - ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START) +extern int d10v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +#define FRAME_CHAIN_VALID(chain, thisframe) d10v_frame_chain_valid (chain, thisframe) #define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc) #define FRAME_ARGS_ADDRESS(fi) (fi)->frame #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame diff --git a/gdb/config/d30v/tm-d30v.h b/gdb/config/d30v/tm-d30v.h index a9f6059f78a..7a69ca36d90 100644 --- a/gdb/config/d30v/tm-d30v.h +++ b/gdb/config/d30v/tm-d30v.h @@ -217,13 +217,8 @@ extern void d30v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info (FRAMELESS) = frameless_look_for_prologue(FI) #define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME) -#if 0 -#define FRAME_CHAIN_VALID(chain,fi) \ - ((chain) != 0 && (fi) != 0 && (fi)->return_pc != 0) -#else -#define FRAME_CHAIN_VALID(chain,fi) \ - ((chain) != 0 && (fi) != 0 && (fi)->frame <= chain) -#endif +extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +#define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe) #define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc) #define FRAME_ARGS_ADDRESS(fi) (fi)->frame #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index bcdbb438fe0..34b95cc1f05 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -201,7 +201,7 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *)); the frame chain or following frames back into the startup code. See the comments in objfile.h */ -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) /* Define other aspects of the stack frame. */ diff --git a/gdb/config/i386/tm-i386nw.h b/gdb/config/i386/tm-i386nw.h index 43a1e1a1496..e5cdadecb47 100644 --- a/gdb/config/i386/tm-i386nw.h +++ b/gdb/config/i386/tm-i386nw.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Stop backtracing when we wander into main. */ -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) /* Offsets (in target ints) into jmp_buf. Not defined in any system header diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h index 0a1e56df6f2..eafff0178c0 100644 --- a/gdb/config/i386/tm-i386v4.h +++ b/gdb/config/i386/tm-i386v4.h @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Use the alternate method of determining valid frame chains. */ -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) /* Offsets (in target ints) into jmp_buf. Not defined in any system header file, so we have to step through setjmp/longjmp with a debugger and figure diff --git a/gdb/config/i960/tm-mon960.h b/gdb/config/i960/tm-mon960.h index 3e7902ab8f9..e441e052b5a 100644 --- a/gdb/config/i960/tm-mon960.h +++ b/gdb/config/i960/tm-mon960.h @@ -24,6 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "i960/tm-i960.h" +/* forward declarations */ +#ifdef __STDC__ +struct frame_info; +#endif + /* redefined from tm-i960.h */ /* Number of machine registers */ #undef NUM_REGS @@ -51,10 +56,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ since it differs between Nindy, Mon960 and VxWorks, the currently supported target types. */ -#define FRAME_CHAIN_VALID(chain, thisframe) \ - mon960_frame_chain_valid (chain, thisframe) - -extern int mon960_frame_chain_valid(); /* See i960-tdep.c */ +extern int mon960_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +#define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe) /* Sequence of bytes for breakpoint instruction */ diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h index 094781fb65d..d0c46c0a39f 100644 --- a/gdb/config/i960/tm-nindy960.h +++ b/gdb/config/i960/tm-nindy960.h @@ -24,6 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "i960/tm-i960.h" +/* forward declarations */ +#ifdef __STDC__ +struct frame_info; +#endif + /* Override the standard gdb prompt when compiled for this target. */ #define DEFAULT_PROMPT "(gdb960) " @@ -80,8 +85,8 @@ nindy_before_main_loop(); /* In remote-nindy.c */ since it differs between NINDY and VxWorks, the two currently supported targets types. */ -#define FRAME_CHAIN_VALID(chain, thisframe) \ - nindy_frame_chain_valid (chain, thisframe) +extern int nindy_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +#define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe) extern int nindy_frame_chain_valid(); /* See nindy-tdep.c */ diff --git a/gdb/config/i960/tm-vx960.h b/gdb/config/i960/tm-vx960.h index 2d56b43f868..17e28119b29 100644 --- a/gdb/config/i960/tm-vx960.h +++ b/gdb/config/i960/tm-vx960.h @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ -#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0) +#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) /* Breakpoint patching is handled at the target end in VxWorks. */ /* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */ diff --git a/gdb/config/m68k/tm-apollo68b.h b/gdb/config/m68k/tm-apollo68b.h index 760d4fc9a0a..ee10410d329 100644 --- a/gdb/config/m68k/tm-apollo68b.h +++ b/gdb/config/m68k/tm-apollo68b.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "m68k/tm-m68k.h" -#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0) +#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) /* These are the jmp_buf registers I could guess. There are 13 registers * in the buffer. There are 8 data registers, 6 general address registers, diff --git a/gdb/config/m68k/tm-m68kv4.h b/gdb/config/m68k/tm-m68kv4.h index 42f7d7fb6e9..67306073c80 100644 --- a/gdb/config/m68k/tm-m68kv4.h +++ b/gdb/config/m68k/tm-m68kv4.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Use the alternate method of determining valid frame chains. */ -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) #include "tm-sysv4.h" #include "m68k/tm-m68k.h" diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h index a194b9452e5..e601bda737c 100644 --- a/gdb/config/m68k/tm-vx68.h +++ b/gdb/config/m68k/tm-vx68.h @@ -33,23 +33,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "m68k/tm-m68k.h" -/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ -#undef FRAME_CHAIN -#undef FRAME_CHAIN_VALID - /* Takes the current frame-struct pointer and returns the chain-pointer to get to the calling frame. If our current frame pointer is zero, we're at the top; else read out the saved FP from memory pointed to by the current FP. */ +#undef FRAME_CHAIN #define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) /* If the chain pointer is zero (either because the saved value fetched by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN never fetched anything), we are at the top of the stack. */ +/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ -#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0) +#undef FRAME_CHAIN_VALID +#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) /* FIXME, Longjmp information stolen from Sun-3 config. Dunno if right. */ /* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least diff --git a/gdb/config/m88k/tm-delta88v4.h b/gdb/config/m88k/tm-delta88v4.h index 7acdd5f435e..112a4a6d65b 100644 --- a/gdb/config/m88k/tm-delta88v4.h +++ b/gdb/config/m88k/tm-delta88v4.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "tm-sysv4.h" /* If we don't define this, backtraces go on forever. */ -#define FRAME_CHAIN_VALID_ALTERNATE 1 +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) #define IN_SIGTRAMP(pc, name) ((name) && (STREQ ("signalhandler", (name)) \ || STREQ("sigacthandler", (name)))) diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h index 1a4a070b2aa..dd7aaa16d9b 100644 --- a/gdb/config/mips/tm-mipsv4.h +++ b/gdb/config/mips/tm-mipsv4.h @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 40 + 36 * 4) /* Use the alternate method of determining valid frame chains. */ -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) /* Convert a DWARF register number to a gdb REGNUM. */ #define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) diff --git a/gdb/config/sparc/tm-sparclite.h b/gdb/config/sparc/tm-sparclite.h index 525d15f3847..d841f89c356 100644 --- a/gdb/config/sparc/tm-sparclite.h +++ b/gdb/config/sparc/tm-sparclite.h @@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DECR_PC_AFTER_HW_BREAK 4 -#define FRAME_CHAIN_VALID_ALTERNATE +#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi) #undef NUM_REGS #define NUM_REGS 80 |