unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* SIGTRAP in kill emulation on MS Windows
@ 2016-08-21 20:42 Alain Schneble
  2016-08-22  2:37 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Schneble @ 2016-08-21 20:42 UTC (permalink / raw)
  To: emacs-devel

Hello

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)?

Cheers,
Alain




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SIGTRAP in kill emulation on MS Windows
  2016-08-21 20:42 SIGTRAP in kill emulation on MS Windows Alain Schneble
@ 2016-08-22  2:37 ` Eli Zaretskii
  2016-08-22  6:36   ` Alain Schneble
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2016-08-22  2:37 UTC (permalink / raw)
  To: Alain Schneble; +Cc: emacs-devel

> From: Alain Schneble <a.s@realize.ch>
> 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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SIGTRAP in kill emulation on MS Windows
  2016-08-22  2:37 ` Eli Zaretskii
@ 2016-08-22  6:36   ` Alain Schneble
  2016-08-22 14:44     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Schneble @ 2016-08-22  6:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alain Schneble <a.s@realize.ch>
>> 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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SIGTRAP in kill emulation on MS Windows
  2016-08-22  6:36   ` Alain Schneble
@ 2016-08-22 14:44     ` Eli Zaretskii
  2016-08-22 14:52       ` Alain Schneble
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2016-08-22 14:44 UTC (permalink / raw)
  To: Alain Schneble; +Cc: emacs-devel

> From: Alain Schneble <a.s@realize.ch>
> CC: <emacs-devel@gnu.org>
> Date: Mon, 22 Aug 2016 08:36:50 +0200
> 
> 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?).

"Suspend" is misleading, IMO.

Anyway, patches are welcome to implement this on Windows.

Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SIGTRAP in kill emulation on MS Windows
  2016-08-22 14:44     ` Eli Zaretskii
@ 2016-08-22 14:52       ` Alain Schneble
  0 siblings, 0 replies; 5+ messages in thread
From: Alain Schneble @ 2016-08-22 14:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alain Schneble <a.s@realize.ch>
>> CC: <emacs-devel@gnu.org>
>> Date: Mon, 22 Aug 2016 08:36:50 +0200
>> 
>> 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?).
>
> "Suspend" is misleading, IMO.
>
> Anyway, patches are welcome to implement this on Windows.
>
> Thanks.

Thanks.  I'll come up with an implementation and propose a patch.  I
agree that "suspend" is misleading and I'll try to find a better name.

Alain




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-22 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-21 20:42 SIGTRAP in kill emulation on MS Windows Alain Schneble
2016-08-22  2:37 ` Eli Zaretskii
2016-08-22  6:36   ` Alain Schneble
2016-08-22 14:44     ` Eli Zaretskii
2016-08-22 14:52       ` Alain Schneble

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).