This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Accessing size of arrays allocated on the stack
- From: "Alexander M. Hoole" <Alexander dot Hoole at ece dot uvic dot ca>
- To: <systemtap at sourceware dot org>
- Date: Wed, 12 Dec 2012 10:19:29 -0800
- Subject: Accessing size of arrays allocated on the stack
- Reply-to: <Alex dot Hoole at ece dot uvic dot ca>
I noticed that systemtap is able to know that a local variable, allocated on
the stack, is an array. For example, a program containing:
...
int main(int argc, char *argv[])
{
char buf[40];
unsigned long p;
char *str;
...
With a probe containing:
...
probe process("./array_test").function("main").call {
log (probefunc()." param: ".$$parms)
log (probefunc()." locals: ".$$locals)
...
Produces
...
main param: argc=0x2 argv=0xbfeb9954
main local: buf=[...] p=0x160c7d7e str=0x3e9a9883
...
Does SystemTap presently support the ability to determine the size of local
arrays using either built-in functionality or embedded C?
Does this differ for user-space vs kernel-space probes?
Cheers,
A