diff options
author | Catherine Moore <clm@redhat.com> | 1998-08-10 01:27:05 +0000 |
---|---|---|
committer | Catherine Moore <clm@redhat.com> | 1998-08-10 01:27:05 +0000 |
commit | 0ff7faafe6a582f16c124e88fb31067cf66cbaef (patch) | |
tree | f8dc956a698d81e0663429ea010a76ff59d90456 /opcodes | |
parent | a582ac33a3bf6bcc8dd52fafdb5a0935b2950a67 (diff) | |
download | gdb-0ff7faafe6a582f16c124e88fb31067cf66cbaef.zip gdb-0ff7faafe6a582f16c124e88fb31067cf66cbaef.tar.gz gdb-0ff7faafe6a582f16c124e88fb31067cf66cbaef.tar.bz2 |
* arm-dis.c (print_insn_big_arm): Check for thumb symbol
attributes.
(print_insn_little_arm): Likewise.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/.Sanitize | 28 | ||||
-rw-r--r-- | opcodes/ChangeLog | 8 | ||||
-rw-r--r-- | opcodes/arm-dis.c | 97 |
3 files changed, 113 insertions, 20 deletions
diff --git a/opcodes/.Sanitize b/opcodes/.Sanitize index 32fe276..72d7aa7 100644 --- a/opcodes/.Sanitize +++ b/opcodes/.Sanitize @@ -186,6 +186,34 @@ else done fi +armelf_files="ChangeLog arm-dis.c" +if ( echo $* | grep keep\-armelf > /dev/null ) ; then + for i in $armelf_files ; do + if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Keeping armelf stuff in $i + fi + fi + done +else + for i in $armelf_files ; do + if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Removing traces of \"armelf\" from $i... + fi + cp $i new + sed '/start\-sanitize\-armelf/,/end-\sanitize\-armelf/d' < $i > new + if [ -n "${safe}" -a ! -f .Recover/$i ] ; then + if [ -n "${verbose}" ] ; then + echo Caching $i in .Recover... + fi + mv $i .Recover + fi + mv new $i + fi + done +fi + v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c" if ( echo $* | grep keep\-v850e > /dev/null ) ; then for i in $v850e_files ; do diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a1ba0d3..bb46c58 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,11 @@ +start-sanitize-armelf +Sun Aug 9 20:17:28 1998 Catherine Moore <clm@cygnus.com> + + * arm-dis.c (print_insn_big_arm): Check for thumb symbol + attributes. + (print_insn_little_arm): Likewise. + +end-sanitize-armelf Mon Aug 3 12:43:16 1998 Doug Evans <devans@seba.cygnus.com> Move all global state data into opcode table struct, and treat diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 32112c1..cd8c0ba 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the ARM - Copyright (C) 1994, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modification by James G. Smith (jsmith@cygnus.co.uk) @@ -24,6 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "arm-opc.h" #include "coff/internal.h" #include "libcoff.h" +#include "opintl.h" + +/* start-sanitize-armelf */ +/* FIXME: This shouldn't be done here */ +#include "elf-bfd.h" +#include "elf/internal.h" +/* end-sanitize-armelf */ static char *arm_conditional[] = {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", @@ -308,9 +315,12 @@ print_insn_arm (pc, info, given) case 'C': switch (given & 0x00090000) { - case 0: + default: func (stream, "_???"); break; + case 0x90000: + func (stream, "_all"); + break; case 0x10000: func (stream, "_ctl"); break; @@ -350,7 +360,7 @@ print_insn_arm (pc, info, given) func (stream, "e"); break; default: - func (stream, "<illegal precision>"); + func (stream, _("<illegal precision>")); break; } break; @@ -639,7 +649,11 @@ print_insn_thumb (pc, info, given) break; case 'a': - info->print_address_func (((pc + 4) & ~1) + (reg << 2), info); + /* PC-relative address -- the bottom two + bits of the address are dropped before + the calculation. */ + info->print_address_func + (((pc + 4) & ~3) + (reg << 2), info); break; case 'x': @@ -709,16 +723,37 @@ print_insn_big_arm (pc, info) unsigned char b[4]; long given; int status; - coff_symbol_type * cs; + coff_symbol_type *cs; +/* start-sanitize-armelf */ + elf_symbol_type *es; +/* end-sanitize-armelf */ int is_thumb; - cs = coffsymbol (*info->symbols); - is_thumb = (cs != NULL) && - ( cs->native->u.syment.n_sclass == C_THUMBEXT - || cs->native->u.syment.n_sclass == C_THUMBSTAT - || cs->native->u.syment.n_sclass == C_THUMBLABEL - || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC - || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC); + is_thumb = false; + if (info->symbols != NULL) + { + if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour) + { + cs = coffsymbol (*info->symbols); + is_thumb = (cs->native->u.syment.n_sclass == C_THUMBEXT + || cs->native->u.syment.n_sclass == C_THUMBSTAT + || cs->native->u.syment.n_sclass == C_THUMBLABEL + || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC + || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC); + + } +/* start-sanitize-armelf */ + else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour) + { + es = *(elf_symbol_type **)(info->symbols); + is_thumb = (es->internal_elf_sym.st_other == C_THUMBEXT + || es->internal_elf_sym.st_other == C_THUMBSTAT + || es->internal_elf_sym.st_other == C_THUMBLABEL + || es->internal_elf_sym.st_other == C_THUMBEXTFUNC + || es->internal_elf_sym.st_other == C_THUMBSTATFUNC); + } +/* end-sanitize-armelf */ + } info->bytes_per_chunk = 4; info->display_endian = BFD_ENDIAN_BIG; @@ -777,16 +812,38 @@ print_insn_little_arm (pc, info) unsigned char b[4]; long given; int status; - coff_symbol_type * cs; + coff_symbol_type *cs; +/* start-sanitize-armelf */ + elf_symbol_type *es; +/* end-sanitize-armelf */ int is_thumb; + + is_thumb = false; + if (info->symbols != NULL) + { + if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour) + { + cs = coffsymbol (*info->symbols); + is_thumb = (cs->native->u.syment.n_sclass == C_THUMBEXT + || cs->native->u.syment.n_sclass == C_THUMBSTAT + || cs->native->u.syment.n_sclass == C_THUMBLABEL + || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC + || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC); + + } +/* start-sanitize-armelf */ + else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour) + { + es = *(elf_symbol_type **)(info->symbols); + is_thumb = (es->internal_elf_sym.st_other == C_THUMBEXT + || es->internal_elf_sym.st_other == C_THUMBSTAT + || es->internal_elf_sym.st_other == C_THUMBLABEL + || es->internal_elf_sym.st_other == C_THUMBEXTFUNC + || es->internal_elf_sym.st_other == C_THUMBSTATFUNC); + } +/* end-sanitize-armelf */ + } - cs = coffsymbol (*info->symbols); - is_thumb = (cs != NULL) && - ( cs->native->u.syment.n_sclass == C_THUMBEXT - || cs->native->u.syment.n_sclass == C_THUMBSTAT - || cs->native->u.syment.n_sclass == C_THUMBLABEL - || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC - || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC); info->bytes_per_chunk = 4; info->display_endian = BFD_ENDIAN_LITTLE; |