diff options
author | Pedro Alves <palves@redhat.com> | 2013-05-23 17:17:50 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-05-23 17:17:50 +0000 |
commit | c2d6af84da44465f30e3bb487721128dfe03d0e4 (patch) | |
tree | 6d1037aa6d79b5fcebf8e353c5f013128e1ca8a4 /gdb/gdbserver/target.h | |
parent | c1e36e3e919994da4fa0da232b173939f3e44bb8 (diff) | |
download | gdb-c2d6af84da44465f30e3bb487721128dfe03d0e4.zip gdb-c2d6af84da44465f30e3bb487721128dfe03d0e4.tar.gz gdb-c2d6af84da44465f30e3bb487721128dfe03d0e4.tar.bz2 |
range stepping: gdbserver (x86 GNU/Linux)
This patch adds support for range stepping to GDBserver, teaching it
about vCont;r.
It'd be easy to enable this for all hardware single-step targets
without needing the linux_target_ops hook, however, at least PPC needs
special care, due to the fact that PPC atomic sequences can't be
hardware single-stepped through, a thing which GDBserver doesn't know
about. So this leaves the support limited to x86/x86_64.
gdb/
2013-05-23 Pedro Alves <palves@redhat.com>
* NEWS: Mention GDBserver range stepping support.
gdb/gdbserver/
2013-05-23 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* linux-low.c (lwp_in_step_range): New function.
(linux_wait_1): If the thread was range stepping and stopped
outside the stepping range, report the stop to GDB. Otherwise,
continue stepping. Add range stepping debug output.
(linux_set_resume_request): Copy the step range from the resume
request to the lwp.
(linux_supports_range_stepping): New.
(linux_target_ops) <supports_range_stepping>: Set to
linux_supports_range_stepping.
* linux-low.h (struct linux_target_ops)
<supports_range_stepping>: New field.
(struct lwp_info) <step_range_start, step_range_end>: New fields.
* linux-x86-low.c (x86_supports_range_stepping): New.
(the_low_target) <supports_range_stepping>: Set to
x86_supports_range_stepping.
* server.c (handle_v_cont): Handle 'r' action.
(handle_v_requests): Append ";r" if the target supports range
stepping.
* target.h (struct thread_resume) <step_range_start,
step_range_end>: New fields.
(struct target_ops) <supports_range_stepping>:
New field.
(target_supports_range_stepping): New macro.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r-- | gdb/gdbserver/target.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index f257459..c57cb40 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -57,6 +57,15 @@ struct thread_resume linux; SuspendThread on win32). This is a host signal value (not enum gdb_signal). */ int sig; + + /* Range to single step within. Valid only iff KIND is resume_step. + + Single-step once, and then continuing stepping as long as the + thread stops in this range. (If the range is empty + [STEP_RANGE_START == STEP_RANGE_END], then this is a single-step + request.) */ + CORE_ADDR step_range_start; /* Inclusive */ + CORE_ADDR step_range_end; /* Exclusive */ }; /* Generally, what has the program done? */ @@ -414,6 +423,8 @@ struct target_ops to break a cyclic dependency. */ void (*read_btrace) (struct btrace_target_info *, struct buffer *, int type); + /* Return true if target supports range stepping. */ + int (*supports_range_stepping) (void); }; extern struct target_ops *the_target; @@ -549,6 +560,10 @@ int kill_inferior (int); #define target_read_btrace(tinfo, buffer, type) \ (*the_target->read_btrace) (tinfo, buffer, type) +#define target_supports_range_stepping() \ + (the_target->supports_range_stepping ? \ + (*the_target->supports_range_stepping) () : 0) + /* Start non-stop mode, returns 0 on success, -1 on failure. */ int start_non_stop (int nonstop); |