This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

$_ and info breakpoint


Andreas Schwab has pointed out that when running GDB from Emacs 22.1:

    gdb-ui clobbers the value of $_ and $__ after every command, which makes
    it impossible to continue a x command, for example.

This is because after every user command the breakpoints buffer is updated
by sending "info breakpoint" to GDB behind the users back and, as the manual
says:

                      The convenience variable `$_' and the default
    examining-address for the `x' command are set to the address of
    the last breakpoint listed

It seems to me that the main use for resetting $_ is so that by repeating the
`x' command you can scan through memory.

Presumably, this problem isn't specific to Emacs, so I suggest the following
possible solutions:

1) That "info breakpoint" doesn't set $_.  At least -break-list shouldn't do
   this.

or

2) An option is added to the command, "info breakpoint noaddress", say, but
   seems like overkill.  So that the user doesn't see the commands that Emacs
   issues, it always uses the server command.  Maybe it would be easy to make
   "server info breakpoint" not set $_ and this would seem a more natural step
   too.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]