diff options
author | Pedro Alves <pedro@palves.net> | 2024-03-22 19:28:55 +0000 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2024-03-25 19:29:53 +0000 |
commit | ccf3148e3133f016a8e1484e85e5e4d8c271c4f0 (patch) | |
tree | bc92dae15a5d360e77593750781e05a0da9aa6c3 /gdb/windows-nat.c | |
parent | f9ee45c3a95ac37cf1c3f4ac6be34b9a53e306f4 (diff) | |
download | fsf-binutils-gdb-ccf3148e3133f016a8e1484e85e5e4d8c271c4f0.zip fsf-binutils-gdb-ccf3148e3133f016a8e1484e85e5e4d8c271c4f0.tar.gz fsf-binutils-gdb-ccf3148e3133f016a8e1484e85e5e4d8c271c4f0.tar.bz2 |
Fix windows_nat_target::fake_create_process ptid
While working on Windows non-stop mode, I managed to introduce a bug
that led to fake_create_process being called. That then resulted in
GDB crashes later on, because fake_create_process added a thread with
an incorrect ptid for this target. It is putting dwThreadId in the
tid field of the ptid instead of on the lwp field. This is fixed by
this patch.
Change-Id: Iaee5d2deaa57c501f7e6909f8ac242af9b183215
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index ee38b98..b123a66 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1371,8 +1371,8 @@ windows_nat_target::fake_create_process () throw_winerror_with_name (_("OpenProcess call failed"), err); /* We can not debug anything in that case. */ } - add_thread (ptid_t (windows_process.current_event.dwProcessId, 0, - windows_process.current_event.dwThreadId), + add_thread (ptid_t (windows_process.current_event.dwProcessId, + windows_process.current_event.dwThreadId, 0), windows_process.current_event.u.CreateThread.hThread, windows_process.current_event.u.CreateThread.lpThreadLocalBase, true /* main_thread_p */); |