From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2421 invoked by alias); 17 Apr 2008 21:25:50 -0000 Received: (qmail 2413 invoked by uid 22791); 17 Apr 2008 21:25:50 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Apr 2008 21:25:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 85B372AA414; Thu, 17 Apr 2008 17:25:21 -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 pr0V7fTHq69C; Thu, 17 Apr 2008 17:25:21 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4CA552AA34E; Thu, 17 Apr 2008 17:25:21 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 416B6E7ACD; Thu, 17 Apr 2008 14:25:19 -0700 (PDT) Date: Thu, 17 Apr 2008 21:29:00 -0000 From: Joel Brobecker To: Doug Evans Cc: Michael Snyder , Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [RFA] mixed source+assembly from cli disassemble Message-ID: <20080417212519.GD12735@adacore.com> References: <20080404003857.A5A451C72B9@localhost> <20080416185535.GB3626@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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: 2008-04/txt/msg00368.txt.bz2 > 2008-04-16 Doug Evans > > * NEWS: Mention new /m modifier for disassemble command. > * cli/cli-cmds.c (print_disassembly): New function. > (disassemble_current_function): New function > (disassemble_command): Recognize /m modifier, print mixed > source+assembly. > (init_cli_cmds): Update disassemble help text. The code part of your patch is good to go, with a couple of tiny adjustments. Let's wait for Eli's feedback before checking in, since there is some documentation being adjusted in the code too. > + printf_filtered ("Dump of assembler code "); > + if (name != NULL) > + { > + printf_filtered ("for function %s:\n", name); > + } > + else > + { > + printf_filtered ("from %s to %s:\n", paddress (low), paddress (high)); > + } We don't need the curly braces in this case. Can you remove them? > + if (*arg == '\0') > + error (_("Missing modifier.")); > + > + while (*arg && ! isspace (*arg)) > + { > + switch (*arg++) > + { > + case 'm': > + mixed_source_and_assembly = 1; > + break; > + default: > + error (_("Invalid disassembly modifier.")); > + } > + } > + > + while (isspace (*arg)) > + ++arg; The formatting looks weird, because some of the lines (the "while" lines for instance) are using spaces instead of tabs. Could you fix that to use TABs, please? > @@ -1383,6 +1439,7 @@ With two args if one is empty it stands > c = add_com ("disassemble", class_vars, disassemble_command, _("\ > Disassemble a specified section of memory.\n\ > Default is the function surrounding the pc of the selected frame.\n\ > +With a /m modifier source lines, if available, are included.\n\ I'd like to have Eli's feedback on this change. I would phrase differently (the current form is missing a coma to make it intelligible): With a /m modifier, source lines are included (if available). -- Joel