Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Pierre Muller" <muller@ics.u-strasbg.fr>
Subject: Re: [RFC] fix win32-nat failure
Date: Wed, 01 Oct 2008 12:50:00 -0000	[thread overview]
Message-ID: <200810011349.55415.pedro@codesourcery.com> (raw)
In-Reply-To: <005401c923c0$be5ae250$3b10a6f0$@u-strasbg.fr>

Huh, weird, I did test this on Cygwin, but looks like I
missed something.  :-(

Thanks, I'll take a look.

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.
> 
> 
> 
> This comes from a call to
> Breakpoint 1, internal_error (file=0x6525d0 "../../purecvs/gdb/inferior.c",
>     line=41, string=0x6525b1 "%s: Assertion `%s' failed.")
>     at ../../purecvs/gdb/utils.c:897
> 897       va_start (ap, string);
> (top-gdb) bt
> #0  internal_error (file=0x6525d0 "../../purecvs/gdb/inferior.c", line=41,
>     string=0x6525b1 "%s: Assertion `%s' failed.")
>     at ../../purecvs/gdb/utils.c:897
> #1  0x0043d116 in current_inferior () at ../../purecvs/gdb/inferior.c:41
> #2  0x0042e1bf in terminal_inferior () at ../../purecvs/gdb/inflow.c:280
> During symbol reading, struct/union type gets multiply defined: struct
> language_
> defn.
> #3  0x004753bc in do_initial_win32_stuff (pid=4996, attaching=0)
> 
> 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)
> 
>   Anyhow, it would be nice if this could be fixed ASAP.
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> 
> 
> 
> 
> 
> Index: gdb/win32-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/win32-nat.c,v
> retrieving revision 1.164
> diff -u -p -r1.164 win32-nat.c
> --- gdb/win32-nat.c     22 Sep 2008 15:21:30 -0000      1.164
> +++ gdb/win32-nat.c     1 Oct 2008 12:10:33 -0000
> @@ -1521,7 +1521,7 @@ win32_wait (ptid_t ptid, struct target_w
>  }
> 
>  static void
> -do_initial_win32_stuff (DWORD pid, int attaching)
> +do_initial_win32_stuff (DWORD pid, DWORD tid, int attaching)
>  {
>    extern int stop_after_trap;
>    int i;
> @@ -1548,6 +1548,7 @@ do_initial_win32_stuff (DWORD pid, int a
>    init_wait_for_inferior ();
> 
>    inf = add_inferior (pid);
> +  inferior_ptid = ptid_build (pid, 0, tid);
>    inf->attach_flag = attaching;
> 
>    terminal_init_inferior_with_pgrp (pid);
> @@ -1729,7 +1730,7 @@ win32_attach (char *args, int from_tty)
>        gdb_flush (gdb_stdout);
>      }
> 
> -  do_initial_win32_stuff (pid, 1);
> +  do_initial_win32_stuff (pid, 0, 1);
>    target_terminal_ours ();
>  }
> 
> @@ -1939,7 +1940,7 @@ win32_create_inferior (char *exec_file,
>    else
>      saw_create = 0;
> 
> -  do_initial_win32_stuff (pi.dwProcessId, 0);
> +  do_initial_win32_stuff (pi.dwProcessId, pi.dwThreadId, 0);
> 
>    /* win32_continue (DBG_CONTINUE, -1); */
>  }
> 
> 



-- 
Pedro Alves


  reply	other threads:[~2008-10-01 12:50 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 [this message]
2008-10-01 18:10 ` Pedro Alves
2008-10-02  8:41   ` Pierre Muller
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=200810011349.55415.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    /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