This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: question regarding accessing a target variable
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Kai Wong" <kai_wong at symantec dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Sat, 24 Jan 2009 10:12:10 -0500
- Subject: Re: question regarding accessing a target variable
- References: <20217654.post@talk.nabble.com> <y0mtzawurrj.fsf@ton.toronto.redhat.com> <1A193CCB5218B14589B1979BC7D510E006F0EB1E@TUS1XCHCLUPIN11.enterprise.veritas.com> <20081029201826.GC16968@redhat.com> <1A193CCB5218B14589B1979BC7D510E006F0ECBC@TUS1XCHCLUPIN11.enterprise.veritas.com> <1A193CCB5218B14589B1979BC7D510E007077719@TUS1XCHCLUPIN11.enterprise.veritas.com> <20081104152629.GB28139@redhat.com> <1A193CCB5218B14589B1979BC7D510E0070F51F0@TUS1XCHCLUPIN12.enterprise.veritas.com> <20081107020842.GG20928@redhat.com> <1A193CCB5218B14589B1979BC7D510E00802F544@TUS1XCHCLUPIN11.enterprise.veritas.com>
"Kai Wong" <kai_wong@symantec.com> writes:
> [...]
> void dummy_function(void *a) {
> typedef struct {
> int x;
> int y;
> } b_t;
> b_t *b = (b_t*)a;
> ...
> }
>
> I can't access the target variables x and y in a systemtap script using
> $b->x and $b->y (I get " semantic error: not accessible at this
> address").
>
> Is there any support in the systemtap script language that lets me
> access x and y without having to write a separate embedded-c function
> for each as follows?
> [...]
I think sources.redhat.com/PR6704 (now 5634) should at some point
cover this, by allowing you write the cast from void* to "struct b_t".
Our pointer/typing operations are currently rather limited. I've been
hoping that we wouldn't need the whole C suite of */&/(cast), but
maybe we'll have to bite that bullet and build it.
- FChE