From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1088 invoked by alias); 8 Aug 2011 15:20:48 -0000 Received: (qmail 1066 invoked by uid 22791); 8 Aug 2011 15:20:46 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,WEBMAIL_BODY X-Spam-Check-By: sourceware.org Received: from nm2-vm1.bt.bullet.mail.ukl.yahoo.com (HELO nm2-vm1.bt.bullet.mail.ukl.yahoo.com) (217.146.182.213) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 08 Aug 2011 15:20:31 +0000 Received: from [217.146.183.195] by nm2.bt.bullet.mail.ukl.yahoo.com with NNFMP; 08 Aug 2011 15:20:30 -0000 Received: from [217.146.183.206] by tm1.bt.bullet.mail.ukl.yahoo.com with NNFMP; 08 Aug 2011 15:20:30 -0000 Received: from [127.0.0.1] by omp1004.bt.mail.ukl.yahoo.com with NNFMP; 08 Aug 2011 15:20:30 -0000 Received: (qmail 97666 invoked by uid 60001); 8 Aug 2011 15:20:30 -0000 Received: from [86.148.25.87] by web86703.mail.ird.yahoo.com via HTTP; Mon, 08 Aug 2011 16:20:30 BST References: <1311947955.89527.YahooMailRC@web86708.mail.ird.yahoo.com> <1312026270.62521.YahooMailRC@web86705.mail.ird.yahoo.com> <1312803282.12167.YahooMailRC@web86707.mail.ird.yahoo.com> <201108081606.58401.pedro@codesourcery.com> Message-ID: <1312816830.93830.YahooMailRC@web86703.mail.ird.yahoo.com> Date: Mon, 08 Aug 2011 15:20:00 -0000 From: pfee@talk21.com Subject: Re: Enhancement - show old and new thread info when switching during debugging To: Pedro Alves , gdb-patches@sourceware.org Cc: Joel Brobecker , Tom Tromey In-Reply-To: <201108081606.58401.pedro@codesourcery.com> 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-08/txt/msg00147.txt.bz2 > > I've looked into convenience variables and have developed a new patch.= The=20 >gdb=20 > > > output when switching threads is no longer altered, instead the=20=20 >$_prev_thread=20 > > > convenience variable can be used to switch back to the previous thread. > >=20 > > When making this patch I renamed an existing variable from=20 > > previous_inferior_ptid to current_inferior_ptid. That way we have val= ues=20 >that=20 > > > move from inferior_ptid (the new ptid) to current_inferior_ptid and fi= nally=20 >to=20=20 > > > previous_inferior_ptid (which is exposed via the convenience variable)= .=20=20 >This=20 > > > seemed better than leaving the variables names as was and introducing= =20 >something=20 > > >=20 > > confusing like previous_previous_inferior_ptid. >=20 > Sorry, but current_inferior_ptid for this will be even more confusing. > There's several current_FOO globals that represent the currently select= ed > state. And one of them is "current_inferior". Having current_inferior(= )=20 >return > one thing, and current_inferior_ptid mean another thing will be a recipe > for long term confusion. No problem, I'll pick another name. >=20 > >=20 > > By the way, I've made the patches against GDB trunk, I presume that's= =20 >preferred=20 > > > over GDB 7.3. >=20 > Yes, thanks. 7.3 is in maintenance mode now. New features go to trunk. That's what I expected, thanks. >=20 > >Content-Type: application/octet-stream; name=3D"prev_thread.patch" > >Content-Transfer-Encoding: base64 > >Content-Disposition: attachment; filename=3D"prev_thread.patch" >=20 > Any chance you can convince your mailer to attach patches > with "Content-Type: text/x-patch" or some other text mime > type? If you're using a web email account, I think that > means telling your browser the mime type of the ".patch" > extension. If you can get it to not use base64, and use > "content-disposition: inline", you get extra bonus points. I'm using Yahoo webmail, it's handling of attachments could be better. I'l= l try=20 using a traditional email client. >=20 > > + /* Values move from interior_ptid to current_inferior_ptid to > > + * previous_inferior_ptid. The previous value is exposed to the > > + * user through the $_prev_thread convenience variable. > > + */ >=20 > Please no leading * on every comment line. See other > comments, and follow the same style. Ok >=20 > In order for this to be accepted, it will need some > documentation in the manual. >=20 > I'm not sure the variable is sufficiently well defined yet. > What does gdb print in this case? >=20 > (gdb) thread 2 > (gdb) thread 3 > (gdb) p $_prev_thread >=20 > It feels like it should print thread 2, that is, we'd > define it to the thread the user last had selected, > and so: >=20 > (gdb) thread $_prev_thread > (gdb) thread $_prev_thread >=20 > would cycle between thread 2 and 3. >=20 > This definition works for non-stop mode as well. > Otherwise, as is, we get to define it as "the thread that > the user had selected the last time an execution command > was ran" (and the $_prev_thread is undefined/meaningless in > non-stop mode). I appreciate the feedback, your summary of the current operation is correct= .=20=20 I'll take a look at making $_prev_thread be influenced by the user entering= =20 "thread" commands. Since that should then give us consistent operation in = both=20 all-stop and non-stop modes, the additional change will be worthwhile. Thanks, Paul