From: Hesham M <hesham.eembedded@gmail.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Postmortem debugging with arm-none-eabi-gdb from memory dump (not core)
Date: Sat, 14 Oct 2017 08:52:00 -0000 [thread overview]
Message-ID: <CA+fECkUWYrc8Xa0GZM+ST0pz9OWSj=dNSoCL2iHQWE0staQVdA@mail.gmail.com> (raw)
In-Reply-To: <20171013201955.GK8425@1170ee0b50d5>
On Fri, Oct 13, 2017 at 4:19 PM, Yao Qi <qiyaoltc@gmail.com> wrote:
> On 17-10-05 05:55:38, Hesham M wrote:
>> Hi all,
>>
>> As this is my first email to the list, and as an old user for gdb, I'd like
>> first to thank the gdb community for their effort.
>>
>> In a bare-metal ARM system, is there a way to use arm-none-eabi-gdb for
>> postmortem debugging, the same way we do when we debug with core file on
>> Linux, for example?
>>
>> The issue is that I don't have a "core" file but I can generate memory dump
>> of the whole memory (ROM is already known and through the hardware debugger
>> used I can write the RAM contents to a file (outside the target of course).
>> I can also collect the registers at the time of the crash. I can do the
>> debugging/analysis if I connect gdb to the target at the time of the crash
>> but I need to do this in later time away from the target. I hope to find a
>> way to debug with memory dumps the same way gdb debugs with core files.
>>
>> Of course if I can convert the memory dump to a valid core file, it might
>> be another path to the solution. I don't know how to do that or if there is
>> a tool that can help with this conversion.
>>
>> Any idea if this is possible?
>
> I prefer this approach, and it is possible. GDB has a command "gcore",
> https://sourceware.org/gdb/current/onlinedocs/gdb/Core-File-Generation.html#index-generate_002dcore_002dfile
> you can take a loop how GDB does it.
>
>>
>> A variant of this is idea is done for Keil tools:
>> https://os.mbed.com/blog/entry/Post-mortem-debugging-with-ARM-mbed/
>>
>> I have posted a similar question on stackoverflow but they closed it! So,
>> please let me know if my question isn't clear.
>>
>> Thanks,
>> -Hesham
>
> --
> Yao (齐尧)
Hi Yao,
Thanks for replying. Unfortunately, gcore is not implemented for
bare-metal ARM, arm-none-eabi-gdb.
GDB documentation says abour gcore:
Note that this command is implemented only for some systems (as of
this writing, GNU/Linux, FreeBSD, Solaris, and S390).
Trying it on my system, I got:
(gdb) gcore file
Command not implemented for this target.
I appreciate any ideas or hints.
Thanks,
-Hesham
next prev parent reply other threads:[~2017-10-14 8:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 9:55 Hesham M
2017-10-13 18:00 ` Hesham M
2017-10-13 20:20 ` Yao Qi
2017-10-14 8:52 ` Hesham M [this message]
2017-10-15 8:11 ` Christian Gagneraud
2017-10-15 16:31 ` Hesham M
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+fECkUWYrc8Xa0GZM+ST0pz9OWSj=dNSoCL2iHQWE0staQVdA@mail.gmail.com' \
--to=hesham.eembedded@gmail.com \
--cc=gdb@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox