diff options
-rw-r--r-- | gdb/ChangeLog | 17 | ||||
-rw-r--r-- | gdb/config/m68k/tm-apollo68b.h | 2 | ||||
-rw-r--r-- | gdb/config/pa/tm-hppa.h | 54 | ||||
-rw-r--r-- | gdb/config/tm-sunos.h | 3 | ||||
-rw-r--r-- | gdb/config/tm-sysv4.h | 2 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 80 |
6 files changed, 134 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5cc5e89..6e9dcd3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +Thu Nov 24 00:39:27 1994 Jeff Law (law@snake.cs.utah.edu) + + * blockframe.c (find_pc_partial_function): Inhibit mst_trampoline + symbol special handling when INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK + is defined. + * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Renamed from + IN_SOLIB_TRAMPOLINE. All callers changed. + (IN_SOLIB_RETURN_TRAMPOLINE): Provide default definition. + (wait_for_inferior): Handle single stepping through trampolines on + return paths from shared libraries. + * config/pa/tm-hppa.h (IN_SOLIB_CALL_TRAMPOLINE): Use + in_solib_call_trampoline. + (IN_SOLIB_RETURN_TRAMPOLINE): Use in_solib_return_trampoline. + (INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK): Define. + * hppa-tdep.c (in_solib_call_trampoline): New function. + (in_solib_return_trampoline): New function. + Wed Nov 23 21:43:03 1994 Steve Chamberlain (sac@jonny.cygnus.com) * tm-h8300.h (REMOTE_BREAKPOINT): Define. diff --git a/gdb/config/m68k/tm-apollo68b.h b/gdb/config/m68k/tm-apollo68b.h index 0e33df6..720f980 100644 --- a/gdb/config/m68k/tm-apollo68b.h +++ b/gdb/config/m68k/tm-apollo68b.h @@ -56,4 +56,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* How to decide if we're in a shared library function. (Probably a wrong definintion inherited from the VxWorks config file). */ -#define IN_SOLIB_TRAMPOLINE(pc, name) (name && strcmp(name, "<end_of_program>") == 0) +#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (name && strcmp(name, "<end_of_program>") == 0) diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 20fc438..f88462b 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -56,9 +56,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -/* skip (stw rp, -20(0,sp)); copy 4,1; copy sp, 4; stwm 1,framesize(sp) - for gcc, or (stw rp, -20(0,sp); stwm 1, framesize(sp) for hcc */ - #define SKIP_PROLOGUE(pc) pc = skip_prologue (pc) /* If PC is in some function-call trampoline code, return the PC @@ -66,9 +63,26 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, NULL) -/* Return non-zero if we are in some sort of a trampoline. */ +/* Return non-zero if we are in an appropriate trampoline. */ + +#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ + in_solib_call_trampoline (pc, name) + +#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \ + in_solib_return_trampoline (pc, name) + +/* For some stupid reason find_pc_partial_function wants to treat + trampoline symbols differently. + + In a nutshell, find_pc_partial_fucntion sets the low address for + the function to the PC value that was passed in if the PC value + passed in is a mst_trampoline symbol. -#define IN_SOLIB_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name) + This causes wait_for_inferior to execute code for stepping over + or around a function (stop_pc == stop_func_start). This is + extremely bad when we're stepping through a return from a shared + library back to user code (which on the PA uses trampolines). */ +#define INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK /* Immediately after a function call, return the saved pc. Can't go through the frames for this because on some machines @@ -82,15 +96,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define INNER_THAN > - /* Sequence of bytes for breakpoint instruction. */ -/*#define BREAKPOINT {0x00, 0x00, 0x00, 0x00}*/ -#ifdef KERNELDEBUG /* XXX */ -#define BREAKPOINT {0x00, 0x00, 0xa0, 0x00} -#else #define BREAKPOINT {0x00, 0x01, 0x00, 0x04} -#endif /* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT @@ -104,10 +112,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 4) | 0x2) == 0xE840C002) -/* Return 1 if P points to an invalid floating point value. */ - -#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */ - /* Say how long (ordinary) registers are. This is a piece of bogosity used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ @@ -124,7 +128,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define REGISTER_NAMES \ {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \ "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", \ - "r20", "r21", "r22", "arg3", "arg2", "arg1", "arg0", "dp", "ret0", "ret1", \ + "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1", \ "sp", "r31", "sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", \ "eiem", "iir", "isr", "ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", \ "sr3", "sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", "cr13", \ @@ -189,7 +193,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ -#define REGISTER_BYTES (NUM_REGS * REGISTER_RAW_SIZE (1)) +#define REGISTER_BYTES (NUM_REGS * 4) /* Index within `registers' of the first byte of the space for register N. */ @@ -512,8 +516,16 @@ struct obj_unwind_info { #define OBJ_UNWIND_INFO(obj) ((struct obj_unwind_info *)obj->obj_private) -extern CORE_ADDR target_read_pc PARAMS ((void)); -extern void target_write_pc PARAMS ((CORE_ADDR)); +extern CORE_ADDR target_read_pc PARAMS ((int)); +extern void target_write_pc PARAMS ((CORE_ADDR, int)); + +#define TARGET_READ_PC(pid) target_read_pc (pid) +#define TARGET_WRITE_PC(v,pid) target_write_pc (v,pid) + +/* start-sanitize-hpread */ +/* For a number of horrible reasons we may have to adjust the location + of variables on the stack. Ugh. */ +#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR) +/* end-sanitize-hpread */ -#define TARGET_READ_PC() target_read_pc () -#define TARGET_WRITE_PC(v) target_write_pc (v) +extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR)); diff --git a/gdb/config/tm-sunos.h b/gdb/config/tm-sunos.h index 1a1ee10..a747ffd 100644 --- a/gdb/config/tm-sunos.h +++ b/gdb/config/tm-sunos.h @@ -22,7 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Return non-zero if we are in a shared library trampoline code stub. */ -#define IN_SOLIB_TRAMPOLINE(pc, name) lookup_solib_trampoline_symbol_by_pc (pc) +#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ + lookup_solib_trampoline_symbol_by_pc (pc) /* If PC is in a shared library trampoline code, return the PC where the function itself actually starts. If not, return 0. */ diff --git a/gdb/config/tm-sysv4.h b/gdb/config/tm-sysv4.h index 58ae568..dcb6935 100644 --- a/gdb/config/tm-sysv4.h +++ b/gdb/config/tm-sysv4.h @@ -26,7 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ we cannot always find the shared library trampoline symbols (e.g. on Irix5). */ -#define IN_SOLIB_TRAMPOLINE(pc, name) in_plt_section((pc), (name)) +#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name)) extern int in_plt_section PARAMS ((CORE_ADDR, char *)); /* If PC is in a shared library trampoline code, return the PC diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 83772c6..a3f6994 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1574,6 +1574,86 @@ pa_print_fp_reg (i) } } +/* Return one if PC is in the call path of a shared library trampoline, else + return zero. */ + +in_solib_call_trampoline (pc, name) + CORE_ADDR pc; + char *name; +{ + struct minimal_symbol *minsym; + struct unwind_table_entry *u; + + /* Get the unwind descriptor corresponding to PC, return zero + if no unwind was found. */ + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* If this isn't a linker stub, then return now. */ + if (u->stub_type != IMPORT + && u->stub_type != EXPORT) + return 0; + + /* The call and return path execute the same instructions within + an IMPORT stub! So an IMPORT stub is both a call and return + trampoline. */ + if (u->stub_type == IMPORT) + return 1; + + /* The linker may group many EXPORT stubs into one unwind entry. So + lookup the minimal symbol and use that as the beginning of this + particular stub. */ + minsym = lookup_minimal_symbol_by_pc (pc); + if (minsym == NULL) + return 0; + + /* Export stubs have distinct call and return paths. The first + two instructions are the call path, following four are the + return path. */ + return (pc >= SYMBOL_VALUE (minsym) && pc < SYMBOL_VALUE (minsym) + 8); +} + +/* Return one if PC is in the return path of a shared library trampoline, + else return zero. */ + +in_solib_return_trampoline (pc, name) + CORE_ADDR pc; + char *name; +{ + struct minimal_symbol *minsym; + struct unwind_table_entry *u; + + /* Get the unwind descriptor corresponding to PC, return zero + if no unwind was found. */ + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* If this isn't a linker stub, then return now. */ + if (u->stub_type != IMPORT + && u->stub_type != EXPORT) + return 0; + + /* The call and return path execute the same instructions within + an IMPORT stub! So an IMPORT stub is both a call and return + trampoline. */ + if (u->stub_type == IMPORT) + return 1; + + /* The linker may group many EXPORT stubs into one unwind entry. So + lookup the minimal symbol and use that as the beginning of this + particular stub. */ + minsym = lookup_minimal_symbol_by_pc (pc); + if (minsym == NULL) + return 0; + + /* Export stubs have distinct call and return paths. The first + two instructions are the call path, following four are the + return path. */ + return (pc >= SYMBOL_VALUE (minsym) + 8 && pc < SYMBOL_VALUE (minsym) + 20); +} + /* Figure out if PC is in a trampoline, and if so find out where the trampoline will jump to. If not in a trampoline, return zero. |