From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2152 invoked by alias); 1 Oct 2009 16:33:42 -0000 Received: (qmail 2140 invoked by uid 22791); 1 Oct 2009 16:33:41 -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; Thu, 01 Oct 2009 16:33:35 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 99EC52BAB4E; Thu, 1 Oct 2009 12:33:33 -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 XjhaTwJ66w0Z; Thu, 1 Oct 2009 12:33:33 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4DB7A2BAB44; Thu, 1 Oct 2009 12:33:33 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5290AF593D; Thu, 1 Oct 2009 09:33:30 -0700 (PDT) Date: Thu, 01 Oct 2009 16:33:00 -0000 From: Joel Brobecker To: Caz Yokoyama Cc: 'Eli Zaretskii' , pedro@codesourcery.com, gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Message-ID: <20091001163330.GL10338@adacore.com> References: <1724490614004CEB9EE1A091A151E05B@xpjpn> <20090929042226.GK9003@adacore.com> <2C14068798BA41219F3603CDD24C8BC0@xpjpn> <20090929051929.GL9003@adacore.com> <7063C3E99BE344B2B98EDC0318ED852A@xpjpn> <20090929163910.GO9003@adacore.com> <93F096FEF7ED4579B52B23D69DA91195@xpjpn> <8363b0qm0n.fsf@gnu.org> <20090930201204.GH10338@adacore.com> <5650DA603A804427AA3B3F8F91164548@xpjpn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5650DA603A804427AA3B3F8F91164548@xpjpn> 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/msg00013.txt.bz2 Regarding testing, since you are modifying remote.c, you'll need to run the testsuite using gdbserver. The testsuite needs to be run before and after the patch, in order to compare the results. Normally, there should be no regression. Directions on how to do that are explained at http://sourceware.org/gdb/wiki/TestingGDB (see Testing gdbserver in a native configuration). Please indicate when you submit patches that you ran the testsuite, and that you found no regression. > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence: New function. > + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Just a few formatting nits left: The ChangeLog entries needs to be indented using tabs. You're mixing spaces and tabs. You're missing a closing parenthesis after send_interrupt_sequence and the line just after is too long (maximum is 79 or 80 characters). > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] You changed the user interface again, this is really fustrating. Personally, I don't care anymore what names we use for these options and I can see why you prefer them, but since we're changing them again, please ask Daniel Jacobowitz and Pedro Alves, who are the major maintainers and regular users of this code, whether they are OK with your choices. In the future, I would really appreciate if we agreed on the user interface first, without considering code while doing that, and then stay with what we've agreed on. Otherwise, things keep changing every time I look at a patch, and we both waste valuable time. That being said, we're getting there. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb starts. This is mostly needed when you debug > + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for > + connecting gdb. */ Formatting: 2 spaces after each of the 2 periods. > @@ -8993,6 +9073,10 @@ > _initialize_remote (void) > { > struct remote_state *rs; > + struct cmd_list_element *cmd; > + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ > + static char *_set_remotebreak_ = "remotebreak"; > + static char *_show_remotebreak_ = "remotebreak"; Try this instead: char *cmd_name; cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); deprecate_cmd (cmd, "set remote interrupt-sequence"); cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); deprecate_cmd (cmd, "show remote interrupt-sequence"); The reason why you're getting the SEGV is because lookup_cmd updates the pointer your passing to point after the command name it has matched. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ Please undo this part of the change. You do NOT need to update the command documentation for "set/show remotebreak", since this is already taken care -- Joel