-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging with OpenOCD/GDB is not working. #33
Comments
Any update on this issue ? |
The problem really is nasty. Here is, what I found out for topic 1: when you either do a step or set a breakpoint, openOCD will write a "breakpoint opcode" to the assembly instruction location you want to stop the processor. When the processor fetches this instruction, it stops and openOCD (and gdb) take control again and writes the original assembly instruction to memory. Then, the processor should be able to execute the original code, when you make the next step... But: If the instruction cache is enabled, the previously fetched breakpoint instruction is still there and will be executed again. Note that openOCD has written the original instruction to memory, but not into the instruction cache. If you perform the following command in gdb: monitor mww 0xE000EF50 0x0 you should be able to proceed from your breakpoint, at least to single step once... But this is surely not the definitive way to handle that. Another way might be to add a "hook-stop" to gdb: define hook-stop and add these lines to your gdb init script "start-gdb. This is not yet a final solution and works far from perfect, so I a still busy investigating further... |
Regarding your second topic: is "hbreak ethr_thr_create:405" actually a valid syntax to set a breakpoint at line 405? See: Obviously, breakpoint 4 is set to the first code line of function led_timer, and breakpoint 5 is set to the same line... So I don't think you can set a breakpoint on a specific line in a function, you can only set it to a line in a file... |
Hi, I had a discussion on the openocd user's list: and it seems debugging and cache usage is .... not yet properly supported for the cortex-m. So we will have to discuss, how to proceed in this matter... The solution I proposed as a work around doesn't seem to work reliably either :-( |
When trying to debug with OpenOCD and GDB, the debugger is not working properly after breaking.
First Issue
When setting a breakpoint (hardware or software) and continuing the execution GDB break correctly but then
stepi
do not advance the code pointer. This happens even when masking the interruptions.Second Issue
When setting a breakpoint at a give line number in some code compiled with debug info and without optimization (
-g -O0
) GDB set the breakpoint to the beginning of the function regardless of the specified line number.Example
Host
Ubuntu 17.04 64-bit
Intel® Core™ i7-4770K CPU @ 3.50GHz × 8
GDB Console
OpenOCD Console
The text was updated successfully, but these errors were encountered: