* config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Down grade to
authorAndrew Cagney <cagney@redhat.com>
Sat, 24 Mar 2001 02:07:49 +0000 (02:07 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 24 Mar 2001 02:07:49 +0000 (02:07 +0000)
GDB_MULTI_ARCH_PARTIAL from two.  SOFTWARE_SINGLE_STEP is not
multi-arch.
* gdbarch.sh (SOFTWARE_SINGLE_STEP): Add.
* gdbarch.h, gdbarch.c: Re-generate.
* target.h (SOFTWARE_SINGLE_STEP_P)
(SOFTWARE_SINGLE_STEP): Delete macro definitions.

gdb/ChangeLog
gdb/config/sparc/tm-sp64.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/target.h

index 8ab4e59f1eff86c036c97c8ddc2054c145dce292..3dfb65e3d2754bddd24507a84c3f319bf6d49490 100644 (file)
@@ -1,3 +1,15 @@
+2001-03-23  Andrew Cagney  <ac131313@redhat.com>
+
+       * config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Down grade to
+       GDB_MULTI_ARCH_PARTIAL from two.  SOFTWARE_SINGLE_STEP is not
+       multi-arch.
+
+       * gdbarch.sh (SOFTWARE_SINGLE_STEP): Add.
+       * gdbarch.h, gdbarch.c: Re-generate.
+
+       * target.h (SOFTWARE_SINGLE_STEP_P)
+       (SOFTWARE_SINGLE_STEP): Delete macro definitions.
+
 2001-03-23  Andrew Cagney  <ac131313@redhat.com>
 
        * gdbarch.sh (gdbarch_register_read, gdbarch_register_write): Add.
index c5fc7df7df10c7eb2a6ac14688351681027b12e2..423b7ec264886d0b788a9e1c389b5095883f5ebb 100644 (file)
@@ -23,7 +23,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define GDB_MULTI_ARCH 2
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
 
 #ifndef GDB_TARGET_IS_SPARC64
 #define GDB_TARGET_IS_SPARC64 1
index 8145d99a755b604933c8012c593fb11005e8f66f..5735315c2fd7d900e9a143e5ed65881fdc98b928 100644 (file)
@@ -246,6 +246,7 @@ struct gdbarch
   const struct floatformat * double_format;
   const struct floatformat * long_double_format;
   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
+  gdbarch_software_single_step_ftype *software_single_step;
 };
 
 
@@ -378,6 +379,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   /* startup_gdbarch() */
 };
 
@@ -757,6 +759,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if (gdbarch->long_double_format == 0)
     gdbarch->long_double_format = &floatformat_unknown;
   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
+  /* Skip verify of software_single_step, has predicate */
 }
 
 
@@ -1432,6 +1435,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
                       XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
 #endif
+#if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
+                      XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
+#endif
 #ifdef TARGET_ARCHITECTURE
   if (TARGET_ARCHITECTURE != NULL)
     fprintf_unfiltered (file,
@@ -2149,6 +2159,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
                         (long) current_gdbarch->convert_from_func_ptr_addr
                         /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
+#endif
+#ifdef SOFTWARE_SINGLE_STEP
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
+                        (long) current_gdbarch->software_single_step
+                        /*SOFTWARE_SINGLE_STEP ()*/);
 #endif
   if (current_gdbarch->dump_tdep != NULL)
     current_gdbarch->dump_tdep (current_gdbarch, file);
@@ -4215,6 +4232,30 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
 }
 
+int
+gdbarch_software_single_step_p (struct gdbarch *gdbarch)
+{
+  return gdbarch->software_single_step != 0;
+}
+
+void
+gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
+{
+  if (gdbarch->software_single_step == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_software_single_step invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
+  gdbarch->software_single_step (sig, insert_breakpoints_p);
+}
+
+void
+set_gdbarch_software_single_step (struct gdbarch *gdbarch,
+                                  gdbarch_software_single_step_ftype software_single_step)
+{
+  gdbarch->software_single_step = software_single_step;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
index a9f0e158f95ad935bfbe5d9059783b49415e8cb2..34891a43b93a6a7ad547abec1a6b0794f4063828 100644 (file)
@@ -1489,6 +1489,46 @@ extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdb
 #endif
 #endif
 
+/* FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+   the target needs software single step.  An ISA method to implement it.
+  
+   FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+   using the breakpoint system instead of blatting memory directly (as with rs6000).
+  
+   FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+   single step.  If not, then implement single step using breakpoints. */
+
+#if defined (SOFTWARE_SINGLE_STEP)
+/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
+#if !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (0)
+#endif
+
+extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
+#endif
+
+typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
+extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
+extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
+#endif
+#endif
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
index ac6d3e971da2a3ed80150769ae7f40272d965cf1..991ea132415663e3ebf83d0a38e72faadb447c2d 100755 (executable)
@@ -513,6 +513,15 @@ v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_flo
 v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)
 v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown
 f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::default_convert_from_func_ptr_addr::0
+# FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+# the target needs software single step.  An ISA method to implement it.
+#
+# FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+# using the breakpoint system instead of blatting memory directly (as with rs6000).
+#
+# FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+# single step.  If not, then implement single step using breakpoints.
+F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
 EOF
 }
 
index fa805830aa08eef3c1ef5e92fa8774aeb7e15a55..22c152f6d85b0ada30b489b006130324fa476914 100644 (file)
@@ -1251,12 +1251,6 @@ extern void push_remote_target (char *name, int from_tty);
 \f
 /* Imported from machine dependent code */
 
-#ifndef SOFTWARE_SINGLE_STEP_P
-#define SOFTWARE_SINGLE_STEP_P() 0
-#define SOFTWARE_SINGLE_STEP(sig,bp_p) \
-     (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
-#endif /* SOFTWARE_SINGLE_STEP_P */
-
 /* Blank target vector entries are initialized to target_ignore. */
 void target_ignore (void);
 
This page took 0.030407 seconds and 4 git commands to generate.