This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/17741] try-catch statement as a tapset function


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

Josh Stone <jistone at redhat dot com> changed:

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

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
Note that both arguments will be evaluated *before* the function is called, so
if the first throws, your try_catch() won't even get a chance to catch it.  You
would need lambdas to let the function wrap a try-catch around evaluation.

A macro @try_catch can almost fake this, but since try-catch is a statement,
not an expression, it can't have a value.  And we don't have anything like
({...}) expressions to wrap up statements as expressions.

How about @try_assign(part_1, "k:".modname(addr()), sprintf("k:%p",addr())) ? 
This would expand exactly like your "wordy" example.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]