This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question regarding accessing a target variable


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]