From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic306-21.consmr.mail.ir2.yahoo.com (sonic306-21.consmr.mail.ir2.yahoo.com [77.238.176.207]) by sourceware.org (Postfix) with ESMTPS id 42482385BF83 for ; Tue, 14 Apr 2020 22:41:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42482385BF83 X-YMail-OSG: wb89yAcVM1nEsbpstTMlX0tq6KnpEHC.MH.0wdhZew4p9Ne_w8L3ACV1ZtJGg5P OUV24zTweZqyclPJLSINZ6FNri2lp.NMTr5GiPdxeVx6aJA9bYl_cBUsxx7xyYWTyhAZGnO5a7Dy tZSY7QG2hFIa9opH3ztgUnhuiDp5MeH2_wgTBkTACAyvjbzLRFTtz0nwEUeGRoUnA_1AUR7BGO41 mD5tghVVc5x3r7D4ZuWYZPnWRla7QD3dmR.jRYqfU34lSzr5skobXOcXvFl4NUAjE_UorqvNoeD6 gpjk7zDacDpQ2dvsuDR5MCEJLkQlqzi2KiX2fG62VX8mHUI0hxfIKOcjhSaFZFzJrykEeob6lvgZ NXh400fvvP3VTNfJcIlcYR_sNBz_wHrYv9ef7tK5j5cc_MPwaAPmyhAOP6A1DqU9qrHtyuAYEv49 nTzkJuTIGJhJlG72WIYTKHu3k1yLbXG6ClWPitReNOQ10DIPKW1usc7C1kCzeCVzSQosRRwUKP41 hsz4UM.hkUaiuuOdeuArsAglKVO6PhXTtjlo6OMTVgiDX03MXAhmOljXgF6X3E0aAplSDF6w6pGH F7qdcFgJK3tYMhXDheo6zJ.ZelFD3zl3dmq0mfEsh4R.v0R.ZOmEZj6QRT2NdqptmKSvHAcW3Tzj 4sAfI7Y4_8r5qr3VvGqDcgLub2dioMuJ9Sw0NvtTwK_u_NTTg.fp_nWqadkn5sh0OHb6DnRCKQLe fIcbL4RoC5rOALLcq2cmePqz8OjQnQs0vt.tuxQ5Nc1j7gGzarHrArO7ffRTQ0ZTGlj8UcSbfgrR 9PrkNaohUV5ZeWlbC1k4fiIHH8fkt7e430Mkj9WQGpyiFkKvqmC0FXFirk6SoiOG_ap8toXQHMQX aibgm3b4diszsIqxID6VoKEw3Te2iLQJvHV4WKZ3fMCseD.1ocQ8eMXTgnYb0uah9C79vBWTwKM0 SzJepCJgxmZFbfC3shuUwVbdyLW5aQc3DqNuELzYCINvzfRHMfUbgXvX.lOIj1tONna7jc6eXyd. b.32MneXn5FZTnahdUIc6_wOgifS3x1L9QVdEEQK3hcGbfZgUR3W35hOxLmKi.76IlIax8yqM2EY _lkmtYOamhOcFkVO.gMNMI.rt7qpDrGfwn5gJIBkawuur2gerOW5izWfPJ174vGB7C4XWUcL4e0r vY88TVhWspiaXoydTasBGVub.M9usnzBJ8rYnfWDcyWSFZXt3yxerHCZf5qb8zGY2tiprrth8L1z b_e2KWQjxw4Q2yx5v2wkTKEAEny75HoxjfBrTtyxVZILFCyuIHY9ldaiIgq9bFDFBY4pZRRDEHAU LVZgusUaQfA7G7HAXLrI- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Tue, 14 Apr 2020 22:41:15 +0000 Date: Tue, 14 Apr 2020 22:41:13 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <1253231843.1175283.1586904073822@mail.yahoo.com> In-Reply-To: <20200414175434.8047-26-palves@redhat.com> References: <20200414175434.8047-1-palves@redhat.com> <20200414175434.8047-26-palves@redhat.com> Subject: Re: [PATCH 25/28] Don't write to inferior_ptid in windows-nat.c, part II MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15651 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 X-Spam-Status: No, score=-17.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 22:41:19 -0000 I did my tests now, thanks for your git branch. Am Dienstag, 14. April 2020, 19:55:30 MESZ hat Pedro Alves via Gdb-patches = Folgendes geschrieben: > Writing to inferior_ptid in > windows_nat_target::get_windows_debug_event is just incorrect and not > necessary.=C2=A0 We'll report the event to GDB's core, which then takes > care of switching inferior_ptid / current thread. > > Related (see windows_nat_target::get_windows_debug_event), there's > also a "current_windows_thread" global that is just begging to get out > of sync with core GDB's current thread.=C2=A0 This patch removes it. > gdbserver already does not have an equivalent global in win32-low.cc. > > gdb/ChangeLog: > yyyy-mm-dd=C2=A0 Pedro Alves=C2=A0 > >=C2=A0=C2=A0=C2=A0=C2=A0 * nat/windows-nat.c (current_windows_thread): Rem= ove. >=C2=A0=C2=A0=C2=A0=C2=A0 * nat/windows-nat.h (current_windows_thread): Rem= ove. >=C2=A0=C2=A0=C2=A0=C2=A0 * windows-nat.c (windows_nat_target::stopped_by_s= w_breakpoint): >=C2=A0=C2=A0=C2=A0=C2=A0 Adjust. >=C2=A0=C2=A0=C2=A0=C2=A0 (display_selectors): Adjust to fetch the current >=C2=A0=C2=A0=C2=A0=C2=A0 windows_thread_info based on inferior_ptid. >=C2=A0=C2=A0=C2=A0=C2=A0 (fake_create_process): No longer write to current= _windows_thread. >=C2=A0=C2=A0=C2=A0=C2=A0 (windows_nat_target::get_windows_debug_event): >=C2=A0=C2=A0=C2=A0=C2=A0 Don't set inferior_ptid or current_windows_thread= . >=C2=A0=C2=A0=C2=A0=C2=A0 (windows_nat_target::wait): Adjust to not rely on >=C2=A0=C2=A0=C2=A0=C2=A0 current_windows_thread. >=C2=A0=C2=A0=C2=A0=C2=A0 (windows_nat_target::detach): Use switch_to_no_th= read instead of >=C2=A0=C2=A0=C2=A0=C2=A0 writing to inferior_ptid directly. > --- > gdb/nat/windows-nat.c |=C2=A0 1 - > gdb/nat/windows-nat.h |=C2=A0 3 --- > gdb/windows-nat.c=C2=A0=C2=A0=C2=A0 | 62 ++++++++++++++++++++++++++------= ------------------- > 3 files changed, 32 insertions(+), 34 deletions(-) > > diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c > index cd7c1d177c..a382b9edb9 100644 > --- a/gdb/nat/windows-nat.c > +++ b/gdb/nat/windows-nat.c > @@ -36,7 +36,6 @@ DEBUG_EVENT current_event; >=C2=A0=C2=A0=C2=A0=C2=A0 ContinueDebugEvent.=C2=A0 */ > static DEBUG_EVENT last_wait_event; > > -windows_thread_info *current_windows_thread; > DWORD desired_stop_thread_id =3D -1; > std::vector pending_stops; > EXCEPTION_RECORD siginfo_er; > diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h > index aea1519672..dc27827d9c 100644 > --- a/gdb/nat/windows-nat.h > +++ b/gdb/nat/windows-nat.h > @@ -168,9 +168,6 @@ extern enum gdb_signal last_sig; >=C2=A0=C2=A0=C2=A0=C2=A0 stop.=C2=A0 */ > extern DEBUG_EVENT current_event; > > -/* Info on currently selected thread */ > -extern windows_thread_info *current_windows_thread; > - > /* The ID of the thread for which we anticipate a stop event. >=C2=A0=C2=A0=C2=A0=C2=A0 Normally this is -1, meaning we'll accept an even= t in any >=C2=A0=C2=A0=C2=A0=C2=A0 thread.=C2=A0 */ > diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c > index 1bbebf00b9..78e7e31c67 100644 > --- a/gdb/windows-nat.c > +++ b/gdb/windows-nat.c > @@ -317,7 +317,9 @@ struct windows_nat_target final : public x86_nat_targ= et > >=C2=A0=C2=A0 bool stopped_by_sw_breakpoint () override >=C2=A0=C2=A0 { > -=C2=A0=C2=A0=C2=A0 return current_windows_thread->stopped_at_software_br= eakpoint; > +=C2=A0=C2=A0=C2=A0 windows_thread_info *th > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D thread_rec (inferior_ptid, DONT_INVAL= IDATE_CONTEXT); > +=C2=A0=C2=A0=C2=A0 return th->stopped_at_software_breakpoint; >=C2=A0=C2=A0 } > >=C2=A0=C2=A0 bool supports_stopped_by_sw_breakpoint () override > @@ -1125,11 +1127,15 @@ display_selector (HANDLE thread, DWORD sel) > static void > display_selectors (const char * args, int from_tty) > { > -=C2=A0 if (!current_windows_thread) > +=C2=A0 if (inferior_ptid =3D=3D null_ptid) >=C2=A0=C2=A0=C2=A0=C2=A0 { >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 puts_filtered ("Impossible to display= selectors now.\n"); >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return; >=C2=A0=C2=A0=C2=A0=C2=A0 } > + > +=C2=A0 windows_thread_info *current_windows_thread > +=C2=A0=C2=A0=C2=A0 =3D thread_rec (inferior_ptid, DONT_INVALIDATE_CONTEX= T); > + >=C2=A0=C2=A0 if (!args) >=C2=A0=C2=A0=C2=A0=C2=A0 { > #ifdef __x86_64__ > @@ -1338,12 +1344,11 @@ fake_create_process (void) >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unsigned) GetLastError (= )); >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*=C2=A0 We can not debug anything in= that case.=C2=A0 */ >=C2=A0=C2=A0=C2=A0=C2=A0 } > -=C2=A0 current_windows_thread > -=C2=A0=C2=A0=C2=A0 =3D windows_add_thread (ptid_t (current_event.dwProce= ssId, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 current_event.dwThreadId, 0), > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 current_event.u.CreateThread.hThread, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 current_event.u.CreateThread.lpThreadLocalBase, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 true /* main_thread_p */); > +=C2=A0 windows_add_thread (ptid_t (current_event.dwProcessId, 0, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 current_event.dwThreadId), > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 current_event.u.CreateThread.hThread, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 current_event.u.CreateThread.lpThreadLocalBase, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 true /* main_thread_p */); >=C2=A0=C2=A0 return current_event.dwThreadId; > } > > @@ -1516,10 +1521,9 @@ windows_nat_target::get_windows_debug_event (int p= id, >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 thread_id =3D stop->thread_id; >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *ourstatus =3D stop->status; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inferior_ptid =3D ptid_t (current_event.d= wProcessId, thread_id, 0); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 current_windows_thread =3D thread_rec (in= ferior_ptid, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INVALIDATE_CONTEXT); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 current_windows_thread->reload_context = =3D 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ptid_t ptid (current_event.dwProcessId, t= hread_id); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 th =3D thread_rec (ptid, INVALIDATE_CONTE= XT); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 th->reload_context =3D 1; > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return thread_id; >=C2=A0=C2=A0=C2=A0=C2=A0 } > @@ -1734,14 +1738,6 @@ windows_nat_target::get_windows_debug_event (int p= id, >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 thread_id =3D 0; >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CHECK (windows_continue (continue_sta= tus, desired_stop_thread_id, 0)); >=C2=A0=C2=A0=C2=A0=C2=A0 } > -=C2=A0 else > -=C2=A0=C2=A0=C2=A0 { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inferior_ptid =3D ptid_t (current_event.d= wProcessId, thread_id, 0); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 current_windows_thread =3D th; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!current_windows_thread) > -=C2=A0=C2=A0=C2=A0 current_windows_thread =3D thread_rec (inferior_ptid, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INVALIDA= TE_CONTEXT); > -=C2=A0=C2=A0=C2=A0 } > > out: >=C2=A0=C2=A0 return thread_id; The removal of these lines breaks debugging on Windows, right on startup I = get: (gdb) r Starting program: C:\qiewer\heob\heob64.exe C:/src/repos/binutils-gdb.git/gdb/thread.c:86: internal-error: thread_info*= inferior_thread(): Assertion `tp' failed. Full stacktrace of the assertion failure: (gdb) bt #0=C2=A0 internal_error (file=3D0xa713a8 = "C:/src/repos/binutils-gdb.git/gdb/thread.c", line=3D86, =C2=A0=C2=A0=C2=A0 fmt=3D0xa71388 "%s: As= sertion `%s' failed.") at C:/src/repos/binutils-gdb.git/gdbsupport/errors.c= c:51 #1=C2=A0 0x000000000066cfd9 in inferior_thread () at C:/src/repos/binutils-= gdb.git/gdb/thread.c:86 #2=C2=A0 inferior_thread () at C:/src/repos/binutils-gdb.git/gdb/thread.c:8= 3 #3=C2=A0 0x00000000005603a0 in post_create_inferior (target=3D0x999ba0 , from_tty=3Dfrom_tty@entry=3D0) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/infcmd.c:444 #4=C2=A0 0x0000000000563727 in run_command_1 (args=3D, from_= tty=3D1, run_how=3DRUN_NORMAL) at C:/src/repos/binutils-gdb.git/gdb/infcmd.= c:670 #5=C2=A0 0x00000000004810c2 in cmd_func (cmd=3D0xa713a8 , args=3D0x56 , =C2=A0=C2=A0=C2=A0 from_tty=3D10949512) at C:/src/repos/binutils-gdb.git/gd= b/cli/cli-decode.c:1952 #6=C2=A0 0x00000000006735a8 in execute_command (p=3D, p@entr= y=3D0x13bae0 "", from_tty=3D1) at C:/src/repos/binutils-gdb.git/gdb/top.c:6= 55 #7=C2=A0 0x00000000005153f4 in command_handler (command=3D0x13bae0 "") at C= :/src/repos/binutils-gdb.git/gdb/event-top.c:588 #8=C2=A0 0x00000000005162a2 in command_line_handler (rl=3D...) at C:/src/re= pos/binutils-gdb.git/gdb/event-top.c:773 #9=C2=A0 0x0000000000515bd3 in gdb_rl_callback_handler (rl=3D0x13b4c0 "r") = at c:/msys64/mingw64/x86_64-w64-mingw32/include/c++/9.3.0/bits/unique_ptr.h= :153 #10 0x00000000006e4eec in rl_callback_read_char () at C:/src/repos/binutils= -gdb.git/readline/readline/callback.c:281 #11 0x0000000000514f4e in gdb_rl_callback_read_char_wrapper_noexcept () at = C:/src/repos/binutils-gdb.git/gdb/event-top.c:177 #12 0x0000000000515a84 in gdb_rl_callback_read_char_wrapper (client_data=3D= ) at C:/src/repos/binutils-gdb.git/gdb/event-top.c:193 #13 0x0000000000514d92 in stdin_event_handler (error=3D, cli= ent_data=3D0x13b720) at C:/src/repos/binutils-gdb.git/gdb/event-top.c:516 #14 0x00000000007a91e0 in handle_file_event (ready_mask=3D2, file_ptr=3D0x1= e93c0) at C:/src/repos/binutils-gdb.git/gdbsupport/event-loop.cc:548 #15 gdb_wait_for_event (block=3D) at C:/src/repos/binutils-g= db.git/gdbsupport/event-loop.cc:698 #16 gdb_wait_for_event (block=3D) at C:/src/repos/binutils-g= db.git/gdbsupport/event-loop.cc:561 #17 0x00000000007a9318 in gdb_do_one_event () at C:/src/repos/binutils-gdb.= git/gdbsupport/event-loop.cc:215 #18 0x0000000000592c4d in start_event_loop () at C:/src/repos/binutils-gdb.= git/gdb/main.c:356 #19 captured_command_loop () at C:/src/repos/binutils-gdb.git/gdb/main.c:41= 6 #20 0x0000000000594b55 in captured_main (data=3D0xfd4fdc0) at C:/src/repos/= binutils-gdb.git/gdb/main.c:1254 #21 gdb_main (args=3Dargs@entry=3D0xfd4fe20) at C:/src/repos/binutils-gdb.g= it/gdb/main.c:1269 #22 0x000000000098a757 in main (argc=3D3, argv=3D0x1048a0) at C:/src/repos/= binutils-gdb.git/gdb/gdb.c:32 (gdb) up #1=C2=A0 0x000000000066cfd9 in inferior_thread () at C:/src/repos/binutils-= gdb.git/gdb/thread.c:86 86=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gdb_assert (tp); (gdb) l 81 82=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct thread_info* 83=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inferior_thread (void) 84=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { 85=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct thread_info *tp =3D fin= d_thread_ptid (current_inferior (), inferior_ptid); 86=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gdb_assert (tp); 87=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return tp; 88=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } 89 90=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Delete the breakpoint pointed at by BP_= P, if there's one.=C2=A0 */ This replacement works fine for me so far: diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 78e7e31c67..b22df182a1 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1738,6 +1738,12 @@ windows_nat_target::get_windows_debug_event (int pid= , =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 thread_id =3D 0; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CHECK (windows_continue (continue_stat= us, desired_stop_thread_id, 0)); =C2=A0=C2=A0=C2=A0=C2=A0 } +=C2=A0 else +=C2=A0=C2=A0=C2=A0 { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (th !=3D nullptr) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 switch_to_thread (&the_windows_nat_ta= rget, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pt= id_t (current_event.dwProcessId, thread_id, 0)); +=C2=A0=C2=A0=C2=A0 } =C2=A0out: =C2=A0=C2=A0 return thread_id; Btw., I think this variable in get_windows_debug_event is no longer useful: =C2=A0 static windows_thread_info dummy_thread_info (0, 0, 0); Hannes