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]

[patch, rfc] New frame location AT_SYMBOL, use with mips


Hello,

This adds the new call dummy breakpoint location AT_SYMBOL. It's addition lets the MIPS eliminate its custom call_dummy_location() method.

Long term, there should be a command for explicitly specifying the call dummy breakpoint location.

Comments. I'll look to commit it in a few days.

Andrew
2003-08-05  Andrew Cagney  <cagney@redhat.com>

	* inferior.h (AT_SYMBOL): Define.
	* blockframe.c (inside_entry_file): Check for AT_SYMBOL.
	* infcall.c (call_function_by_hand): Add code to handle AT_SYMBOL.
	* mips-tdep.c (mips_call_dummy_address): Delete function.
	(mips_gdbarch_init): Set call_dummy_location to AT_SYMBOL, do not
	set call_dummy_address.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.76
diff -u -r1.76 blockframe.c
--- blockframe.c	15 Jul 2003 17:23:31 -0000	1.76
+++ blockframe.c	6 Aug 2003 02:37:40 -0000
@@ -59,7 +59,8 @@
     return 1;
   if (symfile_objfile == 0)
     return 0;
-  if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+  if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+      || CALL_DUMMY_LOCATION == AT_SYMBOL)
     {
       /* Do not stop backtracing if the pc is in the call dummy
          at the entry point.  */
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.20
diff -u -r1.20 infcall.c
--- infcall.c	31 Jul 2003 23:41:25 -0000	1.20
+++ infcall.c	6 Aug 2003 02:37:41 -0000
@@ -547,6 +547,23 @@
          it's address is the same as the address of the dummy.  */
       bp_addr = dummy_addr;
       break;
+    case AT_SYMBOL:
+      /* Some executables define a symbol __CALL_DUMMY_ADDRESS whose
+	 address is the location where the breakpoint should be
+	 placed.  Once all targets are using the overhauled frame code
+	 this can be deleted - ON_STACK is a better option.  */
+      {
+	struct minimal_symbol *sym;
+
+	sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
+	real_pc = funaddr;
+	if (sym)
+	  dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+	else
+	  dummy_addr = entry_point_address ();
+	bp_addr = dummy_addr;
+	break;
+      }
     default:
       internal_error (__FILE__, __LINE__, "bad switch");
     }
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.58
diff -u -r1.58 inferior.h
--- inferior.h	7 Jun 2003 22:38:55 -0000	1.58
+++ inferior.h	6 Aug 2003 02:37:41 -0000
@@ -438,6 +438,7 @@
 /* Possible values for CALL_DUMMY_LOCATION.  */
 #define ON_STACK 1
 #define AT_ENTRY_POINT 4
+#define AT_SYMBOL 5
 
 /* FIXME: cagney/2000-04-17: gdbarch should manage this.  The default
    shouldn't be necessary. */
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.224
diff -u -r1.224 mips-tdep.c
--- mips-tdep.c	28 Jul 2003 15:31:08 -0000	1.224
+++ mips-tdep.c	6 Aug 2003 02:37:43 -0000
@@ -5540,25 +5540,6 @@
 }
 
 
-/* Return a location where we can set a breakpoint that will be hit
-   when an inferior function call returns.  This is normally the
-   program's entry point.  Executables that don't have an entry
-   point (e.g. programs in ROM) should define a symbol __CALL_DUMMY_ADDRESS
-   whose address is the location where the breakpoint should be placed.  */
-
-static CORE_ADDR
-mips_call_dummy_address (void)
-{
-  struct minimal_symbol *sym;
-
-  sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
-  if (sym)
-    return SYMBOL_VALUE_ADDRESS (sym);
-  else
-    return entry_point_address ();
-}
-
-
 /* When debugging a 64 MIPS target running a 32 bit ABI, the size of
    the register stored on the stack (32) is different to its real raw
    size (64).  The below ensures that registers are fetched from the
@@ -6113,7 +6094,10 @@
 
   /* MIPS version of CALL_DUMMY */
 
-  set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
+  /* NOTE: cagney/2003-08-05: Eventually call dummy location will be
+     replaced by a command, and all targets will default to on stack
+     (regardless of the stack's execute status).  */
+  set_gdbarch_call_dummy_location (gdbarch, AT_SYMBOL);
   set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
   set_gdbarch_frame_align (gdbarch, mips_frame_align);
   set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);

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