[llvm-bugs] [Bug 43860] New: COFF Debug info shows variable at the wrong lexical scope.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 31 07:54:46 PDT 2019


            Bug ID: 43860
           Summary: COFF Debug info shows variable at the wrong lexical
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: international.phantom at gmail.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

Given the following test case:

// inlined.cpp

int inlineFunction(int Param) __attribute__((always_inline));
int inlineFunction(int Param) {
  int Var_1 = Param;
    int Var_2 = Param + Var_1;
    Var_1 = Var_2;
  return Var_1;

int testInlined(int Param_1, int Param_2) {
  int A = Param_1;
  A += inlineFunction(Param_2);
  return A;


Using the following command line options to generate debug info
(DWARF) and (COFF):

clang -c -g -O0 inlined.cpp -o inlined-dwarf.o
clang -c -g -O0 inlined.cpp -o inlined-coff.o -gcodeview

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.o

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191031/10ff6659/attachment.html>

More information about the llvm-bugs mailing list