Hi,
Recently I met a problem incurred by DWARF Missing. Simply, if a function gets inlined to a call site,
the dwarf infomation for the call site maybe:
DW_TAG_inlined_subroutine:
DW_AT_abstract_origin (0x0123456)
The gdb would blame when it finds 0x0123456 doesn’t refer to any functions in dwarf format.
For example,
static void foo() { ... } // only used by bar
void bar() {
foo();
}
After foo gets inlined to bar, there is no user of foo. So the compiler could and should remove foo. However,
the compiler removes the debug info of foo, so the callsite in bar can’t find definition of foo in the current module.
There is a brief introduction. I met this problem in ThinLTO. But I believe the function elimination should be the root cause.
I am not sure if this is a bug about compiler or about the debugger. For example, the debugger should emit a warning instead
of crashing. It affects how should solve this problem.
I made a copy to some people who are familiar with debug info to my knowledge. If this is not polite and disturbing, just inform me.
Thanks,
Chuanqi