Re: gdb 8.3.1 truncated register in remote g packet

Luis Machado
2019-11-01T20:27:30Z

Hi,

On 11/1/19 3:24 PM, Reinoud Koornstra wrote:
> On Fri, Nov 1, 2019 at 9:11 AM Luis Machado <luis.machado@linaro.org
> <mailto:luis.machado@linaro.org>> wrote:
>
> Hi Reinoud,
>
> Hi Luis,
> Thanks for your response.
>
>
> That error means your remote arm32 machine's debugging stub doesn't
> agree with GDB in terms of the register set. GDB is likely assuming
> register set A and the debugging stub is assuming register set B.
>
> You can check what the debugging stub is sending via "set debug remote
> 1". If it supports XML register descriptions, you'll see data flying by.
>
> If it doesn't, then GDB is probably making a guess as to what the
> proper
> register set is.
>
> In summary, i think we need more data in order to make an informer
> guess
> on what is going wrong here, but probably GDB and the debugging stub
> are
> not in sync in terms of registers.
>
> Â Here's more output with debug remote.
> sudo gdb-for-arm/bin/arm-linux-gnueabihf-gdb ./vmlinux
> GNU gdb (GDB) 8.3.1
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "--host=x86_64-pc-linux-gnu
> --target=arm-linux-gnueabihf".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> Â  Â  <http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from ./vmlinux...
> (gdb) set serial baud 115200
> (gdb) set debug remote 1
> (gdb) target remote /dev/ttyUSB4
> Remote debugging using /dev/ttyUSB4
> Sending packet:
> $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df...Ack
> Packet received:
> Packet qSupported (supported-packets) is NOT supported

This is not great.

If the debugging stub doesn't support qSupported, then it means GDB will
need to guess what the stub's register set is, and that can be tricky.

Do you know what register set the debugging stub is using?

> Sending packet: $vMustReplyEmpty#3a...Ack
> Packet received:
> Sending packet: $Hg0#df...Ack
> Packet received: OK
> Sending packet: $qTStatus#49...Ack
> Packet received:
> Packet qTStatus (trace-status) is NOT supported
> Sending packet: $?#3f...Ack
> Packet received: S05
> Sending packet: $qfThreadInfo#bb...Ack
> Packet received:
> mfffffffe,fffffffd,01,02,03,05,06,07,08,09,0a,0b,0c,0d,0e,0f,10,11,12
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0147,014a,014c,0164,016f,0198,01a3,01a9,01dc,01ea,04b3,0502,0511,0512,0513,0514,0515
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0523,0524,0525,0535,0540,0548,0614,098d,0992,0993,09bf,09c2,09c8,09cd,09ce,09db,09e1
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m09ea,09f7,09ff,0a36,0a3e,0a4b,0a51,0a57,0a58,0a5a,0a5b,0a5d,0a5e,0a5f,0aa4,0aa6,0aa8
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0af2,0af3,0af4,0afa,0afc,0b7d,0b9a,0b9b,0b9c,0c1d,0cb8,0b96,0be9,0beb,0bf7,0bfb,0bfc
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0bfd,0bfe,0bff,0c00,0c01,0c02,0c03,0c04,0c05,0c06,0c60,0c65,0c67,0c68,0c6d,0c6e,0c7c
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0c7d,0c7f,0ce5,0df6,0e2f,0e39,0e3b,0e3d,0e5d,0e3e,0e3f,0e41,0e8c,0e8e,0ea3,0eaf,0ebc
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m0ebe,0ebf,0ec1,0ec2,0ec5,0ec7,0ec9,0ed0,0ed3,0ed4,0eca,0ecc,0ece,0ecf,0ed2,0edc,1061
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m1105,13fb,144c,145a,14b6,14c8,14cd,14e0,14f4,150b,1510,1511,1512,1514,1699,169b,169d
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m169e,169f,16a0,16a1,16a2,16cd,16cf,16d1,16d2,16d3,16d7,16dd,16de,16df,16e0,16e1,16e2
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m16e3,16e4,16e6,1961,1c81,1c82,1c83,1c84,1c85,1c86,1c87,16f2,16f3,16f5,16f6,16fc,1758
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m1759,175a,16f7,16f8,16fa,1704,1706,1719,1723,1724,1725,1734,1735,1741,1744,1747,1877
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m187b,187d,1880,188f,1893,193b,1949,194a,194f,1952,1957,1a78,1c75,1c77,1c9d,1eb4,1eb6
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> m1eb8,1ebe,29ed,0149,096c,1334,184d,1df6,1f3f,2123,2165,2175,2183
> Sending packet: $qsThreadInfo#c8...Ack
> Packet received:
> Sending packet: $qAttached#8f...Ack
> Packet received:
> Packet qAttached (query-attached) is NOT supported
> Sending packet: $Hc-1#09...Ack
> Packet received: OK
> Sending packet: $qC#b4...Ack
> Packet received: QC0aa8
> Sending packet: $qOffsets#4b...Ack
> Packet received:
> Sending packet: $g#67...Ack
> Packet received:
> 0000000001000000b0829e80ac829e8054829880b4a698806700000013000060060000000000000000000000cc3e27bed03e27bec03e27be10200a80581f0a8000000000000000000000000000000000000000000000000000000000000000000000000000000000
> Truncated register 19 in remote 'g' packet

Could you verify if there is real truncation in the data transmission?
Do you have access to what the debugging stub is sending?