[lldb-dev] Linux core dump doesn't show listing when loaded
Ted Woodward via lldb-dev
lldb-dev at lists.llvm.org
Tue Dec 8 12:07:00 PST 2015
I don't think we should automatically print a backtrace after the target create; just the stop reason and source (or disassembly) listing, ideally only for the crashed thread.
Conceptually, we're loading the core file and attaching, and get a stopped state. The state should be completely read-only - no running, changing memory, registers, etc.
Process::LoadCore() shows this:
// We successfully loaded a core file, now pretend we stopped so we can
// show all of the threads in the core file and explore the crashed
// state.
SetPrivateState (eStateStopped);
Process::LoadCore() also acts like we're attaching:
DynamicLoader *dyld = GetDynamicLoader ();
if (dyld)
dyld->DidAttach();
GetJITLoaders().DidAttach();
A comment in CommandObjectTarget.cpp says we're launching the core file:
// Seems weird that we Launch a core file, but that is
// what we do!
error = process_sp->LoadCore();
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
-----Original Message-----
From: lldb-dev [mailto:lldb-dev-bounces at lists.llvm.org] On Behalf Of Jim Ingham via lldb-dev
Sent: Wednesday, December 02, 2015 12:26 PM
To: Todd Fiala
Cc: LLDB
Subject: Re: [lldb-dev] Linux core dump doesn't show listing when loaded
> On Dec 2, 2015, at 8:35 AM, Todd Fiala via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>
> Does our init file mechanism have the ability to do something conditionally if it's a core file? (i.e. do we already have a way to get Ted's desired behavior via an inserted call to "thread backtrace all" that somehow gets triggered by the init, but only when we're talking about a core file?)
>
> Alternatively, Ted, you could have a wrapper script of some sort (think lldb-core.{sh,bat} or something) that you call that sources an lldb core-file-specific init file that sets up aliases and the like to start up lldb how you want, maybe?
Seems to me, the question is, is "target create --core" the same as "target create" or is it "target create" followed by "attach". In the latter case, for "real" processes, we always print the stop state. Since you really are attaching to the core process when you load a core file, the behavior of printing the stop state feels more right to me. As to how that prints, following this logic, that should be the same as any other stop printing, and is I think orthogonal to Ted's original question.
Jim
>
> On Mon, Nov 30, 2015 at 9:32 AM, Greg Clayton via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> "thread list" should just list the threads and their stop reasons (no backtraces). If you want backtraces just do "thread backtrace all".
>
>
> On Nov 24, 2015, at 1:09 PM, Ted Woodward via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> >
> > I’ve been working on an old rev that we’d released on; now I’m much closer to ToT as we move towards our next major Hexagon release.
> >
> > Core dumps on the old rev would print out a listing/disassembly for each thread in the core dump. Now it doesn’t.
> >
> > ToT does this, on x86 Linux:
> >
> > >bin/lldb ~/lldb_test/coredump/lincrash -c ~/lldb_test/coredump/lincore
> > (lldb) target create "/usr2/tedwood/lldb_test/coredump/lincrash" --core "/usr2/tedwood/lldb_test/coredump/lincore"
> > Core file '/usr2/tedwood/lldb_test/coredump/lincore' (x86_64) was loaded.
> > (lldb) thread list
> > Process 0 stopped
> > * thread #1: tid = 0, 0x0000000000401190 lincrash`main + 16 at lincrash.c:5, name = 'lincrash', stop reason = signal SIGSEGV
> > (lldb)
> >
> > I can see the listing by going up and down the stack, but I’d like to see the listing on load. Is the no listing intended?
> >
> > Ted
> >
> > --
> > Qualcomm Innovation Center, Inc.
> > The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
> >
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
>
> --
> -Todd
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
_______________________________________________
lldb-dev mailing list
lldb-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
More information about the lldb-dev
mailing list