Skip to content

GNU gdb 10-12 "New inferior" bug with BMD v2.0.0-rc1 #2112

@ALTracer

Description

@ALTracer

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:

Newer versions work correctly:

(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:

  1. 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).
  2. 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).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions