Comment 11 for bug 1995274

Revision history for this message
In , L-lunak-5 (l-lunak-5) wrote :

The only remaining issue I can see is that DWARF5 + -gsplit-dwarf does not output source locations in backtraces. So far I have not been able to find out which part of Valgrind code is responsible, the furthest I know so far is that search_one_loctab() does not find the location, possibly because di->loctab_used is slightly smaller than in non-split case. I also don't see any difference in DWARF info when compared to split DWARF4 or non-split DWARF5 that would seem relevant (llvm-dwarfdump claims .debug_line are the same in both cases when generated by GCC 11).

Testcase:
$ cat a.cpp
static int func(int a, int* b)
{
    if(*b)
        return a + 2;
    else
        return a - 2;
}

int main()
{
    int v;
    return func(4, &v);
}

$ g++-11 -g -gdwarf-5 a.cpp -gsplit-dwarf
$ valgrind ./a.out
...
==22491== Conditional jump or move depends on uninitialised value(s)
==22491== at 0x400559: func(int, int*) (in /home/seli/tmp/a.out)
==22491== by 0x400583: main (in /home/seli/tmp/a.out)

$ g++-11 -g -gdwarf-5 a.cpp
$ valgrind ./a.out
...
==22512== Conditional jump or move depends on uninitialised value(s)
==22512== at 0x400559: func(int, int*) (a.cpp:3)
==22512== by 0x400583: main (a.cpp:12)