Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/3] Remove call of GenerateConsoleCtrlEvent
Date: Wed, 23 Sep 2020 19:21:22 +0200	[thread overview]
Message-ID: <20200923172122.2089-3-ssbssa@yahoo.de> (raw)
In-Reply-To: <20200923172122.2089-1-ssbssa@yahoo.de>

GenerateConsoleCtrlEvent returns TRUE even if no ctrl-c event was created
in the target process (like if the target doesn't have a console).

Since this prevents DebugBreakProcess from being called (which should
always work), this removes it.

gdbserver/ChangeLog:

2020-09-23  Hannes Domani  <ssbssa@yahoo.de>

	* win32-low.cc (win32_process_target::request_interrupt):
	Remove call of GenerateConsoleCtrlEvent.
---
 gdbserver/win32-low.cc | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 588a23a643..d50fc4c98e 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -101,7 +101,6 @@ const struct target_desc *wow64_win32_tdesc;
 typedef BOOL (WINAPI *winapi_DebugActiveProcessStop) (DWORD dwProcessId);
 typedef BOOL (WINAPI *winapi_DebugSetProcessKillOnExit) (BOOL KillOnExit);
 typedef BOOL (WINAPI *winapi_DebugBreakProcess) (HANDLE);
-typedef BOOL (WINAPI *winapi_GenerateConsoleCtrlEvent) (DWORD, DWORD);
 
 #ifdef __x86_64__
 typedef BOOL (WINAPI *winapi_Wow64SetThreadContext) (HANDLE,
@@ -1694,7 +1693,6 @@ void
 win32_process_target::request_interrupt ()
 {
   winapi_DebugBreakProcess DebugBreakProcess;
-  winapi_GenerateConsoleCtrlEvent GenerateConsoleCtrlEvent;
 
 #ifdef _WIN32_WCE
   HMODULE dll = GetModuleHandle (_T("COREDLL.DLL"));
@@ -1702,17 +1700,6 @@ win32_process_target::request_interrupt ()
   HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL"));
 #endif
 
-  GenerateConsoleCtrlEvent = GETPROCADDRESS (dll, GenerateConsoleCtrlEvent);
-
-  if (GenerateConsoleCtrlEvent != NULL
-      && GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, current_process_id))
-    return;
-
-  /* GenerateConsoleCtrlEvent can fail if process id being debugged is
-     not a process group id.
-     Fallback to XP/Vista 'DebugBreakProcess', which generates a
-     breakpoint exception in the interior process.  */
-
   DebugBreakProcess = GETPROCADDRESS (dll, DebugBreakProcess);
 
   if (DebugBreakProcess != NULL
-- 
2.27.0


  parent reply	other threads:[~2020-09-23 17:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200923172122.2089-1-ssbssa.ref@yahoo.de>
2020-09-23 17:21 ` [PATCH 1/3] Handle 64bit breakpoints of WOW64 processes as SIGINT Hannes Domani via Gdb-patches
2020-09-23 17:21   ` [PATCH 2/3] Revert "Fix ctrl-c when debugging WOW64 processes" Hannes Domani via Gdb-patches
2020-09-23 17:21   ` Hannes Domani via Gdb-patches [this message]
2020-09-24  3:35     ` [PATCH 3/3] Remove call of GenerateConsoleCtrlEvent Simon Marchi
2020-09-24 14:40       ` Eli Zaretskii via Gdb-patches
2020-09-24 15:01         ` Hannes Domani via Gdb-patches
2020-09-24  3:30   ` [PATCH 1/3] Handle 64bit breakpoints of WOW64 processes as SIGINT Simon Marchi
2020-09-24 15:26     ` Hannes Domani via Gdb-patches
2020-09-24 15:29       ` Simon Marchi
2020-09-24 16:37         ` Hannes Domani via Gdb-patches
2020-09-24 16:42           ` Simon Marchi
2020-09-24 17:05             ` Hannes Domani via Gdb-patches
2020-09-24 17:22               ` Joel Brobecker
2020-09-24 17:51                 ` Hannes Domani via Gdb-patches

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

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

  git send-email \
    --in-reply-to=20200923172122.2089-3-ssbssa@yahoo.de \
    --to=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox