From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8730 invoked by alias); 27 Sep 2012 00:57:42 -0000 Received: (qmail 8668 invoked by uid 48); 27 Sep 2012 00:57:18 -0000 From: "jistone at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/13486] pass-4 error (frame_base undeclared), inlined function argument Date: Thu, 27 Sep 2012 00:57: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" Content-Transfer-Encoding: quoted-printable 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/msg00342.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D13486 Josh Stone changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jistone at redhat dot com --- Comment #2 from Josh Stone 2012-09-27 00:57= :17 UTC --- (In reply to comment #0) > I don't see a location list for this "mapcount" variable, but that must j= ust be=20 > my lyin' eyes. I believe that's because you only quoted the "subprogram" section for the inline, which is basically just info shared across all instances. You need= the particular "inlined_subroutine" to get actual location lists. Your rmap.o shows this at ead9, with mapcount at eb03 and location list 5dc= b.=20 This is an implicit_pointer to die e858 with location list 58df. And part = of that list indeed references fb_reg -172, as in your generated C. I can't reproduce the issue with your script on a current F17 kernel, as I = get just "not accessible at this address". But I just ran into this elsewhere: $ stap -e 'probe process.function("seen_triple") { println($ht) }' -c df -p4 /tmp/stapPYTjE4/stap_7fb9f85209eb688e311d35324c1e6749_1395_src.c: In functi= on =E2=80=98function__dwarf_tvar_get_ht_0=E2=80=99: /tmp/stapPYTjE4/stap_7fb9f85209eb688e311d35324c1e6749_1395_src.c:118:16: er= ror: =E2=80=98frame_base=E2=80=99 undeclared (first use in this function) And the symptoms are the same, an inline function parameter resolving to an implicit_pointer to something else that references fb_reg. I figured out that loc2c.c:c_emit_location() only emits code for frame_base= if it's on the first loc of the chain. But in this case, the loc_implicit_poi= nter has no frame_base, yet its ->pointer.target does. That target comes later = in the chain, thus we get a reference to frame_base without defining it. I'm testing this patch to look if *any* of the loc chain needs frame_base, = and so far it seems to work: diff --git a/loc2c.c b/loc2c.c index 16b8c8e..7c4ec60 100644 --- a/loc2c.c +++ b/loc2c.c @@ -2538,9 +2538,13 @@ c_emit_location (FILE *out, struct location *loc, int indent, bool deref =3D false; *max_stack =3D 0; - if (loc->frame_base !=3D NULL) - emit_loc_value (out, loc->frame_base, indent, "frame_base", true, - &deref, max_stack); + for (l =3D loc; l !=3D NULL; l =3D l->next) + if (l->frame_base !=3D NULL) + { + emit_loc_value (out, l->frame_base, indent, "frame_base", true, + &deref, max_stack); + break; + } for (; loc->next !=3D NULL; loc =3D loc->next) switch (loc->type) --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are the assignee for the bug.