From: "J.T. Conklin" <jtc@redbacknetworks.com>
To: gdb@cygnus.com
Subject: breakpoint extension for remote protocol
Date: Fri, 04 Dec 1998 10:59:00 -0000 [thread overview]
Message-ID: <199812041858.KAA25185@jtc.redbacknetworks.com> (raw)
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
next reply other threads:[~1998-12-04 10:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-04 10:59 J.T. Conklin [this message]
1998-12-23 13:07 ` Greg McGary
[not found] <199812041858.KAA25185.cygnus.gdb@jtc.redbacknetworks.com>
1998-12-10 19:27 ` 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 ` J.T. Conklin
[not found] <199901050119.RAA19672.cygnus.gdb@jtc.redbacknetworks.com>
1999-04-01 0:00 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199812041858.KAA25185@jtc.redbacknetworks.com \
--to=jtc@redbacknetworks.com \
--cc=gdb@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox