From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12672 invoked by alias); 4 Aug 2012 22:58:30 -0000 Received: (qmail 12664 invoked by uid 22791); 4 Aug 2012 22:58:29 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_MJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Aug 2012 22:57:55 +0000 From: "mjw at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/14431] NULL/invalid char * pretty printed as "" string Date: Sat, 04 Aug 2012 22:58: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: mjw 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: 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/msg00151.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14431 --- Comment #1 from Mark Wielaard 2012-08-04 22:57:54 UTC --- What about we always also add the address of a char array? diff --git a/tapsets.cxx b/tapsets.cxx index 1068a42..edeb30c 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2893,18 +2893,20 @@ dwarf_pretty_print::print_chars (Dwarf_Die* start_type, target_symbol* e, const char *name = dwarf_diename (&type); if (name && (name == string("char") || name == string("unsigned char"))) { - if (push_deref (pf, "\"%s\"", e)) + if (push_deref (pf, "\"%s\"@%p", e)) { // steal the last arg for a string access assert (!pf->args.empty()); + expression* expr = pf->args.back(); functioncall* fcall = new functioncall; fcall->tok = e->tok; fcall->function = userspace_p ? "user_string2" : "kernel_string2"; - fcall->args.push_back (pf->args.back()); + fcall->args.push_back (expr); expression *err_msg = new literal_string (""); err_msg->tok = e->tok; fcall->args.push_back (err_msg); pf->args.back() = fcall; + pf->args.push_back (expr); } return true; } 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? -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.