diff options
author | John Gilmore <gnu@cygnus> | 1991-11-18 23:52:12 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-11-18 23:52:12 +0000 |
commit | e140f1dab1e9517aa3523e52a92f954dfbabaf4a (patch) | |
tree | a06e3112e68bec966ec031bc6ee19b6655b547cf /gdb | |
parent | d08a5233d9e40a97789243cd563c5090b1736721 (diff) | |
download | gdb-e140f1dab1e9517aa3523e52a92f954dfbabaf4a.zip gdb-e140f1dab1e9517aa3523e52a92f954dfbabaf4a.tar.gz gdb-e140f1dab1e9517aa3523e52a92f954dfbabaf4a.tar.bz2 |
Remove tdesc stuff. Remove FRAME_CHAIN_COMBINE from all tm-*.h files,
since it was always defined exactly the same in all of them.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 26 | ||||
-rw-r--r-- | gdb/blockframe.c | 91 | ||||
-rw-r--r-- | gdb/coffread.c | 95 | ||||
-rw-r--r-- | gdb/infrun.c | 33 | ||||
-rw-r--r-- | gdb/m88k-tdep.c | 19 | ||||
-rw-r--r-- | gdb/tm-29k.h | 8 | ||||
-rw-r--r-- | gdb/tm-68k.h | 8 | ||||
-rw-r--r-- | gdb/tm-arm.h | 8 | ||||
-rw-r--r-- | gdb/tm-convex.h | 8 | ||||
-rw-r--r-- | gdb/tm-delta88.h | 406 | ||||
-rw-r--r-- | gdb/tm-i386v.h | 8 | ||||
-rw-r--r-- | gdb/tm-i960.h | 10 | ||||
-rw-r--r-- | gdb/tm-irix3.h | 8 | ||||
-rw-r--r-- | gdb/tm-m88k.h | 171 | ||||
-rw-r--r-- | gdb/tm-merlin.h | 8 | ||||
-rw-r--r-- | gdb/tm-mips.h | 8 | ||||
-rw-r--r-- | gdb/tm-nindy960.h | 2 | ||||
-rw-r--r-- | gdb/tm-np1.h | 9 | ||||
-rw-r--r-- | gdb/tm-pn.h | 9 | ||||
-rw-r--r-- | gdb/tm-pyr.h | 8 | ||||
-rw-r--r-- | gdb/tm-rs6000.h | 8 | ||||
-rw-r--r-- | gdb/tm-sparc.h | 8 | ||||
-rw-r--r-- | gdb/tm-sun386.h | 8 | ||||
-rw-r--r-- | gdb/tm-symmetry.h | 11 | ||||
-rw-r--r-- | gdb/tm-tahoe.h | 8 | ||||
-rw-r--r-- | gdb/tm-umax.h | 8 | ||||
-rw-r--r-- | gdb/tm-vax.h | 8 | ||||
-rw-r--r-- | gdb/xm-delta88.h | 76 | ||||
-rw-r--r-- | gdb/xm-m88k.h | 14 |
29 files changed, 192 insertions, 900 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2564a88..4ceece7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,29 @@ +Mon Nov 18 15:12:45 1991 John Gilmore (gnu at cygnus.com) + + * blockframe.c: Remove tdesc-related code. Default + FRAME_CHAIN_COMBINE if not defined. + * infrun.c: Remove tdesc-related code. + * m88k-tdep.c (frame_chain_combine, init_frame_pc): Remove copies + of defaultable things. + * tm-m88k.h: New file, common to all Moto 88k target configs. + Derived from tm-delta88.h. + * tm-delta88.h: Use it. + * xm-m88k.h: Common file for 88K hosts. Remove obsolete stuff. + * xm-delta88.h: Use it. + * tm-*.h: Remove FRAME_CHAIN_COMBINE macros, since all are + default. + * coffread.c: Remove tdesc stuff. + +Mon Nov 18 13:51:37 1991 Per Bothner (bothner at cygnus.com) + + * source.c (open_source_file): If openp fails, try again + using just the base (non-directory) part of the filename. + This solves various annoying problems, such as when the + source was compiled with an absolute pathname - and the + source files have moved. Or if the source was compiled + using a relative pathname, it can be more convenient + to just specific the source directory to the dir command. + Mon Nov 18 00:04:41 1991 Fred Fish (fnf at cygnus.com) * cplus-dem.c (munge_function_name): Add missing third arg to diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 7efe141..ee42d7c 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -27,10 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "value.h" /* for read_register */ #include "target.h" /* for target_has_stack */ -/* Required by INIT_EXTRA_FRAME_INFO on 88k. */ -#include <setjmp.h> -#include <obstack.h> - CORE_ADDR read_pc (); /* In infcmd.c */ /* Start and end of object file containing the entry point. @@ -56,6 +52,79 @@ outside_startup_file (addr) return !(addr >= startup_file_start && addr < startup_file_end); } +/* Support an alternate method to avoid running off the bottom of + the stack (or top, depending upon your stack orientation). + + There are two frames that are "special", the frame for the function + containing the process entry point, since it has no predecessor frame, + and the frame for the function containing the user code entry point + (the main() function), since all the predecessor frames are for the + process startup code. Since we have no guarantee that the linked + in startup modules have any debugging information that gdb can use, + we need to avoid following frame pointers back into frames that might + have been built in the startup code, as we might get hopelessly + confused. However, we almost always have debugging information + available for main(). + + These variables are used to save the range of PC values which are valid + within the main() function and within the function containing the process + entry point. If we always consider the frame for main() as the outermost + frame when debugging user code, and the frame for the process entry + point function as the outermost frame when debugging startup code, then + all we have to do is have FRAME_CHAIN_VALID return false whenever a + frame's current PC is within the range specified by these variables. + In essence, we set "blocks" in the frame chain beyond which we will + not proceed when following the frame chain. + + A nice side effect is that we can still debug startup code without + running off the end of the frame chain, assuming that we have usable + debugging information in the startup modules, and if we choose to not + use the block at main, or can't find it for some reason, everything + still works as before. And if we have no startup code debugging + information but we do have usable information for main(), backtraces + from user code don't go wandering off into the startup code. + + To use this method, define your FRAME_CHAIN_VALID macro like: + + #define FRAME_CHAIN_VALID(chain, thisframe) \ + (chain != 0 \ + && !(inside_main_scope ((thisframe)->pc)) \ + && !(inside_entry_scope ((thisframe)->pc))) + + and add initializations of the four scope controlling variables inside + the object file / debugging information processing modules. */ + +CORE_ADDR entry_scope_lowpc; +CORE_ADDR entry_scope_highpc; +CORE_ADDR main_scope_lowpc; +CORE_ADDR main_scope_highpc; + +/* Test a specified PC value to see if it is in the range of addresses + that correspond to the main() function. See comments above for why + we might want to do this. + + Typically called from FRAME_CHAIN_VALID. */ + +int +inside_main_scope (pc) +CORE_ADDR pc; +{ + return (main_scope_lowpc <= pc && pc < main_scope_highpc); +} + +/* Test a specified PC value to see if it is in the range of addresses + that correspond to the process entry point function. See comments above + for why we might want to do this. + + Typically called from FRAME_CHAIN_VALID. */ + +int +inside_entry_scope (pc) +CORE_ADDR pc; +{ + return (entry_scope_lowpc <= pc && pc < entry_scope_highpc); +} + /* Address of innermost stack frame (contents of FP register) */ static FRAME current_frame; @@ -104,7 +173,7 @@ create_new_frame (addr, pc) fci->pc = pc; #ifdef INIT_EXTRA_FRAME_INFO - INIT_EXTRA_FRAME_INFO (fci); + INIT_EXTRA_FRAME_INFO (0, fci); #endif return fci; @@ -208,12 +277,18 @@ frameless_look_for_prologue (frame) return 0; } +/* Default a few macros that people seldom redefine. */ + #if !defined (INIT_FRAME_PC) #define INIT_FRAME_PC(fromleaf, prev) \ prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); #endif +#ifndef FRAME_CHAIN_COMBINE +#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) +#endif + /* Return a structure containing various interesting information about the frame that called NEXT_FRAME. Returns NULL if there is no such frame. */ @@ -281,6 +356,8 @@ get_prev_frame_info (next_frame) return 0; address = FRAME_CHAIN_COMBINE (address, next_frame); } + if (address == 0) + return 0; prev = (struct frame_info *) obstack_alloc (&frame_cache_obstack, @@ -294,12 +371,12 @@ get_prev_frame_info (next_frame) prev->next_frame = prev->next ? prev->next->frame : 0; #ifdef INIT_EXTRA_FRAME_INFO - INIT_EXTRA_FRAME_INFO(prev); + INIT_EXTRA_FRAME_INFO(fromleaf, prev); #endif /* This entry is in the frame queue now, which is good since FRAME_SAVED_PC may use that queue to figure out it's value - (see m-sparc.h). We want the pc saved in the inferior frame. */ + (see tm-sparc.h). We want the pc saved in the inferior frame. */ INIT_FRAME_PC(fromleaf, prev); return prev; diff --git a/gdb/coffread.c b/gdb/coffread.c index f42f22b..4b9f245 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -26,11 +26,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "bfd.h" #include "symfile.h" -#if defined (TDESC) -/* Need to get C_VERSION and friends. FIXME, should be in internalcoff.h */ -#include "coff-m88k.h" -#endif /* not TDESC */ - #include <obstack.h> #include <string.h> @@ -153,21 +148,6 @@ static unsigned local_symesz; static unsigned local_auxesz; -#ifdef TDESC -#include "tdesc.h" -#define SEM -int int_sem_val = 's' << 24 | 'e' << 16 | 'm' << 8 | '.'; -int temp_sem_val; -int last_coffsem = 2; -#if 0 - /* This isn't used currently. */ -int last_coffsyn = 0; -#endif -int debug_info = 0; /*used by tdesc */ -extern dc_dcontext_t tdesc_handle; -extern int safe_to_init_tdesc_context; -#endif - /* Chain of typedefs of pointers to empty struct/union types. They are chained thru the SYMBOL_VALUE_CHAIN. */ @@ -466,13 +446,6 @@ start_symtab () context_stack = 0; within_function = 0; last_source_file = 0; -#ifdef TDESC - last_coffsem = 2; -#if 0 - /* This isn't used currently. */ - last_coffsyn = 0; -#endif -#endif /* Initialize the source file line number information for this file. */ @@ -568,15 +541,6 @@ end_symtab (objfile) xrealloc (lv, (sizeof (struct linetable) + lv->nitems * sizeof (struct linetable_entry))); -#ifdef TDESC - symtab->coffsem = last_coffsem; -#if 0 - /* This isn't used currently. Besides, if this is really about "syntax", - it shouldn't need to stick around past symbol read-in time. */ - symtab->coffsyn = last_coffsyn; -#endif -#endif - free_named_symtabs (symtab->filename); /* Link the new symtab into the list of such. */ @@ -594,10 +558,9 @@ record_misc_function (name, address) char *name; CORE_ADDR address; { -#ifdef TDESC /* We don't want TDESC entry points on the misc_function_vector */ if (name[0] == '@') return; -#endif + /* mf_text isn't true, but apparently COFF doesn't tell us what it really is, so this guess is more useful than mf_unknown. */ prim_record_misc_function (savestring (name, strlen (name)), @@ -636,10 +599,6 @@ coff_symfile_init (sf) /* FIXME memory leak */ sf->sym_private = xmalloc (sizeof (struct coff_symfile_info)); -#if defined (TDESC) - safe_to_init_tdesc_context = 0; -#endif - /* Save startup file's range of PC addresses to help blockframe.c decide where the bottom of the stack is. */ if (bfd_get_file_flags (abfd) & EXEC_P) @@ -698,21 +657,6 @@ find_linenos (abfd, asect, vpinfo) maxoff = offset + size; if (maxoff > info->max_lineno_offset) info->max_lineno_offset = maxoff; -#ifdef TDESC - /* While we're at it, find the debug_info. It's in the s_relptr - (or, in BFD-speak, rel_filepos) of the text segment section header. */ - if (strcmp (bfd_section_name (abfd, asect), ".text") == 0) - { - /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ - debug_info = asect->rel_filepos; - /* End of warning */ - if (tdesc_handle) - { - dc_terminate (tdesc_handle); - tdesc_handle = 0; - } - } -#endif /* TDESC */ } @@ -1122,27 +1066,8 @@ read_coff_symtab (desc, nsyms, objfile) free (new); } break; -#ifdef TDESC - case C_VERSION: -#if 0 - /* This isn't used currently. */ - if (strcmp (cs->c_name, ".coffsyn") == 0) - last_coffsyn = cs->c_value; - else -#endif /* 0 */ - if ((strcmp (cs->c_name, ".coffsem") == 0) && - (cs->c_value != 0)) - last_coffsem = cs->c_value; - break; -#endif /* TDESC */ default: -#ifdef TDESC - if ((strcmp (cs->c_name, ".coffsem") == 0) && - (cs->c_value != 0)) - last_coffsem = cs->c_value; - else -#endif (void) process_coff_symbol (cs, &main_aux); break; } @@ -1871,6 +1796,9 @@ decode_base_type (cs, c_type, aux) type = coff_alloc_type (cs->c_symnum); TYPE_CODE (type) = TYPE_CODE_STRUCT; TYPE_NAME (type) = concat ("struct ", "<opaque>", NULL); + TYPE_CPLUS_SPECIFIC (type) + = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type)); + bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type)); TYPE_LENGTH (type) = 0; TYPE_FIELDS (type) = 0; TYPE_NFIELDS (type) = 0; @@ -1963,6 +1891,9 @@ read_struct_type (index, length, lastsym) type = coff_alloc_type (index); TYPE_CODE (type) = TYPE_CODE_STRUCT; + TYPE_CPLUS_SPECIFIC (type) + = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type)); + bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type)); TYPE_LENGTH (type) = length; while (!done && symnum < lastsym && symnum < nlist_nsyms_global) @@ -2125,19 +2056,7 @@ read_enum_type (index, length, lastsym) static struct sym_fns coff_sym_fns = { - /* This assumes that 88kbcs implies TDESC and TDESC implies 88kbcs. - If that's not true, this can be relaxed, but if it is true, - it will just cause users grief if we try to read the wrong kind - of symbol file. */ -#if defined (TDESC) - "m88kbcs", 8, -#else /* not TDESC */ -# ifdef i386 - "i386coff", 8, -# else "coff", 4, -# endif /* not i386 */ -#endif /* not TDESC */ coff_new_init, coff_symfile_init, coff_symfile_read, }; diff --git a/gdb/infrun.c b/gdb/infrun.c index bb23c94..3ca563f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -25,7 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ Current and previous sp. Current and previous start of current function. - If the start's of the functions don't match, then + If the starts of the functions don't match, then a) We did a subroutine call. @@ -169,12 +169,6 @@ extern struct target_ops child_ops; /* In inftarg.c */ (name && !strcmp ("_sigtramp", name)) #endif -#ifdef TDESC -#include "tdesc.h" -int safe_to_init_tdesc_context = 0; -extern dc_dcontext_t current_context; -#endif - /* Tables of how to react to signals; the user sets them. */ static char signal_stop[NSIG]; @@ -774,9 +768,6 @@ wait_for_inferior () int stop_step_resume_break; struct symtab_and_line sal; int remove_breakpoints_on_following_step = 0; -#ifdef TDESC - extern dc_handle_t tdesc_handle; -#endif int current_line; #if 0 @@ -805,9 +796,6 @@ wait_for_inferior () if (WIFEXITED (w)) { target_terminal_ours (); /* Must do this before mourn anyway */ -#ifdef TDESC - safe_to_init_tdesc_context = 0; -#endif if (WEXITSTATUS (w)) printf ("\nProgram exited with code 0%o.\n", (unsigned int)WEXITSTATUS (w)); @@ -828,9 +816,6 @@ wait_for_inferior () stop_signal = WTERMSIG (w); target_terminal_ours (); /* Must do this before mourn anyway */ target_kill ((char *)0, 0); /* kill mourns as well */ -#ifdef TDESC - safe_to_init_tdesc_context = 0; -#endif #ifdef PRINT_RANDOM_SIGNAL printf ("\nProgram terminated: "); PRINT_RANDOM_SIGNAL (stop_signal); @@ -855,14 +840,6 @@ wait_for_inferior () #endif /* NO_SINGLE_STEP */ stop_pc = read_pc (); -#ifdef TDESC - if (safe_to_init_tdesc_context) - { - current_context = init_dcontext(); - set_current_frame ( create_new_frame (get_frame_base (read_pc()),read_pc())); - } - else -#endif /* TDESC */ set_current_frame ( create_new_frame (read_register (FP_REGNUM), read_pc ())); @@ -1327,14 +1304,6 @@ wait_for_inferior () to one-proceed past a breakpoint. */ /* If we've just finished a special step resume and we don't want to hit a breakpoint, pull em out. */ -#ifdef TDESC - if (!tdesc_handle) - { - init_tdesc(); - safe_to_init_tdesc_context = 1; - } -#endif - if (!step_resume_break_address && remove_breakpoints_on_following_step) { diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index ff15ff8..594bd49 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -96,13 +96,6 @@ frame_chain_valid (chain, thisframe) && outside_startup_file (FRAME_SAVED_PC (thisframe))); } -CORE_ADDR -frame_chain_combine (chain, thisframe) - CORE_ADDR chain; -{ - return chain; -} - void init_extra_frame_info (fromleaf, fi) int fromleaf; @@ -112,18 +105,6 @@ init_extra_frame_info (fromleaf, fi) fi->args_pointer = 0; /* Unknown */ fi->locals_pointer = 0; /* Unknown */ } - -void -init_frame_pc (fromleaf, prev) - int fromleaf; - struct frame_info *prev; -{ - /* FIXME, for now it's the default from blockframe.c. If it stays that - way, remove it entirely from here. */ - prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : - prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); - -} /* Examine an m88k function prologue, recording the addresses at which registers are saved explicitly by the prologue code, and returning diff --git a/gdb/tm-29k.h b/gdb/tm-29k.h index 3f8bfc3..8e970d0 100644 --- a/gdb/tm-29k.h +++ b/gdb/tm-29k.h @@ -437,12 +437,8 @@ void init_frame_pc (); /* FRAME_CHAIN takes a FRAME and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* On the 29k, the nominal address of a frame is the address on the register stack of the return address (the one next to the incoming @@ -465,8 +461,6 @@ void init_frame_pc (); #define FRAME_CHAIN_VALID(chain, thisframe) \ (outside_startup_file (FRAME_SAVED_PC (thisframe))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (0) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-68k.h b/gdb/tm-68k.h index f501495..f8efb12 100644 --- a/gdb/tm-68k.h +++ b/gdb/tm-68k.h @@ -301,12 +301,8 @@ extern struct ext_format ext_format_68881; /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the 68000, the frame's nominal address is the address of a 4-byte word containing the calling frame's address. */ @@ -334,8 +330,6 @@ extern struct ext_format ext_format_68881; #endif /* FRAME_CHAIN_VALID_ALTERNATE */ -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-arm.h b/gdb/tm-arm.h index ee63d6a..8715195 100644 --- a/gdb/tm-arm.h +++ b/gdb/tm-arm.h @@ -232,12 +232,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the ARM, the frame's nominal address is the FP value, and 12 bytes before comes the saved previous FP value as a 4-byte word. */ @@ -250,8 +246,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (FRAME_SAVED_PC (thisframe) >= first_object_file_end)) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-convex.h b/gdb/tm-convex.h index 2424a2f..1ada10b 100644 --- a/gdb/tm-convex.h +++ b/gdb/tm-convex.h @@ -305,12 +305,8 @@ extern struct value *value_of_trapped_internalvar (); /* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame, and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* (caller fp is saved at 8(fp)) */ @@ -319,8 +315,6 @@ extern struct value *value_of_trapped_internalvar (); #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* We need the boundaries of the text in the exec file, as a kludge, diff --git a/gdb/tm-delta88.h b/gdb/tm-delta88.h index eacac69..7474b3e 100644 --- a/gdb/tm-delta88.h +++ b/gdb/tm-delta88.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc. +/* Target machine description for Motorola Delta 88 box, for GDB. + Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -16,408 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* g++ support is not yet included. */ - -#define TARGET_BYTE_ORDER BIG_ENDIAN - -/* We cache information about saved registers in the frame structure, - to save us from having to re-scan function prologues every time - a register in a non-current frame is accessed. */ - -#define EXTRA_FRAME_INFO \ - struct frame_saved_regs *fsr; \ - CORE_ADDR locals_pointer; \ - CORE_ADDR args_pointer; - -/* Zero the frame_saved_regs pointer when the frame is initialized, - so that FRAME_FIND_SAVED_REGS () will know to allocate and - initialize a frame_saved_regs struct the first time it is called. - Set the arg_pointer to -1, which is not valid; 0 and other values - indicate real, cached values. */ - -#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ - init_extra_frame_info (fromleaf, fi) -extern void init_extra_frame_info (); - -#define INIT_FRAME_PC(fromleaf, prev) \ - init_frame_pc (fromleaf, prev) -extern void init_frame_pc (); - -#define IEEE_FLOAT - -/* Define this if the C compiler puts an underscore at the front - of external names before giving them to the linker. */ - -#define NAMES_HAVE_UNDERSCORE - -/* Hook for read_relative_register_raw_bytes */ - -#define READ_RELATIVE_REGISTER_RAW_BYTES - -/* Offset from address of function to start of its code. - Zero on most machines. */ - -#define FUNCTION_START_OFFSET 0 - -/* Advance PC across any function entry prologue instructions - to reach some "real" code. */ - -#define SKIP_PROLOGUE(frompc) \ - skip_prologue (frompc) -extern CORE_ADDR skip_prologue (); - -/* The m88k kernel aligns all instructions on 4-byte boundaries. The - kernel also uses the least significant two bits for its own hocus - pocus. When gdb receives an address from the kernel, it needs to - preserve those right-most two bits, but gdb also needs to be careful - to realize that those two bits are not really a part of the address - of an instruction. Shrug. */ - -#define ADDR_BITS_REMOVE(addr) ((addr) & ~3) -#define ADDR_BITS_SET(addr) (((addr) | 0x00000002) - 4) - -/* Immediately after a function call, return the saved pc. - Can't always go through the frames for this because on some machines - the new frame is not set up until the new function executes - some instructions. */ - -#define SAVED_PC_AFTER_CALL(frame) \ - (ADDR_BITS_REMOVE (read_register (SRP_REGNUM))) - -/* Address of end of stack space (in core files). */ - -#define STACK_END_ADDR 0xF0000000 - -/* Stack grows downward. */ - -#define INNER_THAN < - -/* Sequence of bytes for breakpoint instruction. */ - -/* instruction 0xF000D1FF is 'tb0 0,r0,511' - If Bit bit 0 of r0 is clear (always true), - initiate exception processing (trap). - */ -#define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF} - -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ - -#define DECR_PC_AFTER_BREAK 0 - -/* Nonzero if instruction at PC is a return instruction. */ -/* 'jmp r1' or 'jmp.n r1' is used to return from a subroutine. */ - -#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 2) == 0xF800) - -/* Return 1 if P points to an invalid floating point value. - LEN is the length in bytes. */ - -#define INVALID_FLOAT(p, len) IEEE_isNAN(p,len) - -/* Say how long (ordinary) registers are. */ - -#define REGISTER_TYPE long - -/* Number of machine registers */ - -#define NUM_REGS 38 - -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ - -#define REGISTER_NAMES {\ - "r0",\ - "r1",\ - "r2",\ - "r3",\ - "r4",\ - "r5",\ - "r6",\ - "r7",\ - "r8",\ - "r9",\ - "r10",\ - "r11",\ - "r12",\ - "r13",\ - "r14",\ - "r15",\ - "r16",\ - "r17",\ - "r18",\ - "r19",\ - "r20",\ - "r21",\ - "r22",\ - "r23",\ - "r24",\ - "r25",\ - "r26",\ - "r27",\ - "r28",\ - "r29",\ - "r30",\ - "r31",\ - "psr",\ - "fpsr",\ - "fpcr",\ - "sxip",\ - "snip",\ - "sfip",\ - "vbr",\ - "dmt0",\ - "dmd0",\ - "dma0",\ - "dmt1",\ - "dmd1",\ - "dma1",\ - "dmt2",\ - "dmd2",\ - "dma2",\ - "sr0",\ - "sr1",\ - "sr2",\ - "sr3",\ - "fpecr",\ - "fphs1",\ - "fpls1",\ - "fphs2",\ - "fpls2",\ - "fppt",\ - "fprh",\ - "fprl",\ - "fpit",\ - "fpsr",\ - "fpcr",\ - }; - - -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -#define SRP_REGNUM 1 /* Contains subroutine return pointer */ -#define RV_REGNUM 2 /* Contains simple return values */ -#define SRA_REGNUM 12 /* Contains address of struct return values */ -#define FP_REGNUM 31 /* Reg fetched to locate frame when pgm stops */ -#define SP_REGNUM 31 /* Contains address of top of stack */ -#define SXIP_REGNUM 35 /* Contains Shadow Execute Instruction Pointer */ -#define SNIP_REGNUM 36 /* Contains Shadow Next Instruction Pointer */ -#define PC_REGNUM SXIP_REGNUM /* Program Counter */ -#define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */ -#define PSR_REGNUM 32 /* Processor Status Register */ -#define FPSR_REGNUM 33 /* Floating Point Status Register */ -#define FPCR_REGNUM 34 /* Floating Point Control Register */ -#define SFIP_REGNUM 37 /* Contains Shadow Fetched Intruction pointer */ -#define NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */ - -/* PSR status bit definitions. */ - -#define PSR_MODE 0x80000000 -#define PSR_BYTE_ORDER 0x40000000 -#define PSR_SERIAL_MODE 0x20000000 -#define PSR_CARRY 0x10000000 -#define PSR_SFU_DISABLE 0x000003f0 -#define PSR_SFU1_DISABLE 0x00000008 -#define PSR_MXM 0x00000004 -#define PSR_IND 0x00000002 -#define PSR_SFRZ 0x00000001 - -/* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the address - of the next instr to be executed when a breakpoint occurs. Because - the kernel gets the next instr (SNIP_REGNUM), the instr in SNIP needs - to be put back into SFIP, and the instr in SXIP should be shifted - to SNIP */ - -/* Are you sitting down? It turns out that the 88K BCS (binary compatibility - standard) folks originally felt that the debugger should be responsible - for backing up the IPs, not the kernel (as is usually done). Well, they - have reversed their decision, and in future releases our kernel will be - handling the backing up of the IPs. So, eventually, we won't need to - do the SHIFT_INST_REGS stuff. But, for now, since there are 88K systems out - there that do need the debugger to do the IP shifting, and since there - will be systems where the kernel does the shifting, the code is a little - more complex than perhaps it needs to be (we still go inside SHIFT_INST_REGS, - and if the shifting hasn't occurred then gdb goes ahead and shifts). */ - -#define SHIFT_INST_REGS - -/* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. */ - -#define REGISTER_BYTES (NUM_REGS * sizeof(REGISTER_TYPE)) - -/* Index within `registers' of the first byte of the space for - register N. */ - -#define REGISTER_BYTE(N) ((N)*sizeof(REGISTER_TYPE)) - -/* Number of bytes of storage in the actual machine representation - for register N. */ - -#define REGISTER_RAW_SIZE(N) (sizeof(REGISTER_TYPE)) - -/* Number of bytes of storage in the program's representation - for register N. */ - -#define REGISTER_VIRTUAL_SIZE(N) (sizeof(REGISTER_TYPE)) - -/* Largest value REGISTER_RAW_SIZE can have. */ - -#define MAX_REGISTER_RAW_SIZE (sizeof(REGISTER_TYPE)) - -/* Largest value REGISTER_VIRTUAL_SIZE can have. -/* Are FPS1, FPS2, FPR "virtual" regisers? */ - -#define MAX_REGISTER_VIRTUAL_SIZE (sizeof(REGISTER_TYPE)) - -/* Nonzero if register N requires conversion - from raw format to virtual format. */ - -#define REGISTER_CONVERTIBLE(N) (0) - -/* Convert data from raw format for register REGNUM - to virtual format for register REGNUM. */ - -#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) {bcopy ((FROM), (TO), (sizeof(REGISTER_TYPE)));} - -/* Convert data from virtual format for register REGNUM - to raw format for register REGNUM. */ - -#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) {bcopy ((FROM), (TO), (sizeof(REGISTER_TYPE)));} - -/* Return the GDB type object for the "standard" data type - of data in register N. */ - -#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) - -/* The 88k call/return conventions call for "small" values to be returned - into consecutive registers starting from r2. */ - -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - bcopy (&(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), (VALBUF), TYPE_LENGTH (TYPE)) - -#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF)) - -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format. */ - -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ - write_register_bytes (2*sizeof(void*), (VALBUF), TYPE_LENGTH (TYPE)) - -/* In COFF, if PCC says a parameter is a short or a char, do not - change it to int (it seems the convention is to change it). */ - -#define BELIEVE_PCC_PROMOTION 1 - -/* Describe the pointer in each stack frame to the previous stack frame - (its caller). */ - -/* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. - - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ - -extern CORE_ADDR frame_chain (); -extern int frame_chain_valid (); -extern CORE_ADDR frame_chain_combine (); -extern int frameless_function_invocation (); - -#define FRAME_CHAIN(thisframe) \ - frame_chain (thisframe) - -#define FRAME_CHAIN_VALID(chain, thisframe) \ - frame_chain_valid (chain, thisframe) - -#define FRAME_CHAIN_COMBINE(chain, thisframe) \ - frame_chain_combine (chain, thisframe) - -#define FRAMELESS_FUNCTION_INVOCATION(frame, fromleaf) \ - fromleaf = frameless_function_invocation (frame) - -/* Define other aspects of the stack frame. */ - -#define FRAME_SAVED_PC(FRAME) \ - frame_saved_pc (FRAME) -extern CORE_ADDR frame_saved_pc (); - -#define FRAME_ARGS_ADDRESS(fi) \ - frame_args_address (fi) -extern CORE_ADDR frame_args_address (); - -#define FRAME_LOCALS_ADDRESS(fi) \ - frame_locals_address (fi) -extern CORE_ADDR frame_locals_address (); - -/* Return number of args passed to a frame. - Can return -1, meaning no way to tell. */ - -#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1) - -/* Return number of bytes at start of arglist that are not really args. */ - -#define FRAME_ARGS_SKIP 0 - -/* Put here the code to store, into a struct frame_saved_regs, - the addresses of the saved registers of frame described by FRAME_INFO. - This includes special registers such as pc and fp saved in special - ways in the stack frame. sp is even more special: - the address we return for it IS the sp for the next frame. */ - -/* On the 88k, parameter registers get stored into the so called "homing" - area. This *always* happens when you compiled with GCC and use -g. - Also, (with GCC and -g) the saving of the parameter register values - always happens right within the function prologue code, so these register - values can generally be relied upon to be already copied into their - respective homing slots by the time you will normally try to look at - them (we hope). - - Note that homing area stack slots are always at *positive* offsets from - the frame pointer. Thus, the homing area stack slots for the parameter - registers (passed values) for a given function are actually part of the - frame area of the caller. This is unusual, but it should not present - any special problems for GDB. - - Note also that on the 88k, we are only interested in finding the - registers that might have been saved in memory. This is a subset of - the whole set of registers because the standard calling sequence allows - the called routine to clobber many registers. - - We could manage to locate values for all of the so called "preserved" - registers (some of which may get saved within any particular frame) but - that would require decoding all of the tdesc information. Tht would be - nice information for GDB to have, but it is not strictly manditory if we - can live without the ability to look at values within (or backup to) - previous frames. -*/ - -#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ - frame_find_saved_regs (frame_info, &frame_saved_regs) - - -/* There is not currently a functioning way to call functions in the - inferior. */ - -/* But if there was this is where we'd put the call dummy. */ -/* #define CALL_DUMMY_LOCATION AFTER_TEXT_END */ - -/* When popping a frame on the 88k (say when doing a return command), the - calling function only expects to have the "preserved" registers restored. - Thus, those are the only ones that we even try to restore here. */ - -extern void pop_frame (); - -#define POP_FRAME pop_frame () +#include "tm-m88k.h" /* BCS is a standard for binary compatibility. This machine uses it. */ #if !defined (BCS) diff --git a/gdb/tm-i386v.h b/gdb/tm-i386v.h index 11c90a4..409cc53 100644 --- a/gdb/tm-i386v.h +++ b/gdb/tm-i386v.h @@ -217,12 +217,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ #define FRAME_CHAIN(thisframe) \ (outside_startup_file ((thisframe)->pc) ? \ @@ -232,8 +228,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-i960.h b/gdb/tm-i960.h index 1e7fa52..7dba1de 100644 --- a/gdb/tm-i960.h +++ b/gdb/tm-i960.h @@ -264,12 +264,8 @@ extern CORE_ADDR saved_pc_after_call (); /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* We cache information about saved registers in the frame structure, to save us from having to re-scan function prologues every time @@ -294,10 +290,8 @@ extern CORE_ADDR saved_pc_after_call (); #define FRAME_CHAIN(thisframe) \ (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one - and has no caller. In that case, FRAME_CHAIN_COMBINE is not used. + and has no caller. On the i960, each various target system type must define FRAME_CHAIN_VALID, since it differs between NINDY and VxWorks, the two currently supported diff --git a/gdb/tm-irix3.h b/gdb/tm-irix3.h index 8843302..f62a39e 100644 --- a/gdb/tm-irix3.h +++ b/gdb/tm-irix3.h @@ -201,20 +201,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ #define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe) #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ diff --git a/gdb/tm-m88k.h b/gdb/tm-m88k.h index 423594d..f562f86 100644 --- a/gdb/tm-m88k.h +++ b/gdb/tm-m88k.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc. +/* Target machine description for generic Motorola 88000, for GDB. + Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -16,97 +17,36 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* This is currently for a 88000 running DGUX. If other 88k ports are - done, OS-specific stuff should be moved (see tm-68k.h, for example). */ /* g++ support is not yet included. */ -#include "tdesc.h" - -#if !defined (DGUX) -#define DGUX 1 -#endif - #define TARGET_BYTE_ORDER BIG_ENDIAN -#define EXTRA_SYMTAB_INFO int coffsem; - -/* This is not a CREATE_INFERIOR_HOOK because it also applies to - remote debugging. */ -#define START_INFERIOR_HOOK() \ - { \ - extern int safe_to_init_tdesc_context; \ - extern dc_handle_t tdesc_handle; \ - \ - safe_to_init_tdesc_context = 0; \ - if (tdesc_handle) \ - { \ - dc_terminate (tdesc_handle); \ - tdesc_handle = 0; \ - } \ - } - -dc_dcontext_t get_prev_context (); -extern int stack_error; - -#define EXTRA_FRAME_INFO dc_dcontext_t frame_context; -#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ - { \ - if (fci->next_frame != NULL) \ - { \ - extern jmp_buf stack_jmp; \ - struct frame_info *next_frame = fci->next; \ - /* The call to get_prev_context */ \ - /* will update current_context for us. */ \ - stack_error = 1; \ - if (!setjmp (stack_jmp)) \ - { \ - fci->frame_context \ - = get_prev_context (next_frame->frame_context); \ - stack_error = 0; \ - } \ - else \ - { \ - stack_error = 0; \ - next_frame->prev = 0; \ - return 0; \ - } \ - if (!fci->frame_context) \ - { \ - next_frame->prev = 0; \ - return 0; \ - } \ - } \ - else \ - { \ - /* We are creating an arbitrary frame */ \ - /* (i.e. we are in create_new_frame). */ \ - extern dc_dcontext_t current_context; \ - \ - fci->frame_context = current_context; \ - } \ - } - -#define INIT_FRAME_PC(fromleaf, prev) \ - { \ - prev->pc = dc_location (prev->frame_context); \ - prev->frame = get_frame_base (prev->pc); \ - } +/* We cache information about saved registers in the frame structure, + to save us from having to re-scan function prologues every time + a register in a non-current frame is accessed. */ -#define IEEE_FLOAT +#define EXTRA_FRAME_INFO \ + struct frame_saved_regs *fsr; \ + CORE_ADDR locals_pointer; \ + CORE_ADDR args_pointer; + +/* Zero the frame_saved_regs pointer when the frame is initialized, + so that FRAME_FIND_SAVED_REGS () will know to allocate and + initialize a frame_saved_regs struct the first time it is called. + Set the arg_pointer to -1, which is not valid; 0 and other values + indicate real, cached values. */ -/* Text Description (TDESC) is used by m88k to maintain stack & reg info */ +#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ + init_extra_frame_info (fromleaf, fi) +extern void init_extra_frame_info (); -#define TDESC +#define IEEE_FLOAT /* Define this if the C compiler puts an underscore at the front of external names before giving them to the linker. */ #define NAMES_HAVE_UNDERSCORE -/* Hook for read_relative_register_raw_bytes */ - -#define READ_RELATIVE_REGISTER_RAW_BYTES - /* Offset from address of function to start of its code. Zero on most machines. */ @@ -115,7 +55,9 @@ extern int stack_error; /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -#define SKIP_PROLOGUE(frompc) 0 +#define SKIP_PROLOGUE(frompc) \ + skip_prologue (frompc) +extern CORE_ADDR skip_prologue (); /* The m88k kernel aligns all instructions on 4-byte boundaries. The kernel also uses the least significant two bits for its own hocus @@ -133,27 +75,7 @@ extern int stack_error; some instructions. */ #define SAVED_PC_AFTER_CALL(frame) \ - (read_register (SRP_REGNUM) & (~3)) - -/* Address of end of stack space. */ - -#define STACK_END_ADDR 0xF0000000 - -/* Stack grows downward. */ - -#define INNER_THAN < - -/* Sequence of bytes for breakpoint instruction. */ - -/* instruction 0xF000D1FF is 'tb0 0,r0,511' - If Bit bit 0 of r0 is clear (always true), - initiate exception processing (trap). - */ -#define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF} - -/* Address of end of stack space. */ - -#define STACK_END_ADDR 0xF0000000 + (ADDR_BITS_REMOVE (read_register (SRP_REGNUM))) /* Stack grows downward. */ @@ -179,7 +101,7 @@ extern int stack_error; #define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 2) == 0xF800) /* Return 1 if P points to an invalid floating point value. - LEN is the length in bytes -- not relevant on the 386. */ + LEN is the length in bytes. */ #define INVALID_FLOAT(p, len) IEEE_isNAN(p,len) @@ -271,7 +193,7 @@ extern int stack_error; #define SRP_REGNUM 1 /* Contains subroutine return pointer */ #define RV_REGNUM 2 /* Contains simple return values */ #define SRA_REGNUM 12 /* Contains address of struct return values */ -#define FP_REGNUM 30 /* Contains address of executing stack frame */ +#define FP_REGNUM 31 /* Reg fetched to locate frame when pgm stops */ #define SP_REGNUM 31 /* Contains address of top of stack */ #define SXIP_REGNUM 35 /* Contains Shadow Execute Instruction Pointer */ #define SNIP_REGNUM 36 /* Contains Shadow Next Instruction Pointer */ @@ -382,38 +304,41 @@ extern int stack_error; #define BELIEVE_PCC_PROMOTION 1 -/* We provide our own get_saved_register in m88k-tdep.c. */ -#define GET_SAVED_REGISTER - /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ -/* These are just dummies for the 88k because INIT_FRAME_PC sets prev->frame - instead. */ +extern CORE_ADDR frame_chain (); +extern int frame_chain_valid (); +extern int frameless_function_invocation (); -#define FRAME_CHAIN(thisframe) (0) +#define FRAME_CHAIN(thisframe) \ + frame_chain (thisframe) -#define FRAME_CHAIN_VALID(chain, thisframe) (1) +#define FRAME_CHAIN_VALID(chain, thisframe) \ + frame_chain_valid (chain, thisframe) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (0) +#define FRAMELESS_FUNCTION_INVOCATION(frame, fromleaf) \ + fromleaf = frameless_function_invocation (frame) /* Define other aspects of the stack frame. */ -#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame+4, 4)) +#define FRAME_SAVED_PC(FRAME) \ + frame_saved_pc (FRAME) +extern CORE_ADDR frame_saved_pc (); -#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) +#define FRAME_ARGS_ADDRESS(fi) \ + frame_args_address (fi) +extern CORE_ADDR frame_args_address (); -#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) +#define FRAME_LOCALS_ADDRESS(fi) \ + frame_locals_address (fi) +extern CORE_ADDR frame_locals_address (); /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ @@ -471,11 +396,5 @@ extern int stack_error; calling function only expects to have the "preserved" registers restored. Thus, those are the only ones that we even try to restore here. */ -extern void pop_frame (); - #define POP_FRAME pop_frame () - -/* BCS is a standard for binary compatibility. This machine uses it. */ -#if !defined (BCS) -#define BCS 1 -#endif +extern void pop_frame (); diff --git a/gdb/tm-merlin.h b/gdb/tm-merlin.h index 3a4ac23..f782dd0 100644 --- a/gdb/tm-merlin.h +++ b/gdb/tm-merlin.h @@ -210,12 +210,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the Merlin, the frame's nominal address is the FP value, and at that address is saved previous FP value as a 4-byte word. */ @@ -228,8 +224,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4)) diff --git a/gdb/tm-mips.h b/gdb/tm-mips.h index e47443f..dc5af0d 100644 --- a/gdb/tm-mips.h +++ b/gdb/tm-mips.h @@ -222,20 +222,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ #define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe) #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ diff --git a/gdb/tm-nindy960.h b/gdb/tm-nindy960.h index 36a24fd..520eb6b 100644 --- a/gdb/tm-nindy960.h +++ b/gdb/tm-nindy960.h @@ -78,7 +78,7 @@ extern char *nindy_ttyname; /* Name of serial port to talk to nindy */ #define STACK_END_ADDR (0xfe000000) /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one - and has no caller. In that case, FRAME_CHAIN_COMBINE is not used. + and has no caller. On the i960, each various target system type defines FRAME_CHAIN_VALID, since it differs between NINDY and VxWorks, the two currently supported diff --git a/gdb/tm-np1.h b/gdb/tm-np1.h index 5fe8789..75a36af 100644 --- a/gdb/tm-np1.h +++ b/gdb/tm-np1.h @@ -326,12 +326,8 @@ extern struct type *builtin_type_np1_vector; /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the NPL, the frame's norminal address is Br2 and the previous routines frame is up the stack X bytes, where X is the @@ -341,9 +337,6 @@ extern struct type *builtin_type_np1_vector; #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && chain != (thisframe)->frame) -#define FRAME_CHAIN_COMBINE(chain, thisframe) \ - (chain) - /* Define other aspects of the stack frame on NPL. */ #define FRAME_SAVED_PC(FRAME) \ (read_memory_integer ((FRAME)->frame + 8, 4)) diff --git a/gdb/tm-pn.h b/gdb/tm-pn.h index e84cc27..3300c8c 100644 --- a/gdb/tm-pn.h +++ b/gdb/tm-pn.h @@ -300,12 +300,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the NPL, the frame's norminal address is Br2 and the previous routines frame is up the stack X bytes, where X is the @@ -315,9 +311,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && chain != (thisframe)->frame) -#define FRAME_CHAIN_COMBINE(chain, thisframe) \ - (chain) - /* Define other aspects of the stack frame on NPL. */ #define FRAME_SAVED_PC(frame) \ (read_memory_integer ((frame)->frame + 8, 4)) diff --git a/gdb/tm-pyr.h b/gdb/tm-pyr.h index 750fef2..a977a52 100644 --- a/gdb/tm-pyr.h +++ b/gdb/tm-pyr.h @@ -307,12 +307,8 @@ do { \ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the pyr, the frame's nominal address is the address of parameter register 0. The previous frame is found 32 words up. */ @@ -325,8 +321,6 @@ do { \ /*((thisframe) >= CONTROL_STACK_ADDR))*/ -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-rs6000.h b/gdb/tm-rs6000.h index ce47df6..3b90fe3 100644 --- a/gdb/tm-rs6000.h +++ b/gdb/tm-rs6000.h @@ -327,12 +327,8 @@ extern unsigned int rs6000_struct_return_address; /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the RS6000, the frame's nominal address is the address of a 4-byte word containing the calling frame's address. */ @@ -345,8 +341,6 @@ extern unsigned int rs6000_struct_return_address; #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-sparc.h b/gdb/tm-sparc.h index dd82d9e..15d214b 100644 --- a/gdb/tm-sparc.h +++ b/gdb/tm-sparc.h @@ -308,12 +308,8 @@ CORE_ADDR sparc_extract_struct_value_address ( /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the Sun 4, the frame-chain's nominal address is held in the frame pointer register. @@ -349,8 +345,6 @@ CORE_ADDR sparc_frame_chain (); #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-sun386.h b/gdb/tm-sun386.h index 3365374..0af69c0 100644 --- a/gdb/tm-sun386.h +++ b/gdb/tm-sun386.h @@ -220,12 +220,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ #define FRAME_CHAIN(thisframe) \ (outside_startup_file ((thisframe)->pc) ? \ @@ -235,8 +231,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-symmetry.h b/gdb/tm-symmetry.h index 5089201..cf5af29 100644 --- a/gdb/tm-symmetry.h +++ b/gdb/tm-symmetry.h @@ -242,16 +242,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* On Symmetry, %ebp points to caller's %ebp, and the return address - is right on top of that. -*/ + is right on top of that. */ #define FRAME_CHAIN(thisframe) \ (outside_startup_file ((thisframe)->pc) ? \ @@ -261,8 +256,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/tm-tahoe.h b/gdb/tm-tahoe.h index 72290fe..9456808 100644 --- a/gdb/tm-tahoe.h +++ b/gdb/tm-tahoe.h @@ -210,12 +210,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the Tahoe, the frame's nominal address is the FP value, and it points to the old FP */ @@ -228,8 +224,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* Saved PC */ diff --git a/gdb/tm-umax.h b/gdb/tm-umax.h index 0dea301..727ffcf 100644 --- a/gdb/tm-umax.h +++ b/gdb/tm-umax.h @@ -214,12 +214,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the ns32000 series, the frame's nominal address is the FP value, and at that address is saved previous FP value as a 4-byte word. */ @@ -232,8 +228,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4)) diff --git a/gdb/tm-vax.h b/gdb/tm-vax.h index ac0bc86..a91a3c7 100644 --- a/gdb/tm-vax.h +++ b/gdb/tm-vax.h @@ -220,12 +220,8 @@ fix to bug-gdb@prep.ai.mit.edu. */ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. - FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address - and produces the nominal address of the caller frame. - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. - In that case, FRAME_CHAIN_COMBINE is not used. */ + it means the given frame is the outermost one and has no caller. */ /* In the case of the Vax, the frame's nominal address is the FP value, and 12 bytes later comes the saved previous FP value as a 4-byte word. */ @@ -238,8 +234,6 @@ fix to bug-gdb@prep.ai.mit.edu. */ #define FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) -#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) - /* Define other aspects of the stack frame. */ /* A macro that tells us whether the function invocation represented diff --git a/gdb/xm-delta88.h b/gdb/xm-delta88.h index 306e447..f408c8b 100644 --- a/gdb/xm-delta88.h +++ b/gdb/xm-delta88.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc. +/* Host machine description for Motorola Delta 88 system, for GDB. + Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -16,10 +17,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* This is currently for a 88000 running DGUX. If other 88k ports are - done, OS-specific stuff should be moved (see tm-68k.h, for example). */ -/* g++ support is not yet included. */ - #define HOST_BYTE_ORDER BIG_ENDIAN #if !defined (USG) @@ -27,47 +24,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #endif #define MAXPATHLEN 1024 -/* delta 88 doesn't have bcopy(), etc. */ -#define USG_UTILS 1 #include <sys/param.h> #include <sys/time.h> -#define vfork() fork() -#define index strchr -#define rindex strrchr -#define getwd(BUF) getcwd(BUF,MAXPATHLEN); -#define bzero(ptr,count) (memset((ptr),0,(count))) -#define bcopy(src,dst,count) (memcpy((dst),(src),(count))) -#define bcmp(left,right,count) (memcmp((right),(left),(count))) -#if 0 -#ifdef __GNUC__ -#define memcpy __builtin_memcpy -/* gcc doesn't have this, at least not gcc 1.92. */ -/* #define memset __builtin_memset */ -#define strcmp __builtin_strcmp -#endif -#endif - #define HAVE_TERMIO - /*#define USIZE 2048*/ #define NBPG NBPC #define UPAGES USIZE -#define HAVE_GETPAGESIZE - /* Get rid of any system-imposed stack limit if possible. */ /*#define SET_STACK_LIMIT_HUGE*/ -/* number of traps that happen between exec'ing the shell - * to run an inferior, and when we finally get to - * the inferior code. This is 2 on most implementations. - */ -#define START_INFERIOR_TRAPS_EXPECTED 2 - /* This is the amount to subtract from u.u_ar0 to get the offset in the core file of the register values. */ @@ -80,46 +50,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = m88k_register_u_addr ((blockend),(regno)); -#define HAVE_WAIT_STRUCT - #define FETCH_INFERIOR_REGISTERS - -/* Interface definitions for kernel debugger KDB. */ - -/* Map machine fault codes into signal numbers. - First subtract 0, divide by 4, then index in a table. - Faults for which the entry in this table is 0 - are not handled by KDB; the program's own trap handler - gets to handle then. */ - -#define FAULT_CODE_ORIGIN 0 -#define FAULT_CODE_UNITS 4 -#define FAULT_TABLE \ -{ 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0} - -/* Start running with a stack stretching from BEG to END. - BEG and END should be symbols meaningful to the assembler. - This is used only for kdb. */ - -#define INIT_STACK(beg, end) {} - -/* Push the frame pointer register on the stack. */ -#define PUSH_FRAME_PTR {} - -/* Copy the top-of-stack to the frame pointer register. */ -#define POP_FRAME_PTR {} - -/* After KDB is entered by a fault, push all registers - that GDB thinks about (all NUM_REGS of them), - so that they appear in order of ascending GDB register number. - The fault code will be on the stack beyond the last register. */ - -#define PUSH_REGISTERS {} -/* Assuming the registers (including processor status) have been - pushed on the stack in order of ascending GDB register number, - restore them and return to the address in the saved PC register. */ +/* Address of end of stack space (in core files). */ -#define POP_REGISTERS {} +#define STACK_END_ADDR 0xF0000000 diff --git a/gdb/xm-m88k.h b/gdb/xm-m88k.h index bcfc23e..bad91f8 100644 --- a/gdb/xm-m88k.h +++ b/gdb/xm-m88k.h @@ -17,10 +17,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* This is currently for a 88000 running DGUX. If other 88k ports are - done, OS-specific stuff should be moved (see tm-68k.h, for example). */ -/* g++ support is not yet included. */ - #define HOST_BYTE_ORDER BIG_ENDIAN #if !defined (USG) @@ -51,18 +47,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define NBPG NBPC #define UPAGES USIZE -#define HAVE_GETPAGESIZE - /* Get rid of any system-imposed stack limit if possible. */ #define SET_STACK_LIMIT_HUGE -/* number of traps that happen between exec'ing the shell - * to run an inferior, and when we finally get to - * the inferior code. This is 2 on most implementations. - */ -#define START_INFERIOR_TRAPS_EXPECTED 2 - /* This is the amount to subtract from u.u_ar0 to get the offset in the core file of the register values. */ @@ -75,6 +63,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = m88k_register_u_addr ((blockend),(regno)); -#define HAVE_WAIT_STRUCT - #define FETCH_INFERIOR_REGISTERS |