<div class="__aliyun_email_body_block"><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Hi,</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;">Recently I met a problem incurred by DWARF Missing. Simply, if a function gets inlined to a call site,</div><div  style="clear:both;">the dwarf infomation for the call site maybe:</div><div  style="clear:both;">```</div><div  style="clear:both;">DW_TAG_inlined_subroutine:</div><div  style="clear:both;">    DW_AT_abstract_origin (0x0123456)</div><div  style="clear:both;">```</div><div  style="clear:both;">The gdb would blame when it finds 0x0123456 doesn't refer to any functions in dwarf format.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">From my point of view, the reason there is unexist <span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">DW_AT_abstract_origin is due to function elimination.</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">For example,</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">```</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">static void foo() { ... } // only used by bar</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">void bar() {</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">    foo();</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">}</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">```</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">After foo gets inlined to bar, there is no user of foo. So the compiler could and should remove foo. However,</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">the compiler removes the debug info of foo, so the callsite in bar can't find definition of foo in the current module.</span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;"><br ></span></div><div  style="clear:both;"><span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">There is a brief introduction. I met this problem in ThinLTO. But I believe the function elimination should be the root cause.</span></div><div  style="clear:both;">I am not sure if this is a bug about compiler or about the debugger. For example, the debugger should emit a warning instead</div><div  style="clear:both;">of crashing. It affects how should solve this problem.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">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.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">Thanks,</div><div  style="clear:both;">Chuanqi</div><div  style="clear:both;"><br ></div><div  style="clear:both;"><br ></div><div  style="clear:both;"><br ></div></div>