http://llvm.org/bugs/show_bug.cgi?id=12323

             Bug #: 12323
           Summary: Incorrect line numbers in debug information when
                    building with inlining
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Headers
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 8248
  --> http://llvm.org/bugs/attachment.cgi?id=8248
repro

The attached (zipped) ii file contains this code:

  if (!SupplementaryBranding::GetBrand().empty()) {
    if (SupplementaryBranding::GetBrand() != product_brand) {
      ASSERT_STRING("FinancialPing::FormRequest: supplementary branding bad");
      return false;
    }
  }

When stepping through it, gdb complains:

  Line number 664 out of range; ../../rlz/lib/financial_ping.cc has 373 lines.



Compile the file:
  clang -O3 -gdwarf-2 -fvisibility=hidden -arch i386  \
    -fno-rtti -fno-exceptions -fvisibility-inlines-hidden \
    -c ~/repro.ii  -Wno-c++11-extensions

Then look at the debug information:
  dwarfdump repro.o | mvim -

It contains:

0x000284ee:                 TAG_inlined_subroutine [101] *
                             AT_abstract_origin( {0x00005110} (
"_ZNKSs5emptyEv" ) )
                             AT_low_pc( 0x000000ad )
                             AT_high_pc( 0x000000bb )
                             AT_call_file( "/Users/thakis/repro.ii" )
                             AT_call_line( 113 )

0x000284fd:                     TAG_inlined_subroutine [102] *
                                 AT_abstract_origin( {0x000050f8} (
"_ZNKSs4sizeEv" ) )
                                 AT_low_pc( 0x000000ad )
                                 AT_high_pc( 0x000000bb )
                                 AT_call_file( "/Users/thakis/repro.ii" )
                                 AT_call_line( 664 )

^ Note the 664 here, which is the line where "size()" is defined for strings
(which probably has been inlined). Instead, it should have the line number of
where size() is called (113).

(In the normal case, where the input isn't a single .ii file, the AT_call_file
entry correctly points to "../../rlz/lib/financial_ping.cc")








clang --versionclang version 3.1 (trunk 152598)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to