From: Jeff Law Date: Wed, 6 Apr 1994 00:51:50 +0000 (+0000) Subject: * hppa-tdep.c (frameless_function_invocation): If no unwind X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f43b9b70dc94baa6737737c2342b12eff1d7eaf;p=binutils-gdb.git * hppa-tdep.c (frameless_function_invocation): If no unwind descriptor was found, then assume this was not a frameless function invocation. (frame_saved_pc): If the saved PC is in a linker stub, then return the return address which the linker stub will return to. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 22c8622a460..310a1d2ee59 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ Tue Apr 5 15:29:25 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + * hppa-tdep.c (frameless_function_invocation): If no unwind + descriptor was found, then assume this was not a frameless + function invocation. + (frame_saved_pc): If the saved PC is in a linker stub, then + return the return address which the linker stub will return to. + * xm-hppab.h: Never define USG. * xm-hppah.h: Always define USG. diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 9ec6a90f0c4..7729fdfd420 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -485,7 +485,7 @@ frameless_function_invocation (frame) u = find_unwind_entry (frame->pc); if (u == 0) - return frameless_look_for_prologue (frame); + return 0; return (u->Total_frame_size == 0 && u->stub_type == 0); } @@ -506,6 +506,7 @@ frame_saved_pc (frame) FRAME frame; { CORE_ADDR pc = get_frame_pc (frame); + struct unwind_table_entry *u; /* BSD, HPUX & OSF1 all lay out the hardware state in the same manner at the base of the frame in an interrupt handler. Registers within @@ -522,6 +523,7 @@ frame_saved_pc (frame) return rp; } +restart: if (frameless_function_invocation (frame)) { int ret_regnum; @@ -542,12 +544,12 @@ frame_saved_pc (frame) fi = get_frame_info (frame->next); get_frame_saved_regs (fi, &saved_regs); if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM] & 0x2, 4)) - return read_memory_integer (saved_regs.regs[31], 4); + pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3; else - return read_memory_integer (saved_regs.regs[RP_REGNUM], 4); + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; } else - return read_register (ret_regnum) & ~0x3; + pc = read_register (ret_regnum) & ~0x3; } else { @@ -567,15 +569,23 @@ frame_saved_pc (frame) fi = get_frame_info (frame->next); get_frame_saved_regs (fi, &saved_regs); if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM] & 0x2, 4)) - return read_memory_integer (saved_regs.regs[31], 4); + pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3; else - return read_memory_integer (saved_regs.regs[RP_REGNUM], 4); + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; } else if (rp_offset == 0) - return read_register (RP_REGNUM) & ~0x3; + pc = read_register (RP_REGNUM) & ~0x3; else - return read_memory_integer (frame->frame + rp_offset, 4) & ~0x3; + pc = read_memory_integer (frame->frame + rp_offset, 4) & ~0x3; } + + /* If PC is inside a linker stub, then dig out the address the stub + will return to. */ + u = find_unwind_entry (pc); + if (u && u->stub_type != 0) + goto restart; + + return pc; } /* We need to correct the PC and the FP for the outermost frame when we are