Re: JIT debugging (Attach and speed)

Pedro Alves
2016-03-22T15:46:45Z

On 03/22/2016 02:55 PM, Yichao Yu wrote:
> Hi,
>
> I've recently seen some issues when debugging julia JIT code with GDB.
> Some of these might worth a bug report but I'd like to post here first
> since the most blocking issue was discussed here a few years ago.
>
> 1. Registering JIT code to GDB is O(n^2) and this is very bad for
> serious JIT users like julia. (I've seen 10k to 100k jit objects
> generated in the test)
>
> The issue was discussed on this list ~2011[1] but it seems that the
> issue is still there. I was also told that lldb 3.8 should support the
> same JIT debugging interface without the O(n^2) slow down[2].

I re-read the 2011 discussion, and it seems like we had an idea for a
fix:

https://sourceware.org/ml/gdb/2011-01/msg00011.html

Paul, did you ever manage to get that working?

>
> 2. JIT code registration on attach is broken.
>
> When I set a breakpoint on `jit_inferior_init`[3] (i.e. lauching
> gdb with `gdb --args gdb -p <pid_to_debug>`) which IIUC is what
> responsible for walking the jit object list at init time, it seems
> that the function is never called.
>
> (I haven't seen a bug report about this yet)

Do you know whether this happens with 7.11 and master, and if so,
would it be possible for you to git bisect the culprit?

Thanks,
Pedro Alves