[Bug translator/18191] DWARF-based sizeof(), array_size(), typeof() operators

fche at redhat dot com sourceware-bugzilla@sourceware.org
Wed Apr 1 22:48:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=18191

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
(In reply to Stephane Chazelas from comment #1)

> function sizeof:long (addr:long) %{ /* pure */ /* pragma:symbols */
>   STAP_RETVALUE = -1;
>   _stp_kallsyms_lookup(STAP_ARG_addr, (unsigned long*)&(STAP_RETVALUE),
> NULL, NULL, NULL);
> %}

Note that the above great start is not actually DWARF-based - it's just
symbol-table based.  We might want to do a few things extra:

- rename to symsize (since that's what it does)

- throw an error if the address can't be resolved to a known symbol, instead of
returning a sentinel -1

- having a user-space variant usymsize() that passes 'current' as the last
parameter to the underlying lookup function

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Systemtap mailing list