Mirror of the gdb mailing list
 help / color / mirror / Atom feed
[parent not found: <199901050119.RAA19672.cygnus.gdb@jtc.redbacknetworks.com>]
* breakpoint extension for remote protocol
@ 1998-12-04 10:59 J.T. Conklin
  1998-12-23 13:07 ` Greg McGary
  0 siblings, 1 reply; 16+ messages in thread
From: J.T. Conklin @ 1998-12-04 10:59 UTC (permalink / raw)
  To: gdb

I've been tasked to add support for hardware watch/breakpoints over
the remote protocol.  

This is what I'm thinking so far: A create breakpoint command would
insert a breakpoint insn or set the appropriate debug registers.  A
cooresponding delete breakpoint command would remove a breakpoint.

Having stubs manage their own breakpoints may even be adventageous for
systems without hardware breakpoints.  As GDB inserts breakpoint insns
directly in the text segment, it requires the text segment to be read/
write.  Errors that would ordinarily cause an exception could pass
unnoticed.  The mem write command could be modified to write enable
the page, copy the data, and then write protect it again; but doing
those protection modifications only when breakpoints are inserted and
removed protects the user from inadvertantly using GDB to modify read
only data.

This of course, would require the stubs to keep track of more
information.  In many cases allocating breakpoint contexts dynamically
would be impossible or undesirable (it is likely that you couldn't use
the same dynamic memory allocator as the rest of the system (if indeed
such a facility was available) as it wouldn't be safe to use in an
interrupt/exception context).  As such, the protocol will have to have
a mechanism to indicate that all available breakpoints have been
allocated.  This is probably not much of a concern, since ROM monitors
and hardware watch/breakpoint registers have similar constraints.  I'd
like to not limit the number of contexts to a fixed number, as some
systems/debugging situations may need many more than others.

Here is the protocol elements that I'm currently working with:

    Insert Breakpoint:	   B<type>,<address>[,<length>]
    returns:		   ??	- A cookie representing the breakpoint
			   EX	- breakpoint type not supported
				- no breakpoint contexts available
				- invalid/unsupported address
				- invalid/unsupported length

    Remove Breakpoint:	   D<cookie>
    returns:		   OK	- breakpoint removed
			   EX	- breakpoint <cookie> not found


    <type>		   'r', 'w', 'x' for read, write, or execute.
    <address>		   A target address
    <length>		   1, 2, or 4; number of bytes for read or 
			   write watchpoint.

When the target is started (step, continue), the stub is responsible
for installing breakpoints instructions.  Likewise, when the stub
regains control, it is responsible for removing breakpoints.

	--jtc


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1999-04-01  0:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <199812041858.KAA25185.cygnus.gdb@jtc.redbacknetworks.com>
1998-12-10 19:27 ` breakpoint extension for remote protocol Andrew Cagney
1998-12-10 21:46   ` Stu Grossman
1998-12-11 11:59     ` J.T. Conklin
1998-12-11 14:30       ` J.T. Conklin
1998-12-11 11:24   ` J.T. Conklin
     [not found]   ` <13936.45476.191551.329690.cygnus.gdb@babylon-5.cygnus.com>
1999-04-01  0:00     ` Andrew Cagney
1999-04-01  0:00       ` J.T. Conklin
1999-04-01  0:00         ` Stan Shebs
1999-04-01  0:00           ` Jim Blandy
1999-04-01  0:00             ` Stan Shebs
1999-04-01  0:00               ` GDB: one version for all targets Brendan Simon
1999-04-01  0:00                 ` Stan Shebs
1999-04-01  0:00               ` breakpoint extension for remote protocol J.T. Conklin
     [not found] <199901050119.RAA19672.cygnus.gdb@jtc.redbacknetworks.com>
1999-04-01  0:00 ` Andrew Cagney
1998-12-04 10:59 J.T. Conklin
1998-12-23 13:07 ` Greg McGary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox