[syslinux] Debugging
Ferenc Wagner
wferi at niif.hu
Tue Jun 24 08:46:04 PDT 2008
Hi!
It's indeed better to open a new thread for this. So, here's my test
session:
$ qemu -fda extlinux.144 -s -S
Then in another terminal:
$ gdb extlinux.elf
(gdb) set architecture i8086
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0x0000fff0 in ?? () at localboot.inc:68
68 jmp kaboom ; If we returned, oh boy...
How does "jmp kaboom" get here? We are at the BIOS entry point:
(gdb) display/10i $cs*16+$eip
1: x/10i $cs * 16 + $eip
0xffff0: ljmp $0xf000,$0xe05b
[...]
(gdb) info symbol 0x7c00
bootsec in section .text
(gdb) b bootsec
Note: breakpoint -2 also set at pc 0x7c00.
Breakpoint 1 at 0x7c00: file extlinux.asm, line 146.
Breakpoint -2? That's new for me. Anyway:
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000005a7 in ?? ()
1: x/10i $cs * 16 + $eip
0xf05a7: push %bp
0xf05a8: mov %sp,%bp
0xf05aa: push %bx
0xf05ab: push %ds
0xf05ac: mov 4(%bp),%ax
0xf05af: movl %ax,%ds
0xf05b1: mov 6(%bp),%bx
0xf05b4: mov (%bx),%ax
0xf05b6: pop %ds
0xf05b7: pop %bx
(gdb) bt
#0 0x000005a7 in ?? ()
#1 0x00404dc6 in ?? ()
#2 0xfedf001c in ?? ()
#3 0x001ef000 in ?? ()
#4 0x003e001e in ?? ()
#5 0x7b66001e in ?? ()
#6 0x7b654c5c in ?? ()
#7 0x00007b64 in __stack_start ()
#8 0x11a8f000 in ?? ()
#9 0x00000000 in ?? ()
Now that doesn't buy me much...
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
pollchar () at conio.inc:289
289 mov dx,[SerialPort]
1: x/10i $cs * 16 + $eip
0x97e2 <pollchar+8>: mov 11242,%dx
0x97e6 <pollchar+12>: and %dx,%dx
0x97e8 <pollchar+14>: je 0x9801 <pollchar.done>
0x97ea <pollchar+16>: add $0x5,%dx
0x97ed <pollchar+19>: in (%dx),%al
0x97ee <pollchar+20>: test $0x1,%al
0x97f0 <pollchar+22>: je 0x9801 <pollchar.done>
0x97f2 <pollchar+24>: inc %dx
0x97f3 <pollchar+25>: mov 14758,%ah
0x97f7 <pollchar+29>: in (%dx),%al
(gdb) bt
#0 pollchar () at conio.inc:289
That doesn't either. Do I ask too much from my good ol' GDB when I
need a stack trace? Is there a way I can hint it perhaps?
Otherwise, I would be interested to read how you debug com32 modules.
--
Thanks,
Feri.
More information about the Syslinux
mailing list