This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/14431] char * always being printed as, possibly INVALID/NULL "<unknown>", string without giving actual address
- From: "jistone at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Mon, 06 Aug 2012 17:24:42 +0000
- Subject: [Bug translator/14431] char * always being printed as, possibly INVALID/NULL "<unknown>", string without giving actual address
- Auto-submitted: auto-generated
- References: <bug-14431-6586@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14431
--- Comment #4 from Josh Stone <jistone at redhat dot com> 2012-08-06 17:24:42 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> >
> > It's tough to automagically do The Right Thing without knowing what the user is
> > looking for.
>
> Yes, that is why we should just give all information instead of guessing what
> the user wants.
But too much information will make it difficult to read.
> > And in some cases, especially with kernel pointers, the %p may
> > overshadow the actual string, something like:
> >
> > > {.foo=""@0xffffffffffcb4010, .foo_size=42, .bar=""@0xffffffffffcb4050, .bar_size=47}
>
> What do you mean by overshadow?
I meant that since the value of kernel pointers on 64-bit will always take 16
characters, it clutters the output quite a bit. That may be a matter of
opinion, but this is supposed to be "pretty" printing.
> I think this example shows nicely why you always want the address, since the
> strings look the same (are empty - by accident?), but clearly they are not the
> same since they are at different addresses.
If you really are looking just for string values, then the memory addresses of
those strings are irrelevant.
> I do like the usage of plain ? instead of "<unknown>".
Note the difference that I proposed it *without* quotes, so it's clear that the
string is not really "?".
> > for people who know they want something
> > different, like all pointer addresses, they can always roll their own
> > pretty-print.
>
> Is that really that simple? I wasn't able to do that easily. Except by printing
> the fields individually with my own identifiers.
Yes, you'd print fields yourself individually to get the formatting you really
want.
We can't be all things to all people with a heuristic like pretty printing. I
tried to make it as simple-yet-useful as possible, to hopefully capture most
cases. Another example is chasing & expanding struct pointers, which we
decided was too difficult to get "right" without cluttering the general case.
So here you have "possibly invalid char*", or worse "valid char* to a
non-string" - I'm not sure we can fully address this without making the "char*
pointing to a string" case worse.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.