This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Hardware breakpoints when using i386 simulator


David Welch wrote:
> 
> Hi,
> 
> I'm using gdb 5.0 to debug an os kernel running on an i386 simulator
> called bochs. The bochs remote stub supports hardware breakpoints but
> instead of sending a request, gdb tries to set breakpoints as if the
> program was running locally. I'd like to fix this, my initial idea was
> that i386_insert_watchpoint should check if the current target is a remote
> one and call remote_insert_watchpoint. Is this the right approach?

Hardware breakpoints or watchpoints?

For breakpoints, GDB should first try a ``Z'' packet and then, only if
that fails, fall back to a memory breakpoint.

Use ``set debug remote 1''  before trying to set a breakpoint to see if
this is happening.

For watchpoints, these are still (unfortunatly) determined at compile
time (bug).  Your target (what was it?) may not have them enabled. 
Hardware watchpoint configury needs to be added to the gdbarch vector.

Have a look at remote.c and the macro TARGET_HAS_HARDWARE_WATCHPOINTS.

	Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]