From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24092 invoked by alias); 11 Mar 2009 03:16:52 -0000 Received: (qmail 24084 invoked by uid 22791); 11 Mar 2009 03:16:51 -0000 X-SWARE-Spam-Status: No, hits=-1.5 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.190) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Mar 2009 03:16:42 +0000 Received: by ti-out-0910.google.com with SMTP id y8so1473862tia.12 for ; Tue, 10 Mar 2009 20:16:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.110.57.6 with SMTP id f6mr4442124tia.11.1236741399117; Tue, 10 Mar 2009 20:16:39 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 Mar 2009 08:32:00 -0000 Message-ID: Subject: Re: [RFC] disassemble-next-line From: teawater To: Tom Tromey , Eli Zaretskii , Doug Evans Cc: Pedro Alves , Daniel Jacobowitz , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00149.txt.bz2 Hi guys, On Mon, Mar 9, 2009 at 23:26, Tom Tromey wrote: >>>>>> "teawater" =3D=3D teawater =A0 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> + =A0 If OFF, GDB will not do it. > teawater> + =A0 doesn't support it, GDB will instead use the traditional > > I think this third line should be removed. OK. I will remove it. > > teawater> +/* Show assembly codes; stub for catch_errors. =A0*/ > teawater> + > teawater> +struct gdb_disassembly_stub_args > teawater> +{ > teawater> + =A0int how_many; > teawater> + =A0CORE_ADDR low; > teawater> + =A0CORE_ADDR high; > teawater> +}; > teawater> + > teawater> +static int > teawater> +gdb_disassembly_stub (void *args) > teawater> +{ > teawater> + =A0struct gdb_disassembly_stub_args *p =3D args; > teawater> + =A0gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->h= igh); > teawater> + =A0return 0; > > IMO, in this case it would be shorter, and clearer, to use TRY_CATCH > at the call site rather than catch_errors. =A0What do you think? OK. I will change it to TRY_CATCH. > > teawater> + =A0/* If disassemble-next-line is set to auto or on and doesn= 't have > teawater> + =A0 =A0 line message, output current instructions. =A0*/ > > "a line message" > > teawater> + =A0 =A0 =A0/* If disassemble-next-line is set to on and there= is line > teawater> + =A0 =A0 =A0 =A0 messages, output assembly codes for next line= . =A0*/ > > "there are line messages" I will change it. > > teawater> + =A0add_setshow_enum_cmd ("disassemble-next-line", class_run, > teawater> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 disassemble_next_line= _enum, > teawater> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &disassemble_next_lin= e, _("\ > 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. =A0I think it should at least say when the assembly will > be displayed. =A0"assembly codes" in particular sounds odd to me. I think Doug's idea is better: If ON, GDB will disassemble the next source line when execution stops. If the next source line cannot be ascertained, the next instruction will be disassembled instead. > > teawater> +If auto (which is the default), gdb will output a assembly cod= e\n\ > teawater> +at current address if there is not line message."), > > "at the current address" I will change it. > > The line message bit could use rewording as well; at least s/not/no/. > About line message. struct symtab_and_line { struct symtab *symtab; struct obj_section *section; /* Line number. Line numbers start at 1 and proceed through symtab->nlin= es. 0 is never a valid line number; it is used to indicate that line number information is not available. */ int line; CORE_ADDR pc; CORE_ADDR end; int explicit_pc; int explicit_line; }; It don't have comment name. What about change it to "line debug message"? Thanks for your help. Hui