aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1996-01-23 00:50:24 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1996-01-23 00:50:24 +0000
commit458bbd1f1e586aa857df7cd61cd7b7fd09b96f98 (patch)
tree6bef4277f51e7c80740b1ce1d3ecb065eb17b1a9 /binutils/objdump.c
parent049f3d4c7525d6f45106db5f3c4b4e16ef03ce95 (diff)
downloadgdb-458bbd1f1e586aa857df7cd61cd7b7fd09b96f98.zip
gdb-458bbd1f1e586aa857df7cd61cd7b7fd09b96f98.tar.gz
gdb-458bbd1f1e586aa857df7cd61cd7b7fd09b96f98.tar.bz2
Add new option --show-raw-insn.
* objdump.c (show_raw_insn): New global. (usage): Update. (long_options): Update. (disassemble_data): Set disasm_info.flags if --show-raw-insn. * objdump.c (disassemble_data): Set new arch,mach,endian fields in disasm_info.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 852588f..3279eb7 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -52,6 +52,7 @@ int dump_ar_hdrs; /* -a */
int dump_private_headers; /* -p */
int with_line_numbers; /* -l */
boolean with_source_code; /* -S */
+int show_raw_insn; /* --show-raw-insn */
int dump_stab_section_info; /* --stabs */
boolean disassemble; /* -d */
boolean disassemble_all; /* -D */
@@ -140,7 +141,8 @@ Usage: %s [-ahifdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
[--architecture=machine] [--reloc] [--full-contents] [--stabs]\n\
[--syms] [--all-headers] [--dynamic-syms] [--dynamic-reloc]\n\
[--wide] [--version] [--help] [--private-headers]\n\
- [--start-address=addr] [--stop-address=addr] objfile...\n\
+ [--start-address=addr] [--stop-address=addr]\n\
+ [--show-raw-insn] objfile...\n\
at least one option besides -l (--line-numbers) must be given\n");
list_supported_targets (program_name, stream);
exit (status);
@@ -171,6 +173,7 @@ static struct option long_options[]=
{"reloc", no_argument, NULL, 'r'},
{"section", required_argument, NULL, 'j'},
{"section-headers", no_argument, NULL, 'h'},
+ {"show-raw-insn", no_argument, &show_raw_insn, 1},
{"source", no_argument, NULL, 'S'},
{"stabs", no_argument, &dump_stab_section_info, 1},
{"start-address", required_argument, NULL, OPTION_START_ADDRESS},
@@ -831,6 +834,8 @@ disassemble_data (abfd)
disasm_info.application_data = (PTR) &aux;
aux.abfd = abfd;
disasm_info.print_address_func = objdump_print_address;
+ if (show_raw_insn)
+ disasm_info.flags |= DISASM_RAW_INSN_FLAG;
if (machine != (char *) NULL)
{
@@ -854,6 +859,13 @@ disassemble_data (abfd)
exit (1);
}
+ disasm_info.arch = bfd_get_arch (abfd);
+ disasm_info.mach = bfd_get_mach (abfd);
+ if (bfd_big_endian (abfd))
+ disasm_info.endian = BFD_ENDIAN_BIG;
+ else
+ disasm_info.endian = BFD_ENDIAN_LITTLE;
+
for (section = abfd->sections;
section != (asection *) NULL;
section = section->next)