From c8d5aac9dbf03c7f729dc56a712b73ed12fd1704 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 30 Mar 2010 15:45:16 +0000 Subject: [PATCH] Add xmlRegisters= to qSupported packet. gdb/ 2010-03-30 H.J. Lu * NEWS: Mention xmlRegisters= in qSupported packet. * i386-tdep.c: Include "remote.h". (_initialize_i386_tdep): Call register_remote_support_xml. * remote.c (remote_support_xml): New. (register_remote_support_xml): Likewise. (remote_query_supported_append): Likewise. (remote_query_supported): Support remote_support_xml. * remote.h (register_remote_support_xml): New. gdb/doc/ 2010-03-30 H.J. Lu * gdb.texinfo (General Query Packets): Add xmlRegisters. --- gdb/ChangeLog | 54 +++++++++++++++++++++++--------------- gdb/NEWS | 3 +++ gdb/doc/ChangeLog | 62 +++++++++++++++++++++++--------------------- gdb/doc/gdb.texinfo | 6 +++++ gdb/i386-tdep.c | 4 +++ gdb/remote.c | 74 ++++++++++++++++++++++++++++++++++++++++++++--------- gdb/remote.h | 1 + 7 files changed, 143 insertions(+), 61 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 403210b..f8fb777 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2010-03-30 H.J. Lu + + * NEWS: Mention xmlRegisters= in qSupported packet. + + * i386-tdep.c: Include "remote.h". + (_initialize_i386_tdep): Call register_remote_support_xml. + + * remote.c (remote_support_xml): New. + (register_remote_support_xml): Likewise. + (remote_query_supported_append): Likewise. + (remote_query_supported): Support remote_support_xml. + + * remote.h (register_remote_support_xml): New. + 2010-03-29 Stan Shebs * tracepoint.c (trace_find_line_command): Remove dead code. @@ -1033,23 +1047,23 @@ (gnu_v3_print_method_ptr): Use the physname for virtual methods without a demangled name. Print out type information for non-virtual methods. - * linespec.c (decode_line_1): Force ANY string using "::" (or + * linespec.c (decode_line_1): Force ANY string using "::" (or "." for java) to use decode_compound, and clean up any stray quoting. - If we found a file symtab, re-evaluate whether the remainder is_quoted. - (decode_compound): Stop consuming at an open parenthesis. - Keep template parameters. - Keep any overload information. - Keep keywords like "const". - Remove paren_pointer. - Move is_quoted check from set_flags to here. - Remove #if 0 code from 2000. Ten years is long enough. - (find_method): Before comparing symbol names, canonicalize the string - from the user. - If a specific overload is requested, find it. Otherwise throw an error. + If we found a file symtab, re-evaluate whether the remainder is_quoted. + (decode_compound): Stop consuming at an open parenthesis. + Keep template parameters. + Keep any overload information. + Keep keywords like "const". + Remove paren_pointer. + Move is_quoted check from set_flags to here. + Remove #if 0 code from 2000. Ten years is long enough. + (find_method): Before comparing symbol names, canonicalize the string + from the user. + If a specific overload is requested, find it. Otherwise throw an error. (find_method_overload_end): New function. (set_flags): Remove. - (decode_compound): Assume that parentheses are matched. - It's a lot easier. + (decode_compound): Assume that parentheses are matched. + It's a lot easier. * symtab.c (symbol_find_demangled_name): Add DMGL_VERBOSE flag to cplus_demangle. * linespec.c (decode_line_1): Keep important keywords like @@ -1214,7 +1228,7 @@ 2010-03-07 Joel Brobecker * remote.c (remote_get_ada_task_ptid): New function. - (init_remote_ops): Set remote_ops.to_get_ada_task_ptid. + (init_remote_ops): Set remote_ops.to_get_ada_task_ptid. 2010-03-06 Christopher Faylor @@ -1307,7 +1321,7 @@ address as UnsignedLongLong, not LongLong. 2010-03-05 Kevin Buettner - Pedro Alves + Pedro Alves * remote-mips.c (gdbthread.h): Include. (remote_mips_ptid): Declare. @@ -1697,7 +1711,7 @@ GDB's gdbarch_addr_bit as size of values on the DWARF stack. 2010-02-26 Phil Muldoon - Tom Tromey + Tom Tromey * python/py-type.c (typy_lookup_typename): Add in block argument. If provided restrict lookup to specified blocks. @@ -2672,8 +2686,8 @@ Mon Feb 8 13:17:10 2010 Chris Moller 2010-01-25 gingold - * windows-nat.c (windows_continue): Use %x to print thread id. - (get_windows_debug_event): Ditto. + * windows-nat.c (windows_continue): Use %x to print thread id. + (get_windows_debug_event): Ditto. 2010-01-22 Tom Tromey @@ -3704,7 +3718,7 @@ Mon Feb 8 13:17:10 2010 Chris Moller 2010-01-04 Ulrich Weigand - * features/Makefile (WHICH): Add s390-linux32, s390-linux64, + * features/Makefile (WHICH): Add s390-linux32, s390-linux64, and s390x-linux64. (s390-linux32-expedite): Define. (s390-linux64-expedite): Define. diff --git a/gdb/NEWS b/gdb/NEWS index f01b55e..0d27faa 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,9 @@ *** Changes since GDB 7.1 +* GDB now sends xmlRegisters= in qSupported packet to indicate that + it understands register description. + * The --batch flag now disables pagination and queries. * X86 general purpose registers diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 0e9fa3c..30d811a 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2010-03-30 H.J. Lu + + * gdb.texinfo (General Query Packets): Add xmlRegisters. + 2010-03-29 Stan Shebs Nathan Sidwell @@ -16,8 +20,8 @@ 2010-03-27 Matt Rice - * gdb.texinfo (ARM): Document arguments to "target sim". - (Set Catchpoints): Use @dots{} instead of @r{...}. + * gdb.texinfo (ARM): Document arguments to "target sim". + (Set Catchpoints): Use @dots{} instead of @r{...}. 2010-03-26 Pedro Alves @@ -88,7 +92,7 @@ description to read_var text. 2010-02-26 Phil Muldoon - Tom Tromey + Tom Tromey * gdb.texinfo (Types In Python): Describe block argument in template_argument and gdb.lookup_type. @@ -362,7 +366,7 @@ 2009-10-27 Tom Tromey Eli Zaretskii - PR python/10781 + PR python/10781 * gdb.texinfo (Values From Inferior): Document cast method. @@ -521,8 +525,8 @@ 2009-08-05 Jeremy Bennett - * gdb.texinfo (Separate Debug Files, Remote Protocol): Clarified - CRC definitions. + * gdb.texinfo (Separate Debug Files, Remote Protocol): Clarified + CRC definitions. 2009-08-03 Vladimir Prus @@ -714,7 +718,7 @@ Add index entries. 2009-04-30 Hui Zhu - Michael Snyder + Michael Snyder * gdb.texinfo: (Process Record and Replay): Add documentation for process record and replay. @@ -778,7 +782,7 @@ * gdb.texinfo (Source Path): Document --with-relocated-sources. 2009-04-18 Carlos O'Donell - Joseph Myers + Joseph Myers * Makefile.in (MAKEHTML): Set to makeinfo --html. (MAKEHTMLFLAGS): Set to empty. @@ -1041,7 +1045,7 @@ * gdb.texinfo (Define, Hooks): Document prefix command support. 2009-01-14 Joseph Myers - Carlos O'Donell + Carlos O'Donell Fixes for makeinfo --html. @@ -1106,24 +1110,24 @@ MI non-stop and multiprocess docs. - * gdb.texinfo (GDB/MI): New section 'GDB/MI General Design' - (GDB/MI Output Records): New section 'GDB/MI Frame Information' - Adjust documentation for *stopped, document =thread-created, - =thread-exited, =thread-group-created and =thread-group-exited. - (GDB/MI Thread Commands): Document the 'state' field in - -thread-info output. - (GDB/MI Program Execution): Mention --all and --thread-group - options. - (GDB/MI Variable Objects): Describe floating and fixed variable - objects. - (GDB/MI Miscellaneous Commands): Document -list-thread-groups. + * gdb.texinfo (GDB/MI): New section 'GDB/MI General Design' + (GDB/MI Output Records): New section 'GDB/MI Frame Information' + Adjust documentation for *stopped, document =thread-created, + =thread-exited, =thread-group-created and =thread-group-exited. + (GDB/MI Thread Commands): Document the 'state' field in + -thread-info output. + (GDB/MI Program Execution): Mention --all and --thread-group + options. + (GDB/MI Variable Objects): Describe floating and fixed variable + objects. + (GDB/MI Miscellaneous Commands): Document -list-thread-groups. 2008-12-02 Vladimir Prus - * gdb.texinfo (Operating System Information): New appendix. - (Operating System Auxiliary Information): Document 'info os processes' - (Remote Configuration): Document 'osdata' - (General Query Packets): Document qXfer:osdata:read. + * gdb.texinfo (Operating System Information): New appendix. + (Operating System Auxiliary Information): Document 'info os processes' + (Remote Configuration): Document 'osdata' + (General Query Packets): Document qXfer:osdata:read. 2008-11-27 Tristan Gingold @@ -1152,11 +1156,11 @@ 2008-11-17 Vladimir Prus * gdb.texinfo (GDB/MI Async Records): Document - =thread-selected. + =thread-selected. 2008-11-17 Vladimir Prus - * observer.texi (new_inferior, inferior_exit): New observers. + * observer.texi (new_inferior, inferior_exit): New observers. 2008-10-27 Pedro Alves @@ -1278,12 +1282,12 @@ 2008-08-20 Vladimir Prus - * gdb.textinfo (GDB/MI Miscellaneous Commands): Use @table - for possible features of -list-features. + * gdb.textinfo (GDB/MI Miscellaneous Commands): Use @table + for possible features of -list-features. 2008-08-19 Vladimir Prus - * gdb.texinfo (Background execution): Adjust example + * gdb.texinfo (Background execution): Adjust example (GDB/MI Miscellaneous Commands): Document -list-target-features. 2008-08-19 Vladimir Prus diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index ef51ed1..fab06a8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -30633,6 +30633,12 @@ extensions to the remote protocol. @value{GDBN} does not use such extensions unless the stub also reports that it supports them by including @samp{multiprocess+} in its @samp{qSupported} reply. @xref{multiprocess extensions}, for details. + +@item xmlRegisters +This feature indicates that @value{GDBN} supports the XML target +description. If the stub sees @samp{xmlRegisters=} with target +specific strings separated by a comma, it will report register +description. @end table Stubs should ignore any unknown values for diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 83275ac..9b4c93e 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -44,6 +44,7 @@ #include "value.h" #include "dis-asm.h" #include "disasm.h" +#include "remote.h" #include "gdb_assert.h" #include "gdb_string.h" @@ -6000,4 +6001,7 @@ is \"default\"."), /* Initialize the standard target descriptions. */ initialize_tdesc_i386 (); + + /* Tell remote stub that we support XML target description. */ + register_remote_support_xml ("i386"); } diff --git a/gdb/remote.c b/gdb/remote.c index dcae72c..03644d1 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3467,6 +3467,53 @@ static struct protocol_feature remote_protocol_features[] = { PACKET_TracepointSource }, }; +static char *remote_support_xml; + +/* Register string appended to "xmlRegisters=" in qSupported query. */ + +void +register_remote_support_xml (const char *xml ATTRIBUTE_UNUSED) +{ +#if defined(HAVE_LIBEXPAT) + if (remote_support_xml == NULL) + remote_support_xml = concat ("xmlRegisters=", xml, NULL); + else + { + char *copy = xstrdup (remote_support_xml + 13); + char *p = strtok (copy, ","); + + do + { + if (strcmp (p, xml) == 0) + { + /* already there */ + xfree (copy); + return; + } + } + while ((p = strtok (NULL, ",")) != NULL); + xfree (copy); + + p = concat (remote_support_xml, ",", xml, NULL); + xfree (remote_support_xml); + remote_support_xml = p; + } +#endif +} + +static char * +remote_query_supported_append (char *msg, const char *append) +{ + if (msg) + { + char *p = concat (msg, ";", append, NULL); + xfree (msg); + return p; + } + else + return xstrdup (append); +} + static void remote_query_supported (void) { @@ -3485,24 +3532,27 @@ remote_query_supported (void) rs->buf[0] = 0; if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE) { + char *q = NULL; const char *qsupported = gdbarch_qsupported (target_gdbarch); + + if (rs->extended) + q = remote_query_supported_append (q, "multiprocess+"); + if (qsupported) + q = remote_query_supported_append (q, qsupported); + + if (remote_support_xml) + q = remote_query_supported_append (q, remote_support_xml); + + if (q) { - char *q; - if (rs->extended) - q = concat ("qSupported:multiprocess+;", qsupported, NULL); - else - q = concat ("qSupported:", qsupported, NULL); - putpkt (q); + char *p = concat ("qSupported:", q, NULL); xfree (q); + putpkt (p); + xfree (p); } else - { - if (rs->extended) - putpkt ("qSupported:multiprocess+"); - else - putpkt ("qSupported"); - } + putpkt ("qSupported"); getpkt (&rs->buf, &rs->buf_size, 0); diff --git a/gdb/remote.h b/gdb/remote.h index a82d0d7..d480e26 100644 --- a/gdb/remote.h +++ b/gdb/remote.h @@ -66,6 +66,7 @@ extern void (*deprecated_target_wait_loop_hook) (void); void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes, const struct target_desc *tdesc); +void register_remote_support_xml (const char *); void remote_file_put (const char *local_file, const char *remote_file, int from_tty); -- 2.7.4