This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: $_ and info breakpoint [PATCH]
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 10 Jul 2007 12:22:20 +1200
- Subject: Re: $_ and info breakpoint [PATCH]
- References: <18064.7905.924535.720690@kahikatea.snap.net.nz> <20070709115647.GC3095@caradoc.them.org>
> > 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 <nickrob@snap.net.nz>
* 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);