From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3435 invoked by alias); 30 Aug 2006 18:14:45 -0000 Received: (qmail 3426 invoked by uid 22791); 30 Aug 2006 18:14:43 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 30 Aug 2006 18:14:41 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GIUaF-00082c-3C; Wed, 30 Aug 2006 14:14:39 -0400 Date: Wed, 30 Aug 2006 18:14:00 -0000 From: Daniel Jacobowitz To: Alex Bligh Cc: gdb@sourceware.org Subject: Re: thread_db_get_info: cannot get thread info: generic error on fork()/execvp() Message-ID: <20060830181439.GA29333@nevyn.them.org> Mail-Followup-To: Alex Bligh , gdb@sourceware.org References: <20060726214801.14303.qmail@sourceware.org> <20060718124206.30754.qmail@sourceware.org> <20060731130001.GA1823@nevyn.them.org> <44DF8D67.8090502@alex.org.uk> <44F5BCAB.7050400@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44F5BCAB.7050400@alex.org.uk> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00249.txt.bz2 On Wed, Aug 30, 2006 at 05:28:27PM +0100, Alex Bligh wrote: > Hi, > > Now we have a pretty trivial test case to reproduce this problem, > as per the 20 line program at the bottom of bug 2149, > is there any chance at all of getting a fix? I currently > can't debug my app at all because it suffers from this > problem. I am willing to help in any way I can to debug > this or test. Well, I can reproduce the problem. I can see roughly what's wrong, too. We still think we're attached to the old thread. Could you try this patch? -- Daniel Jacobowitz CodeSourcery 2006-08-30 Daniel Jacobowitz * infrun.c (handle_inferior_event): Context switch after fork and exec events. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.214 diff -u -p -r1.214 infrun.c --- infrun.c 19 Aug 2006 03:19:00 -0000 1.214 +++ infrun.c 30 Aug 2006 18:13:51 -0000 @@ -1411,6 +1411,12 @@ handle_inferior_event (struct execution_ pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid); pending_follow.fork_event.child_pid = ecs->ws.value.related_pid; + if (!ptid_equal (ecs->ptid, inferior_ptid)) + { + context_switch (ecs); + flush_cached_frames (); + } + stop_pc = read_pc (); stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0); @@ -1469,6 +1475,12 @@ handle_inferior_event (struct execution_ ecs->random_signal = !bpstat_explains_signal (stop_bpstat); inferior_ptid = ecs->saved_inferior_ptid; + if (!ptid_equal (ecs->ptid, inferior_ptid)) + { + context_switch (ecs); + flush_cached_frames (); + } + /* If no catchpoint triggered for this, then keep going. */ if (ecs->random_signal) {