This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] Remove macro SOFTWARE_SINGLE_STEP
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Mon, 18 Jun 2007 06:18:19 +0200
- Subject: [rfc] Remove macro SOFTWARE_SINGLE_STEP
Hello,
this patch removes macro SOFTWARE_SINGLE_STEP from gdbarch.sh.
ChangeLog:
* gdbarch.sh (SOFTWARE_SINGLE_STEP): Replace by
gdbarch_software_single_step.
* infrun.c (resume): Likewise.
* gdbarch.sh (SOFTWARE_SINGLE_STEP_P): Replace by
gdbarch_software_single_step_p.
* infrun.c (resume): Likewise
(handle_inferior_event): Likewise.
(adjust_pc_after_break): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
Is this ok to commit?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.c 2007-06-18 06:07:32.000000000 +0200
@@ -1067,21 +1067,9 @@
fprintf_unfiltered (file,
"gdbarch_dump: smash_text_address = <0x%lx>\n",
(long) current_gdbarch->smash_text_address);
-#ifdef SOFTWARE_SINGLE_STEP_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "SOFTWARE_SINGLE_STEP_P()",
- XSTRING (SOFTWARE_SINGLE_STEP_P ()));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
gdbarch_software_single_step_p (current_gdbarch));
-#ifdef SOFTWARE_SINGLE_STEP
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "SOFTWARE_SINGLE_STEP(frame)",
- XSTRING (SOFTWARE_SINGLE_STEP (frame)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: software_single_step = <0x%lx>\n",
(long) current_gdbarch->software_single_step);
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.h 2007-06-18 06:07:23.000000000 +0200
@@ -659,30 +659,11 @@
A return value of 1 means that the software_single_step breakpoints
were inserted; 0 means they were not. */
-#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
-
extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
-#if !defined (GDB_TM_FILE) && defined (SOFTWARE_SINGLE_STEP_P)
-#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
-#endif
-#if !defined (SOFTWARE_SINGLE_STEP_P)
-#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
-#endif
typedef int (gdbarch_software_single_step_ftype) (struct frame_info *frame);
extern int gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame);
extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
-#if !defined (GDB_TM_FILE) && defined (SOFTWARE_SINGLE_STEP)
-#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
-#endif
-#if !defined (SOFTWARE_SINGLE_STEP)
-#define SOFTWARE_SINGLE_STEP(frame) (gdbarch_software_single_step (current_gdbarch, frame))
-#endif
/* Return non-zero if the processor is executing a delay slot and a
further single-step is needed before the instruction finishes. */
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.sh 2007-06-18 06:07:09.000000000 +0200
@@ -606,7 +606,7 @@
#
# A return value of 1 means that the software_single_step breakpoints
# were inserted; 0 means they were not.
-F:=:int:software_single_step:struct frame_info *frame:frame
+F::int:software_single_step:struct frame_info *frame:frame
# Return non-zero if the processor is executing a delay slot and a
# further single-step is needed before the instruction finishes.
diff -urN src/gdb/infrun.c dev/gdb/infrun.c
--- src/gdb/infrun.c 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/infrun.c 2007-06-18 06:13:17.000000000 +0200
@@ -537,10 +537,10 @@
a command like `return' or `jump' to continue execution."));
}
- if (SOFTWARE_SINGLE_STEP_P () && step)
+ if (gdbarch_software_single_step_p (current_gdbarch) && step)
{
/* Do it the hard way, w/temp breakpoints */
- if (SOFTWARE_SINGLE_STEP (get_current_frame ()))
+ if (gdbarch_software_single_step (current_gdbarch, get_current_frame ()))
{
/* ...and don't ask hardware to do it. */
step = 0;
@@ -1184,7 +1184,7 @@
breakpoint_pc = read_pc_pid (ecs->ptid) - gdbarch_decr_pc_after_break
(current_gdbarch);
- if (SOFTWARE_SINGLE_STEP_P ())
+ if (gdbarch_software_single_step_p (current_gdbarch))
{
/* When using software single-step, a SIGTRAP can only indicate
an inserted breakpoint. This actually makes things
@@ -1373,7 +1373,8 @@
(LONGEST) ecs->ws.value.integer));
gdb_flush (gdb_stdout);
target_mourn_inferior ();
- singlestep_breakpoints_inserted_p = 0; /* SOFTWARE_SINGLE_STEP_P() */
+ /* gdbarch_software_single_step_p */
+ singlestep_breakpoints_inserted_p = 0;
stop_print_frame = 0;
stop_stepping (ecs);
return;
@@ -1393,7 +1394,8 @@
target_mourn_inferior ();
print_stop_reason (SIGNAL_EXITED, stop_signal);
- singlestep_breakpoints_inserted_p = 0; /* SOFTWARE_SINGLE_STEP_P() */
+ /* gdbarch_software_single_step_p */
+ singlestep_breakpoints_inserted_p = 0;
stop_stepping (ecs);
return;
@@ -1549,7 +1551,7 @@
if (stepping_past_singlestep_breakpoint)
{
- gdb_assert (SOFTWARE_SINGLE_STEP_P ()
+ gdb_assert (gdbarch_software_single_step_p (current_gdbarch)
&& singlestep_breakpoints_inserted_p);
gdb_assert (ptid_equal (singlestep_ptid, ecs->ptid));
gdb_assert (!ptid_equal (singlestep_ptid, saved_singlestep_ptid));
@@ -1599,7 +1601,8 @@
if (!breakpoint_thread_match (stop_pc, ecs->ptid))
thread_hop_needed = 1;
}
- else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ else if (gdbarch_software_single_step_p (current_gdbarch)
+ && singlestep_breakpoints_inserted_p)
{
/* We have not context switched yet, so this should be true
no matter which thread hit the singlestep breakpoint. */
@@ -1670,7 +1673,8 @@
/* Saw a breakpoint, but it was hit by the wrong thread.
Just continue. */
- if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ if (gdbarch_software_single_step_p (current_gdbarch)
+ && singlestep_breakpoints_inserted_p)
{
/* Pull the single step breakpoints out of the target. */
remove_single_step_breakpoints ();
@@ -1719,7 +1723,8 @@
return;
}
}
- else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ else if (gdbarch_software_single_step_p (current_gdbarch)
+ && singlestep_breakpoints_inserted_p)
{
sw_single_step_trap_p = 1;
ecs->random_signal = 0;
@@ -1741,7 +1746,8 @@
deprecated_context_hook (pid_to_thread_id (ecs->ptid));
}
- if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ if (gdbarch_software_single_step_p (current_gdbarch)
+ && singlestep_breakpoints_inserted_p)
{
/* Pull the single step breakpoints out of the target. */
remove_single_step_breakpoints ();