From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9809 invoked by alias); 5 Aug 2012 20:29:58 -0000 Received: (qmail 9801 invoked by uid 22791); 5 Aug 2012 20:29:58 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Aug 2012 20:29:45 +0000 From: "jistone at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/14431] NULL/invalid char * pretty printed as "" string Date: Sun, 05 Aug 2012 20:29:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jistone at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2012-q3/txt/msg00155.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14431 Josh Stone changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jistone at redhat dot com --- Comment #2 from Josh Stone 2012-08-05 20:29:44 UTC --- (In reply to comment #1) > What about we always also add the address of a char array? [...] > For our contrived example above that would give: > > {.foo=""@0xcb4010, .foo_size=42, .bar=""@0xcb4050, .bar_size=47} > {.foo=""@0x0, .foo_size=42, .bar=""@0x2a, .bar_size=0} > > Does that look reasonable or silly? It's tough to automagically do The Right Thing without knowing what the user is looking for. 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} Rather than trying both string value and address every time, maybe we should make new kernel/user_string variants that return either a quoted string *or* a pointer value, e.g. "\"foo\"" or "0x2a" depending on whether it's readable. Maybe "?@0x2a" to indicate it was tried but couldn't be read. Your examples would be: > {.foo="", .foo_size=42, .bar="", .bar_size=47} > {.foo=?@0x0, .foo_size=42, .bar=?@0x2a, .bar_size=0} We can only try to be just so smart... for people who know they want something different, like all pointer addresses, they can always roll their own pretty-print. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.