From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16854 invoked by alias); 10 Jul 2007 00:22:31 -0000 Received: (qmail 16846 invoked by uid 22791); 10 Jul 2007 00:22:30 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jul 2007 00:22:27 +0000 Received: from kahikatea.snap.net.nz (216.61.255.123.dynamic.snap.net.nz [123.255.61.216]) by viper.snap.net.nz (Postfix) with ESMTP id 7849F3D9A6C; Tue, 10 Jul 2007 12:22:23 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 7EA7F8FBF6; Tue, 10 Jul 2007 12:22:21 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18066.53564.134378.88590@kahikatea.snap.net.nz> Date: Tue, 10 Jul 2007 00:22:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org Subject: Re: $_ and info breakpoint [PATCH] In-Reply-To: <20070709115647.GC3095@caradoc.them.org> References: <18064.7905.924535.720690@kahikatea.snap.net.nz> <20070709115647.GC3095@caradoc.them.org> X-Mailer: VM 7.19 under Emacs 22.1.50.12 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: 2007-07/txt/msg00157.txt.bz2 > > The convenience variable `$_' and the default > > examining-address for the `x' command are set to the address of > > the last breakpoint listed > > I didn't know this was there, but if it's a documented feature, we > should probably leave it be. But it's not documented for -break-list > and I can't see any reason why it should be. > > > 1) That "info breakpoint" doesn't set $_. At least -break-list shouldn't > > do this. > > Is changing -break-list enough to fix your problem? If so, I > recommend that; either by separating -break-list and info break into > different functions, or by the old hack of ui_out_is_mi_like_p. At the moment Emacs still uses "info breakpoint". I certainly will change the behaviour of -break-list but for the moment I would like to implement my last suggestion: make "server info breakpoint" not set $_ and this would seem a more natural step too. AFAICS the server prefix was written for use with annotations and front-ends. This shouldn't affect existing use and we can put a caveat in the documentaion in the manual: The convenience variable `$_' and the default examining-address for the `x' command are set to the address of the last breakpoint listed unless the command is prefixed with 'server ' (see Command History). -- Nick http://www.inet.net.nz/~nickrob 2007-07-10 Nick Roberts * breakpoint.c: Include "top.h". (breakpoint_1): Don't set convenience variable $_ if server prefix is used. (_initialize_breakpoint): Describe this behaviour in command help. *** breakpoint.c 03 Jul 2007 16:45:50 +1200 1.255 --- breakpoint.c 10 Jul 2007 12:11:31 +1200 *************** *** 55,60 **** --- 55,61 ---- #include "exceptions.h" #include "memattr.h" #include "ada-lang.h" + #include "top.h" #include "gdb-events.h" #include "mi/mi-common.h" *************** breakpoint_1 (int bnum, int allflag) *** 3828,3834 **** { /* Compare against (CORE_ADDR)-1 in case some compiler decides that a comparison of an unsigned with -1 is always false. */ ! if (last_addr != (CORE_ADDR) -1) set_next_address (last_addr); } --- 3829,3835 ---- { /* Compare against (CORE_ADDR)-1 in case some compiler decides that a comparison of an unsigned with -1 is always false. */ ! if (last_addr != (CORE_ADDR) -1 && !server_command) set_next_address (last_addr); } *************** breakpoint will be disabled. The \"Addr *** 8161,8167 **** address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed.\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); } --- 8162,8169 ---- address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed unless the command\n\ ! is prefixed with \"server \".\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); } *************** breakpoint will be disabled. The \"Addr *** 8177,8183 **** address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed.\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); --- 8179,8186 ---- address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed unless the command\n\ ! is prefixed with \"server \".\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); *************** breakpoint will be disabled. The \"Addr *** 8193,8199 **** address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed.\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); --- 8196,8203 ---- address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed unless the command\n\ ! is prefixed with \"server \".\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.")); *************** breakpoint will be disabled. The \"Addr *** 8212,8219 **** address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed.\n\ ! \n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set."), &maintenanceinfolist); --- 8216,8223 ---- address and file/line number respectively.\n\ \n\ Convenience variable \"$_\" and default examine address for \"x\"\n\ ! are set to the address of the last breakpoint listed unless the command\n\ ! is prefixed with \"server \".\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set."), &maintenanceinfolist);