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.
This commit is contained in:
parent
c1dec97bf1
commit
75cebea968
5 changed files with 65 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
@ -1034,6 +1037,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
|||
fprintf_unfiltered (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));
|
||||
|
@ -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. */
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
26
gdb/remote.c
26
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue