From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] Remove macro SOFTWARE_SINGLE_STEP
Date: Mon, 18 Jun 2007 04:19:00 -0000 [thread overview]
Message-ID: <4676078B.8030301@de.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 518 bytes --]
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
[-- Attachment #2: diff-remove-SOFTWARE_SINGLE_STEP --]
[-- Type: text/plain, Size: 6854 bytes --]
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 ();
next reply other threads:[~2007-06-18 4:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-18 4:19 Markus Deuling [this message]
2007-06-18 18:03 ` Ulrich Weigand
2007-06-19 3:34 ` Markus Deuling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4676078B.8030301@de.ibm.com \
--to=deuling@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox