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

            Bug ID: 20690
           Summary: clang++ does not output Dwarf DW_AT_default_value
                    Debugging Information Entry
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 12910
  --> http://llvm.org/bugs/attachment.cgi?id=12910&action=edit
Dwarf dump of binary compiled from included program

When compiling a C++ class with methods with default arguments, clang does not
appear to output the Dwarf debugging information entry representing a default
value.  To reproduce, compile the following program on Linux (via clang++ -g
test.cc) and dump the resulting a.out file (I've attached the output of a
simple dump via pyelftools).  The DW_AT_default_value attribute is not present
in the dump.

----
#include <string>
#include <iostream>

class testclass {
 public:
  testclass() {}

  void test_method(int a = 1) {
    std::cout << a << std::endl;
  }
};

int
main(int argc, char** argv) {
  std::string abc("abc");

  testclass t;

  t.test_method(8);

  std::cout << abc << std::endl;
}
----

This bug occurs in clang built from LLVM version 215330, clang version 215327.

This is a problem for, e.g., calling some STL library routines from lldb, as
such routines are often documented as having fewer arguments than they are
defined with, the extra arguments being defaulted and used for, e.g.,
allocation.  Without information about the default arguments, lldb cannot
present the interface to the user they expect.  See
http://llvm.org/bugs/show_bug.cgi?id=20604 .

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