GNU bug report logs - #72667
31.0.50; gud-print moves the cursor after execution

Previous Next

Package: emacs;

Reported by: TatriX <tatrics <at> gmail.com>

Date: Fri, 16 Aug 2024 11:39:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: TatriX <tatrics <at> gmail.com>
Cc: 72667 <at> debbugs.gnu.org
Subject: bug#72667: 31.0.50; gud-print moves the cursor after execution
Date: Sat, 17 Aug 2024 13:34:26 +0300
> From: TatriX <tatrics <at> gmail.com>
> Date: Fri, 16 Aug 2024 13:38:26 +0200
> 
> When one runs `gud-print' with `C-x C-a C-p`, point moves to a line that
>  is the debugger stopped at instead of staying where it was. I'm not
>  sure if it is an intended behaviour. If it is, it would be very nice if
>  one could override it, since I find that I want the point to keep it's
>  position after I print a value. I can always run `C-x C-a C-l` to jump
>  to the currently executing line.
> 
> Here's a an illustration. Suppose you have a program `test.c':
> 
> ```
>     int main() {
>       int a = 42;
>       int b = 13;
>       int c = 69;
>       return a + b + c;
>     }
> ```
> 
> Which you can compile for example like this: `gcc -g -Wall -o test01 test.c'.
> Now, if you stop execution at `int b', move the point to `int a' and run
> `C-x C-a C-p' the point will jump back to `int b' instead of staying at
> `int a'.

I think this is an intentional feature: after each GUD command Emacs
returns point to the current line as indicated by the debugger.  The
intent is to keep the current line always visible on display.  Since
Emacs doesn't really understand the effect of debugger commands, it
must restore point after each such command.

May I ask why you use gud-print and not gud-tooltip-mode?  The latter
will allow you to show values of variables without moving point.




This bug report was last modified 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.