Re: [patch,7.3] Fix JIT clang-lli gdb-7.3 regression Re: [gdb-7.3] Error in gdb-llvm integration: Unable to read JIT descriptor from remote memory!

Paul Pluzhnikov
2011-07-04T22:21:03Z

On Mon, Jul 4, 2011 at 2:46 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Sun, 03 Jul 2011 01:36:45 +0200, Yuri wrote:
>> I tried the upcoming gdb-7.3 and the message "Unable to read JIT descriptor
>> from remote memory!" is back when llvm::JITEmitDebugInfo is set when
>> libLLVM-3.0.so is loaded dynamically.
>> gdb-7.1 was broken this way, gdb-7.2 works, now gdb-7.3 code is broken
>> again.

Sorry about the breakage ...

> 739571cc3151651f49f7171cfd98275d983bfaaa is the first bad commit
> commit 739571cc3151651f49f7171cfd98275d983bfaaa
> Author: Paul Pluzhnikov <ppluzhnikov@google.com>
> Date:   Mon Jan 31 21:37:00 2011 +0000
> Re: [patch] Fix leak of bp_jit_event breakpoints
> http://sourceware.org/ml/gdb-patches/2011-01/msg00556.html
>
> I expect Paul had /usr/bin/lli linked statically; /usr/bin/lli uses
> libLLVM-2.8.so at least on Fedora 15.

Rather, I didn't test with lli (I don't even know what it is).

> I have mostly reverted that part of the Paul's patch

FWIW, I don't believe reverting the patch is the right fix. Certainly
using a single global to guard against recursive invocation can not
possibly work correctly in multi-inferior GDB.

> there is no "reduced"
> reinitialization on a new objfile load as it can be the first successful
> initialization at all.

It's been a while since I looked at that code, but it sounds to me
that we should keep the jit_inferior_data per-objfile, and not
per-inferior. This might even allow GDB to work with multiple JITers
in the same inferior ;-)

I'll see if I can work up a patch tomorrow.

Thanks,
--
Paul Pluzhnikov