emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging M-x gdb


From: Eli Zaretskii
Subject: Re: Debugging M-x gdb
Date: Fri, 31 Mar 2023 17:28:02 +0300

> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: emacs-devel@gnu.org
> Date: Fri, 31 Mar 2023 15:58:38 +0200
> 
> * From a xterm:
>        egdb ~/bin/emacs-debug
>        (gdb) source ~/emacs-repo/src/.gdbinit
>        (gdb) set args -Q
>        (gdb) run
> 
> * Into this Emacs:
> 
>        M-x gdb
>        Run gdb (like this): egdb -i=mi /usr/X11R6/bin/xclock
>        Enable querying debuginfod servers for this session? (y or n) n
>        M-x gdb-many-windows
> 
> * Into this Emacs *gud-xclock* buffer:
>        (gdb) run    # then from another terminal: pkill xclock
>        [Inferior 1 (process 76899) exited with code 01]
> 
> Now Emacs starts spinning the CPU.
> 
> * Into the first xterm with GDB:
> 
>        (gdb) thread apply all bt
> 
> ... nothing (even after quitting the Emacs *gud-xclock* buffer and
> that the CPU goes back to normal).

You didn't attach GDB to Emacs.  Instead, you started Emacs under GDB.

You should do it like this:

  * From exterm:

     $ ~/bin/emacs-debug &

  * From Emacs:

       M-x gdb
       Run gdb (like this): egdb -i=mi /usr/X11R6/bin/xclock
       Enable querying debuginfod servers for this session? (y or n) n
       M-x gdb-many-windows

  * Into this Emacs *gud-xclock* buffer:
       (gdb) run    # then from another terminal: pkill xclock
       [Inferior 1 (process 76899) exited with code 01]

Now Emacs starts spinning the CPU.

  * Into the first xterm:

     $ egdb -p PID

where PID is the process ID of the Emacs process that spins the CPU.
Then at the prompt of this GDB:

     (gdb) thread apply all bt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]