Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Make arm_record_test work on big-endian machines
Date: Mon, 12 Mar 2018 18:54:00 -0000	[thread overview]
Message-ID: <907342c39bf37dae5f6498abc5887dd4@polymtl.ca> (raw)
In-Reply-To: <86po49dxw3.fsf@gmail.com>

On 2018-03-12 13:09, Yao Qi wrote:
> Simon Marchi <simon.marchi@ericsson.com> writes:
> 
>> What do you think about the patch below?  Functionally, it should be 
>> identical
>> to what you suggested, but I think it's clear to fix extract_arm_insn 
>> instead.
>> 
> 
> Patch looks good to me.  Thanks.
> 
>> +
>> +  insn_record->arm_insn
>> +    = (uint32_t) extract_unsigned_integer (&buf[0], 2, endian);
>> +
>> +  if (insn_size == 4)
>> +    {
>> +      insn_record->arm_insn <<= 16;
>> +      insn_record->arm_insn
>> +	|= (uint32_t) extract_unsigned_integer (&buf[2], 2, endian);
> 
> Better to add some comments here.

Oh, actually, does my patch get it wrong for ARM instructions?  For 
them, it seems like in little endian, the four bytes of an instruction 
are reversed (as if it was a 4-byte value).  So that would explain why 
the word swap would only occur under a if (THUMB2_RECORD == 
record_type).  There is no test with ARM instructions in 
arm_record_test... should there be one?

Simon


      reply	other threads:[~2018-03-12 18:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  3:09 Simon Marchi
2018-03-12 14:16 ` Yao Qi
2018-03-12 15:42   ` Simon Marchi
2018-03-12 17:09     ` Yao Qi
2018-03-12 18:54       ` Simon Marchi [this message]

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=907342c39bf37dae5f6498abc5887dd4@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=simon.marchi@ericsson.com \
    /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