From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27677 invoked by alias); 9 Jan 2003 01:05:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27666 invoked from network); 9 Jan 2003 01:05:30 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by 209.249.29.67 with SMTP; 9 Jan 2003 01:05:30 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A50CC3EC2; Wed, 8 Jan 2003 20:05:21 -0500 (EST) Message-ID: <3E1CCAD1.6030009@redhat.com> Date: Thu, 09 Jan 2003 01:05:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com Subject: Re: threads and target-function-calls References: <3E1B7829.6B6E8BAF@redhat.com> <3E1C4F29.2070003@redhat.com> <3E1CC6AA.465581D@redhat.com> <3E1CC8C4.600442A9@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00356.txt.bz2 > Michael Snyder wrote: > >> >> Andrew Cagney wrote: > >> > > >> > > Hey folks, >> > > >> > > Did you know that (at least on x86 linux), if you have a multi-thread >> > > program and you execute a target function call, all the threads get to >> > > run? Doesn't that seem like a bad thing? Wouldn't we really rather >> > > only run the thread that is executing the target function call? > >> > >> > Ha! That's just the start. Doing nested inferior function calls on >> > alternative threads scrables the dummy frame cache: >> > http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=468 > >> >> But... that's just sick. ;-( >> Wait -- you can't do that. It isn't meaningful to change threads >> and then continue/whatever. It assumes gdb has more control over >> scheduling than it actually has. > > > Oh, I think I misunderstood. You have in mind this: > (gdb) print foo() > [switching thread to xyz] > Breakpoint 2 in foo () > (gdb) print bar() > > not this: > (gdb) print foo () > breakpoint 2 in foo() > (gdb) thread xyz > (gdb) print bar() > > right? Either. Or even things like: (gdb) print foo() [new thread xyx] Thread xyz hit breakpoint 2 in foo() (gdb) print bar() (there was talk of trying to only allow one thread to run). Andrew