From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22020 invoked by alias); 3 Mar 2009 16:42:02 -0000 Received: (qmail 21898 invoked by uid 22791); 3 Mar 2009 16:42:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Mar 2009 16:41:57 +0000 Received: from wpaz21.hot.corp.google.com (wpaz21.hot.corp.google.com [172.24.198.85]) by smtp-out.google.com with ESMTP id n23GftHQ004492 for ; Tue, 3 Mar 2009 08:41:55 -0800 Received: from rv-out-0708.google.com (rvbl33.prod.google.com [10.140.88.33]) by wpaz21.hot.corp.google.com with ESMTP id n23GfoIY018204 for ; Tue, 3 Mar 2009 08:41:53 -0800 Received: by rv-out-0708.google.com with SMTP id l33so2684071rvb.0 for ; Tue, 03 Mar 2009 08:41:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.187.14 with SMTP id k14mr3602428rvf.270.1236098513228; Tue, 03 Mar 2009 08:41:53 -0800 (PST) In-Reply-To: References: Date: Tue, 03 Mar 2009 16:42:00 -0000 Message-ID: Subject: Re: What about add a interface to output the assembly codes follow inferior execution From: Doug Evans To: teawater Cc: gdb ml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2009-03/txt/msg00023.txt.bz2 On Mon, Mar 2, 2009 at 7:10 PM, teawater wrote: > Hi guys, > > I am not sure gdb have a interface to output assembly codes except > "disassemble". > Maybe gdb can support a interface can output assembly codes of next > part of code. > > For example: > #If exec-disassemble set to auto, just output assembly codes if there > is not line message. > #It will be the default value. > (gdb) set exec-disassemble auto > (gdb) si > 0x080483ee =A0 =A0 =A024 =A0 =A0 =A0 =A0 =A0 =A0 =A0b =3D printf ("a =3D = %d b =3D %d c =3D %d\n", a, b, c); > (gdb) si > 0x080482d8 in printf@plt () > Current language: =A0auto; currently asm > 0x080482d8 : =A0 =A0 =A0jmp =A0 =A0*0x8049670 > (gdb) si > 0x080482de in printf@plt () > 0x080482de : =A0 =A0 =A0push =A0 $0x10 > > #If exec-disassemble set to on, gdb will always output assembly codes. > (gdb) set exec-disassemble on > (gdb) n > 26 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf ("a =3D %d b =3D %d c =3D %d\n", a, = b, c); > =A080483fe: =A0 =A0 =A0 8b 15 84 96 04 08 =A0 =A0 =A0 mov =A0 =A00x804968= 4,%edx > =A08048404: =A0 =A0 =A0 8b 45 f4 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mov =A0 = =A0-0xc(%ebp),%eax > =A08048407: =A0 =A0 =A0 89 44 24 0c =A0 =A0 =A0 =A0 =A0 =A0 mov =A0 =A0%e= ax,0xc(%esp) > =A0804840b: =A0 =A0 =A0 8b 45 f8 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mov =A0 = =A0-0x8(%ebp),%eax > =A0804840e: =A0 =A0 =A0 89 44 24 08 =A0 =A0 =A0 =A0 =A0 =A0 mov =A0 =A0%e= ax,0x8(%esp) > =A08048412: =A0 =A0 =A0 89 54 24 04 =A0 =A0 =A0 =A0 =A0 =A0 mov =A0 =A0%e= dx,0x4(%esp) > =A08048416: =A0 =A0 =A0 c7 04 24 58 85 04 08 =A0 =A0movl =A0 $0x8048558,(= %esp) > =A0804841d: =A0 =A0 =A0 e8 b6 fe ff ff =A0 =A0 =A0 =A0 =A0call =A0 80482d= 8 > > #If exec-disassemble set to off, gdb will work like before. > (gdb) set exec-disassemble off > > > What do you think about it? Are you looking for behaviour different than what "disp/8i $pc" would give = you?