This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] inside_entry_func() related changes
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 4 Feb 2004 11:47:34 -0500
- Subject: Re: [RFA] inside_entry_func() related changes
- References: <1031122000931.ZM22440@localhost.localdomain>
On Fri, Nov 21, 2003 at 05:09:32PM -0700, Kevin Buettner wrote:
> This patch changes the implementation of inside_entry_func() so that
> the entry_func_{low,high}pc fields are not used.
>
> It also enables the inside_entry_func() test within frame.c because
> I need this to work for FR-V. (Note that a previous patch removed
> the inside_entry_func() call from frv-tdep.c.)
Revisiting this patch too. I've added documentation and removed the
now-unneeded change to inside_entry_func; does anyone disagree with
this patch? Docs OK?
A testcase would indeed be nice. Damned if I know how to write one,
though.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-04 Kevin Buettner <kevinb@redhat.com>
* frame.c (backtrace_past_entry_func): New static global.
(get_prev_frame): Enable inside_entry_func() test. Use
``backtrace_past_entry_func'' to allow more frames to be
seen.
(_initialize_frame): Define new commands "set/show backtrace
past-entry-func".
2004-02-04 Daniel Jacobowitz <drow@mvista.com>
* gdb.texinfo (Backtraces): Document "set backtrace past-entry-func".
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.156
diff -u -p -r1.156 frame.c
--- frame.c 4 Feb 2004 16:34:51 -0000 1.156
+++ frame.c 4 Feb 2004 16:43:04 -0000
@@ -134,6 +134,7 @@ static int frame_debug;
/* Flag to indicate whether backtraces should stop at main et.al. */
static int backtrace_past_main;
+static int backtrace_past_entry_func;
static unsigned int backtrace_limit = UINT_MAX;
@@ -1815,8 +1816,6 @@ get_prev_frame (struct frame_info *this_
dummy frame PC's typically land in the entry func. Don't apply
this test to the sentinel frame. Sentinel frames should always
be allowed to unwind. */
- /* NOTE: cagney/2003-02-25: Don't enable until someone has found
- hard evidence that this is needed. */
/* NOTE: cagney/2003-07-07: Fixed a bug in inside_main_func - wasn't
checking for "main" in the minimal symbols. With that fixed
asm-source tests now stop in "main" instead of halting the
@@ -1830,13 +1829,11 @@ get_prev_frame (struct frame_info *this_
guess) to determine the address range of the start function.
That should provide a far better stopper than the current
heuristics. */
- /* NOTE: cagney/2003-07-15: Need to add a "set backtrace
- beyond-entry-func" command so that this can be selectively
- disabled. */
- if (0
-#if 0
- && backtrace_beyond_entry_func
-#endif
+ /* NOTE: kevinb/2003-11-21: The implementation of inside_entry_func()
+ has been revised. Testing against the FR-V simulator shows that
+ a backtrace is correctly terminated once the start() frame has been
+ hit. */
+ if (!backtrace_past_entry_func
&& this_frame->type != DUMMY_FRAME && this_frame->level >= 0
&& inside_entry_func (this_frame))
{
@@ -2330,6 +2327,19 @@ Show whether backtraces should continue
Normally the caller of \"main\" is not of interest, so GDB will terminate\n\
the backtrace at \"main\". Set this variable if you need to see the rest\n\
of the stack trace.",
+ NULL, NULL, &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
+
+ add_setshow_boolean_cmd ("past-entry-func", class_obscure,
+ &backtrace_past_entry_func, "\
+Set whether backtraces should continue past the entry function\n\
+Normally, any frames that exist beyond the entry function are of\n\
+little interest. Set this variable if you need to see the rest of the stack\n\
+trace\n", "\
+Show whether backtraces should continue past the entry function\n\
+Normally, any frames that exist beyond the entry function are of\n\
+little interest. Set this variable if you need to see the rest of the stack\n\
+trace\n",
NULL, NULL, &set_backtrace_cmdlist,
&show_backtrace_cmdlist);
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.191
diff -u -p -r1.191 gdb.texinfo
--- doc/gdb.texinfo 2 Feb 2004 21:07:53 -0000 1.191
+++ doc/gdb.texinfo 4 Feb 2004 16:43:07 -0000
@@ -4050,6 +4050,8 @@ code for line @code{993} of @code{builti
@kindex set backtrace past-main
@kindex show backtrace past-main
+@kindex set backtrace past-entry-func
+@kindex show backtrace past-entry-func
@kindex set backtrace limit
@kindex show backtrace limit
@@ -4073,6 +4075,18 @@ default.
@item show backtrace past-main
Display the current user entry point backtrace policy.
+
+@table @code
+@item set backtrace past-entry-func
+@itemx set backtrace past-entry-func on
+Backtraces will continue past the system-specific process entry point.
+
+@item set backtrace past-entry-func off
+Backtraces will stop when they encounter the system-specific process entry
+point. This is the default.
+
+@item show backtrace past-entry-func
+Display the current system-specific process entry point backtrace policy.
@item set backtrace limit @var{n}
@itemx set backtrace limit 0