Getting a global static char
Tim Beaulen
tbscope@gmail.com
Mon Nov 10 08:33:00 GMT 2008
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.
More information about the Systemtap
mailing list