Re: [PATCH] arm reversible : <phase_2_complete>

oza Pawandeep
2011-11-08T10:45:33Z

Hi Yao,

the function sbo_sbz is generic function, which checks whether alll
the bits are 1 or all are 0 ?
the position of starting bit could be anything and ending bit could be anything.
this function accepts any position (between 0-31) and any length.

I looked at the functions which you suggested;
they seem to be working on specific insns.

I could not find a better way other than ANDing all the bits to find
out whether they all are 1 or 0.

I could be easily wrong here or still might not be getting the angle
which you are trying to bring in.

Regards,
Oza.

On Tue, Nov 8, 2011 at 3:46 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 11/08/2011 02:01 PM, oza Pawandeep wrote:
>> Yao >> This function is used to match opcode for instructions.  Why don't
>> you use bit operation (AND and OR) and logic operation to match
>> instruction?  Bit operation and logic operation are widely used in
>> gdb.  It is efficient and easy to read.  I suggest to replace
>> sbo_sbz by bit/logical operation when matching instruction.
>>
>>
>> Oza >> I am not sure what you meant by re-writting sbo_sbz function.
>> as there is already '&' and '!' and '>>' which all are bit operators.
>
> I suggested to remove sbo_sbz function, to decode instructions with
> macros bits/bit, and to match using if/else/switch etc.
>
> Please reference arm_get_next_pc_raw, arm_process_displaced_insn and
> thumb_process_displaced_insn to see how instructions are decoded and
> matched.
>
> --
> Yao (齐尧)
>