* [Bug translator/18191] New: DWARF-based sizeof(), array_size(), typeof() operators
@ 2015-04-01 17:46 dsmith at redhat dot com
2015-04-01 22:39 ` [Bug translator/18191] " stephane.chazelas+sourceware at gmail dot com
2015-04-01 22:48 ` fche at redhat dot com
0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2015-04-01 17:46 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=18191
Bug ID: 18191
Summary: DWARF-based sizeof(), array_size(), typeof() operators
Product: systemtap
Version: unspecified
Status: NEW
Severity: enhancement
Priority: P2
Component: translator
Assignee: systemtap at sourceware dot org
Reporter: dsmith at redhat dot com
As mentioned by Stephane Chazelas on the mailing list:
<https://sourceware.org/ml/systemtap/2015-q1/msg00236.html>
It might be nice to have DWARF-based sizeof(), array_size(), typeof()
operators.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug translator/18191] DWARF-based sizeof(), array_size(), typeof() operators
2015-04-01 17:46 [Bug translator/18191] New: DWARF-based sizeof(), array_size(), typeof() operators dsmith at redhat dot com
@ 2015-04-01 22:39 ` stephane.chazelas+sourceware at gmail dot com
2015-04-01 22:48 ` fche at redhat dot com
1 sibling, 0 replies; 3+ messages in thread
From: stephane.chazelas+sourceware at gmail dot com @ 2015-04-01 22:39 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=18191
Stephane Chazelas <stephane.chazelas+sourceware at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stephane.chazelas+sourcewar
| |e at gmail dot com
--- Comment #1 from Stephane Chazelas <stephane.chazelas+sourceware at gmail dot com> ---
[Thanks David]
I don't know about the other ones, but a DWARF-based sizeof() (at least for
kernel symbols) should just be a matter of:
function sizeof:long (addr:long) %{ /* pure */ /* pragma:symbols */
STAP_RETVALUE = -1;
_stp_kallsyms_lookup(STAP_ARG_addr, (unsigned long*)&(STAP_RETVALUE), NULL,
NULL, NULL);
%}
See
http://stackoverflow.com/questions/29034267/get-size-of-target-array-in-systemtap
for where the request is coming from.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug translator/18191] DWARF-based sizeof(), array_size(), typeof() operators
2015-04-01 17:46 [Bug translator/18191] New: DWARF-based sizeof(), array_size(), typeof() operators dsmith at redhat dot com
2015-04-01 22:39 ` [Bug translator/18191] " stephane.chazelas+sourceware at gmail dot com
@ 2015-04-01 22:48 ` fche at redhat dot com
1 sibling, 0 replies; 3+ messages in thread
From: fche at redhat dot com @ 2015-04-01 22:48 UTC (permalink / raw)
To: systemtap
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-01 22:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 17:46 [Bug translator/18191] New: DWARF-based sizeof(), array_size(), typeof() operators dsmith at redhat dot com
2015-04-01 22:39 ` [Bug translator/18191] " stephane.chazelas+sourceware at gmail dot com
2015-04-01 22:48 ` fche at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).