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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 22 Jul 2012 20:06:45 +0300

> From: "Drew Adams" <[email-masked]>
> Date: Sun, 22 Jul 2012 09:46:51 -0700
> Cc: [email-masked]
> 
> > Could be the abort in delete_frame I've told you about.  Why don't you
> > run Emacs in the debugger jsut from the beginning?  (In a running
> > instance of Emacs go to the src directory, type M-x gdb, give your
> > full-path emacs.exe as argument, type "run" and do your 
> > things until the emacs fired up this way becomes unresponsive.
> > A "bt full" in the first instance should tell you what happened.)
> 
> I must be missing something when I try to follow that recipe.
> 
> I started Emacs with my setup.  I moved to the src directory (in Emacs 24.1,
> since I don't have src for later builds - but Emacs 24.1 has the same problem).
> I typed M-x gdb, appended c:/Emacs-24.1/bin/emacs.exe and hit RET.
> 
> That seemed to pop up a new emacs -Q session (splash page, none of my
> customizations, minibuffer in the same frame, etc.), with this message in buffer
> *Warnings*, whose window split the screen with the splash page:
> 
> "Error (initialization): User has no home directory"
> 
> (There are no messages in *Messages*.)
> 
> And in buffer *gud-emacs.exe* I see this:
> 
> (gdb) run
> Starting program: /cygdrive/c/Emacs-24.1/bin/emacs.exe 
> Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
> Loaded symbols for
> /cygdrive/c/WINDOWS/WinSxS/X86_Microsoft.Windows.Common-Controls_6595b64144ccf1d
> f_6.0.2600.6028_x-ww_61e65202/comctl32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/msvcrt.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/gdi32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/user32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/shlwapi.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/comdlg32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/shell32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/mpr.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/ole32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/usp10.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/winmm.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/winspool.drv
> 
> Should I have appended something different to `M-x gdb'?  This is what I use
> when I start Emacs with my setup:
> 
> C:\Emacs-24.1\bin\runemacs.exe --debug-init

Don't invoke GDB from inside Emacs, that's only good when you do that
from the same version of Emacs you are debugging, and even then there
are a few gotchas.

Instead, go to the directory where you have .gdbinit, and type from
the shell prompt:

 >gdb /path/to/emacs.exe RET

When GDB ends its initialization and shows the "(gdb)" prompt, type:

 (gdb) run --debug-init

You should now have your normal Emacs session, with all the
customizations you normally have.