<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Inferior method execution ignores default arguments"
href="http://llvm.org/bugs/show_bug.cgi?id=20604">20604</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inferior method execution ignores default arguments
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>HP
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rdsmith@chromium.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=12870" name="attach_12870" title="Example method definition with default arg.">attachment 12870</a> <a href="attachment.cgi?id=12870&action=edit" title="Example method definition with default arg.">[details]</a></span>
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)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>