This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
It seems like GDB supports setting a watchpoint, but the hardware is unable to actually do it:
(gdb) watch *0xe0e8 Hardware watchpoint 1: *0xe0e8 (gdb) c Continuing. Warning: Could not insert hardware watchpoint 1. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints. Command aborted. (gdb) info watchpoints Num Type Disp Enb Address What 1 hw watchpoint keep y *0xe0e8
Does the MSP430 just not support watchpoints or do I have to go about it differently?
Hi Mike!
Did you know that you can enable watchpoints directly in CCS? This is further described in section 7.4.7.2 in our CCS user's guide:
Is there a specific reason you are using GDB?
Thanks,
Mitch
I started developing my application in CCS but I've now transitioned to the msp430-gcc standalone package for development/building/debugging. I moved away from the IDE in order to have a more compatible process with the other software packages included in my overall project.
If CCS supports watchpoints, I assume that means my issue is related to GDB and not the msp430. Thanks for the info, that helps narrow down the problem.
Hi Mike,
Yes, the MSP430 supports watchpoints. I will go ahead and close out the thread. You can re-open the thread by simply making another post and I will be notified.
Thanks,
Mitch
Unfortunately, I'm still unable to successfully set a watchpoint so my issue is not yet resolved. The syntax I used in the original post seems to be correct according to GDB documentation so I'm unsure what the problem is.
I can't tell what you are using as the gdb server. I tried out mspdebug and it appears to support watchpoints. At least in command line mode.
Watchpoint support will depend on the gdb server as it just uses the EEM hardware to monitor memory access in a slightly different way from the typical breakpoint.
I'm using the gdb agent provided by the msp430-gcc standalone debug stack.
Found here: msp430-gcc/bin/gdb_agent_console
I did some digging around in mspdebug since source code for that is available. It turns out that it sets a different type of breakpoint in response to a gdb watch command than it uses for its native setwatch command. It sets something equivalent to the mspdebug setwatch_w command which triggers only on write access.
Well, it is supposed to. While setwatch works fine neither setwatch_w nor the gdb watch command ever trigger. (setwatch_r doesn't trigger on reads either.)
I found that mspdebug was using the write by DMA condition for setwatch_w for some reason. When I removed the DMA condition it worked as expected and the gdb watch command also worked. So I suspect that your problem is with gdb_agent. Hard to say for sure since source code isn't available anywhere that I have looked.
Hi,
Thanks for reporting this.
TI maintain the GDB Agent, so I don't immediately have any solutions or suggestions to work around this. I've reported it to them and will update you when I get some some further info.
For now I would suggest trying to use mspdebug as a proxy for GDB as David suggested.
Regards,
Even though we are not yet able to resolve the issue, I appreciate your debugging efforts.
How would that work exactly? I've reached a problem that is difficult to debug without being able to set watchpoints so mspdebug might be my only option.
I've hardly used mspdebug myself, but try the steps at the end of this guide: https://gist.github.com/0/631c9006a672458eaa48
- mspdebug <device> 'prog <output_elf_file>'
- in mspdebug, run "gdb 1234"
- in msp430-elf-gdb, run "target remote :1234"
You want to program the device via gdb so that it loads your symbols. "load file.elf". But for the watchpoint to work you must have compiled mspdebug from source after altering the way it sets watchpoints. In file drivers/tilib.c look for BP_WRITE_DMA and remove the _DMA.
A ticket for this issue has been filed as DBGTRC-5335.
You can track it directly here: cqweb.ext.ti.com/.../DBGTRC-5335
**Attention** This is a public forum