* [patch/rfc] Fix inside entry func call
@ 2004-02-03 4:06 Andrew Cagney
2004-02-03 17:25 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2004-02-03 4:06 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 418 bytes --]
Hello,
This, cleans up one part of a long dangling thread. Per:
http://sources.redhat.com/ml/gdb-patches/2003-11/msg00462.html
This modifies the unwind code so that it uses the test:
+ && get_frame_func (this_frame) == entry_point_address ()
that that in place, the old inside_entry_func can be made static to
blockframe.c. This should reduce Kevin's patch to just doco + frame.c
tweaks.
comments?
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 4186 bytes --]
2004-02-02 Andrew Cagney <cagney@redhat.com>
* objfiles.h: Delete comments refering to inside_entry_func and
DEPRECATED_FRAME_CHAIN_VALID.
* defs.h (inside_entry_func): Delete declaration.
* blockframe.c (inside_entry_func): Make static.
* frame.c: Include "symfile.h"
(get_prev_frame): Instead of inside_entry_func, call
get_frame_func and entry_point_address.
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.86
diff -u -r1.86 blockframe.c
--- blockframe.c 15 Jan 2004 20:00:17 -0000 1.86
+++ blockframe.c 3 Feb 2004 03:56:48 -0000
@@ -159,7 +159,7 @@
/* Test whether PC is inside the range of addresses that corresponds
to the process entry point function. */
-int
+static int
inside_entry_func (CORE_ADDR pc)
{
if (symfile_objfile == 0)
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.139
diff -u -r1.139 defs.h
--- defs.h 2 Feb 2004 16:07:26 -0000 1.139
+++ defs.h 3 Feb 2004 03:56:54 -0000
@@ -327,8 +327,6 @@
/* From blockframe.c */
-extern int inside_entry_func (CORE_ADDR);
-
extern int deprecated_inside_entry_file (CORE_ADDR addr);
extern int inside_main_func (CORE_ADDR pc);
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.155
diff -u -r1.155 frame.c
--- frame.c 11 Jan 2004 16:52:16 -0000 1.155
+++ frame.c 3 Feb 2004 03:57:19 -0000
@@ -39,6 +39,7 @@
#include "frame-base.h"
#include "command.h"
#include "gdbcmd.h"
+#include "symfile.h"
/* We keep a cache of stack frames, each of which is a "struct
frame_info". The innermost one gets allocated (in
@@ -1821,9 +1822,8 @@
checking for "main" in the minimal symbols. With that fixed
asm-source tests now stop in "main" instead of halting the
backtrace in wierd and wonderful ways somewhere inside the entry
- file. Suspect that deprecated_inside_entry_file and
- inside_entry_func tests were added to work around that (now
- fixed) case. */
+ file. Suspect that deprecated_inside_entry_file test was added
+ to work around that (now fixed) case. */
/* NOTE: cagney/2003-07-15: danielj (if I'm reading it right)
suggested having the inside_entry_func test use the
inside_main_func msymbol trick (along with entry_point_address I
@@ -1833,12 +1833,14 @@
/* NOTE: cagney/2003-07-15: Need to add a "set backtrace
beyond-entry-func" command so that this can be selectively
disabled. */
+ /* NOTE: cagney/2004-02-02: Replaced call to inside_entry_func with
+ more direct check that the frame's function is the entry-point. */
if (0
#if 0
&& backtrace_beyond_entry_func
#endif
&& this_frame->type != DUMMY_FRAME && this_frame->level >= 0
- && inside_entry_func (get_frame_pc (this_frame)))
+ && get_frame_func (this_frame) == entry_point_address ())
{
if (frame_debug)
{
Index: objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.29
diff -u -r1.29 objfiles.h
--- objfiles.h 19 Jan 2004 19:56:02 -0000 1.29
+++ objfiles.h 3 Feb 2004 03:57:28 -0000
@@ -98,18 +98,7 @@
use the block at main, or can't find it for some reason, everything
still works as before. And if we have no startup code debugging
information but we do have usable information for main(), backtraces
- from user code don't go wandering off into the startup code.
-
- To use this method, define your DEPRECATED_FRAME_CHAIN_VALID macro
- like:
-
- #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 \
- && !(inside_main_func ((thisframe)->pc)) \
- && !(inside_entry_func ((thisframe)->pc)))
-
- and add initializations of the four scope controlling variables inside
- the object file / debugging information processing modules. */
+ from user code don't go wandering off into the startup code. */
struct entry_info
{
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch/rfc] Fix inside entry func call
2004-02-03 4:06 [patch/rfc] Fix inside entry func call Andrew Cagney
@ 2004-02-03 17:25 ` Daniel Jacobowitz
2004-02-03 22:19 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-03 17:25 UTC (permalink / raw)
To: gdb-patches
On Mon, Feb 02, 2004 at 11:06:15PM -0500, Andrew Cagney wrote:
> Hello,
>
> This, cleans up one part of a long dangling thread. Per:
> http://sources.redhat.com/ml/gdb-patches/2003-11/msg00462.html
> This modifies the unwind code so that it uses the test:
>
> + && get_frame_func (this_frame) == entry_point_address ()
>
> that that in place, the old inside_entry_func can be made static to
> blockframe.c. This should reduce Kevin's patch to just doco + frame.c
> tweaks.
>
> comments?
Please re-read that discussion. Particularly:
http://sources.redhat.com/ml/gdb-patches/2003-11/msg00459.html
in which I asked you to leave the call to inside_entry_func and change
its implementation. You asked for other legitimate uses of this
function, and I gave you some.
> (get_prev_frame): Instead of inside_entry_func, call
> get_frame_func and entry_point_address.
I still object to this change.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch/rfc] Fix inside entry func call
2004-02-03 17:25 ` Daniel Jacobowitz
@ 2004-02-03 22:19 ` Andrew Cagney
2004-02-04 15:40 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2004-02-03 22:19 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> On Mon, Feb 02, 2004 at 11:06:15PM -0500, Andrew Cagney wrote:
>
>> Hello,
>>
>> This, cleans up one part of a long dangling thread. Per:
>> http://sources.redhat.com/ml/gdb-patches/2003-11/msg00462.html
>> This modifies the unwind code so that it uses the test:
>>
>> + && get_frame_func (this_frame) == entry_point_address ()
>>
>> that that in place, the old inside_entry_func can be made static to
>> blockframe.c. This should reduce Kevin's patch to just doco + frame.c
>> tweaks.
>>
>> comments?
>
>
> Please re-read that discussion. Particularly:
>
> http://sources.redhat.com/ml/gdb-patches/2003-11/msg00459.html
>
> in which I asked you to leave the call to inside_entry_func and change
> its implementation. You asked for other legitimate uses of this
> function, and I gave you some.
Sorry, I'm lost. Right now, even without this patch, there is only one
call path to that function:
get_prev_frame
legacy_get_prev_frame
legacy_frame_chain_valid
inside_entry_func
It is there to prop up legacy code. Given this, I even considered
deleting it (or folding it into legacy_frame_chain_valid).
Do you want me to add a new separate static frame.c:inside_entry_func?
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch/rfc] Fix inside entry func call
2004-02-03 22:19 ` Andrew Cagney
@ 2004-02-04 15:40 ` Daniel Jacobowitz
2004-02-04 16:30 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-04 15:40 UTC (permalink / raw)
To: gdb-patches
On Tue, Feb 03, 2004 at 05:19:06PM -0500, Andrew Cagney wrote: It is
> there to prop up legacy code. Given this, I even considered deleting
> it (or folding it into legacy_frame_chain_valid).
>
> Do you want me to add a new separate static frame.c:inside_entry_func?
I apologize for my continued obtuseness. How would you feel about the
below patch instead?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-02 Andrew Cagney <cagney@redhat.com>
Daniel Jacobowitz <drow@mvista.com>
* objfiles.h: Delete comments refering to inside_entry_func and
DEPRECATED_FRAME_CHAIN_VALID.
* defs.h (inside_entry_func): Update prototype..
* blockframe.c (inside_entry_func): Rename to
legacy_inside_entry_func. Add new inside_entry_func taking a frame.
* frame.c (get_prev_frame): Pass the frame to inside_entry_func.
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.86
diff -u -p -r1.86 blockframe.c
--- blockframe.c 15 Jan 2004 20:00:17 -0000 1.86
+++ blockframe.c 4 Feb 2004 15:39:25 -0000
@@ -156,11 +156,18 @@ inside_main_func (CORE_ADDR pc)
&& symfile_objfile->ei.main_func_highpc > pc);
}
-/* Test whether PC is inside the range of addresses that corresponds
- to the process entry point function. */
+/* Test whether THIS_FRAME is inside the process entry point function. */
int
-inside_entry_func (CORE_ADDR pc)
+inside_entry_func (struct frame_info *this_frame)
+{
+ return (get_frame_func (this_frame) == entry_point_address ());
+}
+
+/* Similar to inside_entry_func, but accomodating legacy frame code. */
+
+static int
+legacy_inside_entry_func (CORE_ADDR pc)
{
if (symfile_objfile == 0)
return 0;
@@ -604,7 +611,7 @@ legacy_frame_chain_valid (CORE_ADDR fp,
/* If we're already inside the entry function for the main objfile, then it
isn't valid. */
- if (inside_entry_func (get_frame_pc (fi)))
+ if (legacy_inside_entry_func (get_frame_pc (fi)))
return 0;
/* If we're inside the entry file, it isn't valid. */
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.139
diff -u -p -r1.139 defs.h
--- defs.h 2 Feb 2004 16:07:26 -0000 1.139
+++ defs.h 4 Feb 2004 15:39:25 -0000
@@ -324,10 +324,11 @@ struct cleanup
struct symtab;
struct breakpoint;
+struct frame_info;
/* From blockframe.c */
-extern int inside_entry_func (CORE_ADDR);
+extern int inside_entry_func (struct frame_info *this_frame);
extern int deprecated_inside_entry_file (CORE_ADDR addr);
@@ -655,8 +656,6 @@ enum lval_type
lval_register or lval_memory). */
lval_reg_frame_relative
};
-
-struct frame_info;
/* Control types for commands */
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.155
diff -u -p -r1.155 frame.c
--- frame.c 11 Jan 2004 16:52:16 -0000 1.155
+++ frame.c 4 Feb 2004 15:39:26 -0000
@@ -1838,7 +1838,7 @@ get_prev_frame (struct frame_info *this_
&& backtrace_beyond_entry_func
#endif
&& this_frame->type != DUMMY_FRAME && this_frame->level >= 0
- && inside_entry_func (get_frame_pc (this_frame)))
+ && inside_entry_func (this_frame))
{
if (frame_debug)
{
Index: objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.29
diff -u -p -r1.29 objfiles.h
--- objfiles.h 19 Jan 2004 19:56:02 -0000 1.29
+++ objfiles.h 4 Feb 2004 15:39:26 -0000
@@ -98,18 +98,7 @@ struct objfile_data;
use the block at main, or can't find it for some reason, everything
still works as before. And if we have no startup code debugging
information but we do have usable information for main(), backtraces
- from user code don't go wandering off into the startup code.
-
- To use this method, define your DEPRECATED_FRAME_CHAIN_VALID macro
- like:
-
- #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 \
- && !(inside_main_func ((thisframe)->pc)) \
- && !(inside_entry_func ((thisframe)->pc)))
-
- and add initializations of the four scope controlling variables inside
- the object file / debugging information processing modules. */
+ from user code don't go wandering off into the startup code. */
struct entry_info
{
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch/rfc] Fix inside entry func call
2004-02-04 15:40 ` Daniel Jacobowitz
@ 2004-02-04 16:30 ` Andrew Cagney
2004-02-04 16:43 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2004-02-04 16:30 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> 2004-02-02 Andrew Cagney <cagney@redhat.com>
> Daniel Jacobowitz <drow@mvista.com>
>
> * objfiles.h: Delete comments refering to inside_entry_func and
> DEPRECATED_FRAME_CHAIN_VALID.
> * defs.h (inside_entry_func): Update prototype..
> * blockframe.c (inside_entry_func): Rename to
> legacy_inside_entry_func. Add new inside_entry_func taking a frame.
> * frame.c (get_prev_frame): Pass the frame to inside_entry_func.
Whatever.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch/rfc] Fix inside entry func call
2004-02-04 16:30 ` Andrew Cagney
@ 2004-02-04 16:43 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-04 16:43 UTC (permalink / raw)
To: gdb-patches
On Wed, Feb 04, 2004 at 11:30:03AM -0500, Andrew Cagney wrote:
> >2004-02-02 Andrew Cagney <cagney@redhat.com>
> > Daniel Jacobowitz <drow@mvista.com>
> >
> > * objfiles.h: Delete comments refering to inside_entry_func and
> > DEPRECATED_FRAME_CHAIN_VALID.
> > * defs.h (inside_entry_func): Update prototype..
> > * blockframe.c (inside_entry_func): Rename to
> > legacy_inside_entry_func. Add new inside_entry_func taking a frame.
> > * frame.c (get_prev_frame): Pass the frame to inside_entry_func.
>
> Whatever.
Checked in.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-02-04 16:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-03 4:06 [patch/rfc] Fix inside entry func call Andrew Cagney
2004-02-03 17:25 ` Daniel Jacobowitz
2004-02-03 22:19 ` Andrew Cagney
2004-02-04 15:40 ` Daniel Jacobowitz
2004-02-04 16:30 ` Andrew Cagney
2004-02-04 16:43 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox