Subject: bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focus when it calls `list-processes'

From: "Drew Adams" <[email-masked]>
Date: Mon, 23 Jul 2012 09:28:00 -0700

> I suggest that instead of invoking Emacs from GDB, you
> invoke it normally (presumably from a desktop shortcut); then
> immediately attach GDB to it, like you do when Emacs crashes; then
> type "continue" at GDB's prompt to let Emacs run; and finally do
> whatever Martin asked you to for which he wanted GDB to kick in.

That I would like to try, but I don't know the recipe.

What I have done in the past I did after getting the Emacs popup dialog window
about a fatal crash (what you have called the "Emacs abort dialog"), following
instructions that you gave me in the past.

For the current crash, which presents no such dialog box, I tried following
Martin's instructions for invoking gdb from within Emacs.  You then instructed
me not to do that but to instead invoke gdb outside Emacs.  That's when I tried
doing invoking it from a bash shell etc.

If you give me the recipe for invoking gdb from within Emacs the right way then
I will be glad to try it.  In sum, this is not clear to me: "immediately attach
GDB to it, like you do when Emacs crashes".

Thx.

P.S. These are the instructions from you that I follow when I do get the "Emacs
abort dialog" box:

> when you see the Emacs abort dialog do this in order:
> 
>   . Find out the PID of the Emacs process
>   . Open a shell window and chdir to the directory where you have GDB
>     and .gdbinit
>   . Type "./gdb -p PID" and hit RET
>   . When you see the "(gdb)" prompt, type "c RET"
>   . Click YES on the Emacs abort dialog
> 
> You should then see GDB announcing the crash, something like this:
> 
>  Program received signal SIGTRAP, Trace/breakpoint trap.
>  [Switching to Thread 3684.0x1210]
>  0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
> 
> and then the GDB prompt "(gdb)".  Now you are ready to debug the
> crash.

At that point, I type `bt'.  And perhaps `frame N' for some N followed by `p
XYZ' for something XYZ such as `selected_window'.  Then I type `xtype'.

If you can tell me what to do differently here, where there is no "Emacs abort
dialog" box, I will follow the recipe and let you know what I see.