Re: [PATCH 25/28] Don't write to inferior_ptid in windows-nat.c, part II

Hannes Domani
2020-04-15T15:32:27Z

Am Mittwoch, 15. April 2020, 17:08:27 MESZ hat Pedro Alves <palves@redhat.com> Folgendes geschrieben:

> On 4/14/20 11:41 PM, Hannes Domani via Gdb-patches wrote:
>
> > 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  internal_error (file=0xa713a8 <selftests::test_target_info+168> "C:/src/repos/binutils-gdb.git/gdb/thread.c", line=86,
> >     fmt=0xa71388 <selftests::test_target_info+136> "%s: Assertion `%s' failed.") at C:/src/repos/binutils-gdb.git/gdbsupport/errors.cc:51
> > #1  0x000000000066cfd9 in inferior_thread () at C:/src/repos/binutils-gdb.git/gdb/thread.c:86
> > #2  inferior_thread () at C:/src/repos/binutils-gdb.git/gdb/thread.c:83
> > #3  0x00000000005603a0 in post_create_inferior (target=0x999ba0 <the_windows_nat_target>, from_tty=from_tty@entry=0)
> >     at C:/src/repos/binutils-gdb.git/gdb/infcmd.c:444
> > #4  0x0000000000563727 in run_command_1 (args=<optimized out>, from_tty=1, run_how=RUN_NORMAL) at C:/src/repos/binutils-gdb.git/gdb/infcmd.c:670
>
> > Btw., I think this variable in get_windows_debug_event is no longer useful:
> >  static windows_thread_info dummy_thread_info (0, 0, 0);
> >
>
> Thanks for pointing that out.
>
> >
> > This replacement works fine for me so far:
>
> Does this instead work for you?  This adds a single
> switch_to_thread at the end of the initialization.

Yes, this also works for me.

Hannes