[LLVMbugs] [Bug 20690] New: clang++ does not output Dwarf DW_AT_default_value Debugging Information Entry

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 17 12:27:51 PDT 2014


            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: unassignedclangbugs at nondot.org
          Reporter: rdsmith at chromium.org
                CC: llvmbugs at cs.uiuc.edu
    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 {
  testclass() {}

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

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

  testclass t;


  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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140817/4f6e7a2c/attachment.html>

More information about the llvm-bugs mailing list