From: Jim Blandy <jimb@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alexandre Courbot <Alexandre.Courbot@lifl.fr>, gdb@sources.redhat.com
Subject: Re: Using gdb as a trace agent
Date: Mon, 17 May 2004 18:29:00 -0000 [thread overview]
Message-ID: <vt2ad06ap24.fsf@zenia.home> (raw)
In-Reply-To: <6654-Mon17May2004202803+0300-eliz@gnu.org>
"Eli Zaretskii" <eliz@gnu.org> writes:
> > Date: Mon, 17 May 2004 18:47:51 +0200
> > From: Alexandre Courbot <Alexandre.Courbot@lifl.fr>
> >
> > The ideal for me would be to be able to use tracepoints in both cases
> > (i.e. remote and local). What would prevent a local support for tracepoints?
>
> Nothing, except the fact that the code to do that has not been
> written yet.
>
> If you fill that void, you will have my eternal gratitude.
>
> > no chance to get tracepoints to work locally? That would turn GDB
> > into a great analysis tool.
>
> This was discussed in the past, and everybody agreed it would be
> great. Now all we need is someone to step forward and code that.
Yep. Here's why it's only been implemented remotely:
On a typical remote embedded system communicating with GDB via a stub,
the stub is installed as a trap handler: when the debuggee hits a
breakpoint, the processor simply transfers control to the stub. The
stub then chats with GDB for as long as is necessary, and when it
receives a 'continue' packet, it returns from the trap handler.
This means that it's pretty easy to add tracepoints in a low-overhead
way. The stub just looks up the address of the instruction at which
the trap occurred in a table of tracepoints; if it finds a tracepoint
at that address, it collects the associated data, and continues
immediately.
So for native configurations, the challenge is to find a low-overhead
way to handle those traps. For example, one could add tracepoint
support to gdbserver, but then you'd have one process collecting data
from another process via ptrace or some other system call, and it
wouldn't be very lightweight.
next prev parent reply other threads:[~2004-05-17 18:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-17 13:00 Alexandre Courbot
2004-05-17 15:36 ` Jim Blandy
2004-05-17 16:49 ` Alexandre Courbot
2004-05-17 18:09 ` Eli Zaretskii
2004-05-17 18:29 ` Jim Blandy [this message]
2004-05-17 22:17 ` Alexandre Courbot
2004-05-18 7:07 ` Ramana Radhakrishnan
2004-05-18 8:33 ` Alexandre Courbot
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=vt2ad06ap24.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=Alexandre.Courbot@lifl.fr \
--cc=eliz@gnu.org \
--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