From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17021 invoked by alias); 2 Oct 2009 18:49:58 -0000 Received: (qmail 17011 invoked by uid 22791); 2 Oct 2009 18:49:56 -0000 X-SWARE-Spam-Status: No, hits=-2.5 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 18:49:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2BB162BAB34; Fri, 2 Oct 2009 14:49:51 -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 ssET8Fm6LCTP; Fri, 2 Oct 2009 14:49:51 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E71F42BAB25; Fri, 2 Oct 2009 14:49:50 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 81B8AF5906; Fri, 2 Oct 2009 11:49:46 -0700 (PDT) Date: Fri, 02 Oct 2009 18:49:00 -0000 From: Joel Brobecker To: Paul Pluzhnikov Cc: gdb-patches@sourceware.org Subject: Re: [RFC][patch] Allow to disassemble line. Message-ID: <20091002184946.GZ10338@adacore.com> References: <20091002004954.8966C76B2B@ppluzhnikov.mtv.corp.google.com> <20091002065226.GW10338@adacore.com> <8ac60eac0910021131j71b1f79t5d908195652dc7e1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0910021131j71b1f79t5d908195652dc7e1@mail.gmail.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/msg00065.txt.bz2 > Perhaps it is reasonable to get rid of the parameter, and just say that > 'disas/l' always disassembles current line, [...] Not necessarily. Perhaps we could look at the /l as a qualifier which allows the user to specify that he's not going to provide a range, or a start address, but rather one address that's part of a line. GDB is to understand this as a request to disassemble the block of instruction corresponding to the line corresponding to that address. When looking at it this way, adding support for "foo.c:22" becomes orthogonal to the introduction of the /l modifier. For instance, you could do "disass /l" which, without argument, would access the default value which conceptually is the $pc of the currently selected frame. We can also independently add FILE:LINE as a valid location expression and make it work regardless of whether the /l modifier is used or not. What I propose we do, for now, is not worry too much if the line of code is split in multiple instruction blocks. Let's just print the first one, for instance. There is no reason why we cannot deal with that later if needed. -- Joel