aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-12-02 07:57:38 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-12-02 07:57:38 +0000
commit07e059b5a9cbdeab8bf2980e07e79f892a2da854 (patch)
tree065ba2dfb548976f2d0691a8753a54d03148c1d5 /gdb/remote.c
parentf3c85de60aa06c1f075332c95fb2c32de79d50d3 (diff)
downloadgdb-07e059b5a9cbdeab8bf2980e07e79f892a2da854.zip
gdb-07e059b5a9cbdeab8bf2980e07e79f892a2da854.tar.gz
gdb-07e059b5a9cbdeab8bf2980e07e79f892a2da854.tar.bz2
Implement -list-thread-groups --available
* Makefile.in (XMLFILES): Add osdata.dtd. (SFILES): Add osdata.c. (COMMON_OBS): Add osdata.o. * linux-nat.c: Include pwd.h, sys/types.h, gdb_dirent.h and xml-support.h. (linux_nat_xfer_osdata): New function. (linux_xfer_partial): Handle TARGET_OBJECT_OSDATA. * osdata.c: New file. * osdata.h: New file. * remote.c (PACKET_qXfer_osdata): New packet enum. (remote_protocol_features): Add "qXfer:osdata:read". (remote_read_qxfer): Handle TARGET_OBJECT_OSDATA. (extended_remote_can_run): New. (init_extended_remote_ops): Set to_can_run to extended_remote_can_run. (_initialize_remote): Add packet config command for "qXfer:osdata:read". * xml-support.c (obstack_xml_printf): New function. * xml-support.h (obstack_xml_printf): Declare. * target.c (target_get_osdata): New function. * target.h (enum target_object): Add TARGET_OBJECT_OSDATA. (target_os_data): Declare. * features/osdata.dtd: New file. * mi/mi-main.c (mi_list_thread_groups): Handle the --available option.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 06ab783..c8a46ee 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -992,6 +992,7 @@ enum {
PACKET_qXfer_memory_map,
PACKET_qXfer_spu_read,
PACKET_qXfer_spu_write,
+ PACKET_qXfer_osdata,
PACKET_qGetTLSAddr,
PACKET_qSupported,
PACKET_QPassSignals,
@@ -2958,6 +2959,8 @@ static struct protocol_feature remote_protocol_features[] = {
PACKET_qXfer_spu_read },
{ "qXfer:spu:write", PACKET_DISABLE, remote_supported_packet,
PACKET_qXfer_spu_write },
+ { "qXfer:osdata:read", PACKET_DISABLE, remote_supported_packet,
+ PACKET_qXfer_osdata },
{ "QPassSignals", PACKET_DISABLE, remote_supported_packet,
PACKET_QPassSignals },
{ "QStartNoAckMode", PACKET_DISABLE, remote_supported_packet,
@@ -7355,6 +7358,13 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
return remote_read_qxfer (ops, "memory-map", annex, readbuf, offset, len,
&remote_protocol_packets[PACKET_qXfer_memory_map]);
+ case TARGET_OBJECT_OSDATA:
+ /* Should only get here if we're connected. */
+ gdb_assert (remote_desc);
+ return remote_read_qxfer
+ (ops, "osdata", annex, readbuf, offset, len,
+ &remote_protocol_packets[PACKET_qXfer_osdata]);
+
default:
return -1;
}
@@ -8647,6 +8657,15 @@ remote_supports_multi_process (void)
return remote_multi_process_p (rs);
}
+static int
+extended_remote_can_run (void)
+{
+ if (remote_desc != NULL)
+ return 1;
+
+ return 0;
+}
+
static void
init_remote_ops (void)
{
@@ -8732,6 +8751,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
extended_remote_ops.to_detach = extended_remote_detach;
extended_remote_ops.to_attach = extended_remote_attach;
extended_remote_ops.to_kill = extended_remote_kill;
+ extended_remote_ops.to_can_run = extended_remote_can_run;
}
static int
@@ -9041,6 +9061,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL,
add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_spu_write],
"qXfer:spu:write", "write-spu-object", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_osdata],
+ "qXfer:osdata:read", "osdata", 0);
+
add_packet_config_cmd (&remote_protocol_packets[PACKET_qGetTLSAddr],
"qGetTLSAddr", "get-thread-local-storage-address",
0);