• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónb35d5edb03798388d503d922d8f909a133bf93dd (tree)
Tiempo2015-11-20 03:31:49
AutorPedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

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:

static void
x86_linux_process_qsupported (const char *query)
{
/* Return if gdb doesn't support XML. If gdb sends "xmlRegisters="
with "i386" in qSupported query, it supports x86 XML target
        1. */
use_xml = 0;
if (query != NULL && startswith (query, "xmlRegisters="))
{

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);

}
x86_linux_update_xmltarget ();
}

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.

Cambiar Resumen

Diferencia incremental

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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+
16 2015-11-19 Simon Marchi <simon.marchi@ericsson.com>
27
38 * nat/aarch64-linux-hw-point.c (aarch64_linux_set_debug_regs): Change
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4467,9 +4467,6 @@ remote_query_supported (void)
44674467 if (packet_set_cmd_state (PACKET_hwbreak_feature) != AUTO_BOOLEAN_FALSE)
44684468 q = remote_query_supported_append (q, "hwbreak+");
44694469
4470- if (remote_support_xml)
4471- q = remote_query_supported_append (q, remote_support_xml);
4472-
44734470 q = remote_query_supported_append (q, "qRelocInsn+");
44744471
44754472 if (rs->extended)
@@ -4488,6 +4485,11 @@ remote_query_supported (void)
44884485 if (packet_set_cmd_state (PACKET_vContSupported) != AUTO_BOOLEAN_FALSE)
44894486 q = remote_query_supported_append (q, "vContSupported+");
44904487
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+
44914493 q = reconcat (q, "qSupported:", q, (char *) NULL);
44924494 putpkt (q);
44934495