unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alain Schneble <a.s@realize.ch>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: SIGTRAP in kill emulation on MS Windows
Date: Mon, 22 Aug 2016 08:36:50 +0200	[thread overview]
Message-ID: <86r39hia2l.fsf@realize.ch> (raw)
In-Reply-To: <83lgzpbkaq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 22 Aug 2016 05:37:49 +0300")

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.




  reply	other threads:[~2016-08-22  6:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-08-22 14:44     ` Eli Zaretskii
2016-08-22 14:52       ` Alain Schneble

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r39hia2l.fsf@realize.ch \
    --to=a.s@realize.ch \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).