[LLVMbugs] [Bug 24235] New: Thunk function appears in debugger call stack

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 23 14:04:18 PDT 2015


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

            Bug ID: 24235
           Summary: Thunk function appears in debugger call stack
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: amjad.aboud at intel.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14638
  --> https://llvm.org/bugs/attachment.cgi?id=14638&action=edit
Source file to reproduce the issue

To reproduce the issue build the attached source file:
1. run the following command line:
  clang -cc1 -triple x86_64-pc-linux -emit-obj -g -O0 -o thunk-call-stack.o
thunk-call-stack.cpp
2. link the object file "thunk-call-stack.o" into executable thunk-call-stack
4. run: gdb thunk-call-stack
5. add a breakpoint at line 10 and run ("b 10" --> "r")
6. show the call stack ("bt")

It will look like this:
(gdb) bt
#0  C::foo() () at dbgThunk.cpp:10
#1  0x00000000004008bb in virtual thunk to C::foo() () at dbgThunk.cpp:10
#2  0x00000000004007e7 in main () at dbgThunk.cpp:16


while it should look like this:
#0  C::foo() () at dbgThunk.cpp:10
#1  0x00000000004007e7 in main () at dbgThunk.cpp:16


The root cause for this is that the thunk function is being generated with a
call instruction to the original function rather than a jump instruction.

-- 
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/20150723/39a7e994/attachment.html>


More information about the llvm-bugs mailing list