From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20397 invoked by alias); 26 Mar 2007 05:55:45 -0000 Received: (qmail 20389 invoked by uid 22791); 26 Mar 2007 05:55:44 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1.dnsmadeeasy.com (HELO smtp1.dnsmadeeasy.com) (205.234.170.134) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 26 Mar 2007 06:55:41 +0100 Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id A187C29A7A3; Mon, 26 Mar 2007 05:55:39 +0000 (GMT) X-Authenticated-Name: js.dnsmadeeasy X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com Received: from avtrex.com (unknown [67.116.42.147]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP; Mon, 26 Mar 2007 05:55:39 +0000 (GMT) Received: from [192.168.7.223] ([192.168.7.223]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 25 Mar 2007 22:55:37 -0700 Message-ID: <46076056.10301@avtrex.com> Date: Mon, 26 Mar 2007 05:55:00 -0000 From: David Daney User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: "Develop.ReactOS" Cc: gdb Subject: Re: Need help debuging i386 in real mode. References: <200703251435091123125@gmail.com> In-Reply-To: <200703251435091123125@gmail.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00308.txt.bz2 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