diff options
| author | Pedro Alves <pedro@palves.net> | 2023-05-09 20:34:50 +0100 |
|---|---|---|
| committer | Pedro Alves <pedro@palves.net> | 2026-04-24 21:28:44 +0100 |
| commit | 42cdda339eff96251b69ab964e311fcf26c773c8 (patch) | |
| tree | 4d63edf63428dd9f3225a5ac7ffef96ba922f5c0 | |
| parent | e6d0aabfd3b3b61d721fadc18042826e42fa3486 (diff) | |
| download | binutils-42cdda339eff96251b69ab964e311fcf26c773c8.tar.gz binutils-42cdda339eff96251b69ab964e311fcf26c773c8.tar.bz2 binutils-42cdda339eff96251b69ab964e311fcf26c773c8.zip | |
Windows gdb: Factor code out of windows_nat_target::windows_continue
This factors some code out of windows_nat_target::windows_continue
into a new windows_continue_one function. This will make the
following patch easier to read (as well as the resulting code itself).
Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: I14a0386b1b8b03015e86273060af173b5130e375
| -rw-r--r-- | gdb/windows-nat.c | 16 | ||||
| -rw-r--r-- | gdb/windows-nat.h | 3 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 170b837e930..2ecb8a105c0 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -704,6 +704,15 @@ windows_per_inferior::handle_access_violation return false; } +void +windows_nat_target::continue_one_thread (windows_thread_info *th, + windows_continue_flags cont_flags) +{ + bool killed = (cont_flags & WCONT_KILLED) != 0; + thread_context_continue (th, killed); + th->resume (); +} + /* Resume thread specified by ID, or all artificially suspended threads, if we are continuing execution. See description of windows_continue_flags for CONT_FLAGS. */ @@ -725,12 +734,7 @@ windows_nat_target::windows_continue (DWORD continue_status, int id, for (auto &th : windows_process->thread_list) if (id == -1 || id == (int) th->tid) - { - bool killed = (cont_flags & WCONT_KILLED) != 0; - thread_context_continue (th.get (), killed); - - th->resume (); - } + continue_one_thread (th.get (), cont_flags); continue_last_debug_event_main_thread (_("Failed to resume program execution"), continue_status, diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index c4f3b2423b6..221ce58a887 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -243,6 +243,9 @@ private: void delete_thread (ptid_t ptid, DWORD exit_code, bool main_thread_p); DWORD fake_create_process (); + void continue_one_thread (windows_thread_info *th, + windows_continue_flags cont_flags); + BOOL windows_continue (DWORD continue_status, int id, windows_continue_flags cont_flags = 0); |
