This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Getting a global static char
- From: "Tim Beaulen" <tbscope at gmail dot com>
- To: systemtap at sources dot redhat dot com
- Date: Mon, 10 Nov 2008 09:33:02 +0100
- Subject: Getting a global static char
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=f9LVdjcw3Sl8NX/Nmh2sQKWGK/NrKsqGTPMFNyk2DHc=; b=rkvZnSGsGeMM+GV+lcU4J3ihvxCajGCbFAiGf99qyiFDVJLG3ahLHdHcqqGabinG0y 20uFaLxoP8C+9hm4yIol8S5MOCwfoCBdK8j9t4Q/HFp6hY3+wkYCC/4oKfyIL38yaEYH mh2p0CpqUkTxZQzADFTm/awcEPKuCR1DzXkpA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=s2U8HWg8xj/XcnocigQazFMwIA4BgECSpB1NKwGpwnsQnNzT2MehPEasaLb0QMSjot 1rtt8fW8dbrijy5rTMzJGm4D/qtVjLO9vT73+JJ3sqAnZDZaSBiYOZL9b9PL2r5ivhFj eUXFHlDzs1Sp/6LDNElu5ZUIsBDAW8JsZNDkA=
Hello,
I'm trying to learn Systemtap and while playing around I got to a problem.
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.
Here's the relevant part of the source code:
static const char qt_meta_stringdata_
KDERebuildDialog[] = {
"KDERebuildDialog\0\0slotStartButtonClicked()\0"
"slotStopButtonClicked()\0"
"slotCloseButtonClicked()\0slotProcessFinished()\0"
"slotProcessStarted()\0message\0"
"slotProcessError(QString)\0"
"slotProcessWarning(QString)\0value\0"
"slotProgress(int)\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) }
Which I then call like this:
sudo stap -vvvvvv ./debug.stp
/home/kde4/projects/kderebuild/kderebuild -c
'/home/kde4/projects/kderebuild/kderebuild'
This gives the following error:
Resolution problem with probe probe_1384
printf("%s %s (%s)\\n", pp(), sprint("this=%#x _clname=%#x ",
_dwarf_tvar_get_this_3(), _dwarf_tvar_get__clname_4()),
$qt_meta_stringdata_KDERebuildDialog)
semantic error: unable to find local
'qt_meta_stringdata_KDERebuildDialog' near pc 0x8053f4c (alternatives:
this _clname): identifier '$qt_meta_stringdata_KDERebuildDialog' at
./debug.stp:4:85
source: probe process(@1).function("qt_metacast").call {
printf("%s %s (%s)\n",pp(),$$parms,$qt_meta_stringdata_KDERebuildDialog)
}
^
Is there a way to get to the qt_meta_stringdata_KDERebuildDialog string?
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
process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
this=0x7b _clname=0x0
process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
this=0x7b _clname=0x0
process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
this=0x7b _clname=0x0
process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
this=0x7b _clname=0x0
The idea is to print the name string which corresponds to _clname, like this:
process("/home/kde4/projects/kderebuild/kderebuild").function("qt_metacast").call
this=0x7b _clname=0x0 (KDERebuildDialog)
Thanks
I attached the complete source file which contains the
qt_meta_stringdata_KDERebuildDialog variable en the qt_metacast
function.