* Re: $_ and info breakpoint [PATCH]
[not found] ` <20070709115647.GC3095@caradoc.them.org>
@ 2007-07-10 0:22 ` Nick Roberts
2007-07-10 1:43 ` Daniel Jacobowitz
2007-07-11 18:15 ` Jim Blandy
0 siblings, 2 replies; 11+ messages in thread
From: Nick Roberts @ 2007-07-10 0:22 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> > 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);
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 0:22 ` $_ and info breakpoint [PATCH] Nick Roberts
@ 2007-07-10 1:43 ` Daniel Jacobowitz
2007-07-10 3:20 ` Eli Zaretskii
2007-07-11 18:15 ` Jim Blandy
1 sibling, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-07-10 1:43 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Tue, Jul 10, 2007 at 12:22:20PM +1200, Nick Roberts wrote:
> 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.
I didn't see your earlier suggestion, and in fact I didn't know about
the server command prefix at all. This seems fine to me; does anyone
else see a reason why we shouldn't do it?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 1:43 ` Daniel Jacobowitz
@ 2007-07-10 3:20 ` Eli Zaretskii
2007-07-10 11:20 ` Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2007-07-10 3:20 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: nickrob, gdb-patches
> Date: Mon, 9 Jul 2007 21:43:12 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org
>
> On Tue, Jul 10, 2007 at 12:22:20PM +1200, Nick Roberts wrote:
> > 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.
>
> I didn't see your earlier suggestion, and in fact I didn't know about
> the server command prefix at all. This seems fine to me; does anyone
> else see a reason why we shouldn't do it?
None here. I think it's a good idea.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 3:20 ` Eli Zaretskii
@ 2007-07-10 11:20 ` Daniel Jacobowitz
2007-07-10 23:11 ` Nick Roberts
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-07-10 11:20 UTC (permalink / raw)
To: gdb-patches
On Tue, Jul 10, 2007 at 06:20:11AM +0300, Eli Zaretskii wrote:
> > Date: Mon, 9 Jul 2007 21:43:12 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sourceware.org
> >
> > On Tue, Jul 10, 2007 at 12:22:20PM +1200, Nick Roberts wrote:
> > > 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.
> >
> > I didn't see your earlier suggestion, and in fact I didn't know about
> > the server command prefix at all. This seems fine to me; does anyone
> > else see a reason why we shouldn't do it?
>
> None here. I think it's a good idea.
Thanks. Nick, patch is OK for trunk; I suppose there will be a
corresponding update to the emacs mode? Or does it use 'server'
already?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 11:20 ` Daniel Jacobowitz
@ 2007-07-10 23:11 ` Nick Roberts
2007-07-10 23:51 ` Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2007-07-10 23:11 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> > None here. I think it's a good idea.
>
> Thanks. Nick, patch is OK for trunk; I suppose there will be a
> corresponding update to the emacs mode? Or does it use 'server'
> already?
Committed. GDB commands that Emacs runs behind the users back already user the
server prefix so that the user doesn't get any surprises if he tries to use the
command history in the GUD buffer.
Incidentally, AFAICS Eclipse doesn't give the user access to the command line
and the console is just for program I/O, which seems to restrict the use of GDB
to only the functionality that they program in.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 23:11 ` Nick Roberts
@ 2007-07-10 23:51 ` Daniel Jacobowitz
2007-07-11 0:35 ` Nick Roberts
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-07-10 23:51 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Wed, Jul 11, 2007 at 11:11:13AM +1200, Nick Roberts wrote:
> Incidentally, AFAICS Eclipse doesn't give the user access to the command line
> and the console is just for program I/O, which seems to restrict the use of GDB
> to only the functionality that they program in.
They don't have a very nice console, but it's there. If you click on
the tab that your program I/O isn't on, you can type commands at GDB
and it will get them (it's in the Consoles pane, but a separate
sub-pane or view or whatever the heck they call it).
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 23:51 ` Daniel Jacobowitz
@ 2007-07-11 0:35 ` Nick Roberts
2007-07-11 11:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2007-07-11 0:35 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> They don't have a very nice console, but it's there. If you click on
> the tab that your program I/O isn't on, you can type commands at GDB
> and it will get them (it's in the Consoles pane, but a separate
> sub-pane or view or whatever the heck they call it).
OK, I've found it now - there's no (gdb) prompt. I thought perhaps there
would be the same problem with $_, but that doeasn't appear to be the case.
I don't really understand how they control the separate terminal for program
I/O as the program is a child of GDB, and not Eclipse, so presumably Eclipse
can't create a terminal for it. In my migratory mode I use sleep to create a
terminal and send program I/O to that, but this seems a bit of a hack.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-11 0:35 ` Nick Roberts
@ 2007-07-11 11:32 ` Daniel Jacobowitz
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-07-11 11:32 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Wed, Jul 11, 2007 at 12:35:46PM +1200, Nick Roberts wrote:
> OK, I've found it now - there's no (gdb) prompt. I thought perhaps there
> would be the same problem with $_, but that doeasn't appear to be the case.
Interesting, I wonder why not. It does happen when I use -break-info
manually.
> I don't really understand how they control the separate terminal for program
> I/O as the program is a child of GDB, and not Eclipse, so presumably Eclipse
> can't create a terminal for it. In my migratory mode I use sleep to create a
> terminal and send program I/O to that, but this seems a bit of a hack.
I don't know if they create the pty manually and then pass its
filename to GDB using -inferior-tty-set (which should work) or if they
fake it some other way.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH]
2007-07-10 0:22 ` $_ and info breakpoint [PATCH] Nick Roberts
2007-07-10 1:43 ` Daniel Jacobowitz
@ 2007-07-11 18:15 ` Jim Blandy
2007-07-11 22:56 ` $_ and info breakpoint [PATCH: doco] Nick Roberts
1 sibling, 1 reply; 11+ messages in thread
From: Jim Blandy @ 2007-07-11 18:15 UTC (permalink / raw)
To: Nick Roberts; +Cc: Daniel Jacobowitz, gdb-patches
Nick Roberts <nickrob@snap.net.nz> writes:
> 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).
I have no warlord M-DEL patch, but I just wanted to point out that
'server' should be documented more clearly than it is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH: doco]
2007-07-11 18:15 ` Jim Blandy
@ 2007-07-11 22:56 ` Nick Roberts
2007-07-12 3:19 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2007-07-11 22:56 UTC (permalink / raw)
To: Jim Blandy; +Cc: Daniel Jacobowitz, gdb-patches
> > 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).
>
> I have no warlord M-DEL patch, but I just wanted to point out that
> 'server' should be documented more clearly than it is.
How about this? (adapted fron the "Server Prefix" node in annotate.texinfo)
--
Nick http://www.inet.net.nz/~nickrob
2007-07-12 Nick Roberts <nickrob@snap.net.nz>
* gdb.texinfo (Server Prefix): New node. Adapt from existing node
in annotate.texinfo.
(Command History): Link to new node.
*** gdb.texinfo 04 Jul 2007 17:37:49 +1200 1.420
--- gdb.texinfo 12 Jul 2007 10:50:38 +1200
*************** package, to provide the history facility
*** 15436,15442 ****
Interactively}, for the detailed description of the History library.
To issue a command to @value{GDBN} without affecting certain aspects of
! the state which is seen by users, prefix it with @samp{server }. This
means that this command will not affect the command history, nor will it
affect @value{GDBN}'s notion of which command to repeat if @key{RET} is
pressed on a line by itself.
--- 15436,15443 ----
Interactively}, for the detailed description of the History library.
To issue a command to @value{GDBN} without affecting certain aspects of
! the state which is seen by users, prefix it with @samp{server }
! (@pxref{Server Prefix}). This
means that this command will not affect the command history, nor will it
affect @value{GDBN}'s notion of which command to repeat if @key{RET} is
pressed on a line by itself.
*************** This is Edition @value{EDITION}, @value{
*** 21241,21246 ****
--- 21242,21248 ----
@menu
* Annotations Overview:: What annotations are; the general syntax.
+ * Server Prefix:: Issuing a command without affecting user state.
* Prompting:: Annotations marking @value{GDBN}'s need for input.
* Errors:: Annotations for error messages.
* Invalidation:: Some annotations describe things now invalid.
*************** Here @samp{quit} is input to @value{GDBN
*** 21319,21324 ****
--- 21321,21340 ----
denotes a @samp{control-z} character) are annotations; the rest is
output from @value{GDBN}.
+ @node Server Prefix
+ @section The Server Prefix
+ @cindex server prefix for annotations
+
+ If you prefix a command with @samp{server } then it will not affect
+ the command history, nor will it affect @value{GDBN}'s notion of which
+ command to repeat if @key{RET} is pressed on a line by itself. This
+ means that commands can be run behind a user's back by a front-end in
+ a transparent manner.
+
+ The server prefix does not affect the recording of values into the value
+ history; to print a value without recording it into the value history,
+ use the @code{output} command instead of the @code{print} command.
+
@node Prompting
@section Annotation for @value{GDBN} Input
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: $_ and info breakpoint [PATCH: doco]
2007-07-11 22:56 ` $_ and info breakpoint [PATCH: doco] Nick Roberts
@ 2007-07-12 3:19 ` Eli Zaretskii
0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2007-07-12 3:19 UTC (permalink / raw)
To: Nick Roberts; +Cc: jimb, drow, gdb-patches
> From: Nick Roberts <nickrob@snap.net.nz>
> Date: Thu, 12 Jul 2007 10:56:04 +1200
> Cc: Daniel Jacobowitz <drow@false.org>, gdb-patches@sourceware.org
>
> > I have no warlord M-DEL patch, but I just wanted to point out that
> > 'server' should be documented more clearly than it is.
>
> How about this? (adapted fron the "Server Prefix" node in annotate.texinfo)
It's fine, but please modify the @cindex entry to not mention
annotations. Just "server prefix for commands" is fine.
Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-07-12 3:19 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <18064.7905.924535.720690@kahikatea.snap.net.nz>
[not found] ` <20070709115647.GC3095@caradoc.them.org>
2007-07-10 0:22 ` $_ and info breakpoint [PATCH] Nick Roberts
2007-07-10 1:43 ` Daniel Jacobowitz
2007-07-10 3:20 ` Eli Zaretskii
2007-07-10 11:20 ` Daniel Jacobowitz
2007-07-10 23:11 ` Nick Roberts
2007-07-10 23:51 ` Daniel Jacobowitz
2007-07-11 0:35 ` Nick Roberts
2007-07-11 11:32 ` Daniel Jacobowitz
2007-07-11 18:15 ` Jim Blandy
2007-07-11 22:56 ` $_ and info breakpoint [PATCH: doco] Nick Roberts
2007-07-12 3:19 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox