aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-01-09 22:55:10 +0000
committerDaniel Jacobowitz <drow@false.org>2007-01-09 22:55:10 +0000
commit23181151a2399f4ecbc272cda73172a078d1b435 (patch)
treeea2a6e528a8ea59c2af185ebd8e1d1c7c08d7a55 /gdb/remote.c
parent3e9cb5f4b2410bf5b0e0659dbeb532f08c2963de (diff)
downloadgdb-23181151a2399f4ecbc272cda73172a078d1b435.zip
gdb-23181151a2399f4ecbc272cda73172a078d1b435.tar.gz
gdb-23181151a2399f4ecbc272cda73172a078d1b435.tar.bz2
XML feature description support.
* NEWS: Mention target descriptions, "set tdesc filename", "unset tdesc filename", "show tdesc filename", and qXfer:features:read. * arch-utils.c (choose_architecture_for_target): New function. (gdbarch_info_fill): Call it. * target-descriptions.c (struct property): Make members non-const. (struct target_desc): Add arch member. (target_description_filename): New variable. (target_find_description): Try via XML first. (tdesc_architecture): New. (free_target_description, make_cleanup_free_target_description): New. (set_tdesc_property): Call xstrdup. (set_tdesc_architecture, tdesc_set_cmdlist, tdesc_show_cmdlist) (tdesc_unset_cmdlist, unset_tdesc_cmd, unset_tdesc_filename_cmd) (set_tdesc_cmd, show_tdesc_cmd, set_tdesc_filename_cmd) (show_tdesc_filename_cmd, _initialize_target_descriptions): New. * target-descriptions.h (tdesc_architecture) (make_cleanup_free_target_description, set_tdesc_architecture): New prototypes. * Makefile.in (SFILES): Add xml-tdesc.c. (COMMON_OBS): Add xml-tdesc.o. (target-descriptions.o): Update. (xml-tdesc.o): New rule. * xml-tdesc.c, xml-tdesc.h: New files. * remote.c (PACKET_qXfer_features): New enum. (remote_protocol_features): Add qXfer:features:read. (remote_xfer_partial): Handle TARGET_OBJECT_AVAILABLE_FEATURES. (_initialize_remote): Register qXfer:features:read. * target.h (enum target_object): Add TARGET_OBJECT_AVAILABLE_FEATURES. * features/gdb-target.dtd: New file. * linux-i386-low.c (the_low_target): Set arch_string. * linux-x86-64-low.c (the_low_target): Likewise. * linux-low.c (linux_arch_string): New. (linux_target_ops): Add it. * linux-low.h (struct linux_target_ops): Add arch_string. * server.c (write_qxfer_response): Use const void * for DATA. (get_features_xml): New. (handle_query): Handle qXfer:features:read. Report it for qSupported. * target.h (struct target_ops): Add arch_string method. * gdb.texinfo (Target Descriptions): New section. (General Query Packets): Add QPassSignals anchor. Mention qXfer:features:read under qSupported. Expand mentions of qXfer:memory-map:read and QPassSignals. Document qXfer:features:read.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index c229bff..48be844 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -893,6 +893,7 @@ enum {
PACKET_Z3,
PACKET_Z4,
PACKET_qXfer_auxv,
+ PACKET_qXfer_features,
PACKET_qXfer_memory_map,
PACKET_qGetTLSAddr,
PACKET_qSupported,
@@ -2294,6 +2295,8 @@ static struct protocol_feature remote_protocol_features[] = {
{ "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
{ "qXfer:auxv:read", PACKET_DISABLE, remote_supported_packet,
PACKET_qXfer_auxv },
+ { "qXfer:features:read", PACKET_DISABLE, remote_supported_packet,
+ PACKET_qXfer_features },
{ "qXfer:memory-map:read", PACKET_DISABLE, remote_supported_packet,
PACKET_qXfer_memory_map },
{ "QPassSignals", PACKET_DISABLE, remote_supported_packet,
@@ -5716,6 +5719,11 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
return remote_read_qxfer (ops, "auxv", annex, readbuf, offset, len,
&remote_protocol_packets[PACKET_qXfer_auxv]);
+ case TARGET_OBJECT_AVAILABLE_FEATURES:
+ return remote_read_qxfer
+ (ops, "features", annex, readbuf, offset, len,
+ &remote_protocol_packets[PACKET_qXfer_features]);
+
case TARGET_OBJECT_MEMORY_MAP:
gdb_assert (annex == NULL);
return remote_read_qxfer (ops, "memory-map", annex, readbuf, offset, len,
@@ -6589,6 +6597,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL,
add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_auxv],
"qXfer:auxv:read", "read-aux-vector", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_features],
+ "qXfer:features:read", "target-features", 0);
+
add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_memory_map],
"qXfer:memory-map:read", "memory-map", 0);