【问题标题】:Incorrect line numbers in gdb with openocd and contiker ng使用 openocd 和 contiker ng 的 gdb 中的行号不正确
【发布时间】:2021-09-02 06:27:24
【问题描述】:

我正在尝试使用 OpenOCD 调试在 LaunchPad CC1312r1 板上运行的 Contiki-ng 应用程序。当我在源文件中的一行添加断点时,gdb 获取错误的行号。

(gdb) b packet-send.c:34
Breakpoint 1 at 0x14d46: file ../seneco/communication/udp/packet-send.c, line 60.

我编写了一个小型演示应用程序,它工作正常,但我无法在我应该调试的应用程序中获得正确的行号。

(gdb) b my-cng-example.c:57
Breakpoint 1 at 0xa072: file my-cng-example.c, line 57.

我已经尝试在我的本地 PC 上使用 contiki-ng docker 映像进行编译。我试过 gdb-multiarch 和 arm-none-eabi-gdb。我正在使用 TI 的 OpenOCD 存储库,它支持 LaunchPad CC1312r1。

调试器报告以下编译器标志:

(gdb) info source
Current source file is ../seneco/communication/udp/packet-send.c
Compilation directory is /home/david/gitlab/seneco-contiki-ng/seneco
Located in /home/david/gitlab/seneco-contiki-ng/seneco/communication/udp/packet-send.c
Contains 65 lines.
Source language is c.
Producer is GNU C99 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] -mcpu=cortex-m4 -mthumb -mabi=aapcs -mlittle-endian -mfloat-abi=soft -march=armv7e-m -g -O0 -Os -std=c99 -fno-common -ffunction-sections -fdata-sections -fno-strict-aliasing -fshort-enums -fomit-frame-pointer -fno-builtin.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.

【问题讨论】:

    标签: arm gdb gdbserver openocd contiki-ng


    【解决方案1】:

    我试图设置断点的行已被预处理器定义删除。 gdb 只是在下一个有效行设置断点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-29
      • 2011-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多