* Remote core file debugging
@ 2009-04-30 19:08 Eli Zaretskii
2009-04-30 19:11 ` David Daney
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-04-30 19:08 UTC (permalink / raw)
To: gdb
Is gdbserver supposed to support remote post-mortem debugging using a
core file on a remote machine?
I have a situation where producing a backtrace from a dead program's
core file by running GDB on the machine where the application crashed
is impractical. This is because the program has huge amounts of debug
info, so starting GDB eats up all memory, which is a no-no, since the
application which restarted itself after a crash must be up at all
times, and eating up too much memory causes the OS to kill
applications. So I'm looking for ways of producing the equivalent of
"bt full", but without firing up GDB on the target system (a Red Hat
box).
If gdbserver does not support this, what alternatives do I have?
TIA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:08 Remote core file debugging Eli Zaretskii
@ 2009-04-30 19:11 ` David Daney
2009-04-30 19:28 ` Eli Zaretskii
2009-04-30 19:26 ` Daniel Jacobowitz
2009-04-30 21:45 ` Mark Kettenis
2 siblings, 1 reply; 9+ messages in thread
From: David Daney @ 2009-04-30 19:11 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
Eli Zaretskii wrote:
> Is gdbserver supposed to support remote post-mortem debugging using a
> core file on a remote machine?
>
> I have a situation where producing a backtrace from a dead program's
> core file by running GDB on the machine where the application crashed
> is impractical. This is because the program has huge amounts of debug
> info, so starting GDB eats up all memory, which is a no-no, since the
> application which restarted itself after a crash must be up at all
> times, and eating up too much memory causes the OS to kill
> applications. So I'm looking for ways of producing the equivalent of
> "bt full", but without firing up GDB on the target system (a Red Hat
> box).
>
> If gdbserver does not support this, what alternatives do I have?
>
I must be missing something, but why can't you move the core file to the
debugging host and debug it there with gdb?
David Daney
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:08 Remote core file debugging Eli Zaretskii
2009-04-30 19:11 ` David Daney
@ 2009-04-30 19:26 ` Daniel Jacobowitz
2009-04-30 19:31 ` Eli Zaretskii
2009-04-30 21:45 ` Mark Kettenis
2 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2009-04-30 19:26 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
On Thu, Apr 30, 2009 at 10:03:24PM +0300, Eli Zaretskii wrote:
> Is gdbserver supposed to support remote post-mortem debugging using a
> core file on a remote machine?
No. Can you move the core file to the remote machine? You also need
a copy of the target application and libraries on the remote machine,
as with live remote debugging.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:11 ` David Daney
@ 2009-04-30 19:28 ` Eli Zaretskii
2009-04-30 19:40 ` Michael Snyder
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2009-04-30 19:28 UTC (permalink / raw)
To: David Daney; +Cc: gdb
> Date: Thu, 30 Apr 2009 12:08:02 -0700
> From: David Daney <ddaney@caviumnetworks.com>
> CC: gdb@sourceware.org
>
> I must be missing something, but why can't you move the core file to the
> debugging host and debug it there with gdb?
Sorry, I should have said that in the first place: because it's huge,
and there are quite a few of them. It's not a single target system,
either: there are a few dozen of them, so copying huge core files from
all of them would be at least time consuming if not impractical.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:26 ` Daniel Jacobowitz
@ 2009-04-30 19:31 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-04-30 19:31 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
> Date: Thu, 30 Apr 2009 15:11:01 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb@sourceware.org
>
> Can you move the core file to the remote machine?
See my response to David: I'd like to avoid that, if possible.
> You also need a copy of the target application and libraries on the
> remote machine, as with live remote debugging.
These are already available on the remote: the application is built
there and then pushed to the targets.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:28 ` Eli Zaretskii
@ 2009-04-30 19:40 ` Michael Snyder
2009-05-04 0:29 ` Hui Zhu
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2009-04-30 19:40 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: David Daney, gdb
Eli Zaretskii wrote:
>> Date: Thu, 30 Apr 2009 12:08:02 -0700
>> From: David Daney <ddaney@caviumnetworks.com>
>> CC: gdb@sourceware.org
>>
>> I must be missing something, but why can't you move the core file to the
>> debugging host and debug it there with gdb?
>
> Sorry, I should have said that in the first place: because it's huge,
> and there are quite a few of them. It's not a single target system,
> either: there are a few dozen of them, so copying huge core files from
> all of them would be at least time consuming if not impractical.
GDBserver cannot currently do what you want.
Options include
1) Teach gdbserver to understand core files, and
2) Write a corefile server that understands gdb serial protocol.
#2 might be a bit easier, at least if you start with libbfd
which already knows how to read core files. Your server would
only need to understand a reasonably small subset of commands
(memory read, register read, possibly threads if your system
includes them).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:08 Remote core file debugging Eli Zaretskii
2009-04-30 19:11 ` David Daney
2009-04-30 19:26 ` Daniel Jacobowitz
@ 2009-04-30 21:45 ` Mark Kettenis
2009-05-01 8:06 ` Eli Zaretskii
2 siblings, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2009-04-30 21:45 UTC (permalink / raw)
To: eliz; +Cc: gdb
> Date: Thu, 30 Apr 2009 22:03:24 +0300
> From: Eli Zaretskii <eliz@gnu.org>
>
> Is gdbserver supposed to support remote post-mortem debugging using a
> core file on a remote machine?
I don't think it is.
> I have a situation where producing a backtrace from a dead program's
> core file by running GDB on the machine where the application crashed
> is impractical. This is because the program has huge amounts of debug
> info, so starting GDB eats up all memory, which is a no-no, since the
> application which restarted itself after a crash must be up at all
> times, and eating up too much memory causes the OS to kill
> applications. So I'm looking for ways of producing the equivalent of
> "bt full", but without firing up GDB on the target system (a Red Hat
> box).
>
> If gdbserver does not support this, what alternatives do I have?
Copy the core file and binaries to a somewhat more powerful machine
and use a cross-gdb (the same you'd probably use with gdbserver)?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 21:45 ` Mark Kettenis
@ 2009-05-01 8:06 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-05-01 8:06 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb
> Date: Thu, 30 Apr 2009 23:37:05 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: gdb@sourceware.org
>
> > If gdbserver does not support this, what alternatives do I have?
>
> Copy the core file and binaries to a somewhat more powerful machine
> and use a cross-gdb (the same you'd probably use with gdbserver)?
No, I don't need a cross-gdb, as both systems are Red Hat.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Remote core file debugging
2009-04-30 19:40 ` Michael Snyder
@ 2009-05-04 0:29 ` Hui Zhu
0 siblings, 0 replies; 9+ messages in thread
From: Hui Zhu @ 2009-05-04 0:29 UTC (permalink / raw)
To: Michael Snyder; +Cc: Eli Zaretskii, David Daney, gdb
On Fri, May 1, 2009 at 03:23, Michael Snyder <msnyder@vmware.com> wrote:
> Eli Zaretskii wrote:
>>>
>>> Date: Thu, 30 Apr 2009 12:08:02 -0700
>>> From: David Daney <ddaney@caviumnetworks.com>
>>> CC: gdb@sourceware.org
>>>
>>> I must be missing something, but why can't you move the core file to the
>>> debugging host and debug it there with gdb?
>>
>> Sorry, I should have said that in the first place: because it's huge,
>> and there are quite a few of them. It's not a single target system,
>> either: there are a few dozen of them, so copying huge core files from
>> all of them would be at least time consuming if not impractical.
>
> GDBserver cannot currently do what you want.
>
> Options include
> 1) Teach gdbserver to understand core files, and
> 2) Write a corefile server that understands gdb serial protocol.
>
> #2 might be a bit easier, at least if you start with libbfd
> which already knows how to read core files. Your server would
> only need to understand a reasonably small subset of commands
> (memory read, register read, possibly threads if your system
> includes them).
#2 sounds cool. Maybe it can be optional function of gdbserver.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-05-04 0:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 19:08 Remote core file debugging Eli Zaretskii
2009-04-30 19:11 ` David Daney
2009-04-30 19:28 ` Eli Zaretskii
2009-04-30 19:40 ` Michael Snyder
2009-05-04 0:29 ` Hui Zhu
2009-04-30 19:26 ` Daniel Jacobowitz
2009-04-30 19:31 ` Eli Zaretskii
2009-04-30 21:45 ` Mark Kettenis
2009-05-01 8:06 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox