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/2861] user_string fault handling


------- Additional Comments From hunt at redhat dot com  2006-06-28 21:59 -------
Subject: Re:  user_string fault handling

On Wed, 2006-06-28 at 18:56 +0000, fche at redhat dot com wrote:
> ------- Additional Comments From fche at redhat dot com  2006-06-28 18:56 -------
> For the short term, I would like to see a separate user_string() variant that
> silently tolerates errors.  This variant could return a fixed string in this
> case, or (even better) the string given by an additional parameter:
> 
>    user_string (addr) ==> noisily fails as presently
>    user_string2 (addr,msg) ==> quietly returns msg on access error
> 
> The syscalls tapset would presumably switch to the second form.

Is there really a need for a caller-specified error message that would
justify the overhead of the extra strcpy? 

I'd like to avoid changing all the current code. How about

user_string(addr) ==> returns "<unknown>" on error
user_string(addr, 0) ==> same as above but prints warning
user_string(addr, 1) ==> prints error message and sets lasterr

> One might modify the translator to permit overloading by function arity, thus
> not requiring such awesome creativity with function naming.

A good idea independent regardless of how we solve this problem. Is
there a PR for it?




-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2861

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


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