This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
ignore helper no longer works?
- From: "Jafa" <jafa at silicondust dot com>
- To: <gdb at sources dot redhat dot com>
- Date: Wed, 2 Jul 2003 17:25:29 -0700
- Subject: ignore helper no longer works?
- Reply-to: "Jafa" <jafa at silicondust dot com>
Hi guys,
I now have the ip2k frame handling code working using the new scheme
including giving valid results in any position within the prologue. Stack
backtraces and finish both work reliably.
Gcc for the ip2k has a habit of using a lot of stub functions - typically
3-4 instruction sequences which are just snippits of code with a return
instruction (not valid functions).
>From the user's point-of-view, if they click step-into they want to step
into the c-level function - not an invisible stub that happens to have been
inserted by gcc to set up the parameters to that function.
The solution has been to register a IGNORE_HELPER_CALL function that tells
gdb that it has just stepped into a helper/stub and to treat it as an
extension of the current function (ie just keep stepping).
The problem is that gcc also tends to use a stub for the epilogue of
functions (jump to a stub that cleans up the stack and returns).
With the old frame handling system this worked fine - gdb just kept stepping
through the epilogue stub.
With the new system it fails... it asks for the frame information of the
epilogue stub (which is not a function). There are a large number of stubs
and it would pose quite a problem to attempt to get gdb understand them all
(not to mention keeping up with our gcc guy thinking up new stubs).
I am fully open to ideas :-)
BTW - MIPS will have the same problem as it uses epilogue stubs as well.
Thanks
Nick
Trace of 'next' at the end of a function leading into an epilogue stub...
(gdb) n
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff3] }
{ flush_cached_frames () }
{ create_sentinel_frame (...) ->
{level=-1,type=NORMAL_FRAME,unwind=0x4dd1d4,pc=<unknown>,id={stack=0x0,code=
0x0},func=<unknown>} }
{ get_prev_frame (this_frame=-1) { frame_register_unwind
(frame=-1,regnum="pc",...) -> *optimizedp=0 *lvalp=2 *addrp=0x100
*bufferp=[8047] }
{ frame_pc_unwind (this_frame=-1) -> 0x201008e }
->
{level=0,type=UNKNOWN_FRAME,unwind=<unknown>,pc=0x201008e,id=<unknown>,func=
<unknown>} }
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff3] }
{ flush_cached_frames () }
{ create_sentinel_frame (...) ->
{level=-1,type=NORMAL_FRAME,unwind=0x4dd1d4,pc=<unknown>,id={stack=0x0,code=
0x0},func=<unknown>} }
{ get_prev_frame (this_frame=-1) { frame_register_unwind
(frame=-1,regnum="pc",...) -> *optimizedp=0 *lvalp=2 *addrp=0x100
*bufferp=[0a56] }
{ frame_pc_unwind (this_frame=-1) -> 0x20014ac }
->
{level=0,type=UNKNOWN_FRAME,unwind=<unknown>,pc=0x20014ac,id=<unknown>,func=
<unknown>} }
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff3] }
{ frame_register_unwind (frame=0,regnum="pc",...) ip2k_frame_unwind_cache:
{ frame_func_unwind (fi=-1) -> 0x20014ac }
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff3] }
entry_pc = 0x020014ac
current_pc = 0x020014ac
return_pc = 0x02011836
entry_sp = 0x01000ff3
normal_sp = 0x01000ff3
current_sp = 0x01000ff3
-> *optimizedp=0 *lvalp=0 *addrp=0x0 *bufferp=[8c1b] }
{ frame_pc_unwind (this_frame=0) -> 0x2011836 }
{ get_frame_id (fi=0) ip2k_frame_this_id
-> {stack=0x1000ff3,code=0x0} }
{ frame_id_p (l={stack=0x1000ff5,code=0x0}) -> 1 }
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff3] }
{ flush_cached_frames () }
{ frame_id_p (l={stack=0x1000ff5,code=0x0}) -> 1 }
{ create_sentinel_frame (...) ->
{level=-1,type=NORMAL_FRAME,unwind=0x4dd1d4,pc=<unknown>,id={stack=0x0,code=
0x0},func=<unknown>} }
{ get_prev_frame (this_frame=-1) { frame_register_unwind
(frame=-1,regnum="pc",...) -> *optimizedp=0 *lvalp=2 *addrp=0x100
*bufferp=[8c1b] }
{ frame_pc_unwind (this_frame=-1) -> 0x2011836 }
->
{level=0,type=UNKNOWN_FRAME,unwind=<unknown>,pc=0x2011836,id=<unknown>,func=
<unknown>} }
{ get_frame_id (fi=0) ip2k_frame_this_id
ip2k_frame_unwind_cache:
{ frame_func_unwind (fi=-1) -> 0x2011804 }
{ frame_register_unwind (frame=-1,regnum="sp",...) -> *optimizedp=0 *lvalp=2
*addrp=0x102 *bufferp=[0ff5] }
correction of 8 applied
entry_pc = 0x02011804
current_pc = 0x02011836
return_pc = 0x020114b0
entry_sp = 0x01000fff
normal_sp = 0x01000ffd
current_sp = 0x01000ff5
-> {stack=0x1000fff,code=0x0} }
{ frame_id_eq (l={stack=0x1000ff5,code=0x0},r={stack=0x1000fff,code=0x0}) ->
0 }
{ flush_cached_frames () }