aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-04-09 03:40:00 +0000
committerPedro Alves <palves@redhat.com>2010-04-09 03:40:00 +0000
commit219f2f2398a678322264121a25214b3046180dec (patch)
treec9cb248482f190db5039f4c3a6aec0c96b3b3d3d /gdb/gdbserver/target.h
parent33da3f1cb51cb8851ab5b12d1f5fa61e45232276 (diff)
downloadgdb-219f2f2398a678322264121a25214b3046180dec.zip
gdb-219f2f2398a678322264121a25214b3046180dec.tar.gz
gdb-219f2f2398a678322264121a25214b3046180dec.tar.bz2
gdb/gdbserver/
* server.h (LONGEST): New. (struct thread_info) <while_stepping>: New field. (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz): Declare. (initialize_tracepoint, handle_tracepoint_general_set) (handle_tracepoint_query, tracepoint_finished_step) (tracepoint_was_hit, release_while_stepping_state_list): (current_traceframe): Declare. * server.c (handle_general_set): Handle tracepoint packets. (read_memory): New. (write_memory): New. (handle_search_memory_1): Use read_memory. (handle_query): Report support for conditional tracepoints, trace state variables, and tracepoint sources. Handle tracepoint queries. (main): Initialize the tracepoints module. (process_serial_event): Handle traceframe reads/writes. * linux-low.c (handle_tracepoints): New. (linux_wait_1): Call it. (linux_resume_one_lwp): Handle while-stepping. (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New. (linux_target_ops): Install them. * linux-low.h (struct linux_target_ops) <supports_tracepoints>: New field. * linux-x86-low.c (x86_supports_tracepoints): New. (the_low_target). Install it. * mem-break.h (delete_breakpoint): Declare. * mem-break.c (delete_breakpoint): Make external. * target.h (struct target_ops): Add `supports_tracepoints', `read_pc', and `write_pc' fields. (target_supports_tracepoints): Define. * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two) (phex_nz): New. * regcache.h (struct regcache) <registers_owned>: New field. (init_register_cache, regcache_cpy): Declare. (regcache_read_pc, regcache_write_pc): Declare. (register_cache_size): Declare. (supply_regblock): Declare. * regcache.c (init_register_cache): New. (new_register_cache): Use it. (regcache_cpy): New. (register_cache_size): New. (supply_regblock): New. (regcache_read_pc, regcache_write_pc): New. * tracepoint.c: New. * Makefile.in (OBS): Add tracepoint.o. (tracepoint.o): New rule. gdb/ * regformats/regdat.sh: Include server.h. Don't include regcache.h.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r--gdb/gdbserver/target.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 6109b1c..6ee5009 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -289,6 +289,16 @@ struct target_ops
/* Target specific qSupported support. */
void (*process_qsupported) (const char *);
+
+ /* Return 1 if the target supports tracepoints, 0 (or leave the
+ callback NULL) otherwise. */
+ int (*supports_tracepoints) (void);
+
+ /* Read PC from REGCACHE. */
+ CORE_ADDR (*read_pc) (struct regcache *regcache);
+
+ /* Write PC to REGCACHE. */
+ void (*write_pc) (struct regcache *regcache, CORE_ADDR pc);
};
extern struct target_ops *the_target;
@@ -333,6 +343,10 @@ void set_target_ops (struct target_ops *);
if (the_target->process_qsupported) \
the_target->process_qsupported (query)
+#define target_supports_tracepoints() \
+ (the_target->supports_tracepoints \
+ ? (*the_target->supports_tracepoints) () : 0)
+
/* Start non-stop mode, returns 0 on success, -1 on failure. */
int start_non_stop (int nonstop);