Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org>
Subject: RE: [RFC] fix win32-nat failure
Date: Thu, 02 Oct 2008 08:41:00 -0000	[thread overview]
Message-ID: <009a01c9246a$64ece5b0$2ec6b110$@u-strasbg.fr> (raw)
In-Reply-To: <200810011909.10343.pedro@codesourcery.com>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : Wednesday, October 01, 2008 8:09 PM
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [RFC] fix win32-nat failure
> 
> On Wednesday 01 October 2008 13:25:08, Pierre Muller wrote:
> 
> >   Current GDB head has a problem with win32-nat:
> >
> > When starting ./gdb ./gdb
> > (gdb) run
> > Starting program: /usr/local/src/gdbcvs/build-bare/gdb/gdb.exe ./gdb
> > ../../purecvs/gdb/inferior.c:41: internal-error: current_inferior:
> Assertion
> > `inf' failed.
> 
> Ah, I know why I didn't see this happening.  When running GDB under
> GDB itself, GDB considers that it doesn't have a terminal at all, so
> this code path isn't exercised.  Maybe this applies to the testsuite
> as well.  :-/

  Well, in fact, I don't understand this statement,
after reading it, I suspected that this had to do with the fact that
I use a lot the 'set new-console on' option,
but even without this I still get the same assertion failed message,
so I don't understand why you did not also get it.
 
> > I was able to fix this by setting inferior_ptid before
> terminal_inferior was
> > called,
> > but I did this using also the ThreadId available when starting with
> > CreateProcess.
> >   But there is no thread number available for processes to which we
> attach,
> > thus I simply passed zero in that case...
> 
> >   I don't know, maybe the correct fix is to only set inferior_ptid
> > to ptid_build(pid, 0, 0)
> 
> Yes, you don't need the tid at this point even when creating instead
> of attaching.  A smaller change would be something like this:
> 
> +  inferior_ptid = pid_to_ptid (pid);
> 
>    terminal_init_inferior_with_pgrp (pid);
> 
> Perhaps also adding a comment saying something like:
> 
>   /* Make the new process the current inferior, so terminal handling
>      can rely on it.  When attaching, we don't know about any thread
>      id here, but that's OK --- nothing should be referencing the
>      current thread until we report an event out of win32_wait.  */
> 
> Do you want to give it a try and confirm on your end?

  OK, let me try this simpler patch out,
I will send a RFA if that works OK for me.


Pierre Muller
Pascal language support maintainer for GDB





  reply	other threads:[~2008-10-02  8:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 12:25 Pierre Muller
2008-10-01 12:50 ` Pedro Alves
2008-10-01 18:10 ` Pedro Alves
2008-10-02  8:41   ` Pierre Muller [this message]
2008-10-02 11:58     ` [RFA] " Pierre Muller
2008-10-02 13:02       ` Pedro Alves
2008-10-02 14:22         ` Pierre Muller
2008-10-02 15:25         ` Christopher Faylor
2008-10-02 15:54           ` Pedro Alves
2008-10-02 19:07             ` Christopher Faylor
2008-10-02 12:12     ` [RFC] " Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='009a01c9246a$64ece5b0$2ec6b110$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox