-
Notifications
You must be signed in to change notification settings - Fork 307
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
OpenOCD return error when using GDB to hit hardware breakpoints on hardware that doesn't support them. #1034
Comments
You mention hardware breakpoints in the name of the issue. However, the line you are referring to is related to processing of software breakpoints: riscv-openocd/src/server/gdb_server.c Line 1829 in cb2b394
Are you sure you have determined the source of the issue correctly? Please, attach OpenOCD |
Sorry, I got the wrong line number. riscv-openocd/src/server/gdb_server.c Line 1859 in cb2b394
|
AFAIU, Please, attach OpenOCD |
OpenOCD log
OpenOCD
|
ERROR_NOT_IMPLEMENTED is returned if OpenOCD does not implement something (not the target). Here the behavior is as expected. You try to set a HW breakpoint -> you have no available resources -> you get an error. GDB should not disconnect in such a case. Which GDB version are you using? |
GDB version I want to make sure that the error code is |
Again, OpenOCD should return ERROR_TARGET_RESOURCE_NOT_AVAILABLE here since no HW resources available. ERROR_NOT_IMPLEMENTED is for the cases when something is not impleneted in OpenOCD itself. Here is the debug session from gdb 13.2:
GDB is not disconnected. it simply aborts the "continue" command since it can't set HW watchpoint. |
That's the problem I'm having, and I'm not expressing it clearly. At this point it is not possible to use commands such as continue or single-step unless the hardware breakpoint is removed, is it possible to just warn without returning an error? |
But that's the intended behavior for GDB. You've explicitly asked to set a HW watchpoint. GDB is unable to do so. GDB is unable to proceed unless you cancel this request. |
If you're trying to report and analyse an OpenOCD issue then it might make more sense to use OpenOCD standalone and its Telnet interface to interact with the program/target obviating the need for GDB and thus simplifying the diagnosis? Also, the code that you're referring to in |
I presume that the question is answered. The behavior you have is the expected one. Let us know if you think that there is something that needs to be changed. |
I think it's better to report a warning when this behaviour is detected than to report an error outright.
reporting an error will cause GDB to disconnect
riscv-openocd/src/server/gdb_server.c
Line 1832 in cb2b394
The text was updated successfully, but these errors were encountered: