Small improvement to output from show_instruction()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

To aid understanding and for debugging it is useful if the instruction
type is indicated when the type is not an integer value. I suggest
following small change to show_instruction():

 if (opcode < ARRAY_SIZE(opcodes)) {
  const char *op = opcodes[opcode];
  if (!op)
   buf += sprintf(buf, "opcode:%d", opcode);
  else
   buf += sprintf(buf, "%s", op);
  if (insn->type && is_float_type(insn->type))
   buf += sprintf(buf, ".f%d", insn->size);
  else if (insn->size)
   buf += sprintf(buf, ".%d", insn->size);
  if (insn->type) {
   if (is_ptr_type(insn->type))
    buf += sprintf(buf, "*");
  }
  memset(buf, ' ', 20);
  buf++;
 }

For example, the output for following:

extern int printf(const char *, ...);
int main(void)
{
    printf("%f\n", (double)-1);
    return 0;
}

is shown as:

main:
.L0:
        <entry-point>
        symaddr.64* %r1 <- <anon symbol:0000024A51894818>
        push.64*    %r1
        push.f64    $-1
        call.32     %r2 <- printf
        ret.32      $0


Thanks and Regards
Dibyendu
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux