This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH/i386newframe] Remove call to inside_entry_file
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Cc: vinschen at redhat dot com
- Date: Thu, 29 May 2003 15:39:53 +0200 (CEST)
- Subject: [PATCH/i386newframe] Remove call to inside_entry_file
Folks,
Back in April there was a discussion about removing the call to
inside_entry_file() from i386_frame_chain(). The issue resurfaced in
my work on the i386newframe branch. In the meantime I did some more
research, and it seems that most OSes (Linux, *BSD) clear %ebp upon
executing a new program, and have been doing so for a very long time
(the BSD's have been doing this right from the start it seems). This
makes me pretty confident that in almost all "hosted" environments,
the outermost frame is correctly marked as such, which means that
inside_entry_file is completely redundant. For code running on "bare
metal" it can be argued that the code itself should mark the outermost
frame. Therefore I've decided to remove the call to
inside_entry_file. Anyway, since the default is to stop the backtrace
at main, this shouldn't make a difference at all. And if a target
surfaces that needs the call, we can always add it back for just that
target.
I had also introduced the inside_entry_file call on amd64. Here we
only support Linux, which does the right thing, so the call can
certainly be removed here.
Patch attached.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_frame_this_id): Remove inside_entry_file
check. The majority of i386 targets shouldn't need this, and it
hurts Cygwin.
* x86-64-tdep.c (x86_64_frame_this_id): Likewise.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.138.2.16
diff -u -p -r1.138.2.16 i386-tdep.c
--- i386-tdep.c 29 May 2003 10:35:38 -0000 1.138.2.16
+++ i386-tdep.c 29 May 2003 11:46:57 -0000
@@ -761,10 +761,6 @@ i386_frame_this_id (struct frame_info *n
if (cache->base == 0)
return;
- /* This is meant to halt the backtrace at "_start". */
- if (inside_entry_file (cache->pc))
- return;
-
(*this_id) = frame_id_build (cache->base + 8, cache->pc);
}
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.67.2.5
diff -u -p -r1.67.2.5 x86-64-tdep.c
--- x86-64-tdep.c 19 May 2003 16:58:19 -0000 1.67.2.5
+++ x86-64-tdep.c 29 May 2003 11:46:57 -0000
@@ -962,10 +962,6 @@ x86_64_frame_this_id (struct frame_info
if (cache->base == 0)
return;
- /* This is meant to halt the backtrace at "_start". */
- if (inside_entry_file (cache->pc))
- return;
-
(*this_id) = frame_id_build (cache->base + 16, cache->pc);
}