Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: "Develop.ReactOS" <develop.reactos@gmail.com>
Cc: gdb <gdb@sourceware.org>
Subject: Re: Need help debuging i386 in real mode.
Date: Mon, 26 Mar 2007 05:55:00 -0000	[thread overview]
Message-ID: <46076056.10301@avtrex.com> (raw)
In-Reply-To: <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


      reply	other threads:[~2007-03-26  5:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-25  6:35 Develop.ReactOS
2007-03-26  5:55 ` David Daney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46076056.10301@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=develop.reactos@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox