public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: "Tim Beaulen" <tbscope@gmail.com>
Cc: systemtap@sources.redhat.com
Subject: Re: Getting a global static char
Date: Mon, 10 Nov 2008 14:18:00 -0000	[thread overview]
Message-ID: <y0mvduvzmu7.fsf@ton.toronto.redhat.com> (raw)
In-Reply-To: <dd1e9b170811100033s7d4dcb7dyd08e48342172ebf1@mail.gmail.com> (Tim Beaulen's message of "Mon, 10 Nov 2008 09:33:02 +0100")

"Tim Beaulen" <tbscope@gmail.com> writes:

> I'm trying to learn Systemtap and while playing around I got to a problem.

You seem to have quite some way, good job.

> I want to read a global static char so I can display the actual
> strings instead of numbers.  But Systemtap doesn't seem to find the
> global static char.
> [...]
> static const char qt_meta_stringdata_
> KDERebuildDialog[] = {
>     "KDERebuildDialog\0\0slotStartButtonClicked()\0"
> [...]

> At the moment, all I want to do is read that string and display it. I
> created a .stp file with the following code:
> probe process(@1).function("qt_metacast").call { printf("%s %s
> (%s)\n",pp(),$$parms,$qt_meta_stringdata_KDERebuildDialog) }

That should almost work (even though your string has those funky
embedded \0's).  You'd need a user_string($qt_meta_...) to extract the
value as a string.  But I believe our bug #4906 and another one is
impacting resolution of some global variables.  Sorry about that,
we'll try to fix it soon.


> If I leave out that string, I get output like this:
> process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
> this=0x7b _clname=0x0

Do those 0x7b/0x0 values look correct, by the way?  We're finding
gcc's current debugging info limitations more severely impact
userspace probing than kernel.  (bug #6941, #1155, and may gcc GCC VTA
be ready soon).


- FChE

      reply	other threads:[~2008-11-10 14:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-10  8:33 Tim Beaulen
2008-11-10 14:18 ` Frank Ch. Eigler [this message]

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=y0mvduvzmu7.fsf@ton.toronto.redhat.com \
    --to=fche@redhat.com \
    --cc=systemtap@sources.redhat.com \
    --cc=tbscope@gmail.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).