-
-
Notifications
You must be signed in to change notification settings - Fork 827
Description
After #2010, in January builds and later, I've noticed GDB version 12.1.90 stopped working properly with BMP firmware v2.0.0-rc1 and BMDA.
git bisect
narrowed it down to this commit: v1.10.0-1548-g 1a9fc96. For reference, git describe v2.0.0-rc1~1
says v1.10.0-1606-g74fd17d0
.
The interaction prevents debugging after hitting a breakpoint or doing line-stepping via next
, including GUI buttons of Eclipse CDT.
New inferior 2
New thread 1
Truncated register 17 in remote 'g' packet
or, more verbosely,
Sending packet: $vCont?#49...Ack
Packet received: vCont;c;C;s;t
Packet vCont (verbose-resume) is supported
Sending packet: $vCont;c#a8...Ack
Packet received: T05thread:1;
Sending packet: $qAttached#8f...Ack
Packet received: 0
Packet qAttached (query-attached) is supported
[New inferior 2]
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
[New Thread 1]
Sending packet: $g#67...Ack
Packet received: 000000204C020020942300200000000094230020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00900020D35F00081C5200080000006100900020FCFFFFFF00000000
Truncated register 17 in remote 'g' packet
Affected versions:
- GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major)
10.1.90.20201028-git
from ARM GNU-RM https://developer.arm.com/downloads/-/gnu-rm - GNU gdb (GNU Tools for STM32 10.3-2021.10.20211105-1100)
10.2.90.20210621-git
from STM32CubeIDE v1.10.0 https://github.com/STMicroelectronics/gnu-tools-for-stm32/tree/10.3-2021.10 - GNU gdb (GNU Tools for STM32 11.3.rel1.20230519-1941)
12.1.90.20220802-git
from STM32CubeIDE v1.13.0 https://github.com/STMicroelectronics/gnu-tools-for-stm32 - GNU gdb (xPack GNU Arm Embedded GCC x86_64)
12.1.90.20221210-git
from Arduino stm32duino core pulling xPack gcc-12.2 tarball, https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/tree/v12.2.1-1.2 - likely gdb-multiarch 12.0.90, 12.1 from Ubuntu jammy 22.04 LTS (can test, haven't tested yet). https://packages.ubuntu.com/jammy-updates/gdb-multiarch
Newer versions work correctly:
- GNU gdb (xPack GNU Arm Embedded GCC x86_64)
13.2.90.20231008-git
from xPack gcc-13.2 https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/tree/v13.2.1-1.1 - GNU gdb (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))
14.2.90.20240526-git
fromarm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads - gdb-multiarch
13.1-2ubuntu2.1
(from Ubuntu lunar), self-built via dpkg-buildpackage (release gone) - gdb-multiarch
15.1-1ubuntu2
(from Ubuntu oracular), self-built https://packages.ubuntu.com/oracular/gdb-multiarch
(and PR2010 was likely tested on some new enough version).
Older versions also work correctly:
- GNU gdb (GNU Tools for Arm Embedded Processors 8-2019-q3-update)
8.3.0.20190703-git
from ARM GNU-RM - GNU gdb (GNU Tools for ARM Embedded Processors 7-2018-q2-update)
8.1.0.20180315-git
from ARM GNU-RM - GNU gdb (GNU Tools for ARM Embedded Processors)
7.8.0.20150604-cvs
from Ubuntu trusty/xenial gcc-arm-none-eabi-4_9 (release gone)
I've tried some workaround, that is replacing reported thread "1" with "p1.1", and it helped unbreak operation until next Run (with vKill).
https://github.com/ALTracer/blackmagic/commits/fix/gdb-10-12-thread/
Inspiration from daniel5151/gdbstub#104 which is a Rust gdbstub for armv4t tested against gdb-11.2.
I see three ways out of this:
- BMD org declares GDB 10, 11, 12 too broken to support, obsolete, legacy, unsupported, so users have to upgrade GDB (or stop using BMF-v2.0 on BMP).
- Maintainers revert the offending commit which does not solve an existing problem IMO (optional diagnostic logging from gdb internals with "guess" messages is not a problem, it always guesses the thread correctly).
- Me or maintainers evolve the thread-reporting logic to some form which would work correctly across this many gdb versions, just like it used to work before that commit.
Related to #2018 (same symptoms).
See also bminor/binutils-gdb@2f761de which was merged by gdb-13.1-release.