This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: $return in wildcarded void functions
Hi -
On Tue, Mar 06, 2007 at 02:05:39PM -0800, Mike Mason wrote:
> [...]
> >So:
> > $?var==0 implies $!var==0
> > $?var==0 implies $var would have caused compile-time error
> > $?var==1 implies $!var equals what $var would have
>
> I like this approach. Could it also work for variables defined locally in
> probes (e.g. ?var and !var, no $)? What about global variables?
I can't think of any reason to apply it to normal script variables.
The point here is to adapt to vagaries of the probed software, not the
probe script itself.
> I'm not crazy about returning 0 for a non-existent variable, but at
> least this method provides a way to avoid that.
Yes.
> Does $?var==1 imply that $var and $!var exist ?
$?var and $!var would exist for any $var and $var->field->array[43]
expression. $var would exist only when it "should" and cause a
translation-time error otherwise.
- FChE