-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COFF Debug info shows variable at the wrong lexical scope. #43205
Comments
|
This is the reduced output generated by llvm-dwarfdump: inlined-dwarf.o: file format ELF64-x86-64 .debug_info contents: DW_TAG_compile_unit DW_TAG_subprogram DW_TAG_subprogram DW_TAG_subprogram (*) Var_1 and Var_2 are at different lexical scopes. |
|
This is the reduced output generated by llvm-readobj: outline copy (inlineFunction)Subsection [ (*) Var_1 and Var_2 at different lexical scopes. |
|
This is the reduced output generated by llvm-readobj: caller (testInlined)Subsection [ (*) Var_1 and Var_2 at the same lexical scope. |
|
This is the ouput from llvm-diva (tool under development). llvm-diva --print=scopes,symbols,types inlined-dwarf.o inlined-coff.o --attribute=level,format Logical View: [001] {CompileUnit} 'inlined.cpp' Logical View: [001] {CompileUnit} 'inlined.cpp' The logical view for the DWARF debug info, shows 'Var_1' and 'Var_2' () Var_1, scope [004] The logical view for the COFF debug-info, shows 'Var_1' and 'Var_2' () Var_1, scope [004] |
|
Would it be correct to say that the bug is: lexical scopes disappear from codeview after inlining? There are some conditions under which lexical scopes may be ignored: Perhaps this example hits one of those cases. |
Thanks very much for the link. For the given case, https://github.com/llvm/llvm-project/blob/master/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp#L2769 const DILexicalBlock *DILB = dyn_cast(Scope.getScopeNode()); DILB is null. From my understanding, the lexical blocks created due to the inlining |
Yes. That would be a better description for the bug. |
|
I am just starting to get familiar with the CodeView format and the |
Extended Description
Given the following test case:
Using the following command line options to generate debug info
(DWARF) and (COFF):
Looking at the output generated by llvm-dwarfdump and llvm-readobj,
the COFF debug info shows the variable 'Var_2' at the same lexical
scope as the variable 'Var_1' in the 'testInlined' as results of the
function 'inlineFunction' being inlined.
llvm-dwarfdump --debug-info inlined-dwarf.oThe text was updated successfully, but these errors were encountered: