Hi all,
When I trace a program step by step in GDB under Emacs, Emacs will
switch the input focus to the source code. Can I change this behavior so
that Emacs will jump to the corresponding line in the source code but the
input focus still stay in the GDB buffer?
Thanks.
> When I trace a program step by step in GDB under Emacs, Emacs will
> switch the input focus to the source code.
It doesn't for me. Here the selected window remains the one where the
GDB interaction happens. Perhaps you could describe what you do in
more detail, starting with "emacs -Q".
>Message: 6
>Date: Fri, 12 Oct 2012 08:47:26 +0200
>From: Eli Zaretskii <e...@gnu.org>
>To: help-gnu-em...@gnu.org
>Subject: Re: gdb in Emacs
>Message-ID: <83bog889vl....@gnu.org>
>> Date: Thu, 11 Oct 2012 23:35:12 -0500
>> From: Shiyuan <gshy2...@gmail.com>
>> When I trace a program step by step in GDB under Emacs, Emacs will
>> switch the input focus to the source code.
>It doesn't for me. Here the selected window remains the one where the
>GDB interaction happens. Perhaps you could describe what you do in
>more detail, starting with "emacs -Q".
>Also, which version of Emacs is that?
I am using Emacs 23.3(9.0) in Mac OS 10.6. This is the operation sequence
which causes the problem:
1. start Emacs with -Q, open GDB under Emacs: gdb --annotate=3 program
2. set the breakpoint: b location
3. run the program: r
4. When GDB hits the breakpoint, the window splits horizontally into two
windows, one with GDB,
another one is the source code, at this time, the focus point is in GDB
window.
5. while the focus point stil remains in GDB window, open a new frame with
: Ctrl-x 5 2.
Now a new frame is created with one window and another GDB is in it.
6. Switch the focus point to source code window, Run delete other winodw:
Ctrl-X 1.
Now the source code window occupies the whole frame which was
previously splited into two windows.
Now Emacs has two frames. One frame has only GDB window, another frame
has only source code window.
Now, If I switch the focus point back to the GDB window, and keep
stepping using the GDB command "next", the focus
point will switch back to source code window automatically after each
GDB command.
Can someone verify this and tell me what might goes wrong? Thanks.
> I am using Emacs 23.3(9.0) in Mac OS 10.6. This is the operation sequence
> which causes the problem:
> 1. start Emacs with -Q, open GDB under Emacs: gdb --annotate=3 program
> 2. set the breakpoint: b location
> 3. run the program: r
> 4. When GDB hits the breakpoint, the window splits horizontally into two
> windows, one with GDB,
> another one is the source code, at this time, the focus point is in GDB
> window.
> 5. while the focus point stil remains in GDB window, open a new frame with
> : Ctrl-x 5 2.
> Now a new frame is created with one window and another GDB is in it.
> 6. Switch the focus point to source code window, Run delete other winodw:
> Ctrl-X 1.
> Now the source code window occupies the whole frame which was
> previously splited into two windows.
> Now Emacs has two frames. One frame has only GDB window, another frame
> has only source code window.
> Now, If I switch the focus point back to the GDB window, and keep
> stepping using the GDB command "next", the focus
> point will switch back to source code window automatically after each
> GDB command.
I can confirm this behavior in both Emacs 23.3 and the current
development sources.
Please report this as a bug using "M-x report-emacs-bug RET", so that
it will get fixed, preferably for the next version 24.3.
On Sat, Oct 13, 2012 at 3:49 AM, Eli Zaretskii <e...@gnu.org> wrote:
> > Date: Fri, 12 Oct 2012 10:27:10 -0500
> > From: Shiyuan <gshy2...@gmail.com>
> > I am using Emacs 23.3(9.0) in Mac OS 10.6. This is the operation
> sequence
> > which causes the problem:
> > 1. start Emacs with -Q, open GDB under Emacs: gdb --annotate=3 program
> > 2. set the breakpoint: b location
> > 3. run the program: r
> > 4. When GDB hits the breakpoint, the window splits horizontally into two
> > windows, one with GDB,
> > another one is the source code, at this time, the focus point is in
> GDB
> > window.
> > 5. while the focus point stil remains in GDB window, open a new frame
> with
> > : Ctrl-x 5 2.
> > Now a new frame is created with one window and another GDB is in it.
> > 6. Switch the focus point to source code window, Run delete other winodw:
> > Ctrl-X 1.
> > Now the source code window occupies the whole frame which was
> > previously splited into two windows.
> > Now Emacs has two frames. One frame has only GDB window, another
> frame
> > has only source code window.
> > Now, If I switch the focus point back to the GDB window, and keep
> > stepping using the GDB command "next", the focus
> > point will switch back to source code window automatically after each
> > GDB command.
> I can confirm this behavior in both Emacs 23.3 and the current
> development sources.
> Please report this as a bug using "M-x report-emacs-bug RET", so that
> it will get fixed, preferably for the next version 24.3.