Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: <gdb-patches@sourceware.org>,  <qiyaoltc@gmail.com>
Subject: Re: [PATCH v6] Enable tracing of pseudo-registers on ARM
Date: Fri, 26 Feb 2016 08:34:00 -0000	[thread overview]
Message-ID: <86wpprc1ky.fsf@gmail.com> (raw)
In-Reply-To: <1456414378-1918-1-git-send-email-antoine.tremblay@ericsson.com>	(Antoine Tremblay's message of "Thu, 25 Feb 2016 10:32:58 -0500")

Antoine Tremblay <antoine.tremblay@ericsson.com> writes:

> @@ -20,7 +20,11 @@
>   * registers on x86_64.
>   */
>  

The comments above should be updated as well.

> +#if (defined __x86_64__)
>  #include <immintrin.h>
> +#elif (defined __arm__ || defined __thumb2__ || defined __thumb__)

__arm__ is defined even in thumb mode, so only "defined __arm__" is enough.

> +#include <arm_neon.h>

Why do you include arm_neon.h?  I don't see anything NEON specific is used.

> +#endif
>  
>  void
>  dummy (void)
> @@ -37,6 +41,7 @@ main (void)
>  {
>    /* 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.  */
> +#if (defined __x86_64__)
>    register __v8si a asm("xmm15") = {
>      0x12340001,
>      0x12340002,
> @@ -48,6 +53,13 @@ main (void)
>      0x12340008,
>    };
>    asm volatile ("traceme: call dummy" : : "x" (a));
> +#elif (defined __arm__ || defined __thumb2__ || defined __thumb__)

Only "defined __arm__" is needed.

> +  register uint32_t a asm("s5") = {
> +    0x2
> +  };

I'd like to write an inline asm to set s5 a value and the value can be shown as
an integer so that the test is more reliable (current test tests float
"2.80259693e-45").

> +  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..12a2740 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 <http://www.gnu.org/licenses/>.
>  
> -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
>  
> +if { [is_amd64_regs_target] } {
> + set add_flags "-mavx"
> +} elseif { [istarget "arm*-*-*"] } {
> + set add_flags "-mfpu=neon"

Don't have to pass -mfpu=neon, because the case is also valid for vfp.

> +}
> +
>  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 Neon support"

$s5 exists on the processors which support NEON or VFP, so the
$reg_message isn't accurate.  We can change reg_message to "check
register $reg".

-- 
Yao (齐尧)


  parent reply	other threads:[~2016-02-26  8:34 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 17:45 [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Antoine Tremblay
2016-01-07 17:45 ` [PATCH 3/4] Enable tracing of pseudo-registers on ARM Antoine Tremblay
2016-02-12 15:14   ` Yao Qi
2016-02-12 15:54     ` Marcin Kościelnicki
2016-02-15 10:27       ` Yao Qi
2016-02-15 10:57         ` Pedro Alves
2016-02-15 14:46     ` [PATCH v2] " Antoine Tremblay
2016-02-19 16:33       ` Antoine Tremblay
2016-02-19 19:29         ` [PATCH v3] " Antoine Tremblay
2016-02-19 20:06           ` [PATCH v4] " Antoine Tremblay
2016-02-19 20:22           ` [PATCH v3] " Pedro Alves
2016-02-19 20:32             ` Antoine Tremblay
2016-02-22 11:51             ` Yao Qi
2016-02-22 16:51             ` Antoine Tremblay
2016-02-24 18:11               ` Pedro Alves
2016-02-24 18:21                 ` Marcin Kościelnicki
2016-02-24 18:33                   ` Pedro Alves
2016-02-24 18:55                     ` Antoine Tremblay
2016-02-24 19:02                       ` Pedro Alves
2016-02-24 19:02                     ` Antoine Tremblay
2016-02-23 19:34             ` Antoine Tremblay
2016-02-24 18:20               ` Pedro Alves
2016-02-24 18:47                 ` Antoine Tremblay
2016-02-23 19:41             ` [PATCH v5] " Antoine Tremblay
2016-02-24 19:12               ` Pedro Alves
2016-02-24 19:25                 ` Antoine Tremblay
2016-02-25 10:35               ` Yao Qi
2016-02-25 15:33                 ` [PATCH v6] " Antoine Tremblay
2016-02-25 17:59                   ` Pedro Alves
2016-02-25 18:19                     ` Antoine Tremblay
2016-02-26  8:34                   ` Yao Qi [this message]
2016-02-26 13:00                     ` Antoine Tremblay
2016-02-26 13:03                       ` [PATCH v7] " Antoine Tremblay
2016-02-26 14:14                         ` Yao Qi
2016-02-26 14:57                           ` Antoine Tremblay
2016-02-26 14:59                             ` [PATCH v8] " Antoine Tremblay
2016-02-26 15:57                               ` Yao Qi
2016-02-26 17:45                                 ` Antoine Tremblay
2016-01-07 17:45 ` [PATCH 2/4] Use the target architecture when encoding tracepoint actions Antoine Tremblay
2016-02-06 20:58   ` Marcin Kościelnicki
2016-02-11 13:02   ` Pedro Alves
2016-02-11 13:21     ` Antoine Tremblay
2016-01-07 17:45 ` [PATCH 4/4] Support tracepoints for ARM linux in GDBServer Antoine Tremblay
2016-01-07 17:45 ` [PATCH 1/4] Teach arm unwinders to terminate gracefully Antoine Tremblay
2016-02-12 14:46   ` Yao Qi
2016-02-24 17:57     ` Antoine Tremblay
2016-02-25 11:44     ` Pedro Alves
2016-02-25 13:15       ` Antoine Tremblay
2016-02-26  9:12         ` Yao Qi
2016-02-26 12:26           ` Antoine Tremblay
2016-02-26 14:25             ` Yao Qi
2016-02-26 20:10               ` Antoine Tremblay
2016-04-06 15:54       ` Yao Qi
2016-04-06 16:30         ` Pedro Alves
2016-04-07 16:33           ` Yao Qi
2016-05-04 16:24       ` Yao Qi
2016-01-11 12:17 ` [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Yao Qi
2016-01-11 12:56   ` Antoine Tremblay
2016-01-11 13:41     ` Yao Qi
2016-04-26 19:11   ` Antoine Tremblay
2016-04-27  8:00     ` Yao Qi
2016-04-27 12:07       ` Antoine Tremblay
2016-04-27 13:57         ` Yao Qi
2016-04-27 14:41           ` Antoine Tremblay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wpprc1ky.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox