From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18493 invoked by alias); 1 Oct 2008 12:25:55 -0000 Received: (qmail 18484 invoked by uid 22791); 1 Oct 2008 12:25:54 -0000 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Oct 2008 12:25:15 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id m91CP55n049304 ; Wed, 1 Oct 2008 14:25:05 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402::141]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id m91CP52E041935 ; Wed, 1 Oct 2008 14:25:05 +0200 (CEST) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id m91CP4AG038972 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Wed, 1 Oct 2008 14:25:04 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: , "'Pedro Alves'" Subject: [RFC] fix win32-nat failure Date: Wed, 01 Oct 2008 12:25:00 -0000 Message-ID: <005401c923c0$be5ae250$3b10a6f0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.u-strasbg.fr [IPv6:2001:660:2402::158]); Wed, 01 Oct 2008 14:25:05 +0200 (CEST) X-Virus-Status: Clean Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00012.txt.bz2 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); */ }