From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1488 invoked by alias); 18 Mar 2010 13:33:46 -0000 Received: (qmail 1479 invoked by uid 22791); 18 Mar 2010 13:33:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 13:33:41 +0000 Received: (qmail 20186 invoked from network); 18 Mar 2010 13:33:39 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Mar 2010 13:33:39 -0000 Date: Thu, 18 Mar 2010 13:33:00 -0000 From: Daniel Jacobowitz To: Doug Evans Cc: temp@sourceboost.com, gdb@sourceware.org Subject: Re: Getting pissed off by gdb. Please help with stepping in. Message-ID: <20100318133334.GA7732@caradoc.them.org> Mail-Followup-To: Doug Evans , temp@sourceboost.com, gdb@sourceware.org References: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-03/txt/msg00125.txt.bz2 On Thu, Mar 18, 2010 at 12:22:20AM -0700, Doug Evans wrote: > This patch for cvs head gets things working for me. I haven't run it > through the testsuite, and it might be nice compare more than just > frame ids (and for the gdb crowd, yes, the FIXME needs to go before > being checked in ...), but .... this patch seems otherwise reasonable > to me. At the point where the patch is applied gdb has already > decided to continue - what's a case where it *should* continue at this > point *if* the frame has changed? [Note that gdb has already handled > various cases like stopping in trampolines and such.] In addition to what Eli said... here's the previous block: if ((stop_pc == stop_pc_sal.pc) && (ecs->event_thread->current_line != stop_pc_sal.line || ecs->event_thread->current_symtab != stop_pc_sal.symtab)) { /* We are at the start of a different line. So stop. Note that we don't stop if we step into the middle of a different line. That is said to make things like for (;;) statements work better. */ IOW, if we are at a line boundary, we stop stepping. If we've ended up in the middle of a line, we keep going. This prevents us from ending up in a weird state where we show the line containing the function call, but the function has already been called. I think it'd be even more confusing. This is a difference between stepping out of a function and finishing. Now, if you end up in a different function while continuing to step (or "next"), there's a good argument that you should stop... -- Daniel Jacobowitz CodeSourcery