From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18588 invoked by alias); 26 Feb 2016 14:57:33 -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 18488 invoked by uid 89); 26 Feb 2016 14:57:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 14:57:31 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id CD.6D.32102.EB760D65; Fri, 26 Feb 2016 15:57:02 +0100 (CET) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.96) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 26 Feb 2016 09:57:28 -0500 References: <1456491775-29750-1-git-send-email-antoine.tremblay@ericsson.com> <86lh67blt9.fsf@gmail.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Yao Qi CC: Antoine Tremblay , Subject: Re: [PATCH v7] Enable tracing of pseudo-registers on ARM In-Reply-To: <86lh67blt9.fsf@gmail.com> Date: Fri, 26 Feb 2016 14:57:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00862.txt.bz2 Yao Qi writes: > Antoine Tremblay writes: > >> gdb/testsuite/ChangeLog: >> >> * gdb.trace/tracefile-pseudo-reg.c: Include arm_neon.h if on arm. > > arm_neon.h is not included now, but stdint.h is included. Yes this is due to the usage of uint32_t. > >> (main): Add a register variable and a tracepoint label. >> * gdb.trace/tracefile-pseudo-reg.exp): Add arm pseudo register >> tracing test with s5 pseudo register. > >> diff --git a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.c b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.c >> index 3cc3ec0..33761c1 100644 >> --- a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.c >> +++ b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.c >> @@ -16,11 +16,15 @@ >> along with this program. If not, see . */ >> >> /* >> - * Test program for reading target description from tfile: collects AVX >> - * registers on x86_64. >> + * Test program for reading target description from tfile: collects pseudo >> + * register on the target. >> */ > > The comment format doesn't comply to GNU coding standard. It should be > > /* Test program for reading target description from tfile: collects pseudo > registers on the target. */ > Fixed. >> >> +#if (defined __x86_64__) >> #include >> +#elif (defined __arm__) >> +#include >> +#endif >> >> void >> dummy (void) >> @@ -35,6 +39,7 @@ end (void) >> int >> main (void) >> { >> +#if (defined __x86_64__) >> /* Strictly speaking, it should be ymm15 (xmm15 is 128-bit), but gcc older >> than 4.9 doesn't recognize "ymm15" as a valid register name. */ >> register __v8si a asm("xmm15") = { >> @@ -48,6 +53,11 @@ main (void) >> 0x12340008, >> }; >> asm volatile ("traceme: call dummy" : : "x" (a)); >> +#elif (defined __arm__) >> + register uint32_t a asm("s5") = 0x3f800000; /* 1. */ >> + asm volatile ("traceme: bl dummy" : : "x" (a)); >> +#endif >> + >> end (); >> return 0; >> } >> diff --git a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> index 4c52c64..33677a1 100644 >> --- a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> +++ b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> @@ -12,8 +12,8 @@ >> # You should have received a copy of the GNU General Public License >> # along with this program. If not, see . >> >> -if { ! [is_amd64_regs_target] } { >> - verbose "Skipping tfile AVX test (target is not x86_64)." >> +if { ! [is_amd64_regs_target] && ! [istarget "arm*-*-*"] } { >> + verbose "Skipping tracefile pseudo register tests, target is not supported." >> return >> } >> >> @@ -21,8 +21,14 @@ load_lib "trace-support.exp" >> >> standard_testfile >> >> +set add_flags "" >> + >> +if { [is_amd64_regs_target] } { >> + set add_flags "-mavx" >> +} >> + >> if {[prepare_for_testing $testfile.exp $testfile $srcfile \ >> - [list debug additional_flags=-mavx]]} { >> + [list debug additional_flags=$add_flags]]} { >> return -1 >> } >> >> @@ -36,20 +42,31 @@ if ![gdb_target_supports_trace] { >> return -1 >> } >> >> -gdb_test_multiple "print \$ymm15" "check for AVX support" { >> +if { [is_amd64_regs_target] } { >> + set reg "\$ymm15" >> + set reg_message "check for AVX support" >> +} elseif { [istarget "arm*-*-*"] } { >> + set reg "\$s5" >> + set reg_message "check for register $reg" >> +} > > We can set reg_message out of the condition block, > > if { [is_amd64_regs_target] } { > set reg "\$ymm15" > } elseif { [istarget "arm*-*-*"] } { > set reg "\$s5" > } > > set reg_message "check for register $reg" OK. Patch v8 follows.