Re: [PATCH v2 5/7] btrace, gdbserver: remove the to_supports_btrace target method

Maciej W. Rozycki
2018-02-24T16:51:54Z

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

On Fri, 26 Jan 2018, Markus Metzger wrote:

> Remove the to_supports_btrace target method and instead rely on detecting errors
> when trying to enable recording. This will also provide a suitable error
> message explaining why recording is not possible.

Hmm, v3 of this change (apparently never posted), that is specifically
commit de6242d30757 ("btrace, gdbserver: remove the to_supports_btrace
target method"), has broken remote `mips-linux' target debugging
completely, that is an attempt to make a remote connection fails in the
initial handshake, e.g.:

Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid = 25519
Listening on port 2346
target remote 1.2.3.4:2346
Remote debugging using 1.2.3.4:2346
Reading symbols from .../lib/ld.so.1...done.
0x77fc8de0 in __start () from .../lib/ld.so.1
Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.
(gdb) continue
The program is not being run.
(gdb) FAIL: gdb.base/advance.exp: can't run to main

See the attached RSP packet exchange log for details. Please investigate.

Maciej

[-- Attachment #2: Type: text/plain, Size: 10082 bytes --]

Remote debugging using 1.2.3.4:2346
Sending packet: $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386#6a...Ack
Packet received: PacketSize=3fff;QPassSignals+;QProgramSignals+;QStartupWithShell+;QEnvironmentHexEncoded+;QEnvironmentReset+;QEnvironmentUnset+;QSetWorkingDir+;qXfer:libraries-svr4:read+;augmented-libraries-svr4-read+;qXfer:auxv:read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;fork-events+;vfork-events+;exec-events+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;BreakpointCommands+;QAgent+;Qbtrace:bts+;Qbtrace-conf:b
Packet qSupported (supported-packets) is supported
Sending packet: $vMustReplyEmpty#3a...Ack
Packet received:
Sending packet: $QStartNoAckMode#b0...Ack
Packet received: OK
Sending packet: $QProgramSignals:0;1;3;4;6;7;8;9;a;b;c;d;e;f;10;11;12;13;14;15;16;17;18;19;1a;1b;1c;1d;1e;1f;20;21;22;23;24;25;26;27;28;29;2a;2b;2c;2d;2e;2f;30;31;32;33;34;35;36;37;38;39;3a;3b;3c;3d;3e;3f;40;41;42;43;44;45;46;47;48;49;4a;4b;4c;4d;4e;4f;50;51;52;53;54;55;56;57;58;59;5a;5b;5c;5d;5e;5f;60;61;62;63;64;65;66;67;68;69;6a;6b;6c;6d;6e;6f;70;71;72;73;74;75;76;77;78;79;7a;7b;7c;7d;7e;7f;80;81;82;83;84;85;86;87;88;89;8a;8b;8c;8d;8e;8f;90;91;92;93;94;95;96;97;#75...Packet received: OK
Sending packet: $Hgp0.0#ad...Packet received: OK
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: l<?xml version="1.0"?>\n \n\n \n<target>\n <architecture>mips</architecture>\n <osabi>GNU/Linux</osabi>\n <xi:include href="mips-cpu.xml"/>\n <xi:include href="mips-cp0.xml"/>\n <xi:include href="mips-fpu.xml"/>\n <xi:inclu[14 bytes omitted]
Sending packet: $qXfer:features:read:mips-cpu.xml:0,fff#24...Packet received: l<?xml version="1.0"?>\n \n\n \n<feature name="org.gnu.gdb.mips.cpu">\n <reg name="r0" bitsize="32" regnum="0"/>\n <reg name="r1" bitsize="32"/>\n <reg name="r2" bitsize="32"/>\n <reg name="r3" bitsize="32"/>\n <reg name="[13 bytes omitted]
Sending packet: $qXfer:features:read:mips-cp0.xml:0,fff#df...Packet received: l<?xml version="1.0"?>\n \n\n \n<feature name="org.gnu.gdb.mips.cp0">\n <reg name="status" bitsize="32" regnum="32"/>\n <reg name="badvaddr" bitsize="32" regnum="35"/>\n <reg name="cause" bitsize="32" regnum="36"/>\n</featu[12 bytes omitted]
Sending packet: $qXfer:features:read:mips-fpu.xml:0,fff#27...Packet received: l<?xml version="1.0"?>\n \n\n \n<feature name="org.gnu.gdb.mips.fpu">\n <reg name="f0" bitsize="32" type="ieee_single" regnum="38"/>\n <reg name="f1" bitsize="32" type="ieee_single"/>\n <reg name="f2" bitsize="32" type="ie[11 bytes omitted]
Sending packet: $qXfer:features:read:mips-dsp.xml:0,fff#23...Packet received: l<?xml version="1.0"?>\n \n\n \n<feature name="org.gnu.gdb.mips.dsp">\n <reg name="hi1" bitsize="32" regnum="72"/>\n <reg name="lo1" bitsize="32" regnum="73"/>\n <reg name="hi2" bitsize="32" regnum="74"/>\n <reg name="lo2"[12 bytes omitted]
Sending packet: $QNonStop:0#8c...Packet received: OK
Sending packet: $qTStatus#49...Packet received:
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Packet received: T051d:d0baff7f;25:e08dfc77;thread:p6a61.6a61;core:0;
Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p6a61.6a61" core="0" name="advance"/>\n</threads>\n
Sending packet: $qAttached:6a61#c7...Packet received: 0
Packet qAttached (query-attached) is supported
Sending packet: $Hc-1#09...Packet received: E01
Sending packet: $qOffsets#4b...Packet received:
Sending packet: $qXfer:libraries-svr4:read::0,fff#91...Packet received: l<library-list-svr4 version="1.0"/>
Sending packet: $qXfer:auxv:read::0,1000#6b...Packet received: l!\000\000\000\000@ÿw\020\000\000\000\000\000\000\000\006\000\000\000\000@\000\000\021\000\000\000d\000\000\000\003\000\000\0004\000@\000\004\000\000\000 \000\000\000\005\000\000\000\t\000\000\000\a\000\000\000\000\200üw\b\000\000\000\000\000\000\000\t\000\000\000À\005@\000\013\000\000\000cy\000\000\f\000\000\000cy\000\000\r\000\000\000\204\003\000\000\016\000\000\000\204\003\000\000\027\000\000\000\000\000\000\000\031\000\000\000Ó»ÿ\177\037\000\000\000\221¿ÿ\177\017\000\000\000ã»ÿ\177\000\000\000\000\000\000\000\000[10 bytes omitted]
Sending packet: $vFile:setfs:0#bf...Packet received: F0
Packet vFile:setfs (hostio-setfs) is supported
Sending packet: $vFile:open:2f70726f632f32373233332f7461736b2f32373233332f6d617073,0,1c0#db...Packet received: F3
Packet vFile:open (hostio-open) is supported
readahead cache miss 251
Sending packet: $vFile:pread:3,3fff,0#96...Packet received: F33c;00400000-00404000 r-xp 00000000 00:1d 357628039 .../gdb/testsuite/outputs/gdb.base/advance/advance\n00410000-00414000 rwxp 00000000 00:1d 357628039 .../gdb/testsuite/outputs/gdb.base/advance/advance\n77fc8000-77fec000 r-xp 00000000 00:1d 3529929641 .../lib/ld-2.27.9000.so\n77ff0000-77ff4000 r--p 00000000 00:00 0 [3 bytes omitted]
Packet vFile:pread (hostio-pread) is supported
readahead cache miss 252
Sending packet: $vFile:pread:3,3fff,33c#2f...Packet received: F0;
Sending packet: $vFile:close:3#b3...Packet received: F0
Packet vFile:close (hostio-close) is supported
Sending packet: $qXfer:libraries-svr4:read::0,fff#91...Packet received: l<library-list-svr4 version="1.0"/>
Reading symbols from .../lib/ld.so.1...done.
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Packet qSymbol (symbol-lookup) is supported
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $m77fd9d40,4#06...Packet received: 0800e003
Sending packet: $m77ff4000,34#fe...Packet received: 7f454c4601010100000000000000000003000800010000009002000034000000c40b00000510007034002000070028000f000e00
Sending packet: $m77ff4034,e0#33...Packet received: 0300007018010000180100001801000018000000180000000400000008000000000000703001000030010000300100001800000018000000040000000400000001000000000000000000000000000000980a0000980a0000050000000000010002000000d0090000d0090000d0090000c0000000c00000000400000004000000040000004802000048020000480200003c0000003c000000040000000400000050e57464000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000
Sending packet: $m77ff4000,1fff#fa...Packet received: 7f454c4601010100000000000000000003000800010000009002000034000000c40b00000510007034002000070028000f000e000300007018010000180100001801000018000000180000000400000008000000000000703001000030010000300100001800000018000000040000000400000001000000000000000000000000000000980a0000980a0000050000000000010002000000d0090000d0090000d0090000c0000000c00000000400000004000000040000004802000048020000480200003c0000003c000000040000000400000050e5746400000000000000000000000000000000000000000000000004000000000000000000000000000000
Sending packet: $m77ff5fff,1fff#9d...Packet received: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sending packet: $m77ff7ffe,2#6d...Packet received: 0000
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p6a61.6a61" core="0" name="advance"/>\n</threads>\n
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
Sending packet: $m77fc8ddc,4#67...Packet received: 00000000
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
Sending packet: $m77fc8ddc,4#67...Packet received: 00000000
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
0x77fc8de0 in __start ()
from .../lib/ld.so.1
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $qXfer:btrace-conf:read::0,fff#5c...Packet received:
Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.