From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14113 invoked by alias); 3 Jul 2003 00:27:37 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14104 invoked from network); 3 Jul 2003 00:27:31 -0000 Received: from unknown (HELO hydra.ubicom.com) (4.20.168.98) by sources.redhat.com with SMTP; 3 Jul 2003 00:27:31 -0000 Received: FROM fenway.scenix.com BY hydra.ubicom.com ; Wed Jul 02 17:25:30 2003 -0700 Received: from nkelseyxp (NKELSEY-XP [192.168.1.187]) by fenway.scenix.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id 31X7LV68; Wed, 2 Jul 2003 17:25:29 -0700 Message-ID: <003701c340f9$9badaa30$0a02a8c0@scenix.com> Reply-To: "Jafa" From: "Jafa" To: Subject: ignore helper no longer works? Date: Thu, 03 Jul 2003 00:27:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2003-07/txt/msg00054.txt.bz2 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=,id={stack=0x0,code= 0x0},func=} } { 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=,pc=0x201008e,id=,func= } } { 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=,id={stack=0x0,code= 0x0},func=} } { 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=,pc=0x20014ac,id=,func= } } { 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=,id={stack=0x0,code= 0x0},func=} } { 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=,pc=0x2011836,id=,func= } } { 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 () }