This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug tapsets/2861] user_string fault handling
- From: "hunt at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 30 Jun 2006 19:13:20 -0000
- Subject: [Bug tapsets/2861] user_string fault handling
- References: <20060628164947.2861.hunt@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From hunt at redhat dot com 2006-06-30 19:13 -------
Subject: Re: user_string fault handling
On Thu, 2006-06-29 at 01:08 +0000, fche at redhat dot com wrote:
>
> > user_string(addr, 0) ==> same as above but prints warning
>
> The ", 0" setting is not helpful (nor is the "0" too informative). We
> don't print run-time warnings at the present, and for good reason: they
> are only noise.
Unless, of course, you are interested in that "noise". As a developer I
often want to see it.
> > user_string(addr, 1) ==> prints error message and sets lasterr
>
> I don't find the ", 1" is too informative.
How is it less informative than user_string2() as you proposed? I was
thinking it would be better to have parameters that modify the functions
behavior than lots of functions that do almost the same thing.
OK, here is what I am going to do for now.
user_string(addr:long) - returns "<unknown>" on error, otherwise no
warnings, errors, etc. This is simplest and cleanest and will satisfy
99.99% of uses.
user_string2(addr:long, err_msg:string) - Those who want to check for
errors and are afraid that files named "<unknown>" might confuse their
script can use this and give it something less likely to be a valid
filename or data. This could be renamed to user_string() too if/when we
change the translator.
user_string_warn(addr:long) - For debugging/developers. If copies are
failing often, maybe we want some more details. Not likely to be used
much, but I sometimes use something like 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.