This is the mail archive of the
mailing list for the systemtap project.
Re: feature request: DWARF-based sizeof(), array_size(), typeof()
- From: David Smith <dsmith at redhat dot com>
- To: Stephane Chazelas <stephane dot chazelas at gmail dot com>, systemtap at sourceware dot org
- Date: Wed, 01 Apr 2015 12:49:26 -0500
- Subject: Re: feature request: DWARF-based sizeof(), array_size(), typeof()
- Authentication-results: sourceware.org; auth=none
- References: <20150317212227 dot GA9874 at chaz dot gmail dot com>
On 03/17/2015 04:22 PM, Stephane Chazelas wrote:
> recently, I found myself needing to loop over the elements of a
> kernel array
> Though there are ways to get that information (parse symdata(),
> use C code relying on internal APIs), none of them are
> straighforward or ideal.
> It would be nice if operators like sizeof(addr) (to retrieve the
> size of a symbol at a given address) and array_size(addr) (to
> retrieve the number of elements if that is an array). be added
> to systemtap.
> A typeof() one could be nice as well (especially if we can
> combine it with @cast).
> What do you think?
It is an interesting idea, although since that really isn't my area of
expertise I'm not sure how easy/possible those operators would be.
I filed PR18191 on your idea so we won't lose it. Please CC yourself on