Summary: | Getting wrong scope for inlined function | ||
---|---|---|---|
Product: | systemtap | Reporter: | Mark Wielaard <mark> |
Component: | translator | Assignee: | Josh Stone <jistone> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Mark Wielaard
2009-10-02 21:38:05 UTC
(In reply to comment #0) > This is because of the following logic [...] That, and also because the scope_die for process.mark("constvalues") is for main() instead of func(). I think all will be better if process.statement(PC) uses the inner-most scope_die that contains the PC, rather than how it currently uses just the subprogram die containing the PC. (In reply to comment #1) > (In reply to comment #0) > > This is because of the following logic [...] > > That, and also because the scope_die for process.mark("constvalues") is for > main() instead of func(). Which is that way because func() gets inlined. So the workaround that is used in testsuite/systemtap.base/const_value.c for now is to explicitly mark the function as noinline (which isn't ideal because not all gcc versions seem smart enough to see that f is a const_value in that case, but gcc 4.5 for svn does see that it can be optimized that way even when not inlined). This should be a better in commit 6b517475. I revamped the way that statement(NUM) is matched, and from the testsuite it seems to be solid. (In reply to comment #2) > So the workaround that is used in testsuite/systemtap.base/const_value.c > for now is to explicitly mark the function as noinline [...] I tried to remove this workaround, and while it can now find the variables, I'm still getting an error: semantic error: libdwfl failure (dwfl_addrmodule): no error This is while processing $f, in a call to dwflpp::emit_address. I can't figure out whether I broke something else, or if maybe that "no error" means that it doesn't need relocation on that address? (In reply to comment #3) > I tried to remove this workaround, and while it can now find the variables, I'm > still getting an error: > > semantic error: libdwfl failure (dwfl_addrmodule): no error > > This is while processing $f, in a call to dwflpp::emit_address. I can't figure > out whether I broke something else, or if maybe that "no error" means that it > doesn't need relocation on that address? I should have written two testcases. I split the original one in two and removed the workaround from the original. commit e82cb6e94e5028637bdf0eedc0f6035139629a90 Author: Mark Wielaard <mjw@redhat.com> Date: Tue Oct 6 15:26:58 2009 +0200 PR10726 remove testcase workaround. * testsuite/systemtap.base/const_value.c: Allow inlining since PR10726 was fixed. I think your analysis of the issue is correct. I am tracking that as new bug PR10739. Closing this issue since it is solved. Thanks. |