From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14056 invoked by alias); 3 Mar 2009 03:11:06 -0000 Received: (qmail 14046 invoked by uid 22791); 3 Mar 2009 03:11:05 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Mar 2009 03:10:59 +0000 Received: by ti-out-0910.google.com with SMTP id y8so2852410tia.12 for ; Mon, 02 Mar 2009 19:10:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.110.11.4 with SMTP id 4mr8490376tik.47.1236049855014; Mon, 02 Mar 2009 19:10:55 -0800 (PST) Date: Tue, 03 Mar 2009 03:11:00 -0000 Message-ID: Subject: What about add a interface to output the assembly codes follow inferior execution From: teawater To: gdb ml Content-Type: text/plain; charset=ISO-8859-1 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: 2009-03/txt/msg00017.txt.bz2 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 24 b = printf ("a = %d b = %d c = %d\n", a, b, c); (gdb) si 0x080482d8 in printf@plt () Current language: auto; currently asm 0x080482d8 : jmp *0x8049670 (gdb) si 0x080482de in printf@plt () 0x080482de : push $0x10 #If exec-disassemble set to on, gdb will always output assembly codes. (gdb) set exec-disassemble on (gdb) n 26 printf ("a = %d b = %d c = %d\n", a, b, c); 80483fe: 8b 15 84 96 04 08 mov 0x8049684,%edx 8048404: 8b 45 f4 mov -0xc(%ebp),%eax 8048407: 89 44 24 0c mov %eax,0xc(%esp) 804840b: 8b 45 f8 mov -0x8(%ebp),%eax 804840e: 89 44 24 08 mov %eax,0x8(%esp) 8048412: 89 54 24 04 mov %edx,0x4(%esp) 8048416: c7 04 24 58 85 04 08 movl $0x8048558,(%esp) 804841d: e8 b6 fe ff ff call 80482d8 #If exec-disassemble set to off, gdb will work like before. (gdb) set exec-disassemble off What do you think about it? Thanks, Hui