From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28042 invoked by alias); 29 Jul 2011 13:59:34 -0000 Received: (qmail 28033 invoked by uid 22791); 29 Jul 2011 13:59:33 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from nm4.bt.bullet.mail.ukl.yahoo.com (HELO nm4.bt.bullet.mail.ukl.yahoo.com) (217.146.183.202) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 29 Jul 2011 13:59:17 +0000 Received: from [217.146.183.197] by nm4.bt.bullet.mail.ukl.yahoo.com with NNFMP; 29 Jul 2011 13:59:16 -0000 Received: from [217.146.183.206] by tm3.bt.bullet.mail.ukl.yahoo.com with NNFMP; 29 Jul 2011 13:59:16 -0000 Received: from [127.0.0.1] by omp1004.bt.mail.ukl.yahoo.com with NNFMP; 29 Jul 2011 13:59:16 -0000 Received: (qmail 29111 invoked by uid 60001); 29 Jul 2011 13:59:15 -0000 Received: from [94.72.254.2] by web86708.mail.ird.yahoo.com via HTTP; Fri, 29 Jul 2011 14:59:15 BST Message-ID: <1311947955.89527.YahooMailRC@web86708.mail.ird.yahoo.com> Date: Fri, 29 Jul 2011 15:29:00 -0000 From: pfee@talk21.com Subject: Enhancement - show old and new thread info when switching during debugging To: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00801.txt.bz2 Hello all, The following patch is also attached to bug 13042. http://sourceware.org/bugzilla/show_bug.cgi?id=3D13042 It gives the user info about the thread they're switching from in addition = to=20 that which they're switching to. This is useful if the switch was not inte= nded=20 and=20 they wish to continue debugging the old thread. Thanks, Paul 2011-07-29 Paul Fee * infrun.c (normal_stop): Output information about previous thread when= =20 switching Index: infrun.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.497 diff -u -r1.497 infrun.c --- infrun.c 21 Jul 2011 23:46:09 -0000 1.497 +++ infrun.c 29 Jul 2011 13:54:44 -0000 @@ -5770,9 +5770,12 @@ && last.kind !=3D TARGET_WAITKIND_SIGNALLED && last.kind !=3D TARGET_WAITKIND_EXITED) { + const char* previous_pid_str =3D strdup (target_pid_to_str=20 (previous_inferior_ptid)); target_terminal_ours_for_output (); - printf_filtered (_("[Switching to %s]\n"), - target_pid_to_str (inferior_ptid)); + printf_filtered (_("[Switching from %s to %s]\n"), + previous_pid_str, + target_pid_to_str (inferior_ptid)); + free ((void*)previous_pid_str); annotate_thread_changed (); previous_inferior_ptid =3D inferior_ptid; }