<html>
<head>
<base href="https://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 --- - Expression evaluation broken for__attribute__((overloadable))"
href="https://llvm.org/bugs/show_bug.cgi?id=26694">26694</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Expression evaluation broken for__attribute__((overloadable))
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ewan@codeplay.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, scallanan@apple.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=15932" name="attach_15932" title="Example C file and compiled binary">attachment 15932</a> <a href="attachment.cgi?id=15932&action=edit" title="Example C file and compiled binary">[details]</a></span>
Example C file and compiled binary
Commit r260768 broke expression evaluation for C functions with
__attribute__((overloadable))
See attached example compiled with clang -g -O0
Before this commit the correct decl of evaluated function 'MyFunc' was chosen.
(lldb) target create "overloadable"
Current executable set to 'overloadable' (x86_64).
(lldb) b 19
Breakpoint 1: where = overloadable`main + 44 at overloadable.c:19, address =
0x00000000004005bc
(lldb) r
Process 7127 launched: '/home/ewan/Desktop/Scratch/overloadable' (x86_64)
This is a float function
This is an integer function
Process 7127 stopped
* thread #1: tid = 7127, 0x00000000004005bc overloadable`main + 44 at
overloadable.c:19, name = 'overloadable', stop reason = breakpoint 1.1
frame #0: 0x00000000004005bc overloadable`main + 44 at overloadable.c:19
16 MyFunc(2.0f);
17 int x = MyFunc(2);
18
-> 19 return 0;
20 }
(lldb) expr -- MyFunc('a')
This is an integer function
(int) $0 = 97
(lldb) expr -- MyFunc(2)
This is an integer function
(int) $1 = 2
(lldb) expr -- MyFunc(2.0f)
This is a float function
Now however the the first decl looks like it's always chosen, incorrectly in
these cases.
(lldb) target create "overloadable"
Current executable set to 'overloadable' (x86_64).
(lldb) b 19
Breakpoint 1: where = overloadable`main + 44 at overloadable.c:19, address =
0x00000000004005bc
(lldb) r
Process 6992 launched: '/home/ewan/Desktop/Scratch/overloadable' (x86_64)
This is a float function
This is an integer function
Process 6992 stopped
* thread #1: tid = 6992, 0x00000000004005bc overloadable`main + 44 at
overloadable.c:19, name = 'overloadable', stop reason = breakpoint 1.1
frame #0: 0x00000000004005bc overloadable`main + 44 at overloadable.c:19
16 MyFunc(2.0f);
17 int x = MyFunc(2);
18
-> 19 return 0;
20 }
(lldb) expr -- MyFunc('a')
This is a float function
(int) $0 = 25
(lldb) expr -- MyFunc(2)
This is a float function</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>