Automatically use hardware watchpoints

Vladimir Prus vladimir@codesourcery.com
Wed Nov 1 11:48:00 GMT 2006


Hello!

At the moment, gdb is not very good at debugging applications in flash:
	- you must remember to use 'hbreak' and not 'break'
	- a number of commands (like "next") want to use breakpoints
        internally. Since software breakpoints do no work, those commands
        do no work either.

This patch makes insert_bp_location automatically decide what breakpoint type 
should be used if the target provides a memory map. 

Tested by running binary from flash and observing that 'break', 'step', 'next' 
and 'finish' all work fine, while they did not work before. OK?

There are couples of other calls to target_set_breakpoint that are not 
affected by this patch. On a preliminary look, one call is executed only for 
one system (hppa) and the other call seems wrong. I'll look into that more 
and will send a separate patch.

- Volodya

gdb/
	* breakpoint.c: Include "memattr.h".
	(automatic_hardware_breakpoints): New.
	(show_automatic_hardware_breakpoints): New.
	(insert_bp_location): Automatically use
	hardware breakpoints.
	(_initialize_breakpoint): Register the "auto-hw"
	variable.
	* Makefile.in (breakpoint.o): Update dependencies.

gdb/doc
	* gdb.texinfo (Setting breakpoints): Document
	automatic software/hardware breakpoint usage and
	the "set breakpoint auto-hw" command.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: breakpoint.diff
Type: text/x-diff
Size: 4221 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20061101/9bb9cbac/attachment.bin>


More information about the Gdb-patches mailing list