From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic304-22.consmr.mail.ir2.yahoo.com (sonic304-22.consmr.mail.ir2.yahoo.com [77.238.179.147]) by sourceware.org (Postfix) with ESMTPS id D4468385B835 for ; Thu, 9 Apr 2020 15:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D4468385B835 X-YMail-OSG: Sll2yLgVM1nihFYNToSu6NYoPQBVChCJREA.WwoBG2.uE5.UcBz3705BVVTYjRb jh2c8Mv3Jn0XHnb3KxmusVhz6KL.QTtjaEiF8IXBKQp7NWrU8wGc0GY2VSs335ismwQO0Ua7zgiF jxSiJE8ELuvPBon_KAjK.hKVeeFc1QKCLc0pAx8IoHuOETygkMjxxPmG9s5F.uzZwucs9dPa4Yiz IKHpfvQ5J0XDS5fB_H94IDFxaUchbTz2rgneh0z9i0VZcTNawRX1PJdmvaZUQ29P_TndQT0fU48t tcLHzNNakBKVKUSVoTHb5rsouF9F.CYCudEzqxvYSjkQBiLQaFQ_hUSH3SCOSPY0c6Br0o3WhM3b 5_vPqG54JM0Qf_66BlJu3WM.p.IEfGgOzNzUR2sa8WNmV3WppBXXIbf1x61ETa_3Div4qaMHd71T JVQzomF0XAS_cyBCwU0JZcAKW9xPqOiuwEZix.5S3QC_KWLULfyX8yojh1tjfWyjvmSrwv034Nxf 09i9fXIhOh0O8dc_rvL1PaYzU.WXMjP.clc9SRu2uf9QjxJhDDYcbi40aJ_Lx4XLvpoqT5tVbZ5u XSICJ68LFWU2zE1LsfJ0jj6MfYsO8nZ4KF09WnHmHJR0sEfaauizjshEtXvUVvcYwm2E6DnEkDzg KejB_tbU5zrfglK6qLGNshn2kONzJgkl1NX2I9.BLP04rgRomYTSlzoxryJynokImJHXTjO9W_nI 0nAIXt2YptmDKITAcuSUpvSk9vmJfQvNLgwplmOefgtKKPALcP9r2EhIxdtY8F4FkU5ZwX8pDUlI 57oex2bq5DVvEA7.42oqTvg2aiSYsbGXMZQXbw8RS4cW2b9aqd.xwsZM1Lji5yB13f6di5uAjJOe zvaEnFnSRE37QBsVQK2VloWpsf2WFbGhljpakU86bL3ewoHrVjdKXOmXkOQQNv1s2b.Hi1DP9gqg 79tSkPGt7.29Eix.VI5p.y2VIVTZNR7wP9HuE8kxQi9IxPT5VlXp_QrwGYmwxmvVSMJjrBmnFj.e TsYAd6eKIAh5JcEndGWAf29DyYNRFE6N_FyvW8rItIDgr6TAGX7JOAcvNyifQmeC84NMvdfzBImX qokyE0fmKAvEU.uLB81TacZD27wgs2pln7iop4ik.OSEf7owYm0Ytq76juuxxYVDs3wLInh987.m aR_U1mGnvpYbKeH4AO6hNUgiZZ7C2MjH1_gkYshH0Y7D4ZvhpV4wF8LcL90l4cUkmejkM7kdaG6K LmOVb5hYhs784D0aVrt8husYSiIKFr_IlCRwZU9Ixraup.C5e2SFk7d3zCsi_GVz1d2qKt9BxajV szv05CuGG0NcUj8E- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Thu, 9 Apr 2020 15:08:12 +0000 Date: Thu, 9 Apr 2020 15:08:11 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <742051217.5730225.1586444891056@mail.yahoo.com> In-Reply-To: References: <20200313190855.28662-1-tromey@adacore.com> <87pnchogza.fsf@tromey.com> <352012716.4805895.1586384237188@mail.yahoo.com> <87r1wxmkzf.fsf@tromey.com> Subject: Re: [PATCH v3 00/29] Windows code sharing + bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15620 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: Thu, 09 Apr 2020 15:08:16 -0000 Am Donnerstag, 9. April 2020, 16:57:38 MESZ hat Jon Turney Folgendes geschrieben: > On 09/04/2020 03:49, Tom Tromey wrote: > > >>>>>> "Hannes" =3D=3D Hannes Domani via Gdb-patches writes: > > > > Hannes> I seems I kinda missed to actually use Wow64SuspendThread when = I implemented > > Hannes> the WOW64 stuff. > > > > Could you double-check to make sure I didn't mess it up when rebasing > > this series over your patches? > > > > Hannes> Maybe I should just try to implement the WOW64 stuff for gdbser= ver as well, and > > Hannes> then try to move more shared stuff into nat/windows-nat.c? > > > > It would be nice to try to keep the code more in sync. > > They still aren't identical but they do share quite a bit more now. > > So, unless it's unusually hard, I would say yes. > > > I wonder if SuspendThread() is actually needed at all, since it doesn't > make a huge amount of sense for the debugee to still be running when > WaitForDebugEvent() returns. I took me quite a while to figure out a situation where SuspendThread() was actually called. And I can get there if I start the target process in a new console, and the= n press ctrl-c in there so I get the DBG_CONTROL_C exception. And then do something with threads, either "thread 1" or "info threads". The backtrace then looks like this: Thread 1 hit Breakpoint 1, 0x0000000077182a60 in SuspendThread () from C:\W= indows\system32\kernel32.dll (gdb) bt #0=C2=A0 0x0000000077182a60 in SuspendThread () from C:\Windows\system32\ke= rnel32.dll #1=C2=A0 0x00000000005b9d32 in windows_nat::windows_thread_info::suspend (t= his=3Dthis@entry=3D0x11c79100) at C:/src/repos/binutils-gdb.git/gdb/nat/win= dows-nat.c:63 #2=C2=A0 0x00000000006c7e09 in windows_nat::thread_rec (ptid=3D..., disposi= tion=3Ddisposition@entry=3Dwindows_nat::INVALIDATE_CONTEXT) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/windows-nat.c:406 #3=C2=A0 0x00000000006c7e5e in windows_nat_target::fetch_registers (this=3D= , regcache=3D0x11d053f0, r=3D8) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/regcache.h:383 #4=C2=A0 0x000000000066ab3c in target_fetch_registers (regcache=3Dregcache@= entry=3D0x11d053f0, regno=3Dregno@entry=3D8) at C:/src/repos/binutils-gdb.g= it/gdb/target.h:1326 #5=C2=A0 0x00000000005ec6ca in regcache::raw_update (regnum=3D8, this=3D0x1= 1d053f0) at C:/src/repos/binutils-gdb.git/gdb/regcache.c:499 #6=C2=A0 regcache::raw_update (this=3D0x11d053f0, regnum=3D)= at C:/src/repos/binutils-gdb.git/gdb/regcache.c:488 #7=C2=A0 0x00000000005ed51e in readable_regcache::raw_read (this=3D0x11d053= f0, regnum=3D8, buf=3D0x11d33e70 "") at C:/src/repos/binutils-gdb.git/gdb/r= egcache.c:513 #8=C2=A0 0x00000000005ee1bf in readable_regcache::cooked_read_value (this= =3D0x11d053f0, regnum=3D8) at C:/src/repos/binutils-gdb.git/gdb/regcache.c:= 663 #9=C2=A0 0x000000000061af87 in sentinel_frame_prev_register (this_frame=3D<= optimized out>, this_prologue_cache=3D, regnum=3D) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/sentinel-frame.c:53 #10 0x0000000000527546 in frame_unwind_register_value (next_frame=3Dnext_fr= ame@entry=3D0x11837cf0, regnum=3Dregnum@entry=3D8) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/frame.c:1229 #11 0x000000000052780d in frame_register_unwind (next_frame=3Dnext_frame@en= try=3D0x11837cf0, regnum=3Dregnum@entry=3D8, optimizedp=3Doptimizedp@entry= =3D0xfd5f4b8, =C2=A0=C2=A0=C2=A0 unavailablep=3Dunavailablep@entry=3D0xfd5f4bc, lvalp=3Dl= valp@entry=3D0xfd5f4c4, addrp=3Daddrp@entry=3D0xfd5f4c8, realnump=3Drealnum= p@entry=3D0xfd5f4c0, =C2=A0=C2=A0=C2=A0 bufferp=3Dbufferp@entry=3D0xfd5f508 "@=CB=9C+\017") at C= :/src/repos/binutils-gdb.git/gdb/frame.c:1132 #12 0x0000000000527b99 in frame_unwind_register (next_frame=3Dnext_frame@en= try=3D0x11837cf0, regnum=3D8, buf=3Dbuf@entry=3D0xfd5f508 "@=CB=9C+\017") =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/frame.c:1188 #13 0x000000000054d9d7 in i386_unwind_pc (gdbarch=3D0x118ae400, next_frame= =3D0x11837cf0) at C:/src/repos/binutils-gdb.git/gdb/i386-tdep.c:1971 #14 0x0000000000526eb0 in frame_unwind_pc (this_frame=3D0x11837cf0) at C:/s= rc/repos/binutils-gdb.git/gdb/frame.c:928 #15 0x0000000000527010 in get_frame_pc (frame=3D0x11837dc0) at C:/src/repos= /binutils-gdb.git/gdb/frame.c:2399 #16 get_frame_address_in_block (this_frame=3D0x11837dc0) at C:/src/repos/bi= nutils-gdb.git/gdb/frame.c:2429 #17 0x00000000005270bf in get_frame_address_in_block_if_available (this_fra= me=3D, pc=3Dpc@entry=3D0xfd5f628) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/frame.c:2492 #18 0x0000000000527240 in select_frame (fi=3D) at C:/src/rep= os/binutils-gdb.git/gdb/frame.c:1738 #19 0x0000000000528627 in select_frame (fi=3D) at C:/src/rep= os/binutils-gdb.git/gdb/frame.c:1727 #20 get_selected_frame (message=3Dmessage@entry=3D0x0) at C:/src/repos/binu= tils-gdb.git/gdb/frame.c:1680 #21 0x00000000006712a5 in print_thread_info_1 (uiout=3D0x118b6f00, requeste= d_threads=3D0x0, global_ids=3D0, pid=3D-1, show_global_ids=3D0) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/thread.c:1193 #22 0x0000000000671ed7 in info_threads_command (arg=3D, from= _tty=3D) at C:/src/repos/binutils-gdb.git/gdb/thread.c:1284 #23 0x0000000000480d22 in cmd_func (cmd=3D0xf4, args=3D0x2 , from_tty=3D7976) =C2=A0=C2=A0=C2=A0 at C:/src/repos/binutils-gdb.git/gdb/cli/cli-decode.c:19= 52 #24 0x0000000000674638 in execute_command (p=3D, p@entry=3D0= x11c68790 "info threads", from_tty=3D1) at C:/src/repos/binutils-gdb.git/gd= b/top.c:655 #25 0x0000000000516054 in command_handler (command=3D0x11c68790 "info threa= ds") at C:/src/repos/binutils-gdb.git/gdb/event-top.c:587 #26 0x0000000000516f02 in command_line_handler (rl=3D...) at C:/src/repos/b= inutils-gdb.git/gdb/event-top.c:772 #27 0x0000000000516833 in gdb_rl_callback_handler (rl=3D0x11805f60 "info th= reads") =C2=A0=C2=A0=C2=A0 at c:/msys64/mingw64/x86_64-w64-mingw32/include/c++/9.3.= 0/bits/unique_ptr.h:153 #28 0x00000000006e60fc in rl_callback_read_char () at C:/src/repos/binutils= -gdb.git/readline/readline/callback.c:281 #29 0x00000000006e633f in rl_callback_read_char () at C:/src/repos/binutils= -gdb.git/readline/readline/callback.c:222 #30 0x0000000000515bae in gdb_rl_callback_read_char_wrapper_noexcept () at = C:/src/repos/binutils-gdb.git/gdb/event-top.c:176 #31 0x00000000005166e4 in gdb_rl_callback_read_char_wrapper (client_data=3D= ) at C:/src/repos/binutils-gdb.git/gdb/event-top.c:192 #32 0x00000000005159f2 in stdin_event_handler (error=3D, cli= ent_data=3D0x1180b720) at C:/src/repos/binutils-gdb.git/gdb/event-top.c:515 #33 0x0000000000514a10 in handle_file_event (ready_mask=3D2, file_ptr=3D0x1= 1ce4ee0) at C:/src/repos/binutils-gdb.git/gdb/event-loop.c:701 #34 gdb_wait_for_event (block=3D) at C:/src/repos/binutils-g= db.git/gdb/event-loop.c:852 #35 gdb_wait_for_event (block=3D) at C:/src/repos/binutils-g= db.git/gdb/event-loop.c:714 #36 0x0000000000514bee in gdb_do_one_event () at C:/src/repos/binutils-gdb.= git/gdb/event-loop.c:313 #37 0x0000000000514cde in gdb_do_one_event () at C:/src/repos/binutils-gdb.= git/gdb/event-loop.c:337 #38 start_event_loop () at C:/src/repos/binutils-gdb.git/gdb/event-loop.c:3= 37 #39 0x0000000000593ce2 in captured_command_loop () at C:/src/repos/binutils= -gdb.git/gdb/main.c:360 #40 0x0000000000595b05 in captured_main (data=3D0xfd5fdc0) at C:/src/repos/= binutils-gdb.git/gdb/main.c:1198 #41 gdb_main (args=3Dargs@entry=3D0xfd5fe20) at C:/src/repos/binutils-gdb.g= it/gdb/main.c:1213 #42 0x000000000098adc7 in main (argc=3D3, argv=3D0x1348a0) at C:/src/repos/= binutils-gdb.git/gdb/gdb.c:32 Hannes