[Bug translator/32964] @defined() not finding expected member fields

fche at redhat dot com sourceware-bugzilla@sourceware.org
Thu May 15 23:07:05 GMT 2025


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

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

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

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
The problem appears to be one of timing: the way that pass-2 resolution works.

@defined() operators are effectively evaluated during probe-derivation time, at
which time identifiers like 'bdev' (script level local variables) are not
resolved yet.  That means the @defined(t->foo) cannot work, because this t
doesn't have a symbol referent, and thus no type_details.

Later, during semantic_type_symbols(), @defined() operators that are still left
alone in the parse tree are assumed to be false.

If the current behaviour is retained, at the very least, better diagnostics
should be included to let users realize this (using autocast-style local
variables in @defined expressions) is an unsupported construct.

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


More information about the Systemtap mailing list