diff options
author | nobody <> | 2003-03-26 20:19:13 +0000 |
---|---|---|
committer | nobody <> | 2003-03-26 20:19:13 +0000 |
commit | 53d90b0ab35fcebbca22bdbc21128ccced53f2fb (patch) | |
tree | 7fc14e9d38eb52587fc83c53ee81033ef587fd30 | |
parent | 5f04291e65feecc0683332aa2f39d25ebaf1c31c (diff) | |
download | binutils-gdb-53d90b0ab35fcebbca22bdbc21128ccced53f2fb.tar.gz |
This commit was manufactured by cvs2svn to create branchcagney_framebase-20030326-branchpoint
'cagney_framebase-20030326-branch'.
Sprout from cagney_lazyid-20030317-branch 2003-03-17 14:23:51 UTC nobody 'This commit was manufactured by cvs2svn to create branch'
Cherrypick from master 2003-03-26 20:19:12 UTC Daniel Jacobowitz <drow@false.org> ' * breakpoint.c (handle_gnu_4_16_catch_command, get_catch_sals)':
bfd/ChangeLog
bfd/archures.c
bfd/bfd-in2.h
bfd/coff-arm.c
bfd/coffcode.h
bfd/coffgen.c
bfd/cpu-arm.c
bfd/elf32-arm.h
bfd/elf32-m68k.c
bfd/elf32-xstormy16.c
bfd/elf64-mips.c
bfd/elf64-sparc.c
bfd/elfn32-mips.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-mips.h
bfd/libbfd.h
bfd/peXXigen.c
bfd/reloc.c
bfd/version.h
gdb/ChangeLog
gdb/MAINTAINERS
gdb/Makefile.in
gdb/ada-lang.c
gdb/alpha-osf1-tdep.c
gdb/alpha-tdep.c
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/arm-tdep.h
gdb/armnbsd-tdep.c
gdb/avr-tdep.c
gdb/blockframe.c
gdb/breakpoint.c
gdb/c-lang.c
gdb/config/i386/cygwin.mt
gdb/config/m68k/tm-os68k.h
gdb/config/m68k/tm-sun3.h
gdb/config/m68k/tm-vx68.h
gdb/config/mips/tm-irix3.h
gdb/config/mips/tm-irix6.h
gdb/config/mips/tm-mips.h
gdb/config/mips/tm-tx39.h
gdb/config/mips/tm-tx39l.h
gdb/config/pa/tm-hppa.h
gdb/config/sparc/tm-sp64.h
gdb/config/sparc/tm-sparc.h
gdb/cris-tdep.c
gdb/d10v-tdep.c
gdb/defs.h
gdb/disasm.c
gdb/doc/ChangeLog
gdb/doc/Makefile.in
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/doc/observer.texi
gdb/dummy-frame.h
gdb/dwarf2cfi.c
gdb/expression.h
gdb/f-lang.c
gdb/frame.c
gdb/frame.h
gdb/frv-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbserver/ChangeLog
gdb/gdbserver/config.in
gdb/gdbserver/configure
gdb/gdbserver/configure.in
gdb/gdbserver/linux-low.c
gdb/gdbtypes.h
gdb/h8300-tdep.c
gdb/hppa-tdep.c
gdb/i386-cygwin-tdep.c
gdb/i386-interix-tdep.c
gdb/i386-tdep.c
gdb/ia64-tdep.c
gdb/inferior.h
gdb/infrun.c
gdb/jv-lang.c
gdb/language.c
gdb/language.h
gdb/m2-lang.c
gdb/m68hc11-tdep.c
gdb/m68k-tdep.c
gdb/main.c
gdb/mcore-tdep.c
gdb/mdebugread.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/ns32k-tdep.c
gdb/objc-lang.c
gdb/objc-lang.h
gdb/objfiles.h
gdb/observer.c
gdb/osabi.c
gdb/p-lang.c
gdb/ppc-linux-tdep.c
gdb/ppc-sysv-tdep.c
gdb/ppc-tdep.h
gdb/printcmd.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/scm-lang.c
gdb/sh-tdep.c
gdb/signals/signals.c
gdb/somsolib.c
gdb/sparc-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/e500-abi.c
gdb/testsuite/gdb.arch/e500-abi.exp
gdb/testsuite/gdb.arch/e500-regs.c
gdb/testsuite/gdb.arch/e500-regs.exp
gdb/testsuite/gdb.asm/asm-source.exp
gdb/testsuite/gdb.asm/m68hc11.inc
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/ending-run.exp
gdb/testsuite/gdb.base/help.exp
gdb/testsuite/gdb.base/watchpoint.c
gdb/testsuite/gdb.base/watchpoint.exp
gdb/v850-tdep.c
gdb/valops.c
gdb/vax-tdep.c
gdb/version.in
gdb/x86-64-tdep.c
gdb/xstormy16-tdep.c
include/ChangeLog
include/ansidecl.h
include/coff/ChangeLog
include/coff/arm.h
include/elf/ChangeLog
include/elf/arm.h
include/gdb/ChangeLog
include/gdb/sim-arm.h
include/hashtab.h
include/opcode/ChangeLog
include/opcode/s390.h
libiberty/ChangeLog
libiberty/Makefile.in
libiberty/hashtab.c
opcodes/ChangeLog
opcodes/arm-dis.c
opcodes/arm-opc.h
opcodes/i386-dis.c
opcodes/s390-dis.c
opcodes/s390-mkopc.c
opcodes/s390-opc.c
opcodes/s390-opc.txt
sim/arm/ChangeLog
sim/arm/Makefile.in
sim/arm/armcopro.c
sim/arm/armdefs.h
sim/arm/armemu.h
sim/arm/arminit.c
sim/arm/configure
sim/arm/configure.in
sim/arm/maverick.c
sim/arm/wrapper.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/h8300/inst.h
162 files changed, 5724 insertions, 2060 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bc78750d5b8..cec8e28d809 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,77 @@ +2003-03-26 Andreas Schwab <schwab@suse.de> + + * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf_m68k_relocate_section): Use it to correctly handle symbols + forced to be local. + (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got + entries for symbols that are forced to be local. + +2003-03-25 Alexandre Oliva <aoliva@redhat.com> + + * elfxx-mips.c (_bfd_mips_relax_section): New function. + * elfxx-mips.h (_bfd_mips_relax_section): Declare. + * elfn32-mips.c, elf64-mips.c: Use it. + +2003-03-25 Stan Cox <scox@redhat.com> + Nick Clifton <nickc@redhat.com> + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * archures.c: Add bfd_mach_arm_iWMMXt. + * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt + object files to be linked with XScale ones. + (coff_arm_final_link_postscript): Update note section. + * coffcode.h (coff_set_arch_mach_hook): Handle note section. + * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook + after identifying a coff binary. + * cpu-arm.c (processors): Add iWMMXt. + (arch_inf): Likewise. + * elf32-arm.h (arm_object_p): Handle note section. + (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to + be linked with XScale ones. + (elf32_arm_section_flags): New function: Set flags on note section. + (elf32_arm_final_write_processing): Handle note section. + +2003-03-21 DJ Delorie <dj@redhat.com> + + * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call + _bfd_elf_rela_local_sym. + +2003-03-20 H.J. Lu <hjl@gnu.org> + + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for + non-ELF outputs. + +2003-03-20 Nick Clifton <nickc@redhat.com> + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and + $idata5 in case bfd_coff_final_link is not called. + +2003-03-19 Jakub Jelinek <jakub@redhat.com> + + * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count + field. + (canon_reloc_count): Define. + (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, + sparc64_elf_canonicalize_dynamic_reloc): Use it instead of + reloc_count. + (sparc64_elf_canonicalize_reloc): New routine. + (bfd_elf64_canonicalize_reloc): Define. + +2003-03-18 Jakub Jelinek <jakub@redhat.com> + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation + againt mergeable sections. Take r_addend into account when caching + trampolines. + +2003-03-18 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for + local symbols that have no dyninfo. + 2003-03-14 Gene Smith <gene.smith@siemens.com> * ieee.c (ieee_write_expression): Handle the case where symbol is diff --git a/bfd/archures.c b/bfd/archures.c index 62edda109bb..18ebb835115 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -235,6 +235,7 @@ DESCRIPTION .#define bfd_mach_arm_5TE 9 .#define bfd_mach_arm_XScale 10 .#define bfd_mach_arm_ep9312 11 +.#define bfd_mach_arm_iWMMXt 12 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 2385c409a5c..8960f66df34 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1691,6 +1691,7 @@ enum bfd_architecture #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 #define bfd_mach_arm_ep9312 11 +#define bfd_mach_arm_iWMMXt 12 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -2563,6 +2564,7 @@ field in the instruction. */ BFD_RELOC_ARM_SWI, BFD_RELOC_ARM_MULTI, BFD_RELOC_ARM_CP_OFF_IMM, + BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 2fadcbef557..24015049826 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -2240,6 +2240,25 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) if (ibfd == obfd) return TRUE; + if (bfd_get_mach (obfd) && bfd_get_mach (obfd) != bfd_get_mach (ibfd)) + { + /* For now, allow an output file type of 'xscale' if the + input file type is 'iWMMXt'. This means that we will + not have to build an entire iWMMXt enabled set of libraries + just to test a iWMMXt enabled binary. Change the output + type to iWMMXt though. Similarly allow 'xscale' binaries + to be linked into a 'iWMMXt' output binary. */ + if ( bfd_get_mach (obfd) == bfd_mach_arm_XScale + && bfd_get_mach (ibfd) == bfd_mach_arm_iWMMXt) + bfd_set_arch_mach (obfd, bfd_get_arch (obfd), bfd_mach_arm_iWMMXt); + else if ( bfd_get_mach (ibfd) != bfd_mach_arm_XScale + || bfd_get_mach (obfd) != bfd_mach_arm_iWMMXt) + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + } + /* If the two formats are different we cannot merge anything. This is not an error, since it is permissable to change the input and output formats. */ @@ -2584,6 +2603,44 @@ coff_arm_final_link_postscript (abfd, pfinfo) globals->bfd_of_glue_owner->output_has_begun = TRUE; } + { + asection * arm_arch_section; + + /* Look for a .note section. If one is present check + the machine number encoded in it, and set it to the current + machine number if it is different. This allows XScale and + iWMMXt binaries to be merged and the resulting output to be set + to iWMMXt, even if the first input file had an XScale .note. */ + + arm_arch_section = bfd_get_section_by_name (abfd, ".note"); + + if (arm_arch_section != NULL) + { + char buffer [4]; + + if (bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + { + unsigned long arm_mach; + + /* We have to extract the value this way to allow for a + host whose endian-ness is different from the target. */ + arm_mach = bfd_get_32 (abfd, buffer); + + if (arm_mach != bfd_get_mach (abfd)) + { + bfd_put_32 (abfd, bfd_get_mach (abfd), buffer); + + if (! bfd_set_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + (*_bfd_error_handler) + (_("warning: unable to update contents of .note section in %s"), + bfd_get_filename (abfd)); + } + } + } + } + return TRUE; } diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ee50a10993c..da8121fd77f 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1899,6 +1899,27 @@ coff_set_arch_mach_hook (abfd, filehdr) currently the XScale. */ case F_ARM_5: machine = bfd_mach_arm_XScale; break; } + + { + asection * arm_arch_section; + + arm_arch_section = bfd_get_section_by_name (abfd, ".note"); + + if (arm_arch_section) + { + bfd_byte buffer [4]; + + if (! bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + (*_bfd_error_handler) + (_("%s: warning: unable to retrieve .note section from %s"), + bfd_get_filename (abfd)); + + /* We have to extract the value this way to allow for a + host whose endian-ness is different from the target. */ + machine = bfd_get_32 (abfd, buffer); + } + } break; #endif #ifdef MC68MAGIC diff --git a/bfd/coffgen.c b/bfd/coffgen.c index c905ab17eec..a3e3eecb413 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -226,7 +226,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) if (! bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f)) goto fail; - /* Now copy data as required; construct all asections etc */ + /* Now copy data as required; construct all asections etc. */ if (nscns != 0) { unsigned int i; @@ -241,6 +241,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) } } + bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f); /* make_abs_section (abfd); */ return abfd->xvec; diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index 923c2500afe..eb3011d7d29 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -96,7 +96,8 @@ processors[] = { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, { bfd_mach_arm_XScale, "xscale" }, - { bfd_mach_arm_ep9312, "ep9312" } + { bfd_mach_arm_ep9312, "ep9312" }, + { bfd_mach_arm_iWMMXt, "iwmmxt" } }; static bfd_boolean @@ -142,7 +143,8 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_arm_5T, "armv5t", FALSE, & arch_info_struct[8]), N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), - N (bfd_mach_arm_ep9312, "ep9312", FALSE, NULL) + N (bfd_mach_arm_ep9312, "ep9312", FALSE, & arch_info_struct[11]), + N (bfd_mach_arm_iWMMXt,"iwmmxt", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 509b4815574..417284b3169 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -2119,10 +2119,43 @@ static bfd_boolean elf32_arm_object_p (abfd) bfd *abfd; { - /* XXX - we ought to examine a .note section here. */ + asection * arm_arch_section; - if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT) - bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312); + arm_arch_section = bfd_get_section_by_name (abfd, ARM_NOTE_SECTION); + + if (arm_arch_section) + { + char buffer [4]; + unsigned long arm_mach; + + if (! bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + (*_bfd_error_handler) + (_("%s: warning: unable to retrieve %s section from %s"), + ARM_NOTE_SECTION, bfd_get_filename (abfd)); + else + { + /* We have to extract the value this way to allow for a + host whose endian-ness is different from the target. */ + arm_mach = bfd_get_32 (abfd, buffer); + bfd_default_set_arch_mach (abfd, bfd_arch_arm, arm_mach); + + if (bfd_get_arch (abfd) == bfd_arch_arm) + return TRUE; + + /* If the set failed for some reason, do not leave the architecture + type as 0 (unknown), but issue a warning message and force it to + be set to bfd_arch_arm. */ + (*_bfd_error_handler) + (_("%s: warning: unrecognized ARM machine number: %x"), + bfd_get_filename (abfd), arm_mach); + } + } + else + { + if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT) + bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312); + } return TRUE; } @@ -2263,6 +2296,25 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) return TRUE; } + if (bfd_get_mach (obfd) && bfd_get_mach (obfd) != bfd_get_mach (ibfd)) + { + /* For now, allow an output file type of 'xscale' if the + input file type is 'iWMMXt'. This means that we will + not have to build an entire iWMMXt enabled set of libraries + just to test a iWMMXt enabled binary. Change the output + type to iWMMXt though. Similarly allow 'xscale' binaries + to be linked into a 'iWMMXt' output binary. */ + if ( bfd_get_mach (obfd) == bfd_mach_arm_XScale + && bfd_get_mach (ibfd) == bfd_mach_arm_iWMMXt) + bfd_set_arch_mach (obfd, bfd_get_arch (obfd), bfd_mach_arm_iWMMXt); + else if ( bfd_get_mach (ibfd) != bfd_mach_arm_XScale + || bfd_get_mach (obfd) != bfd_mach_arm_iWMMXt) + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + } + /* Identical flags must be compatible. */ if (in_flags == out_flags) return TRUE; @@ -3660,6 +3712,65 @@ elf32_arm_reloc_type_class (rela) } } +static bfd_boolean elf32_arm_section_flags PARAMS ((flagword *, Elf_Internal_Shdr *)); +static void elf32_arm_final_write_processing PARAMS ((bfd *, bfd_boolean)); + +/* Set the right machine number for an Arm ELF file. */ + +static bfd_boolean +elf32_arm_section_flags (flags, hdr) + flagword *flags; + Elf_Internal_Shdr *hdr; +{ + if (hdr->sh_type == SHT_NOTE) + *flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS; + + return TRUE; +} + +void +elf32_arm_final_write_processing (abfd, linker) + bfd *abfd; + bfd_boolean linker ATTRIBUTE_UNUSED; +{ + asection * arm_arch_section; + char buffer [4]; + unsigned long arm_mach; + + /* Look for a .note.arm.ident section. If one is present check + the machine number encoded in it, and set it to the current + machine number if it is different. This allows XScale and + iWMMXt binaries to be merged and the resulting output to be set + to iWMMXt, even if the first input file had an XScale .note. */ + + arm_arch_section = bfd_get_section_by_name (abfd, ARM_NOTE_SECTION); + + if (arm_arch_section == NULL) + return; + + if (! bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + /* If the ident section does not exist then just skip this check. */ + return; + + /* We have to extract the value this way to allow for a + host whose endian-ness is different from the target. */ + arm_mach = bfd_get_32 (abfd, buffer); + + if (arm_mach == bfd_get_mach (abfd)) + return; + + bfd_put_32 (abfd, bfd_get_mach (abfd), buffer); + + if (! bfd_set_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, sizeof buffer)) + (*_bfd_error_handler) + (_("warning: unable to update contents of %s section in %s"), + ARM_NOTE_SECTION, bfd_get_filename (abfd)); + + return; +} + #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define ELF_MAXPAGESIZE 0x8000 @@ -3685,6 +3796,8 @@ elf32_arm_reloc_type_class (rela) #define elf_backend_post_process_headers elf32_arm_post_process_headers #define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_object_p elf32_arm_object_p +#define elf_backend_section_flags elf32_arm_section_flags +#define elf_backend_final_write_processing elf32_arm_final_write_processing #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 19a2ce8c755..abb0eece334 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1097,6 +1097,17 @@ elf_m68k_adjust_dynamic_symbol (info, h) return TRUE; } +/* This is the condition under which elf_m68k_finish_dynamic_symbol + will be called from elflink.h. If elflink.h doesn't call our + finish_dynamic_symbol routine, we'll need to do something about + initializing any .plt and .got entries in elf_m68k_relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ + ((DYN) \ + && ((SHARED) \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -1416,9 +1427,14 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_68K_GOT32) && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") != 0)) - && elf_hash_table (info)->dynamic_sections_created + && (WILL_CALL_FINISH_DYNAMIC_SYMBOL + (elf_hash_table (info)->dynamic_sections_created, + info->shared, h)) && (! info->shared - || (! info->symbolic && h->dynindx != -1) + || (! info->symbolic + && h->dynindx != -1 + && (h->elf_link_hash_flags + & ELF_LINK_FORCED_LOCAL) == 0) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) || (info->shared @@ -1496,13 +1512,18 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (h != NULL) { + bfd_boolean dyn; + off = h->got.offset; BFD_ASSERT (off != (bfd_vma) -1); - if (!elf_hash_table (info)->dynamic_sections_created + dyn = elf_hash_table (info)->dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) != 0) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -1940,7 +1961,9 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic || h->dynindx == -1) + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { rela.r_info = ELF32_R_INFO (0, R_68K_RELATIVE); diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index c09e9de2135..22ab8ef57cd 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -845,9 +845,7 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections [r_symndx]; - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 46d9a92cb5b..39f21b3046d 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -2887,6 +2887,7 @@ const struct elf_size_info mips_elf64_size_info = #define bfd_elf64_canonicalize_reloc mips_elf64_canonicalize_reloc #define bfd_elf64_get_dynamic_reloc_upper_bound mips_elf64_get_dynamic_reloc_upper_bound #define bfd_elf64_canonicalize_dynamic_reloc mips_elf64_canonicalize_dynamic_reloc +#define bfd_elf64_bfd_relax_section _bfd_mips_relax_section /* MIPS ELF64 archive functions. */ #define bfd_elf64_archive_functions diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index e4f04b552a7..bca09b73cef 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -96,6 +96,8 @@ static bfd_boolean sparc64_elf_slurp_one_reloc_table PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, asymbol **, bfd_boolean)); static bfd_boolean sparc64_elf_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); +static long sparc64_elf_canonicalize_reloc + PARAMS ((bfd *, asection *, arelent **, asymbol **)); static long sparc64_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR)); @@ -311,6 +313,17 @@ sparc64_elf_info_to_howto (abfd, cache_ptr, dst) cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)]; } +struct sparc64_elf_section_data +{ + struct bfd_elf_section_data elf; + unsigned int do_relax, reloc_count; +}; + +#define sec_do_relax(sec) \ + ((struct sparc64_elf_section_data *) elf_section_data (sec))->do_relax +#define canon_reloc_count(sec) \ + ((struct sparc64_elf_section_data *) elf_section_data (sec))->reloc_count + /* Due to the way how we handle R_SPARC_OLO10, each entry in a SHT_RELA section can represent up to two relocs, we must tell the user to allocate more space. */ @@ -361,7 +374,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) native_relocs = (bfd_byte *) allocated; - relents = asect->relocation + asect->reloc_count; + relents = asect->relocation + canon_reloc_count (asect); entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf64_External_Rela)); @@ -416,7 +429,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) relent->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (rela.r_info)]; } - asect->reloc_count += relent - relents; + canon_reloc_count (asect) += relent - relents; if (allocated != NULL) free (allocated); @@ -478,8 +491,9 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) if (asect->relocation == NULL) return FALSE; - /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count. */ - asect->reloc_count = 0; + /* The sparc64_elf_slurp_one_reloc_table routine increments + canon_reloc_count. */ + canon_reloc_count (asect) = 0; if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)) @@ -493,6 +507,32 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) return TRUE; } +/* Canonicalize the relocs. */ + +static long +sparc64_elf_canonicalize_reloc (abfd, section, relptr, symbols) + bfd *abfd; + sec_ptr section; + arelent **relptr; + asymbol **symbols; +{ + arelent *tblptr; + unsigned int i; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + + if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE)) + return -1; + + tblptr = section->relocation; + for (i = 0; i < canon_reloc_count (section); i++) + *relptr++ = tblptr++; + + *relptr = NULL; + + return canon_reloc_count (section); +} + + /* Canonicalize the dynamic relocation entries. Note that we return the dynamic relocations as a single block, although they are actually associated with particular sections; the interface, which @@ -528,7 +568,7 @@ sparc64_elf_canonicalize_dynamic_reloc (abfd, storage, syms) if (! sparc64_elf_slurp_reloc_table (abfd, s, syms, TRUE)) return -1; - count = s->reloc_count; + count = canon_reloc_count (s); p = s->relocation; for (i = 0; i < count; i++) *storage++ = p++; @@ -1918,15 +1958,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) return TRUE; } -struct sparc64_elf_section_data -{ - struct bfd_elf_section_data elf; - unsigned int do_relax; -}; - -#define sec_do_relax(sec) \ - ((struct sparc64_elf_section_data *) elf_section_data (sec))->do_relax - static bfd_boolean sparc64_elf_new_section_hook (abfd, sec) bfd *abfd; @@ -3177,6 +3208,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_get_reloc_upper_bound #define bfd_elf64_get_dynamic_reloc_upper_bound \ sparc64_elf_get_dynamic_reloc_upper_bound +#define bfd_elf64_canonicalize_reloc \ + sparc64_elf_canonicalize_reloc #define bfd_elf64_canonicalize_dynamic_reloc \ sparc64_elf_canonicalize_dynamic_reloc #define bfd_elf64_bfd_reloc_type_lookup \ diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 00a0e88c1ce..9105d185bb8 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -2211,6 +2211,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data \ _bfd_mips_elf_print_private_bfd_data +#define bfd_elf32_bfd_relax_section _bfd_mips_relax_section /* Support for SGI-ish mips targets using n32 ABI. */ diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index d1a78abfcc7..d46d78c5c43 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -696,6 +696,10 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) one pass. */ *again = FALSE; + /* Don't even try to relax for non-ELF outputs. */ + if (link_info->hash->creator->flavour != bfd_target_elf_flavour) + return FALSE; + /* Nothing to do if there are no relocations. */ if ((sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) @@ -819,6 +823,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) tsec = ia64_info->plt_sec; toff = dyn_i->plt2_offset; + BFD_ASSERT (irel->r_addend == 0); } /* Can't do anything else with dynamic symbols. */ @@ -837,10 +842,15 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) } } - symaddr = (tsec->output_section->vma - + tsec->output_offset - + toff - + irel->r_addend); + if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE) + toff = _bfd_merged_section_offset (abfd, &tsec, + elf_section_data (tsec)->sec_info, + toff + irel->r_addend, + (bfd_vma) 0); + else + toff += irel->r_addend; + + symaddr = tsec->output_section->vma + tsec->output_offset + toff; roff = irel->r_offset; @@ -1965,7 +1975,11 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) struct elfNN_ia64_local_hash_entry *loc_h; loc_h = get_local_sym_hash (ia64_info, abfd, rel, create); - BFD_ASSERT (loc_h); + if (!loc_h) + { + BFD_ASSERT (!create); + return NULL; + } pp = &loc_h->info; } diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 2b2f615934a..c8c9870fdd1 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -5451,6 +5451,185 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) return TRUE; } +bfd_boolean +_bfd_mips_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + bfd_boolean *again; +{ + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel, *irelend; + Elf_Internal_Shdr *symtab_hdr; + bfd_byte *contents = NULL; + bfd_byte *free_contents = NULL; + size_t extsymoff; + bfd_boolean changed_contents = FALSE; + bfd_vma sec_start = sec->output_section->vma + sec->output_offset; + Elf_Internal_Sym *isymbuf = NULL; + + /* We are not currently changing any sizes, so only one pass. */ + *again = FALSE; + + if (link_info->relocateable) + return TRUE; + + internal_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs) + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + return TRUE; + + irelend = internal_relocs + sec->reloc_count + * get_elf_backend_data (abfd)->s->int_rels_per_ext_rel; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info; + + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + bfd_signed_vma sym_offset; + unsigned int r_type; + unsigned long r_symndx; + asection *sym_sec; + unsigned long instruction; + + /* Turn jalr into bgezal, and jr into beq, if they're marked + with a JALR relocation, that indicate where they jump to. + This saves some pipeline bubbles. */ + r_type = ELF_R_TYPE (abfd, irel->r_info); + if (r_type != R_MIPS_JALR) + continue; + + r_symndx = ELF_R_SYM (abfd, irel->r_info); + /* Compute the address of the jump target. */ + if (r_symndx >= extsymoff) + { + struct mips_elf_link_hash_entry *h + = ((struct mips_elf_link_hash_entry *) + elf_sym_hashes (abfd) [r_symndx - extsymoff]); + + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; + + /* If a symbol is undefined, or if it may be overridden, + skip it. */ + if (! ((h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak) + && h->root.root.u.def.section) + || (link_info->shared && ! link_info->symbolic + && ! (h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))) + continue; + + sym_sec = h->root.root.u.def.section; + if (sym_sec->output_section) + symval = (h->root.root.u.def.value + + sym_sec->output_section->vma + + sym_sec->output_offset); + else + symval = h->root.root.u.def.value; + } + else + { + Elf_Internal_Sym *isym; + + /* Read this BFD's symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto relax_return; + } + + isym = isymbuf + r_symndx; + if (isym->st_shndx == SHN_UNDEF) + continue; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec + = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = isym->st_value + + sym_sec->output_section->vma + + sym_sec->output_offset; + } + + /* Compute branch offset, from delay slot of the jump to the + branch target. */ + sym_offset = (symval + irel->r_addend) + - (sec_start + irel->r_offset + 4); + + /* Branch offset must be properly aligned. */ + if ((sym_offset & 3) != 0) + continue; + + sym_offset >>= 2; + + /* Check that it's in range. */ + if (sym_offset < -0x8000 || sym_offset >= 0x8000) + continue; + + /* Get the section contents if we haven't done so already. */ + if (contents == NULL) + { + /* Get cached copy if it exists. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto relax_return; + + free_contents = contents; + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto relax_return; + } + } + + instruction = bfd_get_32 (abfd, contents + irel->r_offset); + + /* If it was jalr <reg>, turn it into bgezal $zero, <target>. */ + if ((instruction & 0xfc1fffff) == 0x0000f809) + instruction = 0x04110000; + /* If it was jr <reg>, turn it into b <target>. */ + else if ((instruction & 0xfc1fffff) == 0x00000008) + instruction = 0x10000000; + else + continue; + + instruction |= (sym_offset & 0xffff); + bfd_put_32 (abfd, instruction, contents + irel->r_offset); + changed_contents = TRUE; + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + { + if (!changed_contents && !link_info->keep_memory) + free (contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + return TRUE; + + relax_return: + if (free_contents != NULL) + free (free_contents); + return FALSE; +} + /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the dynamic object, but we're not including those sections. We have to diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 3f7794361b6..3064c39d137 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -108,3 +108,6 @@ extern bfd_reloc_status_type _bfd_mips_elf32_gprel16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); extern unsigned long _bfd_elf_mips_mach PARAMS ((flagword)); +extern bfd_boolean _bfd_mips_relax_section (bfd *, asection *, + struct bfd_link_info *, + bfd_boolean *); diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 222b23dcb5d..df2ba3e3f97 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1043,6 +1043,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_SWI", "BFD_RELOC_ARM_MULTI", "BFD_RELOC_ARM_CP_OFF_IMM", + "BFD_RELOC_ARM_CP_OFF_IMM_S2", "BFD_RELOC_ARM_ADR_IMM", "BFD_RELOC_ARM_LDR_IMM", "BFD_RELOC_ARM_LITERAL", diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 70236785661..9ab72d0990e 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -570,7 +570,9 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; PEAOUTHDR *aouthdr_out = (PEAOUTHDR *) out; bfd_vma sa, fa, ib; + IMAGE_DATA_DIRECTORY idata2, idata5; + if (pe->force_minimum_alignment) { if (!extra->FileAlignment) @@ -586,6 +588,9 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) fa = extra->FileAlignment; ib = extra->ImageBase; + idata2 = pe->pe_opthdr.DataDirectory[1]; + idata5 = pe->pe_opthdr.DataDirectory[12]; + if (aouthdr_in->tsize) { aouthdr_in->text_start -= ib; @@ -614,28 +619,34 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) #define SA(x) (((x) + sa -1 ) & (- sa)) /* We like to have the sizes aligned. */ - aouthdr_in->bsize = FA (aouthdr_in->bsize); extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; - /* first null out all data directory entries .. */ + /* First null out all data directory entries. */ memset (extra->DataDirectory, 0, sizeof (extra->DataDirectory)); add_data_entry (abfd, extra, 0, ".edata", ib); - - /* Don't call add_data_entry for .idata$2 or .idata$5. It's done in - bfd_coff_final_link where all the required information is - available. */ - - /* However, until other .idata fixes are made (pending patch), the - entry for .idata is needed for backwards compatability. FIXME. */ - add_data_entry (abfd, extra, 1, ".idata", ib); - add_data_entry (abfd, extra, 2, ".rsrc", ib); - add_data_entry (abfd, extra, 3, ".pdata", ib); + /* In theory we do not need to call add_data_entry for .idata$2 or + .idata$5. It will be done in bfd_coff_final_link where all the + required information is available. If however, we are not going + to perform a final link, eg because we have been invoked by objcopy + or strip, then we need to make sure that these Data Directory + entries are initialised properly. + + So - we copy the input values into the output values, and then, if + a final link is going to be performed, it can overwrite them. */ + extra->DataDirectory[1] = idata2; + extra->DataDirectory[12] = idata5; + + if (extra->DataDirectory[1].VirtualAddress == 0) + /* Until other .idata fixes are made (pending patch), the entry for + .idata is needed for backwards compatability. FIXME. */ + add_data_entry (abfd, extra, 1, ".idata", ib); + /* For some reason, the virtual size (which is what's set by add_data_entry) for .reloc is not the same as the size recorded in this slot by MSVC; it doesn't seem to cause problems (so far), @@ -689,7 +700,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) aouthdr_out->standard.text_start); #ifndef COFF_WITH_pep - /* PE32+ does not have data_start member! */ + /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, aouthdr_out->standard.data_start); #endif @@ -1994,9 +2005,9 @@ _bfd_XXi_final_link_postscript (abfd, pfinfo) ((h1->root.u.def.value + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset) - - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); + - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); } - + /* If we couldn't find idata$2, we either have an excessively trivial program or are in DEEP trouble; we have to assume trivial program.... */ diff --git a/bfd/reloc.c b/bfd/reloc.c index 9f8a952c591..f4a33218022 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2519,6 +2519,8 @@ ENUMX ENUMX BFD_RELOC_ARM_CP_OFF_IMM ENUMX + BFD_RELOC_ARM_CP_OFF_IMM_S2 +ENUMX BFD_RELOC_ARM_ADR_IMM ENUMX BFD_RELOC_ARM_LDR_IMM diff --git a/bfd/version.h b/bfd/version.h index c42c4496ab5..6d6a9a8959d 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030317 +#define BFD_VERSION_DATE 20030326 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bec734b8c2a..24f5b8a0752 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,402 @@ +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + * breakpoint.c (handle_gnu_4_16_catch_command, get_catch_sals) + (struct sal_chain, map_catch_names): Remove. + (catch_exception_command_1): Don't call + handle_gnu_4_16_catch_command. + +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + From Mark Dettinger <dettinge@de.ibm.com>: + * dwarf2cfi.c (read_2u): Increment pointer by two. + +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + * signals/signals.c: Fix typos in last change. + +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + * signals/signals.c (REALTIME_LO, REALTIME_HI): Define if + not already defined. Use __SIGRTMIN if available. + (target_signal_from_host): Remove SIGRTMIN block. + (do_target_signal_to_host): Remove SIGRTMIN block; check that + the signal is within the realtime range. + +2003-03-25 Adam Fedor <fedor@gnu.org> + + * Makefile.in (infrun.o): Add $(language_h) + * infrun.c (handle_inferior_event): Use skip_language_trampoline + for language specific trampolines. + * language.h (struct language_defn): Add skip_trampoline. + (skip_language_trampoline): Declare. + * language.c (unk_lang_trampoline, skip_language_trampoline): + New functions. + (unknown_language_defn, auto_language_defn, local_language_defn): + Add ukn_lang_trampoline. + * ada-lang.c (ada_language_defn): Add NULL for language + specific skip_trampoline. + * c-lang.c, f-lang.c, jv-lang.c, m2-lang.c, p-lang.c, + scm-lang.c: Likewise. + * objc-lang.c (objc_skip_trampoline): New function. + (objc_language_defn): Add objc_skip_trampoline. + +I2003-03-25 Andrew Cagney <cagney@redhat.com> + + * frame.c (get_prev_frame): Delay validating a frame's ID - + non-NULL, didn't go backwards - until an attempt to unwind it to + the previous frame. + +2003-03-25 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Replace + EXTRA_STACK_ALIGNMENT_NEEDED. Default to 0 not 1. + * gdbarch.h, gdbarch.c: Re-generate. + * config/sparc/tm-sparc.h + (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Define. + * sparc-tdep.c (sparc_gdbarch_init): Set + deprecated_extra_stack_alignment_needed. + * config/pa/tm-hppa.h (EXTRA_STACK_ALIGNMENT_NEEDED): Delete. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not clear + extra_stack_alignment_needed. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * hppa-tdep.c (hppa_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * m68k-tdep.c (m68k_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + +2003-03-25 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_STORE_STRUCT_RETURN): Replace + STORE_STRUCT_RETURN. + * gdbarch.h, gdbarch.c: Regenerate. + * d10v-tdep.c (d10v_store_struct_return): Delete function. + (d10v_push_arguments): Set the struct return register. + (d10v_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2003-03-25 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (CALL_DUMMY_STACK_ADJUST_P): Delete. + (DEPRECATED_CALL_DUMMY_STACK_ADJUST): Replace + CALL_DUMMY_STACK_ADJUST with a predicate variable. + * gdbarch.h, gdbarch.c: Regenerate. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set + call_dummy_stack_adjust_p. + * vax-tdep.c (vax_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68k-tdep.c (m68k_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + * config/sparc/tm-sp64.h (CALL_DUMMY_STACK_ADJUST): Update. + * config/sparc/tm-sparc.h (CALL_DUMMY_STACK_ADJUST): Update. + * config/sparc/tm-sp64.h (CALL_DUMMY_STACK_ADJUST): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. Do not set + call_dummy_stack_adjust_p. + * inferior.h (CALL_DUMMY_STACK_ADJUST_P): Delete macro. + (CALL_DUMMY_STACK_ADJUST): Delete macro. + * sparc-tdep.c (sparc32_push_arguments): Update. + * valops.c (hand_function_call): Update. + +2003-03-25 Corinna Vinschen <vinschen@redhat.com> + + * xstormy16-tdep.c (xstormy16_gdbarch_init): Add call to + set_gdbarch_char_signed. + +2003-03-25 Richard Earnshaw <rearnsha@arm.com> + + PR cli/548 + * arm-tdep.c (_initialize_arm_tdep): Command is "set arm disassembler". + +2003-03-25 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.c (arm_gdbarch_init): Register the disassembler function. + (_initialize_arm_tdep): Don't set tm_print_insn. + +2003-03-24 Adam Fedor <fedor@gnu.org> + + * Makefile.in (YYOBJ): Add objc-exp.tab.o + * objc-lang.h: Add multiple inclusion protection. + (start_msglist, add_msglist, end_msglist): Additional declarations. + +2003-03-24 Richard Earnshaw <rearnsha@arm.com> + + * armnbsd-tdep.c (arm_netbsd_aout_init_abi): ARM_FLOAT_SOFT enum + value was renamed to ARM_FLOAT_SOFT_FPA. + +2003-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_FRAME_CHAIN): Replace FRAME_CHAIN. + (DEPRECATED_FRAME_CHAIN_VALID): Replace FRAME_CHAIN_VALID. + * gdbarch.h, gdbarch.c: Regenerate. + * valops.c (hand_function_call): Update. + * objfiles.h (DEPRECATED_FRAME_CHAIN_VALID): Update. + * frame.c (legacy_saved_regs_this_id): Update. + (legacy_get_prev_frame, get_prev_frame, legacy_frame_p): Update. + * dummy-frame.h: Update. + * config/sparc/tm-sparc.h (DEPRECATED_FRAME_CHAIN): Update. + * config/pa/tm-hppa.h (DEPRECATED_FRAME_CHAIN_VALID): Update. + * config/m68k/tm-vx68.h (DEPRECATED_FRAME_CHAIN): Update. + * config/m68k/tm-os68k.h (DEPRECATED_FRAME_CHAIN): Update. + * config/m68k/tm-sun3.h: Update. + * blockframe.c (inside_main_func, frame_chain_valid): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_frame_chain, sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_frame_saved_pc): Update. + (rs6000_gdbarch_init, rs6000_frame_saved_pc): Update. + (frame_get_saved_regs): Update. + * ppc-linux-tdep.c (ppc_linux_init_abi): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_frame_num_args, i386_gdbarch_init): Update. + * i386-interix-tdep.c (i386_interix_init_abi): Update. + (i386_interix_back_one_frame): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + (hppa_init_extra_frame_info): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.h (arm_float_model): Add AUTO and LAST values. + (arm_get_fp_model): Declare. + * arm-tdep.c (fp_model_strings): New string array. + (arm_fp_model, current_fp_model): New variables. + (arm_get_fp_model): New function. + (arm_set_fp): New function. + (set_fp_model_sfunc): New function. + (show_fp_model): New function. + (_initialize_arm_tdep): Add new command to set/show the FPU. + (arm_extract_return_value): Use arm_get_fp_model. + (arm_store_return_value): Likewise. + (arm_gdbarch_init): Default fpa model is softfpa. Call arm_set_fp + to initialize the floating-point data types. + * arm-linux-tdep.c (arm_linux_init_abi): The default floating point + model is FPA. + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.c (show_arm_command): Don't print out help. Instead, show + the current setting of each value. + (_initialize_arm_tdep): Delete variable new_cmd and add new vars + new_set and new_show. Use add_setshow_cmd_full and + add_setshow_boolean_cmd as appropriate. Deprecate "set/show apcs32" + commands and add new version as subcommands of "set/show arm". + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.c (setarmcmdlist, showarmcmdlist): New command lists. + (set_arm_command, show_arm_command): New functions. + (_initialize_arm_tdep): Add them. + (num_disassembly_options): Renamed from num_flavor_options. + (valid_disassembly_styles): Renamed from valid_flavors. + (disassembly_style): Renamed from disassembly_flavor. + (set_disassembly_style_sfunc): Renamed from + set_disassembly_flavor_sfunc. + (set_disassembly_style): Renamed from set_disassembly_flavor. + (arm_othernames): Updated. + (_initialize_arm_tdep): Deprecate "set/show disassembly-flavor" + command. Add "set/show arm disassembly" commands. Deprecate + "othernames" command. + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * Makefile.in (elf_reloc_macros_h, elf_arm_h): Define. + (arm-tdep.o): Depend on elf_arm_h. + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * Makefile.in (coff_internal_h): Define. + (arm-tdep.o): Update dependencies. + +2003-03-22 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.c (prologue_cache): Delete. + (check_prologue_cache, save_prologue_cache): Delete. + (arm_scan_prologue): Don't check or update the prologue_cache. + (arm_gdb_arch_init): Don't initialize it. + (_initialize_arm_tdep): Likewise. + +2003-03-21 Stephane Carrez <stcarrez@nerim.fr> + + * MAINTAINERS (tui): Maintainer of tui code. + +2003-03-21 Corinna Vinschen <vinschen@redhat.com> + + * Makefile.in (ALLDEPFILES): Add i386-cygwin-tdep.c. + (i386-cygwin-tdep.o): Add dependencies. + * defs.h (enum gdb_osabi): Add GDB_OSABI_CYGWIN. + * i386-cygwin-tdep.c: New file. + * osabi.c (gdb_osabi_name): Add string for GDB_OSABI_CYGWIN. + * config/i386/cygwin.mt (TDEPFILES): Add i386-cygwin-tdep.o. + +2003-03-20 Andrew Cagney <cagney@redhat.com> + + * infrun.c (DYNAMIC_TRAMPOLINE_NEXTPC): Delete macro. + (handle_inferior_event): Remove code calling + DYNAMIC_TRAMPOLINE_NEXTPC. + + * Makefile.in (init.c): Don't add $(srcdir) prefix when a file + already has a full path. + + * main.c (gdb_main): Return 1. + (captured_main): Call error to report an invalid interpreter. + + * Makefile.in (alpha-osf1-tdep.o): Update dependencies. + * alpha-osf1-tdep.c: Include "gdb_string.h". + +2003-03-19 J. Brobecker <brobecker@gnat.com> + + Continuing work to convert the hppa targets to multiarch partial. + + * hppa-tdep.c (hppa_gdbarch_init): Set the push_dummy_frame gdbarch + method, now that hppa_push_dummy_frame has a conformant prototype. + * config/pa/tm-hppa.h (DEPRECATED_PUSH_DUMMY_FRAME): Wrap macro + inside "#if !GDB_MULTI_ARCH ... #endif" conditional, in preparation + for the switch to multiarch partial. + +2003-03-19 Kevin Buettner <kevinb@redhat.com> + + * mdebugread.c (parse_symbol): For stEnd, we're done counting + when iss is issNull. + +2003-03-18 Kevin Buettner <kevinb@redhat.com> + + * mips-tdep.c (mips_register_name): Fix fencepost error involving + NUM_REGS bounds check. + +2003-03-18 Kevin Buettner <kevinb@redhat.com> + + * Makefile.in (mips-tdep.o): Add dependency on $(gdb_assert_h). + * mips-tdep.c (gdb_assert.h): Include. + (mips_generic_reg_names, mips_processor_reg_names): Make static. + (mips_register_name): Handle integer registers explicitly. Add + bounds checking. + (mips_r3041_reg_names, mips_r3051_reg_names, mips_r3081_reg_names) + (mips_lsi33k_reg_names): Don't list integer registers; they're + handled by mips_register_name() now. + * config/mips/tm-irix3.h (MIPS_REGISTER_NAMES): Likewise. + * config/mips/tm-irix6.h (MIPS_REGISTER_NAMES): Likewise. + * config/mips/tm-mips.h (MIPS_REGISTER_NAMES): Likewise. + * config/mips/tm-tx39.h (MIPS_REGISTER_NAMES): Likewise. + * config/mips/tm-tx39l.h (MIPS_REGISTER_NAMES): Likewise. + +2003-03-18 Andrew Cagney <cagney@redhat.com> + + * printcmd.c (print_scalar_formatted): Change VALADDR parameter to + a void pointer. + * gdbtypes.h (print_scalar_formatted): Update declaration. + * expression.h (enum exp_opcode): Remove non-ISO C trailing comma. + +2003-03-18 J. Brobecker <brobecker@gnat.com> + + * infrun.c (observer.h): Add #include. + (normal_stop): Add call to observer_notify_normal_stop. + * Makefile.in (infrun.o): Add dependency on observer.h. + +2003-03-18 J. Brobecker <brobecker@gnat.com> + + Continuing work to convert the hppa targets to multiarch partial. + * hppa-tdep.c (hppa_push_dummy_frame): Remove unused function + parameter. Reformat comment. + * config/pa/tm-hppa.h (hppa_push_dummy_frame): Update profile. + (DEPRECATED_PUSH_DUMMY_FRAME): Update call to hppa_push_dummy_frame() + to match new profile. + +2003-03-18 J. Brobecker <brobecker@gnat.com> + + * hppa-tdep.c (hppa_push_dummy_frame): Remove hack which does not + appear to be working in any case. + +2003-03-18 J. Brobecker <brobecker@gnat.com> + + * observer.c (observer_test_first_observer): New static variable. + (observer_test_second_observer): Likewise. + (observer_test_third_observer): Likewise. + (observer_test_first_notification_function): New static function. + (observer_test_second_notification_function): Likewise. + (observer_test_third_notification_function): Likewise. + +2003-03-17 J. Brobecker <brobecker@gnat.com> + + * hppa-tdep.c (gdb_assert.h): Add missing #include. + * somsolib.c (gdb_assert.h): Likewise. + * Makefile.in (hppa-tdep.o): Add dependency on gdb_assert.h. + (somsolib.o): Likewise. + +2003-03-17 Andrew Cagney <cagney@redhat.com> + + * disasm.c (gdb_disassembly): Set di.mach using the architecture's + BFD. Simplify setting of di.endian. + +2003-03-17 Andrew Cagney <cagney@redhat.com> + + * rs6000-tdep.c (ppc_floating_point_unit_p): New function. + * ppc-tdep.h (ppc_floating_point_unit_p): Declare. + + From Elena Zannoni <ezannoni@redhat.com> + * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): Handle e500 + vector and floating-point parameters. + (ppc_sysv_abi_use_struct_convention): Handle e500 struct return + convention. + (ppc_sysv_abi_broken_use_struct_convention): Ditto. + +2003-03-17 Fernando Nasser <fnasser@redhat.com> + + * MAINTAINERS: Remove my name from several maintainership roles. + 2003-03-17 Andrew Cagney <cagney@redhat.com> Fix frame off-by-one bug. diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 00ac4c07268..0adfcb6ea28 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -63,7 +63,6 @@ maintainer works with the native maintainer when resolving API issues. arc Deleted. arm --target=arm-elf ,-Werror - Fernando Nasser fnasser@redhat.com Scott Bambrough scottb@netwinder.org Richard Earnshaw rearnsha@arm.com @@ -225,7 +224,6 @@ generic symtabs Jim Blandy jimb@redhat.com xcoff reader Any maintainer can modify this; please send tricky ones to Kevin Buettner <kevinb@redhat.com> linespec Elena Zannoni ezannoni@redhat.com - Fernando Nasser fnasser@redhat.com HP/UX readers Any [past] maintainer can modify this. Please send tricky ones to the symtabs maintainers. @@ -245,12 +243,13 @@ shared libs (devolved) Kevin Buettner kevinb@redhat.com remote.c Andrew Cagney cagney@redhat.com include/remote-sim.h, remote-sim.c Andrew Cagney cagney@redhat.com -sds protocol Fernando Nasser fnasser@redhat.com -rdi/adp protocol Fernando Nasser fnasser@redhat.com +sds protocol (vacant) +rdi/adp protocol (vacant) documentation Eli Zaretskii eliz@gnu.org -testsuite Fernando Nasser fnasser@redhat.com +testsuite (Global Maintainers) config Mark Salter msalter@redhat.com - lib Mark Salter msalter@redhat.com + lib Fernando Nasser fnasser@redhat.com + Mark Salter msalter@redhat.com gdbtk (gdb.gdbtk) Keith Seitz keiths@redhat.com c++ (gdb.c++) Michael Chastain mec@shout.net David Carlton carlton@math.stanford.edu @@ -266,7 +265,7 @@ Kernel Object Display Fernando Nasser fnasser@redhat.com UI: External (user) interfaces. -command interpreter Fernando Nasser fnasser@redhat.com +command interpreter (Global Maintainers) gdbtk (c & tcl) Jim Ingham jingham@apple.com Fernando Nasser fnasser@redhat.com Keith Seitz keiths@redhat.com @@ -275,8 +274,8 @@ libgui (w/foundry, sn) Jim Ingham jingham@apple.com mi (gdb/mi) Andrew Cagney cagney@redhat.com Elena Zannoni ezannoni@redhat.com Fernando Nasser fnasser@redhat.com -tui (vacant) - Technical Contact Point wdb@cup.hp.com +tui Stephane Carrez stcarrez@nerim.fr + (Global Maintainers) Misc: diff --git a/gdb/Makefile.in b/gdb/Makefile.in index a5d986e506e..d7666e48216 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -566,8 +566,11 @@ callback_h = $(INCLUDE_DIR)/gdb/callback.h coff_sym_h = $(INCLUDE_DIR)/coff/sym.h coff_symconst_h = $(INCLUDE_DIR)/coff/symconst.h coff_ecoff_h = $(INCLUDE_DIR)/coff/ecoff.h +coff_internal_h = $(INCLUDE_DIR)/coff/internal.h dis_asm_h = $(INCLUDE_DIR)/dis-asm.h +elf_reloc_macros_h = $(INCLUDE_DIR)/elf/reloc-macros.h elf_sh_h = $(INCLUDE_DIR)/elf/sh.h +elf_arm_h = $(INCLUDE_DIR)/elf/arm.h $(elf_reloc_macros_h) elf_bfd_h = $(BFD_SRC)/elf-bfd.h libaout_h = $(BFD_SRC)/libaout.h remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h @@ -871,6 +874,7 @@ YYFILES = c-exp.tab.c \ jv-exp.tab.c \ f-exp.tab.c m2-exp.tab.c p-exp.tab.c YYOBJ = c-exp.tab.o \ + objc-exp.tab.o \ jv-exp.tab.o \ f-exp.tab.o m2-exp.tab.o p-exp.tab.o @@ -966,6 +970,13 @@ uninstall: force $(CONFIG_UNINSTALL) # everything else. The catch is that other modules still take the # address of these builtin types forcing them to be variables, sigh! +# NOTE: cagney/2003-03-18: The sed pattern ``s|^\([^ /]...'' is +# anchored on the first column and excludes the ``/'' character so +# that it doesn't add the $(srcdir) prefix to any file that already +# has an absolute path. It turns out that $(DEC)'s True64 make +# automatically adds the $(srcdir) prefixes when it encounters files +# in sub-directories such as cli/ and mi/. + INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_OBS) $(CONFIG_INITS) init.c: $(INIT_FILES) @echo Making init.c @@ -985,7 +996,7 @@ init.c: $(INIT_FILES) -e '/[a-z0-9A-Z_]*-exp.tab.o/d' \ -e 's/\.o/.c/' \ -e 's,signals\.c,signals/signals\.c,' \ - -e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \ + -e 's|^\([^ /][^ ]*\)|$(srcdir)/\1|g' | \ while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \ sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' | \ ( echo _initialize_gdbtypes ; grep -v '^_initialize_gdbtypes$$' ) > init.l-tmp @@ -1344,7 +1355,7 @@ ALLDEPFILES = \ hppa-tdep.c hppa-hpux-tdep.c \ hppab-nat.c hppah-nat.c hpread.c \ i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \ - i386v4-nat.c i386ly-tdep.c \ + i386v4-nat.c i386ly-tdep.c i386-cygwin-tdep.c \ i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \ i387-tdep.c \ i386-linux-tdep.c i386-nat.c \ @@ -1490,7 +1501,7 @@ alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ alpha-nat.o: alpha-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ $(regcache_h) $(alpha_tdep_h) $(gregset_h) $(gdb_string_h) alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ - $(value_h) $(alpha_tdep_h) $(osabi_h) + $(value_h) $(osabi_h) $(gdb_string_h) $(alpha_tdep_h) alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) $(symfile_h) \ $(objfiles_h) $(gdb_string_h) $(linespec_h) $(regcache_h) \ @@ -1520,9 +1531,9 @@ arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ $(osabi_h) arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ - $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) \ - $(arm_tdep_h) $(gdb_sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ - $(elf_arm_h) $(gdb_assert_h) $(bfd_in2_h) $(libcoff_h) $(osabi_h) + $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) $(osabi_h) \ + $(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ + $(elf_arm_h) $(gdb_assert_h) armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ $(regcache_h) $(gdbcore_h) armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(arm_tdep_h) $(nbsd_tdep_h) \ @@ -1735,7 +1746,7 @@ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ $(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \ $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \ - $(symfile_h) $(objfiles_h) $(language_h) $(osabi_h) + $(symfile_h) $(objfiles_h) $(language_h) $(osabi_h) $(gdb_assert_h) hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ $(osabi_h) hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) @@ -1778,6 +1789,8 @@ i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(i386_tdep_h) $(osabi_h) i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(regcache_h) $(target_h) $(i386_tdep_h) $(osabi_h) +i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(gdb_string_h) \ + $(i386_tdep_h) $(osabi_h) i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \ $(regcache_h) $(arch_utils_h) $(i386_tdep_h) $(i387_tdep_h) \ $(nbsd_tdep_h) $(solib_svr4_h) $(osabi_h) @@ -1817,7 +1830,8 @@ infptrace.o: infptrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \ $(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \ $(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \ - $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) + $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \ + $(observer_h) $(language_h) inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ @@ -1928,10 +1942,11 @@ mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ $(solib_svr4_h) $(osabi_h) $(gdb_string_h) $(mips_tdep_h) \ $(gdb_assert_h) mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) -mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ - $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ - $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ - $(regcache_h) $(osabi_h) $(mips_tdep_h) $(block_h) $(opcode_mips_h) \ +mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(gdb_assert_h) \ + $(frame_h) $(inferior_h) $(symtab_h) $(value_h) $(gdbcmd_h) \ + $(language_h) $(gdbcore_h) $(symfile_h) $(objfiles_h) \ + $(gdbtypes_h) $(target_h) $(arch_utils_h) $(regcache_h) \ + $(osabi_h) $(mips_tdep_h) $(block_h) $(opcode_mips_h) \ $(elf_mips_h) $(elf_bfd_h) $(symcat_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ @@ -2175,7 +2190,7 @@ somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \ $(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \ $(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \ - $(regcache_h) + $(regcache_h) $(gdb_assert_h) source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \ $(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \ $(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index bf0e6dfb941..bcb280582de 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8080,6 +8080,7 @@ const struct language_defn ada_language_defn = { ada_print_type, /* Print a type using appropriate syntax */ ada_val_print, /* Print a value using appropriate syntax */ ada_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ #if 0 {"8#%lo#", "8#", "o", "#"}, /* Octal format info */ diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index fa5bc5e41d0..4eaa3c4013c 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -23,6 +23,7 @@ #include "gdbcore.h" #include "value.h" #include "osabi.h" +#include "gdb_string.h" #include "alpha-tdep.h" diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 57cd8936e99..a6449e1e834 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -54,7 +54,6 @@ static gdbarch_register_convertible_ftype alpha_register_convertible; static gdbarch_register_convert_to_virtual_ftype alpha_register_convert_to_virtual; static gdbarch_register_convert_to_raw_ftype alpha_register_convert_to_raw; -static gdbarch_store_struct_return_ftype alpha_store_struct_return; static gdbarch_deprecated_extract_return_value_ftype alpha_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype alpha_extract_struct_value_address; @@ -67,7 +66,6 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address; static gdbarch_skip_prologue_ftype alpha_skip_prologue; static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call; -static gdbarch_frame_chain_ftype alpha_frame_chain; static gdbarch_push_arguments_ftype alpha_push_arguments; static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy; @@ -1839,7 +1837,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_saved_pc_after_call (gdbarch, alpha_saved_pc_after_call); - set_gdbarch_frame_chain (gdbarch, alpha_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, alpha_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, alpha_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs); @@ -1847,7 +1845,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, alpha_extract_return_value); - set_gdbarch_store_struct_return (gdbarch, alpha_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, alpha_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, alpha_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address); @@ -1877,7 +1875,6 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 1ebe600191f..01b45f13f89 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -525,6 +525,8 @@ arm_linux_init_abi (struct gdbarch_info info, tdep->arm_breakpoint = arm_linux_arm_le_breakpoint; tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint); + tdep->fp_model = ARM_FLOAT_FPA; + tdep->jb_pc = ARM_LINUX_JB_PC; tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index e1d19c89c68..dbe14836d96 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -28,7 +28,7 @@ #include "gdbcore.h" #include "symfile.h" #include "gdb_string.h" -#include "dis-asm.h" /* For register flavors. */ +#include "dis-asm.h" /* For register styles. */ #include "regcache.h" #include "doublest.h" #include "value.h" @@ -99,8 +99,27 @@ static int arm_debug; #define MSYMBOL_SIZE(msym) \ ((long) MSYMBOL_INFO (msym) & 0x7fffffff) +/* The list of available "set arm ..." and "show arm ..." commands. */ +static struct cmd_list_element *setarmcmdlist = NULL; +static struct cmd_list_element *showarmcmdlist = NULL; + +/* The type of floating-point to use. Keep this in sync with enum + arm_float_model, and the help string in _initialize_arm_tdep. */ +static const char *fp_model_strings[] = +{ + "auto", + "softfpa", + "fpa", + "softvfp", + "vfp" +}; + +/* A variable that can be configured by the user. */ +static enum arm_float_model arm_fp_model = ARM_FLOAT_AUTO; +static const char *current_fp_model = "auto"; + /* Number of different reg name sets (options). */ -static int num_flavor_options; +static int num_disassembly_options; /* We have more registers than the disassembler as gdb can print the value of special registers as well. @@ -118,19 +137,19 @@ static char * arm_register_name_strings[] = "fps", "cpsr" }; /* 24 25 */ static char **arm_register_names = arm_register_name_strings; -/* Valid register name flavors. */ -static const char **valid_flavors; +/* Valid register name styles. */ +static const char **valid_disassembly_styles; -/* Disassembly flavor to use. Default to "std" register names. */ -static const char *disassembly_flavor; +/* Disassembly style to use. Default to "std" register names. */ +static const char *disassembly_style; /* Index to that option in the opcodes table. */ static int current_option; /* This is used to keep the bfd arch_info in sync with the disassembly - flavor. */ -static void set_disassembly_flavor_sfunc(char *, int, + style. */ +static void set_disassembly_style_sfunc(char *, int, struct cmd_list_element *); -static void set_disassembly_flavor (void); +static void set_disassembly_style (void); static void convert_from_extended (const struct floatformat *, const void *, void *); @@ -642,60 +661,6 @@ thumb_scan_prologue (struct frame_info *fi) } } -/* Check if prologue for this frame's PC has already been scanned. If - it has, copy the relevant information about that prologue and - return non-zero. Otherwise do not copy anything and return zero. - - The information saved in the cache includes: - * the frame register number; - * the size of the stack frame; - * the offsets of saved regs (relative to the old SP); and - * the offset from the stack pointer to the frame pointer - - The cache contains only one entry, since this is adequate for the - typical sequence of prologue scan requests we get. When performing - a backtrace, GDB will usually ask to scan the same function twice - in a row (once to get the frame chain, and once to fill in the - extra frame information). */ - -static struct frame_info *prologue_cache; - -static int -check_prologue_cache (struct frame_info *fi) -{ - int i; - - if (get_frame_pc (fi) == get_frame_pc (prologue_cache)) - { - get_frame_extra_info (fi)->framereg = get_frame_extra_info (prologue_cache)->framereg; - get_frame_extra_info (fi)->framesize = get_frame_extra_info (prologue_cache)->framesize; - get_frame_extra_info (fi)->frameoffset = get_frame_extra_info (prologue_cache)->frameoffset; - for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) - get_frame_saved_regs (fi)[i] = get_frame_saved_regs (prologue_cache)[i]; - return 1; - } - else - return 0; -} - - -/* Copy the prologue information from fi to the prologue cache. */ - -static void -save_prologue_cache (struct frame_info *fi) -{ - int i; - - deprecated_update_frame_pc_hack (prologue_cache, get_frame_pc (fi)); - get_frame_extra_info (prologue_cache)->framereg = get_frame_extra_info (fi)->framereg; - get_frame_extra_info (prologue_cache)->framesize = get_frame_extra_info (fi)->framesize; - get_frame_extra_info (prologue_cache)->frameoffset = get_frame_extra_info (fi)->frameoffset; - - for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) - get_frame_saved_regs (prologue_cache)[i] = get_frame_saved_regs (fi)[i]; -} - - /* This function decodes an ARM function prologue to determine: 1) the size of the stack frame 2) which registers are saved on it @@ -770,10 +735,6 @@ arm_scan_prologue (struct frame_info *fi) LONGEST return_value; CORE_ADDR prologue_start, prologue_end, current_pc; - /* Check if this function is already in the cache of frame information. */ - if (check_prologue_cache (fi)) - return; - /* Assume there is no frame until proven otherwise. */ get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM; get_frame_extra_info (fi)->framesize = 0; @@ -783,7 +744,6 @@ arm_scan_prologue (struct frame_info *fi) if (arm_pc_is_thumb (get_frame_pc (fi))) { thumb_scan_prologue (fi); - save_prologue_cache (fi); return; } @@ -975,8 +935,6 @@ arm_scan_prologue (struct frame_info *fi) get_frame_extra_info (fi)->frameoffset = fp_offset - sp_offset; else get_frame_extra_info (fi)->frameoffset = 0; - - save_prologue_cache (fi); } /* Find REGNUM on the stack. Otherwise, it's in an active register. @@ -2227,9 +2185,7 @@ arm_extract_return_value (struct type *type, if (TYPE_CODE_FLT == TYPE_CODE (type)) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - switch (tdep->fp_model) + switch (arm_get_fp_model (current_gdbarch)) { case ARM_FLOAT_FPA: { @@ -2244,7 +2200,7 @@ arm_extract_return_value (struct type *type, } break; - case ARM_FLOAT_SOFT: + case ARM_FLOAT_SOFT_FPA: case ARM_FLOAT_SOFT_VFP: regcache_cooked_read (regs, ARM_A1_REGNUM, valbuf); if (TYPE_LENGTH (type) > 4) @@ -2422,10 +2378,9 @@ arm_store_return_value (struct type *type, struct regcache *regs, if (TYPE_CODE (type) == TYPE_CODE_FLT) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); char buf[ARM_MAX_REGISTER_RAW_SIZE]; - switch (tdep->fp_model) + switch (arm_get_fp_model (current_gdbarch)) { case ARM_FLOAT_FPA: @@ -2433,7 +2388,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, regcache_cooked_write (regs, ARM_F0_REGNUM, buf); break; - case ARM_FLOAT_SOFT: + case ARM_FLOAT_SOFT_FPA: case ARM_FLOAT_SOFT_VFP: regcache_cooked_write (regs, ARM_A1_REGNUM, valbuf); if (TYPE_LENGTH (type) > 4) @@ -2577,16 +2532,92 @@ arm_skip_stub (CORE_ADDR pc) return 0; /* not a stub */ } -/* If the user changes the register disassembly flavor used for info - register and other commands, we have to also switch the flavor used - in opcodes for disassembly output. This function is run in the set - disassembly_flavor command, and does that. */ +static void +set_arm_command (char *args, int from_tty) +{ + printf_unfiltered ("\"set arm\" must be followed by an apporpriate subcommand.\n"); + help_list (setarmcmdlist, "set arm ", all_commands, gdb_stdout); +} + +static void +show_arm_command (char *args, int from_tty) +{ + cmd_show_list (showarmcmdlist, from_tty, ""); +} + +enum arm_float_model +arm_get_fp_model (struct gdbarch *gdbarch) +{ + if (arm_fp_model == ARM_FLOAT_AUTO) + return gdbarch_tdep (gdbarch)->fp_model; + + return arm_fp_model; +} + +static void +arm_set_fp (struct gdbarch *gdbarch) +{ + enum arm_float_model fp_model = arm_get_fp_model (gdbarch); + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE + && (fp_model == ARM_FLOAT_SOFT_FPA || fp_model == ARM_FLOAT_FPA)) + { + set_gdbarch_double_format (gdbarch, + &floatformat_ieee_double_littlebyte_bigword); + set_gdbarch_long_double_format + (gdbarch, &floatformat_ieee_double_littlebyte_bigword); + } + else + { + set_gdbarch_double_format (gdbarch, &floatformat_ieee_double_little); + set_gdbarch_long_double_format (gdbarch, + &floatformat_ieee_double_little); + } +} + +static void +set_fp_model_sfunc (char *args, int from_tty, + struct cmd_list_element *c) +{ + enum arm_float_model fp_model; + + for (fp_model = ARM_FLOAT_AUTO; fp_model != ARM_FLOAT_LAST; fp_model++) + if (strcmp (current_fp_model, fp_model_strings[fp_model]) == 0) + { + arm_fp_model = fp_model; + break; + } + + if (fp_model == ARM_FLOAT_LAST) + internal_error (__FILE__, __LINE__, "Invalid fp model accepted: %s.", + current_fp_model); + + if (gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_arm) + arm_set_fp (current_gdbarch); +} + +static void +show_fp_model (char *args, int from_tty, + struct cmd_list_element *c) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + if (arm_fp_model == ARM_FLOAT_AUTO + && gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_arm) + printf_filtered (" - the default for the current ABI is \"%s\".\n", + fp_model_strings[tdep->fp_model]); +} + +/* If the user changes the register disassembly style used for info + register and other commands, we have to also switch the style used + in opcodes for disassembly output. This function is run in the "set + arm disassembly" command, and does that. */ static void -set_disassembly_flavor_sfunc (char *args, int from_tty, +set_disassembly_style_sfunc (char *args, int from_tty, struct cmd_list_element *c) { - set_disassembly_flavor (); + set_disassembly_style (); } /* Return the ARM register name corresponding to register I. */ @@ -2597,16 +2628,16 @@ arm_register_name (int i) } static void -set_disassembly_flavor (void) +set_disassembly_style (void) { const char *setname, *setdesc, **regnames; int numregs, j; - /* Find the flavor that the user wants in the opcodes table. */ + /* Find the style that the user wants in the opcodes table. */ int current = 0; numregs = get_arm_regnames (current, &setname, &setdesc, ®names); - while ((disassembly_flavor != setname) - && (current < num_flavor_options)) + while ((disassembly_style != setname) + && (current < num_disassembly_options)) get_arm_regnames (++current, &setname, &setdesc, ®names); current_option = current; @@ -2630,19 +2661,17 @@ set_disassembly_flavor (void) set_arm_regname_option (current); } -/* arm_othernames implements the "othernames" command. This is kind - of hacky, and I prefer the set-show disassembly-flavor which is - also used for the x86 gdb. I will keep this around, however, in - case anyone is actually using it. */ +/* arm_othernames implements the "othernames" command. This is deprecated + by the "set arm disassembly" command. */ static void arm_othernames (char *names, int n) { /* Circle through the various flavors. */ - current_option = (current_option + 1) % num_flavor_options; + current_option = (current_option + 1) % num_disassembly_options; - disassembly_flavor = valid_flavors[current_option]; - set_disassembly_flavor (); + disassembly_style = valid_disassembly_styles[current_option]; + set_disassembly_style (); } /* Fetch, and possibly build, an appropriate link_map_offsets structure @@ -2850,8 +2879,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) ready to unwind the PC first (see frame.c:get_prev_frame()). */ set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); - /* This is the way it has always defaulted. */ - tdep->fp_model = ARM_FLOAT_FPA; + /* We used to default to FPA for generic ARM, but almost nobody uses that + now, and we now provide a way for the user to force the model. So + default to the most useful variant. */ + tdep->fp_model = ARM_FLOAT_SOFT_FPA; /* Breakpoints. */ switch (info.byte_order) @@ -2888,7 +2919,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); @@ -2903,10 +2933,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_arguments (gdbarch, arm_push_arguments); /* Frame handling. */ - set_gdbarch_frame_chain_valid (gdbarch, arm_frame_chain_valid); + set_gdbarch_deprecated_frame_chain_valid (gdbarch, arm_frame_chain_valid); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, arm_init_extra_frame_info); set_gdbarch_read_fp (gdbarch, arm_read_fp); - set_gdbarch_frame_chain (gdbarch, arm_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, arm_frame_chain); set_gdbarch_frameless_function_invocation (gdbarch, arm_frameless_function_invocation); set_gdbarch_deprecated_frame_saved_pc (gdbarch, arm_frame_saved_pc); @@ -2964,7 +2994,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Returning results. */ set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value); set_gdbarch_store_return_value (gdbarch, arm_store_return_value); - set_gdbarch_store_struct_return (gdbarch, arm_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, arm_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention); set_gdbarch_extract_struct_value_address (gdbarch, arm_extract_struct_value_address); @@ -2973,6 +3003,9 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* XXX For an RDI target we should ask the target if it can single-step. */ set_gdbarch_software_single_step (gdbarch, arm_software_single_step); + /* Disassembly. */ + set_gdbarch_print_insn (gdbarch, gdb_print_insn_arm); + /* Minsymbol frobbing. */ set_gdbarch_elf_make_msymbol_special (gdbarch, arm_elf_make_msymbol_special); set_gdbarch_coff_make_msymbol_special (gdbarch, @@ -2999,20 +3032,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case BFD_ENDIAN_LITTLE: set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_little); - if (tdep->fp_model == ARM_FLOAT_VFP - || tdep->fp_model == ARM_FLOAT_SOFT_VFP) - { - set_gdbarch_double_format (gdbarch, &floatformat_ieee_double_little); - set_gdbarch_long_double_format (gdbarch, - &floatformat_ieee_double_little); - } - else - { - set_gdbarch_double_format - (gdbarch, &floatformat_ieee_double_littlebyte_bigword); - set_gdbarch_long_double_format - (gdbarch, &floatformat_ieee_double_littlebyte_bigword); - } + arm_set_fp (gdbarch); break; default: @@ -3020,22 +3040,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) "arm_gdbarch_init: bad byte order for float format"); } - /* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still - references the old architecture vector, not the one we are - building here. */ - if (get_frame_saved_regs (prologue_cache) != NULL) - xfree (get_frame_saved_regs (prologue_cache)); - - /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still - references the old architecture vector, not the one we are - building here. */ - { - CORE_ADDR *saved_regs = xcalloc (1, (sizeof (CORE_ADDR) - * (gdbarch_num_regs (gdbarch) - + gdbarch_num_pseudo_regs (gdbarch)))); - deprecated_set_frame_saved_regs_hack (prologue_cache, saved_regs); - } - return gdbarch; } @@ -3077,7 +3081,7 @@ _initialize_arm_tdep (void) { struct ui_file *stb; long length; - struct cmd_list_element *new_cmd; + struct cmd_list_element *new_set, *new_show; const char *setname; const char *setdesc; const char **regnames; @@ -3100,31 +3104,39 @@ _initialize_arm_tdep (void) gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_APCS, arm_init_abi_apcs); - tm_print_insn = gdb_print_insn_arm; - /* Get the number of possible sets of register names defined in opcodes. */ - num_flavor_options = get_arm_regname_num_options (); + num_disassembly_options = get_arm_regname_num_options (); + + /* Add root prefix command for all "set arm"/"show arm" commands. */ + add_prefix_cmd ("arm", no_class, set_arm_command, + "Various ARM-specific commands.", + &setarmcmdlist, "set arm ", 0, &setlist); + + add_prefix_cmd ("arm", no_class, show_arm_command, + "Various ARM-specific commands.", + &showarmcmdlist, "show arm ", 0, &showlist); /* Sync the opcode insn printer with our register viewer. */ parse_arm_disassembler_option ("reg-names-std"); /* Begin creating the help text. */ stb = mem_fileopen (); - fprintf_unfiltered (stb, "Set the disassembly flavor.\n\ -The valid values are:\n"); + fprintf_unfiltered (stb, "Set the disassembly style.\n" + "The valid values are:\n"); /* Initialize the array that will be passed to add_set_enum_cmd(). */ - valid_flavors = xmalloc ((num_flavor_options + 1) * sizeof (char *)); - for (i = 0; i < num_flavor_options; i++) + valid_disassembly_styles + = xmalloc ((num_disassembly_options + 1) * sizeof (char *)); + for (i = 0; i < num_disassembly_options; i++) { numregs = get_arm_regnames (i, &setname, &setdesc, ®names); - valid_flavors[i] = setname; + valid_disassembly_styles[i] = setname; fprintf_unfiltered (stb, "%s - %s\n", setname, setdesc); /* Copy the default names (if found) and synchronize disassembler. */ if (!strcmp (setname, "std")) { - disassembly_flavor = setname; + disassembly_style = setname; current_option = i; for (j = 0; j < numregs; j++) arm_register_names[j] = (char *) regnames[j]; @@ -3132,40 +3144,73 @@ The valid values are:\n"); } } /* Mark the end of valid options. */ - valid_flavors[num_flavor_options] = NULL; + valid_disassembly_styles[num_disassembly_options] = NULL; /* Finish the creation of the help text. */ fprintf_unfiltered (stb, "The default is \"std\"."); helptext = ui_file_xstrdup (stb, &length); ui_file_delete (stb); - /* Add the disassembly-flavor command. */ - new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class, - valid_flavors, - &disassembly_flavor, + /* Add the deprecated disassembly-flavor command. */ + new_set = add_set_enum_cmd ("disassembly-flavor", no_class, + valid_disassembly_styles, + &disassembly_style, helptext, &setlist); - set_cmd_sfunc (new_cmd, set_disassembly_flavor_sfunc); - add_show_from_set (new_cmd, &showlist); - - /* ??? Maybe this should be a boolean. */ - add_show_from_set (add_set_cmd ("apcs32", no_class, - var_zinteger, (char *) &arm_apcs_32, - "Set usage of ARM 32-bit mode.\n", &setlist), - &showlist); + set_cmd_sfunc (new_set, set_disassembly_style_sfunc); + deprecate_cmd (new_set, "set arm disassembly"); + deprecate_cmd (add_show_from_set (new_set, &showlist), + "show arm disassembly"); + + /* And now add the new interface. */ + new_set = add_set_enum_cmd ("disassembler", no_class, + valid_disassembly_styles, &disassembly_style, + helptext, &setarmcmdlist); + + set_cmd_sfunc (new_set, set_disassembly_style_sfunc); + add_show_from_set (new_set, &showarmcmdlist); + + add_setshow_cmd_full ("apcs32", no_class, + var_boolean, (char *) &arm_apcs_32, + "Set usage of ARM 32-bit mode.", + "Show usage of ARM 32-bit mode.", + NULL, NULL, + &setlist, &showlist, &new_set, &new_show); + deprecate_cmd (new_set, "set arm apcs32"); + deprecate_cmd (new_show, "show arm apcs32"); + + add_setshow_boolean_cmd ("apcs32", no_class, &arm_apcs_32, + "Set usage of ARM 32-bit mode. " + "When off, a 26-bit PC will be used.", + "Show usage of ARM 32-bit mode. " + "When off, a 26-bit PC will be used.", + NULL, NULL, + &setarmcmdlist, &showarmcmdlist); + + /* Add a command to allow the user to force the FPU model. */ + new_set = add_set_enum_cmd + ("fpu", no_class, fp_model_strings, ¤t_fp_model, + "Set the floating point type.\n" + "auto - Determine the FP typefrom the OS-ABI.\n" + "softfpa - Software FP, mixed-endian doubles on little-endian ARMs.\n" + "fpa - FPA co-processor (GCC compiled).\n" + "softvfp - Software FP with pure-endian doubles.\n" + "vfp - VFP co-processor.", + &setarmcmdlist); + set_cmd_sfunc (new_set, set_fp_model_sfunc); + set_cmd_sfunc (add_show_from_set (new_set, &showarmcmdlist), show_fp_model); /* Add the deprecated "othernames" command. */ - - add_com ("othernames", class_obscure, arm_othernames, - "Switch to the next set of register names."); - - /* Allocate the prologue_cache. */ - prologue_cache = deprecated_frame_xmalloc (); - deprecated_set_frame_extra_info_hack (prologue_cache, xcalloc (1, sizeof (struct frame_extra_info))); + deprecate_cmd (add_com ("othernames", class_obscure, arm_othernames, + "Switch to the next set of register names."), + "set arm disassembly"); /* Debugging flag. */ - add_show_from_set (add_set_cmd ("arm", class_maintenance, var_zinteger, - &arm_debug, "Set arm debugging.\n\ -When non-zero, arm specific debugging is enabled.", &setdebuglist), - &showdebuglist); + add_setshow_boolean_cmd ("arm", class_maintenance, &arm_debug, + "Set ARM debugging. " + "When on, arm-specific debugging is enabled.", + "Show ARM debugging. " + "When on, arm-specific debugging is enabled.", + NULL, NULL, + &setdebuglist, &showdebuglist); } diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index b8c4711838e..26f3a83a973 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -109,16 +109,24 @@ enum gdb_regnum { only generate 2 of those. The third is APCS_FLOAT, where arguments to functions are passed in floating-point registers. - In addition to the traditional models, VFP adds two more. */ + In addition to the traditional models, VFP adds two more. + + If you update this enum, don't forget to update fp_model_strings in + arm-tdep.c. */ enum arm_float_model { - ARM_FLOAT_SOFT, - ARM_FLOAT_FPA, - ARM_FLOAT_SOFT_VFP, - ARM_FLOAT_VFP + ARM_FLOAT_AUTO, /* Automatic detection. Do not set in tdep. */ + ARM_FLOAT_SOFT_FPA, /* Traditional soft-float (mixed-endian on LE ARM). */ + ARM_FLOAT_FPA, /* FPA co-processor. GCC calling convention. */ + ARM_FLOAT_SOFT_VFP, /* Soft-float with pure-endian doubles. */ + ARM_FLOAT_VFP, /* Full VFP calling convention. */ + ARM_FLOAT_LAST /* Keep at end. */ }; +/* A method to the setting based on user's choice and ABI setting. */ +enum arm_float_model arm_get_fp_model (struct gdbarch *); + /* Target-dependent structure in gdbarch. */ struct gdbarch_tdep { diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c index d12fda044ac..88cf2e52797 100644 --- a/gdb/armnbsd-tdep.c +++ b/gdb/armnbsd-tdep.c @@ -66,7 +66,7 @@ arm_netbsd_aout_init_abi (struct gdbarch_info info, set_gdbarch_in_solib_call_trampoline (gdbarch, arm_netbsd_aout_in_solib_call_trampoline); - tdep->fp_model = ARM_FLOAT_SOFT; + tdep->fp_model = ARM_FLOAT_SOFT_FPA; } static void diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 75707fef9f5..73588375883 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1174,7 +1174,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); /* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */ @@ -1186,7 +1185,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_pop_frame (gdbarch, avr_pop_frame); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); - set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, avr_store_struct_return); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, avr_scan_prologue); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, avr_init_extra_frame_info); @@ -1200,7 +1199,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) avr_remote_translate_xfer_address); set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); /* ??? */ - set_gdbarch_frame_chain (gdbarch, avr_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, avr_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, avr_frame_saved_pc); set_gdbarch_frame_args_address (gdbarch, avr_frame_address); set_gdbarch_frame_locals_address (gdbarch, avr_frame_address); diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 4096ab5429c..364be9e0ef1 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -44,11 +44,11 @@ void _initialize_blockframe (void); -/* Is ADDR inside the startup file? Note that if your machine - has a way to detect the bottom of the stack, there is no need - to call this function from FRAME_CHAIN_VALID; the reason for - doing so is that some machines have no way of detecting bottom - of stack. +/* Is ADDR inside the startup file? Note that if your machine has a + way to detect the bottom of the stack, there is no need to call + this function from DEPRECATED_FRAME_CHAIN_VALID; the reason for + doing so is that some machines have no way of detecting bottom of + stack. A PC of zero is always considered to be the bottom of the stack. */ @@ -75,7 +75,7 @@ inside_entry_file (CORE_ADDR addr) that correspond to the main() function. See comments above for why we might want to do this. - Typically called from FRAME_CHAIN_VALID. + Typically called from DEPRECATED_FRAME_CHAIN_VALID. A PC of zero is always considered to be the bottom of the stack. */ @@ -87,9 +87,10 @@ inside_main_func (CORE_ADDR pc) if (symfile_objfile == 0) return 0; - /* If the addr range is not set up at symbol reading time, set it up now. - This is for FRAME_CHAIN_VALID_ALTERNATE. I do this for coff, because - it is unable to set it up and symbol reading time. */ + /* If the addr range is not set up at symbol reading time, set it up + now. This is for DEPRECATED_FRAME_CHAIN_VALID_ALTERNATE. I do + this for coff, because it is unable to set it up and symbol + reading time. */ if (symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC && symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC) @@ -113,7 +114,7 @@ inside_main_func (CORE_ADDR pc) that correspond to the process entry point function. See comments in objfiles.h for why we might want to do this. - Typically called from FRAME_CHAIN_VALID. + Typically called from DEPRECATED_FRAME_CHAIN_VALID. A PC of zero is always considered to be the bottom of the stack. */ @@ -586,9 +587,10 @@ frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) if (inside_entry_file (frame_pc_unwind (fi))) return 0; - /* If the architecture has a custom FRAME_CHAIN_VALID, call it now. */ - if (FRAME_CHAIN_VALID_P ()) - return FRAME_CHAIN_VALID (fp, fi); + /* If the architecture has a custom DEPRECATED_FRAME_CHAIN_VALID, + call it now. */ + if (DEPRECATED_FRAME_CHAIN_VALID_P ()) + return DEPRECATED_FRAME_CHAIN_VALID (fp, fi); return 1; } diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 491766d67ea..443175d6f15 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -80,10 +80,6 @@ static void clear_command (char *, int); static void catch_command (char *, int); -static void handle_gnu_4_16_catch_command (char *, int, int); - -static struct symtabs_and_lines get_catch_sals (int); - static void watch_command (char *, int); static int can_use_hardware_watchpoint (struct value *); @@ -5706,187 +5702,6 @@ enable_catch_breakpoint (void) } #endif /* 0 */ -struct sal_chain -{ - struct sal_chain *next; - struct symtab_and_line sal; -}; - -#if 0 -/* Not really used -- invocation in handle_gnu_4_16_catch_command - had been commented out in the v.4.16 sources, and stays - disabled there now because "catch NAME" syntax isn't allowed. - pai/1997-07-11 */ -/* This isn't used; I don't know what it was for. */ -/* For each catch clause identified in ARGS, run FUNCTION - with that clause as an argument. */ -static struct symtabs_and_lines -map_catch_names (char *args, int (*function) ()) -{ - register char *p = args; - register char *p1; - struct symtabs_and_lines sals; -#if 0 - struct sal_chain *sal_chain = 0; -#endif - - if (p == 0) - error_no_arg ("one or more catch names"); - - sals.nelts = 0; - sals.sals = NULL; - - while (*p) - { - p1 = p; - /* Don't swallow conditional part. */ - if (p1[0] == 'i' && p1[1] == 'f' - && (p1[2] == ' ' || p1[2] == '\t')) - break; - - if (isalpha (*p1)) - { - p1++; - while (isalnum (*p1) || *p1 == '_' || *p1 == '$') - p1++; - } - - if (*p1 && *p1 != ' ' && *p1 != '\t') - error ("Arguments must be catch names."); - - *p1 = 0; -#if 0 - if (function (p)) - { - struct sal_chain *next = (struct sal_chain *) - alloca (sizeof (struct sal_chain)); - next->next = sal_chain; - next->sal = get_catch_sal (p); - sal_chain = next; - goto win; - } -#endif - printf_unfiltered ("No catch clause for exception %s.\n", p); -#if 0 - win: -#endif - p = p1; - while (*p == ' ' || *p == '\t') - p++; - } -} -#endif - -/* This shares a lot of code with `print_frame_label_vars' from stack.c. */ - -static struct symtabs_and_lines -get_catch_sals (int this_level_only) -{ - register struct blockvector *bl; - register struct block *block; - int index, have_default = 0; - CORE_ADDR pc; - struct symtabs_and_lines sals; - struct sal_chain *sal_chain = 0; - char *blocks_searched; - - /* Not sure whether an error message is always the correct response, - but it's better than a core dump. */ - if (deprecated_selected_frame == NULL) - error ("No selected frame."); - block = get_frame_block (deprecated_selected_frame, 0); - pc = get_frame_pc (deprecated_selected_frame); - - sals.nelts = 0; - sals.sals = NULL; - - if (block == 0) - error ("No symbol table info available.\n"); - - bl = blockvector_for_pc (BLOCK_END (block) - 4, &index); - blocks_searched = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char)); - memset (blocks_searched, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char)); - - while (block != 0) - { - CORE_ADDR end = BLOCK_END (block) - 4; - int last_index; - - if (bl != blockvector_for_pc (end, &index)) - error ("blockvector blotch"); - if (BLOCKVECTOR_BLOCK (bl, index) != block) - error ("blockvector botch"); - last_index = BLOCKVECTOR_NBLOCKS (bl); - index += 1; - - /* Don't print out blocks that have gone by. */ - while (index < last_index - && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < pc) - index++; - - while (index < last_index - && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < end) - { - if (blocks_searched[index] == 0) - { - struct block *b = BLOCKVECTOR_BLOCK (bl, index); - register int i; - register struct symbol *sym; - - ALL_BLOCK_SYMBOLS (b, i, sym) - { - if (STREQ (DEPRECATED_SYMBOL_NAME (sym), "default")) - { - if (have_default) - continue; - have_default = 1; - } - if (SYMBOL_CLASS (sym) == LOC_LABEL) - { - struct sal_chain *next = (struct sal_chain *) - alloca (sizeof (struct sal_chain)); - next->next = sal_chain; - next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), - 0); - sal_chain = next; - } - } - blocks_searched[index] = 1; - } - index++; - } - if (have_default) - break; - if (sal_chain && this_level_only) - break; - - /* After handling the function's top-level block, stop. - Don't continue to its superblock, the block of - per-file symbols. */ - if (BLOCK_FUNCTION (block)) - break; - block = BLOCK_SUPERBLOCK (block); - } - - if (sal_chain) - { - struct sal_chain *tmp_chain; - - /* Count the number of entries. */ - for (index = 0, tmp_chain = sal_chain; tmp_chain; - tmp_chain = tmp_chain->next) - index++; - - sals.nelts = index; - sals.sals = (struct symtab_and_line *) - xmalloc (index * sizeof (struct symtab_and_line)); - for (index = 0; sal_chain; sal_chain = sal_chain->next, index++) - sals.sals[index] = sal_chain->sal; - } - - return sals; -} - static void ep_skip_leading_whitespace (char **s) { @@ -6224,23 +6039,8 @@ catch_exception_command_1 (enum exception_event_kind ex_event, char *arg, else return; /* something went wrong with setting up callbacks */ } - else - { - /* No callbacks from runtime system for exceptions. - Try GNU C++ exception breakpoints using labels in debug info. */ - if (ex_event == EX_EVENT_CATCH) - { - handle_gnu_4_16_catch_command (arg, tempflag, from_tty); - } - else if (ex_event == EX_EVENT_THROW) - { - /* Set a breakpoint on __raise_exception () */ - warning ("Unsupported with this platform/compiler combination."); - warning ("Perhaps you can achieve the effect you want by setting"); - warning ("a breakpoint on __raise_exception()."); - } - } + warning ("Unsupported with this platform/compiler combination."); } /* Cover routine to allow wrapping target_enable_exception_catchpoints @@ -6260,111 +6060,6 @@ cover_target_enable_exception_callback (void *arg) return 1; /*is valid */ } - - -/* This is the original v.4.16 and earlier version of the - catch_command_1() function. Now that other flavours of "catch" - have been introduced, and since exception handling can be handled - in other ways (through target ops) also, this is used only for the - GNU C++ exception handling system. - Note: Only the "catch" flavour of GDB 4.16 is handled here. The - "catch NAME" is now no longer allowed in catch_command_1(). Also, - there was no code in GDB 4.16 for "catch throw". - - Called from catch_exception_command_1 () */ - - -static void -handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty) -{ - /* First, translate ARG into something we can deal with in terms - of breakpoints. */ - - struct symtabs_and_lines sals; - struct symtab_and_line sal; - register struct expression *cond = 0; - register struct breakpoint *b; - char *save_arg; - int i; - - init_sal (&sal); /* initialize to zeroes */ - - /* If no arg given, or if first arg is 'if ', all active catch clauses - are breakpointed. */ - - if (!arg || (arg[0] == 'i' && arg[1] == 'f' - && (arg[2] == ' ' || arg[2] == '\t'))) - { - /* Grab all active catch clauses. */ - sals = get_catch_sals (0); - } - else - { - /* Grab selected catch clauses. */ - error ("catch NAME not implemented"); - -#if 0 - /* Not sure why this code has been disabled. I'm leaving - it disabled. We can never come here now anyway - since we don't allow the "catch NAME" syntax. - pai/1997-07-11 */ - - /* This isn't used; I don't know what it was for. */ - sals = map_catch_names (arg, catch_breakpoint); -#endif - } - - if (!sals.nelts) - return; - - save_arg = arg; - for (i = 0; i < sals.nelts; i++) - { - resolve_sal_pc (&sals.sals[i]); - - while (arg && *arg) - { - if (arg[0] == 'i' && arg[1] == 'f' - && (arg[2] == ' ' || arg[2] == '\t')) - cond = parse_exp_1 ((arg += 2, &arg), - block_for_pc (sals.sals[i].pc), 0); - else - error ("Junk at end of arguments."); - } - arg = save_arg; - } - - for (i = 0; i < sals.nelts; i++) - { - sal = sals.sals[i]; - - if (from_tty) - describe_other_breakpoints (sal.pc, sal.section); - - /* Important -- this is an ordinary breakpoint. For platforms - with callback support for exceptions, - create_exception_catchpoint() will create special bp types - (bp_catch_catch and bp_catch_throw), and there is code in - insert_breakpoints() and elsewhere that depends on that. */ - b = set_raw_breakpoint (sal, bp_breakpoint); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; - - b->cond = cond; - b->enable_state = bp_enabled; - b->disposition = tempflag ? disp_del : disp_donttouch; - - mention (b); - } - - if (sals.nelts > 1) - { - warning ("Multiple breakpoints were set."); - warning ("Use the \"delete\" command to delete unwanted breakpoints."); - } - xfree (sals.sals); -} - static void catch_command_1 (char *arg, int tempflag, int from_tty) { diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 4b4af164ec5..4890a2b933e 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -552,6 +552,7 @@ const struct language_defn c_language_defn = c_print_type, /* Print a type using appropriate syntax */ c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ @@ -604,6 +605,7 @@ const struct language_defn cplus_language_defn = c_print_type, /* Print a type using appropriate syntax */ c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ @@ -633,6 +635,7 @@ const struct language_defn asm_language_defn = c_print_type, /* Print a type using appropriate syntax */ c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/config/i386/cygwin.mt b/gdb/config/i386/cygwin.mt index 4dfc0c23721..6c16345e5cf 100644 --- a/gdb/config/i386/cygwin.mt +++ b/gdb/config/i386/cygwin.mt @@ -1,5 +1,5 @@ # Target: Intel 386 run win32 -TDEPFILES= i386-tdep.o i387-tdep.o +TDEPFILES= i386-tdep.o i386-cygwin-tdep.o i387-tdep.o TM_FILE= tm-cygwin.h diff --git a/gdb/config/m68k/tm-os68k.h b/gdb/config/m68k/tm-os68k.h index 295457090cf..815efff3b02 100644 --- a/gdb/config/m68k/tm-os68k.h +++ b/gdb/config/m68k/tm-os68k.h @@ -35,5 +35,5 @@ If our current frame pointer is zero, we're at the top; else read out the saved FP from memory pointed to by the current FP. */ -#undef FRAME_CHAIN -#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) +#undef DEPRECATED_FRAME_CHAIN +#define DEPRECATED_FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h index 253fd53ff5b..aafba6a9928 100644 --- a/gdb/config/m68k/tm-sun3.h +++ b/gdb/config/m68k/tm-sun3.h @@ -86,17 +86,18 @@ /* The code which tries to deal with this bug is never harmful on a sun3. */ #define SUN_FIXED_LBRAC_BUG (0) -/* On the sun3 the kernel pushes a sigcontext on the user stack and then - `calls' _sigtramp in user code. _sigtramp saves the floating point status - on the stack and calls the signal handler function. The stack does not - contain enough information to allow a normal backtrace, but sigcontext - contains the saved user pc/sp. FRAME_CHAIN and friends in tm-m68k.h and - m68k_find_saved_regs deal with this situation by manufacturing a fake frame - for _sigtramp. - SIG_PC_FP_OFFSET is the offset from the signal handler frame to the - saved pc in sigcontext. - SIG_SP_FP_OFFSET is the offset from the signal handler frame to the end - of sigcontext which is identical to the saved sp at SIG_PC_FP_OFFSET - 4. +/* On the sun3 the kernel pushes a sigcontext on the user stack and + then `calls' _sigtramp in user code. _sigtramp saves the floating + point status on the stack and calls the signal handler + function. The stack does not contain enough information to allow a + normal backtrace, but sigcontext contains the saved user + pc/sp. DEPRECATED_FRAME_CHAIN and friends in tm-m68k.h and + m68k_find_saved_regs deal with this situation by manufacturing a + fake frame for _sigtramp. SIG_PC_FP_OFFSET is the offset from the + signal handler frame to the saved pc in sigcontext. + SIG_SP_FP_OFFSET is the offset from the signal handler frame to the + end of sigcontext which is identical to the saved sp at + SIG_PC_FP_OFFSET - 4. Please note that it is impossible to correctly backtrace from a breakpoint in _sigtramp as _sigtramp modifies the stack pointer a few times. */ diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h index 76ac6fd7303..f7e8fca6f2b 100644 --- a/gdb/config/m68k/tm-vx68.h +++ b/gdb/config/m68k/tm-vx68.h @@ -39,8 +39,8 @@ If our current frame pointer is zero, we're at the top; else read out the saved FP from memory pointed to by the current FP. */ -#undef FRAME_CHAIN -#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) +#undef DEPRECATED_FRAME_CHAIN +#define DEPRECATED_FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) /* FIXME, Longjmp information stolen from Sun-3 config. Dunno if right. */ /* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h index 8875f79b0ad..03c66bd9fd0 100644 --- a/gdb/config/mips/tm-irix3.h +++ b/gdb/config/mips/tm-irix3.h @@ -33,15 +33,11 @@ #undef FCRCS_REGNUM #undef FCRIR_REGNUM -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ +/* Initializer for an array of names for registers 32 and above. + There should be NUM_REGS-32 strings in this initializer. */ #define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra", \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\ diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index 26813ba4fb9..59d3c584ded 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -34,15 +34,11 @@ #undef FCRCS_REGNUM #undef FCRIR_REGNUM -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ +/* Initializer for an array of names for registers 32 and above. + There should be NUM_REGS-32 strings in this initializer. */ #define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\ diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index e092d4a92cb..dada6155713 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -59,16 +59,12 @@ extern int mips_step_skips_delay (CORE_ADDR); #define MIPS_REGSIZE 4 #endif -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ +/* Initializer for an array of names for registers 32 and above. + There should be NUM_REGS-32 strings in this initializer. */ #ifndef MIPS_REGISTER_NAMES #define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ - "sr", "lo", "hi", "bad", "cause","pc", \ + { "sr", "lo", "hi", "bad", "cause","pc", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ diff --git a/gdb/config/mips/tm-tx39.h b/gdb/config/mips/tm-tx39.h index d6fbd29ad33..d095db0668f 100644 --- a/gdb/config/mips/tm-tx39.h +++ b/gdb/config/mips/tm-tx39.h @@ -21,11 +21,7 @@ #undef MIPS_REGISTER_NAMES #define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ - "sr", "lo", "hi", "bad", "cause","pc", \ + { "sr", "lo", "hi", "bad", "cause","pc", \ "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", \ diff --git a/gdb/config/mips/tm-tx39l.h b/gdb/config/mips/tm-tx39l.h index 0c6d32b85f1..81f3b6ddc41 100644 --- a/gdb/config/mips/tm-tx39l.h +++ b/gdb/config/mips/tm-tx39l.h @@ -21,11 +21,7 @@ #undef MIPS_REGISTER_NAMES #define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ - "sr", "lo", "hi", "bad", "cause","pc", \ + { "sr", "lo", "hi", "bad", "cause","pc", \ "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", \ diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 4b196dcd19a..64a4fe1362f 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -116,10 +116,6 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp); #define STACK_ALIGN(sp) hppa_stack_align (sp) #endif -#if !GDB_MULTI_ARCH -#define EXTRA_STACK_ALIGNMENT_NEEDED 0 -#endif - /* Sequence of bytes for breakpoint instruction. */ #define BREAKPOINT {0x00, 0x01, 0x00, 0x04} @@ -390,21 +386,21 @@ extern void hppa_init_extra_frame_info (int, struct frame_info *); /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ -/* FRAME_CHAIN takes a frame's nominal address and produces the - frame's chain-pointer. */ +/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces + the frame's chain-pointer. */ /* In the case of the PA-RISC, the frame's nominal address is the address of a 4-byte word containing the calling frame's address (previous FP). */ #if !GDB_MULTI_ARCH -#define FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe) +#define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe) extern CORE_ADDR hppa_frame_chain (struct frame_info *); #endif #if !GDB_MULTI_ARCH extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *); -#define FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe) +#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe) #endif /* Define other aspects of the stack frame. */ @@ -450,15 +446,10 @@ extern void hppa_frame_find_saved_regs (struct frame_info *, /* Things needed for making the inferior call functions. */ -/* Push an empty stack frame, to record the current PC, etc. */ - -/* FIXME: brobecker 2002-12-26. This macro definition takes advantage - of the fact that DEPRECATED_PUSH_DUMMY_FRAME is called within a - function where a variable inf_status of type struct inferior_status - * is defined. Ugh! Until this is fixed, we will not be able to - move to multiarch partial. */ -#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame (inf_status) -extern void hppa_push_dummy_frame (struct inferior_status *); +#if !GDB_MULTI_ARCH +#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame () +extern void hppa_push_dummy_frame (void); +#endif /* Discard from the stack the innermost frame, restoring all saved registers. */ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 691e38f4e1e..8abec1c709c 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -102,8 +102,8 @@ #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #undef DEPRECATED_PC_IN_CALL_DUMMY #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) -#undef CALL_DUMMY_STACK_ADJUST -#define CALL_DUMMY_STACK_ADJUST 128 +#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128 #undef SIZEOF_CALL_DUMMY_WORDS #define SIZEOF_CALL_DUMMY_WORDS 0 #undef CALL_DUMMY_ADDRESS @@ -143,8 +143,8 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); /* 128 is to reserve space to write the %i/%l registers that will be restored when we resume. */ -#undef CALL_DUMMY_STACK_ADJUST -#define CALL_DUMMY_STACK_ADJUST 128 +#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128 /* Size of the call dummy in bytes. */ #undef CALL_DUMMY_LENGTH diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 8ab7401bd82..7b11c4fbd58 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -392,8 +392,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR); #define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM) /* - * FRAME_CHAIN and FRAME_INFO definitions, collected here for convenience. - */ + * DEPRECATED_FRAME_CHAIN and FRAME_INFO definitions, collected here + * for convenience. */ #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) /* @@ -403,8 +403,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR); /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ -/* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. */ +/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces + the frame's chain-pointer. */ /* In the case of the Sun 4, the frame-chain's nominal address is held in the frame pointer register. @@ -472,7 +472,7 @@ void sparc_get_saved_register (char *raw_buffer, sparc_init_extra_frame_info (FROMLEAF, FCI) extern void sparc_init_extra_frame_info (int, struct frame_info *); -#define FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME)) +#define DEPRECATED_FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME)) extern CORE_ADDR sparc_frame_chain (struct frame_info *); /* A macro that tells us whether the function invocation represented @@ -649,7 +649,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); #define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30) -#define CALL_DUMMY_STACK_ADJUST 68 +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68 /* Call dummy method (eg. on stack, at entry point, etc.) */ @@ -756,3 +756,4 @@ extern int deferred_stores; #define TM_PRINT_INSN_MACH bfd_mach_sparc +#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED 1 diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index c71c12f17f3..8bf06466b7e 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -4276,7 +4276,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); /* No stack adjustment needed when peforming an inferior function call. */ - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); @@ -4287,7 +4286,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_return_address (gdbarch, cris_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame); - set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, cris_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention); @@ -4314,16 +4313,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frameless_function_invocation (gdbarch, cris_frameless_function_invocation); - set_gdbarch_frame_chain (gdbarch, cris_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, cris_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, cris_frame_saved_pc); set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - /* No extra stack alignment needed. Set to 1 by default. */ - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); - /* Helpful for backtracing and returning in a call dummy. */ set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index f443ceff8dd..d9c95c78d31 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -437,18 +437,6 @@ d10v_integer_to_address (struct type *type, void *buf) return val; } -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. - - We store structs through a pointer passed in the first Argument - register. */ - -static void -d10v_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -{ - write_register (ARG1_REGNUM, (addr)); -} - /* Write into appropriate registers a function return value of type TYPE, given in virtual format. @@ -1030,13 +1018,14 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, struct stack_item *si = NULL; long val; - /* If struct_return is true, then the struct return address will - consume one argument-passing register. No need to actually - write the value to the register -- that's done by - d10v_store_struct_return(). */ - + /* If STRUCT_RETURN is true, then the struct return address (in + STRUCT_ADDR) will consume the first argument-passing register. + Both adjust the register count and store that value. */ if (struct_return) - regnum++; + { + write_register (regnum, struct_addr); + regnum++; + } /* Fill in registers and arg lists */ for (i = 0; i < nargs; i++) @@ -1700,14 +1689,12 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_words (gdbarch, d10v_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (d10v_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value); set_gdbarch_push_arguments (gdbarch, d10v_push_arguments); set_gdbarch_push_return_address (gdbarch, d10v_push_return_address); - set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return); set_gdbarch_store_return_value (gdbarch, d10v_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention); @@ -1728,7 +1715,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_stack_align (gdbarch, d10v_stack_align); set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno); - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); set_gdbarch_print_registers_info (gdbarch, d10v_print_registers_info); diff --git a/gdb/defs.h b/gdb/defs.h index 1cd32c00e7f..636b515da52 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -1012,6 +1012,8 @@ enum gdb_osabi GDB_OSABI_ARM_APCS, GDB_OSABI_QNXNTO, + GDB_OSABI_CYGWIN, + GDB_OSABI_INVALID /* keep this last */ }; diff --git a/gdb/disasm.c b/gdb/disasm.c index 75d1783d13f..e9aabc88ac7 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -338,11 +338,8 @@ gdb_disassembly (struct ui_out *uiout, di_initialized = 1; } - di.mach = TARGET_PRINT_INSN_INFO->mach; - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - di.endian = BFD_ENDIAN_BIG; - else - di.endian = BFD_ENDIAN_LITTLE; + di.mach = gdbarch_bfd_arch_info (current_gdbarch)->mach; + di.endian = gdbarch_byte_order (current_gdbarch); /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to determine whether or not to do disassembly from target memory or from the diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 982322d4bb1..3aeadd3ba3c 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,29 @@ +2003-03-25 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + reference to CALL_DUMMY_STACK_ADJUST_P. Rename + CALL_DUMMY_STACK_ADJUST to DEPRECATED_CALL_DUMMY_STACK_ADJUST. + Add reference to PUSH_ARGUMENTS. + +2003-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Algorithms, Target Architecture Definition): + Deprecate FRAME_CHAIN and FRAME_CHAIN_VALID. + +2003-03-18 J. Brobecker <brobecker@gnat.com> + + * gdbint.texinfo (Algorithms): Add new section describing the + Observer paradigm. + (Top): Add menu entry to new observer appendix. + * observer.texi: New file. + * Makefile.in (GDBINT_DOC_SOURCE_INCLUDES): Add dependency on + new observer.texi file. + +2003-03-17 Andrew Cagney <cagney@redhat.com> + + * gdb.texinfo (DATE): Delete. Remove date from titles. Mention + that GNU Press update the manual version number. + 2003-03-12 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 1d5ad3e271c..db74889328c 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -114,7 +114,8 @@ GDB_DOC_FILES = \ # Internals Manual GDBINT_DOC_SOURCE_INCLUDES = \ - $(srcdir)/fdl.texi + $(srcdir)/fdl.texi \ + $(srcdir)/observer.texi GDBINT_DOC_BUILD_INCLUDES = \ gdb-cfg.texi \ GDBvn.texi diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 99de23b6a44..8c38e877353 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -28,11 +28,9 @@ @syncodeindex fn cp @c !!set GDB manual's edition---not the same as GDB version! +@c This is updated by GNU Press. @set EDITION Ninth -@c !!set GDB manual's revision date -@set DATE June 2002 - @c !!set GDB edit command default editor @set EDITOR /bin/ex @@ -49,9 +47,9 @@ This file documents the @sc{gnu} debugger @value{GDBN}. -This is the @value{EDITION} Edition, @value{DATE}, -of @cite{Debugging with @value{GDBN}: the @sc{gnu} Source-Level Debugger} -for @value{GDBN} Version @value{GDBVN}. +This is the @value{EDITION} Edition, of @cite{Debugging with +@value{GDBN}: the @sc{gnu} Source-Level Debugger} for @value{GDBN} +Version @value{GDBVN}. Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@* 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -74,7 +72,6 @@ development.'' @subtitle The @sc{gnu} Source-Level Debugger @sp 1 @subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN} -@subtitle @value{DATE} @author Richard Stallman, Roland Pesch, Stan Shebs, et al. @page @tex @@ -115,7 +112,7 @@ development.'' This file describes @value{GDBN}, the @sc{gnu} symbolic debugger. -This is the @value{EDITION} Edition, @value{DATE}, for @value{GDBN} Version +This is the @value{EDITION} Edition, for @value{GDBN} Version @value{GDBVN}. Copyright (C) 1988-2003 Free Software Foundation, Inc. diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 186d9e7308c..0522d726ade 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -94,6 +94,7 @@ as the mechanisms that adapt @value{GDBN} to specific hosts and targets. * Testsuite:: * Hints:: +* GDB Observers:: @value{GDBN} Currently available observers * GNU Free Documentation License:: The license for this documentation * Index:: @end menu @@ -252,9 +253,9 @@ if it is defined; that is where you should use the @code{FP_REGNUM} value, if your frames are nonstandard.) @cindex frame chain -Given a @value{GDBN} frame, define @code{FRAME_CHAIN} to determine the -address of the calling function's frame. This will be used to create a -new @value{GDBN} frame struct, and then +Given a @value{GDBN} frame, define @code{DEPRECATED_FRAME_CHAIN} to +determine the address of the calling function's frame. This will be +used to create a new @value{GDBN} frame struct, and then @code{DEPRECATED_INIT_EXTRA_FRAME_INFO} and @code{DEPRECATED_INIT_FRAME_PC} will be called for the new frame. @@ -696,6 +697,29 @@ watchpoints might interfere with the underlying OS and are probably unavailable in many platforms. @end enumerate +@section Observing changes in @value{GDBN} internals +@cindex observer pattern interface +@cindex notifications about changes in internals + +In order to function properly, several modules need to be notified when +some changes occur in the @value{GDBN} internals. Traditionally, these +modules have relied on several paradigms, the most common ones being +hooks and gdb-events. Unfortunately, none of these paradigms was +versatile enough to become the standard notification mechanism in +@value{GDBN}. The fact that they only supported one ``client'' was also +a strong limitation. + +A new paradigm, based on the Observer pattern of the @cite{Design +Patterns} book, has therefore been implemented. The goal was to provide +a new interface overcoming the issues with the notification mechanisms +previously available. This new interface needed to be strongly typed, +easy to extend, and versatile enough to be used as the standard +interface when adding new notifications. + +See @ref{GDB Observers} for a brief description of the observers +currently implemented in GDB. The rationale for the current +implementation is also briefly discussed. + @node User Interface @chapter User Interface @@ -3088,17 +3112,11 @@ A static initializer for @code{CALL_DUMMY_WORDS}. Deprecated. @findex CALL_DUMMY_LOCATION See the file @file{inferior.h}. -@item CALL_DUMMY_STACK_ADJUST -@findex CALL_DUMMY_STACK_ADJUST -Stack adjustment needed when performing an inferior function call. - -Should be deprecated in favor of something like @code{STACK_ALIGN}. - -@item CALL_DUMMY_STACK_ADJUST_P -@findex CALL_DUMMY_STACK_ADJUST_P -Predicate for use of @code{CALL_DUMMY_STACK_ADJUST}. - -Should be deprecated in favor of something like @code{STACK_ALIGN}. +@item DEPRECATED_CALL_DUMMY_STACK_ADJUST +@findex DEPRECATED_CALL_DUMMY_STACK_ADJUST +Stack adjustment needed when performing an inferior function call. This +function is no longer needed. @xref{PUSH_ARGUMENTS}, which can handle +all alignment directly. @item CANNOT_FETCH_REGISTER (@var{regno}) @findex CANNOT_FETCH_REGISTER @@ -3239,12 +3257,12 @@ By default, no frame based stack alignment is performed. @findex FRAME_ARGS_ADDRESS_CORRECT See @file{stack.c}. -@item FRAME_CHAIN(@var{frame}) -@findex FRAME_CHAIN +@item DEPRECATED_FRAME_CHAIN(@var{frame}) +@findex DEPRECATED_FRAME_CHAIN Given @var{frame}, return a pointer to the calling frame. -@item FRAME_CHAIN_VALID(@var{chain}, @var{thisframe}) -@findex FRAME_CHAIN_VALID +@item DEPRECATED_FRAME_CHAIN_VALID(@var{chain}, @var{thisframe}) +@findex DEPRECATED_FRAME_CHAIN_VALID Define this to be an expression that returns zero if the given frame is an outermost frame, with no caller, and nonzero otherwise. Most normal situations can be handled without defining this macro, including @code{NULL} @@ -3687,6 +3705,7 @@ method has been superseeded by generic code. @item PUSH_ARGUMENTS (@var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) @findex PUSH_ARGUMENTS +@anchor{PUSH_ARGUMENTS} Define this to push arguments onto the stack for inferior function call. Returns the updated stack pointer value. @@ -6595,6 +6614,7 @@ is so old that it has never been converted to use BFD. Now that's old! @end table +@include observer.texi @include fdl.texi @node Index diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi new file mode 100644 index 00000000000..a967f3200e8 --- /dev/null +++ b/gdb/doc/observer.texi @@ -0,0 +1,64 @@ +@c -*-texinfo-*- +@node GDB Observers +@appendix @value{GDBN} Currently available observers + +@section Implementation rationale +@cindex observers implementation rationale + +An @dfn{observer} is an entity which is interested in being notified +when GDB reaches certain states, or certain events occur in GDB. +The entity being observed is called the @dfn{subject}. To receive +notifications, the observer attaches a callback to the subject. +One subject can have several observers. + +@file{observer.c} implements an internal generic low-level event +notification mechanism. This generic event notification mechansim is +then re-used to implement the exported high-level notification +management routines for all possible notifications. + +The current implementation of the generic observer provides support +for contextual data. This contextual data is given to the subject +when attaching the callback. In return, the subject will provide +this contextual data back to the observer as a parameter of the +callback. + +Note that the current support for the contextual data is only partial, +as it lacks a mechanism that would deallocate this data when the +callback is detached. This is not a problem so far, as this contextual +data is only used internally to hold a function pointer. Later on, if +a certain observer needs to provide support for user-level contextual +data, then the generic notification mechanism will need need to be +enhanced to allow the observer to provide a routine to deallocate the +data when attaching the callback. + +The observer implementation is also currently not reentrant. +In particular, it is therefore not possible to call the attach +or detach routines during a notification. + +@section @code{normal_stop} Notifications +@cindex @code{normal_stop} observer +@cindex notification about inferior execution stop + +@value{GDBN} will notify all @code{normal_stop} observers when the +inferior execution has just stopped, and all the associated internal +processing (such as breakpoint commands, annotations, etc) is about to +be performed before the @value{GDBN} prompt is returned to the user. + +The following interface is available to manage @code{normal_stop} +observers: + +@deftypefun extern struct observer *observer_attach_normal_stop (observer_normal_stop_ftype *@var{f}) +Attach the given @code{normal_stop} callback function @var{f} and +return the associated observer. +@end deftypefun + +@deftypefun extern void observer_detach_normal_stop (struct observer *@var{observer}); +Remove @var{observer} from the list of observers to be notified when +a @code{normal_stop} event occurs. +@end deftypefun + +@deftypefun extern void observer_notify_normal_stop (void); +Send a notification to all @code{normal_stop} observers. +@end deftypefun + + diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index 2d0342115a2..d1a4bc8b459 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -40,7 +40,7 @@ struct frame_id; is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember to define PUSH_RETURN_ADDRESS, because no call instruction will be - being executed by the target. Also FRAME_CHAIN_VALID as + being executed by the target. Also DEPRECATED_FRAME_CHAIN_VALID as generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as generic_fix_call_dummy. */ diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 6bedddbcae8..81fa2071307 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -345,7 +345,7 @@ read_2u (bfd *abfd, char **p) unsigned ret; ret = bfd_get_16 (abfd, (bfd_byte *) * p); - (*p)++; + (*p) += 2; return ret; } diff --git a/gdb/expression.h b/gdb/expression.h index 60e61d97f03..da95fcbcf62 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -322,7 +322,7 @@ enum exp_opcode OP_EXPRSTRING, /* An Objective C Foundation Class NSString constant */ - OP_OBJC_NSSTRING, + OP_OBJC_NSSTRING }; union exp_element diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 84e3d817ea0..6d4e7f96233 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -472,6 +472,7 @@ const struct language_defn f_language_defn = f_print_type, /* Print a type using appropriate syntax */ f_val_print, /* Print a value using appropriate syntax */ c_value_print, /* FIXME */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%o", "0", "o", ""}, /* Octal format info */ {"%d", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/frame.c b/gdb/frame.c index 900b51518c5..8609ce194fb 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -791,8 +791,8 @@ legacy_saved_regs_this_id (struct frame_info *next_frame, this to after the ffi test; I'd rather have backtraces from start go curfluy than have an abort called from main not show main. */ - gdb_assert (FRAME_CHAIN_P ()); - base = FRAME_CHAIN (next_frame); + gdb_assert (DEPRECATED_FRAME_CHAIN_P ()); + base = DEPRECATED_FRAME_CHAIN (next_frame); if (!frame_chain_valid (base, next_frame)) return; @@ -1048,8 +1048,9 @@ legacy_get_prev_frame (struct frame_info *this_frame) Note that the pc-unwind is intentionally performed before the frame chain. This is ok since, for old targets, both - frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume - THIS_FRAME's data structures have already been initialized (using + frame_pc_unwind (nee, DEPRECATED_FRAME_SAVED_PC) and + DEPRECATED_FRAME_CHAIN()) assume THIS_FRAME's data structures + have already been initialized (using DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order doesn't matter. @@ -1196,8 +1197,8 @@ legacy_get_prev_frame (struct frame_info *this_frame) this to after the ffi test; I'd rather have backtraces from start go curfluy than have an abort called from main not show main. */ - gdb_assert (FRAME_CHAIN_P ()); - address = FRAME_CHAIN (this_frame); + gdb_assert (DEPRECATED_FRAME_CHAIN_P ()); + address = DEPRECATED_FRAME_CHAIN (this_frame); if (!frame_chain_valid (address, this_frame)) return 0; @@ -1244,10 +1245,11 @@ legacy_get_prev_frame (struct frame_info *this_frame) DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC. This should also return a flag saying whether to keep the new frame, or whether to discard it, because on some machines (e.g. - mips) it is really awkward to have FRAME_CHAIN_VALID called - BEFORE DEPRECATED_INIT_EXTRA_FRAME_INFO (there is no good way to - get information deduced in FRAME_CHAIN_VALID into the extra - fields of the new frame). std_frame_pc(fromleaf, prev) + mips) it is really awkward to have DEPRECATED_FRAME_CHAIN_VALID + called BEFORE DEPRECATED_INIT_EXTRA_FRAME_INFO (there is no good + way to get information deduced in DEPRECATED_FRAME_CHAIN_VALID + into the extra fields of the new frame). std_frame_pc(fromleaf, + prev) This is the default setting for INIT_PREV_FRAME. It just does what the default DEPRECATED_INIT_FRAME_PC does. Some machines @@ -1273,13 +1275,14 @@ legacy_get_prev_frame (struct frame_info *this_frame) means that the convolution below - needing to carefully order a frame's initialization - isn't needed. - The irony here though, is that FRAME_CHAIN(), at least for a more - up-to-date architecture, always calls FRAME_SAVED_PC(), and - FRAME_SAVED_PC() computes the PC but without first needing the - frame! Instead of the convolution below, we could have simply - called FRAME_SAVED_PC() and been done with it! Note that - FRAME_SAVED_PC() is being superseed by frame_pc_unwind() and that - function does have somewhere to cache that PC value. */ + The irony here though, is that DEPRECATED_FRAME_CHAIN(), at least + for a more up-to-date architecture, always calls + FRAME_SAVED_PC(), and FRAME_SAVED_PC() computes the PC but + without first needing the frame! Instead of the convolution + below, we could have simply called FRAME_SAVED_PC() and been done + with it! Note that FRAME_SAVED_PC() is being superseed by + frame_pc_unwind() and that function does have somewhere to cache + that PC value. */ if (DEPRECATED_INIT_FRAME_PC_FIRST_P ()) prev->pc = (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)); @@ -1295,8 +1298,9 @@ legacy_get_prev_frame (struct frame_info *this_frame) /* If ->frame and ->pc are unchanged, we are in the process of getting ourselves into an infinite backtrace. Some architectures - check this in FRAME_CHAIN or thereabouts, but it seems like there - is no reason this can't be an architecture-independent check. */ + check this in DEPRECATED_FRAME_CHAIN or thereabouts, but it seems + like there is no reason this can't be an architecture-independent + check. */ if (prev->frame == this_frame->frame && prev->pc == this_frame->pc) { @@ -1463,6 +1467,38 @@ get_prev_frame (struct frame_info *this_frame) return prev_frame; } + /* Check that this frame's ID was valid. If it wasn't, don't try to + unwind to the prev frame. Be careful to not apply this test to + the sentinel frame. */ + if (this_frame->level >= 0 && !frame_id_p (get_frame_id (this_frame))) + { + if (frame_debug) + fprintf_filtered (gdb_stdlog, + "Outermost frame - this ID is NULL\n"); + return NULL; + } + + /* Check that this frame's ID isn't inner to (younger, below, next) + the next frame. This happens when frame unwind goes backwards. + Since the sentinel frame isn't valid, don't apply this if this + frame is entier the inner-most or sentinel frame. */ + if (this_frame->level > 0 + && frame_id_inner (get_frame_id (this_frame), + get_frame_id (this_frame->next))) + error ("This frame inner-to next frame (corrupt stack?)"); + + /* Check that this and the next frame are different. If they are + not, there is most likely a stack cycle. As with the inner-than + test, avoid the inner-most and sentinel frames. */ + /* FIXME: cagney/2003-03-17: Can't yet enable this this check. The + frame_id_eq() method doesn't yet use function addresses when + comparing frame IDs. */ + if (0 + && this_frame->level > 0 + && frame_id_eq (get_frame_id (this_frame), + get_frame_id (this_frame->next))) + error ("This frame identical to next frame (corrupt stack?)"); + /* Allocate the new frame but do not wire it in to the frame chain. Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along frame->next to pull some fancy tricks (of course such code is, by @@ -1483,8 +1519,9 @@ get_prev_frame (struct frame_info *this_frame) Note that the pc-unwind is intentionally performed before the frame chain. This is ok since, for old targets, both - frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume - THIS_FRAME's data structures have already been initialized (using + frame_pc_unwind (nee, FRAME_SAVED_PC) and + DEPRECATED_FRAME_CHAIN()) assume THIS_FRAME's data structures + have already been initialized (using DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order doesn't matter. @@ -1528,38 +1565,17 @@ get_prev_frame (struct frame_info *this_frame) &prev_frame->prologue_cache, &prev_frame->id); - /* Check that the unwound ID is valid. */ - if (!frame_id_p (prev_frame->id)) - { - if (frame_debug) - fprintf_unfiltered (gdb_stdlog, - "Outermost frame - unwound frame ID invalid\n"); - return NULL; - } - - /* Check that the new frame isn't inner to (younger, below, next) - the old frame. If that happens the frame unwind is going - backwards. */ - /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since that - doesn't have a valid frame ID. Should instead set the sentinel - frame's frame ID to a true `sentinel'. Leave it until after the - switch to storing the frame ID, instead of the frame base, in the - frame object. */ - if (this_frame->level >= 0 - && frame_id_inner (prev_frame->id, get_frame_id (this_frame))) - error ("Unwound frame inner-to selected frame (corrupt stack?)"); - - /* FIXME: cagney/2003-03-14: Should check that this and next frame's - IDs are different (i.e., !frame_id_eq()). Can't yet do that as - the EQ function doesn't yet compare PC values. */ - - /* FIXME: cagney/2003-03-14: Should delay the evaluation of the - frame ID until when it is needed. That way the inner most frame - can be created without needing to do prologue analysis. */ + /* The unwound frame ID is validate at the start of this function, + as part of the logic to decide if that frame should be further + unwound, and not here while the prev frame is being created. + Doing this makes it possible for the user to examine a frame that + has an invalid frame ID. - /* Note that, due to frameless functions, the stronger test of the - new frame being outer to the old frame can't be used - frameless - functions differ by only their PC value. */ + The very old VAX frame_args_address_correct() method noted: [...] + For the sake of argument, suppose that the stack is somewhat + trashed (which is one reason that "info frame" exists). So, + return 0 (indicating we don't know the address of the arglist) if + we don't know what frame this frame calls. */ /* FIXME: cagney/2002-12-18: Instead of this hack, should only store the frame ID in PREV_FRAME. Unfortunatly, some architectures @@ -1782,7 +1798,7 @@ legacy_frame_p (struct gdbarch *current_gdbarch) return (DEPRECATED_INIT_FRAME_PC_P () || DEPRECATED_INIT_FRAME_PC_FIRST_P () || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () - || FRAME_CHAIN_P () + || DEPRECATED_FRAME_CHAIN_P () || !gdbarch_unwind_dummy_id_p (current_gdbarch) || !SAVE_DUMMY_FRAME_TOS_P ()); } diff --git a/gdb/frame.h b/gdb/frame.h index ee0fc7e49b1..005960cc4f7 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -452,8 +452,8 @@ enum print_what extern void *frame_obstack_zalloc (unsigned long size); #define FRAME_OBSTACK_ZALLOC(TYPE) ((TYPE *) frame_obstack_zalloc (sizeof (TYPE))) -/* If FRAME_CHAIN_VALID returns zero it means that the given frame - is the outermost one and has no caller. */ +/* If DEPRECATED_FRAME_CHAIN_VALID returns zero it means that the + given frame is the outermost one and has no caller. */ extern int frame_chain_valid (CORE_ADDR, struct frame_info *); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 2753283d695..cb8dc55e679 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -35,14 +35,12 @@ static gdbarch_register_virtual_size_ftype frv_register_virtual_size; static gdbarch_register_virtual_type_ftype frv_register_virtual_type; static gdbarch_register_byte_ftype frv_register_byte; static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc; -static gdbarch_frame_chain_ftype frv_frame_chain; static gdbarch_skip_prologue_ftype frv_skip_prologue; static gdbarch_deprecated_extract_return_value_ftype frv_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_value_address; static gdbarch_use_struct_convention_ftype frv_use_struct_convention; static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation; static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info; -static gdbarch_store_struct_return_ftype frv_store_struct_return; static gdbarch_push_arguments_ftype frv_push_arguments; static gdbarch_push_return_address_ftype frv_push_return_address; static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call; @@ -1078,7 +1076,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_saved_pc_after_call (gdbarch, frv_saved_pc_after_call); - set_gdbarch_frame_chain (gdbarch, frv_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, frv_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, frv_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs); @@ -1086,7 +1084,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_use_struct_convention (gdbarch, frv_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value); - set_gdbarch_store_struct_return (gdbarch, frv_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, frv_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, frv_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address); @@ -1115,7 +1113,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_decr_pc_after_break (gdbarch, 0); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 94e89f3a33b..c45a70f054f 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -195,8 +195,7 @@ struct gdbarch int call_dummy_p; LONGEST * call_dummy_words; int sizeof_call_dummy_words; - int call_dummy_stack_adjust_p; - int call_dummy_stack_adjust; + int deprecated_call_dummy_stack_adjust; gdbarch_fix_call_dummy_ftype *fix_call_dummy; gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first; gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc; @@ -217,7 +216,7 @@ struct gdbarch gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame; gdbarch_push_return_address_ftype *push_return_address; gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame; - gdbarch_store_struct_return_ftype *store_struct_return; + gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return; gdbarch_extract_return_value_ftype *extract_return_value; gdbarch_store_return_value_ftype *store_return_value; gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value; @@ -239,8 +238,8 @@ struct gdbarch gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; CORE_ADDR frame_args_skip; gdbarch_frameless_function_invocation_ftype *frameless_function_invocation; - gdbarch_frame_chain_ftype *frame_chain; - gdbarch_frame_chain_valid_ftype *frame_chain_valid; + gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain; + gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid; gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc; gdbarch_unwind_pc_ftype *unwind_pc; gdbarch_frame_args_address_ftype *frame_args_address; @@ -249,7 +248,7 @@ struct gdbarch gdbarch_frame_num_args_ftype *frame_num_args; gdbarch_stack_align_ftype *stack_align; gdbarch_frame_align_ftype *frame_align; - int extra_stack_alignment_needed; + int deprecated_extra_stack_alignment_needed; gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; gdbarch_unwind_dummy_id_ftype *unwind_dummy_id; @@ -434,7 +433,6 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, generic_in_function_epilogue_p, construct_inferior_arguments, 0, @@ -538,7 +536,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->call_dummy_p = -1; current_gdbarch->call_dummy_words = legacy_call_dummy_words; current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; - current_gdbarch->call_dummy_stack_adjust_p = -1; current_gdbarch->register_convertible = generic_register_convertible_not; current_gdbarch->convert_register_p = legacy_convert_register_p; current_gdbarch->register_to_value = legacy_register_to_value; @@ -562,7 +559,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; current_gdbarch->frame_args_address = get_frame_base; current_gdbarch->frame_locals_address = get_frame_base; - current_gdbarch->extra_stack_alignment_needed = 1; current_gdbarch->convert_from_func_ptr_addr = core_addr_identity; current_gdbarch->addr_bits_remove = core_addr_identity; current_gdbarch->smash_text_address = core_addr_identity; @@ -700,12 +696,7 @@ verify_gdbarch (struct gdbarch *gdbarch) fprintf_unfiltered (log, "\n\tcall_dummy_p"); /* Skip verify of call_dummy_words, invalid_p == 0 */ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ - if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->call_dummy_stack_adjust_p == -1)) - fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) - fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust"); + /* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->fix_call_dummy == 0)) fprintf_unfiltered (log, "\n\tfix_call_dummy"); @@ -726,9 +717,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of deprecated_push_dummy_frame, has predicate */ /* Skip verify of push_return_address, has predicate */ /* Skip verify of deprecated_pop_frame, has predicate */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->store_struct_return == 0)) - fprintf_unfiltered (log, "\n\tstore_struct_return"); + /* Skip verify of deprecated_store_struct_return, has predicate */ /* Skip verify of extract_return_value, invalid_p == 0 */ /* Skip verify of store_return_value, invalid_p == 0 */ /* Skip verify of extract_struct_value_address, has predicate */ @@ -758,8 +747,8 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->frame_args_skip == -1)) fprintf_unfiltered (log, "\n\tframe_args_skip"); /* Skip verify of frameless_function_invocation, invalid_p == 0 */ - /* Skip verify of frame_chain, has predicate */ - /* Skip verify of frame_chain_valid, has predicate */ + /* Skip verify of deprecated_frame_chain, has predicate */ + /* Skip verify of deprecated_frame_chain_valid, has predicate */ /* Skip verify of deprecated_frame_saved_pc, has predicate */ /* Skip verify of unwind_pc, has predicate */ /* Skip verify of frame_args_address, invalid_p == 0 */ @@ -772,7 +761,7 @@ verify_gdbarch (struct gdbarch *gdbarch) fprintf_unfiltered (log, "\n\tframe_num_args"); /* Skip verify of stack_align, has predicate */ /* Skip verify of frame_align, has predicate */ - /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ + /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ /* Skip verify of reg_struct_has_addr, has predicate */ /* Skip verify of save_dummy_frame_tos, has predicate */ /* Skip verify of unwind_dummy_id, has predicate */ @@ -1002,23 +991,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: CALL_DUMMY_P = %d\n", CALL_DUMMY_P); #endif -#ifdef CALL_DUMMY_STACK_ADJUST - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n", - XSTRING (CALL_DUMMY_STACK_ADJUST)); - if (CALL_DUMMY_STACK_ADJUST_P) - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", - (long) CALL_DUMMY_STACK_ADJUST); -#endif -#ifdef CALL_DUMMY_STACK_ADJUST_P - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n", - XSTRING (CALL_DUMMY_STACK_ADJUST_P)); - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", - (long) CALL_DUMMY_STACK_ADJUST_P); -#endif #ifdef CALL_DUMMY_START_OFFSET fprintf_unfiltered (file, "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n", @@ -1113,6 +1085,23 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", (long) DECR_PC_AFTER_BREAK); #endif +#ifdef DEPRECATED_CALL_DUMMY_STACK_ADJUST_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_CALL_DUMMY_STACK_ADJUST_P()", + XSTRING (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() = %d\n", + DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ()); +#endif +#ifdef DEPRECATED_CALL_DUMMY_STACK_ADJUST + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST # %s\n", + XSTRING (DEPRECATED_CALL_DUMMY_STACK_ADJUST)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST = %d\n", + DEPRECATED_CALL_DUMMY_STACK_ADJUST); +#endif #ifdef DEPRECATED_DO_REGISTERS_INFO_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1170,6 +1159,54 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_extract_struct_value_address /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif +#ifdef DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED # %s\n", + XSTRING (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED = %d\n", + DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED); +#endif +#ifdef DEPRECATED_FRAME_CHAIN_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_CHAIN_P()", + XSTRING (DEPRECATED_FRAME_CHAIN_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_CHAIN_P() = %d\n", + DEPRECATED_FRAME_CHAIN_P ()); +#endif +#ifdef DEPRECATED_FRAME_CHAIN + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_CHAIN(frame)", + XSTRING (DEPRECATED_FRAME_CHAIN (frame))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n", + (long) current_gdbarch->deprecated_frame_chain + /*DEPRECATED_FRAME_CHAIN ()*/); +#endif +#ifdef DEPRECATED_FRAME_CHAIN_VALID_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_CHAIN_VALID_P()", + XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID_P() = %d\n", + DEPRECATED_FRAME_CHAIN_VALID_P ()); +#endif +#ifdef DEPRECATED_FRAME_CHAIN_VALID + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)", + XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n", + (long) current_gdbarch->deprecated_frame_chain_valid + /*DEPRECATED_FRAME_CHAIN_VALID ()*/); +#endif #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1413,6 +1450,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_store_return_value /*DEPRECATED_STORE_RETURN_VALUE ()*/); #endif +#ifdef DEPRECATED_STORE_STRUCT_RETURN_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_STORE_STRUCT_RETURN_P()", + XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN_P() = %d\n", + DEPRECATED_STORE_STRUCT_RETURN_P ()); +#endif +#ifdef DEPRECATED_STORE_STRUCT_RETURN +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)", + XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n", + (long) current_gdbarch->deprecated_store_struct_return + /*DEPRECATED_STORE_STRUCT_RETURN ()*/); +#endif #ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n", @@ -1525,14 +1585,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->extract_struct_value_address /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif -#ifdef EXTRA_STACK_ALIGNMENT_NEEDED - fprintf_unfiltered (file, - "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n", - XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED)); - fprintf_unfiltered (file, - "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n", - EXTRA_STACK_ALIGNMENT_NEEDED); -#endif #ifdef FIX_CALL_DUMMY #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1593,46 +1645,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", (long) FRAME_ARGS_SKIP); #endif -#ifdef FRAME_CHAIN_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_CHAIN_P()", - XSTRING (FRAME_CHAIN_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN_P() = %d\n", - FRAME_CHAIN_P ()); -#endif -#ifdef FRAME_CHAIN - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_CHAIN(frame)", - XSTRING (FRAME_CHAIN (frame))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN = <0x%08lx>\n", - (long) current_gdbarch->frame_chain - /*FRAME_CHAIN ()*/); -#endif -#ifdef FRAME_CHAIN_VALID_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_CHAIN_VALID_P()", - XSTRING (FRAME_CHAIN_VALID_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN_VALID_P() = %d\n", - FRAME_CHAIN_VALID_P ()); -#endif -#ifdef FRAME_CHAIN_VALID - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_CHAIN_VALID(chain, thisframe)", - XSTRING (FRAME_CHAIN_VALID (chain, thisframe))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN_VALID = <0x%08lx>\n", - (long) current_gdbarch->frame_chain_valid - /*FRAME_CHAIN_VALID ()*/); -#endif #ifdef FRAME_LOCALS_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2336,20 +2348,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->store_return_value /*STORE_RETURN_VALUE ()*/); #endif -#ifdef STORE_STRUCT_RETURN -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "STORE_STRUCT_RETURN(addr, sp)", - XSTRING (STORE_STRUCT_RETURN (addr, sp))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: STORE_STRUCT_RETURN = <0x%08lx>\n", - (long) current_gdbarch->store_struct_return - /*STORE_STRUCT_RETURN ()*/); -#endif #ifdef TARGET_ADDR_BIT fprintf_unfiltered (file, "gdbarch_dump: TARGET_ADDR_BIT # %s\n", @@ -3872,41 +3870,26 @@ set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, } int -gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->call_dummy_stack_adjust_p == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); - return gdbarch->call_dummy_stack_adjust_p; -} - -void -set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, - int call_dummy_stack_adjust_p) -{ - gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; + return gdbarch->deprecated_call_dummy_stack_adjust != 0; } int -gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_call_dummy_stack_adjust invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); - return gdbarch->call_dummy_stack_adjust; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_stack_adjust called\n"); + return gdbarch->deprecated_call_dummy_stack_adjust; } void -set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, - int call_dummy_stack_adjust) +set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, + int deprecated_call_dummy_stack_adjust) { - gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; + gdbarch->deprecated_call_dummy_stack_adjust = deprecated_call_dummy_stack_adjust; } void @@ -4332,23 +4315,30 @@ set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch->deprecated_pop_frame = deprecated_pop_frame; } +int +gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_store_struct_return != 0; +} + void -gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) +gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->store_struct_return == 0) + if (gdbarch->deprecated_store_struct_return == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_store_struct_return invalid"); + "gdbarch: gdbarch_deprecated_store_struct_return invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); - gdbarch->store_struct_return (addr, sp); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n"); + gdbarch->deprecated_store_struct_return (addr, sp); } void -set_gdbarch_store_struct_return (struct gdbarch *gdbarch, - gdbarch_store_struct_return_ftype store_struct_return) +set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, + gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return) { - gdbarch->store_struct_return = store_struct_return; + gdbarch->deprecated_store_struct_return = deprecated_store_struct_return; } void @@ -4779,55 +4769,55 @@ set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, } int -gdbarch_frame_chain_p (struct gdbarch *gdbarch) +gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->frame_chain != 0; + return gdbarch->deprecated_frame_chain != 0; } CORE_ADDR -gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) +gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_chain == 0) + if (gdbarch->deprecated_frame_chain == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_chain invalid"); + "gdbarch: gdbarch_deprecated_frame_chain invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); - return gdbarch->frame_chain (frame); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain called\n"); + return gdbarch->deprecated_frame_chain (frame); } void -set_gdbarch_frame_chain (struct gdbarch *gdbarch, - gdbarch_frame_chain_ftype frame_chain) +set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, + gdbarch_deprecated_frame_chain_ftype deprecated_frame_chain) { - gdbarch->frame_chain = frame_chain; + gdbarch->deprecated_frame_chain = deprecated_frame_chain; } int -gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch) +gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->frame_chain_valid != 0; + return gdbarch->deprecated_frame_chain_valid != 0; } int -gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) +gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_chain_valid == 0) + if (gdbarch->deprecated_frame_chain_valid == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_chain_valid invalid"); + "gdbarch: gdbarch_deprecated_frame_chain_valid invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); - return gdbarch->frame_chain_valid (chain, thisframe); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain_valid called\n"); + return gdbarch->deprecated_frame_chain_valid (chain, thisframe); } void -set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, - gdbarch_frame_chain_valid_ftype frame_chain_valid) +set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, + gdbarch_deprecated_frame_chain_valid_ftype deprecated_frame_chain_valid) { - gdbarch->frame_chain_valid = frame_chain_valid; + gdbarch->deprecated_frame_chain_valid = deprecated_frame_chain_valid; } int @@ -5011,20 +5001,20 @@ set_gdbarch_frame_align (struct gdbarch *gdbarch, } int -gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch) +gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ + /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n"); - return gdbarch->extra_stack_alignment_needed; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extra_stack_alignment_needed called\n"); + return gdbarch->deprecated_extra_stack_alignment_needed; } void -set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, - int extra_stack_alignment_needed) +set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, + int deprecated_extra_stack_alignment_needed) { - gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed; + gdbarch->deprecated_extra_stack_alignment_needed = deprecated_extra_stack_alignment_needed; } int diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index eb36ebc1499..dd66773a8ac 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1260,25 +1260,39 @@ extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int si #endif #endif -extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P) -#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P" +#if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) +/* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */ +#if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (1) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P) -#define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch)) #endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (0) +#endif + +extern int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (gdbarch_deprecated_call_dummy_stack_adjust_p (current_gdbarch)) #endif -extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST) -#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST" +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST (0) +#endif + +extern int gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, int deprecated_call_dummy_stack_adjust); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST) -#define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) +#define DEPRECATED_CALL_DUMMY_STACK_ADJUST (gdbarch_deprecated_call_dummy_stack_adjust (current_gdbarch)) #endif #endif @@ -1743,15 +1757,42 @@ extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_d #endif #endif -typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); -extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); -extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN) -#error "Non multi-arch definition of STORE_STRUCT_RETURN" +/* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */ + +#if defined (DEPRECATED_STORE_STRUCT_RETURN) +/* Legacy for systems yet to multi-arch DEPRECATED_STORE_STRUCT_RETURN */ +#if !defined (DEPRECATED_STORE_STRUCT_RETURN_P) +#define DEPRECATED_STORE_STRUCT_RETURN_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN_P) +#define DEPRECATED_STORE_STRUCT_RETURN_P() (0) +#endif + +extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P) +#error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN_P) +#define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN) +#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_STORE_STRUCT_RETURN"), 0) +#endif + +typedef void (gdbarch_deprecated_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); +extern void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); +extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN) +#error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN) -#define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN) +#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp)) #endif #endif @@ -2154,77 +2195,77 @@ extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, #endif #endif -#if defined (FRAME_CHAIN) -/* Legacy for systems yet to multi-arch FRAME_CHAIN */ -#if !defined (FRAME_CHAIN_P) -#define FRAME_CHAIN_P() (1) +#if defined (DEPRECATED_FRAME_CHAIN) +/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */ +#if !defined (DEPRECATED_FRAME_CHAIN_P) +#define DEPRECATED_FRAME_CHAIN_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_P) -#define FRAME_CHAIN_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_P) +#define DEPRECATED_FRAME_CHAIN_P() (0) #endif -extern int gdbarch_frame_chain_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_P) -#error "Non multi-arch definition of FRAME_CHAIN" +extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P) +#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_P) -#define FRAME_CHAIN_P() (gdbarch_frame_chain_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P) +#define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN) -#define FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "FRAME_CHAIN"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN) +#define DEPRECATED_FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN"), 0) #endif -typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); -extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); -extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN) -#error "Non multi-arch definition of FRAME_CHAIN" +typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame); +extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN) +#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN) -#define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN) +#define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame)) #endif #endif -#if defined (FRAME_CHAIN_VALID) -/* Legacy for systems yet to multi-arch FRAME_CHAIN_VALID */ -#if !defined (FRAME_CHAIN_VALID_P) -#define FRAME_CHAIN_VALID_P() (1) +#if defined (DEPRECATED_FRAME_CHAIN_VALID) +/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */ +#if !defined (DEPRECATED_FRAME_CHAIN_VALID_P) +#define DEPRECATED_FRAME_CHAIN_VALID_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID_P) -#define FRAME_CHAIN_VALID_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID_P) +#define DEPRECATED_FRAME_CHAIN_VALID_P() (0) #endif -extern int gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID_P) -#error "Non multi-arch definition of FRAME_CHAIN_VALID" +extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P) +#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID_P) -#define FRAME_CHAIN_VALID_P() (gdbarch_frame_chain_valid_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P) +#define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID) -#define FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "FRAME_CHAIN_VALID"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID) +#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN_VALID"), 0) #endif -typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); -extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); -extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID) -#error "Non multi-arch definition of FRAME_CHAIN_VALID" +typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); +extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); +extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID) +#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID) -#define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID) +#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe)) #endif #endif @@ -2376,19 +2417,21 @@ typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADD extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address); extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align); +/* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */ + /* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED) -#define EXTRA_STACK_ALIGNMENT_NEEDED (1) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0) #endif -extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch); -extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED) -#error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED" +extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED) -#define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch)) #endif #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index ff745ef4728..a1122e17ea9 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -533,8 +533,7 @@ F:1:DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CO v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx -v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx -v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P +V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0 f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0 F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev @@ -560,8 +559,8 @@ f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0 F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-:::0 -# -f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 +# NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. +F:2:DEPRECATED_STORE_STRUCT_RETURN:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 # f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0 @@ -589,8 +588,8 @@ f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR g # v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1 f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0 -F:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 -F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0 +F:2:DEPRECATED_FRAME_CHAIN:CORE_ADDR:deprecated_frame_chain:struct frame_info *frame:frame::0:0 +F:2:DEPRECATED_FRAME_CHAIN_VALID:int:deprecated_frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0 # DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please # note, per UNWIND_PC's doco, that while the two have similar # interfaces they have very different underlying implementations. @@ -603,7 +602,8 @@ f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0 # F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0 M:::CORE_ADDR:frame_align:CORE_ADDR address:address -v:2:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0::: +# NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. +v:2:DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED:int:deprecated_extra_stack_alignment_needed::::0:0::0::: F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0 # FIXME: kettenis/2003-03-08: This should be replaced by a function # parametrized with (at least) the regcache. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 9a02977f35b..63ec899245a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,14 @@ +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + * linux-low.c (linux_create_inferior): Use __SIGRTMIN. + (linux_wait_for_event, linux_init_signals): Likewise. + +2003-03-17 Daniel Jacobowitz <drow@mvista.com> + + * configure.in: Check for stdlib.h. + * configure: Regenerated. + * config.in: Regenerated. + 2003-01-04 Andreas Schwab <schwab@suse.de> * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31. diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index e5cb0a7db0b..5141263f4c6 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -25,6 +25,9 @@ /* Define if you have the <sgtty.h> header file. */ #undef HAVE_SGTTY_H +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + /* Define if you have the <string.h> header file. */ #undef HAVE_STRING_H diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index f88f4accdea..0b9bee47a3c 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -1105,7 +1105,7 @@ EOF fi -for ac_hdr in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h unistd.h +for ac_hdr in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff --git a/gdb/gdbserver/configure.in b/gdb/gdbserver/configure.in index cb6feedb6f2..9c3106da616 100644 --- a/gdb/gdbserver/configure.in +++ b/gdb/gdbserver/configure.in @@ -31,7 +31,8 @@ AC_PROG_INSTALL AC_HEADER_STDC AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl - proc_service.h sys/procfs.h thread_db.h linux/elf.h unistd.h) + proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl + stdlib.h unistd.h) . ${srcdir}/configure.srv diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 2cb592ae1da..95bf9697739 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -147,7 +147,7 @@ linux_create_inferior (char *program, char **allargs) { ptrace (PTRACE_TRACEME, 0, 0, 0); - signal (SIGRTMIN + 1, SIG_DFL); + signal (__SIGRTMIN + 1, SIG_DFL); setpgid (0, 0); @@ -493,8 +493,8 @@ linux_wait_for_event (struct thread_info *child) /* FIXME drow/2002-06-09: Get signal numbers from the inferior's thread library? */ if (WIFSTOPPED (wstat) - && (WSTOPSIG (wstat) == SIGRTMIN - || WSTOPSIG (wstat) == SIGRTMIN + 1)) + && (WSTOPSIG (wstat) == __SIGRTMIN + || WSTOPSIG (wstat) == __SIGRTMIN + 1)) { if (debug_threads) fprintf (stderr, "Ignored signal %d for %d (LWP %d).\n", @@ -1248,7 +1248,7 @@ linux_init_signals () { /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads to find what the cancel signal actually is. */ - signal (SIGRTMIN+1, SIG_IGN); + signal (__SIGRTMIN+1, SIG_IGN); } void diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 5a079bf4ae0..10466973f7e 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1250,7 +1250,7 @@ extern void recursive_dump_type (struct type *, int); /* printcmd.c */ -extern void print_scalar_formatted (char *, struct type *, int, int, +extern void print_scalar_formatted (void *, struct type *, int, int, struct ui_file *); extern int can_dereference (struct type *); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 415acf8c070..e78bc0f3813 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1120,7 +1120,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) */ set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info); - set_gdbarch_frame_chain (gdbarch, h8300_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, h8300_frame_chain); set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call); set_gdbarch_deprecated_frame_saved_pc (gdbarch, h8300_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue); @@ -1152,7 +1152,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value); set_gdbarch_push_arguments (gdbarch, h8300_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame); - set_gdbarch_store_struct_return (gdbarch, h8300_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, h8300_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention); @@ -1164,8 +1164,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - /* set_gdbarch_call_dummy_stack_adjust */ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); @@ -1175,7 +1173,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT); /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */ - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); set_gdbarch_believe_pcc_promotion (gdbarch, 1); return gdbarch; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 9fde53d4a6e..2f5412e2bb6 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -32,6 +32,7 @@ #include "completer.h" #include "language.h" #include "osabi.h" +#include "gdb_assert.h" /* For argument passing to the inferior */ #include "symtab.h" @@ -164,7 +165,7 @@ CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame); CORE_ADDR hppa_frame_args_address (struct frame_info *fi); CORE_ADDR hppa_frame_locals_address (struct frame_info *fi); int hppa_frame_num_args (struct frame_info *frame); -void hppa_push_dummy_frame (struct inferior_status *inf_status); +void hppa_push_dummy_frame (void); void hppa_pop_frame (void); CORE_ADDR hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, @@ -1068,9 +1069,10 @@ hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame) if (frame->next && !fromleaf) return; - /* If the next frame represents a frameless function invocation - then we have to do some adjustments that are normally done by - FRAME_CHAIN. (FRAME_CHAIN is not called in this case.) */ + /* If the next frame represents a frameless function invocation then + we have to do some adjustments that are normally done by + DEPRECATED_FRAME_CHAIN. (DEPRECATED_FRAME_CHAIN is not called in + this case.) */ if (fromleaf) { /* Find the framesize of *this* frame without peeking at the PC @@ -1425,45 +1427,28 @@ hppa_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) return 0; } -/* - These functions deal with saving and restoring register state - around a function call in the inferior. They keep the stack - double-word aligned; eventually, on an hp700, the stack will have - to be aligned to a 64-byte boundary. */ +/* These functions deal with saving and restoring register state + around a function call in the inferior. They keep the stack + double-word aligned; eventually, on an hp700, the stack will have + to be aligned to a 64-byte boundary. */ void -hppa_push_dummy_frame (struct inferior_status *inf_status) +hppa_push_dummy_frame (void) { CORE_ADDR sp, pc, pcspace; register int regnum; CORE_ADDR int_buffer; double freg_buffer; - /* Oh, what a hack. If we're trying to perform an inferior call - while the inferior is asleep, we have to make sure to clear - the "in system call" bit in the flag register (the call will - start after the syscall returns, so we're no longer in the system - call!) This state is kept in "inf_status", change it there. - - We also need a number of horrid hacks to deal with lossage in the - PC queue registers (apparently they're not valid when the in syscall - bit is set). */ pc = hppa_target_read_pc (inferior_ptid); int_buffer = read_register (FLAGS_REGNUM); if (int_buffer & 0x2) { - unsigned int sid; - int_buffer &= ~0x2; - write_inferior_status_register (inf_status, 0, int_buffer); - write_inferior_status_register (inf_status, PCOQ_HEAD_REGNUM, pc + 0); - write_inferior_status_register (inf_status, PCOQ_TAIL_REGNUM, pc + 4); - sid = (pc >> 30) & 0x3; + const unsigned int sid = (pc >> 30) & 0x3; if (sid == 0) pcspace = read_register (SR4_REGNUM); else pcspace = read_register (SR4_REGNUM + 4 + sid); - write_inferior_status_register (inf_status, PCSQ_HEAD_REGNUM, pcspace); - write_inferior_status_register (inf_status, PCSQ_TAIL_REGNUM, pcspace); } else pcspace = read_register (PCSQ_HEAD_REGNUM); @@ -4982,7 +4967,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call); set_gdbarch_inner_than (gdbarch, hppa_inner_than); set_gdbarch_stack_align (gdbarch, hppa_stack_align); - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_register_size (gdbarch, 4); set_gdbarch_num_regs (gdbarch, hppa_num_regs); @@ -4998,7 +4982,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); set_gdbarch_register_virtual_type (gdbarch, hppa_register_virtual_type); - set_gdbarch_store_struct_return (gdbarch, hppa_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, hppa_extract_return_value); set_gdbarch_use_struct_convention (gdbarch, hppa_use_struct_convention); @@ -5007,8 +4991,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) (gdbarch, hppa_extract_struct_value_address); set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info); - set_gdbarch_frame_chain (gdbarch, hppa_frame_chain); - set_gdbarch_frame_chain_valid (gdbarch, hppa_frame_chain_valid); + set_gdbarch_deprecated_frame_chain (gdbarch, hppa_frame_chain); + set_gdbarch_deprecated_frame_chain_valid (gdbarch, hppa_frame_chain_valid); set_gdbarch_frameless_function_invocation (gdbarch, hppa_frameless_function_invocation); set_gdbarch_deprecated_frame_saved_pc (gdbarch, hppa_frame_saved_pc); @@ -5016,7 +5000,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_locals_address (gdbarch, hppa_frame_locals_address); set_gdbarch_frame_num_args (gdbarch, hppa_frame_num_args); set_gdbarch_frame_args_skip (gdbarch, 0); - /* set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); */ + set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame); set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28); set_gdbarch_call_dummy_start_offset (gdbarch, 0); diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c new file mode 100644 index 00000000000..b07911b3b33 --- /dev/null +++ b/gdb/i386-cygwin-tdep.c @@ -0,0 +1,55 @@ +/* Target-dependent code for Cygwin running on i386's, for GDB. + Copyright 2003 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" + +#include "gdb_string.h" +#include "i386-tdep.h" +#include "osabi.h" + +static void +i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + tdep->struct_return = reg_struct_return; +} + +static enum gdb_osabi +i386_cygwin_osabi_sniffer (bfd * abfd) +{ + char *target_name = bfd_get_target (abfd); + + /* Interix also uses pei-i386. + We need a way to distinguish between the two. */ + if (strcmp (target_name, "pei-i386") == 0) + return GDB_OSABI_CYGWIN; + + return GDB_OSABI_UNKNOWN; +} + +void +_initialize_i386_cygwin_tdep (void) +{ + gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, + i386_cygwin_osabi_sniffer); + + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_CYGWIN, + i386_cygwin_init_abi); +} diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c index e25242c325e..a44989dcc37 100644 --- a/gdb/i386-interix-tdep.c +++ b/gdb/i386-interix-tdep.c @@ -224,10 +224,10 @@ i386_interix_back_one_frame (int fromleaf, struct frame_info *frame) /* No... We must be pointing at the frame that was called by PdxSignalDeliverer; back up across the whole mess. */ - /* Extract the frame for PdxSignalDeliverer. - Note: FRAME_CHAIN used the "old" frame pointer because we were - a deliverer. Get the address of the context record that's on - here frameless. */ + /* Extract the frame for PdxSignalDeliverer. Note: + DEPRECATED_FRAME_CHAIN used the "old" frame pointer because + we were a deliverer. Get the address of the context record + that's on here frameless. */ context = read_memory_integer (frame->frame, 4); /* an Arg */ /* Now extract the frame pointer contained in the context. */ @@ -333,7 +333,7 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_interix_skip_trampoline_code); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); - set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); + set_gdbarch_deprecated_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc); set_gdbarch_name_of_malloc (gdbarch, "_malloc"); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index bb588bf72dc..02abc9e537e 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -636,10 +636,10 @@ i386_frame_num_args (struct frame_info *fi) if (pfi == 0) { /* NOTE: This can happen if we are looking at the frame for - main, because FRAME_CHAIN_VALID won't let us go into start. - If we have debugging symbols, that's not really a big deal; - it just means it will only show as many arguments to main as - are declared. */ + main, because DEPRECATED_FRAME_CHAIN_VALID won't let us go + into start. If we have debugging symbols, that's not really + a big deal; it just means it will only show as many arguments + to main as are declared. */ return -1; } else @@ -1573,7 +1573,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, NULL); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_register_convertible (gdbarch, i386_register_convertible); @@ -1590,7 +1589,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_arguments (gdbarch, i386_push_arguments); set_gdbarch_push_return_address (gdbarch, i386_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, i386_pop_frame); - set_gdbarch_store_struct_return (gdbarch, i386_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, i386_store_struct_return); set_gdbarch_store_return_value (gdbarch, i386_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, i386_extract_struct_value_address); @@ -1614,7 +1613,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); set_gdbarch_frameless_function_invocation (gdbarch, i386_frameless_function_invocation); - set_gdbarch_frame_chain (gdbarch, i386_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, i386_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_frame_saved_pc); set_gdbarch_saved_pc_after_call (gdbarch, i386_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, i386_frame_num_args); diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 069c2e6a0cc..1b3d7657e45 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -91,13 +91,11 @@ static gdbarch_register_virtual_size_ftype ia64_register_virtual_size; static gdbarch_register_virtual_type_ftype ia64_register_virtual_type; static gdbarch_register_byte_ftype ia64_register_byte; static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc; -static gdbarch_frame_chain_ftype ia64_frame_chain; static gdbarch_skip_prologue_ftype ia64_skip_prologue; static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address; static gdbarch_use_struct_convention_ftype ia64_use_struct_convention; static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation; -static gdbarch_store_struct_return_ftype ia64_store_struct_return; static gdbarch_push_arguments_ftype ia64_push_arguments; static gdbarch_push_return_address_ftype ia64_push_return_address; static gdbarch_saved_pc_after_call_ftype ia64_saved_pc_after_call; @@ -2004,7 +2002,7 @@ ia64_pop_frame_regular (struct frame_info *frame) } } - write_register (sp_regnum, FRAME_CHAIN (frame)); + write_register (sp_regnum, DEPRECATED_FRAME_CHAIN (frame)); write_pc (DEPRECATED_FRAME_SAVED_PC (frame)); cfm = read_register (IA64_CFM_REGNUM); @@ -2193,7 +2191,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call); - set_gdbarch_frame_chain (gdbarch, ia64_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, ia64_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, ia64_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs); @@ -2206,7 +2204,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value); - set_gdbarch_store_struct_return (gdbarch, ia64_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, ia64_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, ia64_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address); @@ -2246,7 +2244,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_decr_pc_after_break (gdbarch, 0); diff --git a/gdb/inferior.h b/gdb/inferior.h index 4616a1f3da7..10da8ee5408 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -437,18 +437,6 @@ extern int attach_flag; #define CALL_DUMMY_LENGTH (internal_error (__FILE__, __LINE__, "CALL_DUMMY_LENGTH"), 0) #endif -#if defined (CALL_DUMMY_STACK_ADJUST) -#if !defined (CALL_DUMMY_STACK_ADJUST_P) -#define CALL_DUMMY_STACK_ADJUST_P (1) -#endif -#endif -#if !defined (CALL_DUMMY_STACK_ADJUST) -#define CALL_DUMMY_STACK_ADJUST (internal_error (__FILE__, __LINE__, "CALL_DUMMY_STACK_ADJUST"), 0) -#endif -#if !defined (CALL_DUMMY_STACK_ADJUST_P) -#define CALL_DUMMY_STACK_ADJUST_P (0) -#endif - /* FIXME: cagney/2000-04-17: gdbarch should manage this. The default shouldn't be necessary. */ diff --git a/gdb/infrun.c b/gdb/infrun.c index f65af358a02..6da33946ec1 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -42,6 +42,8 @@ #include "inf-loop.h" #include "regcache.h" #include "value.h" +#include "observer.h" +#include "language.h" /* Prototypes for local functions */ @@ -106,21 +108,6 @@ static ptid_t previous_inferior_ptid; static int may_follow_exec = MAY_FOLLOW_EXEC; -/* Dynamic function trampolines are similar to solib trampolines in that they - are between the caller and the callee. The difference is that when you - enter a dynamic trampoline, you can't determine the callee's address. Some - (usually complex) code needs to run in the dynamic trampoline to figure out - the callee's address. This macro is usually called twice. First, when we - enter the trampoline (looks like a normal function call at that point). It - should return the PC of a point within the trampoline where the callee's - address is known. Second, when we hit the breakpoint, this routine returns - the callee's address. At that point, things proceed as per a step resume - breakpoint. */ - -#ifndef DYNAMIC_TRAMPOLINE_NEXTPC -#define DYNAMIC_TRAMPOLINE_NEXTPC(pc) 0 -#endif - /* If the program uses ELF-style shared libraries, then calls to functions in shared libraries go through stubs, which live in a table called the PLT (Procedure Linkage Table). The first time the @@ -2400,28 +2387,11 @@ process_event_stop_test: function. That's what tells us (a) whether we want to step into it at all, and (b) what prologue we want to run to the end of, if we do step into it. */ - real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + real_stop_pc = skip_language_trampoline (stop_pc); + if (real_stop_pc == 0) + real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); if (real_stop_pc != 0) ecs->stop_func_start = real_stop_pc; - else - { - real_stop_pc = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc); - if (real_stop_pc) - { - struct symtab_and_line xxx; - /* Why isn't this s_a_l called "sr_sal", like all of the - other s_a_l's where this code is duplicated? */ - init_sal (&xxx); /* initialize to zeroes */ - xxx.pc = real_stop_pc; - xxx.section = find_pc_overlay (xxx.pc); - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (xxx, null_frame_id, bp_step_resume); - insert_breakpoints (); - keep_going (ecs); - return; - } - } /* If we have line number information for the function we are thinking of stepping into, step into it. @@ -3113,6 +3083,7 @@ normal_stop (void) done: annotate_stopped (); + observer_notify_normal_stop (); } static int diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 903404d723b..f6bc2deb9d8 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -1054,6 +1054,7 @@ const struct language_defn java_language_defn = java_print_type, /* Print a type using appropriate syntax */ java_val_print, /* Print a value using appropriate syntax */ java_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/language.c b/gdb/language.c index 258152cce13..2b71d1f754e 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -100,6 +100,8 @@ static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR, static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint); +static CORE_ADDR unk_lang_trampoline (CORE_ADDR pc); + /* Forward declaration */ extern const struct language_defn unknown_language_defn; @@ -1337,6 +1339,29 @@ add_language (const struct language_defn *lang) languages[languages_size++] = lang; } +/* Iterate through all registered languages looking for and calling + any non-NULL struct language_defn.skip_trampoline() functions. + Return the result from the first that returns non-zero, or 0 if all + `fail'. */ +CORE_ADDR +skip_language_trampoline (CORE_ADDR pc) +{ + int i; + + for (i = 0; i < languages_size; i++) + { + if (languages[i]->skip_trampoline) + { + CORE_ADDR real_pc = (languages[i]->skip_trampoline) (pc); + if (real_pc) + return real_pc; + } + } + + return 0; +} + + /* Define the language that is no language. */ static int @@ -1398,6 +1423,11 @@ unk_lang_value_print (struct value *val, struct ui_file *stream, int format, error ("internal error - unimplemented function unk_lang_value_print called."); } +static CORE_ADDR unk_lang_trampoline (CORE_ADDR pc) +{ + return 0; +} + static struct type **const (unknown_builtin_types[]) = { 0 @@ -1425,6 +1455,7 @@ const struct language_defn unknown_language_defn = unk_lang_print_type, /* Print a type using appropriate syntax */ unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ + unk_lang_trampoline, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ @@ -1455,6 +1486,7 @@ const struct language_defn auto_language_defn = unk_lang_print_type, /* Print a type using appropriate syntax */ unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ + unk_lang_trampoline, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ @@ -1484,6 +1516,7 @@ const struct language_defn local_language_defn = unk_lang_print_type, /* Print a type using appropriate syntax */ unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ + unk_lang_trampoline, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/language.h b/gdb/language.h index b786959cdce..4b9f8cee46d 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -203,6 +203,12 @@ struct language_defn int (*la_value_print) (struct value *, struct ui_file *, int, enum val_prettyprint); + /* PC is possibly an unknown languages trampoline. + If that PC falls in a trampoline belonging to this language, + return the address of the first pc in the real function, or 0 + if it isn't a language tramp for this language. */ + CORE_ADDR (*skip_trampoline) (CORE_ADDR pc); + /* Base 2 (binary) formats. */ struct language_format_info la_binary_format; @@ -465,4 +471,8 @@ extern void add_language (const struct language_defn *); extern enum language get_frame_language (void); /* In stack.c */ +/* Check for a language-specific trampoline. */ + +extern CORE_ADDR skip_language_trampoline (CORE_ADDR pc); + #endif /* defined (LANGUAGE_H) */ diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 116d85009fd..48c6931e29b 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -426,6 +426,7 @@ const struct language_defn m2_language_defn = m2_print_type, /* Print a type using appropriate syntax */ m2_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"%loB", "", "o", "B"}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 7d64860fb8b..02ba5c0b096 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1389,7 +1389,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value); @@ -1397,13 +1396,13 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_push_return_address (gdbarch, m68hc11_push_return_address); set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); - set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, m68hc11_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); - set_gdbarch_frame_chain (gdbarch, m68hc11_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, m68hc11_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc); set_gdbarch_frame_args_address (gdbarch, m68hc11_frame_args_address); set_gdbarch_frame_locals_address (gdbarch, m68hc11_frame_locals_address); @@ -1412,7 +1411,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); - set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, m68hc11_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); @@ -1425,6 +1424,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc); set_gdbarch_stack_align (gdbarch, m68hc11_stack_align); + set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11); m68hc11_add_reggroups (gdbarch); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index b79c68a19df..a72ea534671 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -245,10 +245,10 @@ m68k_store_return_value (struct type *type, char *valbuf) /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ -/* FRAME_CHAIN takes a frame's nominal address and produces the frame's - chain-pointer. - In the case of the 68000, the frame's nominal address - is the address of a 4-byte word containing the calling frame's address. */ +/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces + the frame's chain-pointer. In the case of the 68000, the frame's + nominal address is the address of a 4-byte word containing the + calling frame's address. */ /* If we are chaining from sigtramp, then manufacture a sigtramp frame (which isn't really on the stack. I'm not sure this is right for anything @@ -1000,17 +1000,17 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Stack grows down. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_stack_align (gdbarch, m68k_stack_align); - + set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_decr_pc_after_break (gdbarch, 2); - set_gdbarch_store_struct_return (gdbarch, m68k_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, m68k_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, m68k_deprecated_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, m68k_store_return_value); - set_gdbarch_frame_chain (gdbarch, m68k_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, m68k_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68k_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs); set_gdbarch_frameless_function_invocation (gdbarch, @@ -1042,13 +1042,11 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 28); set_gdbarch_call_dummy_start_offset (gdbarch, 12); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words)); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy); set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame); diff --git a/gdb/main.c b/gdb/main.c index 559c521c947..fd25750b94e 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -570,11 +570,7 @@ extern int gdbtk_test (char *); /* Find it. */ struct interp *interp = interp_lookup (interpreter_p); if (interp == NULL) - { - fprintf_unfiltered (gdb_stderr, "Interpreter `%s' unrecognized.\n", - interpreter_p); - exit (1); - } + error ("Interpreter `%s' unrecognized", interpreter_p); /* Install it. */ if (!interp_set (interp)) { @@ -815,7 +811,9 @@ gdb_main (struct captured_main_args *args) { use_windows = args->use_windows; catch_errors (captured_main, args, "", RETURN_MASK_ALL); - return 0; + /* The only way to end up here is by an error (normal exit is + handled by quit_force()), hence always return an error status. */ + return 1; } diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 36dbbdb48a4..e3070b35d1e 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -1125,7 +1125,6 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call); set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_decr_pc_after_break (gdbarch, 0); @@ -1137,13 +1136,13 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frames: */ set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info); - set_gdbarch_frame_chain (gdbarch, mcore_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, mcore_frame_chain); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs); set_gdbarch_deprecated_frame_saved_pc (gdbarch, mcore_frame_saved_pc); set_gdbarch_deprecated_store_return_value (gdbarch, mcore_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mcore_extract_return_value); - set_gdbarch_store_struct_return (gdbarch, mcore_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, mcore_store_struct_return); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, mcore_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 7c17d616fea..84b1afa5a7b 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -916,9 +916,13 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, method whose name is identical to the class name (in particular constructor method names are different from the class name). There is therefore no risk that - this check stops the count on the StEnd of a method. */ - if (strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss, - name) == 0) + this check stops the count on the StEnd of a method. + + Also, assume that we're really at the end when tsym.iss + is 0 (issNull). */ + if (tsym.iss == issNull + || strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss, + name) == 0) goto end_of_fields; break; diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 506fd1fe7cf..2a63d22e31d 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -25,6 +25,7 @@ #include "defs.h" #include "gdb_string.h" +#include "gdb_assert.h" #include "frame.h" #include "inferior.h" #include "symtab.h" @@ -361,23 +362,57 @@ static struct cmd_list_element *showmipscmdlist = NULL; /* A set of original names, to be used when restoring back to generic registers from a specific set. */ +static char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES; -char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES; -char **mips_processor_reg_names = mips_generic_reg_names; +/* Integer registers 0 thru 31 are handled explicitly by + mips_register_name(). Processor specific registers 32 and above + are listed in the sets of register names assigned to + mips_processor_reg_names. */ +static char **mips_processor_reg_names = mips_generic_reg_names; +/* Return the name of the register corresponding to REGNO. */ static const char * -mips_register_name (int i) -{ - return mips_processor_reg_names[i]; +mips_register_name (int regno) +{ + /* GPR names for all ABIs other than n32/n64. */ + static char *mips_gpr_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", + }; + + /* GPR names for n32 and n64 ABIs. */ + static char *mips_n32_n64_gpr_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra" + }; + + enum mips_abi abi = mips_abi (current_gdbarch); + + /* The MIPS integer registers are always mapped from 0 to 31. The + names of the registers (which reflects the conventions regarding + register use) vary depending on the ABI. */ + if (0 <= regno && regno < 32) + { + if (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64) + return mips_n32_n64_gpr_names[regno]; + else + return mips_gpr_names[regno]; + } + else if (32 <= regno && regno < NUM_REGS) + return mips_processor_reg_names[regno - 32]; + else + internal_error (__FILE__, __LINE__, + "mips_register_name: bad register number %d", regno); } + /* *INDENT-OFF* */ /* Names of IDT R3041 registers. */ char *mips_r3041_reg_names[] = { - "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", "sr", "lo", "hi", "bad", "cause","pc", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", @@ -391,10 +426,6 @@ char *mips_r3041_reg_names[] = { /* Names of IDT R3051 registers. */ char *mips_r3051_reg_names[] = { - "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", "sr", "lo", "hi", "bad", "cause","pc", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", @@ -408,10 +439,6 @@ char *mips_r3051_reg_names[] = { /* Names of IDT R3081 registers. */ char *mips_r3081_reg_names[] = { - "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", "sr", "lo", "hi", "bad", "cause","pc", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", @@ -425,10 +452,6 @@ char *mips_r3081_reg_names[] = { /* Names of LSI 33k registers. */ char *mips_lsi33k_reg_names[] = { - "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", "epc", "hi", "lo", "sr", "cause","badvaddr", "dcic", "bpc", "bda", "", "", "", "", "", "", "", "", "", "", "", "", "", @@ -6004,7 +6027,6 @@ mips_gdbarch_init (struct gdbarch_info info, /* MIPS version of CALL_DUMMY */ set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame); @@ -6024,7 +6046,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_register_convert_to_raw (gdbarch, mips_register_convert_to_raw); - set_gdbarch_frame_chain (gdbarch, mips_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, mips_frame_chain); set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); set_gdbarch_deprecated_frame_saved_pc (gdbarch, mips_frame_saved_pc); @@ -6057,7 +6079,7 @@ mips_gdbarch_init (struct gdbarch_info info, /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - set_gdbarch_store_struct_return (gdbarch, mips_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, mips_store_struct_return); set_gdbarch_extract_struct_value_address (gdbarch, mips_extract_struct_value_address); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index df6e0439a63..087c9df9f5b 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1170,13 +1170,13 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); - set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, mn10300_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, mn10300_frame_saved_pc); set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, mn10300_extract_struct_value_address); set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value); - set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, mn10300_store_struct_return); set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame); set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); set_gdbarch_frame_args_skip (gdbarch, 0); @@ -1188,7 +1188,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 9737120bbbd..323cade60a2 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -572,7 +572,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); - set_gdbarch_frame_chain (gdbarch, ns32k_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, ns32k_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, ns32k_frame_saved_pc); set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address); @@ -585,7 +585,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Return value info */ - set_gdbarch_store_struct_return (gdbarch, ns32k_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, ns32k_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, @@ -603,7 +603,6 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 0); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ set_gdbarch_decr_pc_after_break (gdbarch, 0); diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 255781e783d..911831e4ba8 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -593,6 +593,35 @@ objc_create_fundamental_type (struct objfile *objfile, int typeid) return (type); } +/* Determine if we are currently in the Objective-C dispatch function. + If so, get the address of the method function that the dispatcher + would call and use that as the function to step into instead. Also + skip over the trampoline for the function (if any). This is better + for the user since they are only interested in stepping into the + method function anyway. */ +static CORE_ADDR +objc_skip_trampoline (CORE_ADDR stop_pc) +{ + CORE_ADDR real_stop_pc; + CORE_ADDR method_stop_pc; + + real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + + if (real_stop_pc != 0) + find_objc_msgcall (real_stop_pc, &method_stop_pc); + else + find_objc_msgcall (stop_pc, &method_stop_pc); + + if (method_stop_pc) + { + real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc); + if (real_stop_pc == 0) + real_stop_pc = method_stop_pc; + } + + return real_stop_pc; +} + /* Table mapping opcodes into strings for printing operators and precedences of the operators. */ @@ -670,6 +699,7 @@ const struct language_defn objc_language_defn = { c_print_type, /* Print a type using appropriate syntax */ c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ + objc_skip_trampoline, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/objc-lang.h b/gdb/objc-lang.h index 85068180fa8..02688c73c66 100644 --- a/gdb/objc-lang.h +++ b/gdb/objc-lang.h @@ -19,6 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if !defined(OBJC_LANG_H) +#define OBJC_LANG_H + +struct stoken; + struct value; struct block; @@ -51,3 +56,10 @@ extern char *find_imps (struct symtab *symtab, struct block *block, unsigned int *nsym, unsigned int *ndebug); extern struct value *value_nsstring (char *ptr, int len); + +/* for parsing Objective C */ +extern void start_msglist (void); +extern void add_msglist (struct stoken *str, int addcolon); +extern int end_msglist (void); + +#endif diff --git a/gdb/objfiles.h b/gdb/objfiles.h index e710263a8af..f747a680108 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -65,14 +65,15 @@ struct htab; confused. However, we almost always have debugging information available for main(). - These variables are used to save the range of PC values which are valid - within the main() function and within the function containing the process - entry point. If we always consider the frame for main() as the outermost - frame when debugging user code, and the frame for the process entry - point function as the outermost frame when debugging startup code, then - all we have to do is have FRAME_CHAIN_VALID return false whenever a - frame's current PC is within the range specified by these variables. - In essence, we set "ceilings" in the frame chain beyond which we will + These variables are used to save the range of PC values which are + valid within the main() function and within the function containing + the process entry point. If we always consider the frame for + main() as the outermost frame when debugging user code, and the + frame for the process entry point function as the outermost frame + when debugging startup code, then all we have to do is have + DEPRECATED_FRAME_CHAIN_VALID return false whenever a frame's + current PC is within the range specified by these variables. In + essence, we set "ceilings" in the frame chain beyond which we will not proceed when following the frame chain back up the stack. A nice side effect is that we can still debug startup code without @@ -83,9 +84,10 @@ struct htab; information but we do have usable information for main(), backtraces from user code don't go wandering off into the startup code. - To use this method, define your FRAME_CHAIN_VALID macro like: + To use this method, define your DEPRECATED_FRAME_CHAIN_VALID macro + like: - #define FRAME_CHAIN_VALID(chain, thisframe) \ + #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 \ && !(inside_main_func ((thisframe)->pc)) \ && !(inside_entry_func ((thisframe)->pc))) diff --git a/gdb/observer.c b/gdb/observer.c index 92ec48e614f..6815d0f9c83 100644 --- a/gdb/observer.c +++ b/gdb/observer.c @@ -190,3 +190,33 @@ observer_notify_normal_stop (void) { generic_observer_notify (normal_stop_subject, NULL); } + +/* The following code is only used to unit-test the observers from + our testsuite. DO NOT USE IT within observer.c! */ + +/* Since this code will not be used within GDB, it will trigger + a warning if we decide to compile with -Wunused-function. + This is ok for now. (brobecker 2003-03-18) */ + +static int observer_test_first_observer = 0; +static int observer_test_second_observer = 0; +static int observer_test_third_observer = 0; + +static void +observer_test_first_notification_function (void) +{ + observer_test_first_observer++; +} + +static void +observer_test_second_notification_function (void) +{ + observer_test_second_observer++; +} + +static void +observer_test_third_notification_function (void) +{ + observer_test_third_observer++; +} + diff --git a/gdb/osabi.c b/gdb/osabi.c index ab49f9afe11..22414062705 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -74,6 +74,8 @@ static const char * const gdb_osabi_names[] = "ARM APCS", "QNX Neutrino", + "Cygwin", + "<invalid>" }; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 88c8cc09a90..40019a47db9 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -461,6 +461,7 @@ const struct language_defn pascal_language_defn = pascal_print_type, /* Print a type using appropriate syntax */ pascal_val_print, /* Print a value using appropriate syntax */ pascal_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "%", "b", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 3ba7c2e52fb..95c7f558f22 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -729,7 +729,7 @@ ppc_linux_init_abi (struct gdbarch_info info, *_push_arguments(). The same remarks hold for the methods below. */ set_gdbarch_frameless_function_invocation (gdbarch, ppc_linux_frameless_function_invocation); - set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, ppc_linux_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 1f01706ef03..9894a5883e2 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -61,11 +61,11 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int structstkspace; int argoffset; int structoffset; - struct value *arg; struct type *type; int len; char old_sp_buf[4]; CORE_ADDR saved_sp; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); greg = struct_return ? 4 : 3; freg = 1; @@ -79,11 +79,12 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, are put in registers. */ for (argno = 0; argno < nargs; argno++) { - arg = args[argno]; + struct value *arg = args[argno]; type = check_typedef (VALUE_TYPE (arg)); len = TYPE_LENGTH (type); - if (TYPE_CODE (type) == TYPE_CODE_FLT) + if (TYPE_CODE (type) == TYPE_CODE_FLT + && ppc_floating_point_unit_p (current_gdbarch)) { if (freg <= 8) freg++; @@ -96,7 +97,10 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, argstkspace += 8; } } - else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */ + else if (len == 8 + && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */ + || (!ppc_floating_point_unit_p (current_gdbarch) + && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */ { if (greg > 9) { @@ -144,6 +148,20 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, argstkspace += 16; } } + else if (len == 8 + && TYPE_CODE (type) == TYPE_CODE_ARRAY + && TYPE_VECTOR (type)) + { + if (greg <= 10) + greg++; + else + { + /* Vector arguments must be aligned to 8 bytes on + the stack. */ + argstkspace += round2 (argstkspace, 8); + argstkspace += 8; + } + } } } @@ -170,30 +188,33 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, freg = 1; greg = 3; vreg = 2; + /* Fill in r3 with the return structure, if any */ if (struct_return) { - char val_buf[4]; - store_address (val_buf, 4, struct_addr); - memcpy (&deprecated_registers[REGISTER_BYTE (greg)], val_buf, 4); + write_register (tdep->ppc_gp0_regnum + greg, struct_addr); greg++; } + /* Now fill in the registers and stack... */ for (argno = 0; argno < nargs; argno++) { - arg = args[argno]; + struct value *arg = args[argno]; + char *val = VALUE_CONTENTS (arg); type = check_typedef (VALUE_TYPE (arg)); len = TYPE_LENGTH (type); - if (TYPE_CODE (type) == TYPE_CODE_FLT) + if (TYPE_CODE (type) == TYPE_CODE_FLT + && ppc_floating_point_unit_p (current_gdbarch)) { if (freg <= 8) { + ULONGEST regval; if (len > 8) printf_unfiltered ( "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno); - memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + freg)], - VALUE_CONTENTS (arg), len); + regval = extract_unsigned_integer (val, len); + write_register (FP0_REGNUM + freg, regval); freg++; } else @@ -203,29 +224,32 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* FIXME: Convert floats to doubles */ if (argoffset & 0x4) argoffset += 4; - write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len); + write_memory (sp + argoffset, val, len); argoffset += 8; } } - else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */ + else if (len == 8 + && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */ + || (!ppc_floating_point_unit_p (current_gdbarch) + && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */ { if (greg > 9) { greg = 11; if (argoffset & 0x4) argoffset += 4; - write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len); + write_memory (sp + argoffset, val, len); argoffset += 8; } else { + ULONGEST regval; if ((greg & 1) == 0) greg++; - - memcpy (&deprecated_registers[REGISTER_BYTE (greg)], - VALUE_CONTENTS (arg), 4); - memcpy (&deprecated_registers[REGISTER_BYTE (greg + 1)], - VALUE_CONTENTS (arg) + 4, 4); + regval = extract_unsigned_integer (val, 4); + write_register (tdep->ppc_gp0_regnum + greg, regval); + regval = extract_unsigned_integer (val + 4, 4); + write_register (tdep->ppc_gp0_regnum + greg + 1, regval); greg += 2; } } @@ -236,18 +260,19 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, || TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION) { - write_memory (sp + structoffset, VALUE_CONTENTS (arg), len); + write_memory (sp + structoffset, val, len); store_address (val_buf, 4, sp + structoffset); structoffset += round2 (len, 8); } else { memset (val_buf, 0, 4); - memcpy (val_buf, VALUE_CONTENTS (arg), len); + memcpy (val_buf, val, len); } if (greg <= 10) { - memcpy (&deprecated_registers[REGISTER_BYTE (greg)], val_buf, 4); + ULONGEST regval = extract_unsigned_integer (val_buf, 4); + write_register (tdep->ppc_gp0_regnum + greg, regval); greg++; } else @@ -262,15 +287,14 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, && TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); char *v_val_buf = alloca (16); memset (v_val_buf, 0, 16); - memcpy (v_val_buf, VALUE_CONTENTS (arg), len); + memcpy (v_val_buf, val, len); if (vreg <= 13) { - memcpy (&deprecated_registers[REGISTER_BYTE (tdep->ppc_vr0_regnum - + vreg)], - v_val_buf, 16); + regcache_cooked_write (current_regcache, + tdep->ppc_vr0_regnum + vreg, + v_val_buf); vreg++; } else @@ -279,6 +303,26 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, argoffset += 16; } } + else if (len == 8 + && TYPE_CODE (type) == TYPE_CODE_ARRAY + && TYPE_VECTOR (type)) + { + char *v_val_buf = alloca (8); + memset (v_val_buf, 0, 8); + memcpy (v_val_buf, val, len); + if (greg <= 10) + { + regcache_cooked_write (current_regcache, + tdep->ppc_ev0_regnum + greg, + v_val_buf); + greg++; + } + else + { + write_memory (sp + argoffset, v_val_buf, 8); + argoffset += 8; + } + } } } @@ -293,7 +337,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int ppc_sysv_abi_broken_use_struct_convention (int gcc_p, struct type *value_type) { - if (TYPE_LENGTH (value_type) == 16 + if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8) && TYPE_VECTOR (value_type)) return 0; @@ -305,7 +349,7 @@ ppc_sysv_abi_broken_use_struct_convention (int gcc_p, struct type *value_type) int ppc_sysv_abi_use_struct_convention (int gcc_p, struct type *value_type) { - if (TYPE_LENGTH (value_type) == 16 + if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8) && TYPE_VECTOR (value_type)) return 0; diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index cf81eb9c1ea..f3c022c577f 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -49,6 +49,11 @@ void rs6000_frame_init_saved_regs (struct frame_info *); CORE_ADDR rs6000_frame_chain (struct frame_info *); int altivec_register_p (int regno); + +/* Return non-zero when the architecture has an FPU (or at least when + the ABI is using the FPU). */ +int ppc_floating_point_unit_p (struct gdbarch *gdbarch); + /* Private data that this module attaches to struct gdbarch. */ struct gdbarch_tdep diff --git a/gdb/printcmd.c b/gdb/printcmd.c index c7b0ffb1b3e..5196ef049b6 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -343,7 +343,7 @@ print_formatted (struct value *val, register int format, int size, with a format. */ void -print_scalar_formatted (char *valaddr, struct type *type, int format, int size, +print_scalar_formatted (void *valaddr, struct type *type, int format, int size, struct ui_file *stream) { LONGEST val_long; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 46733a3ac57..539905ed977 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -137,6 +137,18 @@ altivec_register_p (int regno) return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum); } +/* Use the architectures FP registers? */ +int +ppc_floating_point_unit_p (struct gdbarch *gdbarch) +{ + const struct bfd_arch_info *info = gdbarch_bfd_arch_info (gdbarch); + if (info->arch == bfd_arch_powerpc) + return (info->mach != bfd_mach_ppc_e500); + if (info->arch == bfd_arch_rs6000) + return 1; + return 0; +} + /* Read a LEN-byte address from debugged memory address MEMADDR. */ static CORE_ADDR @@ -1554,14 +1566,16 @@ rs6000_frame_saved_pc (struct frame_info *fi) return lr; } else - return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset, + return read_memory_addr (DEPRECATED_FRAME_CHAIN (fi) + + tdep->lr_frame_offset, wordsize); } if (fdata.lr_offset == 0) return read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum); - return read_memory_addr (FRAME_CHAIN (fi) + fdata.lr_offset, wordsize); + return read_memory_addr (DEPRECATED_FRAME_CHAIN (fi) + fdata.lr_offset, + wordsize); } /* If saved registers of frame FI are not known yet, read and cache them. @@ -1608,7 +1622,7 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) ->frame pointed to the outer-most address of the frame. In the mean time, the address of the prev frame is used as the base address of this frame. */ - frame_addr = FRAME_CHAIN (fi); + frame_addr = DEPRECATED_FRAME_CHAIN (fi); /* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr. All fpr's from saved_fpr to fp31 are saved. */ @@ -1746,8 +1760,8 @@ frame_initial_stack_address (struct frame_info *fi) /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ -/* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. */ +/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces + the frame's chain-pointer. */ /* In the case of the RS/6000, the frame's nominal address is the address of a 4-byte word containing the calling frame's address. */ @@ -2892,7 +2906,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); set_gdbarch_frame_align (gdbarch, rs6000_frame_align); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); @@ -2915,7 +2928,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else set_gdbarch_push_arguments (gdbarch, rs6000_push_arguments); - set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, rs6000_store_struct_return); set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address); set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame); @@ -2937,7 +2950,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, rs6000_frameless_function_invocation); - set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, rs6000_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, rs6000_frame_saved_pc); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 138ef78be08..18b7d108fe7 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1808,12 +1808,12 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frame_args_address (gdbarch, s390_frame_args_address); - set_gdbarch_frame_chain (gdbarch, s390_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, s390_frame_init_saved_regs); set_gdbarch_frame_locals_address (gdbarch, s390_frame_args_address); /* We can't do this */ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - set_gdbarch_store_struct_return (gdbarch, s390_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, s390_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value); /* Amount PC must be decremented by after a breakpoint. @@ -1840,9 +1840,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) s390_frameless_function_invocation); /* Return saved PC from a frame */ set_gdbarch_deprecated_frame_saved_pc (gdbarch, s390_frame_saved_pc); - /* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. */ - set_gdbarch_frame_chain (gdbarch, s390_frame_chain); + /* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and + produces the frame's chain-pointer. */ + set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain); set_gdbarch_saved_pc_after_call (gdbarch, s390_saved_pc_after_call); set_gdbarch_register_byte (gdbarch, s390_register_byte); set_gdbarch_pc_regnum (gdbarch, S390_PC_REGNUM); @@ -1870,7 +1870,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_push_return_address (gdbarch, s390_push_return_address); set_gdbarch_sizeof_call_dummy_words (gdbarch, diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 4bbcd8e5970..746e59970cb 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -250,6 +250,7 @@ const struct language_defn scm_language_defn = c_print_type, /* Print a type using appropriate syntax */ scm_val_print, /* Print a value using appropriate syntax */ scm_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ {"", "", "", ""}, /* Binary format info */ {"#o%lo", "#o", "o", ""}, /* Octal format info */ {"%ld", "", "d", ""}, /* Decimal format info */ diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 2a6449f305a..7649c6208bc 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -4371,12 +4371,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4); set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info); set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc); - set_gdbarch_frame_chain (gdbarch, sh_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, sh_frame_chain); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info); set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value); set_gdbarch_push_arguments (gdbarch, sh_push_arguments); - set_gdbarch_store_struct_return (gdbarch, sh_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, sh_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address); set_gdbarch_deprecated_pop_frame (gdbarch, sh_pop_frame); @@ -4614,11 +4614,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs); set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info); - set_gdbarch_frame_chain (gdbarch, sh64_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, sh64_frame_chain); set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register); set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value); set_gdbarch_push_arguments (gdbarch, sh64_push_arguments); - /*set_gdbarch_store_struct_return (gdbarch, sh64_store_struct_return);*/ + /*set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);*/ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention); set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame); @@ -4661,7 +4661,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_push_return_address (gdbarch, sh_push_return_address); diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c index 82c63d89978..ba5e7eac59a 100644 --- a/gdb/signals/signals.c +++ b/gdb/signals/signals.c @@ -30,6 +30,20 @@ #include <signal.h> +/* Always use __SIGRTMIN if it's available. SIGRTMIN is the lowest + _available_ realtime signal, not the lowest supported; glibc takes + several for its own use. */ + +#ifndef REALTIME_LO +# if defined(__SIGRTMIN) +# define REALTIME_LO __SIGRTMIN +# define REALTIME_HI __SIGRTMAX +# elif defined(SIGRTMIN) +# define REALTIME_LO SIGRTMIN +# define REALTIME_HI SIGRTMAX +# endif +#endif + /* This table must match in order and size the signals in enum target_signal in target.h. */ /* *INDENT-OFF* */ @@ -492,22 +506,6 @@ target_signal_from_host (int hostsig) } #endif -#if defined (SIGRTMIN) - if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX) - { - /* This block of TARGET_SIGNAL_REALTIME value is in order. */ - if (33 <= hostsig && hostsig <= 63) - return (enum target_signal) - (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33); - else if (hostsig == 32) - return TARGET_SIGNAL_REALTIME_32; - else if (64 <= hostsig && hostsig <= 127) - return (enum target_signal) - (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64); - else - error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal"); - } -#endif return TARGET_SIGNAL_UNKNOWN; } @@ -744,40 +742,12 @@ do_target_signal_to_host (enum target_signal oursig, default: #if defined (REALTIME_LO) - if (oursig >= TARGET_SIGNAL_REALTIME_33 - && oursig <= TARGET_SIGNAL_REALTIME_63) + if (oursig < REALTIME_LO || oursig >= REALTIME_HI) { - /* This block of signals is continuous, and - TARGET_SIGNAL_REALTIME_33 is 33 by definition. */ - int retsig = - (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33; - if (retsig >= REALTIME_LO && retsig < REALTIME_HI) - return retsig; - } -#if (REALTIME_LO < 33) - else if (oursig == TARGET_SIGNAL_REALTIME_32) - { - /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with - TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */ - return 32; - } -#endif -#if (REALTIME_HI > 64) - if (oursig >= TARGET_SIGNAL_REALTIME_64 - && oursig <= TARGET_SIGNAL_REALTIME_127) - { - /* This block of signals is continuous, and - TARGET_SIGNAL_REALTIME_64 is 64 by definition. */ - int retsig = - (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64; - if (retsig >= REALTIME_LO && retsig < REALTIME_HI) - return retsig; + *oursig_ok = 0; + return 0; } - -#endif -#endif -#if defined (SIGRTMIN) if (oursig >= TARGET_SIGNAL_REALTIME_33 && oursig <= TARGET_SIGNAL_REALTIME_63) { @@ -785,8 +755,7 @@ do_target_signal_to_host (enum target_signal oursig, TARGET_SIGNAL_REALTIME_33 is 33 by definition. */ int retsig = (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33; - if (retsig >= SIGRTMIN && retsig <= SIGRTMAX) - return retsig; + return retsig; } else if (oursig == TARGET_SIGNAL_REALTIME_32) { @@ -804,6 +773,7 @@ do_target_signal_to_host (enum target_signal oursig, return retsig; } #endif + *oursig_ok = 0; return 0; } diff --git a/gdb/somsolib.c b/gdb/somsolib.c index 08d3e1c5035..c4967521669 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -41,6 +41,7 @@ #include "gdbcmd.h" #include "language.h" #include "regcache.h" +#include "gdb_assert.h" #include <fcntl.h> diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 6e1b211f6d5..e9daad8de60 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -432,9 +432,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) CORE_ADDR sparc_frame_chain (struct frame_info *frame) { - /* Value that will cause FRAME_CHAIN_VALID to not worry about the chain - value. If it really is zero, we detect it later in - sparc_init_prev_frame. + /* Value that will cause DEPRECATED_FRAME_CHAIN_VALID to not worry + about the chain value. If it really is zero, we detect it later + in sparc_init_prev_frame. Note: kevinb/2003-02-18: The constant 1 used to be returned here, but, after some recent changes to frame_chain_valid(), @@ -2249,8 +2249,8 @@ sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp, } /* Make room for the arguments on the stack. */ - accumulate_size += CALL_DUMMY_STACK_ADJUST; - sp = ((sp - accumulate_size) & ~7) + CALL_DUMMY_STACK_ADJUST; + accumulate_size += DEPRECATED_CALL_DUMMY_STACK_ADJUST; + sp = ((sp - accumulate_size) & ~7) + DEPRECATED_CALL_DUMMY_STACK_ADJUST; /* `Push' arguments on the stack. */ for (i = 0, oregnum = 0, m_arg = sparc_args; @@ -3139,7 +3139,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 1); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address); @@ -3147,7 +3146,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM); set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM); - set_gdbarch_frame_chain (gdbarch, sparc_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, sparc_frame_chain); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_deprecated_frame_saved_pc (gdbarch, sparc_frame_saved_pc); @@ -3252,7 +3251,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); #endif - set_gdbarch_call_dummy_stack_adjust (gdbarch, 68); + set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 68); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_frame_args_skip (gdbarch, 68); set_gdbarch_function_start_offset (gdbarch, 0); @@ -3276,7 +3275,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); #endif set_gdbarch_stack_align (gdbarch, sparc32_stack_align); - set_gdbarch_store_struct_return (gdbarch, sparc32_store_struct_return); + set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); + set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); @@ -3308,7 +3308,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); #endif - set_gdbarch_call_dummy_stack_adjust (gdbarch, 128); + set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 128); set_gdbarch_frame_args_skip (gdbarch, 136); set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); @@ -3333,7 +3333,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); #endif set_gdbarch_stack_align (gdbarch, sparc64_stack_align); - set_gdbarch_store_struct_return (gdbarch, sparc64_store_struct_return); + set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); + set_gdbarch_deprecated_store_struct_return (gdbarch, sparc64_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, sparc64_use_struct_convention); set_gdbarch_write_sp (gdbarch, sparc64_write_sp); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fa7aa7312cf..433708822bf 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,54 @@ +2003-03-21 Stephane Carrez <stcarrez@nerim.fr> + + * gdb.asm/asm-source.exp: Set asm-arch for m6811 and m6812. + * gdb.asm/m68hc11.inc: New file for HC11/HC12 macros. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/default.exp: Fix regular expression. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/args.exp: Fix regular expression. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/help.exp: Allow Win32 child process. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/ending-run.exp: Check for Cygwin specific wrapper function + when stepping out of main(). + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/default.exp: Check for win32 specific message when calling + "run" without executable. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/args.exp: Expect .exe in output. + +2003-03-20 Corinna Vinschen <vinschen@redhat.com> + + * gdb.asm/asm-source.exp: Add appropriate --entry linker flag for + Cygwin native. + +2003-03-17 Andrew Cagney <cagney@redhat.com> + + From Elena Zannoni <ezannoni@redhat.com>. Test e500 abi and + vector registes. + * gdb.arch/e500-regs.c, gdb.arch/e500-regs.exp: New files. + * gdb.arch/e500-abi.c, gdb.arch/e500-abi.exp: New files. + +2003-03-17 David Carlton <carlton@math.stanford.edu> + + * gdb.base/watchpoint.exp (test_watchpoint_and_breakpoint): New + test, for PR breakpoints/38. + Call test_watchpoint_and_breakpoint. + * gdb.base/watchpoint.c (func3): New function. + (main): Call func3. + 2003-03-04 David Carlton <carlton@math.stanford.edu> * gdb.c++/templates.exp (do_tests): Accept valid const in "print diff --git a/gdb/testsuite/gdb.arch/e500-abi.c b/gdb/testsuite/gdb.arch/e500-abi.c new file mode 100644 index 00000000000..e2156124b11 --- /dev/null +++ b/gdb/testsuite/gdb.arch/e500-abi.c @@ -0,0 +1,106 @@ +#include <spe.h> + +/* Test PowerPC SPU extensions. */ + +#define vector __attribute__((vector_size(8))) + +vector unsigned short f_vec; +vector short g_vec; +vector float h_vec; +vector float i_vec; +vector unsigned int l_vec; +vector int m_vec; +vector int n_vec; + +/* dummy variables used in the testfile */ +vector unsigned int a_vec_d = {1, 1}; +vector int b_vec_d = {0, 0}; +vector float c_vec_d = {1.0, 1.0}; +vector unsigned int d_vec_d = {0, 0}; +vector int e_vec_d = {1, 1}; +vector unsigned short f_vec_d = {1, 1, 1, 1}; +vector short g_vec_d = {1, 1, 1, 1}; +vector float h_vec_d = {1.0, 1.0}; +vector float i_vec_d = {2.0, 2.0}; +vector unsigned int l_vec_d = {0, 0}; +vector int m_vec_d = {0, 0}; + + +vector int +vec_func (vector unsigned int a_vec_f, + vector int b_vec_f, + vector float c_vec_f, + vector unsigned int d_vec_f, + vector int e_vec_f, + vector unsigned short f_vec_f, + vector short g_vec_f, + vector float h_vec_f, + vector float i_vec_f, + vector unsigned int l_vec_f, + vector int m_vec_f) +{ + vector int n_vec; + + + int x,y,z; + x = 2; + y = 3; + + z = x + y; + z++; + n_vec = __ev_and(a_vec_f, b_vec_f); + n_vec = __ev_or(c_vec_f, d_vec_f); + n_vec = __ev_or(e_vec_f, f_vec_f); + n_vec = __ev_and(g_vec_f, h_vec_f); + n_vec = __ev_and(i_vec_f, l_vec_f); + n_vec = __ev_or(m_vec_f, a_vec_f); + + return n_vec; +} + +void marker(void) {}; + +int +main (void) +{ + vector unsigned int a_vec; + vector int b_vec; + vector float c_vec; + vector unsigned int d_vec; + vector int e_vec; + + vector int res_vec; + + a_vec = (vector unsigned int)__ev_create_u64 ((uint64_t) 55); + b_vec = __ev_create_s64 ((int64_t) 66); + c_vec = (vector float) __ev_create_fs (3.14F, 2.18F); + d_vec = (vector unsigned int) __ev_create_u32 ((uint32_t) 5, (uint32_t) 4); + e_vec = (vector int) __ev_create_s32 ((int32_t) 5, (int32_t) 6); + f_vec = (vector unsigned short) __ev_create_u16 ((uint16_t) 6, (uint16_t) 6, (uint16_t) 7, (uint16_t) 1); + g_vec = (vector short) __ev_create_s16 ((int16_t) 6, (int16_t) 6, (int16_t) 7, (int16_t) 9); + h_vec = (vector float) __ev_create_sfix32_fs (3.0F, 2.0F); + i_vec = (vector float) __ev_create_ufix32_fs (3.0F, 2.0F); + l_vec = (vector unsigned int) __ev_create_ufix32_u32 (3U, 5U); + m_vec = (vector int) __ev_create_sfix32_s32 (6, 9); + + marker (); + +#if 0 +/* This line is useful for cut-n-paste from a gdb session. */ +vec_func(a_vec,b_vec,c_vec,d_vec,e_vec,f_vec,g_vec,h_vec,i_vec,l_vec,m_vec) +#endif + + res_vec = vec_func (a_vec, /* goes in r3 */ + b_vec, /* goes in r4 */ + c_vec, /* goes in r5 */ + d_vec, /* goes in r6 */ + e_vec, /* goes in r7 */ + f_vec, /* goes in r8 */ + g_vec, /* goes in r9 */ + h_vec, /* goes in r10 */ + i_vec, /* goes in stack */ + l_vec, /* goes in stack */ + m_vec); /* goes in stack */ + + return 0; +} diff --git a/gdb/testsuite/gdb.arch/e500-abi.exp b/gdb/testsuite/gdb.arch/e500-abi.exp new file mode 100644 index 00000000000..0d11ad3e24c --- /dev/null +++ b/gdb/testsuite/gdb.arch/e500-abi.exp @@ -0,0 +1,90 @@ +# Copyright 2003 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu +# + +# Tests for Powerpc e500 ABI + + +if $tracelevel then { + strace $tracelevel +} + +# +# This file uses e500-abi.c for input. +# + +set prms_id 0 +set bug_id 0 + +if ![istarget "powerpc-*eabispe"] then { + verbose "Skipping e500 abi tests." + return +} + +set testfile "e500-abi" +set binfile ${objdir}/${subdir}/${testfile} + +set src1 ${srcdir}/${subdir}/${testfile}.c + +if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +# +# Run to `main' where we begin our tests. +# + +if ![runto_main] then { + gdb_suppress_tests +} + +gdb_test "b marker" "Breakpoint 2 at.*file.*e500-abi.c, line \[0-9\]+." "break marker" +gdb_test "continue" "Breakpoint 2.*marker.*e500-abi.c.*" "continue to marker" +gdb_test "finish" "Run till exit from .0.*marker.*at.*e500-abi.c.*main \\(\\) at.*e500-abi.c.*res_vec = vec_func \\(a_vec,.*goes in r3.*" "back to main (1)" + +# now all the arguments of vec_func are initialized + +set pattern "vec_func .a_vec_f=.0, 55., b_vec_f=.0, 66., c_vec_f=.3.14.*2.18.*, d_vec_f=.5, 4., e_vec_f=.5, 6., f_vec_f=.6, 6, 7, 1., g_vec_f=.6, 6, 7, 9., h_vec_f=.3, 2., i_vec_f=.3, 2., l_vec_f=.3, 5., m_vec_f=.6, 9.." + +set pattern1 $pattern +append pattern1 " at.*e500-abi.c.*x = 2;" + +# Now let's call the function. This function has > 8 args, +# the last ones will go on the stack. +gdb_test "p vec_func(a_vec,b_vec,c_vec,d_vec,e_vec,f_vec,g_vec,h_vec,i_vec,l_vec,m_vec)" \ +".\[0-9\]+ = .6, 63." "call inferior function with vectors (1) " + +# Let's call the function again with dummy arguments. This is to clean +# up the contents of the ev registers before the next call. +gdb_test "p vec_func(a_vec_d,b_vec_d,c_vec_d,d_vec_d,e_vec_d,f_vec_d,g_vec_d,h_vec_d,i_vec_d,l_vec_d,m_vec_d)" \ +".\[0-9\]+ = .1, 1." "call inferior function with vectors (2) " + +# Let's step into the function, to see if the args are printed correctly. +gdb_test "step" \ + $pattern1 \ + "step into vec_func" + +# Let's see if the result is returned correctly. +gdb_test "finish" \ + "Run till exit from .0.* at.*e500-abi.c.*main.*res_vec = vec_func .a_vec,.*goes in r3.*Value returned is.*= .6, 63." \ + "vector value returned correctly" diff --git a/gdb/testsuite/gdb.arch/e500-regs.c b/gdb/testsuite/gdb.arch/e500-regs.c new file mode 100644 index 00000000000..bae5f3955b4 --- /dev/null +++ b/gdb/testsuite/gdb.arch/e500-regs.c @@ -0,0 +1,38 @@ +#include <spe.h> +#include <stdio.h> + +#define vector __attribute__((vector_size(8))) + + +vector int +vector_fun (vector int a, vector int b) +{ + vector int c; + a = (vector int) __ev_create_s32 (2, 2); + b = (vector int) __ev_create_s32 (3, 3); + + c = __ev_and (a, b); + return c; +} + +int +main () +{ + vector int y; + vector int x; + vector int z; + int a; + + /* This line may look unnecessary but we do need it, because we want to + have a line to do a next over (so that gdb refetches the registers) + and we don't want the code to change any vector registers. + The splat operations below modify the VRs, + so we don't want to execute them yet. */ + a = 9; + x = (vector int) __ev_create_s32 (-2, -2); + y = (vector int) __ev_create_s32 (1, 1); + + z = vector_fun (x, y); + + return 0; +} diff --git a/gdb/testsuite/gdb.arch/e500-regs.exp b/gdb/testsuite/gdb.arch/e500-regs.exp new file mode 100644 index 00000000000..9224704b219 --- /dev/null +++ b/gdb/testsuite/gdb.arch/e500-regs.exp @@ -0,0 +1,229 @@ +# Copyright 2003 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu +# + +# Tests for Powerpc E500 register setting and fetching + +if $tracelevel then { + strace $tracelevel +} + +# +# Test the use of registers, especially E500 registers, for Powerpc. +# This file uses e500-regs.c for input. +# + +set prms_id 0 +set bug_id 0 + +if ![istarget "powerpc-*eabispe"] then { + verbose "Skipping e500 register tests." + return +} + +set testfile "e500-regs" +set binfile ${objdir}/${subdir}/${testfile} +set src1 ${srcdir}/${subdir}/${testfile}.c + +if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +# +# Run to `main' where we begin our tests. +# + +if ![runto_main] then { + gdb_suppress_tests +} + +# set all the registers integer portions to 1 +for {set i 0} {$i < 32} {incr i 1} { + for {set j 0} {$j < 2} {incr j 1} { + gdb_test "set \$ev$i.v2_int32\[$j\] = 1" "" "set reg ev$i.v4si.f\[$j\]" + } +} + +# Now execute some target code, so that GDB's register cache is flushed. + +#gdb_test "next" "" "" + +send_gdb "show endian\n" +gdb_expect { + -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" { + pass "endianness" + set endianness $expect_out(2,string) + } + -re ".*$gdb_prompt $" { + fail "couldn't get endianness" + } + timeout { fail "(timeout) endianness" } +} + +# And then read the E500 registers back, to see that +# a) the register write above worked, and +# b) the register read (below) also works. + +if {$endianness == "big"} { +set vector_register ".uint64 = 0x100000001, v2_float = .0x0, 0x0., v2_int32 = .0x1, 0x1., v4_int16 = .0x0, 0x1, 0x0, 0x1., v8_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." +} else { +set vector_register ".uint64 = 0x100000001, v2_float = .0x0, 0x0., v2_int32 = .0x1, 0x1., v4_int16 = .0x1, 0x0, 0x1, 0x0., v8_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." +} + +for {set i 0} {$i < 32} {incr i 1} { + gdb_test "info reg ev$i" "ev$i.*$vector_register" "info reg ev$i" +} + +# Test wether the GPRs are updated accordingly. (GPRs are just the lower +# 32 bits of the EV registers.) + +set general_register "0x1\[ \t\]+1" + +for {set i 0} {$i < 32} {incr i 1} { + gdb_test "info reg r$i" "r$i.*$general_register" "info reg r$i" +} + +# Now redo the same tests, but using the print command. +# Note: in LE case, the char array is printed WITHOUT the last character. +# Gdb treats the terminating null char in the array like the terminating +# null char in a string and doesn't print it. This is not a failure, but +# the way gdb works. + +if {$endianness == "big"} { + set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .0, 1, 0, 1., v8_int8 = ..000.000.000.001.000.000.000.001.." +} else { + set decimal_vector ".uint64 = 0x0000000100000001, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .1, 0, 1, 0., v8_int8 = ..001.000.000.000.001.000.000.000.001.000.000.000.001.000.000.." +} + +for {set i 0} {$i < 32} {incr i 1} { + gdb_test "print \$ev$i" ".* = $decimal_vector" "print ev$i" +} + +for {set i 0} {$i < 32} {incr i 1} { + set pattern$i ".*ev$i.*" + append pattern$i $vector_register +} + +send_gdb "info vector\n" +gdb_expect_list "info vector" ".*$gdb_prompt $" { +[$pattern0] +[$pattern1] +[$pattern2] +[$pattern3] +[$pattern4] +[$pattern5] +[$pattern6] +[$pattern7] +[$pattern8] +[$pattern9] +[$pattern10] +[$pattern11] +[$pattern12] +[$pattern13] +[$pattern14] +[$pattern15] +[$pattern16] +[$pattern17] +[$pattern18] +[$pattern19] +[$pattern20] +[$pattern21] +[$pattern22] +[$pattern23] +[$pattern24] +[$pattern25] +[$pattern26] +[$pattern27] +[$pattern28] +[$pattern29] +[$pattern30] +[$pattern31] +} + +# We must restart everything, because we have set important registers to +# some unusual values. + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} +if ![runto_main] then { + gdb_suppress_tests +} + +gdb_test "break vector_fun" \ + "Breakpoint 2 at.*e500-regs.c, line \[0-9\]+\\." \ + "Set breakpoint at vector_fun" + +# Actually it is nuch easier to see these results printed in hex. +# gdb_test "set output-radix 16" \ +# "Output radix now set to decimal 16, hex 10, octal 20." \ +# "Set output radix to hex" + +gdb_test "continue" \ + "Breakpoint 2, vector_fun .a=.-2, -2., b=.1, 1.*e500-regs.c.*ev_create_s32 .2, 2.;" \ + "continue to vector_fun" + +# Do a next over the assignment to vector 'a'. +gdb_test "next" ".*b = \\(vector int\\) __ev_create_s32 \\(3, 3\\);" \ + "next (1)" + +# Do a next over the assignment to vector 'b'. +gdb_test "next" "c = __ev_and \\(a, b\\);" \ + "next (2)" + +# Now 'a' should be '0x02020202...' and 'b' should be '0x03030303...' +gdb_test "print/x a" \ + ".*= .0x2, 0x2." \ + "print vector parameter a" + +gdb_test "print/x b" \ + ".*= .0x3, 0x3." \ + "print vector parameter b" + +# If we do an 'up' now, and print 'x' and 'y' we should see the values they +# have in main, not the values they have in vector_fun. +gdb_test "up" ".1.*main \\(\\) at.*e500-regs.c.*z = vector_fun \\(x, y\\);" \ + "up to main" + +gdb_test "print x" \ + ".*= .-2, -2." \ + "print vector x" + +gdb_test "print y" \ + ".*= .1, 1." \ + "print vector y" + +# now go back to vector_func and do a finish, to see if we can print the return +# value correctly. + +gdb_test "down" \ + ".0 vector_fun \\(a=.2, 2., b=.3, 3.\\) at.*e500-regs.c.*c = __ev_and \\(a, b\\);" \ + "down to vector_fun" + +gdb_test "finish" \ + "Run till exit from .0 vector_fun \\(a=.2, 2., b=.3, 3.\\) at.*e500-regs.c.*main \\(\\) at.*e500-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*= .2, 2." \ + "finish returned correct value" + + + diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index a42c61a575a..ac1bcd28fe0 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -53,10 +53,21 @@ if [istarget "x86_64-*-*"] then { } if [istarget "i\[3456\]86-*-*"] then { set asm-arch i386 + if [istarget "*-*-cygwin*"] then { + set link-flags "--entry _start" + } } if [istarget "m32r*-*"] then { set asm-arch m32r } +if [istarget "m6811-*-*"] then { + set asm-arch m68hc11 + set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" +} +if [istarget "m6812-*-*"] then { + set asm-arch m68hc11 + set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" +} if [istarget "mips*-*"] then { set asm-arch mips } diff --git a/gdb/testsuite/gdb.asm/m68hc11.inc b/gdb/testsuite/gdb.asm/m68hc11.inc new file mode 100644 index 00000000000..90795e3b50e --- /dev/null +++ b/gdb/testsuite/gdb.asm/m68hc11.inc @@ -0,0 +1,49 @@ + comment "subroutine prologue" + .macro gdbasm_enter + ldx _.frame + pshx + sts _.frame + .endm + + comment "subroutine epilogue" + .macro gdbasm_leave + pulx + stx _.frame + rts + .endm + + .macro gdbasm_call subr + jsr \subr + .endm + + .macro gdbasm_several_nops + nop + nop + nop + nop + .endm + + comment "exit (0)" + .macro gdbasm_exit0 + clra + clrb + wai + .endm + + comment "crt0 startup" + .macro gdbasm_startup + .sect .data + .globl _.frame +_.frame: .word 0 + .previous + lds #0x2000 + clr _.frame + clr _.frame+1 + .endm + + comment "Declare a data variable" + .macro gdbasm_datavar name value + .data +\name: + .long \value + .endm diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp index ff7ccab741b..e481ecb1e86 100644 --- a/gdb/testsuite/gdb.base/args.exp +++ b/gdb/testsuite/gdb.base/args.exp @@ -48,7 +48,7 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_test "run" \ - "Starting program.*args 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally." \ + "Starting program.*args(\\.exe)? 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally." \ "correct args printed" # @@ -59,7 +59,7 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_test "run" \ - "Starting program.*args 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally." \ + "Starting program.*args(\\.exe)? 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally." \ "correct args printed, one empty" # @@ -70,7 +70,7 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_test "run" \ - "Starting program.*args 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally." \ + "Starting program.*args(\\.exe)? 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally." \ "correct args printed, two empty" set GDBFLAGS $old_gdbflags diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 7e3ed445645..9179a53a39c 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -428,6 +428,9 @@ No executable file specified.* Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } -re "Starting program: .* +No executable specified, use .target exec.\\..*$gdb_prompt $"\ + { pass "run \"r\" abbreviation" } + -re "Starting program: .* No image loaded into target.*$gdb_prompt $"\ { pass "run \"r\" abbreviation" } -re "Starting program: .* @@ -457,6 +460,9 @@ No executable file specified.* Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\ { pass "run" } -re "Starting program: .* +No executable specified, use .target exec.\\..*$gdb_prompt $"\ + { pass "run" } + -re "Starting program: .* No image loaded into target.*$gdb_prompt $"\ { pass "run" } -re "Starting program: .* diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index f7e954f4aad..f89e142dd92 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -171,6 +171,10 @@ gdb_expect { # This is what happens on sparc64-elf ultra. pass "step out of main" } + -re ".*in.*dll_crt0_1.*$gdb_prompt $" { + # This is what happens on Cygwin. + pass "step out of main" + } -re ".*Program exited normally.*$gdb_prompt $" { # This is what happens on Linux i86 (and I would expect others) set program_exited 1 diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp index 69cf40db748..2eed1dca842 100644 --- a/gdb/testsuite/gdb.base/help.exp +++ b/gdb/testsuite/gdb.base/help.exp @@ -547,7 +547,7 @@ gdb_test "help support" "Support facilities\.\[\r\n\]+List of commands:.*\[\r\n\ # test help symbol-file gdb_test "help symbol-file" "Load symbol table from executable file FILE\.\[\r\n\]+The `file' command can also load symbol tables, as well as setting the file\[\r\n\]+to execute\." "help symbol-file" # test help target child -gdb_test "help target child" "Unix child process \\(started by the \"run\" command\\)\.|Undefined target command: \"child\"\. Try \"help target\"\." "help target child" +gdb_test "help target child" "(Unix|Win32) child process \\(started by the \"run\" command\\)\.|Undefined target command: \"child\"\. Try \"help target\"\." "help target child" # test help target procfs gdb_test "help target procfs" "Unix /proc child process \\(started by the \"run\" command\\)\.|Undefined target command: \"procfs\"\. Try \"help target\"\." "help target procfs (procfs version)" # test help target core diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c index 14ccecd5253..1a61ba16521 100644 --- a/gdb/testsuite/gdb.base/watchpoint.c +++ b/gdb/testsuite/gdb.base/watchpoint.c @@ -83,6 +83,18 @@ func2 () static_b = local_a; } +void +func3 () +{ + int x; + int y; + + x = 0; + x = 1; /* second x assignment */ + y = 1; + y = 2; +} + int func1 () { @@ -170,5 +182,8 @@ int main () recurser (2); marker6 (); + + func3 (); + return 0; } diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index f10955fce5a..c5e37d451a5 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -648,6 +648,27 @@ proc test_complex_watchpoint {} { } } +proc test_watchpoint_and_breakpoint {} { + global gdb_prompt + + # This is a test for PR gdb/38, which involves setting a + # watchpoint right after you've reached a breakpoint. + + if [runto func3] then { + gdb_breakpoint [gdb_get_line_number "second x assignment"] + gdb_continue_to_breakpoint "second x assignment" + gdb_test "watch x" ".*atchpoint \[0-9\]+: x" + gdb_test_multiple "next" "next after watch x" { + -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" { + pass "next after watch x" + } + -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" { + kfail "gdb/38" "next after watch x" + } + } + } +} + # Start with a fresh gdb. gdb_exit @@ -799,6 +820,17 @@ if [initialize] then { timeout {fail "(timeout) access watches disallowed"} } } + + # See above. + if [istarget "mips-idt-*"] then { + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load $binfile + initialize + } + + test_watchpoint_and_breakpoint } # Restore old timeout diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index f0c12a223bc..9bae316adcd 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1244,7 +1244,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) */ set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, v850_frame_init_saved_regs); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, v850_init_extra_frame_info); - set_gdbarch_frame_chain (gdbarch, v850_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, v850_frame_chain); set_gdbarch_saved_pc_after_call (gdbarch, v850_saved_pc_after_call); set_gdbarch_deprecated_frame_saved_pc (gdbarch, v850_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue); @@ -1272,7 +1272,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value); set_gdbarch_push_arguments (gdbarch, v850_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame); - set_gdbarch_store_struct_return (gdbarch, v850_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention); @@ -1284,8 +1284,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - /* set_gdbarch_call_dummy_stack_adjust */ set_gdbarch_fix_call_dummy (gdbarch, v850_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc); @@ -1294,8 +1292,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); - return gdbarch; } diff --git a/gdb/valops.c b/gdb/valops.c index f21b781b8ca..ff24a9f4e7c 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1374,9 +1374,9 @@ hand_function_call (struct value *function, int nargs, struct value **args) be able to correctly perform back traces. If a target is having trouble with backtraces, first thing to do is add FRAME_ALIGN() to its architecture vector. After that, try - adding SAVE_DUMMY_FRAME_TOS() and modifying FRAME_CHAIN so that - when the next outer frame is a generic dummy, it returns the - current frame's base. */ + adding SAVE_DUMMY_FRAME_TOS() and modifying + DEPRECATED_FRAME_CHAIN so that when the next outer frame is a + generic dummy, it returns the current frame's base. */ sp = old_sp; if (INNER_THAN (1, 2)) @@ -1599,7 +1599,10 @@ You must use a pointer to function type variable. Command ignored.", arg_name); on other architectures. This is because all the alignment is taken care of in the above code (ifdef REG_STRUCT_HAS_ADDR) and in hppa_push_arguments */ - if (EXTRA_STACK_ALIGNMENT_NEEDED) + /* NOTE: cagney/2003-03-24: The below code is very broken. Given an + odd sized parameter the below will mis-align the stack. As was + suggested back in '96, better to let PUSH_ARGUMENTS handle it. */ + if (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) { /* MVS 11/22/96: I think at least some of this stack_align code is really broken. Better to let PUSH_ARGUMENTS adjust the @@ -1611,8 +1614,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name); for (i = nargs - 1; i >= 0; i--) len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i])); - if (CALL_DUMMY_STACK_ADJUST_P) - len += CALL_DUMMY_STACK_ADJUST; + if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ()) + len += DEPRECATED_CALL_DUMMY_STACK_ADJUST; sp -= STACK_ALIGN (len) - len; } } @@ -1636,8 +1639,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name); { /* If stack grows up, we must leave a hole at the bottom, note that sp already has been advanced for the arguments! */ - if (CALL_DUMMY_STACK_ADJUST_P) - sp += CALL_DUMMY_STACK_ADJUST; + if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ()) + sp += DEPRECATED_CALL_DUMMY_STACK_ADJUST; sp = STACK_ALIGN (sp); } @@ -1646,24 +1649,19 @@ You must use a pointer to function type variable. Command ignored.", arg_name); /* MVS 11/22/96: I think at least some of this stack_align code is really broken. Better to let PUSH_ARGUMENTS adjust the stack in a target-defined manner. */ - if (CALL_DUMMY_STACK_ADJUST_P) + if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ()) if (INNER_THAN (1, 2)) { /* stack grows downward */ - sp -= CALL_DUMMY_STACK_ADJUST; + sp -= DEPRECATED_CALL_DUMMY_STACK_ADJUST; } /* Store the address at which the structure is supposed to be - written. Note that this (and the code which reserved the space - above) assumes that gcc was used to compile this function. Since - it doesn't cost us anything but space and if the function is pcc - it will ignore this value, we will make that assumption. - - Also note that on some machines (like the sparc) pcc uses a - convention like gcc's. */ - - if (struct_return) - STORE_STRUCT_RETURN (struct_addr, sp); + written. */ + /* NOTE: 2003-03-24: Since PUSH_ARGUMENTS can (and typically does) + store the struct return address, this call is entirely redundant. */ + if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ()) + DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp); /* Write the stack pointer. This is here because the statements above might fool with it. On SPARC, this write also stores the register diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index f5cd2676e85..d2ac4212872 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -42,11 +42,10 @@ static gdbarch_register_virtual_type_ftype vax_register_virtual_type; static gdbarch_skip_prologue_ftype vax_skip_prologue; static gdbarch_saved_pc_after_call_ftype vax_saved_pc_after_call; static gdbarch_frame_num_args_ftype vax_frame_num_args; -static gdbarch_frame_chain_ftype vax_frame_chain; +static gdbarch_deprecated_frame_chain_ftype vax_frame_chain; static gdbarch_frame_args_address_ftype vax_frame_args_address; static gdbarch_frame_locals_address_ftype vax_frame_locals_address; -static gdbarch_store_struct_return_ftype vax_store_struct_return; static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype vax_extract_struct_value_address; @@ -647,7 +646,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); - set_gdbarch_frame_chain (gdbarch, vax_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, vax_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc); set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address); @@ -660,7 +659,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Return value info */ - set_gdbarch_store_struct_return (gdbarch, vax_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, vax_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address); @@ -678,7 +677,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc); diff --git a/gdb/version.in b/gdb/version.in index c9ca6c9020d..dae81b3d271 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-03-17-cvs +2003-03-26-cvs diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index ced11dca01c..321d9c3fec5 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1016,7 +1016,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments); set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, x86_64_pop_frame); - set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, x86_64_store_struct_return); set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value); /* Override, since this is handled by x86_64_extract_return_value. */ set_gdbarch_extract_struct_value_address (gdbarch, NULL); @@ -1025,7 +1025,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs); set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue); - set_gdbarch_frame_chain (gdbarch, x86_64_linux_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, x86_64_linux_frame_chain); set_gdbarch_frameless_function_invocation (gdbarch, x86_64_frameless_function_invocation); /* FIXME: kettenis/20021026: These two are GNU/Linux-specific and diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 2ccbb1e60b5..5408a08adb2 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1055,12 +1055,12 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) xstormy16_init_extra_frame_info); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, xstormy16_frame_init_saved_regs); - set_gdbarch_frame_chain (gdbarch, xstormy16_frame_chain); + set_gdbarch_deprecated_frame_chain (gdbarch, xstormy16_frame_chain); set_gdbarch_deprecated_get_saved_register (gdbarch, xstormy16_get_saved_register); set_gdbarch_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call); set_gdbarch_deprecated_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue); - set_gdbarch_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid); + set_gdbarch_deprecated_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid); set_gdbarch_in_function_epilogue_p (gdbarch, xstormy16_in_function_epilogue_p); @@ -1088,7 +1088,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value); set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame); - set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return); + set_gdbarch_deprecated_store_struct_return (gdbarch, xstormy16_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, @@ -1101,11 +1101,10 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - /* set_gdbarch_call_dummy_stack_adjust */ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc); + set_gdbarch_char_signed (gdbarch, 0); set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); @@ -1115,7 +1114,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address); set_gdbarch_stack_align (gdbarch, xstormy16_stack_align); - set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); set_gdbarch_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos); diff --git a/include/ChangeLog b/include/ChangeLog index c98e61e4360..0e558d3c184 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,15 @@ +2003-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * ansidecl.h (ATTRIBUTE_NONNULL, ATTRIBUTE_NULL_PRINTF, + ATTRIBUTE_NULL_PRINTF_1, ATTRIBUTE_NULL_PRINTF_2, + ATTRIBUTE_NULL_PRINTF_3, ATTRIBUTE_NULL_PRINTF_4, + ATTRIBUTE_NULL_PRINTF_5): New. + (ATTRIBUTE_PRINTF): Add ATTRIBUTE_NONNULL. + +2003-03-17 Jan Hubicka <jh@suse.cz> + + * hashtab.h (htab_traverse_noresize): Declare. + 2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * libiberty.h: Document return value of physmem routines. diff --git a/include/ansidecl.h b/include/ansidecl.h index d169b4f50ed..f8f2d737bf0 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -268,8 +268,21 @@ So instead we use the macro below and test it against specific values. */ #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) #endif /* ATTRIBUTE_NORETURN */ +/* Attribute `nonnull' was valid as of gcc 3.3. */ +#ifndef ATTRIBUTE_NONNULL +# if (GCC_VERSION >= 3003) +# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) +# else +# define ATTRIBUTE_NONNULL(m) +# endif /* GNUC >= 3.3 */ +#endif /* ATTRIBUTE_NONNULL */ + +/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL. + This was the case for the `printf' format attribute by itself + before GCC 3.3, but as of 3.3 we need to add the `nonnull' + attribute to retain this behavior. */ #ifndef ATTRIBUTE_PRINTF -#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) +#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) @@ -277,6 +290,21 @@ So instead we use the macro below and test it against specific values. */ #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ +/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A + NULL format specifier was allowed as of gcc 3.3. */ +#ifndef ATTRIBUTE_NULL_PRINTF +# if (GCC_VERSION >= 3003) +# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) +# else +# define ATTRIBUTE_NULL_PRINTF(m, n) +# endif /* GNUC >= 3.3 */ +# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2) +# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3) +# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4) +# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5) +# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6) +#endif /* ATTRIBUTE_NULL_PRINTF */ + /* We use __extension__ in some places to suppress -pedantic warnings about GCC extensions. This feature didn't work properly before gcc 2.8. */ diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog index b2eec4cbe93..be6154d21c1 100644 --- a/include/coff/ChangeLog +++ b/include/coff/ChangeLog @@ -1,3 +1,10 @@ +2003-03-25 Stan Cox <scox@redhat.com> + Nick Clifton <nickc@redhat.com> + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * arm.h (ARM_NOTE_SECTION): Define. + 2002-11-30 Alan Modra <amodra@bigpond.net.au> * ecoff.h: Replace boolean with bfd_boolean. diff --git a/include/coff/arm.h b/include/coff/arm.h index bcfdcbe4784..8b90228ca98 100644 --- a/include/coff/arm.h +++ b/include/coff/arm.h @@ -124,3 +124,5 @@ struct external_reloc #define RELOC struct external_reloc #define RELSZ 14 #endif + +#define ARM_NOTE_SECTION ".note" diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index e87cdd2e045..5411f769169 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,4 +1,11 @@ -Mon Mar 3 20:35:58 2003 J"orn Rennecke <joern.rennecke@superh.com> +2003-03-25 Stan Cox <scox@redhat.com> + Nick Clifton <nickc@redhat.com> + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * arm.h (ARM_NOTE_SECTION): Define. + +2003-03-03 J"orn Rennecke <joern.rennecke@superh.com> * sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E, and SH2E & SH4 merge to SH4, not SH2E. diff --git a/include/elf/arm.h b/include/elf/arm.h index 534701753c4..3b3f8d0e235 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -140,4 +140,7 @@ START_RELOC_NUMBERS (elf_arm_reloc_type) RELOC_NUMBER (R_ARM_RBASE, 255) END_RELOC_NUMBERS (R_ARM_max) +/* The name of the note section used to identify arm variants. */ +#define ARM_NOTE_SECTION ".note.arm.ident" + #endif /* _ELF_ARM_H */ diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index f60f7b169f7..97c2f443c38 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-03-20 Nick Clifton <nickc@redhat.com> + + * sim-arm.h (sim_arm_regs): Add Maverick co-processor + registers. + 2003-02-27 Andrew Cagney <cagney@redhat.com> * remote-sim.h (sim_open, sim_load, sim_create_inferior): Rename diff --git a/include/gdb/sim-arm.h b/include/gdb/sim-arm.h index 6d80700ad7e..fae11f0b16b 100644 --- a/include/gdb/sim-arm.h +++ b/include/gdb/sim-arm.h @@ -1,6 +1,6 @@ /* This file defines the interface between the Arm simulator and GDB. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Red Hat. @@ -55,7 +55,24 @@ enum sim_arm_regs SIM_ARM_FP6_REGNUM, SIM_ARM_FP7_REGNUM, SIM_ARM_FPS_REGNUM, - SIM_ARM_PS_REGNUM + SIM_ARM_PS_REGNUM, + SIM_ARM_MAVERIC_COP0R0_REGNUM, + SIM_ARM_MAVERIC_COP0R1_REGNUM, + SIM_ARM_MAVERIC_COP0R2_REGNUM, + SIM_ARM_MAVERIC_COP0R3_REGNUM, + SIM_ARM_MAVERIC_COP0R4_REGNUM, + SIM_ARM_MAVERIC_COP0R5_REGNUM, + SIM_ARM_MAVERIC_COP0R6_REGNUM, + SIM_ARM_MAVERIC_COP0R7_REGNUM, + SIM_ARM_MAVERIC_COP0R8_REGNUM, + SIM_ARM_MAVERIC_COP0R9_REGNUM, + SIM_ARM_MAVERIC_COP0R10_REGNUM, + SIM_ARM_MAVERIC_COP0R11_REGNUM, + SIM_ARM_MAVERIC_COP0R12_REGNUM, + SIM_ARM_MAVERIC_COP0R13_REGNUM, + SIM_ARM_MAVERIC_COP0R14_REGNUM, + SIM_ARM_MAVERIC_COP0R15_REGNUM, + SIM_ARM_MAVERIC_DSPSC_REGNUM }; #ifdef __cplusplus diff --git a/include/hashtab.h b/include/hashtab.h index 4995a9a10e0..7acb5eb2859 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -168,6 +168,7 @@ extern void htab_clear_slot PARAMS ((htab_t, void **)); extern void htab_remove_elt PARAMS ((htab_t, void *)); extern void htab_traverse PARAMS ((htab_t, htab_trav, void *)); +extern void htab_traverse_noresize PARAMS ((htab_t, htab_trav, void *)); extern size_t htab_size PARAMS ((htab_t)); extern size_t htab_elements PARAMS ((htab_t)); diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 53adca32362..35c97a68f47 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,9 @@ +2003-03-21 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * s390.h (s390_opcode_arch_val): Rename to s390_opcode_mode_val. + (S390_OPCODE_ESAME): Rename to S390_OPCODE_ZARCH. + (s390_opcode): Remove architecture. Add modes and min_cpu. + 2003-03-17 D.Venkatasubramanian <dvenkat@noida.hcltech.com> * h8300.h (O_SYS_CMDLINE): New pseudo opcode for command line diff --git a/include/opcode/s390.h b/include/opcode/s390.h index 1a42be6603a..6e32723b235 100644 --- a/include/opcode/s390.h +++ b/include/opcode/s390.h @@ -24,10 +24,17 @@ /* List of instruction sets variations. */ -enum s390_opcode_arch_val +enum s390_opcode_mode_val { S390_OPCODE_ESA = 0, - S390_OPCODE_ESAME + S390_OPCODE_ZARCH + }; + +enum s390_opcode_cpu_val + { + S390_OPCODE_G5 = 0, + S390_OPCODE_G6, + S390_OPCODE_Z900 }; /* The opcode table is an array of struct s390_opcode. */ @@ -55,8 +62,11 @@ struct s390_opcode appear in assembly code, and are terminated by a zero. */ unsigned char operands[6]; - /* Bitmask of architectures this opcode is available for. */ - unsigned int architecture; + /* Bitmask of execution modes this opcode is available for. */ + unsigned int modes; + + /* First cpu this opcode is available for. */ + enum s390_opcode_cpu_val min_cpu; }; /* The table itself is sorted by major opcode number, and is otherwise diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index a45e537f4e2..61f6b982a57 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,14 @@ +2003-03-23 Alexandre Oliva <aoliva@redhat.com> + + * Makefile.in (MULTIOSDIR): New macro. Use $(CC) $(LIBCFLAGS) + instead of $$CC alone. + (install_to_tooldir): Use it. + +2003-17-03 Jan Hubicka <jh@suse.cz> + + * hashtab.c (htab_traverse_noresize): Break out from ... + * hashtab.c (htab_traverse): ... here. + 2003-12-03 Jan Hubicka <jh@suse.cz> * hashtab.c (htab_expand): Fix warning. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 064179669bd..737d239450a 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -286,11 +286,16 @@ install_to_libdir: all fi @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install +# This is tricky. Even though CC in the Makefile contains +# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the +# default multilib, so we have to take LIBCFLAGS into account as well, +# since it will be passed the multilib flags. +MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory` install_to_tooldir: all - ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n - ( cd $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` ; $(RANLIB) $(TARGETLIB)n ) - mv -f $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB) + ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n + ( cd $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR) ; $(RANLIB) $(TARGETLIB)n ) + mv -f $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install # needed-list is used by libstdc++. NEEDED is the list of functions diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index ebaa43b2c50..2f8dfd6c581 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -603,7 +603,7 @@ htab_clear_slot (htab, slot) argument. */ void -htab_traverse (htab, callback, info) +htab_traverse_noresize (htab, callback, info) htab_t htab; htab_trav callback; PTR info; @@ -611,9 +611,6 @@ htab_traverse (htab, callback, info) PTR *slot; PTR *limit; - if ((htab->n_elements - htab->n_deleted) * 8 < htab->size) - htab_expand (htab); - slot = htab->entries; limit = slot + htab->size; @@ -628,6 +625,24 @@ htab_traverse (htab, callback, info) while (++slot < limit); } +/* Like htab_traverse_noresize, but does resize the table when it is + too empty to improve effectivity of subsequent calls. */ + +void +htab_traverse (htab, callback, info) + htab_t htab; + htab_trav callback; + PTR info; +{ + PTR *slot; + PTR *limit; + + if ((htab->n_elements - htab->n_deleted) * 8 < htab->size) + htab_expand (htab); + + htab_traverse_noresize (htab, callback, info); +} + /* Return the current size of given hash table. */ size_t diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 94d8721984b..b1338964e53 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,33 @@ +2003-03-25 Stan Cox <scox@redhat.com> + Nick Clifton <nickc@redhat.com> + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * arm-dis.c (regnames): Add iWMMXt register names. + (set_iwmmxt_regnames): New function. + (print_insn_arm): Handle iWMMXt formatters. + * arm-opc.h: Document iWMMXt formatters. + (arm_opcod): Add iWMMXt instructions. + +2003-03-22 Doug Evans <dje@sebabeach.org> + + * i386-dis.c (dis386): Recognize icebp (0xf1). + +2003-03-21 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * s390-dis.c (init_disasm): Rename S390_OPCODE_ESAME to + S390_OPCODE_ZARCH. + (print_insn_s390): Use new modes field of s390_opcodes. + * s390-mkopc.c (ARCHBITS_ESAONLY, ARCHBITS_ESA, ARCHBITS_ESAME): Remove. + (s390_opcode_mode_val, s390_opcode_cpu_val): New enums. + (struct op_struct): Remove archbits. Add mode_bits and min_cpu. + (insertOpcode): Replace archbits by min_cpu and mode_bits. + (dumpTable): Write mode_bits and min_cpu instead of archbits. + (main): Adapt to new format in s390-opcode.txt. + * s390-opc.c (s390_opformats): Replace archbits by min_cpu and + mode_bits. + * s390-opc.txt: Replace archbits by min_cpu and mode_bits. + 2003-03-17 Nick Clifton <nickc@redhat.com> * ppc-opc.c: Fix formatting. Update copyright date. diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 62a2a39ab62..8fb970245dc 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -1,24 +1,24 @@ /* Instruction printing code for the ARM - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modification by James G. Smith (jsmith@cygnus.co.uk) -This file is part of libopcodes. + This file is part of libopcodes. -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "dis-asm.h" @@ -70,7 +70,21 @@ static arm_regname regnames[] = { "atpcs", "Select register names used in the ATPCS", { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "IP", "SP", "LR", "PC" }}, { "special-atpcs", "Select special register names used in the ATPCS", - { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL", "FP", "IP", "SP", "LR", "PC" }} + { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL", "FP", "IP", "SP", "LR", "PC" }}, + { "iwmmxt_regnames", "Select register names used on the Intel(r) Wireless MMX(tm) technology coprocessor", + { "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7", "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15"}}, + { "iwmmxt_Cregnames", "Select control register names used on the Intel(r) Wireless MMX(tm) technology coprocessor", + {"wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved", "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved"}} +}; + +static char * iwmmxt_wwnames[] = +{"b", "h", "w", "d"}; + +static char * iwmmxt_wwssnames[] = +{"b", "bus", "b", "bss", + "h", "hus", "h", "hss", + "w", "wus", "w", "wss", + "d", "dus", "d", "dss" }; /* Default to GCC register name set. */ @@ -98,11 +112,15 @@ static void parse_disassembler_options PARAMS ((char *)); static int print_insn PARAMS ((bfd_vma, struct disassemble_info *, bfd_boolean)); -int get_arm_regname_num_options (void); -int set_arm_regname_option (int option); -int get_arm_regnames (int option, const char **setname, - const char **setdescription, - const char ***register_names); +static int set_iwmmxt_regnames + PARAMS ((void)); + +int get_arm_regname_num_options + PARAMS ((void)); +int set_arm_regname_option + PARAMS ((int)); +int get_arm_regnames + PARAMS ((int, const char **, const char **, const char ***)); /* Functions. */ int @@ -167,6 +185,24 @@ arm_decode_shift (given, func, stream) } } +static int +set_iwmmxt_regnames () +{ + const char * setname; + const char * setdesc; + const char ** regnames; + int iwmmxt_regnames = 0; + int num_regnames = get_arm_regname_num_options (); + + get_arm_regnames (iwmmxt_regnames, &setname, + &setdesc, ®names); + while ((strcmp ("iwmmxt_regnames", setname)) + && (iwmmxt_regnames < num_regnames)) + get_arm_regnames (++iwmmxt_regnames, &setname, &setdesc, ®names); + + return iwmmxt_regnames; +} + /* Print one instruction from PC on INFO->STREAM. Return the size of the instruction (always 4 on ARM). */ @@ -179,9 +215,15 @@ print_insn_arm (pc, info, given) const struct arm_opcode *insn; void *stream = info->stream; fprintf_ftype func = info->fprintf_func; + static int iwmmxt_regnames = 0; for (insn = arm_opcodes; insn->assembler; insn++) { + if (insn->value == FIRST_IWMMXT_INSN + && info->mach != bfd_mach_arm_XScale + && info->mach != bfd_mach_arm_iWMMXt) + insn = insn + IWMMXT_INSN_COUNT; + if ((given & insn->mask) == insn->value) { char * c; @@ -629,6 +671,63 @@ print_insn_arm (pc, info, given) func (stream, "f%d", reg); } break; + + case 'w': + { + long reg; + + if (bitstart != bitend) + { + reg = given >> bitstart; + reg &= (2 << (bitend - bitstart)) - 1; + if (bitend - bitstart == 1) + func (stream, "%s", iwmmxt_wwnames[reg]); + else + func (stream, "%s", iwmmxt_wwssnames[reg]); + } + else + { + reg = (((given >> 8) & 0x1) | + ((given >> 22) & 0x1)); + func (stream, "%s", iwmmxt_wwnames[reg]); + } + } + break; + + case 'g': + { + long reg; + int current_regnames; + + if (! iwmmxt_regnames) + iwmmxt_regnames = set_iwmmxt_regnames (); + current_regnames = set_arm_regname_option + (iwmmxt_regnames); + + reg = given >> bitstart; + reg &= (2 << (bitend - bitstart)) - 1; + func (stream, "%s", arm_regnames[reg]); + set_arm_regname_option (current_regnames); + } + break; + + case 'G': + { + long reg; + int current_regnames; + + if (! iwmmxt_regnames) + iwmmxt_regnames = set_iwmmxt_regnames (); + current_regnames = set_arm_regname_option + (iwmmxt_regnames + 1); + + reg = given >> bitstart; + reg &= (2 << (bitend - bitstart)) - 1; + func (stream, "%s", arm_regnames[reg]); + set_arm_regname_option (current_regnames); + } + break; + default: abort (); } @@ -734,6 +833,54 @@ print_insn_arm (pc, info, given) } break; + case 'L': + switch (given & 0x00400100) + { + case 0x00000000: func (stream, "b"); break; + case 0x00400000: func (stream, "h"); break; + case 0x00000100: func (stream, "w"); break; + case 0x00400100: func (stream, "d"); break; + default: + break; + } + break; + + case 'Z': + { + int value; + /* given (20, 23) | given (0, 3) */ + value = ((given >> 16) & 0xf0) | (given & 0xf); + func (stream, "%d", value); + } + break; + + case 'l': + /* This is like the 'A' operator, except that if + the width field "M" is zero, then the offset is + *not* multiplied by four. */ + { + int offset = given & 0xff; + int multiplier = (given & 0x00000100) ? 4 : 1; + + func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]); + + if (offset) + { + if ((given & 0x01000000) != 0) + func (stream, ", %s#%d]%s", + ((given & 0x00800000) == 0 ? "-" : ""), + offset * multiplier, + ((given & 0x00200000) != 0 ? "!" : "")); + else + func (stream, "], %s#%d", + ((given & 0x00800000) == 0 ? "-" : ""), + offset * multiplier); + } + else + func (stream, "]"); + } + break; + default: abort (); } diff --git a/opcodes/arm-opc.h b/opcodes/arm-opc.h index 213d4f034de..233a8303fea 100644 --- a/opcodes/arm-opc.h +++ b/opcodes/arm-opc.h @@ -1,6 +1,6 @@ /* Opcode table for the ARM. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -60,6 +60,13 @@ struct thumb_opcode %m print register mask for ldm/stm instruction %C print the PSR sub type. %F print the COUNT field of a LFM/SFM instruction. +IWMMXT specific format options: + %<bitfield>g print as an iWMMXt 64-bit register + %<bitfield>G print as an iWMMXt general purpose or control register + %<bitfield>w print as an iWMMXt width field - [bhwd]ss/us + %Z print the Immediate of a WSHUFH instruction. + %L print as an iWMMXt N/M width field. + %l like 'A' except use byte offsets for 'B' & 'H' versions Thumb specific format options: %D print Thumb register (bits 0..2 as high number if bit 7 set) %S print Thumb register (bits 3..5 as high number if bit 6 set) @@ -101,6 +108,59 @@ static const struct arm_opcode arm_opcodes[] = {0x0c500000, 0x0ff00fff, "mra%c\t%12-15r, %16-19r, acc0"}, {0xf450f000, 0xfc70f000, "pld\t%a"}, + /* Intel(r) Wireless MMX(tm) technology instructions. */ +#define FIRST_IWMMXT_INSN 0x0e130130 +#define IWMMXT_INSN_COUNT 47 + {0x0e130130, 0x0f3f0fff, "tandc%22-23w%c\t%12-15r"}, + {0x0e400010, 0x0ff00f3f, "tbcst%6-7w%c\t%16-19g, %12-15r"}, + {0x0e130170, 0x0f3f0ff8, "textrc%22-23w%c\t%12-15r, #%0-2d"}, + {0x0e100070, 0x0f300ff0, "textrm%3?su%22-23w%c\t%12-15r, %16-19g, #%0-2d"}, + {0x0e600010, 0x0ff00f38, "tinsr%6-7w%c\t%16-19g, %12-15r, #%0-2d"}, + {0x0e000110, 0x0ff00fff, "tmcr%c\t%16-19G, %12-15r"}, + {0x0c400000, 0x0ff00ff0, "tmcrr%c\t%0-3g, %12-15r, %16-19r"}, + {0x0e2c0010, 0x0ffc0e10, "tmia%17?tb%16?tb%c\t%5-8g, %0-3r, %12-15r"}, + {0x0e200010, 0x0fff0e10, "tmia%c\t%5-8g, %0-3r, %12-15r"}, + {0x0e280010, 0x0fff0e10, "tmiaph%c\t%5-8g, %0-3r, %12-15r"}, + {0x0e100030, 0x0f300fff, "tmovmsk%22-23w%c\t%12-15r, %16-19g"}, + {0x0e100110, 0x0ff00ff0, "tmrc%c\t%12-15r, %16-19G"}, + {0x0c500000, 0x0ff00ff0, "tmrrc%c\t%12-15r, %16-19r, %0-3g"}, + {0x0e130150, 0x0f3f0fff, "torc%22-23w%c\t%12-15r"}, + {0x0e0001c0, 0x0f300fff, "wacc%22-23w%c\t%12-15g, %16-19g"}, + {0x0e000180, 0x0f000ff0, "wadd%20-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000020, 0x0f800ff0, "waligni%c\t%12-15g, %16-19g, %0-3g, #%20-22d"}, + {0x0e800020, 0x0fc00ff0, "walignr%20-21d%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e200000, 0x0fe00ff0, "wand%20'n%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e800000, 0x0fa00ff0, "wavg2%22?hb%20'r%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000060, 0x0f300ff0, "wcmpeq%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e100060, 0x0f100ff0, "wcmpgt%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0xfc100100, 0xfe500f00, "wldrw\t%12-15G, %A"}, + {0x0c100000, 0x0e100e00, "wldr%L%c\t%12-15g, %l"}, + {0x0e400100, 0x0fc00ff0, "wmac%21?su%20'z%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e800100, 0x0fd00ff0, "wmadd%21?su%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000160, 0x0f100ff0, "wmax%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e100160, 0x0f100ff0, "wmin%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000100, 0x0fc00ff0, "wmul%21?su%20?ml%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000000, 0x0ff00ff0, "wor%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000080, 0x0f000ff0, "wpack%20-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e300040, 0x0f300ff0, "wror%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e300148, 0x0f300ffc, "wror%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"}, + {0x0e000120, 0x0fa00ff0, "wsad%22?hb%20'z%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e0001e0, 0x0f000ff0, "wshufh%c\t%12-15g, %16-19g, #%Z"}, + {0x0e100040, 0x0f300ff0, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e100148, 0x0f300ffc, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"}, + {0x0e000040, 0x0f300ff0, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e000148, 0x0f300ffc, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"}, + {0x0e200040, 0x0f300ff0, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e200148, 0x0f300ffc, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"}, + {0xfc000100, 0xfe500f00, "wstrw\t%12-15G, %A"}, + {0x0c000000, 0x0e100e00, "wstr%L%c\t%12-15g, %l"}, + {0x0e0001a0, 0x0f000ff0, "wsub%20-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e0000c0, 0x0f100fff, "wunpckeh%21?su%22-23w%c\t%12-15g, %16-19g"}, + {0x0e0000e0, 0x0f100fff, "wunpckel%21?su%22-23w%c\t%12-15g, %16-19g"}, + {0x0e1000c0, 0x0f300ff0, "wunpckih%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e1000e0, 0x0f300ff0, "wunpckil%22-23w%c\t%12-15g, %16-19g, %0-3g"}, + {0x0e100000, 0x0ff00ff0, "wxor%c\t%12-15g, %16-19g, %0-3g"}, + /* V5 Instructions. */ {0xe1200070, 0xfff000f0, "bkpt\t0x%16-19X%12-15X%8-11X%0-3X"}, {0xfa000000, 0xfe000000, "blx\t%B"}, diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index f185b2858c4..79faee676e5 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -736,7 +736,7 @@ static const struct dis386 dis386[] = { { "outS", indirDX, eAX, XX }, /* f0 */ { "(bad)", XX, XX, XX }, /* lock prefix */ - { "(bad)", XX, XX, XX }, + { "icebp", XX, XX, XX }, { "(bad)", XX, XX, XX }, /* repne */ { "(bad)", XX, XX, XX }, /* repz */ { "hlt", XX, XX, XX }, diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c index 8745a894373..33121c78b70 100644 --- a/opcodes/s390-dis.c +++ b/opcodes/s390-dis.c @@ -57,7 +57,7 @@ init_disasm (info) current_arch_mask = 1 << S390_OPCODE_ESA; break; case bfd_mach_s390_64: - current_arch_mask = 1 << S390_OPCODE_ESAME; + current_arch_mask = 1 << S390_OPCODE_ZARCH; break; default: abort (); @@ -161,7 +161,7 @@ print_insn_s390 (memaddr, info) const unsigned char *opindex; /* Check architecture. */ - if (!(opcode->architecture & current_arch_mask)) + if (!(opcode->modes & current_arch_mask)) continue; /* Check signature of the opcode. */ if ((buffer[1] & opcode->mask[1]) != opcode->opcode[1] diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c index d79ff810f0e..caa9993a881 100644 --- a/opcodes/s390-mkopc.c +++ b/opcodes/s390-mkopc.c @@ -23,21 +23,28 @@ #include <stdlib.h> #include <string.h> -/* ARCHBITS_ESA and ARCH_ESAME correspond to the bit numbers defined - by s390_opcode_arch_val in include/opcode/s390.h: - ARCHBITS_ESAONLY = (1<<S390_OPCODE_ESA) - ARCHBITS_ESA = (1<<S390_OPCODE_ESA) + (1<<S390_OPCODE_ESAME) - ARCHBITS_ESA = (1<<S390_OPCODE_ESAME). */ -#define ARCHBITS_ESAONLY 1 -#define ARCHBITS_ESA 3 -#define ARCHBITS_ESAME 2 +/* Taken from opcodes/s390.h */ +enum s390_opcode_mode_val + { + S390_OPCODE_ESA = 0, + S390_OPCODE_ZARCH + }; + +enum s390_opcode_cpu_val + { + S390_OPCODE_G5 = 0, + S390_OPCODE_G6, + S390_OPCODE_Z900 + }; struct op_struct { char opcode[16]; char mnemonic[16]; char format[16]; - int archbits; + int mode_bits; + int min_cpu; + unsigned long long sort_value; int no_nibbles; }; @@ -57,7 +64,8 @@ createTable (void) /* `insertOpcode': insert an op_struct into sorted opcode array. */ static void -insertOpcode (char *opcode, char *mnemonic, char *format, int archbits) +insertOpcode (char *opcode, char *mnemonic, char *format, + int min_cpu, int mode_bits) { char *str; unsigned long long sort_value; @@ -87,6 +95,7 @@ insertOpcode (char *opcode, char *mnemonic, char *format, int archbits) str ++; } sort_value <<= 4*(16 - ix); + sort_value += (min_cpu << 8) + mode_bits; no_nibbles = ix; for (ix = 0; ix < no_ops; ix++) if (sort_value > op_array[ix].sort_value) @@ -98,7 +107,8 @@ insertOpcode (char *opcode, char *mnemonic, char *format, int archbits) strcpy(op_array[ix].format, format); op_array[ix].sort_value = sort_value; op_array[ix].no_nibbles = no_nibbles; - op_array[ix].archbits = archbits; + op_array[ix].min_cpu = min_cpu; + op_array[ix].mode_bits = mode_bits; no_ops++; } @@ -136,7 +146,8 @@ dumpTable (void) op_array[ix].no_nibbles*4, op_array[ix].opcode); printf ("MASK_%s, INSTR_%s, ", op_array[ix].format, op_array[ix].format); - printf ("%i}", op_array[ix].archbits); + printf ("%i, ", op_array[ix].mode_bits); + printf ("%i}", op_array[ix].min_cpu); if (ix < no_ops-1) printf (",\n"); else @@ -162,24 +173,50 @@ main (void) char mnemonic[16]; char format[16]; char description[64]; - char archtag[16]; - int archbits; + char cpu_string[16]; + char modes_string[16]; + int min_cpu; + int mode_bits; + char *str; if (currentLine[0] == '#') continue; memset (opcode, 0, 8); - if (sscanf (currentLine, "%15s %15s %15s \"%[^\"]\" %15s", - opcode, mnemonic, format, description, archtag) == 5) + if (sscanf (currentLine, "%15s %15s %15s \"%[^\"]\" %15s %15s", + opcode, mnemonic, format, description, + cpu_string, modes_string) == 6) { - if (strcmp (archtag, "esaonly") == 0) - archbits = ARCHBITS_ESAONLY; - else if (strcmp (archtag, "esa") == 0) - archbits = ARCHBITS_ESA; - else if (strcmp (archtag, "esame") == 0) - archbits = ARCHBITS_ESAME; - else - archbits = 0; - insertOpcode (opcode, mnemonic, format, archbits); + if (strcmp (cpu_string, "g5") == 0) + min_cpu = S390_OPCODE_G5; + else if (strcmp (cpu_string, "g6") == 0) + min_cpu = S390_OPCODE_G6; + else if (strcmp (cpu_string, "z900") == 0) + min_cpu = S390_OPCODE_Z900; + else { + fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); + exit (1); + } + + str = modes_string; + mode_bits = 0; + do { + if (strncmp (str, "esa", 3) == 0 + && (str[3] == 0 || str[3] == ',')) { + mode_bits |= 1 << S390_OPCODE_ESA; + str += 3; + } else if (strncmp (str, "zarch", 5) == 0 + && (str[5] == 0 || str[5] == ',')) { + mode_bits |= 1 << S390_OPCODE_ZARCH; + str += 5; + } else { + fprintf (stderr, "Couldn't parse modes string %s\n", + modes_string); + exit (1); + } + if (*str == ',') + str++; + } while (*str != 0); + insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits); } else fprintf (stderr, "Couldn't scan line %s\n", currentLine); diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c index 7cd8231d95a..a2837833d74 100644 --- a/opcodes/s390-opc.c +++ b/opcodes/s390-opc.c @@ -293,23 +293,23 @@ const struct s390_operand s390_operands[] = const struct s390_opcode s390_opformats[] = { - { "e", OP8(0x00LL), MASK_E, INSTR_E, 3 }, - { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3 }, - { "rie", OP8(0x00LL), MASK_RIE_RRP, INSTR_RIE_RRP, 3 }, - { "ril", OP8(0x00LL), MASK_RIL_RP, INSTR_RIL_RP, 3 }, - { "rr", OP8(0x00LL), MASK_RR_RR, INSTR_RR_RR, 3 }, - { "rre", OP8(0x00LL), MASK_RRE_RR, INSTR_RRE_RR, 3 }, - { "rrf", OP8(0x00LL), MASK_RRF_RURR, INSTR_RRF_RURR, 3 }, - { "rs", OP8(0x00LL), MASK_RS_RRRD, INSTR_RS_RRRD, 3 }, - { "rse", OP8(0x00LL), MASK_RSE_RRRD, INSTR_RSE_RRRD, 3 }, - { "rsi", OP8(0x00LL), MASK_RSI_RRP, INSTR_RSI_RRP, 3 }, - { "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3 }, - { "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3 }, - { "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR,3 }, - { "s", OP8(0x00LL), MASK_S_RD, INSTR_S_RD, 3 }, - { "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3 }, - { "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD,3 }, - { "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3 }, + { "e", OP8(0x00LL), MASK_E, INSTR_E, 3, 0 }, + { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3, 0 }, + { "rie", OP8(0x00LL), MASK_RIE_RRP, INSTR_RIE_RRP, 3, 0 }, + { "ril", OP8(0x00LL), MASK_RIL_RP, INSTR_RIL_RP, 3, 0 }, + { "rr", OP8(0x00LL), MASK_RR_RR, INSTR_RR_RR, 3, 0 }, + { "rre", OP8(0x00LL), MASK_RRE_RR, INSTR_RRE_RR, 3, 0 }, + { "rrf", OP8(0x00LL), MASK_RRF_RURR, INSTR_RRF_RURR, 3, 0 }, + { "rs", OP8(0x00LL), MASK_RS_RRRD, INSTR_RS_RRRD, 3, 0 }, + { "rse", OP8(0x00LL), MASK_RSE_RRRD, INSTR_RSE_RRRD, 3, 0 }, + { "rsi", OP8(0x00LL), MASK_RSI_RRP, INSTR_RSI_RRP, 3, 0 }, + { "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3, 0 }, + { "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3, 0 }, + { "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR,3, 0 }, + { "s", OP8(0x00LL), MASK_S_RD, INSTR_S_RD, 3, 0 }, + { "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3, 0 }, + { "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD,3, 0 }, + { "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3, 0 }, }; const int s390_num_opformats = diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt index ddcf0894ea2..f0b7f83d251 100644 --- a/opcodes/s390-opc.txt +++ b/opcodes/s390-opc.txt @@ -1,626 +1,625 @@ # S/390 opcodes list. Use s390-mkopc to convert it into the opcode table. # Copyright 2000, 2001 Free Software Foundation, Inc. # Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -5a a RX_RRRD "add" esa -6a ad RX_FRRD "add normalized (long)" esa -2a adr RR_FF "add normalized (long)" esa -7a ae RX_FRRD "add normalized (short)" esa -3a aer RR_FF "add normalized (short)" esa -4a ah RX_RRRD "add halfword" esa -5e al RX_RRRD "add logical" esa -1e alr RR_RR "add logical" esa -fa ap SS_LLRDRD "add decimal" esa -1a ar RR_RR "add" esa -7e au RX_FRRD "add unnormalized (short)" esa -3e aur RR_FF "add unnormalized (short)" esa -6e aw RX_FRRD "add unnormalized (long)" esa -2e awr RR_FF "add unnormalized (long)" esa -36 axr RR_FF "add normalized" esa -b240 bakr RRE_RR "branch and stack" esa -45 bal RX_RRRD "branch and link" esa -05 balr RR_RR "branch and link" esa -4d bas RX_RRRD "branch and save" esa -0d basr RR_RR "branch and save" esa -0c bassm RR_RR "branch and save and set mode" esa -47 bc RX_URRD "branch on condition" esa -07 bcr RR_UR "branch on condition" esa -46 bct RX_RRRD "branch on count" esa -06 bctr RR_RR "branch on count" esa -b258 bsg RRE_RR "branch in subspace group" esa -0b bsm RR_RR "branch and set mode" esa -86 bxh RS_RRRD "branch on index high" esa -87 bxle RS_RRRD "branch on index low or equal" esa -59 c RX_RRRD "compare" esa -69 cd RX_FRRD "compare (long)" esa -29 cdr RR_FF "compare (long)" esa -bb cds RS_RRRD "compare double and swap" esa -79 ce RX_FRRD "compare (short)" esa -39 cer RR_FF "compare (short)" esa -b21a cfc S_RD "compare and form codeword" esa -49 ch RX_RRRD "compare halfword" esa -55 cl RX_RRRD "compare logical" esa -d5 clc SS_L0RDRD "compare logical" esa -0f clcl RR_RR "compare logical long" esa -95 cli SI_URD "compare logical" esa -bd clm RS_RURD "compare logical characters under mask" esa -15 clr RR_RR "compare logical" esa -b25d clst RRE_RR "compare logical string" esa -b263 cmpsc RRE_RR "compression call" esa -f9 cp SS_LLRDRD "compare decimal" esa -b24d cpya RRE_AA "copy access" esa -19 cr RR_RR "compare" esa -ba cs RS_RRRD "compare and swap" esa -b230 csch S_00 "clear subchannel" esa -b257 cuse RRE_RR "compare until substring equal" esa -b250 csp RRE_RR "compare and swap and purge" esa -4f cvb RX_RRRD "convert to binary" esa -4e cvd RX_RRRD "convert to decimal" esa -5d d RX_RRRD "divide" esa -6d dd RX_FRRD "divide (long)" esa -2d ddr RR_FF "divide (long)" esa -7d de RX_FRRD "divide (short)" esa -3d der RR_FF "divide (short)" esa -83 diag RS_RRRD "diagnose" esa -fd dp SS_LLRDRD "divide decimal" esa -1d dr RR_RR "divide" esa -b22d dxr RRE_F0 "divide (ext.)" esa -b24f ear RRE_RA "extract access" esa -de ed SS_L0RDRD "edit" esa -df edmk SS_L0RDRD "edit and mark" esa -b226 epar RRE_R0 "extract primary ASN" esa -b249 ereg RRE_RR "extract stacked registers" esa -b227 esar RRE_R0 "extract secondary ASN" esa -b24a esta RRE_RR "extract stacked state" esa -44 ex RX_RRRD "execute" esa -24 hdr RR_FF "halve (long)" esa -34 her RR_FF "halve (short)" esa -b231 hsch S_00 "halt subchannel" esa -b224 iac RRE_R0 "insert address space control" esa -43 ic RX_RRRD "insert character" esa -bf icm RS_RURD "insert characters under mask" esa -b20b ipk S_00 "insert PSW key" esa -b222 ipm RRE_R0 "insert program mask" esa -b221 ipte RRE_RR "invalidate page table entry" esa -b229 iske RRE_RR "insert storage key extended" esa -b223 ivsk RRE_RR "insert virtual storage key" esa -58 l RX_RRRD "load" esa -41 la RX_RRRD "load address" esa -51 lae RX_RRRD "load address extended" esa -9a lam RS_AARD "load access multiple" esa -e500 lasp SSE_RDRD "load address space parameters" esa -23 lcdr RR_FF "load complement (long)" esa -33 lcer RR_FF "load complement (short)" esa -13 lcr RR_RR "load complement" esa -b7 lctl RS_CCRD "load control" esa -68 ld RX_FRRD "load (long)" esa -28 ldr RR_FF "load (long)" esa -78 le RX_FRRD "load (short)" esa -38 ler RR_FF "load (short)" esa -48 lh RX_RRRD "load halfword" esa -98 lm RS_RRRD "load multiple" esa -21 lndr RR_FF "load negative (long)" esa -31 lner RR_FF "load negative (short)" esa -11 lnr RR_RR "load negative" esa -20 lpdr RR_FF "load positive (long)" esa -30 lper RR_FF "load positive (short)" esa -10 lpr RR_RR "load positive" esa -82 lpsw S_RD "load PSW" esa -18 lr RR_RR "load" esa -b1 lra RX_RRRD "load real address" esa -25 lrdr RR_FF "load rounded (ext. to long)" esa -35 lrer RR_FF "load rounded (long to short)" esa -22 ltdr RR_FF "load and test (long)" esa -32 lter RR_FF "load and test (short)" esa -12 ltr RR_RR "load and test" esa -b24b lura RRE_RR "load using real address" esa -5c m RX_RRRD "multiply" esa -af mc SI_URD "monitor call" esa -6c md RX_FRRD "multiply (long)" esa -2c mdr RR_FF "multiply (long)" esa -7c me RX_FRRD "multiply (short to long)" esa -3c mer RR_FF "multiply (short to long)" esa -4c mh RX_RRRD "multiply halfword" esa -fc mp SS_LLRDRD "multiply decimal" esa -1c mr RR_RR "multiply" esa -b232 msch S_RD "modify subchannel" esa -b247 msta RRE_R0 "modify stacked state" esa -d2 mvc SS_L0RDRD "move" esa -e50f mvcdk SSE_RDRD "move with destination key" esa -e8 mvcin SS_L0RDRD "move inverse" esa -d9 mvck SS_RRRDRD "move with key" esa -0e mvcl RR_RR "move long" esa -da mvcp SS_RRRDRD "move to primary" esa -db mvcs SS_RRRDRD "move to secondary" esa -e50e mvcsk SSE_RDRD "move with source key" esa -92 mvi SI_URD "move" esa -d1 mvn SS_L0RDRD "move numerics" esa -f1 mvo SS_LLRDRD "move with offset" esa -b254 mvpg RRE_RR "move page" esa -b255 mvst RRE_RR "move string" esa -d3 mvz SS_L0RDRD "move zones" esa -67 mxd RX_FRRD "multiply (long to ext.)" esa -27 mxdr RR_FF "multiply (long to ext.)" esa -26 mxr RR_FF "multiply (ext.)" esa -54 n RX_RRRD "AND" esa -d4 nc SS_L0RDRD "AND" esa -94 ni SI_URD "AND" esa -14 nr RR_RR "AND" esa -56 o RX_RRRD "OR" esa -d6 oc SS_L0RDRD "OR" esa -96 oi SI_URD "OR" esa -16 or RR_RR "OR" esa -f2 pack SS_LLRDRD "pack" esa -b248 palb RRE_00 "purge ALB" esa -b218 pc S_RD "program call" esa -0101 pr E "program return" esa -b228 pt RRE_RR "program transfer" esa -b20d ptlb S_00 "purge TLB" esa -b23b rchp S_00 "reset channel path" esa -b22a rrbe RRE_RR "reset reference bit extended" esa -b238 rsch S_00 "resume subchannel" esa -5b s RX_RRRD "subtract" esa -b219 sac S_RD "set address space control" esa -b279 sacf S_RD "set address space control fast" esa -b237 sal S_00 "set address limit" esa -b24e sar RRE_AR "set access" esa -b23c schm S_00 "set channel monitor" esa -b204 sck S_RD "set clock" esa -b206 sckc S_RD "set clock comparator" esa -6b sd RX_FRRD "subtract normalized (long)" esa -2b sdr RR_FF "subtract normalized (long)" esa -7b se RX_FRRD "subtract normalized (short)" esa -3b ser RR_FF "subtract normalized (short)" esa -4b sh RX_RRRD "subtract halfword" esa -b214 sie S_RD "start interpretive execution" esa -ae sigp RS_RRRD "signal processor" esa -5f sl RX_RRRD "subtract logical" esa -8b sla RS_R0RD "shift left single" esa -8f slda RS_R0RD "shift left double (long)" esa -8d sldl RS_R0RD "shift left double logical (long)" esa -89 sll RS_R0RD "shift left single logical" esa -1f slr RR_RR "subtract logical" esa -fb sp SS_LLRDRD "subtract decimal" esa -b20a spka S_RD "set PSW key from address" esa -04 spm RR_R0 "set program mask" esa -b208 spt S_RD "set CPU timer" esa -b210 spx S_RD "set prefix" esa -b244 sqdr RRE_F0 "square root (long)" esa -b245 sqer RRE_F0 "square root (short)" esa -1b sr RR_RR "subtract" esa -8a sra RS_R0RD "shift right single" esa -8e srda RS_R0RD "shift right double (long)" esa -8c srdl RS_R0RD "shift right double logical (long)" esa -88 srl RS_R0RD "shift right single logical" esa -f0 srp SS_LIRDRD "shift and round decimal" esa -b25e srst RRE_RR "search string" esa -b225 ssar RRE_R0 "set secondary ASN" esa -b233 ssch S_RD "start subchannel" esa -b22b sske RRE_RR "set storage key extended" esa -80 ssm S_RD "set system mask" esa -50 st RX_RRRD "store" esa -9b stam RS_AARD "store access multiple" esa -b212 stap S_RD "store CPU address" esa -42 stc RX_RRRD "store character" esa -b205 stck S_RD "store clock" esa -b207 stckc S_RD "store clock comparator" esa -be stcm RS_RURD "store characters under mask" esa -b23a stcps S_RD "store channel path status" esa -b239 stcrw S_RD "store channel report word" esa -b6 stctl RS_CCRD "store control" esa -60 std RX_FRRD "store (long)" esa -70 ste RX_FRRD "store (short)" esa -40 sth RX_RRRD "store halfword" esa -b202 stidp S_RD "store CPU id" esa -90 stm RS_RRRD "store multiple" esa -ac stnsm SI_URD "store then AND system mask" esa -ad stosm SI_URD "store then OR system mask" esa -b209 stpt S_RD "store CPU timer" esa -b211 stpx S_RD "store prefix" esa -b234 stsch S_RD "store subchannel" esa -b246 stura RRE_RR "store using real address" esa -7f su RX_FRRD "subtract unnormalized (short)" esa -3f sur RR_FF "subtract unnormalized (short)" esa -0a svc RR_U0 "supervisor call" esa -6f sw RX_FRRD "subtract unnormalized (long)" esa -2f swr RR_FF "subtract unnormalized (long)" esa -37 sxr RR_FF "subtract normalized (ext.)" esa -b24c tar RRE_AR "test access" esa -b22c tb RRE_0R "test block" esa -91 tm SI_URD "test under mask" esa -b236 tpi S_RD "test pending interruption" esa -e501 tprot SSE_RDRD "test protection" esa -dc tr SS_L0RDRD "translate" esa -99 trace RS_RRRD "trace" esa -dd trt SS_L0RDRD "translate and test" esa -93 ts S_RD "test and set" esa -b235 tsch S_RD "test subchannel" esa -f3 unpk SS_LLRDRD "unpack" esa -0102 upt E "update tree" esa -57 x RX_RRRD "exclusive OR" esa -d7 xc SS_L0RDRD "exclusive OR" esa -97 xi SI_URD "exclusive OR" esa -17 xr RR_RR "exclusive OR" esa -f8 zap SS_LLRDRD "zero and add" esa -a70a ahi RI_RI "add halfword immediate" esa -84 brxh RSI_RRP "branch relative on index high" esa -85 brxle RSI_RRP "branch relative on index low or equal" esa -a705 bras RI_RP "branch relative and save" esa -a704 brc RI_UP "branch relative on condition" esa -a706 brct RI_RP "branch relative on count" esa -b241 cksm RRE_RR "checksum" esa -a70e chi RI_RI "compare halfword immediate" esa -a9 clcle RS_RRRD "compare logical long extended" esa -a708 lhi RI_RI "load halfword immediate" esa -a8 mvcle RS_RRRD "move long extended" esa -a70c mhi RI_RI "multiply halfword immediate" esa -b252 msr RRE_RR "multiply single" esa -71 ms RX_RRRD "multiply single" esa -a700 tmh RI_RU "test under mask high" esa -a701 tml RI_RU "test under mask low" esa -0700 nopr RR_0R "no operation" esa -0710 bor RR_0R "branch on overflow / if ones" esa -0720 bhr RR_0R "branch on high" esa -0720 bpr RR_0R "branch on plus" esa -0730 bnler RR_0R "branch on not low or equal" esa -0740 blr RR_0R "branch on low" esa -0740 bmr RR_0R "branch on minus / if mixed" esa -0750 bnher RR_0R "branch on not high or equal" esa -0760 blhr RR_0R "branch on low or high" esa -0770 bner RR_0R "branch on not equal" esa -0770 bnzr RR_0R "branch on not zero / if not zeros" esa -0780 ber RR_0R "branch on equal" esa -0780 bzr RR_0R "branch on zero / if zeros" esa -0790 bnlhr RR_0R "branch on not low or high" esa -07a0 bher RR_0R "branch on high or equal" esa -07b0 bnlr RR_0R "branch on not low" esa -07b0 bnmr RR_0R "branch on not minus / if not mixed" esa -07c0 bler RR_0R "brach on low or equal" esa -07d0 bnhr RR_0R "branch on not high" esa -07d0 bnpr RR_0R "branch on not plus" esa -07e0 bnor RR_0R "branch on not overflow / if not ones" esa -07f0 br RR_0R "unconditional branch" esa -4700 nop RX_0RRD "no operation" esa -4710 bo RX_0RRD "branch on overflow / if ones" esa -4720 bh RX_0RRD "branch on high" esa -4720 bp RX_0RRD "branch on plus" esa -4730 bnle RX_0RRD "branch on not low or equal" esa -4740 bl RX_0RRD "branch on low" esa -4740 bm RX_0RRD "branch on minus / if mixed" esa -4750 bnhe RX_0RRD "branch on not high or equal" esa -4760 blh RX_0RRD "branch on low or high" esa -4770 bne RX_0RRD "branch on not equal" esa -4770 bnz RX_0RRD "branch on not zero / if not zeros" esa -4780 be RX_0RRD "branch on equal" esa -4780 bz RX_0RRD "branch on zero / if zeros" esa -4790 bnlh RX_0RRD "branch on not low or high" esa -47a0 bhe RX_0RRD "branch on high or equal" esa -47b0 bnl RX_0RRD "branch on not low" esa -47b0 bnm RX_0RRD "branch on not minus / if not mixed" esa -47c0 ble RX_0RRD "branch on low or equal" esa -47d0 bnh RX_0RRD "branch on not high" esa -47d0 bnp RX_0RRD "branch on not plus" esa -47e0 bno RX_0RRD "branch on not overflow / if not ones" esa -47f0 b RX_0RRD "unconditional branch" esa -a714 jo RI_0P "jump on overflow / if ones" esa -a724 jh RI_0P "jump on A high" esa -a724 jp RI_0P "jump on plus" esa -a734 jnle RI_0P "jump on not low or equal" esa -a744 jl RI_0P "jump on A low" esa -a744 jm RI_0P "jump on minus / if mixed" esa -a754 jnhe RI_0P "jump on not high or equal" esa -a764 jlh RI_0P "jump on low or high" esa -a774 jne RI_0P "jump on A not equal B" esa -a774 jnz RI_0P "jump on not zero / if not zeros" esa -a784 je RI_0P "jump on A equal B" esa -a784 jz RI_0P "jump on zero / if zeros" esa -a794 jnlh RI_0P "jump on not low or high" esa -a7a4 jhe RI_0P "jump on high or equal" esa -a7b4 jnl RI_0P "jump on A not low" esa -a7b4 jnm RI_0P "jump on not minus / if not mixed" esa -a7c4 jle RI_0P "jump on low or equal" esa -a7d4 jnh RI_0P "jump on A not high" esa -a7d4 jnp RI_0P "jump on not plus" esa -a7e4 jno RI_0P "jump on not overflow / if not ones" esa -a7f4 j RI_0P "jump" esa -b34a axbr RRE_FF "add extended bfp" esa -b31a adbr RRE_FF "add long bfp" esa -ed000000001a adb RXE_FRRD "add long bfp" esa -b30a aebr RRE_FF "add short bfp" esa -ed000000000a aeb RXE_FRRD "add short bfp" esa -b349 cxbr RRE_FF "compare extended bfp" esa -b319 cdbr RRE_FF "compare long bfp" esa -ed0000000019 cdb RXE_FRRD "compare long bfp" esa -b309 cebr RRE_FF "compare short bfp" esa -ed0000000009 ceb RXE_FRRD "compare short bfp" esa -b348 kxbr RRE_FF "compare and signal extended bfp" esa -b318 kdbr RRE_FF "compare and signal long bfp" esa -ed0000000018 kdb RXE_FRRD "compare and signal long bfp" esa -b308 kebr RRE_FF "compare and signal short bfp" esa -ed0000000008 keb RXE_FRRD "compare and signal short bfp" esa -b396 cxfbr RRE_RF "convert from fixed 32 to extended bfp" esa -b395 cdfbr RRE_RF "convert from fixed 32 to long bfp" esa -b394 cefbr RRE_RF "convert from fixed 32 to short bfp" esa -b39a cfxbr RRF_U0FR "convert to fixed extended bfp to 32" esa -b399 cfdbr RRF_U0FR "convert to fixed long bfp to 32" esa -b398 cfebr RRF_U0FR "convert to fixed short bfp to 32" esa -b34d dxbr RRE_FF "divide extended bfp" esa -b31d ddbr RRE_FF "divide long bfp" esa -ed000000001d ddb RXE_FRRD "divide long bfp" esa -b30d debr RRE_FF "divide short bfp" esa -ed000000000d deb RXE_FRRD "divide short bfp" esa -b35b didbr RRF_FUFF "divide to integer long bfp" esa -b353 diebr RRF_FUFF "divide to integer short bfp" esa -b38c efpc RRE_RR "extract fpc" esa -b342 ltxbr RRE_FF "load and test extended bfp" esa -b312 ltdbr RRE_FF "load and test long bfp" esa -b302 ltebr RRE_FF "load and test short bfp" esa -b343 lcxbr RRE_FF "load complement extended bfp" esa -b313 lcdbr RRE_FF "load complement long bfp" esa -b303 lcebr RRE_FF "load complement short bfp" esa -b347 fixbr RRF_U0FF "load fp integer extended bfp" esa -b35f fidbr RRF_U0FF "load fp integer long bfp" esa -b357 fiebr RRF_U0FF "load fp integer short bfp" esa -b29d lfpc S_RD "load fpc" esa -b305 lxdbr RRE_FF "load lengthened long to extended bfp" esa -ed0000000005 lxdb RXE_FRRD "load lengthened long to extended bfp" esa -b306 lxebr RRE_FF "load lengthened short to extended bfp" esa -ed0000000006 lxeb RXE_FRRD "load lengthened short to extended bfp" esa -b304 ldebr RRE_FF "load lengthened short to long bfp" esa -ed0000000004 ldeb RXE_FRRD "load lengthened short to long bfp" esa -b341 lnxbr RRE_FF "load negative extended bfp" esa -b311 lndbr RRE_FF "load negative long bfp" esa -b301 lnebr RRE_FF "load negative short bfp" esa -b340 lpxbr RRE_FF "load positive extended bfp" esa -b310 lpdbr RRE_FF "load positive long bfp" esa -b300 lpebr RRE_FF "load positive short bfp" esa -b345 ldxbr RRE_FF "load rounded extended to long bfp" esa -b346 lexbr RRE_FF "load rounded extended to short bfp" esa -b344 ledbr RRE_FF "load rounded long to short bfp" esa -b34c mxbr RRE_FF "multiply extended bfp" esa -b31c mdbr RRE_FF "multiply long bfp" esa -ed000000001c mdb RXE_FRRD "multiply long bfp" esa -b307 mxdbr RRE_FF "multiply long to extended bfp" esa -ed0000000007 mxdb RXE_FRRD "multiply long to extended bfp" esa -b317 meebr RRE_FF "multiply short bfp" esa -ed0000000017 meeb RXE_FRRD "multiply short bfp" esa -b30c mdebr RRE_FF "multiply short to long bfp" esa -ed000000000c mdeb RXE_FRRD "multiply short to long bfp" esa -b31e madbr RRF_F0FF "multiply and add long bfp" esa -ed000000001e madb RXF_FRRDF "multiply and add long bfp" esa -b30e maebr RRF_F0FF "multiply and add short bfp" esa -ed000000000e maeb RXF_FRRDF "multiply and add short bfp" esa -b31f msdbr RRF_F0FF "multiply and subtract long bfp" esa -ed000000001f msdb RXF_FRRDF "multiply and subtract long bfp" esa -b30f msebr RRF_F0FF "multiply and subtract short bfp" esa -ed000000000f mseb RXF_FRRDF "multiply and subtract short bfp" esa -b384 sfpc RRE_RR "set fpc" esa -b299 srnm S_RD "set rounding mode" esa -b316 sqxbr RRE_FF "square root extended bfp" esa -b315 sqdbr RRE_FF "square root long bfp" esa -ed0000000015 sqdb RXE_FRRD "square root long bfp" esa -b314 sqebr RRE_FF "square root short bfp" esa -ed0000000014 sqeb RXE_FRRD "square root short bfp" esa -b29c stfpc S_RD "store fpc" esa -b34b sxbr RRE_FF "subtract extended bfp" esa -b31b sdbr RRE_FF "subtract long bfp" esa -ed000000001b sdb RXE_FRRD "subtract long bfp" esa -b30b sebr RRE_FF "subtract short bfp" esa -ed000000000b seb RXE_FRRD "subtract short bfp" esa -ed0000000012 tcxb RXE_FRRD "test data class extended bfp" esa -ed0000000011 tcdb RXE_FRRD "test data class long bfp" esa -ed0000000010 tceb RXE_FRRD "test data class short bfp" esa -b274 siga S_RD "signal adapter" esa -# are the following instructions confidential ?? -b2a6 cuutf RRE_RR "convert unicode to utf-8" esa -b2a7 cutfu RRE_RR "convert utf-8 to unicode" esa -ee plo SS_RRRDRD2 "perform locked operation" esa -b25a bsa RRE_RR "branch and set authority" esa -b277 rp S_RD "resume program" esa -0107 sckpf E "set clock programmable field" esa -b27d stsi S_RD "store system information" esa -01ff trap2 E "trap" esa -b2ff trap4 S_RD "trap4" esa +5a a RX_RRRD "add" g5 esa,zarch +6a ad RX_FRRD "add normalized (long)" g5 esa,zarch +2a adr RR_FF "add normalized (long)" g5 esa,zarch +7a ae RX_FRRD "add normalized (short)" g5 esa,zarch +3a aer RR_FF "add normalized (short)" g5 esa,zarch +4a ah RX_RRRD "add halfword" g5 esa,zarch +5e al RX_RRRD "add logical" g5 esa,zarch +1e alr RR_RR "add logical" g5 esa,zarch +fa ap SS_LLRDRD "add decimal" g5 esa,zarch +1a ar RR_RR "add" g5 esa,zarch +7e au RX_FRRD "add unnormalized (short)" g5 esa,zarch +3e aur RR_FF "add unnormalized (short)" g5 esa,zarch +6e aw RX_FRRD "add unnormalized (long)" g5 esa,zarch +2e awr RR_FF "add unnormalized (long)" g5 esa,zarch +36 axr RR_FF "add normalized" g5 esa,zarch +b240 bakr RRE_RR "branch and stack" g5 esa,zarch +45 bal RX_RRRD "branch and link" g5 esa,zarch +05 balr RR_RR "branch and link" g5 esa,zarch +4d bas RX_RRRD "branch and save" g5 esa,zarch +0d basr RR_RR "branch and save" g5 esa,zarch +0c bassm RR_RR "branch and save and set mode" g5 esa,zarch +47 bc RX_URRD "branch on condition" g5 esa,zarch +07 bcr RR_UR "branch on condition" g5 esa,zarch +46 bct RX_RRRD "branch on count" g5 esa,zarch +06 bctr RR_RR "branch on count" g5 esa,zarch +b258 bsg RRE_RR "branch in subspace group" g5 esa,zarch +0b bsm RR_RR "branch and set mode" g5 esa,zarch +86 bxh RS_RRRD "branch on index high" g5 esa,zarch +87 bxle RS_RRRD "branch on index low or equal" g5 esa,zarch +59 c RX_RRRD "compare" g5 esa,zarch +69 cd RX_FRRD "compare (long)" g5 esa,zarch +29 cdr RR_FF "compare (long)" g5 esa,zarch +bb cds RS_RRRD "compare double and swap" g5 esa,zarch +79 ce RX_FRRD "compare (short)" g5 esa,zarch +39 cer RR_FF "compare (short)" g5 esa,zarch +b21a cfc S_RD "compare and form codeword" g5 esa,zarch +49 ch RX_RRRD "compare halfword" g5 esa,zarch +55 cl RX_RRRD "compare logical" g5 esa,zarch +d5 clc SS_L0RDRD "compare logical" g5 esa,zarch +0f clcl RR_RR "compare logical long" g5 esa,zarch +95 cli SI_URD "compare logical" g5 esa,zarch +bd clm RS_RURD "compare logical characters under mask" g5 esa,zarch +15 clr RR_RR "compare logical" g5 esa,zarch +b25d clst RRE_RR "compare logical string" g5 esa,zarch +b263 cmpsc RRE_RR "compression call" g5 esa,zarch +f9 cp SS_LLRDRD "compare decimal" g5 esa,zarch +b24d cpya RRE_AA "copy access" g5 esa,zarch +19 cr RR_RR "compare" g5 esa,zarch +ba cs RS_RRRD "compare and swap" g5 esa,zarch +b230 csch S_00 "clear subchannel" g5 esa,zarch +b257 cuse RRE_RR "compare until substring equal" g5 esa,zarch +b250 csp RRE_RR "compare and swap and purge" g5 esa,zarch +4f cvb RX_RRRD "convert to binary" g5 esa,zarch +4e cvd RX_RRRD "convert to decimal" g5 esa,zarch +5d d RX_RRRD "divide" g5 esa,zarch +6d dd RX_FRRD "divide (long)" g5 esa,zarch +2d ddr RR_FF "divide (long)" g5 esa,zarch +7d de RX_FRRD "divide (short)" g5 esa,zarch +3d der RR_FF "divide (short)" g5 esa,zarch +83 diag RS_RRRD "diagnose" g5 esa,zarch +fd dp SS_LLRDRD "divide decimal" g5 esa,zarch +1d dr RR_RR "divide" g5 esa,zarch +b22d dxr RRE_F0 "divide (ext.)" g5 esa,zarch +b24f ear RRE_RA "extract access" g5 esa,zarch +de ed SS_L0RDRD "edit" g5 esa,zarch +df edmk SS_L0RDRD "edit and mark" g5 esa,zarch +b226 epar RRE_R0 "extract primary ASN" g5 esa,zarch +b249 ereg RRE_RR "extract stacked registers" g5 esa,zarch +b227 esar RRE_R0 "extract secondary ASN" g5 esa,zarch +b24a esta RRE_RR "extract stacked state" g5 esa,zarch +44 ex RX_RRRD "execute" g5 esa,zarch +24 hdr RR_FF "halve (long)" g5 esa,zarch +34 her RR_FF "halve (short)" g5 esa,zarch +b231 hsch S_00 "halt subchannel" g5 esa,zarch +b224 iac RRE_R0 "insert address space control" g5 esa,zarch +43 ic RX_RRRD "insert character" g5 esa,zarch +bf icm RS_RURD "insert characters under mask" g5 esa,zarch +b20b ipk S_00 "insert PSW key" g5 esa,zarch +b222 ipm RRE_R0 "insert program mask" g5 esa,zarch +b221 ipte RRE_RR "invalidate page table entry" g5 esa,zarch +b229 iske RRE_RR "insert storage key extended" g5 esa,zarch +b223 ivsk RRE_RR "insert virtual storage key" g5 esa,zarch +58 l RX_RRRD "load" g5 esa,zarch +41 la RX_RRRD "load address" g5 esa,zarch +51 lae RX_RRRD "load address extended" g5 esa,zarch +9a lam RS_AARD "load access multiple" g5 esa,zarch +e500 lasp SSE_RDRD "load address space parameters" g5 esa,zarch +23 lcdr RR_FF "load complement (long)" g5 esa,zarch +33 lcer RR_FF "load complement (short)" g5 esa,zarch +13 lcr RR_RR "load complement" g5 esa,zarch +b7 lctl RS_CCRD "load control" g5 esa,zarch +68 ld RX_FRRD "load (long)" g5 esa,zarch +28 ldr RR_FF "load (long)" g5 esa,zarch +78 le RX_FRRD "load (short)" g5 esa,zarch +38 ler RR_FF "load (short)" g5 esa,zarch +48 lh RX_RRRD "load halfword" g5 esa,zarch +98 lm RS_RRRD "load multiple" g5 esa,zarch +21 lndr RR_FF "load negative (long)" g5 esa,zarch +31 lner RR_FF "load negative (short)" g5 esa,zarch +11 lnr RR_RR "load negative" g5 esa,zarch +20 lpdr RR_FF "load positive (long)" g5 esa,zarch +30 lper RR_FF "load positive (short)" g5 esa,zarch +10 lpr RR_RR "load positive" g5 esa,zarch +82 lpsw S_RD "load PSW" g5 esa,zarch +18 lr RR_RR "load" g5 esa,zarch +b1 lra RX_RRRD "load real address" g5 esa,zarch +25 lrdr RR_FF "load rounded (ext. to long)" g5 esa,zarch +35 lrer RR_FF "load rounded (long to short)" g5 esa,zarch +22 ltdr RR_FF "load and test (long)" g5 esa,zarch +32 lter RR_FF "load and test (short)" g5 esa,zarch +12 ltr RR_RR "load and test" g5 esa,zarch +b24b lura RRE_RR "load using real address" g5 esa,zarch +5c m RX_RRRD "multiply" g5 esa,zarch +af mc SI_URD "monitor call" g5 esa,zarch +6c md RX_FRRD "multiply (long)" g5 esa,zarch +2c mdr RR_FF "multiply (long)" g5 esa,zarch +7c me RX_FRRD "multiply (short to long)" g5 esa,zarch +3c mer RR_FF "multiply (short to long)" g5 esa,zarch +4c mh RX_RRRD "multiply halfword" g5 esa,zarch +fc mp SS_LLRDRD "multiply decimal" g5 esa,zarch +1c mr RR_RR "multiply" g5 esa,zarch +b232 msch S_RD "modify subchannel" g5 esa,zarch +b247 msta RRE_R0 "modify stacked state" g5 esa,zarch +d2 mvc SS_L0RDRD "move" g5 esa,zarch +e50f mvcdk SSE_RDRD "move with destination key" g5 esa,zarch +e8 mvcin SS_L0RDRD "move inverse" g5 esa,zarch +d9 mvck SS_RRRDRD "move with key" g5 esa,zarch +0e mvcl RR_RR "move long" g5 esa,zarch +da mvcp SS_RRRDRD "move to primary" g5 esa,zarch +db mvcs SS_RRRDRD "move to secondary" g5 esa,zarch +e50e mvcsk SSE_RDRD "move with source key" g5 esa,zarch +92 mvi SI_URD "move" g5 esa,zarch +d1 mvn SS_L0RDRD "move numerics" g5 esa,zarch +f1 mvo SS_LLRDRD "move with offset" g5 esa,zarch +b254 mvpg RRE_RR "move page" g5 esa,zarch +b255 mvst RRE_RR "move string" g5 esa,zarch +d3 mvz SS_L0RDRD "move zones" g5 esa,zarch +67 mxd RX_FRRD "multiply (long to ext.)" g5 esa,zarch +27 mxdr RR_FF "multiply (long to ext.)" g5 esa,zarch +26 mxr RR_FF "multiply (ext.)" g5 esa,zarch +54 n RX_RRRD "AND" g5 esa,zarch +d4 nc SS_L0RDRD "AND" g5 esa,zarch +94 ni SI_URD "AND" g5 esa,zarch +14 nr RR_RR "AND" g5 esa,zarch +56 o RX_RRRD "OR" g5 esa,zarch +d6 oc SS_L0RDRD "OR" g5 esa,zarch +96 oi SI_URD "OR" g5 esa,zarch +16 or RR_RR "OR" g5 esa,zarch +f2 pack SS_LLRDRD "pack" g5 esa,zarch +b248 palb RRE_00 "purge ALB" g5 esa,zarch +b218 pc S_RD "program call" g5 esa,zarch +0101 pr E "program return" g5 esa,zarch +b228 pt RRE_RR "program transfer" g5 esa,zarch +b20d ptlb S_00 "purge TLB" g5 esa,zarch +b23b rchp S_00 "reset channel path" g5 esa,zarch +b22a rrbe RRE_RR "reset reference bit extended" g5 esa,zarch +b238 rsch S_00 "resume subchannel" g5 esa,zarch +5b s RX_RRRD "subtract" g5 esa,zarch +b219 sac S_RD "set address space control" g5 esa,zarch +b279 sacf S_RD "set address space control fast" g5 esa,zarch +b237 sal S_00 "set address limit" g5 esa,zarch +b24e sar RRE_AR "set access" g5 esa,zarch +b23c schm S_00 "set channel monitor" g5 esa,zarch +b204 sck S_RD "set clock" g5 esa,zarch +b206 sckc S_RD "set clock comparator" g5 esa,zarch +6b sd RX_FRRD "subtract normalized (long)" g5 esa,zarch +2b sdr RR_FF "subtract normalized (long)" g5 esa,zarch +7b se RX_FRRD "subtract normalized (short)" g5 esa,zarch +3b ser RR_FF "subtract normalized (short)" g5 esa,zarch +4b sh RX_RRRD "subtract halfword" g5 esa,zarch +b214 sie S_RD "start interpretive execution" g5 esa,zarch +ae sigp RS_RRRD "signal processor" g5 esa,zarch +5f sl RX_RRRD "subtract logical" g5 esa,zarch +8b sla RS_R0RD "shift left single" g5 esa,zarch +8f slda RS_R0RD "shift left double (long)" g5 esa,zarch +8d sldl RS_R0RD "shift left double logical (long)" g5 esa,zarch +89 sll RS_R0RD "shift left single logical" g5 esa,zarch +1f slr RR_RR "subtract logical" g5 esa,zarch +fb sp SS_LLRDRD "subtract decimal" g5 esa,zarch +b20a spka S_RD "set PSW key from address" g5 esa,zarch +04 spm RR_R0 "set program mask" g5 esa,zarch +b208 spt S_RD "set CPU timer" g5 esa,zarch +b210 spx S_RD "set prefix" g5 esa,zarch +b244 sqdr RRE_F0 "square root (long)" g5 esa,zarch +b245 sqer RRE_F0 "square root (short)" g5 esa,zarch +1b sr RR_RR "subtract" g5 esa,zarch +8a sra RS_R0RD "shift right single" g5 esa,zarch +8e srda RS_R0RD "shift right double (long)" g5 esa,zarch +8c srdl RS_R0RD "shift right double logical (long)" g5 esa,zarch +88 srl RS_R0RD "shift right single logical" g5 esa,zarch +f0 srp SS_LIRDRD "shift and round decimal" g5 esa,zarch +b25e srst RRE_RR "search string" g5 esa,zarch +b225 ssar RRE_R0 "set secondary ASN" g5 esa,zarch +b233 ssch S_RD "start subchannel" g5 esa,zarch +b22b sske RRE_RR "set storage key extended" g5 esa,zarch +80 ssm S_RD "set system mask" g5 esa,zarch +50 st RX_RRRD "store" g5 esa,zarch +9b stam RS_AARD "store access multiple" g5 esa,zarch +b212 stap S_RD "store CPU address" g5 esa,zarch +42 stc RX_RRRD "store character" g5 esa,zarch +b205 stck S_RD "store clock" g5 esa,zarch +b207 stckc S_RD "store clock comparator" g5 esa,zarch +be stcm RS_RURD "store characters under mask" g5 esa,zarch +b23a stcps S_RD "store channel path status" g5 esa,zarch +b239 stcrw S_RD "store channel report word" g5 esa,zarch +b6 stctl RS_CCRD "store control" g5 esa,zarch +60 std RX_FRRD "store (long)" g5 esa,zarch +70 ste RX_FRRD "store (short)" g5 esa,zarch +40 sth RX_RRRD "store halfword" g5 esa,zarch +b202 stidp S_RD "store CPU id" g5 esa,zarch +90 stm RS_RRRD "store multiple" g5 esa,zarch +ac stnsm SI_URD "store then AND system mask" g5 esa,zarch +ad stosm SI_URD "store then OR system mask" g5 esa,zarch +b209 stpt S_RD "store CPU timer" g5 esa,zarch +b211 stpx S_RD "store prefix" g5 esa,zarch +b234 stsch S_RD "store subchannel" g5 esa,zarch +b246 stura RRE_RR "store using real address" g5 esa,zarch +7f su RX_FRRD "subtract unnormalized (short)" g5 esa,zarch +3f sur RR_FF "subtract unnormalized (short)" g5 esa,zarch +0a svc RR_U0 "supervisor call" g5 esa,zarch +6f sw RX_FRRD "subtract unnormalized (long)" g5 esa,zarch +2f swr RR_FF "subtract unnormalized (long)" g5 esa,zarch +37 sxr RR_FF "subtract normalized (ext.)" g5 esa,zarch +b24c tar RRE_AR "test access" g5 esa,zarch +b22c tb RRE_0R "test block" g5 esa,zarch +91 tm SI_URD "test under mask" g5 esa,zarch +b236 tpi S_RD "test pending interruption" g5 esa,zarch +e501 tprot SSE_RDRD "test protection" g5 esa,zarch +dc tr SS_L0RDRD "translate" g5 esa,zarch +99 trace RS_RRRD "trace" g5 esa,zarch +dd trt SS_L0RDRD "translate and test" g5 esa,zarch +93 ts S_RD "test and set" g5 esa,zarch +b235 tsch S_RD "test subchannel" g5 esa,zarch +f3 unpk SS_LLRDRD "unpack" g5 esa,zarch +0102 upt E "update tree" g5 esa,zarch +57 x RX_RRRD "exclusive OR" g5 esa,zarch +d7 xc SS_L0RDRD "exclusive OR" g5 esa,zarch +97 xi SI_URD "exclusive OR" g5 esa,zarch +17 xr RR_RR "exclusive OR" g5 esa,zarch +f8 zap SS_LLRDRD "zero and add" g5 esa,zarch +a70a ahi RI_RI "add halfword immediate" g5 esa,zarch +84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch +85 brxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch +a705 bras RI_RP "branch relative and save" g5 esa,zarch +a704 brc RI_UP "branch relative on condition" g5 esa,zarch +a706 brct RI_RP "branch relative on count" g5 esa,zarch +b241 cksm RRE_RR "checksum" g5 esa,zarch +a70e chi RI_RI "compare halfword immediate" g5 esa,zarch +a9 clcle RS_RRRD "compare logical long extended" g5 esa,zarch +a708 lhi RI_RI "load halfword immediate" g5 esa,zarch +a8 mvcle RS_RRRD "move long extended" g5 esa,zarch +a70c mhi RI_RI "multiply halfword immediate" g5 esa,zarch +b252 msr RRE_RR "multiply single" g5 esa,zarch +71 ms RX_RRRD "multiply single" g5 esa,zarch +a700 tmh RI_RU "test under mask high" g5 esa,zarch +a701 tml RI_RU "test under mask low" g5 esa,zarch +0700 nopr RR_0R "no operation" g5 esa,zarch +0710 bor RR_0R "branch on overflow / if ones" g5 esa,zarch +0720 bhr RR_0R "branch on high" g5 esa,zarch +0720 bpr RR_0R "branch on plus" g5 esa,zarch +0730 bnler RR_0R "branch on not low or equal" g5 esa,zarch +0740 blr RR_0R "branch on low" g5 esa,zarch +0740 bmr RR_0R "branch on minus / if mixed" g5 esa,zarch +0750 bnher RR_0R "branch on not high or equal" g5 esa,zarch +0760 blhr RR_0R "branch on low or high" g5 esa,zarch +0770 bner RR_0R "branch on not equal" g5 esa,zarch +0770 bnzr RR_0R "branch on not zero / if not zeros" g5 esa,zarch +0780 ber RR_0R "branch on equal" g5 esa,zarch +0780 bzr RR_0R "branch on zero / if zeros" g5 esa,zarch +0790 bnlhr RR_0R "branch on not low or high" g5 esa,zarch +07a0 bher RR_0R "branch on high or equal" g5 esa,zarch +07b0 bnlr RR_0R "branch on not low" g5 esa,zarch +07b0 bnmr RR_0R "branch on not minus / if not mixed" g5 esa,zarch +07c0 bler RR_0R "brach on low or equal" g5 esa,zarch +07d0 bnhr RR_0R "branch on not high" g5 esa,zarch +07d0 bnpr RR_0R "branch on not plus" g5 esa,zarch +07e0 bnor RR_0R "branch on not overflow / if not ones" g5 esa,zarch +07f0 br RR_0R "unconditional branch" g5 esa,zarch +4700 nop RX_0RRD "no operation" g5 esa,zarch +4710 bo RX_0RRD "branch on overflow / if ones" g5 esa,zarch +4720 bh RX_0RRD "branch on high" g5 esa,zarch +4720 bp RX_0RRD "branch on plus" g5 esa,zarch +4730 bnle RX_0RRD "branch on not low or equal" g5 esa,zarch +4740 bl RX_0RRD "branch on low" g5 esa,zarch +4740 bm RX_0RRD "branch on minus / if mixed" g5 esa,zarch +4750 bnhe RX_0RRD "branch on not high or equal" g5 esa,zarch +4760 blh RX_0RRD "branch on low or high" g5 esa,zarch +4770 bne RX_0RRD "branch on not equal" g5 esa,zarch +4770 bnz RX_0RRD "branch on not zero / if not zeros" g5 esa,zarch +4780 be RX_0RRD "branch on equal" g5 esa,zarch +4780 bz RX_0RRD "branch on zero / if zeros" g5 esa,zarch +4790 bnlh RX_0RRD "branch on not low or high" g5 esa,zarch +47a0 bhe RX_0RRD "branch on high or equal" g5 esa,zarch +47b0 bnl RX_0RRD "branch on not low" g5 esa,zarch +47b0 bnm RX_0RRD "branch on not minus / if not mixed" g5 esa,zarch +47c0 ble RX_0RRD "branch on low or equal" g5 esa,zarch +47d0 bnh RX_0RRD "branch on not high" g5 esa,zarch +47d0 bnp RX_0RRD "branch on not plus" g5 esa,zarch +47e0 bno RX_0RRD "branch on not overflow / if not ones" g5 esa,zarch +47f0 b RX_0RRD "unconditional branch" g5 esa,zarch +a714 jo RI_0P "jump on overflow / if ones" g5 esa,zarch +a724 jh RI_0P "jump on A high" g5 esa,zarch +a724 jp RI_0P "jump on plus" g5 esa,zarch +a734 jnle RI_0P "jump on not low or equal" g5 esa,zarch +a744 jl RI_0P "jump on A low" g5 esa,zarch +a744 jm RI_0P "jump on minus / if mixed" g5 esa,zarch +a754 jnhe RI_0P "jump on not high or equal" g5 esa,zarch +a764 jlh RI_0P "jump on low or high" g5 esa,zarch +a774 jne RI_0P "jump on A not equal B" g5 esa,zarch +a774 jnz RI_0P "jump on not zero / if not zeros" g5 esa,zarch +a784 je RI_0P "jump on A equal B" g5 esa,zarch +a784 jz RI_0P "jump on zero / if zeros" g5 esa,zarch +a794 jnlh RI_0P "jump on not low or high" g5 esa,zarch +a7a4 jhe RI_0P "jump on high or equal" g5 esa,zarch +a7b4 jnl RI_0P "jump on A not low" g5 esa,zarch +a7b4 jnm RI_0P "jump on not minus / if not mixed" g5 esa,zarch +a7c4 jle RI_0P "jump on low or equal" g5 esa,zarch +a7d4 jnh RI_0P "jump on A not high" g5 esa,zarch +a7d4 jnp RI_0P "jump on not plus" g5 esa,zarch +a7e4 jno RI_0P "jump on not overflow / if not ones" g5 esa,zarch +a7f4 j RI_0P "jump" g5 esa,zarch +b34a axbr RRE_FF "add extended bfp" g5 esa,zarch +b31a adbr RRE_FF "add long bfp" g5 esa,zarch +ed000000001a adb RXE_FRRD "add long bfp" g5 esa,zarch +b30a aebr RRE_FF "add short bfp" g5 esa,zarch +ed000000000a aeb RXE_FRRD "add short bfp" g5 esa,zarch +b349 cxbr RRE_FF "compare extended bfp" g5 esa,zarch +b319 cdbr RRE_FF "compare long bfp" g5 esa,zarch +ed0000000019 cdb RXE_FRRD "compare long bfp" g5 esa,zarch +b309 cebr RRE_FF "compare short bfp" g5 esa,zarch +ed0000000009 ceb RXE_FRRD "compare short bfp" g5 esa,zarch +b348 kxbr RRE_FF "compare and signal extended bfp" g5 esa,zarch +b318 kdbr RRE_FF "compare and signal long bfp" g5 esa,zarch +ed0000000018 kdb RXE_FRRD "compare and signal long bfp" g5 esa,zarch +b308 kebr RRE_FF "compare and signal short bfp" g5 esa,zarch +ed0000000008 keb RXE_FRRD "compare and signal short bfp" g5 esa,zarch +b396 cxfbr RRE_RF "convert from fixed 32 to extended bfp" g5 esa,zarch +b395 cdfbr RRE_RF "convert from fixed 32 to long bfp" g5 esa,zarch +b394 cefbr RRE_RF "convert from fixed 32 to short bfp" g5 esa,zarch +b39a cfxbr RRF_U0FR "convert to fixed extended bfp to 32" g5 esa,zarch +b399 cfdbr RRF_U0FR "convert to fixed long bfp to 32" g5 esa,zarch +b398 cfebr RRF_U0FR "convert to fixed short bfp to 32" g5 esa,zarch +b34d dxbr RRE_FF "divide extended bfp" g5 esa,zarch +b31d ddbr RRE_FF "divide long bfp" g5 esa,zarch +ed000000001d ddb RXE_FRRD "divide long bfp" g5 esa,zarch +b30d debr RRE_FF "divide short bfp" g5 esa,zarch +ed000000000d deb RXE_FRRD "divide short bfp" g5 esa,zarch +b35b didbr RRF_FUFF "divide to integer long bfp" g5 esa,zarch +b353 diebr RRF_FUFF "divide to integer short bfp" g5 esa,zarch +b38c efpc RRE_RR "extract fpc" g5 esa,zarch +b342 ltxbr RRE_FF "load and test extended bfp" g5 esa,zarch +b312 ltdbr RRE_FF "load and test long bfp" g5 esa,zarch +b302 ltebr RRE_FF "load and test short bfp" g5 esa,zarch +b343 lcxbr RRE_FF "load complement extended bfp" g5 esa,zarch +b313 lcdbr RRE_FF "load complement long bfp" g5 esa,zarch +b303 lcebr RRE_FF "load complement short bfp" g5 esa,zarch +b347 fixbr RRF_U0FF "load fp integer extended bfp" g5 esa,zarch +b35f fidbr RRF_U0FF "load fp integer long bfp" g5 esa,zarch +b357 fiebr RRF_U0FF "load fp integer short bfp" g5 esa,zarch +b29d lfpc S_RD "load fpc" g5 esa,zarch +b305 lxdbr RRE_FF "load lengthened long to extended bfp" g5 esa,zarch +ed0000000005 lxdb RXE_FRRD "load lengthened long to extended bfp" g5 esa,zarch +b306 lxebr RRE_FF "load lengthened short to extended bfp" g5 esa,zarch +ed0000000006 lxeb RXE_FRRD "load lengthened short to extended bfp" g5 esa,zarch +b304 ldebr RRE_FF "load lengthened short to long bfp" g5 esa,zarch +ed0000000004 ldeb RXE_FRRD "load lengthened short to long bfp" g5 esa,zarch +b341 lnxbr RRE_FF "load negative extended bfp" g5 esa,zarch +b311 lndbr RRE_FF "load negative long bfp" g5 esa,zarch +b301 lnebr RRE_FF "load negative short bfp" g5 esa,zarch +b340 lpxbr RRE_FF "load positive extended bfp" g5 esa,zarch +b310 lpdbr RRE_FF "load positive long bfp" g5 esa,zarch +b300 lpebr RRE_FF "load positive short bfp" g5 esa,zarch +b345 ldxbr RRE_FF "load rounded extended to long bfp" g5 esa,zarch +b346 lexbr RRE_FF "load rounded extended to short bfp" g5 esa,zarch +b344 ledbr RRE_FF "load rounded long to short bfp" g5 esa,zarch +b34c mxbr RRE_FF "multiply extended bfp" g5 esa,zarch +b31c mdbr RRE_FF "multiply long bfp" g5 esa,zarch +ed000000001c mdb RXE_FRRD "multiply long bfp" g5 esa,zarch +b307 mxdbr RRE_FF "multiply long to extended bfp" g5 esa,zarch +ed0000000007 mxdb RXE_FRRD "multiply long to extended bfp" g5 esa,zarch +b317 meebr RRE_FF "multiply short bfp" g5 esa,zarch +ed0000000017 meeb RXE_FRRD "multiply short bfp" g5 esa,zarch +b30c mdebr RRE_FF "multiply short to long bfp" g5 esa,zarch +ed000000000c mdeb RXE_FRRD "multiply short to long bfp" g5 esa,zarch +b31e madbr RRF_F0FF "multiply and add long bfp" g5 esa,zarch +ed000000001e madb RXF_FRRDF "multiply and add long bfp" g5 esa,zarch +b30e maebr RRF_F0FF "multiply and add short bfp" g5 esa,zarch +ed000000000e maeb RXF_FRRDF "multiply and add short bfp" g5 esa,zarch +b31f msdbr RRF_F0FF "multiply and subtract long bfp" g5 esa,zarch +ed000000001f msdb RXF_FRRDF "multiply and subtract long bfp" g5 esa,zarch +b30f msebr RRF_F0FF "multiply and subtract short bfp" g5 esa,zarch +ed000000000f mseb RXF_FRRDF "multiply and subtract short bfp" g5 esa,zarch +b384 sfpc RRE_RR "set fpc" g5 esa,zarch +b299 srnm S_RD "set rounding mode" g5 esa,zarch +b316 sqxbr RRE_FF "square root extended bfp" g5 esa,zarch +b315 sqdbr RRE_FF "square root long bfp" g5 esa,zarch +ed0000000015 sqdb RXE_FRRD "square root long bfp" g5 esa,zarch +b314 sqebr RRE_FF "square root short bfp" g5 esa,zarch +ed0000000014 sqeb RXE_FRRD "square root short bfp" g5 esa,zarch +b29c stfpc S_RD "store fpc" g5 esa,zarch +b34b sxbr RRE_FF "subtract extended bfp" g5 esa,zarch +b31b sdbr RRE_FF "subtract long bfp" g5 esa,zarch +ed000000001b sdb RXE_FRRD "subtract long bfp" g5 esa,zarch +b30b sebr RRE_FF "subtract short bfp" g5 esa,zarch +ed000000000b seb RXE_FRRD "subtract short bfp" g5 esa,zarch +ed0000000012 tcxb RXE_FRRD "test data class extended bfp" g5 esa,zarch +ed0000000011 tcdb RXE_FRRD "test data class long bfp" g5 esa,zarch +ed0000000010 tceb RXE_FRRD "test data class short bfp" g5 esa,zarch +b274 siga S_RD "signal adapter" g5 esa,zarch +b2a6 cuutf RRE_RR "convert unicode to utf-8" g5 esa,zarch +b2a7 cutfu RRE_RR "convert utf-8 to unicode" g5 esa,zarch +ee plo SS_RRRDRD2 "perform locked operation" g5 esa,zarch +b25a bsa RRE_RR "branch and set authority" g5 esa,zarch +b277 rp S_RD "resume program" g5 esa,zarch +0107 sckpf E "set clock programmable field" g5 esa,zarch +b27d stsi S_RD "store system information" g5 esa,zarch +01ff trap2 E "trap" g5 esa,zarch +b2ff trap4 S_RD "trap4" g5 esa,zarch +a700 tmlh RI_RU "test under mask low high" g5 esa,zarch +a701 tmll RI_RU "test under mask low low" g5 esa,zarch +b278 stcke S_RD "store clock extended" g5 esa,zarch +b2a5 tre RRE_RR "translate extended" g5 esa,zarch +eb000000008e mvclu RSE_RRRD "move long unicode" g5 esa,zarch +e9 pka SS_L0RDRD "pack ascii" g5 esa,zarch +e1 pku SS_L0RDRD "pack unicode" g5 esa,zarch +b993 troo RRE_RR "translate one to one" g5 esa,zarch +b992 trot RRE_RR "translate one to two" g5 esa,zarch +b991 trto RRE_RR "translate two to one" g5 esa,zarch +b990 trtt RRE_RR "translate two to two" g5 esa,zarch +ea unpka SS_L0RDRD "unpack ascii" g5 esa,zarch +e2 unpku SS_L0RDRD "unpack unicode" g5 esa,zarch +b358 thder RRE_RR "convert short bfp to long hfp" g5 esa,zarch +b359 thdr RRE_RR "convert long bfp to long hfp" g5 esa,zarch +b350 tbedr RRF_U0FF "convert long hfp to short bfp" g5 esa,zarch +b351 tbdr RRF_U0FF "convert long hfp to long bfp" g5 esa,zarch +b374 lzer RRE_R0 "load short zero" g5 esa,zarch +b375 lzdr RRE_R0 "load long zero" g5 esa,zarch +b376 lzxr RRE_R0 "load extended zero" g5 esa,zarch # Here are the new esame instructions: -b946 bctgr RRE_RR "branch on count 64" esame -b900 lpgr RRE_RR "load positive 64" esame -b910 lpgfr RRE_RR "load positive 64<32" esame -b901 lngr RRE_RR "load negative 64" esame -b911 lngfr RRE_RR "load negative 64<32" esame -b902 ltgr RRE_RR "load and test 64" esame -b912 ltgfr RRE_RR "load and test 64<32" esame -b903 lcgr RRE_RR "load complement 64" esame -b913 lcgfr RRE_RR "load complement 64<32" esame -b980 ngr RRE_RR "and 64" esame -b921 clgr RRE_RR "compare logical 64" esame -b931 clgfr RRE_RR "compare logical 64<32" esame -b981 ogr RRE_RR "or 64" esame -b982 xgr RRE_RR "exclusive or 64" esame -b904 lgr RRE_RR "load 64" esame -b914 lgfr RRE_RR "load 64<32" esame -b920 cgr RRE_RR "compare 64" esame -b930 cgfr RRE_RR "compare 64<32" esame -b908 agr RRE_RR "add 64" esame -b918 agfr RRE_RR "add 64<32" esame -b909 sgr RRE_RR "subtract 64" esame -b919 sgfr RRE_RR "subtract 64<32" esame -b90a algr RRE_RR "add logical 64" esame -b91a algfr RRE_RR "add logical 64<32" esame -b90b slgr RRE_RR "subtract logical 64" esame -b91b slgfr RRE_RR "subtract logical 64<32" esame -e30000000046 bctg RXE_RRRD "branch on count 64" esame -e3000000002e cvdg RXE_RRRD "convert to decimal 64" esame -e3000000000e cvbg RXE_RRRD "convert to binary 64" esame -e30000000024 stg RXE_RRRD "store 64" esame -e30000000080 ng RXE_RRRD "and 64" esame -e30000000021 clg RXE_RRRD "compare logical 64" esame -e30000000031 clgf RXE_RRRD "comparee logical 64<32" esame -e30000000081 og RXE_RRRD "or 64" esame -e30000000082 xg RXE_RRRD "exclusive or 64" esame -e30000000004 lg RXE_RRRD "load 64" esame -e30000000014 lgf RXE_RRRD "load 64<32" esame -e30000000015 lgh RXE_RRRD "load halfword 64" esame -e30000000020 cg RXE_RRRD "compare 64" esame -e30000000030 cgf RXE_RRRD "compare 64<32" esame -e30000000008 ag RXE_RRRD "add 64" esame -e30000000018 agf RXE_RRRD "add 64<32" esame -e30000000009 sg RXE_RRRD "subtract 64" esame -e30000000019 sgf RXE_RRRD "subtract 64<32" esame -e3000000000a alg RXE_RRRD "add logical 64" esame -e3000000001a algf RXE_RRRD "add logical 64<32" esame -e3000000000b slg RXE_RRRD "subtract logical 64" esame -e3000000001b slgf RXE_RRRD "subtract logical 64<32" esame -e3000000000c msg RXE_RRRD "multiply single 64" esame -e3000000001c msgf RXE_RRRD "multiply single 64<32" esame -ec0000000044 brxhg RIE_RRP "branch relative on index high 64" esame -ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" esame -eb0000000044 bxhg RSE_RRRD "branch on index high 64" esame -eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" esame -eb000000000c srlg RSE_RRRD "shift right single logical 64" esame -eb000000000d sllg RSE_RRRD "shift left single logical 64" esame -eb000000000a srag RSE_RRRD "shift right single 64" esame -eb000000000b slag RSE_RRRD "shift left single 64" esame -eb0000000024 stmg RSE_RRRD "store multiple 64" esame -eb0000000026 stmh RSE_RRRD "store multiple high" esame -eb0000000004 lmg RSE_RRRD "load multiple 64" esame -eb0000000096 lmh RSE_RRRD "load multiple high" esame -ef lmd SS_RRRDRD3 "load multiple disjoint" esame -eb000000000f tracg RSE_RRRD "trace 64" esame -e30000000003 lrag RXE_RRRD "load real address 64" esame -e50000000002 strag SSE_RDRD "store read address" esame -eb0000000025 stctg RSE_RRRD "store control 64" esame -eb000000002f lctlg RSE_RRRD "load control 64" esame -eb0000000030 csg RSE_RRRD "compare and swap 64" esame -eb000000003e cdsg RSE_RRRD "compare double and swap 64" esame -eb0000000020 clmh RSE_RURD "compare logical characters under mask high" esame -eb000000002c stcmh RSE_RURD "store characters under mask high" esame -eb0000000080 icmh RSE_RURD "insert characters under mask high" esame -a700 tmlh RI_RU "test under mask low high" esame -a702 tmhh RI_RU "test under mask high high" esame -a701 tmll RI_RU "test under mask low low" esame -a703 tmhl RI_RU "test under mask high low" esame -c004 brcl RIL_UP "branch relative on condition long" esame -c014 jgo RIL_0P "jump long on overflow / if ones" esame -c024 jgh RIL_0P "jump long on high" esame -c024 jgp RIL_0P "jump long on plus" esame -c034 jgnle RIL_0P "jump long on not low or equal" esame -c044 jgl RIL_0P "jump long on low" esame -c044 jgm RIL_0P "jump long on minus / if mixed" esame -c054 jgnhe RIL_0P "jump long on not high or equal" esame -c064 jglh RIL_0P "jump long on low or high" esame -c074 jgne RIL_0P "jump long on not equal" esame -c074 jgnz RIL_0P "jump long on not zero / if not zeros" esame -c084 jge RIL_0P "jump long on equal" esame -c084 jgz RIL_0P "jump long on zero / if zeros" esame -c094 jgnlh RIL_0P "jump long on not low or high" esame -c0a4 jghe RIL_0P "jump long on high or equal" esame -c0b4 jgnl RIL_0P "jump long on not low" esame -c0b4 jgnm RIL_0P "jump long on not minus / if not mixed" esame -c0c4 jgle RIL_0P "jump long on low or equal" esame -c0d4 jgnh RIL_0P "jump long on not high" esame -c0d4 jgnp RIL_0P "jump long on not plus" esame -c0e4 jgno RIL_0P "jump long on not overflow / if not ones" esame -c0f4 jg RIL_0P "jump long" esame -c005 brasl RIL_RP "branch relative and save long" esame -a707 brctg RI_RP "branch relative on count 64" esame -a709 lghi RI_RI "load halfword immediate 64" esame -a70b aghi RI_RI "add halfword immediate 64" esame -a70d mghi RI_RI "multiply halfword immediate 64" esame -a70f cghi RI_RI "compare halfword immediate 64" esame -b925 sturg RRE_RR "store using real address 64" esame -b90e eregg RRE_RR "extract stacked registers 64" esame -b905 lurag RRE_RR "load using real address 64" esame -b90c msgr RRE_RR "multiply single 64" esame -b91c msgfr RRE_RR "multiply single 64<32" esame -b3a4 cegbr RRE_RR "convert from fixed 64 to short bfp" esame -b3a5 cdgbr RRE_RR "convert from fixed 64 to long bfp" esame -b3a6 cxgbr RRE_RR "convert from fixed 64 to extended bfp" esame -b3a8 cgebr RRF_U0FR "convert to fixed short bfd to 64" esame -b3a9 cgdbr RRF_U0FR "convert to fixed long bfp to 64" esame -b3aa cgxbr RRF_U0FR "convert to fixed extended bfp to 64" esame -b3c4 cegr RRE_RR "convert from fixed 64 to short hfp" esame -b3c5 cdgr RRE_RR "convert from fixed 64 to long hfp" esame -b3c6 cxgr RRE_RR "convert from fixed 64 to extended hfp" esame -b3c8 cger RRF_U0FR "convert to fixed short hfp to 64" esame -b3c9 cgdr RRF_U0FR "convert to fixed long hfp to 64" esame -b3ca cgxr RRF_U0FR "convert to fixed extended hfp to 64" esame -010b tam E "test addressing mode" esame -010c sam24 E "set addressing mode 24" esame -010d sam31 E "set addressing mode 31" esame -010e sam64 E "set addressing mode 64" esame -a500 iihh RI_RU "insert immediate high high" esame -a501 iihl RI_RU "insert immediate high low" esame -a502 iilh RI_RU "insert immediate low high" esame -a503 iill RI_RU "insert immediate low low" esame -a504 nihh RI_RU "and immediate high high" esame -a505 nihl RI_RU "and immediate high low" esame -a506 nilh RI_RU "and immediate low high" esame -a507 nill RI_RU "and immediate low low" esame -a508 oihh RI_RU "or immediate high high" esame -a509 oihl RI_RU "or immediate high low" esame -a50a oilh RI_RU "or immediate low high" esame -a50b oill RI_RU "or immediate low low" esame -a50c llihh RI_RU "load logical immediate high high" esame -a50d llihl RI_RU "load logical immediate high low" esame -a50e llilh RI_RU "load logical immediate low high" esame -a50f llill RI_RU "load logical immediate low low" esame -b2b1 stfl S_RD "store facility list" esame -b2b2 lpswe S_RD "load psw extended" esame -b90d dsgr RRE_RR "divide single 64" esame -b90f lrvgr RRE_RR "load reversed 64" esame -b916 llgfr RRE_RR "load logical 64<32" esame -b917 llgtr RRE_RR "load logical thirty one bits" esame -b91d dsgfr RRE_RR "divide single 64<32" esame -b91f lrvr RRE_RR "load reversed 32" esame -b986 mlgr RRE_RR "multiply logical 64" esame -b987 dlgr RRE_RR "divide logical 64" esame -b988 alcgr RRE_RR "add logical with carry 64" esame -b989 slbgr RRE_RR "subtract logical with borrow 64" esame -b98d epsw RRE_RR "extract psw" esame -b996 mlr RRE_RR "multiply logical 32" esame -b997 dlr RRE_RR "divide logical 32" esame -b998 alcr RRE_RR "add logical with carry 32" esame -b999 slbr RRE_RR "subtract logical with borrow 32" esame -b99d esea RRE_R0 "extract and set extended authority" esame -c000 larl RIL_RP "load address relative long" esame -e3000000000d dsg RXE_RRRD "divide single 64" esame -e3000000000f lrvg RXE_RRRD "load reversed 64" esame -e30000000016 llgf RXE_RRRD "load logical 64<32" esame -e30000000017 llgt RXE_RRRD "load logical thirty one bits" esame -e3000000001d dsgf RXE_RRRD "divide single 64<32" esame -e3000000001e lrv RXE_RRRD "load reversed 32" esame -e3000000001f lrvh RXE_RRRD "load reversed 16" esame -e3000000002f strvg RXE_RRRD "store reversed 64" esame -e3000000003e strv RXE_RRRD "store reversed 32" esame -e3000000003f strvh RXE_RRRD "store reversed 64" esame -e30000000086 mlg RXE_RRRD "multiply logical 64" esame -e30000000087 dlg RXE_RRRD "divide logical 64" esame -e30000000088 alcg RXE_RRRD "add logical with carry 64" esame -e30000000089 slbg RXE_RRRD "subtract logical with borrow 64" esame -e3000000008e stpq RXE_RRRD "store pair to quadword" esame -e3000000008f lpq RXE_RRRD "load pair from quadword" esame -e30000000096 ml RXE_RRRD "multiply logical 32" esame -e30000000097 dl RXE_RRRD "divide logical 32" esame -e30000000098 alc RXE_RRRD "add logical with carry 32" esame -e30000000099 slb RXE_RRRD "subtract logical with borrow 32" esame -e30000000090 llgc RXE_RRRD "load logical character" esame -e30000000091 llgh RXE_RRRD "load logical halfword" esame -eb000000001c rllg RSE_RRRD "rotate left single logical 64" esame -eb000000001d rll RSE_RRRD "rotate left single logical 32" esame -b278 stcke S_RD "store clock extended" esame -b2a5 tre RRE_RR "translate extended" esame -eb000000008e mvclu RSE_RRRD "move long unicode" esame -e9 pka SS_L0RDRD "pack ascii" esame -e1 pku SS_L0RDRD "pack unicode" esame -b993 troo RRE_RR "translate one to one" esame -b992 trot RRE_RR "translate one to two" esame -b991 trto RRE_RR "translate two to one" esame -b990 trtt RRE_RR "translate two to two" esame -ea unpka SS_L0RDRD "unpack ascii" esame -e2 unpku SS_L0RDRD "unpack unicode" esame -b358 thder RRE_RR "convert short bfp to long hfp" esame -b359 thdr RRE_RR "convert long bfp to long hfp" esame -b350 tbedr RRF_U0FF "convert long hfp to short bfp" esame -b351 tbdr RRF_U0FF "convert long hfp to long bfp" esame -b374 lzer RRE_R0 "load short zero" esame -b375 lzdr RRE_R0 "load long zero" esame -b376 lzxr RRE_R0 "load extended zero" esame +b946 bctgr RRE_RR "branch on count 64" z900 zarch +b900 lpgr RRE_RR "load positive 64" z900 zarch +b910 lpgfr RRE_RR "load positive 64<32" z900 zarch +b901 lngr RRE_RR "load negative 64" z900 zarch +b911 lngfr RRE_RR "load negative 64<32" z900 zarch +b902 ltgr RRE_RR "load and test 64" z900 zarch +b912 ltgfr RRE_RR "load and test 64<32" z900 zarch +b903 lcgr RRE_RR "load complement 64" z900 zarch +b913 lcgfr RRE_RR "load complement 64<32" z900 zarch +b980 ngr RRE_RR "and 64" z900 zarch +b921 clgr RRE_RR "compare logical 64" z900 zarch +b931 clgfr RRE_RR "compare logical 64<32" z900 zarch +b981 ogr RRE_RR "or 64" z900 zarch +b982 xgr RRE_RR "exclusive or 64" z900 zarch +b904 lgr RRE_RR "load 64" z900 zarch +b914 lgfr RRE_RR "load 64<32" z900 zarch +b920 cgr RRE_RR "compare 64" z900 zarch +b930 cgfr RRE_RR "compare 64<32" z900 zarch +b908 agr RRE_RR "add 64" z900 zarch +b918 agfr RRE_RR "add 64<32" z900 zarch +b909 sgr RRE_RR "subtract 64" z900 zarch zarch +b919 sgfr RRE_RR "subtract 64<32" z900 zarch +b90a algr RRE_RR "add logical 64" z900 zarch +b91a algfr RRE_RR "add logical 64<32" z900 zarch +b90b slgr RRE_RR "subtract logical 64" z900 zarch +b91b slgfr RRE_RR "subtract logical 64<32" z900 zarch +e30000000046 bctg RXE_RRRD "branch on count 64" z900 zarch +e3000000002e cvdg RXE_RRRD "convert to decimal 64" z900 zarch +e3000000000e cvbg RXE_RRRD "convert to binary 64" z900 zarch +e30000000024 stg RXE_RRRD "store 64" z900 zarch +e30000000080 ng RXE_RRRD "and 64" z900 zarch +e30000000021 clg RXE_RRRD "compare logical 64" z900 zarch +e30000000031 clgf RXE_RRRD "comparee logical 64<32" z900 zarch +e30000000081 og RXE_RRRD "or 64" z900 zarch +e30000000082 xg RXE_RRRD "exclusive or 64" z900 zarch +e30000000004 lg RXE_RRRD "load 64" z900 zarch +e30000000014 lgf RXE_RRRD "load 64<32" z900 zarch +e30000000015 lgh RXE_RRRD "load halfword 64" z900 zarch +e30000000020 cg RXE_RRRD "compare 64" z900 zarch +e30000000030 cgf RXE_RRRD "compare 64<32" z900 zarch +e30000000008 ag RXE_RRRD "add 64" z900 zarch +e30000000018 agf RXE_RRRD "add 64<32" z900 zarch +e30000000009 sg RXE_RRRD "subtract 64" z900 zarch +e30000000019 sgf RXE_RRRD "subtract 64<32" z900 zarch +e3000000000a alg RXE_RRRD "add logical 64" z900 zarch +e3000000001a algf RXE_RRRD "add logical 64<32" z900 zarch +e3000000000b slg RXE_RRRD "subtract logical 64" z900 zarch +e3000000001b slgf RXE_RRRD "subtract logical 64<32" z900 zarch +e3000000000c msg RXE_RRRD "multiply single 64" z900 zarch +e3000000001c msgf RXE_RRRD "multiply single 64<32" z900 zarch +ec0000000044 brxhg RIE_RRP "branch relative on index high 64" z900 zarch +ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" z900 zarch +eb0000000044 bxhg RSE_RRRD "branch on index high 64" z900 zarch +eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" z900 zarch +eb000000000c srlg RSE_RRRD "shift right single logical 64" z900 zarch +eb000000000d sllg RSE_RRRD "shift left single logical 64" z900 zarch +eb000000000a srag RSE_RRRD "shift right single 64" z900 zarch +eb000000000b slag RSE_RRRD "shift left single 64" z900 zarch +eb0000000024 stmg RSE_RRRD "store multiple 64" z900 zarch +eb0000000026 stmh RSE_RRRD "store multiple high" z900 zarch +eb0000000004 lmg RSE_RRRD "load multiple 64" z900 zarch +eb0000000096 lmh RSE_RRRD "load multiple high" z900 zarch +ef lmd SS_RRRDRD3 "load multiple disjoint" z900 zarch +eb000000000f tracg RSE_RRRD "trace 64" z900 zarch +e30000000003 lrag RXE_RRRD "load real address 64" z900 zarch +e50000000002 strag SSE_RDRD "store read address" z900 zarch +eb0000000025 stctg RSE_RRRD "store control 64" z900 zarch +eb000000002f lctlg RSE_RRRD "load control 64" z900 zarch +eb0000000030 csg RSE_RRRD "compare and swap 64" z900 zarch +eb000000003e cdsg RSE_RRRD "compare double and swap 64" z900 zarch +eb0000000020 clmh RSE_RURD "compare logical characters under mask high" z900 zarch +eb000000002c stcmh RSE_RURD "store characters under mask high" z900 zarch +eb0000000080 icmh RSE_RURD "insert characters under mask high" z900 zarch +a702 tmhh RI_RU "test under mask high high" z900 zarch +a703 tmhl RI_RU "test under mask high low" z900 zarch +c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch +c014 jgo RIL_0P "jump long on overflow / if ones" z900 esa,zarch +c024 jgh RIL_0P "jump long on high" z900 esa,zarch +c024 jgp RIL_0P "jump long on plus" z900 esa,zarch +c034 jgnle RIL_0P "jump long on not low or equal" z900 esa,zarch +c044 jgl RIL_0P "jump long on low" z900 esa,zarch +c044 jgm RIL_0P "jump long on minus / if mixed" z900 esa,zarch +c054 jgnhe RIL_0P "jump long on not high or equal" z900 esa,zarch +c064 jglh RIL_0P "jump long on low or high" z900 esa,zarch +c074 jgne RIL_0P "jump long on not equal" z900 esa,zarch +c074 jgnz RIL_0P "jump long on not zero / if not zeros" z900 esa,zarch +c084 jge RIL_0P "jump long on equal" z900 esa,zarch +c084 jgz RIL_0P "jump long on zero / if zeros" z900 esa,zarch +c094 jgnlh RIL_0P "jump long on not low or high" z900 esa,zarch +c0a4 jghe RIL_0P "jump long on high or equal" z900 esa,zarch +c0b4 jgnl RIL_0P "jump long on not low" z900 esa,zarch +c0b4 jgnm RIL_0P "jump long on not minus / if not mixed" z900 esa,zarch +c0c4 jgle RIL_0P "jump long on low or equal" z900 esa,zarch +c0d4 jgnh RIL_0P "jump long on not high" z900 esa,zarch +c0d4 jgnp RIL_0P "jump long on not plus" z900 esa,zarch +c0e4 jgno RIL_0P "jump long on not overflow / if not ones" z900 esa,zarch +c0f4 jg RIL_0P "jump long" z900 esa,zarch +c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch +a707 brctg RI_RP "branch relative on count 64" z900 zarch +a709 lghi RI_RI "load halfword immediate 64" z900 zarch +a70b aghi RI_RI "add halfword immediate 64" z900 zarch +a70d mghi RI_RI "multiply halfword immediate 64" z900 zarch +a70f cghi RI_RI "compare halfword immediate 64" z900 zarch +b925 sturg RRE_RR "store using real address 64" z900 zarch +b90e eregg RRE_RR "extract stacked registers 64" z900 zarch +b905 lurag RRE_RR "load using real address 64" z900 zarch +b90c msgr RRE_RR "multiply single 64" z900 zarch +b91c msgfr RRE_RR "multiply single 64<32" z900 zarch +b3a4 cegbr RRE_RR "convert from fixed 64 to short bfp" z900 zarch +b3a5 cdgbr RRE_RR "convert from fixed 64 to long bfp" z900 zarch +b3a6 cxgbr RRE_RR "convert from fixed 64 to extended bfp" z900 zarch +b3a8 cgebr RRF_U0FR "convert to fixed short bfd to 64" z900 zarch +b3a9 cgdbr RRF_U0FR "convert to fixed long bfp to 64" z900 zarch +b3aa cgxbr RRF_U0FR "convert to fixed extended bfp to 64" z900 zarch +b3c4 cegr RRE_RR "convert from fixed 64 to short hfp" z900 zarch +b3c5 cdgr RRE_RR "convert from fixed 64 to long hfp" z900 zarch +b3c6 cxgr RRE_RR "convert from fixed 64 to extended hfp" z900 zarch +b3c8 cger RRF_U0FR "convert to fixed short hfp to 64" z900 zarch +b3c9 cgdr RRF_U0FR "convert to fixed long hfp to 64" z900 zarch +b3ca cgxr RRF_U0FR "convert to fixed extended hfp to 64" z900 zarch +010b tam E "test addressing mode" z900 esa,zarch +010c sam24 E "set addressing mode 24" z900 esa,zarch +010d sam31 E "set addressing mode 31" z900 esa,zarch +010e sam64 E "set addressing mode 64" z900 zarch +a500 iihh RI_RU "insert immediate high high" z900 zarch +a501 iihl RI_RU "insert immediate high low" z900 zarch +a502 iilh RI_RU "insert immediate low high" z900 zarch +a503 iill RI_RU "insert immediate low low" z900 zarch +a504 nihh RI_RU "and immediate high high" z900 zarch +a505 nihl RI_RU "and immediate high low" z900 zarch +a506 nilh RI_RU "and immediate low high" z900 zarch +a507 nill RI_RU "and immediate low low" z900 zarch +a508 oihh RI_RU "or immediate high high" z900 zarch +a509 oihl RI_RU "or immediate high low" z900 zarch +a50a oilh RI_RU "or immediate low high" z900 zarch +a50b oill RI_RU "or immediate low low" z900 zarch +a50c llihh RI_RU "load logical immediate high high" z900 zarch +a50d llihl RI_RU "load logical immediate high low" z900 zarch +a50e llilh RI_RU "load logical immediate low high" z900 zarch +a50f llill RI_RU "load logical immediate low low" z900 zarch +b2b1 stfl S_RD "store facility list" z900 esa,zarch +b2b2 lpswe S_RD "load psw extended" z900 zarch +b90d dsgr RRE_RR "divide single 64" z900 zarch +b90f lrvgr RRE_RR "load reversed 64" z900 zarch +b916 llgfr RRE_RR "load logical 64<32" z900 zarch +b917 llgtr RRE_RR "load logical thirty one bits" z900 zarch +b91d dsgfr RRE_RR "divide single 64<32" z900 zarch +b91f lrvr RRE_RR "load reversed 32" z900 esa,zarch +b986 mlgr RRE_RR "multiply logical 64" z900 zarch +b987 dlgr RRE_RR "divide logical 64" z900 zarch +b988 alcgr RRE_RR "add logical with carry 64" z900 zarch +b989 slbgr RRE_RR "subtract logical with borrow 64" z900 zarch +b98d epsw RRE_RR "extract psw" z900 esa,zarch +b996 mlr RRE_RR "multiply logical 32" z900 esa,zarch +b997 dlr RRE_RR "divide logical 32" z900 esa,zarch +b998 alcr RRE_RR "add logical with carry 32" z900 esa,zarch +b999 slbr RRE_RR "subtract logical with borrow 32" z900 esa,zarch +b99d esea RRE_R0 "extract and set extended authority" z900 zarch +c000 larl RIL_RP "load address relative long" z900 esa,zarch +e3000000000d dsg RXE_RRRD "divide single 64" z900 zarch +e3000000000f lrvg RXE_RRRD "load reversed 64" z900 zarch +e30000000016 llgf RXE_RRRD "load logical 64<32" z900 zarch +e30000000017 llgt RXE_RRRD "load logical thirty one bits" z900 zarch +e3000000001d dsgf RXE_RRRD "divide single 64<32" z900 zarch +e3000000001e lrv RXE_RRRD "load reversed 32" z900 esa,zarch +e3000000001f lrvh RXE_RRRD "load reversed 16" z900 esa,zarch +e3000000002f strvg RXE_RRRD "store reversed 64" z900 zarch +e3000000003e strv RXE_RRRD "store reversed 32" z900 esa,zarch +e3000000003f strvh RXE_RRRD "store reversed 64" z900 esa,zarch +e30000000086 mlg RXE_RRRD "multiply logical 64" z900 zarch +e30000000087 dlg RXE_RRRD "divide logical 64" z900 zarch +e30000000088 alcg RXE_RRRD "add logical with carry 64" z900 zarch +e30000000089 slbg RXE_RRRD "subtract logical with borrow 64" z900 zarch +e3000000008e stpq RXE_RRRD "store pair to quadword" z900 zarch +e3000000008f lpq RXE_RRRD "load pair from quadword" z900 zarch +e30000000096 ml RXE_RRRD "multiply logical 32" z900 esa,zarch +e30000000097 dl RXE_RRRD "divide logical 32" z900 esa,zarch +e30000000098 alc RXE_RRRD "add logical with carry 32" z900 esa,zarch +e30000000099 slb RXE_RRRD "subtract logical with borrow 32" z900 esa,zarch +e30000000090 llgc RXE_RRRD "load logical character" z900 zarch +e30000000091 llgh RXE_RRRD "load logical halfword" z900 zarch +eb000000001c rllg RSE_RRRD "rotate left single logical 64" z900 zarch +eb000000001d rll RSE_RRRD "rotate left single logical 32" z900 esa,zarch diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 5e4b316ca86..c6597defef5 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,27 @@ +2003-03-20 Nick Clifton <nickc@redhat.com> + + * Contribute support for Cirrus Maverick ARM co-processor, + written by Aldy Hernandez <aldyh@redhat.com> and + Andrew Cagney <cagney@redhat.com>: + + * maverick.c: New file: Support for Maverick floating point + co-processor. + * Makefile.in: Add maverick.o target. + * configure.in (COPRO): Add maverick.o. + * configure: Regenerate. + * armcopro.c (ARMul_CoProInit): Only initialise co-processors + available on target processor. Add code to initialse Maverick + co-processor support code. + * armdefs.h (ARMul_state): Add is_ep9312 field. + (ARM_ep9312_Prop): Define. + * armemu.h: Add prototypes for Maverick co-processor + functions. + * arminit.c (ARMul_SelectProcessor): Initialise the + co-processor support once the chip has been selected. + * wrapper.c: Add support for Maverick co-processor. + (init): Do not call ARMul_CoProInit. Delays this until the + chip has been selected. + 2003-03-02 Nick Clifton <nickc@redhat.com> * armos.c (SWIWrite0): Catch big-endian bug when printing diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in index 0da765fd703..017a983289d 100644 --- a/sim/arm/Makefile.in +++ b/sim/arm/Makefile.in @@ -31,6 +31,7 @@ SIM_OBJS = armemu26.o armemu32.o arminit.o armos.o armsupp.o \ armos.o: armos.c armdefs.h armos.h armfpe.h armcopro.o: armcopro.c armdefs.h +maverick.o: maverick.c armdefs.h armemu26.o: armemu.c armdefs.h armemu.h $(CC) -c $(srcdir)/armemu.c -o armemu26.o $(ALL_CFLAGS) diff --git a/sim/arm/armcopro.c b/sim/arm/armcopro.c index 2c2ca8505a6..b9747894869 100644 --- a/sim/arm/armcopro.c +++ b/sim/arm/armcopro.c @@ -1322,34 +1322,48 @@ ARMul_CoProInit (ARMul_State * state) /* Install CoPro Instruction handlers here. The format is: - ARMul_CoProAttach (state, CP Number, - Init routine, Exit routine - LDC routine, STC routine, - MRC routine, MCR routine, - CDP routine, - Read Reg routine, Write Reg routine). */ - ARMul_CoProAttach (state, 4, NULL, NULL, - ValLDC, ValSTC, ValMRC, ValMCR, ValCDP, NULL, NULL); - - ARMul_CoProAttach (state, 5, NULL, NULL, - NULL, NULL, ValMRC, ValMCR, IntCDP, NULL, NULL); - - ARMul_CoProAttach (state, 15, MMUInit, NULL, - NULL, NULL, MMUMRC, MMUMCR, NULL, MMURead, MMUWrite); - - ARMul_CoProAttach (state, 13, XScale_cp13_init, NULL, - XScale_cp13_LDC, XScale_cp13_STC, XScale_cp13_MRC, - XScale_cp13_MCR, NULL, XScale_cp13_read_reg, - XScale_cp13_write_reg); - - ARMul_CoProAttach (state, 14, XScale_cp14_init, NULL, - XScale_cp14_LDC, XScale_cp14_STC, XScale_cp14_MRC, - XScale_cp14_MCR, NULL, XScale_cp14_read_reg, - XScale_cp14_write_reg); - - ARMul_CoProAttach (state, 15, XScale_cp15_init, NULL, - NULL, NULL, XScale_cp15_MRC, XScale_cp15_MCR, - NULL, XScale_cp15_read_reg, XScale_cp15_write_reg); + ARMul_CoProAttach (state, CP Number, Init routine, Exit routine + LDC routine, STC routine, MRC routine, MCR routine, + CDP routine, Read Reg routine, Write Reg routine). */ + if (state->is_ep9312) + { + ARMul_CoProAttach (state, 4, NULL, NULL, DSPLDC4, DSPSTC4, + DSPMRC4, DSPMCR4, DSPCDP4, NULL, NULL); + ARMul_CoProAttach (state, 5, NULL, NULL, DSPLDC5, DSPSTC5, + DSPMRC5, DSPMCR5, DSPCDP5, NULL, NULL); + ARMul_CoProAttach (state, 6, NULL, NULL, NULL, NULL, + DSPMRC6, DSPMCR6, DSPCDP6, NULL, NULL); + } + else + { + ARMul_CoProAttach (state, 4, NULL, NULL, ValLDC, ValSTC, + ValMRC, ValMCR, ValCDP, NULL, NULL); + + ARMul_CoProAttach (state, 5, NULL, NULL, NULL, NULL, + ValMRC, ValMCR, IntCDP, NULL, NULL); + } + + if (state->is_XScale) + { + ARMul_CoProAttach (state, 13, XScale_cp13_init, NULL, + XScale_cp13_LDC, XScale_cp13_STC, XScale_cp13_MRC, + XScale_cp13_MCR, NULL, XScale_cp13_read_reg, + XScale_cp13_write_reg); + + ARMul_CoProAttach (state, 14, XScale_cp14_init, NULL, + XScale_cp14_LDC, XScale_cp14_STC, XScale_cp14_MRC, + XScale_cp14_MCR, NULL, XScale_cp14_read_reg, + XScale_cp14_write_reg); + + ARMul_CoProAttach (state, 15, XScale_cp15_init, NULL, + NULL, NULL, XScale_cp15_MRC, XScale_cp15_MCR, + NULL, XScale_cp15_read_reg, XScale_cp15_write_reg); + } + else + { + ARMul_CoProAttach (state, 15, MMUInit, NULL, NULL, NULL, + MMUMRC, MMUMCR, NULL, MMURead, MMUWrite); + } /* No handlers below here. */ diff --git a/sim/arm/armdefs.h b/sim/arm/armdefs.h index fde31251633..0f252226dd9 100644 --- a/sim/arm/armdefs.h +++ b/sim/arm/armdefs.h @@ -135,6 +135,7 @@ struct ARMul_State unsigned is_v5; /* Are we emulating a v5 architecture ? */ unsigned is_v5e; /* Are we emulating a v5e architecture ? */ unsigned is_XScale; /* Are we emulating an XScale architecture ? */ + unsigned is_ep9312; /* Are we emulating a Cirrus Maverick co-processor ? */ unsigned verbose; /* Print various messages like the banner */ }; @@ -162,6 +163,7 @@ struct ARMul_State #define ARM_v5_Prop 0x80 #define ARM_v5e_Prop 0x100 #define ARM_XScale_Prop 0x200 +#define ARM_ep9312_Prop 0x400 /***************************************************************************\ * Macros to extract instruction fields * diff --git a/sim/arm/armemu.h b/sim/arm/armemu.h index 385924bd689..dfaafb03bbc 100644 --- a/sim/arm/armemu.h +++ b/sim/arm/armemu.h @@ -530,3 +530,16 @@ extern void ARMul_CoProAttach (ARMul_State *, unsigned, ARMul_CPInits *, A extern void ARMul_CoProDetach (ARMul_State *, unsigned); extern ARMword read_cp15_reg (unsigned, unsigned, unsigned); +extern unsigned DSPLDC4 (ARMul_State *, unsigned, ARMword, ARMword); +extern unsigned DSPMCR4 (ARMul_State *, unsigned, ARMword, ARMword); +extern unsigned DSPMRC4 (ARMul_State *, unsigned, ARMword, ARMword *); +extern unsigned DSPSTC4 (ARMul_State *, unsigned, ARMword, ARMword *); +extern unsigned DSPCDP4 (ARMul_State *, unsigned, ARMword); +extern unsigned DSPMCR5 (ARMul_State *, unsigned, ARMword, ARMword); +extern unsigned DSPMRC5 (ARMul_State *, unsigned, ARMword, ARMword *); +extern unsigned DSPLDC5 (ARMul_State *, unsigned, ARMword, ARMword); +extern unsigned DSPSTC5 (ARMul_State *, unsigned, ARMword, ARMword *); +extern unsigned DSPCDP5 (ARMul_State *, unsigned, ARMword); +extern unsigned DSPMCR6 (ARMul_State *, unsigned, ARMword, ARMword); +extern unsigned DSPMRC6 (ARMul_State *, unsigned, ARMword, ARMword *); +extern unsigned DSPCDP6 (ARMul_State *, unsigned, ARMword); diff --git a/sim/arm/arminit.c b/sim/arm/arminit.c index c0312e95239..04399900c95 100644 --- a/sim/arm/arminit.c +++ b/sim/arm/arminit.c @@ -157,6 +157,11 @@ ARMul_SelectProcessor (ARMul_State * state, unsigned properties) state->is_v5 = (properties & ARM_v5_Prop) ? HIGH : LOW; state->is_v5e = (properties & ARM_v5e_Prop) ? HIGH : LOW; state->is_XScale = (properties & ARM_XScale_Prop) ? HIGH : LOW; + state->is_ep9312 = (properties & ARM_ep9312_Prop) ? HIGH : LOW; + + /* Only initialse the coprocessor support once we + know what kind of chip we are dealing with. */ + ARMul_CoProInit (state); } /***************************************************************************\ diff --git a/sim/arm/configure b/sim/arm/configure index 65f0825ff8c..26fd5f5d6d1 100755 --- a/sim/arm/configure +++ b/sim/arm/configure @@ -3534,7 +3534,8 @@ fi done -COPRO=armcopro.o +COPRO="armcopro.o maverick.o" + diff --git a/sim/arm/configure.in b/sim/arm/configure.in index cbfac44e4cd..73fa0a0a643 100644 --- a/sim/arm/configure.in +++ b/sim/arm/configure.in @@ -7,7 +7,8 @@ SIM_AC_COMMON AC_CHECK_HEADERS(unistd.h) -COPRO=armcopro.o +COPRO="armcopro.o maverick.o" + AC_SUBST(COPRO) SIM_AC_OUTPUT diff --git a/sim/arm/maverick.c b/sim/arm/maverick.c new file mode 100644 index 00000000000..82871f90675 --- /dev/null +++ b/sim/arm/maverick.c @@ -0,0 +1,1291 @@ +/* maverick.c -- Cirrus/DSP co-processor interface. + Copyright (C) 2003 Free Software Foundation, Inc. + Contributed by Aldy Hernandez (aldyh@redhat.com). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include <assert.h> +#include "armdefs.h" +#include "ansidecl.h" +#include "armemu.h" + +/*#define CIRRUS_DEBUG 1 /**/ +#if CIRRUS_DEBUG +# define printfdbg printf +#else +# define printfdbg printf_nothing +#endif + +#define POS64(i) ( (~(i)) >> 63 ) +#define NEG64(i) ( (i) >> 63 ) + +/* Define Co-Processor instruction handlers here. */ + +/* Here's ARMulator's DSP definition. A few things to note: + 1) it has 16 64-bit registers and 4 72-bit accumulators + 2) you can only access its registers with MCR and MRC. */ + +/* We can't define these in here because this file might not be linked + unless the target is arm9e-*. They are defined in wrapper.c. + Eventually the simulator should be made to handle any coprocessor + at run time. */ +struct maverick_regs +{ + union + { + int i; + float f; + } upper; + + union + { + int i; + float f; + } lower; +}; + +union maverick_acc_regs +{ + long double ld; /* Acc registers are 72-bits. */ +}; + +struct maverick_regs DSPregs[16]; +union maverick_acc_regs DSPacc[4]; +ARMword DSPsc; + +#define DEST_REG (BITS (12, 15)) +#define SRC1_REG (BITS (16, 19)) +#define SRC2_REG (BITS (0, 3)) + +static int lsw_int_index, msw_int_index; +static int lsw_float_index, msw_float_index; + +static double mv_getRegDouble (int); +static long long mv_getReg64int (int); +static void mv_setRegDouble (int, double val); +static void mv_setReg64int (int, long long val); + +static union +{ + double d; + long long ll; + int ints[2]; +} reg_conv; + +static void +printf_nothing (void * foo, ...) +{ +} + +static void +cirrus_not_implemented (char * insn) +{ + fprintf (stderr, "Cirrus instruction '%s' not implemented.\n", insn); + fprintf (stderr, "aborting!\n"); + + exit (1); +} + +static unsigned +DSPInit (ARMul_State * state) +{ + ARMul_ConsolePrint (state, ", DSP present"); + return TRUE; +} + +unsigned +DSPMRC4 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword * value) +{ + switch (BITS (5, 7)) + { + case 0: /* cfmvrdl */ + /* Move lower half of a DF stored in a DSP reg into an Arm reg. */ + printfdbg ("cfmvrdl\n"); + printfdbg ("\tlower half=0x%x\n", DSPregs[SRC1_REG].lower.i); + printfdbg ("\tentire thing=%g\n", mv_getRegDouble (SRC1_REG)); + + *value = (ARMword) DSPregs[SRC1_REG].lower.i; + break; + + case 1: /* cfmvrdh */ + /* Move upper half of a DF stored in a DSP reg into an Arm reg. */ + printfdbg ("cfmvrdh\n"); + printfdbg ("\tupper half=0x%x\n", DSPregs[SRC1_REG].upper.i); + printfdbg ("\tentire thing=%g\n", mv_getRegDouble (SRC1_REG)); + + *value = (ARMword) DSPregs[SRC1_REG].upper.i; + break; + + case 2: /* cfmvrs */ + /* Move SF from upper half of a DSP register to an Arm register. */ + *value = (ARMword) DSPregs[SRC1_REG].upper.i; + printfdbg ("cfmvrs = mvf%d <-- %f\n", + SRC1_REG, + DSPregs[SRC1_REG].upper.f); + break; + +#ifdef doesnt_work + case 4: /* cfcmps */ + { + float a, b; + int n, z, c, v; + + a = DSPregs[SRC1_REG].upper.f; + b = DSPregs[SRC2_REG].upper.f; + + printfdbg ("cfcmps\n"); + printfdbg ("\tcomparing %f and %f\n", a, b); + + z = a == b; /* zero */ + n = a != b; /* negative */ + v = a > b; /* overflow */ + c = 0; /* carry */ + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } + + case 5: /* cfcmpd */ + { + double a, b; + int n, z, c, v; + + a = mv_getRegDouble (SRC1_REG); + b = mv_getRegDouble (SRC2_REG); + + printfdbg ("cfcmpd\n"); + printfdbg ("\tcomparing %g and %g\n", a, b); + + z = a == b; /* zero */ + n = a != b; /* negative */ + v = a > b; /* overflow */ + c = 0; /* carry */ + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } +#else + case 4: /* cfcmps */ + { + float a, b; + int n, z, c, v; + + a = DSPregs[SRC1_REG].upper.f; + b = DSPregs[SRC2_REG].upper.f; + + printfdbg ("cfcmps\n"); + printfdbg ("\tcomparing %f and %f\n", a, b); + + z = a == b; /* zero */ + n = a < b; /* negative */ + c = a > b; /* carry */ + v = 0; /* fixme */ + printfdbg ("\tz = %d, n = %d\n", z, n); + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } + + case 5: /* cfcmpd */ + { + double a, b; + int n, z, c, v; + + a = mv_getRegDouble (SRC1_REG); + b = mv_getRegDouble (SRC2_REG); + + printfdbg ("cfcmpd\n"); + printfdbg ("\tcomparing %g and %g\n", a, b); + + z = a == b; /* zero */ + n = a < b; /* negative */ + c = a > b; /* carry */ + v = 0; /* fixme */ + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } +#endif + default: + fprintf (stderr, "unknown opcode in DSPMRC4 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPMRC5 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword * value) +{ + switch (BITS (5, 7)) + { + case 0: /* cfmvr64l */ + /* Move lower half of 64bit int from Cirrus to Arm. */ + *value = (ARMword) DSPregs[SRC1_REG].lower.i; + printfdbg ("cfmvr64l ARM_REG = mvfx%d <-- %d\n", + DEST_REG, + (int) *value); + break; + + case 1: /* cfmvr64h */ + /* Move upper half of 64bit int from Cirrus to Arm. */ + *value = (ARMword) DSPregs[SRC1_REG].upper.i; + printfdbg ("cfmvr64h <-- %d\n", (int) *value); + break; + + case 4: /* cfcmp32 */ + { + int res; + int n, z, c, v; + unsigned int a, b; + + printfdbg ("cfcmp32 mvfx%d - mvfx%d\n", + SRC1_REG, + SRC2_REG); + + /* FIXME: see comment for cfcmps. */ + a = DSPregs[SRC1_REG].lower.i; + b = DSPregs[SRC2_REG].lower.i; + + res = DSPregs[SRC1_REG].lower.i - DSPregs[SRC2_REG].lower.i; + /* zero */ + z = res == 0; + /* negative */ + n = res < 0; + /* overflow */ + v = SubOverflow (DSPregs[SRC1_REG].lower.i, DSPregs[SRC2_REG].lower.i, + res); + /* carry */ + c = (NEG (a) && POS (b) || + (NEG (a) && POS (res)) || (POS (b) && POS (res))); + + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } + + case 5: /* cfcmp64 */ + { + long long res; + int n, z, c, v; + unsigned long long a, b; + + printfdbg ("cfcmp64 mvdx%d - mvdx%d\n", + SRC1_REG, + SRC2_REG); + + /* fixme: see comment for cfcmps. */ + + a = mv_getReg64int (SRC1_REG); + b = mv_getReg64int (SRC2_REG); + + res = mv_getReg64int (SRC1_REG) - mv_getReg64int (SRC2_REG); + /* zero */ + z = res == 0; + /* negative */ + n = res < 0; + /* overflow */ + v = ((NEG64 (a) && POS64 (b) && POS64 (res)) + || (POS64 (a) && NEG64 (b) && NEG64 (res))); + /* carry */ + c = (NEG64 (a) && POS64 (b) || + (NEG64 (a) && POS64 (res)) || (POS64 (b) && POS64 (res))); + + *value = (n << 31) | (z << 30) | (c << 29) | (v << 28); + break; + } + + default: + fprintf (stderr, "unknown opcode in DSPMRC5 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPMRC6 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword * value) +{ + switch (BITS (5, 7)) + { + case 0: /* cfmval32 */ + cirrus_not_implemented ("cfmval32"); + break; + + case 1: /* cfmvam32 */ + cirrus_not_implemented ("cfmvam32"); + break; + + case 2: /* cfmvah32 */ + cirrus_not_implemented ("cfmvah32"); + break; + + case 3: /* cfmva32 */ + cirrus_not_implemented ("cfmva32"); + break; + + case 4: /* cfmva64 */ + cirrus_not_implemented ("cfmva64"); + break; + + case 5: /* cfmvsc32 */ + cirrus_not_implemented ("cfmvsc32"); + break; + + default: + fprintf (stderr, "unknown opcode in DSPMRC6 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPMCR4 (ARMul_State * state, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword value) +{ + switch (BITS (5, 7)) + { + case 0: /* cfmvdlr */ + /* Move the lower half of a DF value from an Arm register into + the lower half of a Cirrus register. */ + printfdbg ("cfmvdlr <-- 0x%x\n", (int) value); + DSPregs[SRC1_REG].lower.i = (int) value; + break; + + case 1: /* cfmvdhr */ + /* Move the upper half of a DF value from an Arm register into + the upper half of a Cirrus register. */ + printfdbg ("cfmvdhr <-- 0x%x\n", (int) value); + DSPregs[SRC1_REG].upper.i = (int) value; + break; + + case 2: /* cfmvsr */ + /* Move SF from Arm register into upper half of Cirrus register. */ + printfdbg ("cfmvsr <-- 0x%x\n", (int) value); + DSPregs[SRC1_REG].upper.i = (int) value; + break; + + default: + fprintf (stderr, "unknown opcode in DSPMCR4 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPMCR5 (ARMul_State * state, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword value) +{ + union + { + int s; + unsigned int us; + } val; + + switch (BITS (5, 7)) + { + case 0: /* cfmv64lr */ + /* Move lower half of a 64bit int from an ARM register into the + lower half of a DSP register and sign extend it. */ + printfdbg ("cfmv64lr mvdx%d <-- 0x%x\n", SRC1_REG, (int) value); + DSPregs[SRC1_REG].lower.i = (int) value; + break; + + case 1: /* cfmv64hr */ + /* Move upper half of a 64bit int from an ARM register into the + upper half of a DSP register. */ + printfdbg ("cfmv64hr ARM_REG = mvfx%d <-- 0x%x\n", + SRC1_REG, + (int) value); + DSPregs[SRC1_REG].upper.i = (int) value; + break; + + case 2: /* cfrshl32 */ + printfdbg ("cfrshl32\n"); + val.us = value; + if (val.s > 0) + DSPregs[SRC2_REG].lower.i = DSPregs[SRC1_REG].lower.i << value; + else + DSPregs[SRC2_REG].lower.i = DSPregs[SRC1_REG].lower.i >> -value; + break; + + case 3: /* cfrshl64 */ + printfdbg ("cfrshl64\n"); + val.us = value; + if (val.s > 0) + mv_setReg64int (SRC2_REG, mv_getReg64int (SRC1_REG) << value); + else + mv_setReg64int (SRC2_REG, mv_getReg64int (SRC1_REG) >> -value); + break; + + default: + fprintf (stderr, "unknown opcode in DSPMCR5 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPMCR6 (ARMul_State * state, + unsigned type ATTRIBUTE_UNUSED, + ARMword instr, + ARMword value) +{ + switch (BITS (5, 7)) + { + case 0: /* cfmv32al */ + cirrus_not_implemented ("cfmv32al"); + break; + + case 1: /* cfmv32am */ + cirrus_not_implemented ("cfmv32am"); + break; + + case 2: /* cfmv32ah */ + cirrus_not_implemented ("cfmv32ah"); + break; + + case 3: /* cfmv32a */ + cirrus_not_implemented ("cfmv32a"); + break; + + case 4: /* cfmv64a */ + cirrus_not_implemented ("cfmv64a"); + break; + + case 5: /* cfmv32sc */ + cirrus_not_implemented ("cfmv32sc"); + break; + + default: + fprintf (stderr, "unknown opcode in DSPMCR6 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPLDC4 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type, + ARMword instr, + ARMword data) +{ + static unsigned words; + + if (type != ARMul_DATA) + { + words = 0; + return ARMul_DONE; + } + + if (BIT (22)) + { /* it's a long access, get two words */ + /* cfldrd */ + + printfdbg ("cfldrd: %x (words = %d) (bigend = %d) DESTREG = %d\n", + data, words, state->bigendSig, DEST_REG); + + if (words == 0) + { + if (state->bigendSig) + DSPregs[DEST_REG].upper.i = (int) data; + else + DSPregs[DEST_REG].lower.i = (int) data; + } + else + { + if (state->bigendSig) + DSPregs[DEST_REG].lower.i = (int) data; + else + DSPregs[DEST_REG].upper.i = (int) data; + } + + ++ words; + + if (words == 2) + { + printfdbg ("\tmvd%d <-- mem = %g\n", DEST_REG, + mv_getRegDouble (DEST_REG)); + + return ARMul_DONE; + } + else + return ARMul_INC; + } + else + { + /* Get just one word. */ + + /* cfldrs */ + printfdbg ("cfldrs\n"); + + DSPregs[DEST_REG].upper.i = (int) data; + + printfdbg ("\tmvf%d <-- mem = %f\n", DEST_REG, + DSPregs[DEST_REG].upper.f); + + return ARMul_DONE; + } +} + +unsigned +DSPLDC5 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type, + ARMword instr, + ARMword data) +{ + static unsigned words; + + if (type != ARMul_DATA) + { + words = 0; + return ARMul_DONE; + } + + if (BIT (22)) + { + /* It's a long access, get two words. */ + + /* cfldr64 */ + printfdbg ("cfldr64: %d\n", data); + + if (words == 0) + { + if (state->bigendSig) + DSPregs[DEST_REG].upper.i = (int) data; + else + DSPregs[DEST_REG].lower.i = (int) data; + } + else + { + if (state->bigendSig) + DSPregs[DEST_REG].lower.i = (int) data; + else + DSPregs[DEST_REG].upper.i = (int) data; + } + + ++ words; + + if (words == 2) + { + printfdbg ("\tmvdx%d <-- mem = %lld\n", DEST_REG, + mv_getReg64int (DEST_REG)); + + return ARMul_DONE; + } + else + return ARMul_INC; + } + else + { + /* Get just one word. */ + + /* cfldr32 */ + printfdbg ("cfldr32 mvfx%d <-- %d\n", DEST_REG, (int) data); + + /* 32bit ints should be sign extended to 64bits when loaded. */ + mv_setReg64int (DEST_REG, (long long) data); + + return ARMul_DONE; + } +} + +unsigned +DSPSTC4 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type, + ARMword instr, + ARMword * data) +{ + static unsigned words; + + if (type != ARMul_DATA) + { + words = 0; + return ARMul_DONE; + } + + if (BIT (22)) + { + /* It's a long access, get two words. */ + /* cfstrd */ + printfdbg ("cfstrd\n"); + + if (words == 0) + { + if (state->bigendSig) + *data = (ARMword) DSPregs[DEST_REG].upper.i; + else + *data = (ARMword) DSPregs[DEST_REG].lower.i; + } + else + { + if (state->bigendSig) + *data = (ARMword) DSPregs[DEST_REG].lower.i; + else + *data = (ARMword) DSPregs[DEST_REG].upper.i; + } + + ++ words; + + if (words == 2) + { + printfdbg ("\tmem = mvd%d = %g\n", DEST_REG, + mv_getRegDouble (DEST_REG)); + + return ARMul_DONE; + } + else + return ARMul_INC; + } + else + { + /* Get just one word. */ + /* cfstrs */ + printfdbg ("cfstrs mvf%d <-- %f\n", DEST_REG, + DSPregs[DEST_REG].upper.f); + + *data = (ARMword) DSPregs[DEST_REG].upper.i; + + return ARMul_DONE; + } +} + +unsigned +DSPSTC5 (ARMul_State * state ATTRIBUTE_UNUSED, + unsigned type, + ARMword instr, + ARMword * data) +{ + static unsigned words; + + if (type != ARMul_DATA) + { + words = 0; + return ARMul_DONE; + } + + if (BIT (22)) + { + /* It's a long access, store two words. */ + /* cfstr64 */ + printfdbg ("cfstr64\n"); + + if (words == 0) + { + if (state->bigendSig) + *data = (ARMword) DSPregs[DEST_REG].upper.i; + else + *data = (ARMword) DSPregs[DEST_REG].lower.i; + } + else + { + if (state->bigendSig) + *data = (ARMword) DSPregs[DEST_REG].lower.i; + else + *data = (ARMword) DSPregs[DEST_REG].upper.i; + } + + ++ words; + + if (words == 2) + { + printfdbg ("\tmem = mvd%d = %lld\n", DEST_REG, + mv_getReg64int (DEST_REG)); + + return ARMul_DONE; + } + else + return ARMul_INC; + } + else + { + /* Store just one word. */ + /* cfstr32 */ + *data = (ARMword) DSPregs[DEST_REG].lower.i; + + printfdbg ("cfstr32 MEM = %d\n", (int) *data); + + return ARMul_DONE; + } +} + +unsigned +DSPCDP4 (ARMul_State * state, + unsigned type, + ARMword instr) +{ + int opcode2; + + opcode2 = BITS (5,7); + + switch (BITS (20,21)) + { + case 0: + switch (opcode2) + { + case 0: /* cfcpys */ + printfdbg ("cfcpys mvf%d = mvf%d = %f\n", + DEST_REG, + SRC1_REG, + DSPregs[SRC1_REG].upper.f); + DSPregs[DEST_REG].upper.f = DSPregs[SRC1_REG].upper.f; + break; + + case 1: /* cfcpyd */ + printfdbg ("cfcpyd mvd%d = mvd%d = %g\n", + DEST_REG, + SRC1_REG, + mv_getRegDouble (SRC1_REG)); + mv_setRegDouble (DEST_REG, mv_getRegDouble (SRC1_REG)); + break; + + case 2: /* cfcvtds */ + printfdbg ("cfcvtds mvf%d = (float) mvd%d = %f\n", + DEST_REG, + SRC1_REG, + (float) mv_getRegDouble (SRC1_REG)); + DSPregs[DEST_REG].upper.f = (float) mv_getRegDouble (SRC1_REG); + break; + + case 3: /* cfcvtsd */ + printfdbg ("cfcvtsd mvd%d = mvf%d = %g\n", + DEST_REG, + SRC1_REG, + (double) DSPregs[SRC1_REG].upper.f); + mv_setRegDouble (DEST_REG, (double) DSPregs[SRC1_REG].upper.f); + break; + + case 4: /* cfcvt32s */ + printfdbg ("cfcvt32s mvf%d = mvfx%d = %f\n", + DEST_REG, + SRC1_REG, + (float) DSPregs[SRC1_REG].lower.i); + DSPregs[DEST_REG].upper.f = (float) DSPregs[SRC1_REG].lower.i; + break; + + case 5: /* cfcvt32d */ + printfdbg ("cfcvt32d mvd%d = mvfx%d = %g\n", + DEST_REG, + SRC1_REG, + (double) DSPregs[SRC1_REG].lower.i); + mv_setRegDouble (DEST_REG, (double) DSPregs[SRC1_REG].lower.i); + break; + + case 6: /* cfcvt64s */ + printfdbg ("cfcvt64s mvf%d = mvdx%d = %f\n", + DEST_REG, + SRC1_REG, + (float) mv_getReg64int (SRC1_REG)); + DSPregs[DEST_REG].upper.f = (float) mv_getReg64int (SRC1_REG); + break; + + case 7: /* cfcvt64d */ + printfdbg ("cfcvt64d mvd%d = mvdx%d = %g\n", + DEST_REG, + SRC1_REG, + (double) mv_getReg64int (SRC1_REG)); + mv_setRegDouble (DEST_REG, (double) mv_getReg64int (SRC1_REG)); + break; + } + break; + + case 1: + switch (opcode2) + { + case 0: /* cfmuls */ + printfdbg ("cfmuls mvf%d = mvf%d = %f\n", + DEST_REG, + SRC1_REG, + DSPregs[SRC1_REG].upper.f * DSPregs[SRC2_REG].upper.f); + + DSPregs[DEST_REG].upper.f = DSPregs[SRC1_REG].upper.f + * DSPregs[SRC2_REG].upper.f; + break; + + case 1: /* cfmuld */ + printfdbg ("cfmuld mvd%d = mvd%d = %g\n", + DEST_REG, + SRC1_REG, + mv_getRegDouble (SRC1_REG) * mv_getRegDouble (SRC2_REG)); + + mv_setRegDouble (DEST_REG, + mv_getRegDouble (SRC1_REG) + * mv_getRegDouble (SRC2_REG)); + break; + + default: + fprintf (stderr, "unknown opcode in DSPCDP4 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + break; + + case 3: + switch (opcode2) + { + case 0: /* cfabss */ + DSPregs[DEST_REG].upper.f = (DSPregs[SRC1_REG].upper.f < 0.0F ? + -DSPregs[SRC1_REG].upper.f + : DSPregs[SRC1_REG].upper.f); + printfdbg ("cfabss mvf%d = |mvf%d| = %f\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].upper.f); + break; + + case 1: /* cfabsd */ + mv_setRegDouble (DEST_REG, + (mv_getRegDouble (SRC1_REG) < 0.0 ? + -mv_getRegDouble (SRC1_REG) + : mv_getRegDouble (SRC1_REG))); + printfdbg ("cfabsd mvd%d = |mvd%d| = %g\n", + DEST_REG, + SRC1_REG, + mv_getRegDouble (DEST_REG)); + break; + + case 2: /* cfnegs */ + DSPregs[DEST_REG].upper.f = -DSPregs[SRC1_REG].upper.f; + printfdbg ("cfnegs mvf%d = -mvf%d = %f\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].upper.f); + break; + + case 3: /* cfnegd */ + mv_setRegDouble (DEST_REG, + -mv_getRegDouble (SRC1_REG)); + printfdbg ("cfnegd mvd%d = -mvd%d = %g\n", + DEST_REG, + mv_getRegDouble (DEST_REG)); + break; + + case 4: /* cfadds */ + DSPregs[DEST_REG].upper.f = DSPregs[SRC1_REG].upper.f + + DSPregs[SRC2_REG].upper.f; + printfdbg ("cfadds mvf%d = mvf%d + mvf%d = %f\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].upper.f); + break; + + case 5: /* cfaddd */ + mv_setRegDouble (DEST_REG, + mv_getRegDouble (SRC1_REG) + + mv_getRegDouble (SRC2_REG)); + printfdbg ("cfaddd: mvd%d = mvd%d + mvd%d = %g\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getRegDouble (DEST_REG)); + break; + + case 6: /* cfsubs */ + DSPregs[DEST_REG].upper.f = DSPregs[SRC1_REG].upper.f + - DSPregs[SRC2_REG].upper.f; + printfdbg ("cfsubs: mvf%d = mvf%d - mvf%d = %f\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].upper.f); + break; + + case 7: /* cfsubd */ + mv_setRegDouble (DEST_REG, + mv_getRegDouble (SRC1_REG) + - mv_getRegDouble (SRC2_REG)); + printfdbg ("cfsubd: mvd%d = mvd%d - mvd%d = %g\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getRegDouble (DEST_REG)); + break; + } + break; + + default: + fprintf (stderr, "unknown opcode in DSPCDP4 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPCDP5 (ARMul_State * state, + unsigned type, + ARMword instr) +{ + int opcode2; + char shift; + + opcode2 = BITS (5,7); + + /* Shift constants are 7bit signed numbers in bits 0..3|5..7. */ + shift = BITS (0, 3) | (BITS (5, 7)) << 4; + if (shift & 0x40) + shift |= 0xc0; + + switch (BITS (20,21)) + { + case 0: + /* cfsh32 */ + printfdbg ("cfsh32 %s amount=%d\n", shift < 0 ? "right" : "left", + shift); + if (shift < 0) + /* Negative shift is a right shift. */ + DSPregs[DEST_REG].lower.i = DSPregs[SRC1_REG].lower.i >> -shift; + else + /* Positive shift is a left shift. */ + DSPregs[DEST_REG].lower.i = DSPregs[SRC1_REG].lower.i << shift; + break; + + case 1: + switch (opcode2) + { + case 0: /* cfmul32 */ + DSPregs[DEST_REG].lower.i = DSPregs[SRC1_REG].lower.i + * DSPregs[SRC2_REG].lower.i; + printfdbg ("cfmul32 mvfx%d = mvfx%d * mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 1: /* cfmul64 */ + mv_setReg64int (DEST_REG, + mv_getReg64int (SRC1_REG) + * mv_getReg64int (SRC2_REG)); + printfdbg ("cfmul64 mvdx%d = mvdx%d * mvdx%d = %lld\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getReg64int (DEST_REG)); + break; + + case 2: /* cfmac32 */ + DSPregs[DEST_REG].lower.i + += DSPregs[SRC1_REG].lower.i * DSPregs[SRC2_REG].lower.i; + printfdbg ("cfmac32 mvfx%d += mvfx%d * mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 3: /* cfmsc32 */ + DSPregs[DEST_REG].lower.i + -= DSPregs[SRC1_REG].lower.i * DSPregs[SRC2_REG].lower.i; + printfdbg ("cfmsc32 mvfx%d -= mvfx%d * mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 4: /* cfcvts32 */ + /* fixme: this should round */ + DSPregs[DEST_REG].lower.i = (int) DSPregs[SRC1_REG].upper.f; + printfdbg ("cfcvts32 mvfx%d = mvf%d = %d\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 5: /* cfcvtd32 */ + /* fixme: this should round */ + DSPregs[DEST_REG].lower.i = (int) mv_getRegDouble (SRC1_REG); + printfdbg ("cfcvtd32 mvdx%d = mvd%d = %d\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 6: /* cftruncs32 */ + DSPregs[DEST_REG].lower.i = (int) DSPregs[SRC1_REG].upper.f; + printfdbg ("cftruncs32 mvfx%d = mvf%d = %d\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 7: /* cftruncd32 */ + DSPregs[DEST_REG].lower.i = (int) mv_getRegDouble (SRC1_REG); + printfdbg ("cftruncd32 mvfx%d = mvd%d = %d\n", + DEST_REG, + SRC1_REG, + DSPregs[DEST_REG].lower.i); + break; + } + break; + + case 2: + /* cfsh64 */ + printfdbg ("cfsh64\n"); + + if (shift < 0) + /* Negative shift is a right shift. */ + mv_setReg64int (DEST_REG, + mv_getReg64int (SRC1_REG) >> -shift); + else + /* Positive shift is a left shift. */ + mv_setReg64int (DEST_REG, + mv_getReg64int (SRC1_REG) << shift); + printfdbg ("\t%llx\n", mv_getReg64int(DEST_REG)); + break; + + case 3: + switch (opcode2) + { + case 0: /* cfabs32 */ + DSPregs[DEST_REG].lower.i = (DSPregs[SRC1_REG].lower.i < 0 + ? -DSPregs[SRC1_REG].lower.i : DSPregs[SRC1_REG].lower.i); + printfdbg ("cfabs32 mvfx%d = |mvfx%d| = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 1: /* cfabs64 */ + mv_setReg64int (DEST_REG, + (mv_getReg64int (SRC1_REG) < 0 + ? -mv_getReg64int (SRC1_REG) + : mv_getReg64int (SRC1_REG))); + printfdbg ("cfabs64 mvdx%d = |mvdx%d| = %lld\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getReg64int (DEST_REG)); + break; + + case 2: /* cfneg32 */ + DSPregs[DEST_REG].lower.i = -DSPregs[SRC1_REG].lower.i; + printfdbg ("cfneg32 mvfx%d = -mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 3: /* cfneg64 */ + mv_setReg64int (DEST_REG, -mv_getReg64int (SRC1_REG)); + printfdbg ("cfneg64 mvdx%d = -mvdx%d = %lld\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getReg64int (DEST_REG)); + break; + + case 4: /* cfadd32 */ + DSPregs[DEST_REG].lower.i = DSPregs[SRC1_REG].lower.i + + DSPregs[SRC2_REG].lower.i; + printfdbg ("cfadd32 mvfx%d = mvfx%d + mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 5: /* cfadd64 */ + mv_setReg64int (DEST_REG, + mv_getReg64int (SRC1_REG) + + mv_getReg64int (SRC2_REG)); + printfdbg ("cfadd64 mvdx%d = mvdx%d + mvdx%d = %lld\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getReg64int (DEST_REG)); + break; + + case 6: /* cfsub32 */ + DSPregs[DEST_REG].lower.i = DSPregs[SRC1_REG].lower.i + - DSPregs[SRC2_REG].lower.i; + printfdbg ("cfsub32 mvfx%d = mvfx%d - mvfx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + DSPregs[DEST_REG].lower.i); + break; + + case 7: /* cfsub64 */ + mv_setReg64int (DEST_REG, + mv_getReg64int (SRC1_REG) + - mv_getReg64int (SRC2_REG)); + printfdbg ("cfsub64 mvdx%d = mvdx%d - mvdx%d = %d\n", + DEST_REG, + SRC1_REG, + SRC2_REG, + mv_getReg64int (DEST_REG)); + break; + } + break; + + default: + fprintf (stderr, "unknown opcode in DSPCDP5 0x%x\n", instr); + cirrus_not_implemented ("unknown"); + break; + } + + return ARMul_DONE; +} + +unsigned +DSPCDP6 (ARMul_State * state, + unsigned type, + ARMword instr) +{ + int opcode2; + + opcode2 = BITS (5,7); + + switch (BITS (20,21)) + { + case 0: + /* cfmadd32 */ + cirrus_not_implemented ("cfmadd32"); + break; + + case 1: + /* cfmsub32 */ + cirrus_not_implemented ("cfmsub32"); + break; + + case 2: + /* cfmadda32 */ + cirrus_not_implemented ("cfmadda32"); + break; + + case 3: + /* cfmsuba32 */ + cirrus_not_implemented ("cfmsuba32"); + break; + + default: + fprintf (stderr, "unknown opcode in DSPCDP6 0x%x\n", instr); + } + + return ARMul_DONE; +} + +/* Conversion functions. + + 32-bit integers are stored in the LOWER half of a 64-bit physical + register. + + Single precision floats are stored in the UPPER half of a 64-bit + physical register. */ + +static double +mv_getRegDouble (int regnum) +{ + reg_conv.ints[lsw_float_index] = DSPregs[regnum].upper.i; + reg_conv.ints[msw_float_index] = DSPregs[regnum].lower.i; + return reg_conv.d; +} + +static void +mv_setRegDouble (int regnum, double val) +{ + reg_conv.d = val; + DSPregs[regnum].upper.i = reg_conv.ints[lsw_float_index]; + DSPregs[regnum].lower.i = reg_conv.ints[msw_float_index]; +} + +static long long +mv_getReg64int (int regnum) +{ + reg_conv.ints[lsw_int_index] = DSPregs[regnum].lower.i; + reg_conv.ints[msw_int_index] = DSPregs[regnum].upper.i; + return reg_conv.ll; +} + +static void +mv_setReg64int (int regnum, long long val) +{ + reg_conv.ll = val; + DSPregs[regnum].lower.i = reg_conv.ints[lsw_int_index]; + DSPregs[regnum].upper.i = reg_conv.ints[msw_int_index]; +} + +/* Compute LSW in a double and a long long. */ + +void +mv_compute_host_endianness (ARMul_State * state) +{ + static union + { + long long ll; + long ints[2]; + long i; + double d; + float floats[2]; + float f; + } conv; + + /* Calculate where's the LSW in a 64bit int. */ + conv.ll = 45; + + if (conv.ints[0] == 0) + { + msw_int_index = 0; + lsw_int_index = 1; + } + else + { + assert (conv.ints[1] == 0); + msw_int_index = 1; + lsw_int_index = 0; + } + + /* Calculate where's the LSW in a double. */ + conv.d = 3.0; + + if (conv.ints[0] == 0) + { + msw_float_index = 0; + lsw_float_index = 1; + } + else + { + assert (conv.ints[1] == 0); + msw_float_index = 1; + lsw_float_index = 0; + } + + printfdbg ("lsw_int_index %d\n", lsw_int_index); + printfdbg ("lsw_float_index %d\n", lsw_float_index); +} diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 244c475eb93..f13d32928b0 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -59,6 +59,38 @@ static int big_endian; int stop_simulator; +/* Cirrus DSP registers. + + We need to define these registers outside of maverick.c because + maverick.c might not be linked in unless --target=arm9e-* in which + case wrapper.c will not compile because it tries to access Cirrus + registers. This should all go away once we get the Cirrus and ARM + Coprocessor to coexist in armcopro.c-- aldyh. */ + +struct maverick_regs +{ + union + { + int i; + float f; + } upper; + + union + { + int i; + float f; + } lower; +}; + +union maverick_acc_regs +{ + long double ld; /* Acc registers are 72-bits. */ +}; + +struct maverick_regs DSPregs[16]; +union maverick_acc_regs DSPacc[4]; +ARMword DSPsc; + static void init () { @@ -71,7 +103,6 @@ init () state->bigendSig = (big_endian ? HIGH : LOW); ARMul_MemoryInit (state, mem_size); ARMul_OSInit (state); - ARMul_CoProInit (state); state->verbose = verbosity; done = 1; } @@ -236,6 +267,10 @@ sim_create_inferior (sd, abfd, argv, env) ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop); break; + case bfd_mach_arm_ep9312: + ARMul_SelectProcessor (state, ARM_v4_Prop | ARM_ep9312_Prop); + break; + case bfd_mach_arm_5: if (bfd_family_coff (abfd)) { @@ -422,6 +457,30 @@ sim_store_register (sd, rn, memory, length) ARMul_CPSRAltered (state); break; + case SIM_ARM_MAVERIC_COP0R0_REGNUM: + case SIM_ARM_MAVERIC_COP0R1_REGNUM: + case SIM_ARM_MAVERIC_COP0R2_REGNUM: + case SIM_ARM_MAVERIC_COP0R3_REGNUM: + case SIM_ARM_MAVERIC_COP0R4_REGNUM: + case SIM_ARM_MAVERIC_COP0R5_REGNUM: + case SIM_ARM_MAVERIC_COP0R6_REGNUM: + case SIM_ARM_MAVERIC_COP0R7_REGNUM: + case SIM_ARM_MAVERIC_COP0R8_REGNUM: + case SIM_ARM_MAVERIC_COP0R9_REGNUM: + case SIM_ARM_MAVERIC_COP0R10_REGNUM: + case SIM_ARM_MAVERIC_COP0R11_REGNUM: + case SIM_ARM_MAVERIC_COP0R12_REGNUM: + case SIM_ARM_MAVERIC_COP0R13_REGNUM: + case SIM_ARM_MAVERIC_COP0R14_REGNUM: + case SIM_ARM_MAVERIC_COP0R15_REGNUM: + memcpy (& DSPregs [rn - SIM_ARM_MAVERIC_COP0R0_REGNUM], + memory, sizeof (struct maverick_regs)); + return sizeof (struct maverick_regs); + + case SIM_ARM_MAVERIC_DSPSC_REGNUM: + memcpy (&DSPsc, memory, sizeof DSPsc); + return sizeof DSPsc; + default: return 0; } @@ -477,6 +536,30 @@ sim_fetch_register (sd, rn, memory, length) regval = ARMul_GetCPSR (state); break; + case SIM_ARM_MAVERIC_COP0R0_REGNUM: + case SIM_ARM_MAVERIC_COP0R1_REGNUM: + case SIM_ARM_MAVERIC_COP0R2_REGNUM: + case SIM_ARM_MAVERIC_COP0R3_REGNUM: + case SIM_ARM_MAVERIC_COP0R4_REGNUM: + case SIM_ARM_MAVERIC_COP0R5_REGNUM: + case SIM_ARM_MAVERIC_COP0R6_REGNUM: + case SIM_ARM_MAVERIC_COP0R7_REGNUM: + case SIM_ARM_MAVERIC_COP0R8_REGNUM: + case SIM_ARM_MAVERIC_COP0R9_REGNUM: + case SIM_ARM_MAVERIC_COP0R10_REGNUM: + case SIM_ARM_MAVERIC_COP0R11_REGNUM: + case SIM_ARM_MAVERIC_COP0R12_REGNUM: + case SIM_ARM_MAVERIC_COP0R13_REGNUM: + case SIM_ARM_MAVERIC_COP0R14_REGNUM: + case SIM_ARM_MAVERIC_COP0R15_REGNUM: + memcpy (memory, & DSPregs [rn - SIM_ARM_MAVERIC_COP0R0_REGNUM], + sizeof (struct maverick_regs)); + return sizeof (struct maverick_regs); + + case SIM_ARM_MAVERIC_DSPSC_REGNUM: + memcpy (memory, & DSPsc, sizeof DSPsc); + return sizeof DSPsc; + default: return 0; } diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 6526a55c164..c3d79ba750c 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,16 @@ +2003-03-20 D.Venkatasubramanian <dvenkat@noida.hcltech.com> + + * compile.c (cmdline_location): Added function to + return the location of 8-bit (256 locations) where the + Command Line arguments would be stored. + (decode): Added a TRAP to 0xcc for Commandline + processing using pseudo opcode O_SYS_CMDLINE. + (sim_resume): Added handling of O_SYS_CMDLINE Trap. + (sim_create_inferior): Setting a pointer to + Commandline Args array. + * inst.h: Added a new variable ptr_command_line for + storing pointer to Commandline array. + 2003-03-14 D.Venkatasubramanian <dvenkat@noida.hcltech.com> * compile.c (decode): Added code for some more magic traps. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index eb2a03f2f9f..54a06591338 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -176,6 +176,17 @@ lvalue (int x, int rn) } } +static int +cmdline_location() +{ + if (h8300smode) + return 0xffff00L; + else if (h8300hmode) + return 0x2ff00L; + else + return 0xff00L; +} + static unsigned int decode (int addr, unsigned char *data, decoded_inst *dst) { @@ -477,6 +488,9 @@ decode (int addr, unsigned char *data, decoded_inst *dst) case 0xcb: dst->opcode = O (O_SYS_FSTAT, SB); break; + case 0xcc: + dst->opcode = O (O_SYS_CMDLINE, SB); + break; } /* End of Processing for system calls. */ } @@ -1410,6 +1424,163 @@ sim_resume (SIM_DESC sd, int step, int siggnal) goto condtrue; goto next; + /* Trap for Command Line setup. */ + case O (O_SYS_CMDLINE, SB): + { + int i = 0; /* Loop counter. */ + int j = 0; /* Loop counter. */ + int ind_arg_len = 0; /* Length of each argument. */ + int no_of_args = 0; /* The no. or cmdline args. */ + int current_location = 0; /* Location of string. */ + int old_sp = 0; /* The Initial Stack Pointer. */ + int no_of_slots = 0; /* No. of slots required on the stack + for storing cmdline args. */ + int sp_move = 0; /* No. of locations by which the stack needs + to grow. */ + int new_sp = 0; /* The final stack pointer location passed + back. */ + int *argv_ptrs; /* Pointers of argv strings to be stored. */ + int argv_ptrs_location = 0; /* Location of pointers to cmdline + args on the stack. */ + int char_ptr_size = 0; /* Size of a character pointer on + target machine. */ + int addr_cmdline = 0; /* Memory location where cmdline has + to be stored. */ + int size_cmdline = 0; /* Size of cmdline. */ + + /* Set the address of 256 free locations where command line is + stored. */ + addr_cmdline = cmdline_location(); + cpu.regs[0] = addr_cmdline; + + /* Counting the no. of commandline arguments. */ + for (i = 0; ptr_command_line[i] != NULL; i++) + continue; + + /* No. of arguments in the command line. */ + no_of_args = i; + + /* Current location is just a temporary variable,which we are + setting to the point to the start of our commandline string. */ + current_location = addr_cmdline; + + /* Allocating space for storing pointers of the command line + arguments. */ + argv_ptrs = (int *) malloc (sizeof (int) * no_of_args); + + /* Setting char_ptr_size to the sizeof (char *) on the different + architectures. */ + if (h8300hmode || h8300smode) + { + char_ptr_size = 4; + } + else + { + char_ptr_size = 2; + } + + for (i = 0; i < no_of_args; i++) + { + ind_arg_len = 0; + + /* The size of the commandline argument. */ + ind_arg_len = (strlen (ptr_command_line[i]) + 1); + + /* The total size of the command line string. */ + size_cmdline += ind_arg_len; + + /* As we have only 256 bytes, we need to provide a graceful + exit. Anyways, a program using command line arguments + where we cannot store all the command line arguments + given may behave unpredictably. */ + if (size_cmdline >= 256) + { + cpu.regs[0] = 0; + goto next; + } + else + { + /* current_location points to the memory where the next + commandline argument is stored. */ + argv_ptrs[i] = current_location; + for (j = 0; j < ind_arg_len; j++) + { + SET_MEMORY_B ((current_location + + (sizeof (char) * j)), + *(ptr_command_line[i] + + sizeof (char) * j)); + } + + /* Setting current_location to the starting of next + argument. */ + current_location += ind_arg_len; + } + } + + /* This is the original position of the stack pointer. */ + old_sp = cpu.regs[7]; + + /* We need space from the stack to store the pointers to argvs. */ + /* As we will infringe on the stack, we need to shift the stack + pointer so that the data is not overwritten. We calculate how + much space is required. */ + sp_move = (no_of_args) * (char_ptr_size); + + /* The final position of stack pointer, we have thus taken some + space from the stack. */ + new_sp = old_sp - sp_move; + + /* Temporary variable holding value where the argv pointers need + to be stored. */ + argv_ptrs_location = new_sp; + + /* The argv pointers are stored at sequential locations. As per + the H8300 ABI. */ + for (i = 0; i < no_of_args; i++) + { + /* Saving the argv pointer. */ + if (h8300hmode || h8300smode) + { + SET_MEMORY_L (argv_ptrs_location, argv_ptrs[i]); + } + else + { + SET_MEMORY_W (argv_ptrs_location, argv_ptrs[i]); + } + + /* The next location where the pointer to the next argv + string has to be stored. */ + argv_ptrs_location += char_ptr_size; + } + + /* Required by POSIX, Setting 0x0 at the end of the list of argv + pointers. */ + if (h8300hmode || h8300smode) + { + SET_MEMORY_L (old_sp, 0x0); + } + else + { + SET_MEMORY_W (old_sp, 0x0); + } + + /* Freeing allocated memory. */ + free (argv_ptrs); + for (i = 0; i <= no_of_args; i++) + { + free (ptr_command_line[i]); + } + free (ptr_command_line); + + /* The no. of argv arguments are returned in Reg 0. */ + cpu.regs[0] = no_of_args; + /* The Pointer to argv in Register 1. */ + cpu.regs[1] = new_sp; + /* Setting the stack pointer to the new value. */ + cpu.regs[7] = new_sp; + } + goto next; + /* System call processing starts. */ case O (O_SYS_OPEN, SB): { @@ -2531,10 +2702,37 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty) SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) { + int i = 0; + int len_arg = 0; + int no_of_args = 0; + if (abfd != NULL) cpu.pc = bfd_get_start_address (abfd); else cpu.pc = 0; + + /* Command Line support. */ + if (argv != NULL) + { + /* Counting the no. of commandline arguments. */ + for (no_of_args = 0; argv[no_of_args] != NULL; no_of_args++) + continue; + + /* Allocating memory for the argv pointers. */ + ptr_command_line = (char **) malloc ((sizeof (char *)) + * (no_of_args + 1)); + + for (i = 0; i < no_of_args; i++) + { + /* Calculating the length of argument for allocating memory. */ + len_arg = strlen (argv[i] + 1); + ptr_command_line[i] = (char *) malloc (sizeof (char) * len_arg); + /* Copying the argument string. */ + ptr_command_line[i] = (char *) strdup (argv[i]); + } + ptr_command_line[i] = NULL; + } + return SIM_RC_OK; } diff --git a/sim/h8300/inst.h b/sim/h8300/inst.h index 7f6e4008859..edbee6ae380 100644 --- a/sim/h8300/inst.h +++ b/sim/h8300/inst.h @@ -66,6 +66,9 @@ enum h8300_sim_state { SIM_STATE_RUNNING, SIM_STATE_EXITED, SIM_STATE_SIGNALLED, SIM_STATE_STOPPED }; +/* For Command Line. */ +char **ptr_command_line; /* Pointer to Command Line Arguments. */ + typedef struct { enum h8300_sim_state state; |