[lldb-dev] [Bug 20604] New: Inferior method execution ignores default arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 9 12:59:31 PDT 2014


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

            Bug ID: 20604
           Summary: Inferior method execution ignores default arguments
           Product: lldb
           Version: unspecified
          Hardware: HP
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: rdsmith at chromium.org
    Classification: Unclassified

Created attachment 12870
  --> http://llvm.org/bugs/attachment.cgi?id=12870&action=edit
Example method definition with default arg.

If a C++ method is defined as taking a default argument, lldb does not take
that into account in evaluating an "expr" command.  (I first noticed this
trying to use 
some of the default std::string methods, specifically the constructor which
takes
a default allocator).

Reproduction: On Linux, compile the attached file with "g++ -g test.cc", then:

$ lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) break -f test.cc -l 19
invalid command 'breakpoint -f'
(lldb) break set  -f test.cc -l 19
Breakpoint 1: where = a.out`main + 73 at test.cc:19, address =
0x0000000000400acd
(lldb) run
Process 8036 launching
Process 8036 launched: '/usr/local/google/home/rdsmith/tmp/a.out' (x86_64)
Process 8036 stopped
* thread #1: tid = 8036, 0x00007f7d095486b0, name = 'a.out'
    frame #0:
(lldb) Process 8036 stopped
* thread #1: tid = 8036, 0x0000000000400acd a.out`main(argc=1,
argv=0x00007fff79dcc1b8) + 73 at test.cc:19, name = 'a.out', stop reason = br\
eakpoint 1.1
    frame #0: 0x0000000000400acd a.out`main(argc=1, argv=0x00007fff79dcc1b8) +
73 at test.cc:19
   16
   17     testclass t;
   18
-> 19     t.test_method(8);
   20
   21     std::cout << abc << std::endl;
   22   }
(lldb) expr t.test_method()
error: too few arguments to function call, expected 1, have 0
note: 'test_method' declared here
error: 1 errors parsing expression
(lldb) expr t.test_method(2)
2
(lldb)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140809/3e3c6f4c/attachment.html>


More information about the lldb-dev mailing list