[review,v2] jit: remove bp locations when unregistering jit code

Message ID 20191212090458.9403420AF6@gnutoolchain-gerrit.osci.io
State New, archived
Headers

Commit Message

Simon Marchi (Code Review) Dec. 12, 2019, 9:04 a.m. UTC
  Mihails Strasuns has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/704
......................................................................


Patch Set 2:

> Patch Set 2:
> Ok, so IIUC, you are using a special OpenCL runtime that happens to use the GDB JIT interface?

Yes. I think it uses LLVM JIT infrastructure internally which is the one responsible __jit_debug_register_code call.

It should be quite similar with the one I have linked though. Have just noticed that I had another old local patch to enable debug info for opencl:


With this change you may be able to trigger a pending breakpoint on the kernel function.
  

Patch

diff --git a/gdb/testsuite/lib/opencl_hostapp.c b/gdb/testsuite/lib/opencl_hostapp.c
index 9d6ce0eacb..23da3ad1f6 100644
--- a/gdb/testsuite/lib/opencl_hostapp.c
+++ b/gdb/testsuite/lib/opencl_hostapp.c
@@ -86,7 +86,7 @@  main ()
   device_extensions = (char *) malloc (len);
   CHK (clGetDeviceInfo (device, CL_DEVICE_EXTENSIONS, len, device_extensions,
                        NULL));
-  strcpy (kernel_build_opts, "-Werror -cl-opt-disable");
+  strcpy (kernel_build_opts, "-Werror -g -cl-opt-disable");
   if (strstr (device_extensions, "cl_khr_fp64") != NULL)
     strcpy (kernel_build_opts + strlen (kernel_build_opts),
            " -D HAVE_cl_khr_fp64");