[llvm] r235050 - DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Apr 17 09:43:44 PDT 2015


> On 2015 Apr 16, at 17:55, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
>> On 2015-Apr-16, at 15:50, David Blaikie <dblaikie at gmail.com> wrote:
>> 
>> 
>> 
>> On Thu, Apr 16, 2015 at 3:37 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> 
>>> On 2015-Apr-16, at 14:21, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>>> 
>>>> 
>>>> On 2015-Apr-16, at 11:41, David Blaikie <dblaikie at gmail.com> wrote:
>>>> 
>>>> (from IRC discussion)
>>>> 
>>>> Looks like this might've caused the GDB buildbot regression seen here: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/21390
>>>> 
>>>> Specifically, in the below program
>>>> 
>>>> int *g;
>>>> 
>>>> static __attribute__((always_inline)) int f(int a) {
>>>> int l;
>>>> g = &l;
>>>> return a;
>>>> }
>>>> 
>>>> int main(void) {
>>>> f(0);
>>>> f(0);
>>>> return 0;
>>>> }
>>>> 
>>>> The inlined_subroutine for 'f' in 'main' has no DW_TAG_formal_parameter (for 'a')
>>> 
>>> I've tracked this down -- UserValue::match() needed to be updated.
>> 
>> r235140
>> 
>>> 
>>> I fixed what might be an unrelated bug in DebugLocEntry.  I'll have
>>> to separate out the two changes to see if this testcase provides any
>>> coverage for `DebugLocEntry`; if not I'll maybe need some help from
>>> you or Adrian coming up with a good testcase for that one.
>> 
>> This turned out to be unrelated.
>> 
>> Looking at the code, I'm not even sure what the variables are doing in
>> `DebugLocEntry` -- they're only used to prevent adjacent locations from
>> coalescing.  I guess the main problem is I don't know what this table is
>> for (well, `.debug_loc`, but I don't know what that is either).
>> 
>> .debug_loc is for variables that don't reside in just a single location for their entire lifetime (much like debug_ranges discussed earlier) - if a variable resides in a single place for its entire scope, then DW_AT_location will have a dwarf expression describing that location, otherwise it'll have a sec_offset/data4 giving the offset in debug_loc that describes the various locations and ranges for the variable.
>> 
>> You might look for existing test cases that produce debug_loc sections? But I don't have a canonical way to produce one off-hand. I imagine if one is produced for two distinct inlined variables (from distinct inlined calls to the same function) then their location lists might end up accidentally shared (they'd end up with the same location list (possibly combining both variable location lists), rather than distinct ones)?
>> 
> 
> I tried a variation on your simplified testcase for the original bug,
> hoping that the variables would somehow be coalesced badly:

No wonder I couldn't come up with a testcase where it makes a
difference -- the variable is completely irrelevant here, since
it's identical by construction.  Lists of `DebugLocEntry` are
created separately for each variable/inlined-at pair.

I removed it in r235202 (with cleanups at r235201 and r235203).



More information about the llvm-commits mailing list