Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Duane Ellis <duane@duaneellis.com>
To: Nikolay Martyanov <nmartyanov@ptsecurity.com>
Cc: gdb@sourceware.org
Subject: Re: Custom core file
Date: Wed, 28 Sep 2016 14:28:00 -0000	[thread overview]
Message-ID: <E81BD1FA-C0C1-459F-AB37-9931DB41C8DF@duaneellis.com> (raw)
In-Reply-To: <fb396495-657e-1429-d773-f302171ae3b7@ptsecurity.com>


> I have a self-written bare-metal hypervisor for x86 arch and I'd like to perform postmortem debugging of it's core (not VM, hypervisor itself!).
> So the idea is to save physical memory state and later use GDB to interpret it.

[snip]

> Or may be there are any other ways to feed a raw physical memory to GDB?


here’s a method

GDB has a built in Python interpreter.

GDB has commands such as “dump” and “restore” that allow you to copy a binary file into memory.

Thus - you can use a bit of python to extract your custom core dump
For example you might use Python to unpack your custom core file into various temp binary files
Then in the same python script execute dump/restore commands to load these into memory

http://www.delorie.com/gnu/docs/gdb/gdb_69.html

See:   restore FILENAME binary …..



  reply	other threads:[~2016-09-28 14:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 13:31 Nikolay Martyanov
2016-09-28 14:28 ` Duane Ellis [this message]
2016-09-28 14:58 ` Jan Kratochvil
2016-09-28 15:18   ` Nikolay Martyanov
2016-09-28 15:33     ` Jan Kratochvil
2016-09-28 16:27       ` Nikolay Martyanov
2016-09-28 15:02 ` Nikolay Martyanov
2016-09-28 15:31 duane
2016-09-28 16:37 ` Nikolay Martyanov
2016-09-28 19:22 ` Nikolay Martyanov

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=E81BD1FA-C0C1-459F-AB37-9931DB41C8DF@duaneellis.com \
    --to=duane@duaneellis.com \
    --cc=gdb@sourceware.org \
    --cc=nmartyanov@ptsecurity.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