From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78523 invoked by alias); 3 Sep 2015 09:37:52 -0000 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 Received: (qmail 78510 invoked by uid 89); 3 Sep 2015 09:37:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Sep 2015 09:37:50 +0000 Received: by pacwi10 with SMTP id wi10so41583558pac.3 for ; Thu, 03 Sep 2015 02:37:48 -0700 (PDT) X-Received: by 10.66.243.70 with SMTP id ww6mr67117495pac.88.1441273068438; Thu, 03 Sep 2015 02:37:48 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id ri9sm24558411pbc.4.2015.09.03.02.37.45 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Thu, 03 Sep 2015 02:37:47 -0700 (PDT) From: Yao Qi To: Philippe Waroquiers Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] PR varobj/18564 regression in showing __thread so extern variable References: <1440934487.22248.9.camel@skynet.be> <86wpw9x9au.fsf@gmail.com> <1441229015.13071.23.camel@skynet.be> Date: Thu, 03 Sep 2015 09:37:00 -0000 In-Reply-To: <1441229015.13071.23.camel@skynet.be> (Philippe Waroquiers's message of "Wed, 02 Sep 2015 23:23:35 +0200") Message-ID: <86h9nbyhb6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00052.txt.bz2 Philippe Waroquiers writes: >> > +{ >> > + so_extern =3D &so_extern; >> > + printf("address is %p\n", &so_extern); /* break here to check resu= lt */ >>=20 >> Don't have to call printf and include stdio.h. > Not clear by what to replace this printf (or why it harms). > We don't have to get printf involved in the test, because some targets may don't have printf at all. > I need to put a break after the assignment, as the .exp=20 > will compare so_extern value with address of so_extern. > (note: I changed the .exp, so as to also check so_extern value > in main thread). > The printf line allows to put a break after the assignment. > If it is really better to remove the printf/stdio.h, any suggestion > about what to replace it with ? (we need to avoid the compiler to > optimise away this code to be sure we can put a break). We can replace it with "i++;" (i is a local variable, or a volatile global variable). --=20 Yao (=E9=BD=90=E5=B0=A7)