From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5838 invoked by alias); 27 Mar 2014 15:45:54 -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 5773 invoked by uid 89); 27 Mar 2014 15:45:53 -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,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Mar 2014 15:45:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2RFjmSD030872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Mar 2014 11:45:49 -0400 Received: from redacted.bos.redhat.com ([10.18.17.143]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2RFjkLw022170 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 27 Mar 2014 11:45:48 -0400 Date: Thu, 27 Mar 2014 15:45:00 -0000 From: Kyle McMartin To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [PATCHv2] aarch64: detect atomic sequences like other ll/sc architectures Message-ID: <20140327154546.GJ3075@redacted.bos.redhat.com> References: <20140327015125.GE3075@redacted.bos.redhat.com> <20140327130714.GB4030@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140327130714.GB4030@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00633.txt.bz2 On Thu, Mar 27, 2014 at 06:07:14AM -0700, Joel Brobecker wrote: > A few comments on the testcase. I have no further comments on the code > itself. > > > +#include > > Do you really need stdio.h, here? You do not seem to be making > any function call in your function, so I do not see why it would > be needed. On the other hand, having a dependency on stdio.h means > that the testcase will not compile on many targets (eg: bare metal). > Not that I'm aware of, I'd re-added it as I added some printfs for debugging while writing the testcase and forgot to remove it again. (The PPC64 one has it for some reason as well, likely the same reason.) > > + > > +int main() > > Can you use "(void)" instead of "()"? > Absolutely. > > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_flags] != "" } { > > + unsupported "Testcase compile failed." > > + return -1 > > +} > > +gdb_exit > > +gdb_start > > +gdb_reinitialize_dir $srcdir/$subdir > > +gdb_load ${binfile} > > Can you use standard_testfile and prepare_for_testing? See our testcase > cookbook page at: > https://sourceware.org/gdb/wiki/GDBTestcaseCookbook > > It should replace all of the above after the "if istarget"... > OK, testing this out now. > > +if ![runto_main] then { > > + perror "Couldn't run to breakpoint" > > + continue > > Also according to the cookbook, use: > > untested "could not run to main" > return -1 > > IIRC, with tcl, there isn't a huge distinction in this case between > continue and return -1, but might as well follow the cookbook. > > > +gdb_test continue "Continuing.*Breakpoint $decimal.*" \ > > + "Continue until breakpoint" > > + > > +gdb_test next ".*__asm __volatile.*" \ > > + "Step through the ldxr/stxr sequence" > > + > > +gdb_test next ".*return dword.*" \ > > + "Stepped through sequence through conditional branch" > > Can you put the "continue"/"next" inside double-quotes. > It looks like it's all the same to tcl, but I think it'll make > things more consistent and also allow editors to (syntax)-highlight > those as strings... > Will do. regards, Kyle > Thanks, > -- > Joel