Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDB JIT object registration does not work with LLVM shared library #17856

Closed
yuyichao opened this issue Aug 5, 2016 · 1 comment · Fixed by #20260
Closed

GDB JIT object registration does not work with LLVM shared library #17856

yuyichao opened this issue Aug 5, 2016 · 1 comment · Fixed by #20260
Labels
upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@yuyichao
Copy link
Contributor

yuyichao commented Aug 5, 2016

Not sure if this is due to our compile/link flag or GDB/LLVM bug. (Probably should test on a version of lldb that support jit code registration but somehow my lldb is behaving strangely right now).

Of course an acceptable solution is to make native code debugging in Gallium with and without rr as good as gdb/lldb and also easily installable so that we can remove this interface altogether.

@yuyichao
Copy link
Contributor Author

yuyichao commented Sep 19, 2016

Figured out the root cause https://sourceware.org/ml/gdb/2016-09/msg00059.html Hopefully some gdb dev can fix it soon. Meanwhile, anyone who need this feature can try the following patch.

diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp
index ef8855e..ce62590 100644
--- a/src/jitlayers.cpp
+++ b/src/jitlayers.cpp
@@ -269,9 +269,11 @@ extern "C" {
   // We put information about the JITed function in this global, which the
   // debugger reads.  Make sure to specify the version statically, because the
   // debugger checks the version before we can set it during runtime.
-  extern struct jit_descriptor __jit_debug_descriptor;
+  JL_DLLEXPORT struct jit_descriptor __jit_debug_descriptor;

-  LLVM_ATTRIBUTE_NOINLINE extern void __jit_debug_register_code();
+  JL_DLLEXPORT LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code()
+  {
+  }
 }

 namespace {

Another good news is that they seems to have made some progress on #14846 ref https://sourceware.org/ml/gdb/2016-09/msg00056.html

Edit: and upstream bug report https://sourceware.org/bugzilla/show_bug.cgi?id=20633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant