-
Notifications
You must be signed in to change notification settings - Fork 334
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
Support for adding data watchpoints #1151
Comments
Doesn't |
Here is the function in discussion: https://github.com/riscv-collab/riscv-openocd/blob/riscv/src/target/riscv/riscv.c#L1514 As you can observe, there is no reference to the 'select' field. |
@RaamyPi, AFAIK neither GDB, nor OpenOCD provides means to set a watchpoint on data values (i.e. there is no "select" in OpenOCD's If you wish for this feature to be supported (on the level of In the meantime nothing prevents you from setting the watchpoint on data values manually, by reserving the trigger ( |
Hi @en-sc, I think you're correct about GDB: but doesn't OpenOCD support this via the
|
@TommyMurphyTM1234, thanks! I've missed it. Then it's a bit easier. RISC-V targets can provide support for OpenOCD watchpoints with |
FWIW this code seems to explicitly check for and reject watchpoints that specify a data value to match:
It's certainly feasible but I'm not sure about "easy"? At the moment the code seems to be predicated on using one trigger per watchpoint (and hardware breakpoint?) whereas this change would require additional trigger resource management and availability checking in order to deal with the situation where two triggers are required for a data watchpoint with a value match? |
Not exactly. RISC-V OpenOCD already uses chained triggers, e.g. to set an unaligned watchpoint: riscv-openocd/src/target/riscv/riscv.c Line 1067 in a4020f1
|
Ah - OK - thanks. I wasn't aware of that. 👍 |
@en-sc thank you, I shall follow this up.
@en-sc you're right and I have already tried this as well but this is impractical as gdb is not aware of these artifical watchpoints. |
Even if/when OpenOCD is extended to support value option on data watchpoints this may still be the case given that GDB doesn't have such an option. Unless it will have some awareness of watchpoints set using something like |
GDB definitely has to be extended as well, I wanted to take up the openocd side of things before that. |
According to the latest debug spec (dated May 15, 2024), the select field in mcontrol and mcontrol6 provides an option to configure a watchpoint to break on address/data but openocd doesn't have any reference to this field.
The text was updated successfully, but these errors were encountered: