This is the mail archive of the
mailing list for the GDB project.
Custom core file
- From: Nikolay Martyanov <nmartyanov at ptsecurity dot com>
- To: <gdb at sourceware dot org>
- Date: Wed, 28 Sep 2016 16:31:12 +0300
- Subject: Custom core file
- Authentication-results: sourceware.org; auth=none
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
As I understand, GDB can interpret only `core files`. But I didn't found
a lot of info about this file format.
Some sources say it should be a specific ELF file with several mandatory
Others say `core file` can be in any format and adaptation should be
done on BFD-level of GDB.
I looked through the code in corelow.c. Now my undestanding is somthing
1. Save data section of my hypervisor
2. Save current stack state of my hypervisor
3. Save current registers state (MSR?)
4. Define "sys/user.h"-like header with layout description of above
5. Using this header, implement function analog to
`trad_unix_core_file_p()` in file analog to `trad-core.c` (It translates
my `struct user` to `struct trad_core_struct`)
6. Implement functions like `supply_*regset()` in file like
7. ??? (magic I didn't realized yet)
Note, steps 1-3 say nothing about ELF-format. It embarrasses me...
So my question is: am I looking in a right direction? Can you point me
in to the issues in the plan (or even my understanding)?
Or may be there are any other ways to feed a raw physical memory to GDB?