]> Git Repo - binutils.git/commitdiff
Thu Feb 6 14:14:59 1997 Martin M. Hunt <[email protected]>
authorMartin Hunt <[email protected]>
Thu, 6 Feb 1997 22:22:37 +0000 (22:22 +0000)
committerMartin Hunt <[email protected]>
Thu, 6 Feb 1997 22:22:37 +0000 (22:22 +0000)
* objdump.c (disassemble_bytes): Added code to allow some control
  over the way raw instructions are displayed.

binutils/ChangeLog
binutils/objdump.c

index 4f43f98851fd3fe7d31ff0a34eb8ae09b2c92eb3..d372b44548d5a18d2453f3a41db5e6ad8c141844 100644 (file)
@@ -1,3 +1,8 @@
+Thu Feb  6 14:14:59 1997  Martin M. Hunt  <[email protected]>
+
+       * 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  <[email protected]>
 
        * stabs.c (struct bincl_file): Add next_stack field.
index fd731869a648eb03e7a6e41c8ff5060714602f7d..77a8d710da1358166011b4fda683fa2bc8a712fc 100644 (file)
@@ -1107,7 +1107,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
        {
          char buf[1000];
          SFILE sfile;
-         int pb = 0;
+         int bpc, pb = 0;
 
          done_dot = false;
 
@@ -1139,6 +1139,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
              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;
@@ -1170,15 +1171,31 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
              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;
 
-             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)
This page took 0.044833 seconds and 4 git commands to generate.