From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9174 invoked by alias); 2 Dec 2006 16:33:51 -0000 Received: (qmail 9163 invoked by uid 22791); 2 Dec 2006 16:33:50 -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; Sat, 02 Dec 2006 16:33:45 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GqXo1-0001rr-2G; Sat, 02 Dec 2006 11:33:37 -0500 Date: Sat, 02 Dec 2006 16:33:00 -0000 From: Daniel Jacobowitz To: Rob Quill Cc: Michael Snyder , Joel Brobecker , gdb@sourceware.org Subject: Re: Single stepping and threads Message-ID: <20061202163336.GA7138@nevyn.them.org> Mail-Followup-To: Rob Quill , Michael Snyder , Joel Brobecker , gdb@sourceware.org References: <20061129052942.GA16029@nevyn.them.org> <20061129055915.GM9968@adacore.com> <20061129132535.GA28834@nevyn.them.org> <20061129163844.GN9968@adacore.com> <1164929776.14460.36.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00003.txt.bz2 On Sat, Dec 02, 2006 at 04:27:12PM +0000, Rob Quill wrote: > On 30/11/06, Michael Snyder wrote: > >Default on would be a disaster -- most threaded programs would > >not behave even remotely the same under the debugger as they would > >solo. > > > >In fact, many would deadlock almost immediately. > > I have a question regarding this. In concurrent programming (as we > were tuaght it), the principle was that the interleaving of > instructions from threads was random. So, if "on" were the default, > and a few steps were done in GDB, in fact, as many as it took to > deadlock the program, surely it is possible (although, however > unlikely) that when the program is run without GDB that the > interleaving is the same as that forced by GDB, and the code would > deadlock. Thus making the code bad, rather than the debugger. > > What I'm trying to say is that it was my understanding that when doing > concurent programming the interleaving was random and that for the > program to be "corrent" it should not deadlock under any possible > interleaving. > > I fail to see how stopping all threads and just going forward with one > should stop "correct" code from executiong properly. That's not what "on" does - it would permanently starve all other threads. There's also the point that what is correct is not always useful; GDB tries to interfere as little as practical. -- Daniel Jacobowitz CodeSourcery