emacs-devel
[Top][All Lists]
Advanced

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

Re: SIGTRAP in kill emulation on MS Windows


From: Alain Schneble
Subject: Re: SIGTRAP in kill emulation on MS Windows
Date: Mon, 22 Aug 2016 08:36:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Eli Zaretskii <address@hidden> writes:

>> From: Alain Schneble <address@hidden>
>> Date: Sun, 21 Aug 2016 22:42:05 +0200
>> 
>> sys_kill in w32proc.c maps some signals (SIGINT, SIGKILL, SIGQUIT,
>> SIGHUP) to the appropriate W32 API calls.  Couldn't it handle SIGTRAP as
>> well and map it to a call to DebugBreakProcess
>> (https://msdn.microsoft.com/en-us/library/windows/desktop/ms679298(v=vs.85).aspx)?
>
> It could, but what would be the use case for this functionality?  Who
> or what would trigger that signal, and what would that trigger do on a
> Posix system?

On a Posix system, it's already possible to send a SIGTRAP to a
process. It just invokes kill with SIGTRAP. AFAIK, this dumps a
backtrace and terminates the process or it returns control to the
debugger process if one has been attached.

Hence, IMHO, calling DebugBreakProcess sounds like the natural thing to
do on MS Windows.

Use cases:

1. In M-x proced, M-x proced-send-signal RET TRAP RET

2. New command M-x gud-suspend-debuggee (or a better name?). This one
would invoke `signal-process' with the debugee process and SIGTRAP as
the arguments. This would -- at any point in time -- return control back to
the debugger when called.




reply via email to

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