From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17186 invoked by alias); 29 Jul 2011 16:17:36 -0000 Received: (qmail 17176 invoked by uid 22791); 29 Jul 2011 16:17:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Jul 2011 16:17:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 38B572BAE7A; Fri, 29 Jul 2011 12:17:16 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 74RpHGVIg4y4; Fri, 29 Jul 2011 12:17:16 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CE49F2BAE9F; Fri, 29 Jul 2011 12:17:15 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E6644145615; Fri, 29 Jul 2011 09:17:11 -0700 (PDT) Date: Fri, 29 Jul 2011 17:38:00 -0000 From: Joel Brobecker To: pfee@talk21.com Cc: gdb-patches@sourceware.org Subject: Re: Enhancement - show old and new thread info when switching during debugging Message-ID: <20110729161711.GI5177@adacore.com> References: <1311947955.89527.YahooMailRC@web86708.mail.ird.yahoo.com> <20110729155438.GH5177@adacore.com> <1311955683.74296.YahooMailRC@web86704.mail.ird.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1311955683.74296.YahooMailRC@web86704.mail.ird.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-07/txt/msg00812.txt.bz2 > I've copied output from GDB 7.3 before and after my patch into the bug > report along with some notes on the implementation. I think I understand what you are trying to say. What I am saying is that you can find which thread you switched from, by going up the debugger output until you find a "[Switching to Thread ...]" message. So, the information is already there. I agree it's not ultra convenient, but I personally think it's better than your approach (the new message becomes way to long, IMO). In your case, if going up the output is not good enough, I would suggest two alternative solutions, in order of preference: - Have GDB maintain variable $old_thread or $prev_thread that you can then use to switch to the previous thread; (gdb) thread $old_thread would return you to the previous thread before the switch. - At least print the new thread ID first; -- Joel