aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-07-22 12:55:27 -0600
committerTom Tromey <tromey@adacore.com>2022-07-25 07:29:58 -0600
commiteea2d83593428d2ac18f6b3fc43cff5472521579 (patch)
tree4162da247e301d290ee48fb2f2bbfa1200c9acb5 /gdb/windows-nat.c
parent90ed15932111ce37c4187163dd9279ef1798f24e (diff)
downloadgdb-eea2d83593428d2ac18f6b3fc43cff5472521579.zip
gdb-eea2d83593428d2ac18f6b3fc43cff5472521579.tar.gz
gdb-eea2d83593428d2ac18f6b3fc43cff5472521579.tar.bz2
Remove dead code from windows_nat_target::detach
windows_nat_target::detach has a variable 'detached' that is only set after a call to 'error'. However, this can't happen because 'error' throws an exception. This patch removes the dead code.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 43a2c11..9265ed9 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1912,22 +1912,16 @@ windows_nat_target::attach (const char *args, int from_tty)
void
windows_nat_target::detach (inferior *inf, int from_tty)
{
- int detached = 1;
-
ptid_t ptid = minus_one_ptid;
resume (ptid, 0, GDB_SIGNAL_0);
if (!DebugActiveProcessStop (windows_process.current_event.dwProcessId))
- {
- error (_("Can't detach process %u (error %u)"),
- (unsigned) windows_process.current_event.dwProcessId,
- (unsigned) GetLastError ());
- detached = 0;
- }
+ error (_("Can't detach process %u (error %u)"),
+ (unsigned) windows_process.current_event.dwProcessId,
+ (unsigned) GetLastError ());
DebugSetProcessKillOnExit (FALSE);
- if (detached)
- target_announce_detach (from_tty);
+ target_announce_detach (from_tty);
x86_cleanup_dregs ();
switch_to_no_thread ();