This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa:symtab] deprecate inside_entry_func


Hello,

This patch deprecates the function inside_entry_func. Per the new comments:

+  /* NOTE: cagney/2003-10-31: A very simple test, such as
+     get_frame_func == entry_point should be sufficient for
+     identifying a pc in the entry function.  Does anyone know why it
+     wasn't sufficient and hence, why the very convoluted
+     "deprecated_inside_entry_func" is needed.  */
+  /* NOTE: cagney/2003-10-31: An ABI and its crt0 code should define
+     and implement a clean frame termination.  Not doing that is
+     really a bug in the ABI/crt0, and, hence, not a reason for
+     enabling the call to deprecated_inside_entry_func.  */

It's "evil twin", inside_entry_file, has already been deprecated.

ok?

Andrew

PS: Ref: http://sources.redhat.com/ml/gdb-patches/2003-10/msg00533.html
2003-10-31  Andrew Cagney  <cagney@redhat.com>

	* objfiles.h (struct entry_info): Deprecate the fields
	"entry_func_lowpc", and "entry_func_lowpc".
	* symfile.c (init_entry_point_info): Update.
	* objfiles.c (objfile_relocate): Update.
	* dwarfread.c (read_func_scope): Update.
	* dwarf2read.c (read_func_scope): Update.
	* blockframe.c (deprecated_inside_entry_func): Update.

	* defs.h (deprecated_inside_entry_func): 
	"inside_entry_func".
	* frv-tdep.c (frv_frame_this_id): Update.
	* frame.c (get_prev_frame): Update.
	* blockframe.c (deprecated_inside_entry_func): Rename
	"inside_entry_func".
	(legacy_frame_chain_valid): Update.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.82
diff -u -r1.82 blockframe.c
--- blockframe.c	20 Oct 2003 14:38:42 -0000	1.82
+++ blockframe.c	31 Oct 2003 22:56:10 -0000
@@ -172,7 +172,7 @@
    A PC of zero is always considered to be the bottom of the stack. */
 
 int
-inside_entry_func (CORE_ADDR pc)
+deprecated_inside_entry_func (CORE_ADDR pc)
 {
   if (pc == 0)
     return 1;
@@ -186,8 +186,8 @@
       if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
 	return 0;
     }
-  return (symfile_objfile->ei.entry_func_lowpc <= pc &&
-	  symfile_objfile->ei.entry_func_highpc > pc);
+  return (symfile_objfile->ei.deprecated_entry_func_lowpc <= pc &&
+	  symfile_objfile->ei.deprecated_entry_func_highpc > pc);
 }
 
 /* Return nonzero if the function for this frame lacks a prologue.  Many
@@ -615,7 +615,7 @@
 
   /* 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 (deprecated_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.133
diff -u -r1.133 defs.h
--- defs.h	31 Oct 2003 19:19:51 -0000	1.133
+++ defs.h	31 Oct 2003 22:56:11 -0000
@@ -316,7 +316,7 @@
 
 /* From blockframe.c */
 
-extern int inside_entry_func (CORE_ADDR);
+extern int deprecated_inside_entry_func (CORE_ADDR);
 
 extern int deprecated_inside_entry_file (CORE_ADDR addr);
 
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.110
diff -u -r1.110 dwarf2read.c
--- dwarf2read.c	2 Oct 2003 17:13:16 -0000	1.110
+++ dwarf2read.c	31 Oct 2003 22:56:12 -0000
@@ -2174,8 +2174,8 @@
   if (objfile->ei.entry_point >= lowpc &&
       objfile->ei.entry_point < highpc)
     {
-      objfile->ei.entry_func_lowpc = lowpc;
-      objfile->ei.entry_func_highpc = highpc;
+      objfile->ei.deprecated_entry_func_lowpc = lowpc;
+      objfile->ei.deprecated_entry_func_highpc = highpc;
     }
 
   /* Decode DW_AT_frame_base location descriptor if present, keep result
Index: dwarfread.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarfread.c,v
retrieving revision 1.30
diff -u -r1.30 dwarfread.c
--- dwarfread.c	12 Sep 2003 18:40:16 -0000	1.30
+++ dwarfread.c	31 Oct 2003 22:56:12 -0000
@@ -1767,8 +1767,8 @@
   if (objfile->ei.entry_point >= dip->at_low_pc &&
       objfile->ei.entry_point < dip->at_high_pc)
     {
-      objfile->ei.entry_func_lowpc = dip->at_low_pc;
-      objfile->ei.entry_func_highpc = dip->at_high_pc;
+      objfile->ei.deprecated_entry_func_lowpc = dip->at_low_pc;
+      objfile->ei.deprecated_entry_func_highpc = dip->at_high_pc;
     }
   new = push_context (0, dip->at_low_pc);
   new->name = new_symbol (dip, objfile);
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.147
diff -u -r1.147 frame.c
--- frame.c	24 Oct 2003 17:37:03 -0000	1.147
+++ frame.c	31 Oct 2003 22:56:13 -0000
@@ -1820,10 +1820,10 @@
      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.  */
+     deprecated_inside_entry_func tests were 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
+     suggested having the deprecated_inside_entry_func test use the
      inside_main_func msymbol trick (along with entry_point_address I
      guess) to determine the address range of the start function.
      That should provide a far better stopper than the current
@@ -1831,12 +1831,21 @@
   /* NOTE: cagney/2003-07-15: Need to add a "set backtrace
      beyond-entry-func" command so that this can be selectively
      disabled.  */
+  /* NOTE: cagney/2003-10-31: A very simple test, such as
+     get_frame_func == entry_point should be sufficient for
+     identifying a pc in the entry function.  Does anyone know why it
+     wasn't sufficient and hence, why the very convoluted
+     "deprecated_inside_entry_func" is needed.  */
+  /* NOTE: cagney/2003-10-31: An ABI and its crt0 code should define
+     and implement a clean frame termination.  Not doing that is
+     really a bug in the ABI/crt0, and, hence, not a reason for
+     enabling the call to deprecated_inside_entry_func.  */
   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)))
+      && deprecated_inside_entry_func (get_frame_pc (this_frame)))
     {
       if (frame_debug)
 	{
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.57
diff -u -r1.57 frv-tdep.c
--- frv-tdep.c	27 Oct 2003 06:30:49 -0000	1.57
+++ frv-tdep.c	31 Oct 2003 22:56:13 -0000
@@ -996,7 +996,7 @@
 
   /* This is meant to halt the backtrace at "_start".  Make sure we
      don't halt it at a generic dummy frame. */
-  if (inside_entry_func (func))
+  if (deprecated_inside_entry_func (func))
     return;
 
   /* Check if the stack is empty.  */
Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.39
diff -u -r1.39 objfiles.c
--- objfiles.c	29 Oct 2003 18:29:07 -0000	1.39
+++ objfiles.c	31 Oct 2003 22:56:13 -0000
@@ -781,10 +781,10 @@
       }
   }
 
-  if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC)
+  if (objfile->ei.deprecated_entry_func_lowpc != INVALID_ENTRY_LOWPC)
     {
-      objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-      objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+      objfile->ei.deprecated_entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+      objfile->ei.deprecated_entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
     }
 
   if (objfile->ei.deprecated_entry_file_lowpc != INVALID_ENTRY_LOWPC)
Index: objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.27
diff -u -r1.27 objfiles.h
--- objfiles.h	29 Oct 2003 18:29:07 -0000	1.27
+++ objfiles.h	31 Oct 2003 22:56:13 -0000
@@ -106,7 +106,7 @@
    #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)     \
    (chain != 0                                   \
    && !(inside_main_func ((thisframe)->pc))     \
-   && !(inside_entry_func ((thisframe)->pc)))
+   && !(deprecated_inside_entry_func ((thisframe)->pc)))
 
    and add initializations of the four scope controlling variables inside
    the object file / debugging information processing modules.  */
@@ -125,8 +125,8 @@
     /* Start (inclusive) and end (exclusive) of function containing the
        entry point. */
 
-    CORE_ADDR entry_func_lowpc;
-    CORE_ADDR entry_func_highpc;
+    CORE_ADDR deprecated_entry_func_lowpc;
+    CORE_ADDR deprecated_entry_func_highpc;
 
     /* Start (inclusive) and end (exclusive) of object file containing the
        entry point. */
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.111
diff -u -r1.111 symfile.c
--- symfile.c	29 Oct 2003 18:29:07 -0000	1.111
+++ symfile.c	31 Oct 2003 22:56:14 -0000
@@ -329,8 +329,8 @@
     }
   objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC;
   objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC;
-  objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
-  objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
+  objfile->ei.deprecated_entry_func_lowpc = INVALID_ENTRY_LOWPC;
+  objfile->ei.deprecated_entry_func_highpc = INVALID_ENTRY_HIGHPC;
   objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
   objfile->ei.main_func_highpc = INVALID_ENTRY_HIGHPC;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]