Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "J.T. Conklin" <jtc@redbacknetworks.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@cygnus.com
Subject: Re: breakpoint extension for remote protocol
Date: Thu, 01 Apr 1999 00:00:00 -0000	[thread overview]
Message-ID: <199901050119.RAA19672@jtc.redbacknetworks.com> (raw)
In-Reply-To: <36907643.B544214C@cygnus.com>

> Stu Grossman wrote:
> >  > Did you know
> >  > that some targets actually implement hardware breakpoints by poking the
> >  > registers directly?
> >
> > Yes, and this is a complete sin.

> And J.T. Conklin also wrote:
> > > Did you know that some targets actually implement hardware
> > > breakpoints by poking the registers directly?
> >
> > I saw that.  Yuck.
> >
> 
> Hmm, must be missing something. I don't see the problem.
> 
> Assuming that the existing GDB protocol was fixed so that system
> registers (such as the hardware breakpoint) could be correctly
> configured using `R' commands, I think it is a reasonable solution.
> In fact, I think, in many ways it is better than the alternative of
> trying to embed too many smarts in the on board ROM.

The reason I dislike the idea of GDB manipulating debug registers
directly has more to do with the state of GDB's internals than it
does with the concept itself.

* Although processors within a CPU family usually have the same user-
  level architecture, there are often major system-level differences
  of which GDB remains blissfully unaware.  In order to have generic
  embedded toolchains, GDB would have to have run-time configuration/
  selection of many different CPUs.  

  (IMO having "generic" embedded toolchains is essential.  It makes no
  sense to have multiple toolchains for essentially the same processor
  (ie. sparc, sparclite, sparclet, etc.) when one would do.)

* OK, I'll admit that my first statement is grossly simplified.  In
  fact, many CPU families have user-level differences which evolved
  as new versions have been designed.  For the most part, GDB is able
  to simply ignore the differences.  System-level differences can not
  be ignored so easily.  And when there might be a handful of user-
  level APIs, there may be many, many more if you consider system-
  level differences.

  Those targets that already have a "set processor" command to (re-)
  name registers (ie mips, sh) do so in what I consider a rather 
  klunky manner.  I'm not sure it would scale to all the user/system
  combinations.  The "register sets" idea I mentioned last month may
  help to address this, but more work is needed.

If these problems can be addressed, this might actually be a good and
valuable thing.  I have had occasions where direct access to MMU, etc. 
registers would have been useful in my projects.  But what I'm afraid
would happen is that we'll have proliferation of more and more GDBs
configs that should be one.

>     The cost of a replacing that GDB ROM monitor once it is in the
> field would be expensive when compared to the cost of tweeking the
> target specific GDB source code.  In addition, by having the
> intelligence in GDB (and the monitor just providing direct access to
> registers) it becomes easier to extend that target with additional
> functionality as it is added to GDB.

Although the upgrade costs are there, I think that many (most?) of the
designs that:

     1) have remote debugging enabled in the field
     2) use any of the CPUs supported by the GNU toolchain

will be 

     3) field upgradable.

I suspect any "monitor" would simply be a bootloader / flash upgrader,
while any GDB support will be in the application firmware itself.  At
least I hope so.  Regardless of whether GDB sends a insert hw break/
watch point command or manipulates some new register(s), the GDB stub
is going to have to be changed.

     --jtc


  reply	other threads:[~1999-04-01  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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
1999-04-01  0:00               ` GDB: one version for all targets Brendan Simon
1999-04-01  0:00                 ` Stan Shebs
     [not found] <199901050119.RAA19672.cygnus.gdb@jtc.redbacknetworks.com>
1999-04-01  0:00 ` breakpoint extension for remote protocol Andrew Cagney
1998-12-04 10:59 J.T. Conklin
1998-12-23 13:07 ` Greg McGary

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=199901050119.RAA19672@jtc.redbacknetworks.com \
    --to=jtc@redbacknetworks.com \
    --cc=ac131313@cygnus.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