diff options
author | Pedro Alves <palves@redhat.com> | 2010-04-09 03:40:00 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-04-09 03:40:00 +0000 |
commit | 219f2f2398a678322264121a25214b3046180dec (patch) | |
tree | c9cb248482f190db5039f4c3a6aec0c96b3b3d3d /gdb/gdbserver/server.h | |
parent | 33da3f1cb51cb8851ab5b12d1f5fa61e45232276 (diff) | |
download | gdb-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/server.h')
-rw-r--r-- | gdb/gdbserver/server.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 88c6c5e..dcff359 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -85,6 +85,7 @@ typedef unsigned char gdb_byte; least the size of a (void *). */ typedef long long CORE_ADDR; +typedef long long LONGEST; typedef unsigned long long ULONGEST; /* The ptid struct is a collection of the various "ids" necessary @@ -180,6 +181,31 @@ struct thread_info /* The last wait status reported for this thread. */ struct target_waitstatus last_status; + + /* Given `while-stepping', a thread may be collecting data for more + than one tracepoint simultaneously. E.g.: + + ff0001 INSN1 <-- TP1, while-stepping 10 collect $regs + ff0002 INSN2 + ff0003 INSN3 <-- TP2, collect $regs + ff0004 INSN4 <-- TP3, while-stepping 10 collect $regs + ff0005 INSN5 + + Notice that when instruction INSN5 is reached, the while-stepping + actions of both TP1 and TP3 are still being collected, and that TP2 + had been collected meanwhile. The whole range of ff0001-ff0005 + should be single-stepped, due to at least TP1's while-stepping + action covering the whole range. + + On the other hand, the same tracepoint with a while-stepping action + may be hit by more than one thread simultaneously, hence we can't + keep the current step count in the tracepoint itself. + + This is the head of the list of the states of `while-stepping' + tracepoint actions this thread is now collecting; NULL if empty. + Each item in the list holds the current step of the while-stepping + action. */ + struct wstep_state *while_stepping; }; struct dll_info @@ -371,6 +397,7 @@ int hexify (char *hex, const char *bin, int count); int remote_escape_output (const gdb_byte *buffer, int len, gdb_byte *out_buf, int *out_len, int out_maxlen); +char *unpack_varlen_hex (char *buff, ULONGEST *result); void clear_symbol_cache (struct sym_cache **symcache_p); int look_up_one_symbol (const char *name, CORE_ADDR *addrp); @@ -416,6 +443,7 @@ void buffer_xml_printf (struct buffer *buffer, const char *format, ...) /* Functions from utils.c */ void *xmalloc (size_t) ATTR_MALLOC; +void *xrealloc (void *, size_t); void *xcalloc (size_t, size_t) ATTR_MALLOC; char *xstrdup (const char *) ATTR_MALLOC; void freeargv (char **argv); @@ -426,6 +454,9 @@ void internal_error (const char *file, int line, const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4); void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2); char *paddress (CORE_ADDR addr); +char *pulongest (ULONGEST u); +char *plongest (LONGEST l); +char *phex_nz (ULONGEST l, int sizeof_l); #define gdb_assert(expr) \ ((void) ((expr) ? 0 : \ @@ -464,6 +495,28 @@ char *paddress (CORE_ADDR addr); as large as the largest register set supported by gdbserver. */ #define PBUFSIZ 16384 +/* Functions from tracepoint.c */ + +void initialize_tracepoint (void); + +int handle_tracepoint_general_set (char *own_buf); +int handle_tracepoint_query (char *own_buf); + +int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc); +int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc); + +void release_while_stepping_state_list (struct thread_info *tinfo); + +extern int current_traceframe; + +int in_readonly_region (CORE_ADDR addr, ULONGEST length); +int traceframe_read_mem (int tfnum, CORE_ADDR addr, + unsigned char *buf, ULONGEST length, + ULONGEST *nbytes); +int fetch_traceframe_registers (int tfnum, + struct regcache *regcache, + int regnum); + /* Version information, from version.c. */ extern const char version[]; extern const char host_name[]; |