* Need help debuging i386 in real mode.
@ 2007-03-25 6:35 Develop.ReactOS
2007-03-26 5:55 ` David Daney
0 siblings, 1 reply; 2+ messages in thread
From: Develop.ReactOS @ 2007-03-25 6:35 UTC (permalink / raw)
To: gdb
Hello:
I am trying to debug i386 in real mode. How to disassemble 16-bit code?
gdb appears to always assume a 32-bit segment.Is there a way to coerce gdb into 16-bit disassembly mode? Is there some other tool or cmd I could use?
I need 16-bit disassembly instruction,but gdb's output is wrong:
(gdb) x /10i $eip+$cs*16
0xffff0: ljmp 0x3131,0xf000e05b
0xffff7: das
0xffff8: xor BYTE PTR [ecx],dh
0xffffa: das
0xffffb: xor BYTE PTR [esi],dh
0xffffd: add ah,bh
0xfffff: test DWORD PTR [eax],0x0
0x100005: add BYTE PTR [eax],al
0x100007: add BYTE PTR [eax],al
0x100009: add BYTE PTR [eax],al
Best regards!
Develop.ReactOS
2007-03-25
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Need help debuging i386 in real mode.
2007-03-25 6:35 Need help debuging i386 in real mode Develop.ReactOS
@ 2007-03-26 5:55 ` David Daney
0 siblings, 0 replies; 2+ messages in thread
From: David Daney @ 2007-03-26 5:55 UTC (permalink / raw)
To: Develop.ReactOS; +Cc: gdb
Develop.ReactOS wrote:
> Hello:
> I am trying to debug i386 in real mode. How to disassemble 16-bit code?
> gdb appears to always assume a 32-bit segment.Is there a way to coerce gdb into 16-bit disassembly mode? Is there some other tool or cmd I could use?
>
> I need 16-bit disassembly instruction,but gdb's output is wrong:
> (gdb) x /10i $eip+$cs*16
> 0xffff0: ljmp 0x3131,0xf000e05b
> 0xffff7: das
> 0xffff8: xor BYTE PTR [ecx],dh
> 0xffffa: das
> 0xffffb: xor BYTE PTR [esi],dh
> 0xffffd: add ah,bh
> 0xfffff: test DWORD PTR [eax],0x0
> 0x100005: add BYTE PTR [eax],al
> 0x100007: add BYTE PTR [eax],al
> 0x100009: add BYTE PTR [eax],al
>
>
I have not tested it, but it looks like the GNU binutils objdump program
can do it. If you can get an image of the memory area you want to
disassemble into a file try something like:
objdump --target=binary --architecture=i8086 --disassemble-all
memory_image_filename
David Daney
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-26 5:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-25 6:35 Need help debuging i386 in real mode Develop.ReactOS
2007-03-26 5:55 ` David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox