From 56a56296304cc86e6857718812a6ff33598bddc7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 2 Dec 2008 07:57:35 +0000 Subject: 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. --- gdb/remote.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gdb/remote.c') diff --git a/gdb/remote.c b/gdb/remote.c index 06ab78317fc..c8a46eedc46 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); -- cgit v1.2.1