[llvm-bugs] [Bug 26694] New: Expression evaluation broken for__attribute__((overloadable))

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 22 08:03:21 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26694

            Bug ID: 26694
           Summary: Expression evaluation broken
                    for__attribute__((overloadable))
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: ewan at codeplay.com
                CC: llvm-bugs at lists.llvm.org, scallanan at apple.com
    Classification: Unclassified

Created attachment 15932
  --> https://llvm.org/bugs/attachment.cgi?id=15932&action=edit
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

-- 
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/20160222/e6a6136b/attachment-0001.html>


More information about the llvm-bugs mailing list