[lldb-dev] How to load core on a different machine?

Eugene Birukov via lldb-dev lldb-dev at lists.llvm.org
Wed Jan 6 11:03:24 PST 2016

Hmm... neither approach really works. 
1. I created platform from lldb prompt, but when I create target from core file I see exactly the same wrong stacks. It seems that platform is ignored during core load in my case.2. chroot requires the whole set of binaries there in the new root. I simply cannot copy everything from the server. Even if I do, lldb will use copied binaries which is not a good idea...
root at eugenebi-L2:~# chroot /home/eugene/tmpchroot: failed to run command ‘/bin/bash’: No such file or directory
3. I tried SBDebugger::SetCurrentPlatformSDKRoot() but it does not have any visible effect on load core, not sure what it is supposed to do :)
> Subject: Re: [lldb-dev] How to load core on a different machine?
> From: gclayton at apple.com
> Date: Tue, 5 Jan 2016 15:04:36 -0800
> CC: lldb-dev at lists.llvm.org
> To: eugenebi at hotmail.com
> Try this:
> % lldb
> (lldb) platform select --sysroot /path/to/remote/shared/libraries remote-linux
> (lldb) <load core>
> If this works, there are SBPlatform class calls in the API you can use the select the platform as done above if you need to not do this from the command line.
> The other option is to chroot into /path/to/remote/shared/libraries and you will need to copy your core file into /path/to/remote/shared/libraries, then just run LLDB normally and it should work.
> Greg Clayton
> > On Jan 5, 2016, at 12:53 PM, Eugene Birukov via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> > 
> > Hi,
> > 
> > I am using LLDB-3.7 on Ubuntu Linux.
> > 
> > I have a core dump file and all shared libraries from my server but I want to investigate them on a dev box. But I fail to correctly load it in LLDB - it shows wrong stacks. I.e. I am looking for something equivalent to GDB commands "set solib-absolute-prefix" and "set solib-search-path".
> > 
> > I tried to play with "target modules search-paths insert", but I cannot use it if there is no target and I cannot load core after I have a target - not sure what this command is intended to do...
> > 
> > Now, what I really need to do - it is load core in my custom debugger that uses C++ API. Here I made some progress:
> > 	• Create target with NULL file name
> > 	• Load core using SBTarget::LoadCore()
> > 	• Manually load all executables - the initial a.out and all the shared libraries using SBTarget::AddModule() and SBTarget::SetModuleLoadAddress()
> > This kind of works, but there are two problems:
> > 	• How would I find the list of modules and addresses to load from the core file? Currently I did it by loading core in the debugger on the server, but this is not acceptable for production run...
> > 	• LLDB correctly prints stacks and resolves symbols, but I cannot disassembly any code - the ReadMemory retuns all zeroes from code addresses.
> > 
> > Any help would be greatly appreciated.
> > 
> > Thanks,
> > Eugene
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160106/0b5185a3/attachment.html>

More information about the lldb-dev mailing list