Setting shared library search paths and core files

Before I dive into the code to see if there’s a bug, I wanted to see if I was just doing it wrong.

I have an application with a different libc, etc than the machine I’m running the debugger on. The application also has a bunch of libraries that simply don’t exist in the normal location on my dev machine. I do have everything extracted in a subdirectory with proper relative paths (i.e. my_extract/lib/…, my_extract/opt/…, my_extract/usr/…, etc).

With gdb, I’d do something like:

set sysroot .

file opt/my_cool_program

core my_broken_coredump

then everything would work.

I’ve tried (http://lists.llvm.org/pipermail/lldb-dev/2016-January/009233.html):

platform select --sysroot . host (also tried remote-linux, that didn’t work either)

target create opt/my_cool_program --core my_broken_coredump

or based on: http://lists.llvm.org/pipermail/lldb-dev/2016-January/009235.html

setting set target.exec-search-paths .

target create opt/my_cool_program --core my_broken_coredump

or, based on: http://lists.llvm.org/pipermail/lldb-dev/2016-January/009236.html

target create opt/my_cool_program --core my_broken_coredump

target modules search-paths add /lib ./lib

None of them seem to work. I tried lldb-3.9 in case any recent changes affected this functionality.

Is there a more correct way to do this? Or does this seem like a bug?

Core file debugging is not that well supported right now. I have made
a couple of fixes from time to time, mainly because I see it as a
possibility for testing other parts of the debugger, but I don't think
it get's much use and testing (on linux anyway).

I *think* you might be able to get it working by adding paths to all
libraries included in the core dump into your target.exec-search-paths
(so something like /sysroot/lib, /sysroot/usr/lib, ...), but I don't
guarantee anything. the --sysroot thingy sounds like the most
straight-forward interface, so it would be awesome if you could get
that working.

I regularly load core files on OSX, and it seems to work fine. Is Linux dramatically different?

John

IIUC Linux doesn't include the system libraries in the core files, makes them much smaller, but also makes reconstructing them a bit more work.

Jim