Revisión | b35d5edb03798388d503d922d8f909a133bf93dd (tree) |
---|---|
Tiempo | 2015-11-20 03:31:49 |
Autor | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
gdb: Workaround bad gdbserver qSupported:xmlRegisters=i386;UnknwnFeat+ handling
gdbserver's target_process_qsupported is called for each feature that
the gdbserver common code does not recognize. The only current
implementation, for x86 Linux, does this:
char *copy = xstrdup (query + 13);
char *p;
for (p = strtok (copy, ","); p != NULL; p = strtok (NULL, ","))
{
if (strcmp (p, "i386") == 0)
{
use_xml = 1;
break;
}
}
free (copy);
Notice that this clears use_xml and calls x86_linux_update_xmltarget
each time target_process_qsupported is called. So if gdb sends in any
unknown feature after "xmlRegisters=i386", like e.g.,
"xmlRegisters=i386;UnknownFeature+" gdbserver ends up not reporting a
XML description...
Work around this by having GDB send the "xmlRegisters=" feature last.
gdb/ChangeLog:
2015-11-19 Pedro Alves <palves@redhat.com>
* remote.c (remote_query_supported): Send the "xmlRegisters="
feature last.
@@ -1,3 +1,8 @@ | ||
1 | +2015-11-19 Pedro Alves <palves@redhat.com> | |
2 | + | |
3 | + * remote.c (remote_query_supported): Send the "xmlRegisters=" | |
4 | + feature last. | |
5 | + | |
1 | 6 | 2015-11-19 Simon Marchi <simon.marchi@ericsson.com> |
2 | 7 | |
3 | 8 | * nat/aarch64-linux-hw-point.c (aarch64_linux_set_debug_regs): Change |
@@ -4467,9 +4467,6 @@ remote_query_supported (void) | ||
4467 | 4467 | if (packet_set_cmd_state (PACKET_hwbreak_feature) != AUTO_BOOLEAN_FALSE) |
4468 | 4468 | q = remote_query_supported_append (q, "hwbreak+"); |
4469 | 4469 | |
4470 | - if (remote_support_xml) | |
4471 | - q = remote_query_supported_append (q, remote_support_xml); | |
4472 | - | |
4473 | 4470 | q = remote_query_supported_append (q, "qRelocInsn+"); |
4474 | 4471 | |
4475 | 4472 | if (rs->extended) |
@@ -4488,6 +4485,11 @@ remote_query_supported (void) | ||
4488 | 4485 | if (packet_set_cmd_state (PACKET_vContSupported) != AUTO_BOOLEAN_FALSE) |
4489 | 4486 | q = remote_query_supported_append (q, "vContSupported+"); |
4490 | 4487 | |
4488 | + /* Keep this one last to work around a gdbserver <= 7.10 bug in | |
4489 | + the qSupported:xmlRegisters=i386 handling. */ | |
4490 | + if (remote_support_xml != NULL) | |
4491 | + q = remote_query_supported_append (q, remote_support_xml); | |
4492 | + | |
4491 | 4493 | q = reconcat (q, "qSupported:", q, (char *) NULL); |
4492 | 4494 | putpkt (q); |
4493 | 4495 |