From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13751 invoked by alias); 9 Mar 2009 15:29:07 -0000 Received: (qmail 13741 invoked by uid 22791); 9 Mar 2009 15:29:05 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Mar 2009 15:28:56 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n29FQ60Y014389; Mon, 9 Mar 2009 11:26:06 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n29FQ6HS010024; Mon, 9 Mar 2009 11:26:06 -0400 Received: from opsy.redhat.com (vpn-12-241.rdu.redhat.com [10.11.12.241]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n29FQ5X4010860; Mon, 9 Mar 2009 11:26:05 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 8C2F13784C6; Mon, 9 Mar 2009 09:26:03 -0600 (MDT) To: teawater Cc: Eli Zaretskii , Doug Evans , Pedro Alves , Daniel Jacobowitz , "gdb-patches\@sourceware.org" Subject: Re: [RFC] disassemble-next-line References: From: Tom Tromey Reply-To: Tom Tromey Date: Mon, 09 Mar 2009 15:29:00 -0000 In-Reply-To: (teawater@gmail.com's message of "Sun\, 8 Mar 2009 13\:34\:38 +0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-03/txt/msg00113.txt.bz2 >>>>> "teawater" == teawater writes: teawater> This is the patch for the function to output assembly codes teawater> for next line. teawater> +/* If ON, GDB will output the assembly codes of next line. teawater> + If OFF, GDB will not do it. teawater> + doesn't support it, GDB will instead use the traditional I think this third line should be removed. teawater> +/* Show assembly codes; stub for catch_errors. */ teawater> + teawater> +struct gdb_disassembly_stub_args teawater> +{ teawater> + int how_many; teawater> + CORE_ADDR low; teawater> + CORE_ADDR high; teawater> +}; teawater> + teawater> +static int teawater> +gdb_disassembly_stub (void *args) teawater> +{ teawater> + struct gdb_disassembly_stub_args *p = args; teawater> + gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->high); teawater> + return 0; IMO, in this case it would be shorter, and clearer, to use TRY_CATCH at the call site rather than catch_errors. What do you think? teawater> + /* If disassemble-next-line is set to auto or on and doesn't have teawater> + line message, output current instructions. */ "a line message" teawater> + /* If disassemble-next-line is set to on and there is line teawater> + messages, output assembly codes for next line. */ "there are line messages" teawater> + add_setshow_enum_cmd ("disassemble-next-line", class_run, teawater> + disassemble_next_line_enum, teawater> + &disassemble_next_line, _("\ teawater> +Set debugger's willingness to use disassemble-next-line."), _("\ This text seems circular. Instead it should briefly describe what the option does. teawater> +Show debugger's willingness to use disassemble-next-line."), _("\ teawater> +If on, gdb will output the assembly codes of next line.\n\ This also reads strangely, but I don't have a suggestion for what it ought to say. I think it should at least say when the assembly will be displayed. "assembly codes" in particular sounds odd to me. teawater> +If auto (which is the default), gdb will output a assembly code\n\ teawater> +at current address if there is not line message."), "at the current address" The line message bit could use rewording as well; at least s/not/no/. Tom