Skip to content

Unable to debug > gdb/cp-namespace.c:343: internal-error #23

@epsilonrt

Description

@epsilonrt

Hi,
I've been trying to get TeensyDebug working under VsCode/platformio (Windows11) for a week.

I have an error when launching the debug:

Reading symbols from C:\Users\pasca\OneDrive\Documents\epsilonrt\src\eFlexPwmTest\.pio\build\teensy41-debug\firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote target...
pulseInLong (pin=<error reading variable: Cannot access memory at address 0xfffffff7>, state=<error reading variable: Cannot access memory at address 0xfffffff6>, timeout=<error reading variable: Cannot access memory at address 0xfffffff0>) at C:\Users\pasca\.platformio\packages\framework-arduinoteensy\cores\teensy4/WProgram.h:83
83	static unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout) {
PlatformIO: Initialization completed
/home/build/work/GCC-5-build/src/gdb/gdb/cp-namespace.c:343: internal-error: cp_search_static_and_baseclasses: Assertion `name[prefix_len + 1] == ':'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? 
(y or n) [answered Y; input not from terminal]

This is a bug, please report it.
  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.


/home/build/work/GCC-5-build/src/gdb/gdb/cp-namespace.c:343: internal-error: cp_search_static_and_baseclasses: Assertion `name[prefix_len + 1] == ':'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? 
(y or n) [answered Y; input not from terminal]

I followed all the recommendations of the README and the forum to configure the platformio.ini:

[env:teensy41-debug]
platform = teensy
framework = arduino
board = teensy41
upload_protocol = teensy-cli
build_type = debug
lib_deps = 
  https://github.com/ftrias/TeensyDebug/archive/refs/heads/master.zip
  epsilonrt/eFlexPwm@^0.2.1

; activate Dual USB just as README says
build_flags =
    -DUSB_DUAL_SERIAL
    -DDEBUG                   # Comment out to disable debugging.

build_unflags = 
    -DUSB_SERIAL

debug_build_flags = -O0 -g2 -ggdb2
debug_port = COM3
debug_tool = custom
debug_load_mode = manual
debug_server = 
debug_init_cmds =
  target extended-remote $DEBUG_PORT
  $INIT_BREAK
  define pio_reset_run_target
  interrupt
  tbreak loop
  continue
  end
  define pio_restart_target
  echo Restart is undefined for now.
  end

debug_init_break = 

I followed the gdb bug trail, and tried to modify the gdb version, unfortunately, when I put platformio/toolchain-gccarmnoneeabi@^1.100301.220327 I have errors when linking:

c:/users/pasca/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libg.a(lib_a-sprintf.o):(.ARM.exidx.text.sprintf+0x4): relocation truncated to fit: R_ARM_PREL31 against .ARM.extab.text.sprintf'`

Thank you for your help and advices !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions