Issue to Beware of In Debugging OpenOCD

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Issue to Beware of In Debugging OpenOCD

1,349 次查看
tharonhall
Contributor IV

I was having an issue in which, out of the blue, I could not debug my FRDM-K22F board with the P&E OpenOCD driver for anything, and it had been working flawlessly before. It would start to connect, then disconnect with no indication as to why it did so. You might see a message like:

 

Initializing.

Target has been RESET and is active.

Disconnected from "127.0.0.1" via 127.0.0.1

Target Disconnected.

 

The problem turns out to be that if you create a breakpoint for code you later remove, and do not COMPLETELY delete the breakpoint (not just disable it) the debugger just crashes without any warning at startup and provides nothing to indicate why. I just about pulled my hair out figuring this one out.

 

I found the answer on the P&E Forum: P&E Microcomputer Systems

 

Hope this tip saves someone some heartache!

标签 (1)
标记 (4)
2 回复数

1,111 次查看
tharonhall
Contributor IV

Quick follow up - Since posting this I have at least two more encounters with this behavior and fixed it by deleting the breakpoints completely. I think the problem may occur not just if the code is removed, but if there are changes near the break point code.

0 项奖励
回复

1,111 次查看
BlackNight
NXP Employee
NXP Employee

I believe this is a GDB bug (problem with breakpoints/watchpoints on non-existing code, see Failed to Debug with GDB: Breakpoints or Expressions on non-existing Locations | MCU on Eclipse).

So this is not a problem of OpenOCD, P&E or Segger (the problem occurs for all of them), but a problem of the GDB used in the GNU 4.8 version. GNU 4.9 (launchpad, see above article) does not show the problem for me.

Erich