From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8406 invoked by alias); 2 Oct 2009 06:52:37 -0000 Received: (qmail 8396 invoked by uid 22791); 2 Oct 2009 06:52:36 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Oct 2009 06:52:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1B2C62BABB3; Fri, 2 Oct 2009 02:52:31 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Ho-ojU34YtND; Fri, 2 Oct 2009 02:52:31 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D69052BABB0; Fri, 2 Oct 2009 02:52:30 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B959AF593D; Thu, 1 Oct 2009 23:52:26 -0700 (PDT) Date: Fri, 02 Oct 2009 06:52:00 -0000 From: Joel Brobecker To: Paul Pluzhnikov Cc: gdb-patches@sourceware.org Subject: Re: [RFC][patch] Allow to disassemble line. Message-ID: <20091002065226.GW10338@adacore.com> References: <20091002004954.8966C76B2B@ppluzhnikov.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091002004954.8966C76B2B@ppluzhnikov.mtv.corp.google.com> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00048.txt.bz2 > Attached patch makes it so 'disas/l' will disassemble current line, and > 'disas/l foo.c:22' will disassemble line 22 of foo.c Without looking at the implementation itself for now, I have to say that I have been missing this feature very badly. Questions: 1. What should we do if there are more than one match for the given SAL? Probably, we want to display a multiple-choice menu, and force the user to select one and only one choice. Eg: disass /l foo.c:22 Multiple matches for foo.c:22 [0] cancel [1] foo at foo.c:22 [2] bar at foo.c:22 > This can happen I think with templates (called generics in Ada), and probably inlining. 2. A little trickier: How do we want to handle the case where a line of code is split in more than one block of instructions. This happens really often when debugging optimized code. Right now, the easy solution is to only disassemble the first block. It'd be nice to have them all, though. Perhaps printing the instructions for each block one after the other, with something like a little sign in between indicating the next instruction is part of another block? 0x... bla bla bla 0x... bla bla bla [...] 0x... bla bla bla Anyway, I really like this new feature. -- Joel