Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: Recognize bottom of stack on Linux
@ 2002-02-03 18:21 Jim Blandy
  2002-02-03 19:21 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jim Blandy @ 2002-02-03 18:21 UTC (permalink / raw)
  To: gdb-patches


Now, some folks feel that GDB should show the whole stack, including
_start, __libc_start_main, and anything else that's there.  However,
this isn't the way GDB has ever traditionally behaved on native
targets.  So this patch makes GDB's backtraces end after main.

2002-02-03  Jim Blandy  <jimb@redhat.com>

	* i386-linux-tdep.c (i386_linux_frame_chain): Stop the frame chain
	after `main', not just after the compilation unit containing the
	entry point.

Index: gdb/i386-linux-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/i386-linux-tdep.c,v
retrieving revision 2.7.10.1
diff -c -r2.7.10.1 i386-linux-tdep.c
*** gdb/i386-linux-tdep.c	2002/01/11 22:08:41	2.7.10.1
--- gdb/i386-linux-tdep.c	2002/02/04 02:19:28
***************
*** 352,358 ****
    if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame))
      return frame->frame;
  
!   if (! inside_entry_file (frame->pc))
      return read_memory_unsigned_integer (frame->frame, 4);
  
    return 0;
--- 352,364 ----
    if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame))
      return frame->frame;
  
!   /* On Linux, the entry point is called _start, but that invokes
!      something called __libc_start_main, which calls main.  So if we
!      want the stack to end at main (as it does for GDB's other
!      targets), the `PC in compilation unit containing entry point'
!      rule triggers too late to get us the right result.  */
!   if (! inside_entry_file (frame->pc)
!       && ! inside_main_func (frame->pc))
      return read_memory_unsigned_integer (frame->frame, 4);
  
    return 0;


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2002-03-31  5:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-03 18:21 RFA: Recognize bottom of stack on Linux Jim Blandy
2002-02-03 19:21 ` Daniel Jacobowitz
2002-02-03 23:00   ` Michael Snyder
2002-02-05 11:58   ` Jim Blandy
2002-02-05 13:57     ` Daniel Jacobowitz
2002-02-06 11:24       ` Jim Blandy
2002-02-06 16:09         ` Andrew Cagney
2002-03-30 21:56         ` Daniel Jacobowitz
2002-02-03 22:15 ` Eli Zaretskii
2002-02-04 11:02 ` Kevin Buettner
2002-02-04 17:32   ` Andrew Cagney
2002-02-04 17:42     ` Kevin Buettner
2002-02-04 17:44       ` Daniel Jacobowitz
2002-02-04 17:57         ` Michael Snyder
2002-02-04 18:55           ` Daniel Jacobowitz
2002-02-05 11:52         ` Jim Blandy
2002-02-06 16:02           ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox