This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Need help debuging i386 in real mode.
- From: David Daney <ddaney at avtrex dot com>
- To: "Develop.ReactOS" <develop dot reactos at gmail dot com>
- Cc: gdb <gdb at sourceware dot org>
- Date: Sun, 25 Mar 2007 22:55:34 -0700
- Subject: Re: Need help debuging i386 in real mode.
- References: <200703251435091123125@gmail.com>
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