public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Nathan J. Williams" <nathanw@wasabisystems.com>
To: gdb@sources.redhat.com
Subject: Limiting breakpoints sensibly
Date: Wed, 13 Jul 2005 22:26:00 -0000	[thread overview]
Message-ID: <mtuwtnubax6.fsf@scrubbing-bubbles.mit.edu> (raw)


I'm working on a remote stub and GDB architecture implementation for a
small embedded system, based on 6.3. Among the quirks of this system
are that the code is in flash, which is not writable from the stub's
perspective. This means that all breakpoint requests have to go
through the single breakpoint register. This works fine with one
breakpoint. However, when the user tries to insert more than one
breakpoint, things go poorly.

I wrote the stub to return an error when a breakpoint is already set;
this seemed more sensible than letting all of the requests proceed and
just taking the first or the last one. When remote_insert_breakpoint()
gets the error on the second breakpoint and bails out (with an
unfortunate error message of "Unknown error: 4294967295"), nothing
unwinds the state of the first breakpoint, and it remains set on the
target. If the user then disables the first breakpoint and sets the
second, the stub will complain about setting the second stub. If the
user disables all breakpoints and continues, the first one is still
there to fire.

What I'd like is a way to limit breakpoints with some useful
feedback. The remote_hw_breakpoint_limit variable seems like the right
thing, but it looks like it's for the user to set, and I want my
target architecture to set it somehow. Is it okay to just mash the
variable in my target init routine - nothing else seems to do that -
or is there a better approach to setting this limit?

        - Nathan

                 reply	other threads:[~2005-07-13 22:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=mtuwtnubax6.fsf@scrubbing-bubbles.mit.edu \
    --to=nathanw@wasabisystems.com \
    --cc=gdb@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).