Subject: bug#79144: [PATCH] New debugger-trap function to break to GDB

From: Jeremy Bryant <[email-masked]>
Date: Sat, 02 Aug 2025 21:10:14 +0100

Paul Eggert <[email-masked]> writes:

> On 2025-08-01 16:19, Jeremy Bryant wrote:
>> redraw-display and similar functions are usually okay, but they could
>>   get in the way if what they do modifies Emacs in a way that interferes
>> with debugging
>
> In the past I've used Facos for this purpose, under the theory that
> nobody ever calls acos so I know a breakpoint there means I want the
> debugger trap.
>
> With that in mind I suggest documenting in the doc string that Emacs
> never calls this function except to do X, Y and Z, where X Y and Z are
> spelled out clearly. (I assume X Y and Z all have to do with
> debugging.)

Thanks, the doc string currently says this:

       doc: /* Trap execution flow and hand over control to GDB.
To use, set up a breakpoint to this function from GDB.
The function itself is a do-nothing primitive.  */)

Would the following clarification be clearer from your perspective?

       doc: /* Trap execution flow and hand over control to GDB.
To use, set up a breakpoint in GDB with 
break Fdebugger_trap
This is done in the Emacs source distribution in src/.gdbinit.

The function itself is a do-nothing primitive.  It is reserved for
debugging purposes, and not called by Emacs otherwise.  */)