public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Project Archer <archer@sourceware.org>
Subject: systemtap markers and gdb
Date: Thu, 13 Jan 2011 15:39:00 -0000	[thread overview]
Message-ID: <m3wrm8g6eb.fsf@fleche.redhat.com> (raw)

Sergio and I are working on letting gdb stop when a systemtap static
marker is hit.

I thought I would post the documentation for the user-facing bits for
comments.

The diff below is missing a little context.  The main new command is:

    catch marker PROVIDER NAME

Let me know what you think.

Tom

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7f8c785..3b31704 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -4100,6 +4101,22 @@ and @sc{gnu}/Linux.
 A call to @code{vfork}.  This is currently only available for HP-UX
 and @sc{gnu}/Linux.
 
+@item marker @var{provider} @var{name}
+A @code{SystemTap} static marker was hit.
+
+The @sc{gnu}/Linux tool @code{SystemTap} provides a way for
+applications to embed static markers.  @value{GDBN} can detect when a
+marker was hit.
+
+The marker's arguments are available to any condition or commands
+attached to the catchpoint via the @code{_marker_arg} convenience
+function.  @xref{Convenience Vars}, for more information on
+convenience functions, or below for details on @code{_marker_arg}.
+
+@var{provider} and @var{name} specify the marker to be used.  See
+@uref{http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps}
+for more information on static markers.
+
 @end table
 
 @item tcatch @var{event}
@@ -4161,6 +4178,40 @@ a specific exception is raised.  You can use multiple conditional
 breakpoints to stop your program when any of a number of exceptions are
 raised.
 
+You can examine the available @code{SystemTap} static markers using
+@code{info markers}:
+
+@table @code
+@kindex info markers
+@item info markers [@var{provider} [@var{name}]]
+List the available @code{SystemTap} static markers.
+
+If given, @var{provider} is a regular expression used to select which
+providers to list.  If omitted, all providers are listed.
+
+If given, @var{name} is a regular expression used to select which
+markers to list.  If omitted, all markers are listed.
+@end table
+
+In the condition or commands for a @code{catch marker} catchpoint, you
+can use the @code{_marker_arg} convenience function to extract
+arguments:
+
+@table @code
+@kindex marker arguments
+@kindex _marker_arg convenience function
+@item _marker_arg (@var{n})
+Return the value of an argument to a @code{SystemTap} static marker.
+The argument @var{n} is an integer which indicates which argument to
+return.  Arguments are numbered starting from 0.
+
+The result will be an integer of the appropriate size; types are not
+preserved.
+
+A call to this function is only valid in the condition or commands of
+a @code{catch marker} catchpoint; in other contexts it will give an
+error.
+@end table
 
 @node Delete Breaks
 @subsection Deleting Breakpoints

             reply	other threads:[~2011-01-13 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 15:39 Tom Tromey [this message]
2011-01-13 15:53 ` Phil Muldoon
2011-01-13 16:06   ` Tom Tromey
2011-01-13 17:15     ` Roland McGrath
2011-01-13 17:38       ` Tom Tromey
2011-02-04 22:00         ` Tom Tromey
2011-02-04 23:45           ` Roland McGrath
2011-02-07 15:22             ` Tom Tromey
2011-02-07 18:41               ` Roland McGrath
2011-02-07 16:55           ` Tom Tromey

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=m3wrm8g6eb.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=archer@sourceware.org \
    /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).