我正在尝试使用OpenOCD与GDB一起在我的STM32F4Discovery板上调试STM32F4 Cortex-M4。
设置:
我确保在STM32CubeMX中启用了调试线(这使调试引脚保持在默认状态)
GCC旗是:
-mcpu=cortex-m4 -mthumb -mthumb-interwork -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -g -fno-common -fmessage-length=0我增加了简单的闪烁LED代码到主循环,以测试调试。
我从OpenOCD开始使用openocd -f board/stm32f4discovery.cfg -c "program build/discovery_simple_test.elf verify reset"。OpenOCD会闪烁芯片并重置它。( OpenOCD的输出可以找到这里)
现在我用GDB连接到它:
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x08001450 in ?? ()
(gdb) set verbose on
(gdb) file "/abs_path/build/discovery_simple_test.elf"
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Load new symbol table from "/abs_path/build/discovery_simple_test.elf"? (y or n) y
Reading symbols from /abs_path/build/discovery_simple_test.elf...done.
Reading in symbols for /abs_path/Src/main.c...done.
(gdb) monitor reset
(gdb) break main
Breakpoint 1 at 0x8000232: file /abs_path/Src/main.c, line 71.
(gdb) break /abs_path/Src/main.c:93
Breakpoint 2 at 0x8000258: file /abs_path/Src/main.c, line 93.程序应该在第93行中断,但它没有。
当我停止执行并尝试继续执行时,它不会继续:
(gdb) monitor halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x080006d8 msp: 0x2001ffe8
(gdb) monitor continue
//Program doesn't continue这是怎么回事,我该怎么解决呢?
发布于 2020-04-19 16:11:11
为了解决这个问题,我在openocd中添加了以下命令:-c gdb_breakpoint_override hard
发布于 2016-12-12 18:59:36
可能是另一个GDB-实例正在运行?
“一个程序已经在调试了。”寻找一个“手臂-没有-eabi-gdb”的过程并杀死它。
发布于 2019-05-16 16:33:23
我想要使用的命令只是continue,而不是monitor continue,因为您必须告诉GDB底层软件正在运行。
monitor continue告诉嵌入式系统继续,但是GDB不知道它(它不解释monitor命令的含义,openocd知道)。
https://stackoverflow.com/questions/41092143
复制相似问题