[syslinux] How do I debug com32 modules with GDB using DWARF format?
Tu Do
tuhdo1710 at gmail.com
Mon Oct 9 10:43:56 PDT 2017
On 10/10/17 12:11 AM, Gene Cumm wrote:
>
> I can't say I've ever tried using gdb against COM32 modules.
>
Well, in syslinux v5.00 and above, com32 modules are effectively built
as ELF.
Btw, I already found a way, though not perfect:
- Create a FAT bootable disk image using "syslinux --install".
- Copy hello.c32 module and load it in syslinux.cfg.
- Find the starting address of the sample module, hello.c32, in memory.
For my case, it's 0x37b000 because the main function is at 0x37b210.
0x210 is the start of .text section in hello.c32.
- With the starting address, I can reliably pass to gdb the correct
starting address of .text section, so it can jump to the correct code
when connecting to QEMU with a gdb stub.
The only remaining problem is how to reliably find out the starting
address of the first COM32R module, so I don't have to manually insert
hello.c32 every time I build a different syslinux version. Any idea is
highly appreciated, thanks.
> Care to elaborate on what you're attempting to debug?
Currently, I'm trying to debug a module that must run on a BIOS
environment, boot by syslinux. So, it will need to switch to real mode
temporary for using the services, then switch back to protected mode. At
the moment, syslinux v5.00 and above seem to abandon BIOS and is forcing
the modules to run in protected mode.
But that'll be for another topic.
Tu.
More information about the Syslinux
mailing list