forked from Imagelibrary/binutils-gdb
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:
@@ -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>
|
2010-02-03 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* amd64fbsd-nat.c (amd64fbsd_supply_pcb): Also check for
|
* amd64fbsd-nat.c (amd64fbsd_supply_pcb): Also check for
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ struct gdbarch
|
|||||||
int has_global_breakpoints;
|
int has_global_breakpoints;
|
||||||
gdbarch_has_shared_address_space_ftype *has_shared_address_space;
|
gdbarch_has_shared_address_space_ftype *has_shared_address_space;
|
||||||
gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
|
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 */
|
0, /* has_global_breakpoints */
|
||||||
default_has_shared_address_space, /* has_shared_address_space */
|
default_has_shared_address_space, /* has_shared_address_space */
|
||||||
default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
|
default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
|
||||||
|
0, /* qsupported */
|
||||||
/* startup_gdbarch() */
|
/* startup_gdbarch() */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -661,6 +663,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
|||||||
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
|
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
|
||||||
/* Skip verify of has_shared_address_space, 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 fast_tracepoint_valid_at, invalid_p == 0 */
|
||||||
|
/* Skip verify of qsupported, invalid_p == 0 */
|
||||||
buf = ui_file_xstrdup (log, &length);
|
buf = ui_file_xstrdup (log, &length);
|
||||||
make_cleanup (xfree, buf);
|
make_cleanup (xfree, buf);
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
@@ -1034,6 +1037,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
|||||||
fprintf_unfiltered (file,
|
fprintf_unfiltered (file,
|
||||||
"gdbarch_dump: push_dummy_code = <%s>\n",
|
"gdbarch_dump: push_dummy_code = <%s>\n",
|
||||||
host_address_to_string (gdbarch->push_dummy_code));
|
host_address_to_string (gdbarch->push_dummy_code));
|
||||||
|
fprintf_unfiltered (file,
|
||||||
|
"gdbarch_dump: qsupported = %s\n",
|
||||||
|
gdbarch->qsupported);
|
||||||
fprintf_unfiltered (file,
|
fprintf_unfiltered (file,
|
||||||
"gdbarch_dump: gdbarch_read_pc_p() = %d\n",
|
"gdbarch_dump: gdbarch_read_pc_p() = %d\n",
|
||||||
gdbarch_read_pc_p (gdbarch));
|
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;
|
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
|
/* Keep a registry of per-architecture data-pointers required by GDB
|
||||||
modules. */
|
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 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);
|
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. */
|
/* Definition for an unknown syscall, used basically in error-cases. */
|
||||||
#define UNKNOWN_SYSCALL (-1)
|
#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.
|
# 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
|
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
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
gdb/remote.c
20
gdb/remote.c
@@ -327,6 +327,9 @@ struct remote_state
|
|||||||
/* Nonzero if the user has pressed Ctrl-C, but the target hasn't
|
/* Nonzero if the user has pressed Ctrl-C, but the target hasn't
|
||||||
responded to that. */
|
responded to that. */
|
||||||
int ctrlc_pending_p;
|
int ctrlc_pending_p;
|
||||||
|
|
||||||
|
/* GDBARCH associated with this target. */
|
||||||
|
struct gdbarch *gdbarch;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Private data that we'll store in (struct thread_info)->private. */
|
/* 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);
|
rs->buf = xrealloc (rs->buf, rs->buf_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Record our GDBARCH. */
|
||||||
|
rs->gdbarch = gdbarch;
|
||||||
|
|
||||||
return rsa;
|
return rsa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3474,11 +3480,25 @@ remote_query_supported (void)
|
|||||||
|
|
||||||
rs->buf[0] = 0;
|
rs->buf[0] = 0;
|
||||||
if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
|
if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
|
||||||
|
{
|
||||||
|
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
|
||||||
{
|
{
|
||||||
if (rs->extended)
|
if (rs->extended)
|
||||||
putpkt ("qSupported:multiprocess+");
|
putpkt ("qSupported:multiprocess+");
|
||||||
else
|
else
|
||||||
putpkt ("qSupported");
|
putpkt ("qSupported");
|
||||||
|
}
|
||||||
|
|
||||||
getpkt (&rs->buf, &rs->buf_size, 0);
|
getpkt (&rs->buf, &rs->buf_size, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user