From: Daniel Jacobowitz <drow@mvista.com>
To: Jim Blandy <jimb@redhat.com>
Cc: Saravanan <pes@india.hp.com>, Eli Zaretskii <eliz@elta.co.il>,
gdb@sources.redhat.com
Subject: Re: Tracepoint support in Cygnus GDB ?
Date: Thu, 25 Sep 2003 04:02:00 -0000 [thread overview]
Message-ID: <20030925040205.GA21265@nevyn.them.org> (raw)
In-Reply-To: <vt2he31olrj.fsf@zenia.home>
On Wed, Sep 24, 2003 at 05:38:08PM -0500, Jim Blandy wrote:
>
> "Eli Zaretskii" <eliz@elta.co.il> writes:
> > > Date: Wed, 24 Sep 2003 16:09:49 +0530
> > > From: Saravanan <pes@india.hp.com>
> > >
> > > 1. Why does GDB not provide this support for local
> > > host ?
> >
> > Simple: because no one wrote tracepoints support for native
> > debugging.
>
> Right -- please contribute support for native tracepoints!
>
> > > 2. Is it not the case that the features (supposed to
> > > be) provided by tracepoints can be done using
> > > breakpoint features only (for instance , we can
> > > specify COMMANDS for a breakpoint just as we can
> > > specify ACTIONS for tracepoints) ?
> >
> > Yes. But tracepoints are supposed to be much more lightweight
> > (because only raw data is accumulated during the program's run, while
> > complicated and expensive computations like evaluation of arbitrary
> > expressions, are left for later). So, theoretically, if tracepoints
> > were available for native debugging, one could perhaps debug programs
> > without disrupting their time scale too much, maybe even debug
> > real-time programs (well, one's allowed to dream once in a while,
> > right? ;-).
>
> Actually, the tracepoint system *does* evaluate arbitrary expressions
> each time a tracepoint is hit. The expressions are compiled to a
> bytecode which is pretty simple to interpret. Here's why it's
> lightweight:
> - The bytecode has had all the symbolic work squeezed out of it ---
> it's just a bunch of pretty standard machine-level operations on
> machine words. No name lookups, no type checking, etc. So it can
> run in much less memory and much less time than GDB's evaluator.
> - This means that it can be evaluated entirely on the target. No
> communication with the host is needed. You can do a lot of
> computation in the time it takes a byte to go across a serial line.
>
> There are a bunch of ways we could support this on a native system:
>
> - We could implement it as an extension to ordinary breakpoints:
> hitting a tracepoint would stop the inferior; GDB would collect the
> data, and then continue the inferior. I think this might not be so
> lightweight.
>
> - We could implement a tracing agent that would actually live in the
> inferior and catch some sort of trap. This would be more complex,
> but it would disturb the inferior less.
Or do it via dynamic code replacement at the start of functions.
That's even lighter, though a bit hard to get right.
I hope to work on this - some day. Gotta get through dwarf
improvements first :)
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-09-25 4:02 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-24 10:40 Saravanan
2003-09-24 18:12 ` Eli Zaretskii
2003-09-24 22:41 ` Jim Blandy
2003-09-25 4:02 ` Daniel Jacobowitz [this message]
2003-09-25 21:44 ` Andrew Cagney
2003-09-27 15:46 ` Eli Zaretskii
2003-09-27 17:49 ` Andrew Cagney
2003-09-27 18:37 ` Eli Zaretskii
2003-09-27 18:48 ` Andrew Cagney
2003-09-28 8:40 ` Eli Zaretskii
2003-09-28 19:44 ` Andrew Cagney
2003-09-28 21:07 ` Eli Zaretskii
2003-09-28 21:30 ` Daniel Jacobowitz
2003-09-29 5:36 ` Eli Zaretskii
2003-09-29 14:48 ` Daniel Jacobowitz
2003-09-28 22:25 ` Andrew Cagney
2003-09-29 5:41 ` Eli Zaretskii
2003-09-29 14:52 ` Andrew Cagney
2003-09-29 15:07 ` Daniel Jacobowitz
2003-10-01 21:49 ` Features vs infrastructure (was Re: Tracepoint support in Cygnus GDB ?) Stan Shebs
2003-10-02 3:29 ` Andrew Cagney
2003-10-02 3:47 ` Stan Shebs
2003-10-02 5:31 ` Andrew Cagney
2003-10-02 6:42 ` Stan Shebs
2003-10-02 7:02 ` Joel Brobecker
2003-10-02 19:18 ` Andrew Cagney
2003-10-02 6:04 ` Stan Shebs
2003-10-02 6:29 ` Andrew Cagney
2003-09-30 5:43 ` Tracepoint support in Cygnus GDB ? Jim Blandy
2003-09-30 21:14 ` Andrew Cagney
2003-09-28 22:50 Michael Elizabeth Chastain
2003-09-29 6:28 ` Eli Zaretskii
2003-09-29 13:21 Michael Elizabeth Chastain
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=20030925040205.GA21265@nevyn.them.org \
--to=drow@mvista.com \
--cc=eliz@elta.co.il \
--cc=gdb@sources.redhat.com \
--cc=jimb@redhat.com \
--cc=pes@india.hp.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).