diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-02-03 16:43:03 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-02-03 16:43:03 +0000 |
commit | 75cebea968bbac3e5dccd256de4de0e8305990d0 (patch) | |
tree | f6f23162029513153a111d36fd8c13c1e0d3b99b | |
parent | c1dec97bf174ee0e1f1e96e53d34a78b4a2d9a6a (diff) | |
download | gdb-75cebea968bbac3e5dccd256de4de0e8305990d0.zip gdb-75cebea968bbac3e5dccd256de4de0e8305990d0.tar.gz gdb-75cebea968bbac3e5dccd256de4de0e8305990d0.tar.bz2 |
Add qsupported to gdbarch.
2010-02-03 H.J. Lu <hongjiu.lu@intel.com>
* gdbarch.sh: Add qsupported.
* gdbarch.c: Regenerated.
* gdbarch.h: Likewise.
* remote.c (remote_state): Add gdbarch.
(init_remote_state): Set gdbarch.
(remote_query_supported): Support gdbarch_qsupported.
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/gdbarch.c | 23 | ||||
-rw-r--r-- | gdb/gdbarch.h | 5 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 3 | ||||
-rw-r--r-- | gdb/remote.c | 26 |
5 files changed, 65 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c4ae15e..af536a7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2010-02-03 H.J. Lu <hongjiu.lu@intel.com> + + * gdbarch.sh: Add qsupported. + + * gdbarch.c: Regenerated. + * gdbarch.h: Likewise. + + * remote.c (remote_state): Add gdbarch. + (init_remote_state): Set gdbarch. + (remote_query_supported): Support gdbarch_qsupported. + 2010-02-03 Daniel Jacobowitz <dan@codesourcery.com> * amd64fbsd-nat.c (amd64fbsd_supply_pcb): Also check for diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 6448fc3..cfb042b 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -252,6 +252,7 @@ struct gdbarch int has_global_breakpoints; gdbarch_has_shared_address_space_ftype *has_shared_address_space; gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at; + const char * qsupported; }; @@ -395,6 +396,7 @@ struct gdbarch startup_gdbarch = 0, /* has_global_breakpoints */ default_has_shared_address_space, /* has_shared_address_space */ default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */ + 0, /* qsupported */ /* startup_gdbarch() */ }; @@ -661,6 +663,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of has_global_breakpoints, invalid_p == 0 */ /* Skip verify of has_shared_address_space, invalid_p == 0 */ /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */ + /* Skip verify of qsupported, invalid_p == 0 */ buf = ui_file_xstrdup (log, &length); make_cleanup (xfree, buf); if (length > 0) @@ -1035,6 +1038,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: push_dummy_code = <%s>\n", host_address_to_string (gdbarch->push_dummy_code)); fprintf_unfiltered (file, + "gdbarch_dump: qsupported = %s\n", + gdbarch->qsupported); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_read_pc_p() = %d\n", gdbarch_read_pc_p (gdbarch)); fprintf_unfiltered (file, @@ -3576,6 +3582,23 @@ set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at; } +const char * +gdbarch_qsupported (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of qsupported, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_qsupported called\n"); + return gdbarch->qsupported; +} + +void +set_gdbarch_qsupported (struct gdbarch *gdbarch, + const char * qsupported) +{ + gdbarch->qsupported = qsupported; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 661d34b..1353ab1 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -923,6 +923,11 @@ typedef int (gdbarch_fast_tracepoint_valid_at_ftype) (struct gdbarch *gdbarch, C extern int gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg); extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at); +/* Not NULL if a target has additonal field for qSupported. */ + +extern const char * gdbarch_qsupported (struct gdbarch *gdbarch); +extern void set_gdbarch_qsupported (struct gdbarch *gdbarch, const char * qsupported); + /* Definition for an unknown syscall, used basically in error-cases. */ #define UNKNOWN_SYSCALL (-1) diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index e1d3ff5..0eaa0ef 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -766,6 +766,9 @@ m:int:has_shared_address_space:void:::default_has_shared_address_space::0 # True if a fast tracepoint can be set at an address. m:int:fast_tracepoint_valid_at:CORE_ADDR addr, int *isize, char **msg:addr, isize, msg::default_fast_tracepoint_valid_at::0 + +# Not NULL if a target has additonal field for qSupported. +v:const char *:qsupported:::0:0::0:gdbarch->qsupported EOF } diff --git a/gdb/remote.c b/gdb/remote.c index bf7568c..2c3dfdb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -327,6 +327,9 @@ struct remote_state /* Nonzero if the user has pressed Ctrl-C, but the target hasn't responded to that. */ int ctrlc_pending_p; + + /* GDBARCH associated with this target. */ + struct gdbarch *gdbarch; }; /* Private data that we'll store in (struct thread_info)->private. */ @@ -566,6 +569,9 @@ init_remote_state (struct gdbarch *gdbarch) rs->buf = xrealloc (rs->buf, rs->buf_size); } + /* Record our GDBARCH. */ + rs->gdbarch = gdbarch; + return rsa; } @@ -3475,10 +3481,24 @@ remote_query_supported (void) rs->buf[0] = 0; if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE) { - if (rs->extended) - putpkt ("qSupported:multiprocess+"); + const char *qsupported = gdbarch_qsupported (rs->gdbarch); + if (qsupported) + { + char *q; + if (rs->extended) + q = concat ("qSupported:multiprocess+;", qsupported, NULL); + else + q = concat ("qSupported:", qsupported, NULL); + putpkt (q); + xfree (q); + } else - putpkt ("qSupported"); + { + if (rs->extended) + putpkt ("qSupported:multiprocess+"); + else + putpkt ("qSupported"); + } getpkt (&rs->buf, &rs->buf_size, 0); |