* objdump.c (disassemble_bytes): Added code to allow some control
over the way raw instructions are displayed.
+Thu Feb 6 14:14:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * objdump.c (disassemble_bytes): Added code to allow some control
+ over the way raw instructions are displayed.
+
Thu Feb 6 12:36:03 1997 Ian Lance Taylor <ian@cygnus.com>
* stabs.c (struct bincl_file): Add next_stack field.
Thu Feb 6 12:36:03 1997 Ian Lance Taylor <ian@cygnus.com>
* stabs.c (struct bincl_file): Add next_stack field.
{
char buf[1000];
SFILE sfile;
{
char buf[1000];
SFILE sfile;
info->fprintf_func = (fprintf_ftype) objdump_sprintf;
info->stream = (FILE *) &sfile;
info->bytes_per_line = 0;
info->fprintf_func = (fprintf_ftype) objdump_sprintf;
info->stream = (FILE *) &sfile;
info->bytes_per_line = 0;
+ info->bytes_per_chunk = 0;
bytes = (*disassemble_fn) (section->vma + i, info);
info->fprintf_func = (fprintf_ftype) fprintf;
info->stream = stdout;
bytes = (*disassemble_fn) (section->vma + i, info);
info->fprintf_func = (fprintf_ftype) fprintf;
info->stream = stdout;
long j;
/* If ! prefix_addresses and ! wide_output, we print
long j;
/* If ! prefix_addresses and ! wide_output, we print
- four bytes per line. */
+ bytes_per_line bytes per line. */
pb = bytes;
if (pb > bytes_per_line && ! prefix_addresses && ! wide_output)
pb = bytes_per_line;
pb = bytes;
if (pb > bytes_per_line && ! prefix_addresses && ! wide_output)
pb = bytes_per_line;
- for (j = i; j < i + pb; ++j)
+ if (info->bytes_per_chunk)
+ bpc = info->bytes_per_chunk;
+ else
+ bpc = 1;
+
+ for (j = i; j < i + pb; j += bpc)
- printf ("%02x", (unsigned) data[j]);
- putchar (' ');
+ int k;
+ if (bpc > 1 && info->display_endian == BFD_ENDIAN_LITTLE)
+ {
+ for (k=bpc-1; k >= 0; k--)
+ printf ("%02x", (unsigned) data[j+k]);
+ putchar (' ');
+ }
+ else
+ {
+ for (k=0; k < bpc; k++)
+ printf ("%02x", (unsigned) data[j+k]);
+ putchar (' ');
+ }
}
for (; pb < bytes_per_line; ++pb)
}
for (; pb < bytes_per_line; ++pb)