From: Keith Seitz Date: Fri, 30 Aug 2002 22:52:58 +0000 (+0000) Subject: Merge with kseitz_interps-20020829-merge tag from trunk. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3be8de9279f36c5b10fd880845242699e15ffc5d;p=thirdparty%2Fbinutils-gdb.git Merge with kseitz_interps-20020829-merge tag from trunk. --- diff --git a/ChangeLog b/ChangeLog index 2e98ebbe450..3c71ac2be5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-08-23 Andrew Cagney + + * texinfo/texinfo.tex: Import version 2002-06-04.06. + + * config.guess: Import version 2002-08-23. + * config.sub: Import version 2002-08-22. + +2002-08-20 Alexandre Oliva + + * Makefile.in (GCC_FOR_TARGET): Prepend STAGE_CC_WRAPPER. + * configure.in (CC_FOR_TARGET, GCJ_FOR_TARGET, CXX_FOR_TARGET, + CXX_FOR_TARGET_FOR_RECURSIVE_MAKE): Likewise. + 2002-08-06 Federico G. Schwindt * configure.in (hppa*-*-openbsd*): Treat like hppa*-*-*elf*. diff --git a/Makefile.in b/Makefile.in index c3caa1d0cd0..c37a5052d5a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -251,7 +251,7 @@ GCJ_FOR_TARGET = # variable is passed down to the gcc Makefile, where it is used to # build libgcc2.a. We define it here so that it can itself be # overridden on the command line. -GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) +GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) AS_FOR_TARGET = ` \ if [ -f $$r/gas/as-new ] ; then \ diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a8f1a49e0ed..b2869495ea2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,315 @@ +2002-08-28 Catherine Moore + + * elf32-v850.c (v850_elf_reloc_map): Add new relocs. + (v850-elf-reloc): Don't resolve pc relative relocs. + (v850_elf_ignore_reloc): New routine. + (v850_elf_final_link_relocate): Handle new relocs. + (v850_elf_relax_delete_bytes ): New routine. + (v850_elf_relax_section): New routine. + (bfd_elf32_bfd_relax_section): Define. + (HOWTO): New entries for new relocs. + * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc. + (BFD_RELOC_V850_LONGJUMP): New reloc. + (BFD_RELOC_V850_ALIGN): New reloc. + * archures.c: Remove redundant v850ea architecture. + * cpu-v850.c: Remove redundant v850ea support. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerated. + +2002-08-28 Svein E. Seldal + + * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target. + * configure.in: Add tic4x_coff vector files. + * configure: Regenerate. + * Makefile.am: Add tic4x target. + * Makefile.in: Regenerate. + +2002-08-27 Michael Hayes + + * archures.c: Add the BFD arch type tic4x. + * bfd-in.h: Add BFD_IN_MEMORY flag. + * coff-tic4x.c: New file. + * coffswap.h (coff_swap_sym_out): Add preadjuster. + * cpu-tic4x.c: New file. + * targets.c: Added tic4x- in list of xvecs. + * ticoff.h: New file. + * bfd-in2.h: Regenerate. + +2002-08-27 Adam Nemet + + * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last + bit of DT_INIT and DT_FINI for Thumb functions. + +2002-08-26 Alan Modra + + * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC. + +2002-08-26 Alan Modra + + * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8. + +2002-08-24 Kaz Kojima + + * elf32-sh.c (sh_elf_copy_indirect_symbol): New. + (create_got_section, allocate_dynrelocs, readonly_dynrelocs): + Likewise. + (struct elf_sh_pcrel_relocs_copied): Removed. + (struct elf_sh_dyn_relocs): New. + (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied + field with dyn_relocs. + (struct elf_sh_link_hash_table): Add short-cuts to get dynamic + sections and sym_sec. + (sh_elf_link_hash_newfunc): Clear dyn_relocs. + (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec. + (sh_elf_create_dynamic_sections): Use create_got_section instead + of _bfd_elf_create_got_section. + (sh_elf_check_relocs): Likewise. + (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic + sections. + (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections, + sh_elf_relocate_section, sh_elf_check_relocs, + sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections): + Likewise. + (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the + dynamic relocations and avoiding the copy relocation when we + didn't find any dynamic relocations in the section which has + contents or is read-only. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (sh_elf_size_dynamic_sections): Don't reset the size of + .rela.got section even if dynamic_sections_created flag is off. + Don't use sh_elf_discard_copies. Scan all input bfd and use + allocate_dynrelocs. Call readonly_dynrelocs to determine + whether we need DT_TEXTREL. + (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine + whether the symbol was never referred to. + (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL. + (sh_elf_gc_sweep_hook): Fill with the real sweep function. + (sh_elf_check_relocs): Call create_got_section if the short-cut + to .got is null. Increment reference counters only instead of + allocating space on dynamic sections here. Don't conditionalize + uninitialized got.offset value when marking the symbol as a + global offset table entry. Keep relocations for symbols satisfied + by a dynamic library to avoid copy relocations for the symbol. + Set dynobj field of an elf hash table if needed. + (sh_elf_finish_dynamic_sections): Handle null section pointer + correctly. + (elf_backend_copy_indirect_symbol): Defined. + (elf_backend_can_refcount): Defined. + +2002-08-23 Nick Clifton + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo + previous change. Add comment explaining why. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy + contents of .got.plt[2] to tr0, not address of .got.plt. + (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, set bottom bit + of branch to plt0 as this is a branch to an shmedia instruction. + * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le): + Copy contents of .got.plt[2] to tr0, not address of .got.plt. + (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to + branch to plt0. + (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, branch to + plt0 is now ptrel, so use relative offset. Set bottom bit of + branch target as it is a branch to an shmedia instruction. + +2002-08-23 Stephen Clarke , + Richard Shann + + * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT + value if .init is an SHmedia function. Similarly for DT_FINI. + * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize + dynamic section. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + +2002-08-22 Kaz Kojima + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple + byte read when reading the return address register column. + +2002-08-22 Nick Clifton + + * config.bfd: Add powepc64-*-*bsd* target. + +2002-08-22 Graeme Peterson + + * Makefile.am: Add entries for elf32-shqnx.c + * Makefile.in: Regenerate. + * config.bfd: Add support sh-*-nto* target. + * configure.in: Add support for bfd_elf32_sh{l}qnx_vec. + * configure: Regenerate. + * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" . + * elf32-sh.c: Do not include elf32-target.h if + ELF32_SH_C_INCLUDED is defined. + * elf32-shqnx.c: New file: Support for QNX. + * targets.c: Add bfd_elf32_sh{l}qnx_vec. + +2002-08-22 Nick Clifton + + * po/tr.po: Updated Turkish translation. + + * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the + symbols are not read. + +2002-08-22 Alan Modra + + * elf32-m68hc11.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + * elf32-m68hc12.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + +2002-08-22 Alan Modra + + * coff-rs6000.c (rs6000coff_vec ): Add SEC_CODE and + SEC_DATA. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-22 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data + param to elf_backend_copy_indirect_symbol. + (_bfd_elf_link_hash_copy_indirect): Likewise. + * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust + calls to copy_indirect_symbol. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly + test refcounts for "used" values. + +2002-08-21 John David Anglin + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to + argument declaration. + +2002-08-19 Elena Zannoni + + * archures.c (bfd_mach_ppc_e500): Added. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c (bfd_powerpc_archs): Added e500. + +2002-08-19 Alan Modra + + * elf32-m68hc12.c (elf_backend_can_gc_sections): False. + +2002-08-17 Andrew Cagney + + * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to + `bfd_byte'. + +2002-08-17 Stan Cox + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the + IRIX 6 segment layout for NEWABI. + +2002-08-16 Stephen Clarke + + * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect + symbols when looking for section referred to by a relocation. + * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. + +2002-08-15 Alan Modra + + * elf32-i370.c: Move reloc enum to include/elf/i370.h. + +2002-08-15 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add + missing check for whether the symbol is referenced by DSO before + unexporting it as an unneeded dynamic symbol. + +2002-08-14 H.J. Lu + + * libbfd.h: Regenerate. + +2002-08-14 H.J. Lu + + * config.bfd: Always add 64bit vectors to 32bit Linux/mips. + +2002-08-14 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of + instructions. + (m68hc11_direct_relax): New to define table of relaxable instructions. + (find_relaxable_insn): New, find a relaxable insn. + (compare_reloc): New to compare two relocs. + (m68hc11_elf_relax_section): New, relax text sections. + (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs. + (elf32_m68hc11_check_relocs): New function for GC support. + (elf32_m68hc11_relocate_section): New function for GC support. + (bfd_elf32_bfd_relax_section): Define to support linker relaxation. + (elf_backend_check_relocs): Likewise. + (elf_backend_relocate_section): Likewise. + +2002-08-13 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count + definitions in shared objects when checking symbol with + undefined version. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf_backend_gc_mark_hook): Define for GC section support. + (elf_backend_gc_sweep_hook): Likewise. + (elf_backend_can_gc_sections): Likewise. + + * elf32-m68hc12.c: Likewise. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New. + (_bfd_m68hc11_elf_merge_private_bfd_data): New function. + (_bfd_m68hc11_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC11. + + * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New. + (_bfd_m68hc12_elf_merge_private_bfd_data): New function. + (_bfd_m68hc12_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC12. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs; + fix masks for PC-rel relocs. + (m68hc11_elf_ignore_reloc): New function. + + * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific + 68HC12 banked addressing relocs. + (m68hc12_phys_addr): New to compute physical address of banked memory. + (m68hc12_phys_page): Likewise for page. + (m68hc12_addr_is_banked): New to see if address is in banked area. + (elf_m68hc12_howto_table): Add new relocs and rename to xx12. + +2002-08-13 Stephane Carrez + + * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP, + BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE, + BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12. + * bfd-in2.h: Regenerate. + +2002-08-12 H.J. Lu + + * elflink.h (elf_add_default_symbol): Preserve section across + elf_merge_symbol. + 2002-08-09 Graeme Peterson * Makefile.am: Add entries for elf32-ppcqnx.c, and add @@ -26,7 +338,7 @@ 2002-08-08 H.J. Lu - * elflink.h (elf_add_default_symbol): Don't warn a defintion + * elflink.h (elf_add_default_symbol): Don't warn if a definition overrides an indirect versioned symbol. 2002-08-08 Jakub Jelinek @@ -1842,7 +2154,7 @@ 2002-05-21 Thiemo Seufer - * bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for + * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for non-ELF targets. 2002-05-21 Thiemo Seufer @@ -2288,7 +2600,7 @@ 2002-04-30 Mark Mitchell - * bfd/config.bfd: Add support for powerpc-*-windiss. + * config.bfd: Add support for powerpc-*-windiss. 2002-04-30 Tom Rix @@ -3938,7 +4250,7 @@ 2002-01-25 Steve Ellcey - * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. + * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. 2002-01-25 Philipp Thomas @@ -3972,8 +4284,7 @@ 2002-01-23 Steve Ellcey - * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to - DEFAULT_VECTOR. + * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR. (bfd_elf64_ia64_hpux_big_vec): Ditto. (bfd_elf32_h8300_vec): Ditto. diff --git a/bfd/ChangeLog-0001 b/bfd/ChangeLog-0001 index 3000c0372f5..b5a347577ce 100644 --- a/bfd/ChangeLog-0001 +++ b/bfd/ChangeLog-0001 @@ -1514,7 +1514,7 @@ 2001-10-08 Aldy Hernandez - * bfd/config.bfd (targ_cpu): Add arm9e-*-elf. + * config.bfd (targ_cpu): Add arm9e-*-elf. 2001-10-06 Stephane Carrez @@ -2858,13 +2858,13 @@ 2001-08-31 Eric Christopher Jason Eckhardt - * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32, + * archures.c: Add mipsisa32 and mipsisa64. Remove mips32, mips32_4k and mips64. - * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, + * aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. - * bfd/cpu-mips.c: Ditto. - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. - * bfd/bfd-in2.h: Regenerate. + * cpu-mips.c: Ditto. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. + * bfd-in2.h: Regenerate. 2001-08-31 Jakub Jelinek @@ -3726,7 +3726,7 @@ 2001-07-04 H.J. Lu - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4400, bfd_mach_mips4600 and bfd_mach_mips5000. @@ -4529,7 +4529,7 @@ * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain about overflow in R_OPENRISC_LO_16_IN_INSN and - R_OPENRISC_HI_16_IN_INSN.Index: bfd/elf32-openrisc.c + R_OPENRISC_HI_16_IN_INSN. 2001-04-30 H.J. Lu diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 4913b73afcc..583cb85ed85 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -89,6 +89,7 @@ ALL_MACHINES = \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ + cpu-tic4x.lo \ cpu-tic54x.lo \ cpu-tic80.lo \ cpu-v850.lo \ @@ -140,6 +141,7 @@ ALL_MACHINES_CFILES = \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ + cpu-tic4x.c \ cpu-tic54x.c \ cpu-tic80.c \ cpu-v850.c \ @@ -185,6 +187,7 @@ BFD32_BACKENDS = \ coff-stgo32.lo \ coff-svm68k.lo \ coff-tic30.lo \ + coff-tic4x.lo \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ @@ -240,6 +243,7 @@ BFD32_BACKENDS = \ elf32-sh64-com.lo \ elf32-sh-nbsd.lo \ elf32-sh64-nbsd.lo \ + elf32-shqnx.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32-vax.lo \ @@ -345,6 +349,7 @@ BFD32_BACKENDS_CFILES = \ coff-stgo32.c \ coff-svm68k.c \ coff-tic30.c \ + coff-tic4x.c \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ @@ -399,6 +404,7 @@ BFD32_BACKENDS_CFILES = \ elf32-sh-lin.c \ elf32-sh-nbsd.c \ elf32-sh64-nbsd.c \ + elf32-shqnx.c \ elf32-sparc.c \ elf32-v850.c \ elf32-vax.c \ @@ -933,6 +939,7 @@ cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h @@ -1051,6 +1058,9 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h +coff-tic4x.lo: coff-tic4x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h @@ -1260,6 +1270,10 @@ elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 6d800484b30..470aade9084 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -215,6 +215,7 @@ ALL_MACHINES = \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ + cpu-tic4x.lo \ cpu-tic54x.lo \ cpu-tic80.lo \ cpu-v850.lo \ @@ -267,6 +268,7 @@ ALL_MACHINES_CFILES = \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ + cpu-tic4x.c \ cpu-tic54x.c \ cpu-tic80.c \ cpu-v850.c \ @@ -313,6 +315,7 @@ BFD32_BACKENDS = \ coff-stgo32.lo \ coff-svm68k.lo \ coff-tic30.lo \ + coff-tic4x.lo \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ @@ -368,6 +371,7 @@ BFD32_BACKENDS = \ elf32-sh64-com.lo \ elf32-sh-nbsd.lo \ elf32-sh64-nbsd.lo \ + elf32-shqnx.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32-vax.lo \ @@ -474,6 +478,7 @@ BFD32_BACKENDS_CFILES = \ coff-stgo32.c \ coff-svm68k.c \ coff-tic30.c \ + coff-tic4x.c \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ @@ -528,6 +533,7 @@ BFD32_BACKENDS_CFILES = \ elf32-sh-lin.c \ elf32-sh-nbsd.c \ elf32-sh64-nbsd.c \ + elf32-shqnx.c \ elf32-sparc.c \ elf32-v850.c \ elf32-vax.c \ @@ -1463,6 +1469,7 @@ cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h @@ -1581,6 +1588,9 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h +coff-tic4x.lo: coff-tic4x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h @@ -1790,6 +1800,10 @@ elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 7eebb168fc7..fffb6d92ab6 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -318,6 +318,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) /* std relocs. */ switch (code) { + STD (BFD_RELOC_8, 0); STD (BFD_RELOC_16, 1); STD (BFD_RELOC_32, 2); STD (BFD_RELOC_8_PCREL, 4); diff --git a/bfd/archures.c b/bfd/archures.c index 76094cca6ce..3f0ba7bb65e 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -182,6 +182,7 @@ DESCRIPTION .#define bfd_mach_ppc_rs64ii 642 .#define bfd_mach_ppc_rs64iii 643 .#define bfd_mach_ppc_7400 7400 +.#define bfd_mach_ppc_e500 500 . bfd_arch_rs6000, {* IBM RS/6000 *} .#define bfd_mach_rs6k 0 .#define bfd_mach_rs6k_rs1 6001 @@ -227,12 +228,14 @@ DESCRIPTION . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} +. bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X *} +.#define bfd_mach_c3x 30 +.#define bfd_mach_c4x 40 . bfd_arch_tic54x, {* Texas Instruments TMS320C54X *} . bfd_arch_tic80, {* TI TMS320c80 (MVP) *} . bfd_arch_v850, {* NEC V850 *} .#define bfd_mach_v850 0 .#define bfd_mach_v850e 'E' -.#define bfd_mach_v850ea 'A' . bfd_arch_arc, {* ARC Cores *} .#define bfd_mach_arc_5 0 .#define bfd_mach_arc_6 1 @@ -357,6 +360,7 @@ extern const bfd_arch_info_type bfd_s390_arch; extern const bfd_arch_info_type bfd_sh_arch; extern const bfd_arch_info_type bfd_sparc_arch; extern const bfd_arch_info_type bfd_tic30_arch; +extern const bfd_arch_info_type bfd_tic4x_arch; extern const bfd_arch_info_type bfd_tic54x_arch; extern const bfd_arch_info_type bfd_tic80_arch; extern const bfd_arch_info_type bfd_v850_arch; @@ -411,6 +415,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_sh_arch, &bfd_sparc_arch, &bfd_tic30_arch, + &bfd_tic4x_arch, &bfd_tic54x_arch, &bfd_tic80_arch, &bfd_v850_arch, diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 19fd1072084..9017440c2a1 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -267,6 +267,9 @@ bfd_format; /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ #define BFD_IN_MEMORY 0x800 + +/* The sections in this BFD specify a memory page. */ +#define HAS_LOAD_PAGE 0x1000 /* Symbols and relocation. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index bb5fef0b930..0ab42452029 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -273,6 +273,9 @@ bfd_format; /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ #define BFD_IN_MEMORY 0x800 + +/* The sections in this BFD specify a memory page. */ +#define HAS_LOAD_PAGE 0x1000 /* Symbols and relocation. */ @@ -1572,6 +1575,7 @@ enum bfd_architecture #define bfd_mach_ppc_rs64ii 642 #define bfd_mach_ppc_rs64iii 643 #define bfd_mach_ppc_7400 7400 +#define bfd_mach_ppc_e500 500 bfd_arch_rs6000, /* IBM RS/6000 */ #define bfd_mach_rs6k 0 #define bfd_mach_rs6k_rs1 6001 @@ -1617,6 +1621,9 @@ enum bfd_architecture bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_c3x 30 +#define bfd_mach_c4x 40 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ bfd_arch_tic80, /* TI TMS320c80 (MVP) */ bfd_arch_v850, /* NEC V850 */ @@ -2661,6 +2668,14 @@ bits placed non-contigously in the instruction. */ /* This is a 16 bit offset from the call table base pointer. */ BFD_RELOC_V850_CALLT_16_16_OFFSET, +/* Used for relaxing indirect function calls. */ + BFD_RELOC_V850_LONGCALL, + +/* Used for relaxing indirect jumps. */ + BFD_RELOC_V850_LONGJUMP, + +/* Used to maintain alignment whilst relaxing. */ + BFD_RELOC_V850_ALIGN, /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the instruction. */ @@ -3040,17 +3055,48 @@ this offset in the reloc's section offset. */ BFD_RELOC_IA64_LTOFF_DTPREL22, /* Motorola 68HC11 reloc. -This is the 8 bits high part of an absolute address. */ +This is the 8 bit high part of an absolute address. */ BFD_RELOC_M68HC11_HI8, /* Motorola 68HC11 reloc. -This is the 8 bits low part of an absolute address. */ +This is the 8 bit low part of an absolute address. */ BFD_RELOC_M68HC11_LO8, /* Motorola 68HC11 reloc. -This is the 3 bits of a value. */ +This is the 3 bit of a value. */ BFD_RELOC_M68HC11_3B, +/* Motorola 68HC11 reloc. +This reloc marks the beginning of a jump/call instruction. +It is used for linker relaxation to correctly identify beginning +of instruction and change some branchs to use PC-relative +addressing mode. */ + BFD_RELOC_M68HC11_RL_JUMP, + +/* Motorola 68HC11 reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. */ + BFD_RELOC_M68HC11_RL_GROUP, + +/* Motorola 68HC11 reloc. +This is the 16-bit lower part of an address. It is used for 'call' +instruction to specify the symbol address without any special +transformation (due to memory bank window). */ + BFD_RELOC_M68HC11_LO16, + +/* Motorola 68HC11 reloc. +This is a 8-bit reloc that specifies the page number of an address. +It is used by 'call' instruction to specify the page number of +the symbol. */ + BFD_RELOC_M68HC11_PAGE, + +/* Motorola 68HC11 reloc. +This is a 24-bit reloc that represents the address with a 16-bit +value and a 8-bit page number. The symbol address is transformed +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ + BFD_RELOC_M68HC11_24, + /* These relocs are only used within the CRIS assembler. They are not (at present) written to any object files. */ BFD_RELOC_CRIS_BDISP8, diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 235b6a1ed23..ebed7438433 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4053,7 +4053,7 @@ const bfd_target rs6000coff_vec = (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ @@ -4295,7 +4295,7 @@ const bfd_target pmac_xcoff_vec = (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index f26fe6d99f5..d5cce39b968 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2595,7 +2595,7 @@ const bfd_target rs6000coff64_vec = (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ @@ -2834,7 +2834,7 @@ const bfd_target aix5coff64_vec = (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index bb777aaaf18..212c5c6ff7f 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -2158,6 +2158,13 @@ coff_set_arch_mach_hook (abfd, filehdr) arch = bfd_arch_mcore; break; #endif + +#ifdef W65MAGIC + case W65MAGIC: + arch = bfd_arch_w65; + break; +#endif + default: /* Unreadable input file type */ arch = bfd_arch_obscure; break; diff --git a/bfd/coffswap.h b/bfd/coffswap.h index cd147c5bd5f..5f23ecc07b3 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -1,24 +1,24 @@ /* Generic COFF swapping routines, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, - 2001 + 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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. */ /* This file contains routines used to swap COFF data. It is a header file because the details of swapping depend on the details of the @@ -381,7 +381,12 @@ coff_swap_sym_out (abfd, inp, extp) { struct internal_syment *in = (struct internal_syment *) inp; SYMENT *ext =(SYMENT *) extp; - if(in->_n._n_name[0] == 0) + +#ifdef COFF_ADJUST_SYM_OUT_PRE + COFF_ADJUST_SYM_OUT_PRE (abfd, inp, extp); +#endif + + if (in->_n._n_name[0] == 0) { H_PUT_32 (abfd, 0, ext->e.e.e_zeroes); H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); @@ -391,11 +396,13 @@ coff_swap_sym_out (abfd, inp, extp) #if SYMNMLEN != E_SYMNMLEN -> Error, we need to cope with truncating or extending SYMNMLEN!; #else - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); #endif } + H_PUT_32 (abfd, in->n_value, ext->e_value); H_PUT_16 (abfd, in->n_scnum, ext->e_scnum); + if (sizeof (ext->e_type) == 2) { H_PUT_16 (abfd, in->n_type, ext->e_type); @@ -404,11 +411,14 @@ coff_swap_sym_out (abfd, inp, extp) { H_PUT_32 (abfd, in->n_type, ext->e_type); } + H_PUT_8 (abfd, in->n_sclass, ext->e_sclass); H_PUT_8 (abfd, in->n_numaux, ext->e_numaux); + #ifdef COFF_ADJUST_SYM_OUT_POST COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp); #endif + return SYMESZ; } @@ -428,6 +438,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) #ifdef COFF_ADJUST_AUX_IN_PRE COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, class, indx, numaux, in1); #endif + switch (class) { case C_FILE: @@ -448,9 +459,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) numaux * sizeof (AUXENT)); } else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); #endif } goto end; @@ -502,7 +511,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } - if (ISFCN(type)) + if (ISFCN (type)) { in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize); } @@ -535,7 +544,9 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) #ifdef COFF_ADJUST_AUX_OUT_PRE COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, class, indx, numaux, extp); #endif - memset((PTR)ext, 0, AUXESZ); + + memset ((PTR)ext, 0, AUXESZ); + switch (class) { case C_FILE: @@ -681,29 +692,29 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) #else aouthdr_int->o_toc = H_GET_32 (abfd, aouthdr_ext->o_toc); #endif - aouthdr_int->o_snentry = H_GET_16 (abfd, aouthdr_ext->o_snentry); - aouthdr_int->o_sntext = H_GET_16 (abfd, aouthdr_ext->o_sntext); - aouthdr_int->o_sndata = H_GET_16 (abfd, aouthdr_ext->o_sndata); - aouthdr_int->o_sntoc = H_GET_16 (abfd, aouthdr_ext->o_sntoc); + aouthdr_int->o_snentry = H_GET_16 (abfd, aouthdr_ext->o_snentry); + aouthdr_int->o_sntext = H_GET_16 (abfd, aouthdr_ext->o_sntext); + aouthdr_int->o_sndata = H_GET_16 (abfd, aouthdr_ext->o_sndata); + aouthdr_int->o_sntoc = H_GET_16 (abfd, aouthdr_ext->o_sntoc); aouthdr_int->o_snloader = H_GET_16 (abfd, aouthdr_ext->o_snloader); - aouthdr_int->o_snbss = H_GET_16 (abfd, aouthdr_ext->o_snbss); + aouthdr_int->o_snbss = H_GET_16 (abfd, aouthdr_ext->o_snbss); aouthdr_int->o_algntext = H_GET_16 (abfd, aouthdr_ext->o_algntext); aouthdr_int->o_algndata = H_GET_16 (abfd, aouthdr_ext->o_algndata); - aouthdr_int->o_modtype = H_GET_16 (abfd, aouthdr_ext->o_modtype); - aouthdr_int->o_cputype = H_GET_16 (abfd, aouthdr_ext->o_cputype); + aouthdr_int->o_modtype = H_GET_16 (abfd, aouthdr_ext->o_modtype); + aouthdr_int->o_cputype = H_GET_16 (abfd, aouthdr_ext->o_cputype); #ifdef XCOFF64 aouthdr_int->o_maxstack = H_GET_64 (abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = H_GET_64 (abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxdata = H_GET_64 (abfd, aouthdr_ext->o_maxdata); #else aouthdr_int->o_maxstack = H_GET_32 (abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = H_GET_32 (abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxdata = H_GET_32 (abfd, aouthdr_ext->o_maxdata); #endif #endif #ifdef MIPSECOFF - aouthdr_int->bss_start = H_GET_32 (abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = H_GET_32 (abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->bss_start = H_GET_32 (abfd, aouthdr_ext->bss_start); + aouthdr_int->gp_value = H_GET_32 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); aouthdr_int->cprmask[0] = H_GET_32 (abfd, aouthdr_ext->cprmask[0]); aouthdr_int->cprmask[1] = H_GET_32 (abfd, aouthdr_ext->cprmask[1]); aouthdr_int->cprmask[2] = H_GET_32 (abfd, aouthdr_ext->cprmask[2]); @@ -712,9 +723,9 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) #ifdef ALPHAECOFF aouthdr_int->bss_start = H_GET_64 (abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = H_GET_64 (abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); - aouthdr_int->fprmask = H_GET_32 (abfd, aouthdr_ext->fprmask); + aouthdr_int->gp_value = H_GET_64 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->fprmask = H_GET_32 (abfd, aouthdr_ext->fprmask); #endif } @@ -807,7 +818,8 @@ coff_swap_scnhdr_in (abfd, ext, in) #ifdef COFF_ADJUST_SCNHDR_IN_PRE COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in); #endif - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name)); + memcpy (scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name)); + scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr); scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr); scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size); @@ -866,6 +878,7 @@ coff_swap_scnhdr_out (abfd, in, out) buf, scnhdr_int->s_nlnno); PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno); } + if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) PUT_SCNHDR_NRELOC (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); else diff --git a/bfd/config.bfd b/bfd/config.bfd index efc36554633..55e2afcf86e 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -34,6 +34,7 @@ case "${targ_cpu}" in alpha*) targ_archs=bfd_alpha_arch ;; arm*) targ_archs=bfd_arm_arch ;; c30*) targ_archs=bfd_tic30_arch ;; +c4x*) targ_archs=bfd_tic4x_arch ;; c54x*) targ_archs=bfd_tic54x_arch ;; dlx*) targ_archs=bfd_dlx_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; @@ -256,6 +257,12 @@ case "${targ}" in targ_defvec=tic30_coff_vec ;; + c4x-*-*coff* | tic4x-*-*coff*) + targ_defvec=tic4x_coff1_vec + targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec" + targ_underscore=yes + ;; + c54x*-*-*coff* | tic54x-*-*coff*) targ_defvec=tic54x_coff1_vec targ_selvecs="tic54x_coff1_beh_vec tic54x_coff2_vec tic54x_coff2_beh_vec tic54x_coff0_vec tic54x_coff0_beh_vec" @@ -759,13 +766,13 @@ case "${targ}" in #endif mips*el-*-linux*) targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec" - targ64_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" + targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" + want64=true ;; mips*-*-linux*) targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" - targ64_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec" + targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #ifdef BFD64 mmix-*-*) @@ -847,7 +854,8 @@ case "${targ}" in targ_defvec=rs6000coff64_vec targ_selvecs=rs6000coff_vec ;; - powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*) + powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ + powerpc64-*-*bsd*) targ_defvec=bfd_elf64_powerpc_vec targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" ;; @@ -994,6 +1002,11 @@ case "${targ}" in #endif targ_underscore=yes ;; + sh-*-nto*) + targ_defvec=bfd_elf32_shqnx_vec + targ_selvecs="bfd_elf32_shlqnx_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + targ_underscore=yes + ;; sh-*-pe) targ_defvec=shlpe_vec targ_selvecs="shlpe_vec shlpei_vec" diff --git a/bfd/configure b/bfd/configure index 34a8f31eafd..d30361eed25 100755 --- a/bfd/configure +++ b/bfd/configure @@ -6123,7 +6123,9 @@ do bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; @@ -6238,6 +6240,12 @@ do sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; @@ -6330,10 +6338,10 @@ case ${host64}-${target64}-${want64} in if test -n "$GCC" ; then bad_64bit_gcc=no; echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6 -echo "configure:6334: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6342: checking for gcc version with buggy 64-bit support" >&5 # Add more tests for gcc versions with non-working 64-bit support here. cat > conftest.$ac_ext <&6 -echo "configure:6382: checking for $ac_hdr" >&5 +echo "configure:6390: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6417,12 +6425,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6421: checking for $ac_func" >&5 +echo "configure:6429: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6470,7 +6478,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6474: checking for working mmap" >&5 +echo "configure:6482: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6478,7 +6486,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6656,12 +6664,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6660: checking for $ac_func" >&5 +echo "configure:6668: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/bfd/configure.in b/bfd/configure.in index 84cea63914f..1facc24856f 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -624,7 +624,9 @@ do bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; @@ -739,6 +741,12 @@ do sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; diff --git a/bfd/cpu-powerpc.c b/bfd/cpu-powerpc.c index 55236697d71..b282c6031b9 100644 --- a/bfd/cpu-powerpc.c +++ b/bfd/cpu-powerpc.c @@ -269,6 +269,20 @@ const bfd_arch_info_type bfd_powerpc_archs[] = bfd_default_scan, &bfd_powerpc_archs[13] }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_e500, + "powerpc", + "powerpc:e500", + 3, + false, + powerpc_compatible, + bfd_default_scan, + &bfd_powerpc_archs[14] + }, { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ diff --git a/bfd/cpu-v850.c b/bfd/cpu-v850.c index 88363620266..ce61caa7562 100644 --- a/bfd/cpu-v850.c +++ b/bfd/cpu-v850.c @@ -1,21 +1,21 @@ /* BFD support for the NEC V850 processor - Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 "bfd.h" #include "sysdep.h" @@ -67,7 +67,6 @@ scan (info, string) switch (number) { case bfd_mach_v850e: arch = bfd_arch_v850; break; - case bfd_mach_v850ea: arch = bfd_arch_v850; break; default: return false; } @@ -89,8 +88,7 @@ scan (info, string) static const bfd_arch_info_type arch_info_struct[] = { - N (bfd_mach_v850e, "v850e", false, & arch_info_struct[1]), - N (bfd_mach_v850ea, "v850ea", false, NULL) + N (bfd_mach_v850e, "v850e", false, NULL) }; #undef NEXT diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 2f212bf7b9e..f20113c7f70 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,12 @@ +2002-08-29 John David Anglin + + * chew.c (paramstuff, outputdots, perform, bang and usage): Remove + void from function definitions. + +2002-08-13 Alan Modra + + * header.sed: Strip tabs. + 2002-06-08 Alan Modra * Makefile.am: Fix quote style in last change. diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index dc6f8110829..bdf76e46e19 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -485,7 +485,7 @@ print_stack_level () */ static void -paramstuff (void) +paramstuff () { unsigned int openp; unsigned int fname; @@ -626,7 +626,7 @@ manglecomments () /* Mod tos so that only lines with leading dots remain */ static void -outputdots (void) +outputdots () { unsigned int idx = 0; string_type out; @@ -1261,7 +1261,7 @@ lookup_word (word) } static void -perform (void) +perform () { tos = stack; @@ -1412,7 +1412,7 @@ compile (string) } static void -bang (void) +bang () { *(long *) ((isp[0])) = isp[-1]; isp -= 2; @@ -1487,7 +1487,7 @@ read_in (str, file) } static void -usage (void) +usage () { fprintf (stderr, "usage: -[d|i|g] file\n"); exit (33); diff --git a/bfd/doc/header.sed b/bfd/doc/header.sed index ed27040f743..c58dc607f8c 100644 --- a/bfd/doc/header.sed +++ b/bfd/doc/header.sed @@ -1,3 +1,4 @@ +s|[ ][ ]*| |g s|\(.*\) [^ ]*header.sed.*|\1| s|[^ ]*/||g s|^ *|"| diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 8a7fff13b72..dcccc482f88 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -717,7 +717,8 @@ struct elf_backend_data newly created and plt/got refcounts and dynamic indices should not be copied. */ void (*elf_backend_copy_indirect_symbol) - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); /* Modify any information related to dynamic linking such that the symbol is not exported. */ @@ -1271,7 +1272,8 @@ extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create PARAMS ((bfd *)); extern void _bfd_elf_link_hash_copy_indirect - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); extern void _bfd_elf_link_hash_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); extern boolean _bfd_elf_link_hash_table_init diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 6f10cd7aabe..eb4a69b04d0 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -287,7 +287,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, bfd *abfd; struct bfd_link_info *info; asection *sec, *ehdrsec; - boolean (*reloc_symbol_deleted_p) (bfd_vma, PTR); + boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); struct elf_reloc_cookie *cookie; { bfd_byte *ehbuf = NULL, *buf; @@ -506,6 +506,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, } read_uleb128 (cie.code_align, buf); read_sleb128 (cie.data_align, buf); + /* Note - in DWARF2 the return address column is an unsigned byte. + In DWARF3 it is a ULEB128. We are following DWARF3. For most + ports this will not matter as the value will be less than 128. + For the others (eg FRV, SH, MMIX, IA64) they need a fixed GCC + which conforms to the DWARF3 standard. */ read_uleb128 (cie.ra_column, buf); ENSURE_NO_RELOCS (buf); cie.lsda_encoding = DW_EH_PE_omit; diff --git a/bfd/elf.c b/bfd/elf.c index 1582496a1db..71763d41bef 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -371,7 +371,7 @@ bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, { Elf_Internal_Shdr *shndx_hdr; PTR alloc_ext; - const PTR esym; + const bfd_byte *esym; Elf_External_Sym_Shndx *alloc_extshndx; Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym *isym; @@ -1418,10 +1418,12 @@ _bfd_elf_link_hash_newfunc (entry, table, string) old indirect symbol. Also used for copying flags to a weakdef. */ void -_bfd_elf_link_hash_copy_indirect (dir, ind) +_bfd_elf_link_hash_copy_indirect (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { bfd_signed_vma tmp; + bfd_signed_vma lowest_valid = bed->can_refcount; /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -1439,22 +1441,22 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) /* Copy over the global and procedure linkage table refcount entries. These may have been already set up by a check_relocs routine. */ tmp = dir->got.refcount; - if (tmp <= 0) + if (tmp < lowest_valid) { dir->got.refcount = ind->got.refcount; ind->got.refcount = tmp; } else - BFD_ASSERT (ind->got.refcount <= 0); + BFD_ASSERT (ind->got.refcount < lowest_valid); tmp = dir->plt.refcount; - if (tmp <= 0) + if (tmp < lowest_valid) { dir->plt.refcount = ind->plt.refcount; ind->plt.refcount = tmp; } else - BFD_ASSERT (ind->plt.refcount <= 0); + BFD_ASSERT (ind->plt.refcount < lowest_valid); if (dir->dynindx == -1) { diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index bfc1aa66a6a..5cd94347c31 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -3546,6 +3546,31 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) } bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; + + /* Set the bottom bit of DT_INIT/FINI if the + corresponding function is Thumb. */ + case DT_INIT: + name = info->init_function; + goto get_sym; + case DT_FINI: + name = info->fini_function; + get_sym: + /* If it wasn't set by elf_bfd_final_link + then there is nothing to ajdust. */ + if (dyn.d_un.d_val != 0) + { + struct elf_link_hash_entry * eh; + + eh = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + if (eh != (struct elf_link_hash_entry *) NULL + && ELF_ST_TYPE (eh->type) == STT_ARM_TFUNC) + { + dyn.d_un.d_val |= 1; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; } } diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index afe74bd71b6..8eff52dd5ad 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2917,7 +2917,8 @@ elf_cris_discard_excess_program_dynamics (h, inf) functions; doing this for all symbols would presumably not introduce new problems. Of course we don't do this if we're exporting all dynamic symbols. */ - if (! info->export_dynamic) + if (! info->export_dynamic + && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) { h->root.dynindx = -1; _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index ca62709872e..35e6f32f6ac 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -327,7 +327,8 @@ static boolean elf32_hppa_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static void elf32_hppa_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf32_hppa_check_relocs PARAMS ((bfd *, struct bfd_link_info *, @@ -1145,7 +1146,8 @@ elf32_hppa_create_dynamic_sections (abfd, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf32_hppa_copy_indirect_symbol (dir, ind) +elf32_hppa_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf32_hppa_link_hash_entry *edir, *eind; @@ -1189,7 +1191,7 @@ elf32_hppa_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 3ba50ba851c..d047f0106e2 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -34,30 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/i370.h" -/* i370 relocations */ -/* Note that there is really just one relocation that we currently - * support (and only one that we seem to need, at the moment), and - * that is the 31-bit address relocation. Note that the 370/390 - * only supports a 31-bit (2GB) address space. - */ -enum i370_reloc_type -{ - R_I370_NONE = 0, - R_I370_ADDR31 = 1, - R_I370_ADDR32 = 2, - R_I370_ADDR16 = 3, - R_I370_REL31 = 4, - R_I370_REL32 = 5, - R_I370_ADDR12 = 6, - R_I370_REL12 = 7, - R_I370_ADDR8 = 8, - R_I370_REL8 = 9, - R_I370_COPY = 10, - R_I370_RELATIVE = 11, - - R_I370_max -}; - static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ]; static reloc_howto_type i370_elf_howto_raw[] = diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 5c0d5a1ceab..edf06de43e0 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -45,7 +45,8 @@ static boolean create_got_section static boolean elf_i386_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_i386_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static int elf_i386_tls_transition PARAMS ((struct bfd_link_info *, int, int)); @@ -767,7 +768,8 @@ elf_i386_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_i386_copy_indirect_symbol (dir, ind) +elf_i386_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_i386_link_hash_entry *edir, *eind; @@ -815,7 +817,7 @@ elf_i386_copy_indirect_symbol (dir, ind) edir->tls_type = eind->tls_type; eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index ae69ae255f5..f189be898ce 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,6 +1,6 @@ /* Motorola 68HC11-specific support for 32-bit ELF - Copyright 1999, 2000 Free Software Foundation, Inc. - Contributed by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) This file is part of BFD, the Binary File Descriptor library. @@ -21,14 +21,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" +#include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/m68hc11.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup -PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void m68hc11_info_to_howto_rel -PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +static bfd_reloc_status_type m68hc11_elf_ignore_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + +/* GC mark and sweep. */ +static asection *elf32_m68hc11_gc_mark_hook + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_m68hc11_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_m68hc11_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_m68hc11_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean m68hc11_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static void m68hc11_elf_relax_delete_bytes + PARAMS ((bfd *, asection *, bfd_vma, int)); +static void m68hc11_relax_group + PARAMS ((bfd *, asection *, bfd_byte *, unsigned, + unsigned long, unsigned long)); +static int compare_reloc PARAMS ((const void *, const void *)); + + +boolean _bfd_m68hc11_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword)); +boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); /* Use REL instead of RELA to save space */ #define USE_REL @@ -46,7 +77,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_NONE", /* name */ false, /* partial_inplace */ @@ -110,7 +141,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_PCREL_8", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ false), /* pcrel_offset */ @@ -171,7 +202,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_PCREL_16", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ @@ -204,6 +235,88 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ + + /* A 24 bit relocation */ + HOWTO (R_M68HC11_24, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_24", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit low relocation */ + HOWTO (R_M68HC11_LO16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_LO16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A page relocation */ + HOWTO (R_M68HC11_PAGE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PAGE", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + + /* Mark beginning of a jump instruction (any form). */ + HOWTO (R_M68HC11_RL_JUMP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC11_RL_JUMP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Mark beginning of Gcc relaxation group instruction. */ + HOWTO (R_M68HC11_RL_GROUP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC11_RL_GROUP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ }; /* Map BFD reloc types to M68HC11 ELF reloc types. */ @@ -225,9 +338,15 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { {BFD_RELOC_32, R_M68HC11_32}, {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, - /* The following relocs are defined but they probably don't work yet. */ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, + + {BFD_RELOC_M68HC11_LO16, R_M68HC11_LO16}, + {BFD_RELOC_M68HC11_PAGE, R_M68HC11_PAGE}, + {BFD_RELOC_M68HC11_24, R_M68HC11_24}, + + {BFD_RELOC_M68HC11_RL_JUMP, R_M68HC11_RL_JUMP}, + {BFD_RELOC_M68HC11_RL_GROUP, R_M68HC11_RL_GROUP}, }; static reloc_howto_type * @@ -248,6 +367,25 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +/* This function is used for relocs which are only used for relaxing, + which the linker should otherwise ignore. */ + +static bfd_reloc_status_type +m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -263,6 +401,1213 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } +static asection * +elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + +static boolean +elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +{ + /* We don't use got and plt entries for 68hc11/68hc12. */ + return true; +} + +struct m68hc11_direct_relax +{ + const char *name; + unsigned char code; + unsigned char direct_code; +} m68hc11_direct_relax_table[] = { + { "adca", 0xB9, 0x99 }, + { "adcb", 0xF9, 0xD9 }, + { "adda", 0xBB, 0x9B }, + { "addb", 0xFB, 0xDB }, + { "addd", 0xF3, 0xD3 }, + { "anda", 0xB4, 0x94 }, + { "andb", 0xF4, 0xD4 }, + { "cmpa", 0xB1, 0x91 }, + { "cmpb", 0xF1, 0xD1 }, + { "cpd", 0xB3, 0x93 }, + { "cpxy", 0xBC, 0x9C }, +/* { "cpy", 0xBC, 0x9C }, */ + { "eora", 0xB8, 0x98 }, + { "eorb", 0xF8, 0xD8 }, + { "jsr", 0xBD, 0x9D }, + { "ldaa", 0xB6, 0x96 }, + { "ldab", 0xF6, 0xD6 }, + { "ldd", 0xFC, 0xDC }, + { "lds", 0xBE, 0x9E }, + { "ldxy", 0xFE, 0xDE }, + /* { "ldy", 0xFE, 0xDE },*/ + { "oraa", 0xBA, 0x9A }, + { "orab", 0xFA, 0xDA }, + { "sbca", 0xB2, 0x92 }, + { "sbcb", 0xF2, 0xD2 }, + { "staa", 0xB7, 0x97 }, + { "stab", 0xF7, 0xD7 }, + { "std", 0xFD, 0xDD }, + { "sts", 0xBF, 0x9F }, + { "stxy", 0xFF, 0xDF }, + /* { "sty", 0xFF, 0xDF },*/ + { "suba", 0xB0, 0x90 }, + { "subb", 0xF0, 0xD0 }, + { "subd", 0xB3, 0x93 }, + { 0, 0, 0 } +}; + +static struct m68hc11_direct_relax * +find_relaxable_insn (unsigned char code) +{ + int i; + + for (i = 0; m68hc11_direct_relax_table[i].name; i++) + if (m68hc11_direct_relax_table[i].code == code) + return &m68hc11_direct_relax_table[i]; + + return 0; +} + +static int +compare_reloc (e1, e2) + const void *e1; + const void *e2; +{ + const Elf_Internal_Rela *i1 = (const Elf_Internal_Rela *) e1; + const Elf_Internal_Rela *i2 = (const Elf_Internal_Rela *) e2; + + if (i1->r_offset == i2->r_offset) + return 0; + else + return i1->r_offset < i2->r_offset ? -1 : 1; +} + +#define M6811_OP_LDX_IMMEDIATE (0xCE) + +static void +m68hc11_relax_group (abfd, sec, contents, value, offset, end_group) + bfd *abfd; + asection *sec; + bfd_byte *contents; + unsigned value; + unsigned long offset; + unsigned long end_group; +{ + unsigned char code; + unsigned long start_offset; + unsigned long ldx_offset = offset; + unsigned long ldx_size; + int can_delete_ldx; + int relax_ldy = 0; + + /* First instruction of the relax group must be a + LDX #value or LDY #value. If this is not the case, + ignore the relax group. */ + code = bfd_get_8 (abfd, contents + offset); + if (code == 0x18) + { + relax_ldy++; + offset++; + code = bfd_get_8 (abfd, contents + offset); + } + ldx_size = offset - ldx_offset + 3; + offset += 3; + if (code != M6811_OP_LDX_IMMEDIATE || offset >= end_group) + return; + + + /* We can remove the LDX/LDY only when all bset/brclr instructions + of the relax group have been converted to use direct addressing + mode. */ + can_delete_ldx = 1; + while (offset < end_group) + { + unsigned isize; + unsigned new_value; + int bset_use_y; + + bset_use_y = 0; + start_offset = offset; + code = bfd_get_8 (abfd, contents + offset); + if (code == 0x18) + { + bset_use_y++; + offset++; + code = bfd_get_8 (abfd, contents + offset); + } + + /* Check the instruction and translate to use direct addressing mode. */ + switch (code) + { + /* bset */ + case 0x1C: + code = 0x14; + isize = 3; + break; + + /* brclr */ + case 0x1F: + code = 0x13; + isize = 4; + break; + + /* brset */ + case 0x1E: + code = 0x12; + isize = 4; + break; + + /* bclr */ + case 0x1D: + code = 0x15; + isize = 3; + break; + + /* This instruction is not recognized and we are not + at end of the relax group. Ignore and don't remove + the first LDX (we don't know what it is used for...). */ + default: + return; + } + new_value = (unsigned) bfd_get_8 (abfd, contents + offset + 1); + new_value += value; + if ((new_value & 0xff00) == 0 && bset_use_y == relax_ldy) + { + bfd_put_8 (abfd, code, contents + offset); + bfd_put_8 (abfd, new_value, contents + offset + 1); + if (start_offset != offset) + { + m68hc11_elf_relax_delete_bytes (abfd, sec, start_offset, + offset - start_offset); + end_group--; + } + } + else + { + can_delete_ldx = 0; + } + offset = start_offset + isize; + } + if (can_delete_ldx) + { + /* Remove the move instruction (3 or 4 bytes win). */ + m68hc11_elf_relax_delete_bytes (abfd, sec, ldx_offset, ldx_size); + } +} + +/* This function handles relaxing for the 68HC11. + + + and somewhat more difficult to support. */ + +static boolean +m68hc11_elf_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents = NULL; + bfd_byte *free_contents = NULL; + Elf32_External_Sym *extsyms = NULL; + Elf32_External_Sym *free_extsyms = NULL; + Elf_Internal_Rela *prev_insn_branch = NULL; + Elf_Internal_Rela *prev_insn_group = NULL; + unsigned insn_group_value = 0; + Elf_External_Sym_Shndx *shndx_buf = NULL; + + /* Assume nothing changes. */ + *again = false; + + /* We don't have to do anything for a relocateable link, if + this section does not have relocs, or if this is not a + code section. */ + if (link_info->relocateable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0 + || (sec->flags & SEC_CODE) == 0) + return true; + + /* If this is the first time we have been called for this section, + initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + + /* Get a copy of the native relocations. */ + internal_relocs = (_bfd_elf32_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + /* Checking for branch relaxation relies on the relocations to + be sorted on 'r_offset'. This is not guaranteed so we must sort. */ + qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), + compare_reloc); + + /* Walk through them looking for relaxing opportunities. */ + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + bfd_vma value; + Elf_Internal_Sym isym; + + /* If this isn't something that can be relaxed, then ignore + this reloc. */ + if (ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_16 + && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_JUMP + && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_GROUP) + { + prev_insn_branch = 0; + prev_insn_group = 0; + 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 + { + /* Go get them off disk. */ + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + } + + /* Try to eliminate an unconditional 8 bit pc-relative branch + which immediately follows a conditional 8 bit pc-relative + branch around the unconditional branch. + + original: new: + bCC lab1 bCC' lab2 + bra lab2 + lab1: lab1: + + This happens when the bCC can't reach lab2 at assembly time, + but due to other relaxations it can reach at link time. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_JUMP) + { + Elf_Internal_Rela *nrel; + unsigned char code; + unsigned char roffset; + + prev_insn_branch = 0; + prev_insn_group = 0; + + /* Do nothing if this reloc is the last byte in the section. */ + if (irel->r_offset == sec->_cooked_size) + continue; + + /* See if the next instruction is an unconditional pc-relative + branch, more often than not this test will fail, so we + test it first to speed things up. */ + code = bfd_get_8 (abfd, contents + irel->r_offset + 2); + if (code != 0x7e) + continue; + + /* Also make sure the next relocation applies to the next + instruction and that it's a pc-relative 8 bit branch. */ + nrel = irel + 1; + if (nrel == irelend + || irel->r_offset + 3 != nrel->r_offset + || ELF32_R_TYPE (nrel->r_info) != (int) R_M68HC11_16) + continue; + + /* Make sure our destination immediately follows the + unconditional branch. */ + roffset = bfd_get_8 (abfd, contents + irel->r_offset + 1); + if (roffset != 3) + continue; + + prev_insn_branch = irel; + prev_insn_group = 0; + continue; + } + + /* Read this BFD's symbols if we haven't done so already. */ + if (extsyms == NULL) + { + /* Get cached copy if it exists. */ + if (symtab_hdr->contents != NULL) + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + else + { + /* Go get them off disk. */ + bfd_size_type amt = symtab_hdr->sh_size; + extsyms = (Elf32_External_Sym *) bfd_malloc (amt); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) extsyms, amt, abfd) != amt) + goto error_return; + } + + if (shndx_hdr->sh_size != 0) + { + bfd_size_type amt; + + amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL) + goto error_return; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + goto error_return; + shndx_hdr->contents = (PTR) shndx_buf; + } + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf32_External_Sym *esym; + Elf_External_Sym_Shndx *shndx; + asection *sym_sec; + + /* A local symbol. */ + esym = extsyms + ELF32_R_SYM (irel->r_info); + shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); + bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + + sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); + symval = (isym.st_value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + { + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + prev_insn_branch = 0; + prev_insn_group = 0; + continue; + } + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_GROUP) + { + prev_insn_branch = 0; + prev_insn_group = 0; + + /* Do nothing if this reloc is the last byte in the section. */ + if (irel->r_offset == sec->_cooked_size) + continue; + + prev_insn_group = irel; + insn_group_value = isym.st_value; + continue; + } + + value = symval; + /* Try to turn a far branch to a near branch. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16 + && prev_insn_branch) + { + bfd_vma offset; + unsigned char code; + + offset = value - (prev_insn_branch->r_offset + + sec->output_section->vma + + sec->output_offset + 2); + + /* If the offset is still out of -128..+127 range, + leave that far branch unchanged. */ + if ((offset & 0xff80) != 0 && (offset & 0xff80) != 0xff80) + { + prev_insn_branch = 0; + continue; + } + + /* Shrink the branch. */ + code = bfd_get_8 (abfd, contents + prev_insn_branch->r_offset); + if (code == 0x7e) + { + code = 0x20; + bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); + bfd_put_8 (abfd, offset, + contents + prev_insn_branch->r_offset + 1); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset, 1); + } + else + { + code ^= 0x1; + bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); + bfd_put_8 (abfd, offset, + contents + prev_insn_branch->r_offset + 1); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset - 1, 3); + } + prev_insn_branch = 0; + } + + /* Try to turn a 16 bit address into a 8 bit page0 address. */ + else if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16 + && (value & 0xff00) == 0) + { + unsigned char code; + unsigned short offset; + struct m68hc11_direct_relax *rinfo; + + prev_insn_branch = 0; + offset = bfd_get_16 (abfd, contents + irel->r_offset); + offset += value; + if ((offset & 0xff00) != 0) + { + prev_insn_group = 0; + continue; + } + + if (prev_insn_group) + { + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + m68hc11_relax_group (abfd, sec, contents, offset, + prev_insn_group->r_offset, + insn_group_value); + irel = prev_insn_group; + prev_insn_group = 0; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + continue; + } + + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + rinfo = find_relaxable_insn (code); + if (rinfo == 0) + { + prev_insn_group = 0; + continue; + } + + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + /* Fix the opcode. */ + /* printf ("A relaxable case : 0x%02x (%s)\n", + code, rinfo->name); */ + bfd_put_8 (abfd, rinfo->direct_code, + contents + irel->r_offset - 1); + + /* Delete one byte of data (upper byte of address). */ + m68hc11_elf_relax_delete_bytes (abfd, sec, irel->r_offset, 1); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_8); + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = true; + } + else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16) + { + unsigned char code; + bfd_vma offset; + + prev_insn_branch = 0; + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + if (code == 0x7e) + { + offset = value - (irel->r_offset + + sec->output_section->vma + + sec->output_offset + 1); + offset += bfd_get_16 (abfd, contents + irel->r_offset); + + /* If the offset is still out of -128..+127 range, + leave that far branch unchanged. */ + if ((offset & 0xff80) == 0 || (offset & 0xff80) == 0xff80) + { + + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + /* Shrink the branch. */ + code = 0x20; + bfd_put_8 (abfd, code, + contents + irel->r_offset - 1); + bfd_put_8 (abfd, offset, + contents + irel->r_offset); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 1, 1); + } + } + } + prev_insn_branch = 0; + } + + if (free_relocs != NULL) + { + free (free_relocs); + free_relocs = NULL; + } + + if (free_contents != NULL) + { + if (! link_info->keep_memory) + free (free_contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + free_contents = NULL; + } + + if (free_extsyms != NULL) + { + if (! link_info->keep_memory) + free (free_extsyms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) extsyms; + } + free_extsyms = NULL; + } + + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + if (free_contents != NULL) + free (free_contents); + if (free_extsyms != NULL) + free (free_extsyms); + return false; +} + +/* Delete some bytes from a section while relaxing. */ + +static void +m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count) + bfd *abfd; + asection *sec; + bfd_vma addr; + int count; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; + Elf32_External_Sym *extsyms; + unsigned int sec_shndx; + Elf_External_Sym_Shndx *shndx; + bfd_byte *contents; + Elf_Internal_Rela *irel, *irelend; + bfd_vma toaddr; + Elf32_External_Sym *esym, *esymend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + toaddr = sec->_cooked_size; + + irel = elf_section_data (sec)->relocs; + irelend = irel + sec->reloc_count; + + /* Actually delete the bytes. */ + memmove (contents + addr, contents + addr + count, + (size_t) (toaddr - addr - count)); + sec->_cooked_size -= count; + + /* Adjust all the relocs. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + { + unsigned char code; + unsigned char offset; + unsigned short raddr; + unsigned long old_offset; + int branch_pos; + + old_offset = irel->r_offset; + + /* See if this reloc was for the bytes we have deleted, in which + case we no longer care about it. Don't delete relocs which + represent addresses, though. */ + if (ELF32_R_TYPE (irel->r_info) != R_M68HC11_RL_JUMP + && irel->r_offset >= addr && irel->r_offset < addr + count) + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + + if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_NONE) + continue; + + /* Get the new reloc address. */ + if ((irel->r_offset > addr + && irel->r_offset < toaddr)) + irel->r_offset -= count; + + /* If this is a PC relative reloc, see if the range it covers + includes the bytes we have deleted. */ + switch (ELF32_R_TYPE (irel->r_info)) + { + default: + break; + + case R_M68HC11_RL_JUMP: + code = bfd_get_8 (abfd, contents + irel->r_offset); + switch (code) + { + /* jsr and jmp instruction are also marked with RL_JUMP + relocs but no adjustment must be made. */ + case 0x7e: + case 0x9d: + case 0xbd: + continue; + + case 0x12: + case 0x13: + branch_pos = 3; + raddr = 4; + + /* Special case when we translate a brclr N,y into brclr * + In this case, the 0x18 page2 prefix is removed. + The reloc offset is not modified but the instruction + size is reduced by 1. */ + if (old_offset == addr) + raddr++; + break; + + case 0x1e: + case 0x1f: + branch_pos = 3; + raddr = 4; + break; + + case 0x18: + branch_pos = 4; + raddr = 5; + break; + + default: + branch_pos = 1; + raddr = 2; + break; + } + offset = bfd_get_8 (abfd, contents + irel->r_offset + branch_pos); + raddr += old_offset; + raddr += ((unsigned short) offset | ((offset & 0x80) ? 0xff00 : 0)); + if (irel->r_offset < addr && raddr >= addr) + { + offset -= count; + bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos); + } + else if (irel->r_offset >= addr && raddr <= addr) + { + offset += count; + bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos); + } + else + { + /*printf ("Not adjusted 0x%04x [0x%4x 0x%4x]\n", raddr, + irel->r_offset, addr);*/ + } + + break; + } + } + + /* Adjust the local symbols defined in this section. */ + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; + esym = extsyms; + esymend = esym + symtab_hdr->sh_info; + for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + { + Elf_Internal_Sym isym; + Elf_External_Sym_Shndx dummy; + + bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + + if (isym.st_shndx == sec_shndx + && isym.st_value > addr + && isym.st_value < toaddr) + { + isym.st_value -= count; + bfd_elf32_swap_symbol_out (abfd, &isym, esym, &dummy); + } + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec + && sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value < toaddr) + { + sym_hash->root.u.def.value -= count; + } + } +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static boolean +elf32_m68hc11_check_relocs (abfd, info, sec, relocs) + bfd * abfd; + struct bfd_link_info * info; + asection * sec; + const Elf_Internal_Rela * relocs; +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry ** sym_hashes_end; + const Elf_Internal_Rela * rel; + const Elf_Internal_Rela * rel_end; + + if (info->relocateable) + return true; + + symtab_hdr = & elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry * h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + switch (ELF32_R_TYPE (rel->r_info)) + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_M68HC11_GNU_VTINHERIT: + if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_M68HC11_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + } + } + + return true; +} + +/* Relocate a 68hc11/68hc12 ELF section. */ +static boolean +elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + const char *name; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + bfd_vma relocation; + bfd_reloc_status_type r; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_type == R_M68HC11_GNU_VTENTRY + || r_type == R_M68HC11_GNU_VTINHERIT ) + continue; + + howto = elf_m68hc11_howto_table + r_type; + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + } + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + relocation = 0; + else + { + if (!((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; + relocation = 0; + } + } + + if (h != NULL) + name = h->root.root.string; + else + { + name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name)); + if (name == NULL || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) 0; + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return false; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, + rel->r_offset, true))) + return false; + break; + + case bfd_reloc_outofrange: + msg = _ ("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _ ("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _ ("internal error: dangerous error"); + goto common_error; + + default: + msg = _ ("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, + rel->r_offset))) + return false; + break; + } + } + } + + return true; +} + + + +/* Set and control ELF flags in ELF header. */ + +boolean +_bfd_m68hc11_elf_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +boolean +_bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean ok = true; + + /* Check if we have the same endianess */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI; + old_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + elf_elfheader (obfd)->e_ident[EI_CLASS] + = elf_elfheader (ibfd)->e_ident[EI_CLASS]; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd))) + return false; + } + + return true; + } + + /* Check ABI compatibility. */ + if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 16-bit integers (-mshort) " + "and others for 32-bit integers"), + bfd_archive_filename (ibfd)); + ok = false; + } + if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 32-bit double (-fshort-double) " + "and others for 64-bit double"), + bfd_archive_filename (ibfd)); + ok = false; + } + new_flags &= ~EF_M68HC11_ABI; + old_flags &= ~EF_M68HC11_ABI; + + /* Warn about any other mismatches */ + if (new_flags != old_flags) + { + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (unsigned long) new_flags, + (unsigned long) old_flags); + ok = false; + } + + if (! ok) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +boolean +_bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32) + fprintf (file, _("[abi=32-bit int,")); + else + fprintf (file, _("[abi=16-bit int,")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64) + fprintf (file, _(" 64-bit double]")); + else + fprintf (file, _(" 32-bit double]")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC12_BANKS) + fprintf (file, _(" [memory=bank-model]")); + else + fprintf (file, _(" [memory=flat]")); + + fputc ('\n', file); + + return true; +} + /* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. The Motorola spec says to use a different Elf machine code. */ #define ELF_ARCH bfd_arch_m68hc11 @@ -274,7 +1619,18 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define bfd_elf32_bfd_relax_section m68hc11_elf_relax_section +#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook +#define elf_backend_check_relocs elf32_m68hc11_check_relocs +#define elf_backend_relocate_section elf32_m68hc11_relocate_section #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 +#define elf_backend_can_gc_sections 1 +#define bfd_elf32_bfd_merge_private_bfd_data \ + _bfd_m68hc11_elf_merge_private_bfd_data +#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags +#define bfd_elf32_bfd_print_private_bfd_data \ + _bfd_m68hc11_elf_print_private_bfd_data #include "elf32-target.h" diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index 8f6ca49211f..9ab8780574c 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -1,6 +1,6 @@ /* Motorola 68HC12-specific support for 32-bit ELF - Copyright 1999, 2000 Free Software Foundation, Inc. - Contributed by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) This file is part of BFD, the Binary File Descriptor library. @@ -24,11 +24,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/m68hc11.h" +#include "opcode/m68hc11.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup -PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void m68hc11_info_to_howto_rel -PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +static bfd_reloc_status_type m68hc11_elf_ignore_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type m68hc12_elf_special_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static int m68hc12_addr_is_banked PARAMS ((bfd_vma)); +static bfd_vma m68hc12_phys_addr PARAMS ((bfd_vma)); +static bfd_vma m68hc12_phys_page PARAMS ((bfd_vma)); + +/* GC mark and sweep. */ +static asection *elf32_m68hc11_gc_mark_hook + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_m68hc11_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +boolean _bfd_m68hc12_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +boolean _bfd_m68hc12_elf_set_private_flags PARAMS ((bfd *, flagword)); +boolean _bfd_m68hc12_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); + + /* Use REL instead of RELA to save space */ #define USE_REL @@ -37,6 +60,68 @@ PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); We must handle 8 and 16-bit relocations. The 32-bit relocation is defined but not used except by gas when -gstabs is used (which is wrong). + + The 68HC12 microcontroler has a memory bank switching system + with a 16Kb window in the 64Kb address space. The extended memory + is mapped in the 16Kb window (at 0x8000). The page register controls + which 16Kb bank is mapped. The call/rtc instructions take care of + bank switching in function calls/returns. + + For GNU Binutils to work, we consider there is a physical memory + at 0..0x0ffff and a kind of virtual memory above that. Symbols + in virtual memory have their addresses treated in a special way + when disassembling and when linking. + + For the linker to work properly, we must always relocate the virtual + memory as if it is mapped at 0x8000. When a 16-bit relocation is + made in the virtual memory, we check that it does not cross the + memory bank where it is used. This would involve a page change + which would be wrong. The 24-bit relocation is for that and it + treats the address as a physical address + page number. + + + Banked + Address Space + | | Page n + +---------------+ 0x1010000 + | | + | jsr _foo | + | .. | Page 3 + | _foo: | + +---------------+ 0x100C000 + | | + | call _bar | + | .. | Page 2 + | _bar: | + +---------------+ 0x1008000 + /------>| | + | | call _foo | Page 1 + | | | + | +---------------+ 0x1004000 + Physical | | | + Address Space | | | Page 0 + | | | + +-----------+ 0x00FFFF | +---------------+ 0x1000000 + | | | + | call _foo | | + | | | + +-----------+ 0x00BFFF -+---/ + | | | + | | | + | | 16K | + | | | + +-----------+ 0x008000 -+ + | | + | | + = = + | | + | | + +-----------+ 0000 + + + The 'call _foo' must be relocated with page 3 and 16-bit address + mapped at 0x8000. + The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */ static reloc_howto_type elf_m68hc11_howto_table[] = { /* This reloc does nothing. */ @@ -46,9 +131,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_NONE", /* name */ + "R_M68HC12_NONE", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ @@ -63,7 +148,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_8", /* name */ + "R_M68HC12_8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -78,7 +163,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_HI8", /* name */ + "R_M68HC12_HI8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -93,7 +178,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_LO8", /* name */ + "R_M68HC12_LO8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -108,9 +193,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_PCREL_8", /* name */ + "R_M68HC12_PCREL_8", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ false), /* pcrel_offset */ @@ -122,8 +207,8 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont /*bitfield */ , /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_16", /* name */ + m68hc12_elf_special_reloc, /* special_function */ + "R_M68HC12_16", /* name */ false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ @@ -139,7 +224,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_32", /* name */ + "R_M68HC12_32", /* name */ false, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ @@ -154,7 +239,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_4B", /* name */ + "R_M68HC12_4B", /* name */ false, /* partial_inplace */ 0x003, /* src_mask */ 0x003, /* dst_mask */ @@ -169,9 +254,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_PCREL_16", /* name */ + "R_M68HC12_PCREL_16", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ @@ -204,6 +289,88 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ + + /* A 24 bit relocation */ + HOWTO (R_M68HC11_24, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc, /* special_function */ + "R_M68HC12_24", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit low relocation */ + HOWTO (R_M68HC11_LO16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc,/* special_function */ + "R_M68HC12_LO16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A page relocation */ + HOWTO (R_M68HC11_PAGE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc,/* special_function */ + "R_M68HC12_PAGE", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + + /* Mark beginning of a jump instruction (any form). */ + HOWTO (R_M68HC11_RL_JUMP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC12_RL_JUMP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Mark beginning of Gcc relaxation group instruction. */ + HOWTO (R_M68HC11_RL_GROUP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC12_RL_GROUP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ }; /* Map BFD reloc types to M68HC11 ELF reloc types. */ @@ -225,9 +392,15 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { {BFD_RELOC_32, R_M68HC11_32}, {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, - /* The following relocs are defined but they probably don't work yet. */ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, + + {BFD_RELOC_M68HC11_LO16, R_M68HC11_LO16}, + {BFD_RELOC_M68HC11_PAGE, R_M68HC11_PAGE}, + {BFD_RELOC_M68HC11_24, R_M68HC11_24}, + + {BFD_RELOC_M68HC11_RL_JUMP, R_M68HC11_RL_JUMP}, + {BFD_RELOC_M68HC11_RL_GROUP, R_M68HC11_RL_GROUP}, }; static reloc_howto_type * @@ -248,6 +421,158 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +/* This function is used for relocs which are only used for relaxing, + which the linker should otherwise ignore. */ + +static bfd_reloc_status_type +m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + +static int +m68hc12_addr_is_banked (addr) + bfd_vma addr; +{ + return (addr >= M68HC12_BANK_VIRT) ? 1 : 0; +} + +/* Return the physical address seen by the processor, taking + into account banked memory. */ +static bfd_vma +m68hc12_phys_addr (addr) + bfd_vma addr; +{ + if (addr < M68HC12_BANK_VIRT) + return addr; + + /* Map the address to the memory bank. */ + addr -= M68HC12_BANK_VIRT; + addr &= M68HC12_BANK_MASK; + addr += M68HC12_BANK_BASE; + return addr; +} + +/* Return the page number corresponding to an address in banked memory. */ +static bfd_vma +m68hc12_phys_page (addr) + bfd_vma addr; +{ + if (addr < M68HC12_BANK_VIRT) + return 0; + + /* Map the address to the memory bank. */ + addr -= M68HC12_BANK_VIRT; + addr >>= M68HC12_BANK_SHIFT; + addr &= M68HC12_BANK_PAGE_MASK; + return addr; +} + +static bfd_reloc_status_type +m68hc12_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + reloc_howto_type *howto; + bfd_vma relocation; + bfd_vma phys_addr; + bfd_vma phys_page; + bfd_vma insn_page; + bfd_vma insn_addr; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (! reloc_entry->howto->partial_inplace + || reloc_entry->addend == 0)) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Compute relocation. */ + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + relocation += bfd_get_16 (abfd, (bfd_byte*) data + reloc_entry->address); + + /* Do the memory bank mapping. */ + phys_addr = m68hc12_phys_addr (relocation); + phys_page = m68hc12_phys_page (relocation); + + howto = reloc_entry->howto; + if (howto->complain_on_overflow != complain_overflow_dont + && (phys_addr & (((bfd_vma) -1) << 16))) + return bfd_reloc_overflow; + + switch (howto->type) + { + case R_M68HC11_16: + /* Get virtual address of instruction having the relocation. */ + insn_addr = input_section->output_section->vma + + input_section->output_offset + + reloc_entry->address; + + insn_page = m68hc12_phys_page (insn_addr); + + if (m68hc12_addr_is_banked (relocation) + && m68hc12_addr_is_banked (insn_addr) + && phys_page != insn_page) + { + *error_message = _("address is not in the same bank"); + return bfd_reloc_dangerous; + } + if (m68hc12_addr_is_banked (relocation) + && !m68hc12_addr_is_banked (insn_addr)) + { + *error_message = _("reference to a banked address in " + "the normal address space"); + return bfd_reloc_dangerous; + } + + case R_M68HC11_LO16: + bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address); + break; + + case R_M68HC11_24: + bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address); + bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address + 2); + break; + + case R_M68HC11_PAGE: + bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address); + break; + + default: + abort (); + break; + } + + return bfd_reloc_ok; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -263,6 +588,177 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } +static asection * +elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + +static boolean +elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +{ + /* We don't use got and plt entries for 68hc11/68hc12. */ + return true; +} + + +/* Set and control ELF flags in ELF header. */ + +boolean +_bfd_m68hc12_elf_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +boolean +_bfd_m68hc12_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean ok = true; + + /* Check if we have the same endianess */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI; + old_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + elf_elfheader (obfd)->e_ident[EI_CLASS] + = elf_elfheader (ibfd)->e_ident[EI_CLASS]; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd))) + return false; + } + + return true; + } + + /* Check ABI compatibility. */ + if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 16-bit integers (-mshort) " + "and others for 32-bit integers"), + bfd_archive_filename (ibfd)); + ok = false; + } + if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 32-bit double (-fshort-double) " + "and others for 64-bit double"), + bfd_archive_filename (ibfd)); + ok = false; + } + new_flags &= ~EF_M68HC11_ABI; + old_flags &= ~EF_M68HC11_ABI; + + /* Warn about any other mismatches */ + if (new_flags != old_flags) + { + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (unsigned long) new_flags, + (unsigned long) old_flags); + ok = false; + } + + if (! ok) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +boolean +_bfd_m68hc12_elf_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32) + fprintf (file, _("[abi=32-bit int,")); + else + fprintf (file, _("[abi=16-bit int,")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64) + fprintf (file, _(" 64-bit double]")); + else + fprintf (file, _(" 32-bit double]")); + + fputc ('\n', file); + + return true; +} + /* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. The Motorola spec says to use a different Elf machine code. */ #define ELF_ARCH bfd_arch_m68hc12 @@ -274,7 +770,17 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 +/* Disabled as this backend uses the generic linker. */ +#define elf_backend_can_gc_sections 0 + +#define bfd_elf32_bfd_merge_private_bfd_data \ + _bfd_m68hc12_elf_merge_private_bfd_data +#define bfd_elf32_bfd_set_private_flags _bfd_m68hc12_elf_set_private_flags +#define bfd_elf32_bfd_print_private_bfd_data \ + _bfd_m68hc12_elf_print_private_bfd_data #include "elf32-target.h" diff --git a/bfd/elf32-qnx.h b/bfd/elf32-qnx.h index 454c2b42ec0..d4eefb81508 100644 --- a/bfd/elf32-qnx.h +++ b/bfd/elf32-qnx.h @@ -22,11 +22,11 @@ (start + (segment->p_memsz > segment->p_filesz \ ? segment->p_memsz : segment->p_filesz)) -static boolean elf_i386qnx_copy_private_bfd_data_p +static boolean elf_qnx_copy_private_bfd_data_p PARAMS ((bfd *, asection *, bfd *, asection *)); -static boolean elf_i386qnx_is_contained_by_filepos +static boolean elf_qnx_is_contained_by_filepos PARAMS ((asection *, Elf_Internal_Phdr *)); -static void elf_i386qnx_set_nonloadable_filepos +static void elf_qnx_set_nonloadable_filepos PARAMS ((bfd *, Elf_Internal_Phdr *)); static boolean diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 8067018dd89..bbc2ead9476 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -40,7 +40,8 @@ static boolean create_got_section static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -562,7 +563,8 @@ elf_s390_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -604,7 +606,7 @@ elf_s390_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 522b81680f0..c8bbe7152db 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -56,6 +56,9 @@ static boolean sh_elf_relocate_section static bfd_byte *sh_elf_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); +static void sh_elf_copy_indirect_symbol + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean sh_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -75,6 +78,8 @@ static boolean sh_elf_finish_dynamic_sections static bfd_reloc_status_type sh_elf_reloc_loop PARAMS ((int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, bfd_vma, bfd_vma)); +static boolean create_got_section + PARAMS((bfd *, struct bfd_link_info *)); static boolean sh_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static asection * sh_elf_gc_mark_hook @@ -83,6 +88,10 @@ static asection * sh_elf_gc_mark_hook static boolean sh_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); static enum elf_reloc_type_class sh_elf_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); #ifdef INCLUDE_SHMEDIA @@ -430,33 +439,33 @@ static reloc_howto_type sh_elf_howto_table[] = /* GNU extension to record C++ vtable hierarchy */ HOWTO (R_SH_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_SH_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_SH_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ /* GNU extension to record C++ vtable member usage */ HOWTO (R_SH_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_SH_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_SH_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ HOWTO (R_SH_LOOP_START, /* type */ @@ -510,7 +519,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xfc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in SHARI, SHLLI et al. */ HOWTO (R_SH_DIR6U, /* type */ @@ -525,7 +534,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xfc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in BxxI, LDHI.L et al. */ HOWTO (R_SH_DIR6S, /* type */ @@ -540,7 +549,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xfc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in ADDI, ANDI et al. */ HOWTO (R_SH_DIR10S, /* type */ @@ -555,9 +564,9 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ - /* Used in LD.UW, ST.W et al. */ + /* Used in LD.UW, ST.W et al. */ HOWTO (R_SH_DIR10SW, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -570,9 +579,9 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ - /* Used in LD.L, FLD.S et al. */ + /* Used in LD.L, FLD.S et al. */ HOWTO (R_SH_DIR10SL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -585,7 +594,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in FLD.D, FST.P et al. */ HOWTO (R_SH_DIR10SQ, /* type */ @@ -600,7 +609,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ #else EMPTY_HOWTO (45), @@ -857,11 +866,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT_LOW16", /* name */ + "R_SH_GOT_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 16) & 65536). */ HOWTO (R_SH_GOT_MEDLOW16, /* type */ @@ -876,7 +885,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 32) & 65536). */ HOWTO (R_SH_GOT_MEDHI16, /* type */ @@ -891,7 +900,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 48) & 65536). */ HOWTO (R_SH_GOT_HI16, /* type */ @@ -906,7 +915,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (x & 65536). */ HOWTO (R_SH_GOTPLT_LOW16, /* type */ @@ -917,11 +926,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT_LOW16", /* name */ + "R_SH_GOTPLT_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 16) & 65536). */ HOWTO (R_SH_GOTPLT_MEDLOW16, /* type */ @@ -936,7 +945,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 32) & 65536). */ HOWTO (R_SH_GOTPLT_MEDHI16, /* type */ @@ -951,7 +960,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 48) & 65536). */ HOWTO (R_SH_GOTPLT_HI16, /* type */ @@ -966,7 +975,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (x & 65536). */ HOWTO (R_SH_PLT_LOW16, /* type */ @@ -977,11 +986,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_PLT_LOW16", /* name */ + "R_SH_PLT_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 16) & 65536). */ HOWTO (R_SH_PLT_MEDLOW16, /* type */ @@ -996,7 +1005,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 32) & 65536). */ HOWTO (R_SH_PLT_MEDHI16, /* type */ @@ -1011,7 +1020,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 48) & 65536). */ HOWTO (R_SH_PLT_HI16, /* type */ @@ -1026,7 +1035,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI (x & 65536). */ HOWTO (R_SH_GOTOFF_LOW16, /* type */ @@ -1037,11 +1046,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTOFF_LOW16", /* name */ + "R_SH_GOTOFF_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 16) & 65536). */ HOWTO (R_SH_GOTOFF_MEDLOW16, /* type */ @@ -1056,7 +1065,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 32) & 65536). */ HOWTO (R_SH_GOTOFF_MEDHI16, /* type */ @@ -1071,7 +1080,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 48) & 65536). */ HOWTO (R_SH_GOTOFF_HI16, /* type */ @@ -1086,7 +1095,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (x & 65536). */ HOWTO (R_SH_GOTPC_LOW16, /* type */ @@ -1097,11 +1106,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPC_LOW16", /* name */ + "R_SH_GOTPC_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 16) & 65536). */ HOWTO (R_SH_GOTPC_MEDLOW16, /* type */ @@ -1116,7 +1125,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 32) & 65536). */ HOWTO (R_SH_GOTPC_MEDHI16, /* type */ @@ -1131,7 +1140,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ /* Used in MOVI and SHORI ((x >> 48) & 65536). */ HOWTO (R_SH_GOTPC_HI16, /* type */ @@ -1146,9 +1155,9 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - true), /* pcrel_offset */ + true), /* pcrel_offset */ - /* Used in LD.L, FLD.S et al. */ + /* Used in LD.L, FLD.S et al. */ HOWTO (R_SH_GOT10BY4, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1161,9 +1170,9 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ - /* Used in LD.L, FLD.S et al. */ + /* Used in LD.L, FLD.S et al. */ HOWTO (R_SH_GOTPLT10BY4, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1176,7 +1185,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in FLD.D, FST.P et al. */ HOWTO (R_SH_GOT10BY8, /* type */ @@ -1191,7 +1200,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in FLD.D, FST.P et al. */ HOWTO (R_SH_GOTPLT10BY8, /* type */ @@ -1206,7 +1215,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0xffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (R_SH_COPY64, /* type */ 0, /* rightshift */ @@ -1216,11 +1225,11 @@ static reloc_howto_type sh_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_COPY64", /* name */ + "R_SH_COPY64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ ((bfd_vma) 0) - 1, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (R_SH_GLOB_DAT64, /* type */ 0, /* rightshift */ @@ -1230,11 +1239,11 @@ static reloc_howto_type sh_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_GLOB_DAT64", /* name */ + "R_SH_GLOB_DAT64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ ((bfd_vma) 0) - 1, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (R_SH_JMP_SLOT64, /* type */ 0, /* rightshift */ @@ -1244,11 +1253,11 @@ static reloc_howto_type sh_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_JMP_SLOT64", /* name */ + "R_SH_JMP_SLOT64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ ((bfd_vma) 0) - 1, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (R_SH_RELATIVE64, /* type */ 0, /* rightshift */ @@ -1258,11 +1267,11 @@ static reloc_howto_type sh_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_RELATIVE64", /* name */ + "R_SH_RELATIVE64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ ((bfd_vma) 0) - 1, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ EMPTY_HOWTO (197), EMPTY_HOWTO (198), @@ -1363,7 +1372,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in SHORI. */ HOWTO (R_SH_IMMU16, /* type */ @@ -1378,7 +1387,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (x & 65536). */ HOWTO (R_SH_IMM_LOW16, /* type */ @@ -1389,11 +1398,11 @@ static reloc_howto_type sh_elf_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_LOW16", /* name */ + "R_SH_IMM_LOW16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI ((x - $) & 65536). */ HOWTO (R_SH_IMM_LOW16_PCREL, /* type */ @@ -1423,7 +1432,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (((x - $) >> 16) & 65536). */ HOWTO (R_SH_IMM_MEDLOW16_PCREL, /* type */ @@ -1453,7 +1462,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (((x - $) >> 32) & 65536). */ HOWTO (R_SH_IMM_MEDHI16_PCREL, /* type */ @@ -1483,7 +1492,7 @@ static reloc_howto_type sh_elf_howto_table[] = false, /* partial_inplace */ 0, /* src_mask */ 0x3fffc00, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* Used in MOVI and SHORI (((x - $) >> 48) & 65536). */ HOWTO (R_SH_IMM_HI16_PCREL, /* type */ @@ -1509,11 +1518,11 @@ static reloc_howto_type sh_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_SH_64", /* name */ + "R_SH_64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ ((bfd_vma) 0) - 1, /* dst_mask */ - false), /* pcrel_offset */ + false), /* pcrel_offset */ /* For the .uaquad pseudo, (x - $). */ HOWTO (R_SH_64_PCREL, /* type */ @@ -1955,9 +1964,9 @@ sh_elf_relax_section (abfd, sec, link_info, again) } /* The r_addend field of the R_SH_USES reloc will point us to - the register load. The 4 is because the r_addend field is - computed as though it were a jump offset, which are based - from 4 bytes after the jump instruction. */ + the register load. The 4 is because the r_addend field is + computed as though it were a jump offset, which are based + from 4 bytes after the jump instruction. */ laddr = irel->r_offset + 4 + irel->r_addend; if (laddr >= sec->_raw_size) { @@ -1969,7 +1978,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) insn = bfd_get_16 (abfd, contents + laddr); /* If the instruction is not mov.l NN,rN, we don't know what to - do. */ + do. */ if ((insn & 0xf000) != 0xd000) { ((*_bfd_error_handler) @@ -1996,8 +2005,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) } /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ + being loaded. This reloc will tell us which function is + actually being called. */ for (irelfn = internal_relocs; irelfn < irelend; irelfn++) if (irelfn->r_offset == paddr && ELF32_R_TYPE (irelfn->r_info) == (int) R_SH_DIR32) @@ -2054,8 +2063,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) && h->root.type != bfd_link_hash_defweak) { /* This appears to be a reference to an undefined - symbol. Just ignore it--it will be caught by the - regular reloc processing. */ + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ continue; } @@ -2095,13 +2104,13 @@ sh_elf_relax_section (abfd, sec, link_info, again) /* Replace the jsr with a bsr. */ /* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and - replace the jsr with a bsr. */ + replace the jsr with a bsr. */ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W); if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info) { /* If this needs to be changed because of future relaxing, - it will be handled here like other internal IND12W - relocs. */ + it will be handled here like other internal IND12W + relocs. */ bfd_put_16 (abfd, (bfd_vma) 0xb000 | ((foff >> 1) & 0xfff), contents + irel->r_offset); @@ -2109,13 +2118,13 @@ sh_elf_relax_section (abfd, sec, link_info, again) else { /* We can't fully resolve this yet, because the external - symbol value may be changed by future relaxing. We let - the final link phase handle it. */ + symbol value may be changed by future relaxing. We let + the final link phase handle it. */ bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset); } /* See if there is another R_SH_USES reloc referring to the same - register load. */ + register load. */ for (irelscan = internal_relocs; irelscan < irelend; irelscan++) if (ELF32_R_TYPE (irelscan->r_info) == (int) R_SH_USES && laddr == irelscan->r_offset + 4 + irelscan->r_addend) @@ -2130,8 +2139,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) } /* Look for a R_SH_COUNT reloc on the location where the - function address is stored. Do this before deleting any - bytes, to avoid confusion about the address. */ + function address is stored. Do this before deleting any + bytes, to avoid confusion about the address. */ for (irelcount = internal_relocs; irelcount < irelend; irelcount++) if (irelcount->r_offset == paddr && ELF32_R_TYPE (irelcount->r_info) == (int) R_SH_COUNT) @@ -2142,8 +2151,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) goto error_return; /* That will change things, so, just in case it permits some - other function call to come within range, we should relax - again. Note that this is not required, and it may be slow. */ + other function call to come within range, we should relax + again. Note that this is not required, and it may be slow. */ *again = true; /* Now check whether we got a COUNT reloc. */ @@ -2156,7 +2165,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) } /* The number of uses is stored in the r_addend field. We've - just deleted one. */ + just deleted one. */ if (irelcount->r_addend == 0) { ((*_bfd_error_handler) (_("%s: 0x%lx: warning: bad count"), @@ -2168,8 +2177,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) --irelcount->r_addend; /* If there are no more uses, we can delete the address. Reload - the address from irelfn, in case it was changed by the - previous call to sh_elf_relax_delete_bytes. */ + the address from irelfn, in case it was changed by the + previous call to sh_elf_relax_delete_bytes. */ if (irelcount->r_addend == 0) { if (! sh_elf_relax_delete_bytes (abfd, sec, irelfn->r_offset, 4)) @@ -2355,7 +2364,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) (int) R_SH_NONE); /* If this is a PC relative reloc, see if the range it covers - includes the bytes we have deleted. */ + includes the bytes we have deleted. */ switch ((enum elf_sh_reloc_type) ELF32_R_TYPE (irel->r_info)) { default: @@ -2378,9 +2387,9 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) case R_SH_DIR32: /* If this reloc is against a symbol defined in this - section, and the symbol will not be adjusted below, we - must check the addend to see it will put the value in - range to be adjusted, and hence must be changed. */ + section, and the symbol will not be adjusted below, we + must check the addend to see it will put the value in + range to be adjusted, and hence must be changed. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { isym = isymbuf + ELF32_R_SYM (irel->r_info); @@ -2572,8 +2581,8 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) continue; /* We always cache the relocs. Perhaps, if info->keep_memory is - false, we should free them, if we are permitted to, when we - leave sh_coff_relax_section. */ + false, we should free them, if we are permitted to, when we + leave sh_coff_relax_section. */ internal_relocs = (_bfd_elf32_link_read_relocs (abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL, true)); @@ -2597,9 +2606,9 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) else { /* We always cache the section contents. - Perhaps, if info->keep_memory is false, we - should free them, if we are permitted to, - when we leave sh_coff_relax_section. */ + Perhaps, if info->keep_memory is false, we + should free them, if we are permitted to, + when we leave sh_coff_relax_section. */ ocontents = (bfd_byte *) bfd_malloc (o->_raw_size); if (ocontents == NULL) return false; @@ -2655,9 +2664,9 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) else { /* We always cache the section contents. - Perhaps, if info->keep_memory is false, we - should free them, if we are permitted to, - when we leave sh_coff_relax_section. */ + Perhaps, if info->keep_memory is false, we + should free them, if we are permitted to, + when we leave sh_coff_relax_section. */ ocontents = (bfd_byte *) bfd_malloc (o->_raw_size); if (ocontents == NULL) return false; @@ -2829,8 +2838,8 @@ sh_elf_swap_insns (abfd, sec, relocs, contents, addr) int add; /* There are a few special types of relocs that we don't want to - adjust. These relocs do not apply to the instruction itself, - but are only associated with the address. */ + adjust. These relocs do not apply to the instruction itself, + but are only associated with the address. */ type = (enum elf_sh_reloc_type) ELF32_R_TYPE (irel->r_info); if (type == R_SH_ALIGN || type == R_SH_CODE @@ -2839,11 +2848,11 @@ sh_elf_swap_insns (abfd, sec, relocs, contents, addr) continue; /* If an R_SH_USES reloc points to one of the addresses being - swapped, we must adjust it. It would be incorrect to do this - for a jump, though, since we want to execute both - instructions after the jump. (We have avoided swapping - around a label, so the jump will not wind up executing an - instruction it shouldn't). */ + swapped, we must adjust it. It would be incorrect to do this + for a jump, though, since we want to execute both + instructions after the jump. (We have avoided swapping + around a label, so the jump will not wind up executing an + instruction it shouldn't). */ if (type == R_SH_USES) { bfd_vma off; @@ -2902,11 +2911,11 @@ sh_elf_swap_insns (abfd, sec, relocs, contents, addr) case R_SH_DIR8WPL: /* This reloc ignores the least significant 3 bits of - the program counter before adding in the offset. - This means that if ADDR is at an even address, the - swap will not affect the offset. If ADDR is an at an - odd address, then the instruction will be crossing a - four byte boundary, and must be adjusted. */ + the program counter before adding in the offset. + This means that if ADDR is at an even address, the + swap will not affect the offset. If ADDR is an at an + odd address, then the instruction will be crossing a + four byte boundary, and must be adjusted. */ if ((addr & 3) != 0) { insn = bfd_get_16 (abfd, loc); @@ -2947,7 +2956,7 @@ static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = 0xcc, 0x00, 0x01, 0x10, /* movi .got.plt >> 16, r17 */ 0xc8, 0x00, 0x01, 0x10, /* shori .got.plt & 65535, r17 */ 0x89, 0x10, 0x09, 0x90, /* ld.l r17, 8, r25 */ - 0x6b, 0xf1, 0x46, 0x00, /* ptabs r17, tr0 */ + 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x89, 0x10, 0x05, 0x10, /* ld.l r17, 4, r17 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ @@ -2967,7 +2976,7 @@ static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = 0x10, 0x01, 0x00, 0xcc, /* movi .got.plt >> 16, r17 */ 0x10, 0x01, 0x00, 0xc8, /* shori .got.plt & 65535, r17 */ 0x90, 0x09, 0x10, 0x89, /* ld.l r17, 8, r25 */ - 0x00, 0x46, 0xf1, 0x6b, /* ptabs r17, tr0 */ + 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0x10, 0x05, 0x10, 0x89, /* ld.l r17, 4, r17 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ @@ -3348,22 +3357,23 @@ static const bfd_byte *elf_sh_pic_plt_entry; #endif /* The sh linker needs to keep track of the number of relocs that it - decides to copy in check_relocs for each symbol. This is so that - it can discard PC relative relocs if it doesn't need them when - linking with -Bsymbolic. We store the information in a field - extending the regular ELF linker hash table. */ - -/* This structure keeps track of the number of PC relative relocs we - have copied for a given symbol. */ + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ -struct elf_sh_pcrel_relocs_copied +struct elf_sh_dyn_relocs { - /* Next section. */ - struct elf_sh_pcrel_relocs_copied *next; - /* A section in dynobj. */ - asection *section; - /* Number of relocs copied in this section. */ + struct elf_sh_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; }; /* sh ELF linker hash entry. */ @@ -3376,8 +3386,8 @@ struct elf_sh_link_hash_entry bfd_vma datalabel_got_offset; #endif - /* Number of PC relative relocs copied for this symbol. */ - struct elf_sh_pcrel_relocs_copied *pcrel_relocs_copied; + /* Track dynamic relocs copied for this symbol. */ + struct elf_sh_dyn_relocs *dyn_relocs; }; /* sh ELF linker hash table. */ @@ -3385,12 +3395,19 @@ struct elf_sh_link_hash_entry struct elf_sh_link_hash_table { struct elf_link_hash_table root; -}; -/* Declare this now that the above structures are defined. */ + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; -static boolean sh_elf_discard_copies - PARAMS ((struct elf_sh_link_hash_entry *, PTR)); + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; /* Traverse an sh ELF linker hash table. */ @@ -3431,7 +3448,10 @@ sh_elf_link_hash_newfunc (entry, table, string) table, string)); if (ret != (struct elf_sh_link_hash_entry *) NULL) { - ret->pcrel_relocs_copied = NULL; + struct elf_sh_link_hash_entry *eh; + + eh = (struct elf_sh_link_hash_entry *) ret; + eh->dyn_relocs = NULL; #ifdef INCLUDE_SHMEDIA ret->datalabel_got_offset = (bfd_vma) -1; #endif @@ -3460,9 +3480,51 @@ sh_elf_link_hash_table_create (abfd) return NULL; } + ret->sgot = NULL; + ret->sgotplt = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->sym_sec.abfd = NULL; + return &ret->root.root; } +/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf_sh_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return false; + + htab = sh_elf_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + if (! htab->sgot || ! htab->sgotplt) + abort (); + + htab->srelgot = bfd_make_section (dynobj, ".rela.got"); + if (htab->srelgot == NULL + || ! bfd_set_section_flags (dynobj, htab->srelgot, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + return false; + return true; +} + /* Create dynamic sections when linking against a dynamic object. */ static boolean @@ -3470,6 +3532,7 @@ sh_elf_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; { + struct elf_sh_link_hash_table *htab; flagword flags, pltflags; register asection *s; struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -3490,6 +3553,8 @@ sh_elf_create_dynamic_sections (abfd, info) return false; } + htab = sh_elf_hash_table (info); + /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and .rel[a].bss sections. */ @@ -3504,6 +3569,7 @@ sh_elf_create_dynamic_sections (abfd, info) pltflags |= SEC_READONLY; s = bfd_make_section (abfd, ".plt"); + htab->splt = s; if (s == NULL || ! bfd_set_section_flags (abfd, s, pltflags) || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment)) @@ -3530,12 +3596,13 @@ sh_elf_create_dynamic_sections (abfd, info) s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); + htab->srelplt = s; if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) return false; - if (! _bfd_elf_create_got_section (abfd, info)) + if (! create_got_section (abfd, info)) return false; { @@ -3571,6 +3638,7 @@ sh_elf_create_dynamic_sections (abfd, info) initialize them at run time. The linker script puts the .dynbss section into the .bss section of the final image. */ s = bfd_make_section (abfd, ".dynbss"); + htab->sdynbss = s; if (s == NULL || ! bfd_set_section_flags (abfd, s, SEC_ALLOC)) return false; @@ -3591,6 +3659,7 @@ sh_elf_create_dynamic_sections (abfd, info) s = bfd_make_section (abfd, (bed->default_use_rela_p ? ".rela.bss" : ".rel.bss")); + htab->srelbss = s; if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -3612,6 +3681,9 @@ sh_elf_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { + struct elf_sh_link_hash_table *htab; + struct elf_sh_link_hash_entry *eh; + struct elf_sh_dyn_relocs *p; bfd *dynobj; asection *s; unsigned int power_of_two; @@ -3635,66 +3707,26 @@ sh_elf_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + if (h->plt.refcount <= 0 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 + && h->root.type != bfd_link_hash_undefweak + && h->root.type != bfd_link_hash_undefined)) { /* This case can occur if we saw a PLT reloc in an input file, but the symbol was never referred to by a dynamic object. In such a case, we don't actually need to build a procedure linkage table, and we can just do a REL32 reloc instead. */ - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); - return true; + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_ENTRY_SIZE; - - /* If this symbol is not defined in a regular file, and we are - not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; - } - - h->plt.offset = s->_raw_size; - - /* Make room for this entry. */ - s->_raw_size += elf_sh_sizeof_plt (info); - - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - - s = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += 4; - - /* We also need to make an entry in the .rela.plt section. */ - - s = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += sizeof (Elf32_External_Rela); - return true; } + else + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -3723,6 +3755,30 @@ sh_elf_adjust_dynamic_symbol (info, h) if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) return true; + /* If -z nocopyreloc was given, we won't generate them either. */ + if (info->nocopyreloc) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return true; + } + + eh = (struct elf_sh_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & (SEC_READONLY | SEC_HAS_CONTENTS)) != 0) + break; + } + + /* If we didn't find any dynamic relocs in sections which needs the + copy reloc, then we'll be keeping the dynamic relocs and avoiding + the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return true; + } + /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be an entry for this symbol in the .dynsym section. The dynamic @@ -3733,7 +3789,8 @@ sh_elf_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); + htab = sh_elf_hash_table (info); + s = htab->sdynbss; BFD_ASSERT (s != NULL); /* We must generate a R_SH_COPY reloc to tell the dynamic linker to @@ -3744,7 +3801,7 @@ sh_elf_adjust_dynamic_symbol (info, h) { asection *srel; - srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + srel = htab->srelbss; BFD_ASSERT (srel != NULL); srel->_raw_size += sizeof (Elf32_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; @@ -3757,8 +3814,7 @@ sh_elf_adjust_dynamic_symbol (info, h) power_of_two = 3; /* Apply the required alignment. */ - s->_raw_size = BFD_ALIGN (s->_raw_size, - (bfd_size_type) (1 << power_of_two)); + s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); if (power_of_two > bfd_get_section_alignment (dynobj, s)) { if (! bfd_set_section_alignment (dynobj, s, power_of_two)) @@ -3775,6 +3831,239 @@ sh_elf_adjust_dynamic_symbol (info, h) return true; } +/* This is the condition under which sh_elf_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 sh_elf_relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ + ((DYN) \ + && ((INFO)->shared \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ + +static boolean +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct elf_sh_link_hash_table *htab; + struct elf_sh_link_hash_entry *eh; + struct elf_sh_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return true; + + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + info = (struct bfd_link_info *) inf; + htab = sh_elf_hash_table (info); + + if (htab->root.dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + { + asection *s = htab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->_raw_size == 0) + s->_raw_size += PLT_ENTRY_SIZE; + + h->plt.offset = s->_raw_size; + + /* If this symbol is not defined in a regular file, and we are + not generating a shared library, then set the symbol to this + location in the .plt. This is required to make function + pointers compare as equal between the normal executable and + the shared library. */ + if (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; + } + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ + htab->sgotplt->_raw_size += 4; + + /* We also need to make an entry in the .rel.plt section. */ + htab->srelplt->_raw_size += sizeof (Elf32_External_Rela); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + if (h->got.refcount > 0) + { + asection *s; + boolean dyn; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } + + s = htab->sgot; +#ifdef INCLUDE_SHMEDIA + if (h->type == STT_DATALABEL) + { + struct elf_sh_link_hash_entry *hsh; + + h = (struct elf_link_hash_entry *) h->root.u.i.link; + hsh = (struct elf_sh_link_hash_entry *)h; + hsh->datalabel_got_offset = s->_raw_size; + } + else + h->got.offset = s->_raw_size; +#else + h->got.offset = s->_raw_size; +#endif + s->_raw_size += 4; + dyn = htab->root.dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; + + eh = (struct elf_sh_link_hash_entry *) h; + if (eh->dyn_relocs == NULL) + return true; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for pc-relative relocs that have become local due to symbol + visibility changes. */ + + if (info->shared) + { + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + struct elf_sh_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; + } + } + } + else + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + || (htab->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); + } + + return true; +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static boolean +readonly_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct elf_sh_link_hash_entry *eh; + struct elf_sh_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + eh = (struct elf_sh_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *s = p->sec->output_section; + + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; + + info->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return false; + } + } + return true; +} + /* Set the sizes of the dynamic sections. */ static boolean @@ -3782,15 +4071,17 @@ sh_elf_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { + struct elf_sh_link_hash_table *htab; bfd *dynobj; asection *s; - boolean plt; boolean relocs; + bfd *ibfd; - dynobj = elf_hash_table (info)->dynobj; + htab = sh_elf_hash_table (info); + dynobj = htab->root.dynobj; BFD_ASSERT (dynobj != NULL); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->root.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ if (! info->shared) @@ -3801,106 +4092,135 @@ sh_elf_size_dynamic_sections (output_bfd, info) s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } } - else - { - /* We may have created entries in the .rela.got section. - However, if we are not creating the dynamic sections, we will - not actually use these entries. Reset the size of .rela.got, - which will cause it to get stripped from the output file - below. */ - s = bfd_get_section_by_name (dynobj, ".rela.got"); - if (s != NULL) - s->_raw_size = 0; - } - /* If this is a -Bsymbolic shared link, then we need to discard all - PC relative relocs against symbols defined in a regular object. - We allocated space for them in the check_relocs routine, but we - will not fill them in in the relocate_section routine. */ - if (info->shared && info->symbolic) - sh_elf_link_hash_traverse (sh_elf_hash_table (info), - sh_elf_discard_copies, - (PTR) NULL); - - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - plt = false; - relocs = false; - for (s = dynobj->sections; s != NULL; s = s->next) + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { - const char *name; - boolean strip; + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; - if ((s->flags & SEC_LINKER_CREATED) == 0) + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; - /* It's OK to base decisions on the section name, because none - of the dynobj section names depend upon the input files. */ - name = bfd_get_section_name (dynobj, s); - - strip = false; - - if (strcmp (name, ".plt") == 0) + for (s = ibfd->sections; s != NULL; s = s->next) { - if (s->_raw_size == 0) - { - /* Strip this section if we don't need it; see the - comment below. */ - strip = true; - } - else + struct elf_sh_dyn_relocs *p; + + for (p = ((struct elf_sh_dyn_relocs *) + elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) { - /* Remember whether there is a PLT. */ - plt = true; + if (! bfd_is_abs_section (p->sec) + && bfd_is_abs_section (p->sec->output_section)) + { + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ + } + else if (p->count != 0) + { + srel = elf_section_data (p->sec)->sreloc; + srel->_raw_size += p->count * sizeof (Elf32_External_Rela); + if ((p->sec->output_section->flags & SEC_READONLY) != 0) + info->flags |= DF_TEXTREL; + } } } - else if (strncmp (name, ".rela", 5) == 0) + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; +#ifdef INCLUDE_SHMEDIA + /* Count datalabel local GOT. */ + locsymcount *= 2; +#endif + end_local_got = local_got + locsymcount; + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) { - if (s->_raw_size == 0) + if (*local_got > 0) { - /* If we don't need this section, strip it from the - output file. This is mostly to handle .rela.bss and - .rela.plt. We must create both sections in - create_dynamic_sections, because they must be created - before the linker maps input sections to output - sections. The linker does that before - adjust_dynamic_symbol is called, and it is that - function which decides whether anything needs to go - into these sections. */ - strip = true; + *local_got = s->_raw_size; + s->_raw_size += 4; + if (info->shared) + srel->_raw_size += sizeof (Elf32_External_Rela); } else - { - /* Remember whether there are any reloc sections other - than .rela.plt. */ - if (strcmp (name, ".rela.plt") != 0) - relocs = true; - - /* We use the reloc_count field as a counter if we need - to copy relocs into the output file. */ - s->reloc_count = 0; - } + *local_got = (bfd_vma) -1; } - else if (strncmp (name, ".got", 4) != 0) + } + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ + relocs = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + if (s == htab->splt + || s == htab->sgot + || s == htab->sgotplt) + { + /* Strip this section if we don't need it; see the + comment below. */ + } + else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + { + if (s->_raw_size != 0 && s != htab->srelplt) + relocs = true; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + else { /* It's not one of our sections, so don't allocate space. */ continue; } - if (strip) + if (s->_raw_size == 0) { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rela.bss and + .rela.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + _bfd_strip_section_from_output (info, s); continue; } - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) + /* Allocate memory for the section contents. We use bfd_zalloc + here in case unused entries are not reclaimed before the + section's contents are written out. This should not happen, + but this way if it does, we get a R_SH_NONE reloc instead + of garbage. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL) return false; } - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->root.dynamic_sections_created) { /* Add some entries to the .dynamic section. We fill in the values later, in sh_elf_finish_dynamic_sections, but we @@ -3912,64 +4232,44 @@ sh_elf_size_dynamic_sections (output_bfd, info) if (! info->shared) { - if (!add_dynamic_entry (DT_DEBUG, 0)) + if (! add_dynamic_entry (DT_DEBUG, 0)) return false; } - if (plt) + if (htab->splt->_raw_size != 0) { - if (!add_dynamic_entry (DT_PLTGOT, 0) - || !add_dynamic_entry (DT_PLTRELSZ, 0) - || !add_dynamic_entry (DT_PLTREL, DT_RELA) - || !add_dynamic_entry (DT_JMPREL, 0)) + if (! add_dynamic_entry (DT_PLTGOT, 0) + || ! add_dynamic_entry (DT_PLTRELSZ, 0) + || ! add_dynamic_entry (DT_PLTREL, DT_RELA) + || ! add_dynamic_entry (DT_JMPREL, 0)) return false; } if (relocs) { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) + if (! add_dynamic_entry (DT_RELA, 0) + || ! add_dynamic_entry (DT_RELASZ, 0) + || ! add_dynamic_entry (DT_RELAENT, + sizeof (Elf32_External_Rela))) return false; - } - if ((info->flags & DF_TEXTREL) != 0) - { - if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + /* If any dynamic relocs apply to a read-only section, + then we need a DT_TEXTREL entry. */ + if ((info->flags & DF_TEXTREL) == 0) + elf_link_hash_traverse (&htab->root, readonly_dynrelocs, + (PTR) info); + + if ((info->flags & DF_TEXTREL) != 0) + { + if (! add_dynamic_entry (DT_TEXTREL, 0)) + return false; + } } } #undef add_dynamic_entry return true; } - -/* This function is called via sh_elf_link_hash_traverse if we are - creating a shared object with -Bsymbolic. It discards the space - allocated to copy PC relative relocs against symbols which are - defined in regular objects. We allocated space for them in the - check_relocs routine, but we won't fill them in in the - relocate_section routine. */ - -static boolean -sh_elf_discard_copies (h, ignore) - struct elf_sh_link_hash_entry *h; - PTR ignore ATTRIBUTE_UNUSED; -{ - struct elf_sh_pcrel_relocs_copied *s; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct elf_sh_link_hash_entry *) h->root.root.u.i.link; - - /* We only discard relocs for symbols defined in a regular object. */ - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - return true; - - for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) - s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela); - - return true; -} /* Relocate an SH ELF section. */ @@ -3985,6 +4285,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *local_syms; asection **local_sections; { + struct elf_sh_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; @@ -3995,14 +4296,15 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, asection *splt; asection *sreloc; + htab = sh_elf_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - dynobj = elf_hash_table (info)->dynobj; + dynobj = htab->root.dynobj; local_got_offsets = elf_local_got_offsets (input_bfd); - sgot = NULL; - sgotplt = NULL; - splt = NULL; + sgot = htab->sgot; + sgotplt = htab->sgotplt; + splt = htab->splt; sreloc = NULL; rel = relocs; @@ -4025,7 +4327,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF32_R_TYPE (rel->r_info); /* Many of the relocs are only used for relaxing, and are - handled entirely by the relaxation code. */ + handled entirely by the relaxation code. */ if (r_type > (int) R_SH_LAST_INVALID_RELOC && r_type < (int) R_SH_LOOP_START) continue; @@ -4050,7 +4352,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, howto = sh_elf_howto_table + r_type; /* For relocs that aren't partial_inplace, we get the addend from - the relocation. */ + the relocation. */ if (! howto->partial_inplace) addend = rel->r_addend; @@ -4129,9 +4431,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, return false; } - addend = bfd_get_32 (input_bfd, contents + rel->r_offset); - msec = sec; - addend = + addend = bfd_get_32 (input_bfd, contents + rel->r_offset); + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation; addend += msec->output_section->vma + msec->output_offset; @@ -4162,6 +4464,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { + boolean dyn; + + dyn = htab->root.dynamic_sections_created; sec = h->root.u.def.section; /* In these cases, we don't need the relocation value. We check specially because in some obscure cases @@ -4182,7 +4487,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_SH_GOT_MEDLOW16 || r_type == R_SH_GOT_MEDHI16 || r_type == R_SH_GOT_HI16) - && elf_hash_table (info)->dynamic_sections_created + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) && (! info->shared || (! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags @@ -4197,15 +4502,17 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) && ((r_type == R_SH_DIR32 - && !(ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)) + && (h->elf_link_hash_flags + & ELF_LINK_FORCED_LOCAL) == 0) || r_type == R_SH_REL32) && ((input_section->flags & SEC_ALLOC) != 0 /* DWARF will emit R_SH_DIR32 relocations in its sections against symbols defined externally in shared libraries. We can't do anything with them here. */ - || (input_section->flags & SEC_DEBUGGING) != 0))) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) relocation = 0; else if (sec->output_section == NULL) { @@ -4228,14 +4535,17 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined) + && (! info->symbolic || info->allow_shlib_undefined) + && ! info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, true))) + input_section, rel->r_offset, + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -4416,8 +4726,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, procedure linkage table. */ if (h == NULL - || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) || ! info->shared || info->symbolic || h->dynindx == -1 @@ -4427,12 +4736,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocation is to the entry for this symbol in the global offset table extension for the procedure linkage table. */ - if (sgotplt == NULL) - { - sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (sgotplt != NULL); - } + BFD_ASSERT (sgotplt != NULL); relocation = (sgotplt->output_offset + ((h->plt.offset / elf_sh_sizeof_plt (info) - 1 + 3) * 4)); @@ -4455,15 +4760,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, #endif /* Relocation is to the entry for this symbol in the global offset table. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + + BFD_ASSERT (sgot != NULL); if (h != NULL) { bfd_vma off; + boolean dyn; off = h->got.offset; #ifdef INCLUDE_SHMEDIA @@ -4477,11 +4780,11 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, #endif BFD_ASSERT (off != (bfd_vma) -1); - if (! elf_hash_table (info)->dynamic_sections_created + dyn = htab->root.dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) || (info->shared && (info->symbolic || h->dynindx == -1 - || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) { /* This is actually a static link, or it is a @@ -4585,7 +4888,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, } #ifdef GOT_BIAS - relocation -= GOT_BIAS; + relocation -= GOT_BIAS; #endif goto final_link_relocate; @@ -4600,11 +4903,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocation is relative to the start of the global offset table. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + BFD_ASSERT (sgot != NULL); /* Note that sgot->output_offset is not involved in this calculation. We always want the start of .got. If we @@ -4630,12 +4929,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, #endif /* Use global offset table as symbol value. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - + BFD_ASSERT (sgot != NULL); relocation = sgot->output_section->vma; #ifdef GOT_BIAS @@ -4661,8 +4955,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (h == NULL) goto final_link_relocate; - if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) + if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) goto final_link_relocate; if (h->plt.offset == (bfd_vma) -1) @@ -4673,12 +4966,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, goto final_link_relocate; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - + BFD_ASSERT (splt != NULL); relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); @@ -4872,6 +5160,11 @@ sh_elf_gc_mark_hook (sec, info, rel, h, sym) break; default: +#ifdef INCLUDE_SHMEDIA + while (h->root.type == bfd_link_hash_indirect + && h->root.u.i.link) + h = (struct elf_link_hash_entry *) h->root.u.i.link; +#endif switch (h->root.type) { case bfd_link_hash_defined: @@ -4896,18 +5189,186 @@ sh_elf_gc_mark_hook (sec, info, rel, h, sym) static boolean sh_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; { - /* We use got and plt entries for sh, but it would seem that the - existing SH code does no sort of reference counting or whatnot on - its GOT and PLT entries, so it is not possible to garbage collect - them at this time. */ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + + elf_section_data (sec)->local_dynrel = NULL; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SH_GOT32: + case R_SH_GOTOFF: + case R_SH_GOTPC: +#ifdef INCLUDE_SHMEDIA + case R_SH_GOT_LOW16: + case R_SH_GOT_MEDLOW16: + case R_SH_GOT_MEDHI16: + case R_SH_GOT_HI16: + case R_SH_GOT10BY4: + case R_SH_GOT10BY8: + case R_SH_GOTOFF_LOW16: + case R_SH_GOTOFF_MEDLOW16: + case R_SH_GOTOFF_MEDHI16: + case R_SH_GOTOFF_HI16: + case R_SH_GOTPC_LOW16: + case R_SH_GOTPC_MEDLOW16: + case R_SH_GOTPC_MEDHI16: + case R_SH_GOTPC_HI16: +#endif + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + case R_SH_DIR32: + case R_SH_REL32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_sh_link_hash_entry *eh; + struct elf_sh_dyn_relocs **pp; + struct elf_sh_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + if (!info->shared && h->plt.refcount > 0) + h->plt.refcount -= 1; + + eh = (struct elf_sh_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_SH_PLT32: +#ifdef INCLUDE_SHMEDIA + case R_SH_PLT_LOW16: + case R_SH_PLT_MEDLOW16: + case R_SH_PLT_MEDHI16: + case R_SH_PLT_HI16: +#endif + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_SH_GOTPLT32: +#ifdef INCLUDE_SHMEDIA + case R_SH_GOTPLT_LOW16: + case R_SH_GOTPLT_MEDLOW16: + case R_SH_GOTPLT_MEDHI16: + case R_SH_GOTPLT_HI16: + case R_SH_GOTPLT10BY4: + case R_SH_GOTPLT10BY8: +#endif + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + h->got.refcount -= 1; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + default: + break; + } + return true; } +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +sh_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; + struct elf_link_hash_entry *dir, *ind; +{ + struct elf_sh_link_hash_entry *edir, *eind; + + edir = (struct elf_sh_link_hash_entry *) dir; + eind = (struct elf_sh_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct elf_sh_dyn_relocs **pp; + struct elf_sh_dyn_relocs *p; + + BFD_ASSERT (ind->root.type != bfd_link_hash_indirect); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct elf_sh_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -4921,6 +5382,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + struct elf_sh_link_hash_table *htab; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; bfd *dynobj; @@ -4942,7 +5404,8 @@ sh_elf_check_relocs (abfd, info, sec, relocs) if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - dynobj = elf_hash_table (info)->dynobj; + htab = sh_elf_hash_table (info); + dynobj = htab->root.dynobj; local_got_offsets = elf_local_got_offsets (abfd); rel_end = relocs + sec->reloc_count; @@ -4958,7 +5421,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs) h = sym_hashes[r_symndx - symtab_hdr->sh_info]; /* Some relocs require a global offset table. */ - if (dynobj == NULL) + if (htab->sgot == NULL) { switch (ELF32_R_TYPE (rel->r_info)) { @@ -4988,8 +5451,9 @@ sh_elf_check_relocs (abfd, info, sec, relocs) case R_SH_GOTPC_MEDHI16: case R_SH_GOTPC_HI16: #endif - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! _bfd_elf_create_got_section (dynobj, info)) + if (dynobj == NULL) + htab->root.dynobj = dynobj = abfd; + if (! create_got_section (dynobj, info)) return false; break; @@ -4999,16 +5463,16 @@ sh_elf_check_relocs (abfd, info, sec, relocs) } switch (ELF32_R_TYPE (rel->r_info)) - { - /* This relocation describes the C++ object vtable hierarchy. - Reconstruct it for later use during GC. */ + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ case R_SH_GNU_VTINHERIT: if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return false; break; - /* This relocation describes which C++ vtable entries are actually - used. Record for later use during GC. */ + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ case R_SH_GNU_VTENTRY: if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return false; @@ -5024,133 +5488,34 @@ sh_elf_check_relocs (abfd, info, sec, relocs) case R_SH_GOT10BY4: case R_SH_GOT10BY8: #endif - /* This symbol requires a global offset table entry. */ - - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - - if (srelgot == NULL - && (h != NULL || info->shared)) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - if (srelgot == NULL) - { - srelgot = bfd_make_section (dynobj, ".rela.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return false; - } - } - if (h != NULL) - { -#ifdef INCLUDE_SHMEDIA - if (h->type == STT_DATALABEL) - { - struct elf_sh_link_hash_entry *hsh; - - h = (struct elf_link_hash_entry *) h->root.u.i.link; - hsh = (struct elf_sh_link_hash_entry *)h; - if (hsh->datalabel_got_offset != (bfd_vma) -1) - break; - - hsh->datalabel_got_offset = sgot->_raw_size; - } - else - { -#endif - if (h->got.offset != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; -#ifdef INCLUDE_SHMEDIA - } -#endif - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } + h->got.refcount += 1; else { + bfd_signed_vma *local_got_refcounts; + /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) + symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) { bfd_size_type size; - register unsigned int i; size = symtab_hdr->sh_info; - size *= sizeof (bfd_vma); + size *= sizeof (bfd_signed_vma); #ifdef INCLUDE_SHMEDIA /* Reserve space for both the datalabel and codelabel local GOT offsets. */ size *= 2; #endif - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; -#ifdef INCLUDE_SHMEDIA - for (; i < 2 * symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; -#endif - } -#ifdef INCLUDE_SHMEDIA - if ((rel->r_addend & 1) != 0) - { - if (local_got_offsets[symtab_hdr->sh_info - + r_symndx] != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[symtab_hdr->sh_info - + r_symndx] = sgot->_raw_size; - } - else - { -#endif - if (local_got_offsets[r_symndx] != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[r_symndx] = sgot->_raw_size; -#ifdef INCLUDE_SHMEDIA - } -#endif - - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_SH_RELATIVE reloc so that the dynamic - linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rela); + elf_local_got_refcounts (abfd) = local_got_refcounts; } + local_got_refcounts[r_symndx] += 1; } - - sgot->_raw_size += 4; - break; case R_SH_GOTPLT32: @@ -5166,22 +5531,14 @@ sh_elf_check_relocs (abfd, info, sec, relocs) creating a procedure linkage table entry. */ if (h == NULL - || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) || ! info->shared || info->symbolic - || h->dynindx == -1 - || h->got.offset != (bfd_vma) -1) + || h->dynindx == -1) goto force_got; - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; break; @@ -5204,18 +5561,20 @@ sh_elf_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) + if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) break; h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - + h->plt.refcount += 1; break; case R_SH_DIR32: case R_SH_REL32: - if (h != NULL) - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + if (h != NULL && ! info->shared) + { + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + h->plt.refcount += 1; + } /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc @@ -5228,15 +5587,35 @@ sh_elf_check_relocs (abfd, info, sec, relocs) possible that DEF_REGULAR is not set now but will be set later (it is never cleared). We account for that possibility below by storing information in the - pcrel_relocs_copied field of the hash table entry. */ - if (info->shared - && (sec->flags & SEC_ALLOC) != 0 - && (ELF32_R_TYPE (rel->r_info) != R_SH_REL32 - || (h != NULL - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + dyn_relocs field of the hash table entry. A similar + situation occurs when creating shared libraries and symbol + visibility changes render the symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (sec->flags & SEC_ALLOC) != 0 + && (ELF32_R_TYPE (rel->r_info) != R_SH_REL32 + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (! info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) { + struct elf_sh_dyn_relocs *p; + struct elf_sh_dyn_relocs **head; + + if (dynobj == NULL) + htab->root.dynobj = dynobj = abfd; + /* When creating a shared object, we must copy these reloc types into the output file. We create a reloc section in dynobj and make room for this reloc. */ @@ -5272,44 +5651,44 @@ sh_elf_check_relocs (abfd, info, sec, relocs) } if (sec->flags & SEC_READONLY) info->flags |= DF_TEXTREL; + elf_section_data (sec)->sreloc = sreloc; } - sreloc->_raw_size += sizeof (Elf32_External_Rela); - - /* If we are linking with -Bsymbolic, and this is a - global symbol, we count the number of PC relative - relocations we have entered for this symbol, so that - we can discard them again if the symbol is later - defined by a regular object. Note that this function - is only called if we are using an elf_sh linker - hash table, which means that h is really a pointer to - an elf_sh_link_hash_entry. */ - if (h != NULL && info->symbolic - && ELF32_R_TYPE (rel->r_info) == R_SH_REL32) + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + head = &((struct elf_sh_link_hash_entry *) h)->dyn_relocs; + else { - struct elf_sh_link_hash_entry *eh; - struct elf_sh_pcrel_relocs_copied *p; + asection *s; - eh = (struct elf_sh_link_hash_entry *) h; + /* Track dynamic relocs needed for local syms too. */ + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return false; - for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next) - if (p->section == sreloc) - break; + head = ((struct elf_sh_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + } + p = *head; + if (p == NULL || p->sec != sec) + { + bfd_size_type amt = sizeof (*p); + p = ((struct elf_sh_dyn_relocs *) bfd_alloc (dynobj, amt)); if (p == NULL) - { - p = ((struct elf_sh_pcrel_relocs_copied *) - bfd_alloc (dynobj, (bfd_size_type) sizeof *p)); - if (p == NULL) - return false; - p->next = eh->pcrel_relocs_copied; - eh->pcrel_relocs_copied = p; - p->section = sreloc; - p->count = 0; - } - - ++p->count; + return false; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; } + + p->count += 1; + if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32) + p->pc_count += 1; } break; @@ -5443,9 +5822,11 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { + struct elf_sh_link_hash_table *htab; bfd *dynobj; - dynobj = elf_hash_table (info)->dynobj; + htab = sh_elf_hash_table (info); + dynobj = htab->root.dynobj; if (h->plt.offset != (bfd_vma) -1) { @@ -5462,9 +5843,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); - srel = bfd_get_section_by_name (dynobj, ".rela.plt"); + splt = htab->splt; + sgot = htab->sgotplt; + srel = htab->srelplt; BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL); /* Get the index in the procedure linkage table which @@ -5479,7 +5860,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) got_offset = (plt_index + 3) * 4; #ifdef GOT_BIAS - got_offset -= GOT_BIAS; + if (info->shared) + got_offset -= GOT_BIAS; #endif /* Fill in the entry in the procedure linkage table. */ @@ -5500,8 +5882,10 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) (splt->contents + h->plt.offset + elf_sh_plt_symbol_offset (info))); + /* Set bottom bit because its for a branch to SHmedia */ movi_shori_putval (output_bfd, - (splt->output_section->vma + splt->output_offset), + (splt->output_section->vma + splt->output_offset) + | 1, (splt->contents + h->plt.offset + elf_sh_plt_plt0_offset (info))); #else @@ -5540,7 +5924,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } #ifdef GOT_BIAS - got_offset += GOT_BIAS; + if (info->shared) + got_offset += GOT_BIAS; #endif #ifdef INCLUDE_SHMEDIA @@ -5592,21 +5977,23 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - srel = bfd_get_section_by_name (dynobj, ".rela.got"); + sgot = htab->sgot; + srel = htab->srelgot; BFD_ASSERT (sgot != NULL && srel != NULL); rel.r_offset = (sgot->output_section->vma + sgot->output_offset + (h->got.offset &~ (bfd_vma) 1)); - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. Likewise if - the symbol was forced to be local because of a version file. + /* If this is a static link, or it is a -Bsymbolic link and the + symbol is defined locally or was forced to be local because + of a version file, we just want to emit a RELATIVE reloc. 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)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { rel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE); @@ -5668,30 +6055,33 @@ sh_elf_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; { + struct elf_sh_link_hash_table *htab; bfd *dynobj; asection *sgot; asection *sdyn; - dynobj = elf_hash_table (info)->dynobj; + htab = sh_elf_hash_table (info); + dynobj = htab->root.dynobj; - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (sgot != NULL); + sgot = htab->sgotplt; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->root.dynamic_sections_created) { asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - BFD_ASSERT (sdyn != NULL); + BFD_ASSERT (sgot != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; asection *s; +#ifdef INCLUDE_SHMEDIA + const char *name; +#endif bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); @@ -5700,21 +6090,43 @@ sh_elf_finish_dynamic_sections (output_bfd, info) default: break; +#ifdef INCLUDE_SHMEDIA + case DT_INIT: + name = info->init_function; + goto get_sym; + + case DT_FINI: + name = info->fini_function; + get_sym: + if (dyn.d_un.d_val != 0) + { + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (&htab->root, name, + false, false, true); + if (h != NULL && (h->other & STO_SH5_ISA32)) + { + dyn.d_un.d_val |= 1; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; +#endif + case DT_PLTGOT: - name = ".got"; + s = htab->sgot->output_section; goto get_vma; case DT_JMPREL: - name = ".rela.plt"; + s = htab->srelplt->output_section; get_vma: - s = bfd_get_section_by_name (output_bfd, name); BFD_ASSERT (s != NULL); dyn.d_un.d_ptr = s->vma; bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; case DT_PLTRELSZ: - s = bfd_get_section_by_name (output_bfd, ".rela.plt"); + s = htab->srelplt->output_section; BFD_ASSERT (s != NULL); if (s->_cooked_size != 0) dyn.d_un.d_val = s->_cooked_size; @@ -5733,9 +6145,9 @@ sh_elf_finish_dynamic_sections (output_bfd, info) the linker script arranges for .rela.plt to follow all other relocation sections, we don't have to worry about changing the DT_RELA entry. */ - s = bfd_get_section_by_name (output_bfd, ".rela.plt"); - if (s != NULL) + if (htab->srelplt != NULL) { + s = htab->srelplt->output_section; if (s->_cooked_size != 0) dyn.d_un.d_val -= s->_cooked_size; else @@ -5747,7 +6159,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) } /* Fill in the first entry in the procedure linkage table. */ - splt = bfd_get_section_by_name (dynobj, ".plt"); + splt = htab->splt; if (splt && splt->_raw_size > 0) { if (info->shared) @@ -5793,7 +6205,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) } /* Fill in the first three entries in the global offset table. */ - if (sgot->_raw_size > 0) + if (sgot && sgot->_raw_size > 0) { if (sdyn == NULL) bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); @@ -5803,9 +6215,9 @@ sh_elf_finish_dynamic_sections (output_bfd, info) sgot->contents); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8); - } - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + } return true; } @@ -5853,11 +6265,11 @@ sh_elf_reloc_type_class (rela) #define bfd_elf32_bfd_merge_private_bfd_data \ sh_elf_merge_private_data -#define elf_backend_gc_mark_hook sh_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook sh_elf_gc_sweep_hook -#define elf_backend_check_relocs sh_elf_check_relocs - -#define elf_backend_can_gc_sections 1 +#define elf_backend_gc_mark_hook sh_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook sh_elf_gc_sweep_hook +#define elf_backend_check_relocs sh_elf_check_relocs +#define elf_backend_copy_indirect_symbol \ + sh_elf_copy_indirect_symbol #define elf_backend_create_dynamic_sections \ sh_elf_create_dynamic_sections #define bfd_elf32_bfd_link_hash_table_create \ @@ -5872,9 +6284,15 @@ sh_elf_reloc_type_class (rela) sh_elf_finish_dynamic_sections #define elf_backend_reloc_type_class sh_elf_reloc_type_class +#define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_ENTRY_SIZE + +#ifndef ELF32_SH_C_INCLUDED #include "elf32-target.h" +#endif + diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 07890c6a7cf..193a0bf4930 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -2,24 +2,24 @@ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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. */ /* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char - dependencies. As is the gas & simulator code or the v850. */ + dependencies. As is the gas & simulator code for the v850. */ #include "bfd.h" #include "sysdep.h" @@ -87,6 +87,12 @@ static asection * v850_elf_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static bfd_reloc_status_type v850_elf_ignore_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean v850_elf_relax_delete_bytes + PARAMS ((bfd *, asection *, bfd_vma, bfd_vma, int)); +static boolean v850_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); /* Note: It is REQUIRED that the 'type' value of each entry in this array match the index of the entry in the array. */ @@ -467,6 +473,51 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* dst_mask */ false), /* pcrel_offset */ + /* Indicates a .longcall pseudo-op. The compiler will generate a .longcall + pseudo-op when it finds a function call which can be relaxed. */ + HOWTO (R_V850_LONGCALL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + v850_elf_ignore_reloc, /* special_function */ + "R_V850_LONGCALL", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Indicates a .longjump pseudo-op. The compiler will generate a + .longjump pseudo-op when it finds a branch which can be relaxed. */ + HOWTO (R_V850_LONGJUMP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + v850_elf_ignore_reloc, /* special_function */ + "R_V850_LONGJUMP", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_V850_ALIGN, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + v850_elf_ignore_reloc, /* special_function */ + "R_V850_ALIGN", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ }; /* Map BFD reloc types to V850 ELF reloc types. */ @@ -481,31 +532,34 @@ struct v850_elf_reloc_map static const struct v850_elf_reloc_map v850_elf_reloc_map[] = { - { BFD_RELOC_NONE, R_V850_NONE }, - { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL }, - { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL }, - { BFD_RELOC_HI16_S, R_V850_HI16_S }, - { BFD_RELOC_HI16, R_V850_HI16 }, - { BFD_RELOC_LO16, R_V850_LO16 }, - { BFD_RELOC_32, R_V850_32 }, - { BFD_RELOC_16, R_V850_16 }, - { BFD_RELOC_8, R_V850_8 }, - { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET }, - { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET }, - { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET }, - { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET }, - { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET }, - { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET }, - { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET }, - { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET }, + { BFD_RELOC_NONE, R_V850_NONE }, + { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL }, + { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL }, + { BFD_RELOC_HI16_S, R_V850_HI16_S }, + { BFD_RELOC_HI16, R_V850_HI16 }, + { BFD_RELOC_LO16, R_V850_LO16 }, + { BFD_RELOC_32, R_V850_32 }, + { BFD_RELOC_16, R_V850_16 }, + { BFD_RELOC_8, R_V850_8 }, + { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET }, + { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET }, + { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET }, + { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET }, + { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET }, + { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET }, + { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET }, + { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET }, { BFD_RELOC_V850_TDA_4_5_OFFSET, R_V850_TDA_4_5_OFFSET }, { BFD_RELOC_V850_TDA_4_4_OFFSET, R_V850_TDA_4_4_OFFSET }, { BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, R_V850_SDA_16_16_SPLIT_OFFSET }, { BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, R_V850_ZDA_16_16_SPLIT_OFFSET }, { BFD_RELOC_V850_CALLT_6_7_OFFSET, R_V850_CALLT_6_7_OFFSET }, { BFD_RELOC_V850_CALLT_16_16_OFFSET, R_V850_CALLT_16_16_OFFSET }, - { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT }, - { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY }, + { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT }, + { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY }, + { BFD_RELOC_V850_LONGCALL, R_V850_LONGCALL }, + { BFD_RELOC_V850_LONGJUMP, R_V850_LONGJUMP }, + { BFD_RELOC_V850_ALIGN, R_V850_ALIGN }, }; @@ -1297,6 +1351,9 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) /* Work out which section the relocation is targetted at and the initial relocation command value. */ + if (reloc->howto->pc_relative == true) + return bfd_reloc_ok; + /* Get symbol value. (Common symbols are special.) */ if (bfd_is_com_section (symbol->section)) relocation = 0; @@ -1335,6 +1392,26 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) reloc->addend = relocation; return bfd_reloc_ok; } + +/* This function is used for relocs which are only used + for relaxing, which the linker should otherwise ignore. */ + +static bfd_reloc_status_type +v850_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd * abfd ATTRIBUTE_UNUSED; + arelent * reloc_entry; + asymbol * symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection * input_section; + bfd * output_bfd; + char ** error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} static boolean v850_elf_is_local_label_name (abfd, name) @@ -1349,8 +1426,8 @@ v850_elf_is_local_label_name (abfd, name) static bfd_reloc_status_type v850_elf_final_link_relocate (howto, input_bfd, output_bfd, - input_section, contents, offset, value, - addend, info, sym_sec, is_local) + input_section, contents, offset, value, + addend, info, sym_sec, is_local) reloc_howto_type * howto; bfd * input_bfd; bfd * output_bfd ATTRIBUTE_UNUSED; @@ -1500,6 +1577,9 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, case R_V850_NONE: case R_V850_GNU_VTINHERIT: case R_V850_GNU_VTENTRY: + case R_V850_LONGCALL: + case R_V850_LONGJUMP: + case R_V850_ALIGN: return bfd_reloc_ok; default: @@ -1770,7 +1850,6 @@ v850_elf_object_p (abfd) default: case E_V850_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, 0); break; case E_V850E_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e); break; - case E_V850EA_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850ea); break; } return true; } @@ -1789,7 +1868,6 @@ v850_elf_final_write_processing (abfd, linker) default: case 0: val = E_V850_ARCH; break; case bfd_mach_v850e: val = E_V850E_ARCH; break; - case bfd_mach_v850ea: val = E_V850EA_ARCH; break; } elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH; @@ -1882,7 +1960,6 @@ v850_elf_print_private_bfd_data (abfd, ptr) default: case E_V850_ARCH: fprintf (file, _("v850 architecture")); break; case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break; - case E_V850EA_ARCH: fprintf (file, _("v850ea architecture")); break; } fputc ('\n', file); @@ -2166,6 +2243,939 @@ v850_elf_fake_sections (abfd, hdr, sec) return true; } + +/* Delete some bytes from a section while relaxing. */ + +static boolean +v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count) + bfd * abfd; + asection * sec; + bfd_vma addr; + bfd_vma toaddr; + int count; +{ + Elf_Internal_Shdr * symtab_hdr; + Elf32_External_Sym * extsyms; + Elf32_External_Sym * esym; + Elf32_External_Sym * esymend; + int index; + unsigned int sec_shndx; + bfd_byte * contents; + Elf_Internal_Rela * irel; + Elf_Internal_Rela * irelend; + struct elf_link_hash_entry * sym_hash; + Elf_Internal_Shdr * shndx_hdr; + Elf_External_Sym_Shndx * shndx; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + /* The deletion must stop at the next ALIGN reloc for an alignment + power larger than the number of bytes we are deleting. */ + + /* Actually delete the bytes. */ +#if (DEBUG_RELAX & 2) + fprintf (stderr, "relax_delete: contents: sec: %s %p .. %p %x\n", + sec->name, addr, toaddr, count ); +#endif + memmove (contents + addr, contents + addr + count, + toaddr - addr - count); + memset (contents + toaddr-count, 0, count); + + /* Adjust all the relocs. */ + irel = elf_section_data (sec)->relocs; + irelend = irel + sec->reloc_count; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; + + for (; irel < irelend; irel++) + { + bfd_vma raddr, paddr, symval; + Elf_Internal_Sym isym; + + /* Get the new reloc address. */ + raddr = irel->r_offset; + if ((raddr >= (addr + count) && raddr < toaddr)) + irel->r_offset -= count; + + if (raddr >= addr && raddr < addr + count) + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + (int) R_V850_NONE); + continue; + } + + if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_ALIGN) + continue; + + bfd_elf32_swap_symbol_in (abfd, + extsyms + ELF32_R_SYM (irel->r_info), + shndx ? shndx + ELF32_R_SYM (irel->r_info) : NULL, + & isym); + + if (isym.st_shndx != sec_shndx) + continue; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + symval = isym.st_value; +#if (DEBUG_RELAX & 2) + { + char * name = bfd_elf_string_from_elf_section + (abfd, symtab_hdr->sh_link, isym.st_name); + fprintf (stderr, + "relax_delete: local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sec->name, name, isym.st_name, + sec->output_section->vma, sec->output_offset, + isym.st_value, irel->r_addend); + } +#endif + } + else + { + unsigned long indx; + struct elf_link_hash_entry * h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + + h = elf_sym_hashes (abfd) [indx]; + BFD_ASSERT (h != NULL); + + symval = h->root.u.def.value; +#if (DEBUG_RELAX & 2) + fprintf (stderr, + "relax_delete: defined: sec: %s, name: %s, value: %x + %x + %x addend %x\n", + sec->name, h->root.root.string, h->root.u.def.value, + sec->output_section->vma, sec->output_offset, irel->r_addend); +#endif + } + + paddr = symval + irel->r_addend; + + if ( (symval >= addr + count && symval < toaddr) + && (paddr < addr + count || paddr >= toaddr)) + irel->r_addend += count; + else if ( (symval < addr + count || symval >= toaddr) + && (paddr >= addr + count && paddr < toaddr)) + irel->r_addend -= count; + } + + /* Adjust the local symbols defined in this section. */ + esym = extsyms; + esymend = esym + symtab_hdr->sh_info; + + for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + { + Elf_Internal_Sym isym; + + bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym); + + if (isym.st_shndx == sec_shndx + && isym.st_value >= addr + count + && isym.st_value < toaddr) + { + isym.st_value -= count; + + if (isym.st_value + isym.st_size >= toaddr) + isym.st_size += count; + + bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym); + } + else if (isym.st_shndx == sec_shndx + && isym.st_value < addr + count) + { + if (isym.st_value+isym.st_size >= addr + count + && isym.st_value+isym.st_size < toaddr) + isym.st_size -= count; + + if (isym.st_value >= addr + && isym.st_value < addr + count) + isym.st_value = addr; + + bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym); + } + } + + /* Now adjust the global symbols defined in this section. */ + esym = extsyms + symtab_hdr->sh_info; + esymend = extsyms + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)); + + for (index = 0; esym < esymend; esym ++, index ++) + { + Elf_Internal_Sym isym; + + bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym); + sym_hash = elf_sym_hashes (abfd) [index]; + + if (isym.st_shndx == sec_shndx + && ((sym_hash)->root.type == bfd_link_hash_defined + || (sym_hash)->root.type == bfd_link_hash_defweak) + && (sym_hash)->root.u.def.section == sec + && (sym_hash)->root.u.def.value >= addr + count + && (sym_hash)->root.u.def.value < toaddr) + { + if ((sym_hash)->root.u.def.value + isym.st_size >= toaddr) + { + isym.st_size += count; + bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym); + } + + (sym_hash)->root.u.def.value -= count; + } + else if (isym.st_shndx == sec_shndx + && ((sym_hash)->root.type == bfd_link_hash_defined + || (sym_hash)->root.type == bfd_link_hash_defweak) + && (sym_hash)->root.u.def.section == sec + && (sym_hash)->root.u.def.value < addr + count) + { + if ((sym_hash)->root.u.def.value+isym.st_size >= addr + count + && (sym_hash)->root.u.def.value+isym.st_size < toaddr) + isym.st_size -= count; + + if ((sym_hash)->root.u.def.value >= addr + && (sym_hash)->root.u.def.value < addr + count) + (sym_hash)->root.u.def.value = addr; + + bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym); + } + + if (shndx) + ++ shndx; + } + + return true; +} + +#define NOP_OPCODE (0x0000) +#define MOVHI 0x0640 /* 4byte */ +#define MOVHI_MASK 0x07e0 +#define MOVHI_R1(insn) ((insn) & 0x1f) /* 4byte */ +#define MOVHI_R2(insn) ((insn) >> 11) +#define MOVEA 0x0620 /* 2byte */ +#define MOVEA_MASK 0x07e0 +#define MOVEA_R1(insn) ((insn) & 0x1f) +#define MOVEA_R2(insn) ((insn) >> 11) +#define JARL_4 0x00040780 /* 4byte */ +#define JARL_4_MASK 0xFFFF07FF +#define JARL_R2(insn) (int)(((insn) & (~JARL_4_MASK)) >> 11) +#define ADD_I 0x0240 /* 2byte */ +#define ADD_I_MASK 0x07e0 +#define ADD_I5(insn) ((((insn) & 0x001f) << 11) >> 11) /* 2byte */ +#define ADD_R2(insn) ((insn) >> 11) +#define JMP_R 0x0060 /* 2byte */ +#define JMP_R_MASK 0xFFE0 +#define JMP_R1(insn) ((insn) & 0x1f) + +static boolean +v850_elf_relax_section (abfd, sec, link_info, again) + bfd * abfd; + asection * sec; + struct bfd_link_info * link_info; + boolean * again; +{ + Elf_Internal_Shdr * symtab_hdr; + Elf_Internal_Rela * internal_relocs; + Elf_Internal_Rela * free_relocs = NULL; + Elf_Internal_Rela * irel; + Elf_Internal_Rela * irelend; + Elf_Internal_Rela * irelalign = NULL; + bfd_byte * contents = NULL; + bfd_byte * free_contents = NULL; + Elf32_External_Sym * extsyms = NULL; + Elf32_External_Sym * free_extsyms = NULL; + bfd_vma addr = 0; + bfd_vma toaddr; + int align_pad_size = 0; + Elf_Internal_Shdr * shndx_hdr = NULL; + Elf_External_Sym_Shndx * shndx_buf = NULL; + + * again = false; + + if (link_info->relocateable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0) + return true; + + /* If this is the first time we have been called + for this section, initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = & elf_tdata (abfd)->symtab_hdr; + + internal_relocs = (_bfd_elf32_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + irelend = internal_relocs + sec->reloc_count; + + while (addr < sec->_cooked_size) + { + toaddr = sec->_cooked_size; + + for (irel = internal_relocs; irel < irelend; irel ++) + if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_ALIGN + && irel->r_offset > addr + && irel->r_offset < toaddr) + toaddr = irel->r_offset; + +#ifdef DEBUG_RELAX + fprintf (stderr, "relax region 0x%x to 0x%x align pad %d\n", + addr, toaddr, align_pad_size); +#endif + if (irelalign) + { + bfd_vma alignto; + bfd_vma alignmoveto; + + alignmoveto = BFD_ALIGN (addr - align_pad_size, 1 << irelalign->r_addend); + alignto = BFD_ALIGN (addr, 1 << irelalign->r_addend); + + if (alignmoveto < alignto) + { + unsigned int i; + + align_pad_size = alignto - alignmoveto; +#ifdef DEBUG_RELAX + fprintf (stderr, "relax move region 0x%x to 0x%x delete size 0x%x\n", + alignmoveto, toaddr, align_pad_size); +#endif + if (!v850_elf_relax_delete_bytes (abfd, sec, alignmoveto, + toaddr, align_pad_size)) + goto error_return; + + for (i = BFD_ALIGN (toaddr - align_pad_size, 1); + (i + 1) < toaddr; i += 2) + bfd_put_16 (abfd, NOP_OPCODE, contents + i); + + addr = alignmoveto; + } + else + align_pad_size = 0; + } + + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma laddr; + bfd_vma addend; + bfd_vma symval; + int insn[5]; + int no_match = -1; + Elf_Internal_Rela * hi_irelfn; + Elf_Internal_Rela * lo_irelfn; + Elf_Internal_Rela * irelcall; + bfd_signed_vma foff; + + if (! (irel->r_offset >= addr && irel->r_offset < toaddr + && (ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGCALL + || ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGJUMP))) + continue; + +#ifdef DEBUG_RELAX + fprintf (stderr, "relax check r_info 0x%x r_offset 0x%x r_addend 0x%x\n", + irel->r_info, + irel->r_offset, + irel->r_addend ); +#endif + + /* Get the section contents. */ + if (contents == NULL) + { + 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 error_return; + + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + } + + /* Read this BFD's symbols if we haven't done so already. */ + if (extsyms == NULL) + { + /* Get cached copy if it exists. */ + if (symtab_hdr->contents != NULL) + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + else + { + /* Go get them off disk. */ + bfd_size_type amt; + + amt = symtab_hdr->sh_info; + amt *= sizeof (Elf32_External_Sym); + extsyms = (Elf32_External_Sym *) bfd_malloc (amt); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) extsyms, amt, abfd) != amt) + goto error_return; + } + + if (shndx_hdr->sh_size != 0) + { + bfd_size_type amt; + + amt = symtab_hdr->sh_info; + amt *= sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL) + goto error_return; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + goto error_return; + } + } + + laddr = irel->r_offset; + + if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGCALL) + { + /* Check code for -mlong-calls output. */ + if (laddr + 16 <= (bfd_vma) sec->_raw_size) + { + insn[0] = bfd_get_16 (abfd, contents + laddr); + insn[1] = bfd_get_16 (abfd, contents + laddr + 4); + insn[2] = bfd_get_32 (abfd, contents + laddr + 8); + insn[3] = bfd_get_16 (abfd, contents + laddr + 12); + insn[4] = bfd_get_16 (abfd, contents + laddr + 14); + + if ((insn[0] & MOVHI_MASK) != MOVHI + || MOVHI_R1 (insn[0]) != 0) + no_match = 0; + + if (no_match < 0 + && ((insn[1] & MOVEA_MASK) != MOVEA + || MOVHI_R2 (insn[0]) != MOVEA_R1 (insn[1]))) + no_match = 1; + + if (no_match < 0 + && (insn[2] & JARL_4_MASK) != JARL_4) + no_match = 2; + + if (no_match < 0 + && ((insn[3] & ADD_I_MASK) != ADD_I + || ADD_I5 (insn[3]) != 4 + || JARL_R2 (insn[2]) != ADD_R2 (insn[3]))) + no_match = 3; + + if (no_match < 0 + && ((insn[4] & JMP_R_MASK) != JMP_R + || MOVEA_R2 (insn[1]) != JMP_R1 (insn[4]))) + no_match = 4; + } + else + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGCALL points to unrecognized insns", + bfd_get_filename (abfd), (unsigned long) irel->r_offset)); + + continue; + } + + if (no_match >= 0) + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGCALL points to unrecognized insn 0x%x", + bfd_get_filename (abfd), (unsigned long) irel->r_offset+no_match, insn[no_match])); + + continue; + } + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + for (hi_irelfn = internal_relocs; hi_irelfn < irelend; hi_irelfn ++) + if (hi_irelfn->r_offset == laddr + 2 + && ELF32_R_TYPE (hi_irelfn->r_info) + == (int) R_V850_HI16_S) + break; + + for (lo_irelfn = internal_relocs; lo_irelfn < irelend; lo_irelfn ++) + if (lo_irelfn->r_offset == laddr + 6 + && ELF32_R_TYPE (lo_irelfn->r_info) + == (int) R_V850_LO16) + break; + + for (irelcall = internal_relocs; irelcall < irelend; irelcall ++) + if (irelcall->r_offset == laddr + 8 + && ELF32_R_TYPE (irelcall->r_info) + == (int) R_V850_22_PCREL) + break; + + if ( hi_irelfn == irelend + || lo_irelfn == irelend + || irelcall == irelend) + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGCALL points to unrecognized reloc", + bfd_get_filename (abfd), (unsigned long) irel->r_offset )); + + continue; + } + + if (ELF32_R_SYM (irelcall->r_info) < symtab_hdr->sh_info) + { + unsigned int r_index; + Elf_Internal_Sym isym; + asection * sym_sec; + Elf32_External_Sym * esym; + Elf_External_Sym_Shndx * shndx; + + /* A local symbol. */ + r_index = ELF32_R_SYM (irelcall->r_info); + esym = extsyms + r_index; + shndx = shndx_buf + (shndx_buf ? r_index : 0); + bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym); + + if (isym.st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + 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; + } + else + { + unsigned long indx; + struct elf_link_hash_entry * h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irelcall->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if ( h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + + symval = h->root.u.def.value; + } + + if (symval + irelcall->r_addend != irelcall->r_offset + 4) + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGCALL points to unrecognized reloc 0x%lx", + bfd_get_filename (abfd), (unsigned long) irel->r_offset, irelcall->r_offset )); + + continue; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info) + { + unsigned int r_index; + Elf_Internal_Sym isym; + asection * sym_sec; + Elf32_External_Sym * esym; + Elf_External_Sym_Shndx * shndx; + + /* A local symbol. */ + r_index = ELF32_R_SYM (irel->r_info); + esym = extsyms + r_index; + shndx = shndx_buf + (shndx_buf ? r_index : 0); + bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym); + + if (isym.st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + 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); + } + else + { + unsigned long indx; + struct elf_link_hash_entry * h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if ( h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + addend = irel->r_addend; + + foff = (symval + addend + - (irel->r_offset + + sec->output_section->vma + + sec->output_offset + + 4)); +#ifdef DEBUG_RELAX + fprintf (stderr, "relax longcall r_offset 0x%x ptr 0x%x symbol 0x%x addend 0x%x distance 0x%x\n", + irel->r_offset, + (irel->r_offset + + sec->output_section->vma + + sec->output_offset), + symval, addend, foff); +#endif + + if (foff < -0x100000 || foff >= 0x100000) + /* After all that work, we can't shorten this function call. */ + continue; + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + /* Replace the long call with a jarl. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_V850_22_PCREL); + + addend = 0; + + if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info) + /* If this needs to be changed because of future relaxing, + it will be handled here like other internal IND12W + relocs. */ + bfd_put_32 (abfd, + 0x00000780 | (JARL_R2 (insn[2])<<11) | ((addend << 16) & 0xffff) | ((addend >> 16) & 0xf), + contents + irel->r_offset); + else + /* We can't fully resolve this yet, because the external + symbol value may be changed by future relaxing. + We let the final link phase handle it. */ + bfd_put_32 (abfd, 0x00000780 | (JARL_R2 (insn[2])<<11), + contents + irel->r_offset); + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_V850_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_V850_NONE); + irelcall->r_info = + ELF32_R_INFO (ELF32_R_SYM (irelcall->r_info), R_V850_NONE); + + if (! v850_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 4, toaddr, 12)) + goto error_return; + + align_pad_size += 12; + } + else if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGJUMP) + { + /* Check code for -mlong-jumps output. */ + if (laddr + 10 <= (bfd_vma) sec->_raw_size) + { + insn[0] = bfd_get_16 (abfd, contents + laddr); + insn[1] = bfd_get_16 (abfd, contents + laddr + 4); + insn[2] = bfd_get_16 (abfd, contents + laddr + 8); + + if ((insn[0] & MOVHI_MASK) != MOVHI + || MOVHI_R1 (insn[0]) != 0) + no_match = 0; + + if (no_match < 0 + && ((insn[1] & MOVEA_MASK) != MOVEA + || MOVHI_R2 (insn[0]) != MOVEA_R1 (insn[1]))) + no_match = 1; + + if (no_match < 0 + && ((insn[2] & JMP_R_MASK) != JMP_R + || MOVEA_R2 (insn[1]) != JMP_R1 (insn[2]))) + no_match = 4; + } + else + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGJUMP points to unrecognized insns", + bfd_get_filename (abfd), (unsigned long) irel->r_offset)); + + continue; + } + + if (no_match >= 0) + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGJUMP points to unrecognized insn 0x%x", + bfd_get_filename (abfd), (unsigned long) irel->r_offset+no_match, insn[no_match])); + + continue; + } + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + for (hi_irelfn = internal_relocs; hi_irelfn < irelend; hi_irelfn ++) + if (hi_irelfn->r_offset == laddr + 2 + && ELF32_R_TYPE (hi_irelfn->r_info) == (int) R_V850_HI16_S) + break; + + for (lo_irelfn = internal_relocs; lo_irelfn < irelend; lo_irelfn ++) + if (lo_irelfn->r_offset == laddr + 6 + && ELF32_R_TYPE (lo_irelfn->r_info) == (int) R_V850_LO16) + break; + + if ( hi_irelfn == irelend + || lo_irelfn == irelend) + { + ((*_bfd_error_handler) + ("%s: 0x%lx: warning: R_V850_LONGJUMP points to unrecognized reloc", + bfd_get_filename (abfd), (unsigned long) irel->r_offset )); + + continue; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info) + { + unsigned int r_index; + Elf_Internal_Sym isym; + asection * sym_sec; + Elf32_External_Sym * esym; + Elf_External_Sym_Shndx * shndx; + + /* A local symbol. */ + r_index = ELF32_R_SYM (irel->r_info); + esym = extsyms + r_index; + shndx = shndx_buf + (shndx_buf ? r_index : 0); + bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym); + + if (isym.st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + 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); +#ifdef DEBUG_RELAX + { + char * name = bfd_elf_string_from_elf_section + (abfd, symtab_hdr->sh_link, isym.st_name); + + fprintf (stderr, "relax long jump local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sym_sec->name, name, isym.st_name, + sym_sec->output_section->vma, sym_sec->output_offset, + isym.st_value, irel->r_addend); + } +#endif + } + else + { + unsigned long indx; + struct elf_link_hash_entry * h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if ( h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); +#ifdef DEBUG_RELAX + fprintf (stderr, + "relax longjump defined: sec: %s, name: %s, value: %x + %x + %x addend %x\n", + sec->name, h->root.root.string, h->root.u.def.value, + sec->output_section->vma, sec->output_offset, irel->r_addend); +#endif + } + + addend = irel->r_addend; + + foff = (symval + addend + - (irel->r_offset + + sec->output_section->vma + + sec->output_offset + + 4)); +#ifdef DEBUG_RELAX + fprintf (stderr, "relax longjump r_offset 0x%x ptr 0x%x symbol 0x%x addend 0x%x distance 0x%x\n", + irel->r_offset, + (irel->r_offset + + sec->output_section->vma + + sec->output_offset), + symval, addend, foff); +#endif + if (foff < -0x100000 || foff >= 0x100000) + /* After all that work, we can't shorten this function call. */ + continue; + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + if (foff < -0x100 || foff >= 0x100) + { + /* Replace the long jump with a jr. */ + + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_V850_22_PCREL); + + irel->r_addend = addend; + addend = 0; + + if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info) + /* If this needs to be changed because of future relaxing, + it will be handled here like other internal IND12W + relocs. */ + bfd_put_32 (abfd, + 0x00000780 | ((addend << 15) & 0xffff0000) | ((addend >> 17) & 0xf), + contents + irel->r_offset); + else + /* We can't fully resolve this yet, because the external + symbol value may be changed by future relaxing. + We let the final link phase handle it. */ + bfd_put_32 (abfd, 0x00000780, contents + irel->r_offset); + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_V850_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_V850_NONE); + if (!v850_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 4, toaddr, 6)) + goto error_return; + + align_pad_size += 6; + } + else + { + /* Replace the long jump with a br. */ + + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_V850_9_PCREL); + + irel->r_addend = addend; + addend = 0; + + if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info) + /* If this needs to be changed because of future relaxing, + it will be handled here like other internal IND12W + relocs. */ + bfd_put_16 (abfd, + 0x0585 | ((addend << 10) & 0xf800) | ((addend << 3) & 0x0070), + contents + irel->r_offset); + else + /* We can't fully resolve this yet, because the external + symbol value may be changed by future relaxing. + We let the final link phase handle it. */ + bfd_put_16 (abfd, 0x0585, contents + irel->r_offset); + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_V850_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_V850_NONE); + if (!v850_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 2, toaddr, 8)) + goto error_return; + + align_pad_size += 8; + } + } + } + + irelalign = NULL; + for (irel = internal_relocs; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_ALIGN + && irel->r_offset == toaddr) + { + irel->r_offset -= align_pad_size; + + if (irelalign == NULL || irelalign->r_addend > irel->r_addend) + irelalign = irel; + } + } + + addr = toaddr; + } + + if (!irelalign) + { +#ifdef DEBUG_RELAX + fprintf (stderr, "relax pad %d shorten %d -> %d\n", + align_pad_size, + sec->_cooked_size, + sec->_cooked_size - align_pad_size); +#endif + sec->_cooked_size -= align_pad_size; + } + + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + + if (free_contents != NULL) + free (free_contents); + + if (free_extsyms != NULL) + free (free_extsyms); + + return false; +} #define TARGET_LITTLE_SYM bfd_elf32_v850_vec #define TARGET_LITTLE_NAME "elf32-v850" @@ -2198,6 +3208,7 @@ v850_elf_fake_sections (abfd, hdr, sec) #define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data +#define bfd_elf32_bfd_relax_section v850_elf_relax_section #define elf_symbol_leading_char '_' diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 616fbd496af..d9f86260b49 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1952,7 +1952,8 @@ static boolean create_got_section static boolean ppc64_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static void ppc64_elf_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean ppc64_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -2440,7 +2441,8 @@ ppc64_elf_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc64_elf_copy_indirect_symbol (dir, ind) +ppc64_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct ppc_link_hash_entry *edir, *eind; @@ -2486,7 +2488,7 @@ ppc64_elf_copy_indirect_symbol (dir, ind) edir->is_func_descriptor |= eind->is_func_descriptor; edir->is_entry |= eind->is_entry; - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Set a flag, used by ppc64_elf_gc_mark_hook, on the entry symbol and diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 5f2a16e2143..296e3493200 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -40,7 +40,8 @@ static boolean create_got_section static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -508,7 +509,8 @@ elf_s390_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -550,7 +552,7 @@ elf_s390_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index ba5df98ce1b..4fb695f1011 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -2423,6 +2423,9 @@ sh_elf64_gc_mark_hook (sec, info, rel, h, sym) break; default: + while (h->root.type == bfd_link_hash_indirect + && h->root.u.i.link) + h = (struct elf_link_hash_entry *) h->root.u.i.link; switch (h->root.type) { case bfd_link_hash_defined: @@ -3016,7 +3019,7 @@ static const bfd_byte elf_sh64_plt0_entry_be[PLT_ENTRY_SIZE] = 0xc8, 0x00, 0x01, 0x10, /* shori (.got.plt >> 16) & 65535, r17 */ 0xc8, 0x00, 0x01, 0x10, /* shori .got.plt & 65535, r17 */ 0x8d, 0x10, 0x09, 0x90, /* ld.q r17, 16, r25 */ - 0x6b, 0xf1, 0x46, 0x00, /* ptabs r17, tr0 */ + 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x8d, 0x10, 0x05, 0x10, /* ld.q r17, 8, r17 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ @@ -3036,7 +3039,7 @@ static const bfd_byte elf_sh64_plt0_entry_le[PLT_ENTRY_SIZE] = 0x10, 0x01, 0x00, 0xc8, /* shori (.got.plt >> 16) & 65535, r17 */ 0x10, 0x01, 0x00, 0xc8, /* shori .got.plt & 65535, r17 */ 0x90, 0x09, 0x10, 0x8d, /* ld.q r17, 16, r25 */ - 0x00, 0x46, 0xf1, 0x6b, /* ptabs r17, tr0 */ + 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0x10, 0x05, 0x10, 0x8d, /* ld.q r17, 8, r17 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ @@ -3062,9 +3065,9 @@ static const bfd_byte elf_sh64_plt_entry_be[PLT_ENTRY_SIZE] = 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ - 0xcc, 0x00, 0x01, 0x90, /* movi .PLT0 >> 16, r25 */ - 0xc8, 0x00, 0x01, 0x90, /* shori .PLT0 & 65535, r25 */ - 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ + 0xcc, 0x00, 0x01, 0x90, /* movi (.+8-.PLT0) >> 16, r25 */ + 0xc8, 0x00, 0x01, 0x90, /* shori (.+4-.PLT0) & 65535, r25 */ + 0x6b, 0xf5, 0x66, 0x00, /* ptrel r25, tr0 */ 0xcc, 0x00, 0x01, 0x50, /* movi reloc-offset >> 16, r21 */ 0xc8, 0x00, 0x01, 0x50, /* shori reloc-offset & 65535, r21 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ @@ -3082,9 +3085,9 @@ static const bfd_byte elf_sh64_plt_entry_le[PLT_ENTRY_SIZE] = 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ - 0x90, 0x01, 0x00, 0xcc, /* movi .PLT0 >> 16, r25 */ - 0x90, 0x01, 0x00, 0xc8, /* shori .PLT0 & 65535, r25 */ - 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ + 0x90, 0x01, 0x00, 0xcc, /* movi (.+8-.PLT0) >> 16, r25 */ + 0x90, 0x01, 0x00, 0xc8, /* shori (.+4-.PLT0) & 65535, r25 */ + 0x00, 0x66, 0xf5, 0x6b, /* ptrel r25, tr0 */ 0x50, 0x01, 0x00, 0xcc, /* movi reloc-offset >> 16, r21 */ 0x50, 0x01, 0x00, 0xc8, /* shori reloc-offset & 65535, r21 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ @@ -3714,7 +3717,7 @@ sh64_elf64_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -3805,7 +3808,8 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) The first three are reserved. */ got_offset = (plt_index + 3) * 8; - got_offset -= GOT_BIAS; + if (info->shared) + got_offset -= GOT_BIAS; /* Fill in the entry in the procedure linkage table. */ if (! info->shared) @@ -3824,8 +3828,11 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) (splt->contents + h->plt.offset + elf_sh64_plt_symbol_offset (info))); + /* Set bottom bit because its for a branch to SHmedia */ movi_shori_putval (output_bfd, - (splt->output_section->vma + splt->output_offset), + -(h->plt.offset + + elf_sh64_plt_plt0_offset (info) + 8) + | 1, (splt->contents + h->plt.offset + elf_sh64_plt_plt0_offset (info))); } @@ -3844,7 +3851,8 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) + elf_sh64_plt_symbol_offset (info))); } - got_offset += GOT_BIAS; + if (info->shared) + got_offset += GOT_BIAS; movi_shori_putval (output_bfd, plt_index * sizeof (Elf64_External_Rela), @@ -3987,6 +3995,7 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) Elf_Internal_Dyn dyn; const char *name; asection *s; + struct elf_link_hash_entry *h; bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); @@ -3995,6 +4004,25 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) default: break; + case DT_INIT: + name = info->init_function; + goto get_sym; + + case DT_FINI: + name = info->fini_function; + get_sym: + if (dyn.d_un.d_val != 0) + { + h = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + if (h != NULL && (h->other & STO_SH5_ISA32)) + { + dyn.d_un.d_val |= 1; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; + case DT_PLTGOT: name = ".got"; goto get_vma; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index b6cce8eef99..9c4a9d4ec18 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -134,7 +134,8 @@ static boolean create_got_section static boolean elf64_x86_64_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf64_x86_64_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf64_x86_64_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); @@ -494,7 +495,8 @@ elf64_x86_64_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf64_x86_64_copy_indirect_symbol (dir, ind) +elf64_x86_64_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf64_x86_64_link_hash_entry *edir, *eind; @@ -536,7 +538,7 @@ elf64_x86_64_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static boolean diff --git a/bfd/elflink.h b/bfd/elflink.h index d849478a8af..638f80af266 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -899,19 +899,19 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, /* This function is called to create an indirect symbol from the default for the symbol with the default version if needed. The - symbol is described by H, NAME, SYM, SEC, VALUE, and OVERRIDE. We + symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED indicates if it comes from a DT_NEEDED entry of a shared object. */ static boolean -elf_add_default_symbol (abfd, info, h, name, sym, sec, value, +elf_add_default_symbol (abfd, info, h, name, sym, psec, value, dynsym, override, dt_needed) bfd *abfd; struct bfd_link_info *info; struct elf_link_hash_entry *h; const char *name; Elf_Internal_Sym *sym; - asection **sec; + asection **psec; bfd_vma *value; boolean *dynsym; boolean override; @@ -926,6 +926,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, boolean dynamic; char *p; size_t len, shortlen; + asection *sec; /* If this symbol has a version, and it is the default version, we create an indirect symbol from the default name to the fully @@ -970,7 +971,8 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, actually going to define an indirect symbol. */ type_change_ok = false; size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + sec = *psec; + if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, &hi, &override, &type_change_ok, &size_change_ok, dt_needed)) return false; @@ -1042,7 +1044,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, | ELF_LINK_HASH_DEF_REGULAR)) == 0); ht = (struct elf_link_hash_entry *) hi->root.u.i.link; - (*bed->elf_backend_copy_indirect_symbol) (ht, hi); + (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi); /* See if the new flags lead us to realize that the symbol must be dynamic. */ @@ -1077,7 +1079,8 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, /* Once again, merge with any existing symbol. */ type_change_ok = false; size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + sec = *psec; + if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, &hi, &override, &type_change_ok, &size_change_ok, dt_needed)) return false; @@ -1113,7 +1116,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_DEF_REGULAR)) == 0); - (*bed->elf_backend_copy_indirect_symbol) (h, hi); + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); /* See if the new flags lead us to realize that the symbol must be dynamic. */ @@ -3065,8 +3068,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } free (newname); - /* Mark this version if there is a definition. */ + /* Mark this version if there is a definition and it is + not defined in a shared object. */ if (newh != NULL + && ((newh->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) == 0) && (newh->root.type == bfd_link_hash_defined || newh->root.type == bfd_link_hash_defweak)) d->symver = 1; @@ -3897,7 +3903,7 @@ elf_fix_symbol_flags (h, eif) struct elf_backend_data *bed; bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - (*bed->elf_backend_copy_indirect_symbol) (weakdef, h); + (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h); } } diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 4de90dffc42..dca8b45cd34 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -207,7 +207,8 @@ static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); static void elfNN_ia64_hash_copy_indirect - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static void elfNN_ia64_hash_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); static struct bfd_link_hash_table *elfNN_ia64_hash_table_create @@ -1602,7 +1603,8 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string) } static void -elfNN_ia64_hash_copy_indirect (xdir, xind) +elfNN_ia64_hash_copy_indirect (bed, xdir, xind) + struct elf_backend_data *bed ATTRIBUTE_UNUSED; struct elf_link_hash_entry *xdir, *xind; { struct elfNN_ia64_link_hash_entry *dir, *ind; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index df035315d3e..51326934ffd 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -1486,7 +1486,7 @@ mips_elf_got_page (abfd, info, value, offsetp) g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - /* Look to see if we aleady have an appropriate entry. */ + /* Look to see if we already have an appropriate entry. */ last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno; for (entry = (sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); @@ -1639,7 +1639,7 @@ mips_elf_sort_hash_table (info, max_local) &hsd); /* There should have been enough room in the symbol table to - accomodate both the GOT and non-GOT symbols. */ + accommodate both the GOT and non-GOT symbols. */ BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); /* Now we know which dynamic symbol has the lowest dynamic symbol @@ -3959,7 +3959,7 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info) return false; } - /* Change aligments of some sections. */ + /* Change alignments of some sections. */ s = bfd_get_section_by_name (abfd, ".hash"); if (s != NULL) bfd_set_section_alignment (abfd, s, 4); @@ -6107,9 +6107,9 @@ _bfd_mips_elf_modify_segment_map (abfd) /* For IRIX 6, we don't have .mdebug sections, nor does anything but .dynamic end up in PT_DYNAMIC. However, we do have to insert a - PT_OPTIONS segement immediately following the program header + PT_OPTIONS segment immediately following the program header table. */ - if (ABI_64_P (abfd)) + if (NEWABI_P (abfd)) { for (s = abfd->sections; s; s = s->next) if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS) @@ -6122,7 +6122,7 @@ _bfd_mips_elf_modify_segment_map (abfd) /* Usually, there's a program header table. But, sometimes there's not (like when running the `ld' testsuite). So, if there's no program header table, we just put the - options segement at the end. */ + options segment at the end. */ for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next) @@ -6369,12 +6369,13 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs) _bfd_elf_link_hash_copy_indirect copy the flags for us. */ void -_bfd_mips_elf_copy_indirect_symbol (dir, ind) +_bfd_mips_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct mips_elf_link_hash_entry *dirmips, *indmips; - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); if (ind->root.type != bfd_link_hash_indirect) return; @@ -6791,7 +6792,7 @@ _bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order, asymbol *sym = *(*parent)->sym_ptr_ptr; if (bfd_is_abs_section (sym->section) && abfd) { - /* The special_function wouldn't get called anyways. */ + /* The special_function wouldn't get called anyway. */ } else if (!gp_found) { diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 2bdaacc2016..2c8ac2f2fb4 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -68,7 +68,8 @@ extern boolean _bfd_mips_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); extern void _bfd_mips_elf_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); extern void _bfd_mips_elf_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); extern boolean _bfd_mips_elf_ignore_discarded_relocs diff --git a/bfd/libbfd.h b/bfd/libbfd.h index f7c8cc15569..e855db196a1 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1041,7 +1041,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET", "BFD_RELOC_V850_CALLT_6_7_OFFSET", "BFD_RELOC_V850_CALLT_16_16_OFFSET", - + "BFD_RELOC_V850_LONGCALL", + "BFD_RELOC_V850_LONGJUMP", + "BFD_RELOC_V850_ALIGN", "BFD_RELOC_MN10300_32_PCREL", "BFD_RELOC_MN10300_16_PCREL", "BFD_RELOC_TIC30_LDP", @@ -1218,6 +1220,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M68HC11_HI8", "BFD_RELOC_M68HC11_LO8", "BFD_RELOC_M68HC11_3B", + "BFD_RELOC_M68HC11_RL_JUMP", + "BFD_RELOC_M68HC11_RL_GROUP", + "BFD_RELOC_M68HC11_LO16", + "BFD_RELOC_M68HC11_PAGE", + "BFD_RELOC_M68HC11_24", "BFD_RELOC_CRIS_BDISP8", "BFD_RELOC_CRIS_UNSIGNED_5", "BFD_RELOC_CRIS_SIGNED_6", diff --git a/bfd/po/tr.po b/bfd/po/tr.po index 80dc9e11867..092c0ac5a0c 100644 --- a/bfd/po/tr.po +++ b/bfd/po/tr.po @@ -4,171 +4,171 @@ # msgid "" msgstr "" -"Project-Id-Version: bfd 2.12-pre020121\n" -"POT-Creation-Date: 2002-01-17 12:55+0000\n" -"PO-Revision-Date: 2002-01-24 13:11EET\n" +"Project-Id-Version: bfd 2.12.91\n" +"POT-Creation-Date: 2002-07-23 15:55-0400\n" +"PO-Revision-Date: 2002-08-10 13:11EET\n" "Last-Translator: Deniz Akkus Kanca \n" "Language-Team: Turkish \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-9\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.9.5\n" -#: aout-adobe.c:196 +#: aout-adobe.c:197 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" -msgstr "%s: a.out.adobe dosyasýnda bilinmeyen bölüm türü: %x\n" +msgstr "%s: a.out.adobe dosyasında bilinmeyen bölüm türü: %x\n" #: aout-cris.c:208 #, c-format msgid "%s: Invalid relocation type exported: %d" -msgstr "%s: Geçersiz yer deðiþtirme türü ihraç edilmiþ: %d" +msgstr "%s: Geçersiz yer değiştirme türü ihraç edilmiş: %d" #: aout-cris.c:252 #, c-format msgid "%s: Invalid relocation type imported: %d" -msgstr "%s: Geçersiz yer deðiþtirme türü ithal edilmiþ: %d" +msgstr "%s: Geçersiz yer değiştirme türü ithal edilmiş: %d" #: aout-cris.c:263 #, c-format msgid "%s: Bad relocation record imported: %d" -msgstr "%s: Geçersiz yer deðiþtirme kaydý ithal edilmiþ: %d" +msgstr "%s: Geçersiz yer değiştirme kaydı ithal edilmiş: %d" #: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" -msgstr "%s: `%s' bölümü a.out nesne dosya biçeminde gösterilemez" +msgstr "%s: `%s' bölümü a.out nesne dosya biçeminde gösterilemez" #: aoutx.h:1669 #, c-format msgid "%s: can not represent section for symbol `%s' in a.out object file format" -msgstr "%s: `%s' sembol bölümü a.out nesne dosyasýnda gösterilemez" +msgstr "%s: `%s' sembol bölümü a.out nesne dosyasında gösterilemez" #: aoutx.h:1671 msgid "*unknown*" msgstr "*bilinmeyen*" -#: aoutx.h:3735 +#: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" -msgstr "%s: %s'dan %s'ya yeri deðiþtirilebilen bað desteklenmiyor" +msgstr "%s: %s'dan %s'ya yeri değiştirilebilen bağ desteklenmiyor" #: archive.c:1826 msgid "Warning: writing archive was slow: rewriting timestamp\n" -msgstr "Uyarý: arþiv yazma iþlemi yavaþ: zaman damgasý yeniden yazýlýyor\n" +msgstr "Uyarı: arşiv yazma işlemi yavaş: zaman damgası yeniden yazılıyor\n" #: archive.c:2093 msgid "Reading archive file mod timestamp" -msgstr "Arþiv dosyasý deðiþim zaman damgasý okunuyor" +msgstr "Arşiv dosyası değişim zaman damgası okunuyor" #. FIXME: bfd can't call perror. #: archive.c:2120 msgid "Writing updated armap timestamp" -msgstr "Güncellenmiþ armap zaman damgasý yazýlýyor" +msgstr "Güncellenmiş armap zaman damgası yazılıyor" -#: bfd.c:281 +#: bfd.c:274 msgid "No error" msgstr "Hata yok" -#: bfd.c:282 +#: bfd.c:275 msgid "System call error" -msgstr "Sistem çaðrý hatasý" +msgstr "Sistem çağrı hatası" -#: bfd.c:283 +#: bfd.c:276 msgid "Invalid bfd target" -msgstr "Geçersiz bfd hedefi" +msgstr "Geçersiz bfd hedefi" -#: bfd.c:284 +#: bfd.c:277 msgid "File in wrong format" -msgstr "Dosya yanlýþ biçemde" +msgstr "Dosya yanlış biçemde" -#: bfd.c:285 +#: bfd.c:278 msgid "Archive object file in wrong format" -msgstr "Arþiv nesne dosyasý yanlýþ biçemde" +msgstr "Arşiv nesne dosyası yanlış biçemde" -#: bfd.c:286 +#: bfd.c:279 msgid "Invalid operation" -msgstr "Geçersiz iþlem" +msgstr "Geçersiz işlem" -#: bfd.c:287 +#: bfd.c:280 msgid "Memory exhausted" -msgstr "Bellek tükendi" +msgstr "Bellek tükendi" -#: bfd.c:288 +#: bfd.c:281 msgid "No symbols" msgstr "Sembol yok" -#: bfd.c:289 +#: bfd.c:282 msgid "Archive has no index; run ranlib to add one" -msgstr "Arþivin indeksi yok; ranlib çalýþtýrarak indeks ekleyin" +msgstr "Arşivin indeksi yok; ranlib çalıştırarak indeks ekleyin" -#: bfd.c:290 +#: bfd.c:283 msgid "No more archived files" -msgstr "Baþka arþivlenmiþ dosya yok" +msgstr "Başka arşivlenmiş dosya yok" -#: bfd.c:291 +#: bfd.c:284 msgid "Malformed archive" -msgstr "Bozuk arþiv" +msgstr "Bozuk arşiv" -#: bfd.c:292 +#: bfd.c:285 msgid "File format not recognized" -msgstr "Dosya biçemi tanýnmýyor" +msgstr "Dosya biçemi tanınmıyor" -#: bfd.c:293 +#: bfd.c:286 msgid "File format is ambiguous" -msgstr "Dosya biçemi belirsiz" +msgstr "Dosya biçemi belirsiz" -#: bfd.c:294 +#: bfd.c:287 msgid "Section has no contents" -msgstr "Bölümde içerik yok" +msgstr "Bölümde içerik yok" -#: bfd.c:295 +#: bfd.c:288 msgid "Nonrepresentable section on output" -msgstr "Çýktýda gösterilemeyen bölüm" +msgstr "Çıktıda gösterilemeyen bölüm" -#: bfd.c:296 +#: bfd.c:289 msgid "Symbol needs debug section which does not exist" -msgstr "Sembol, olmayan hata ayýklama bölümünü istiyor" +msgstr "Sembol, olmayan hata ayıklama bölümünü istiyor" -#: bfd.c:297 +#: bfd.c:290 msgid "Bad value" -msgstr "Geçersiz deðer" +msgstr "Geçersiz değer" -#: bfd.c:298 +#: bfd.c:291 msgid "File truncated" -msgstr "Dosya budandý" +msgstr "Dosya budandı" -#: bfd.c:299 +#: bfd.c:292 msgid "File too big" -msgstr "Dosya fazla büyük" +msgstr "Dosya fazla büyük" -#: bfd.c:300 +#: bfd.c:293 msgid "#" -msgstr "#" +msgstr "#" -#: bfd.c:707 +#: bfd.c:700 #, c-format msgid "BFD %s assertion fail %s:%d" -msgstr "BFD %s, olumlama baþarýsýz %s:%d" +msgstr "BFD %s, olumlama başarısız %s:%d" -#: bfd.c:726 +#: bfd.c:719 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" -msgstr "BFD %s iç hatasý, %s'da, %d satýrý, %s içerisinde iþlem durduruldu\n" +msgstr "BFD %s iç hatası, %s'da, %d satırı, %s içerisinde işlem durduruldu\n" -#: bfd.c:730 +#: bfd.c:723 #, c-format -msgid "BFD %sinternal error, aborting at %s line %d\n" -msgstr "BFD %s iç hatasý, %s, %d satýrýnda iþlem durduruldu\n" +msgid "BFD %s internal error, aborting at %s line %d\n" +msgstr "BFD %s iç hatası, %s, %d satırında işlem durduruldu\n" -#: bfd.c:732 +#: bfd.c:725 msgid "Please report this bug.\n" -msgstr "Lütfen bu hatayý bildirin.\n" +msgstr "Lütfen bu hatayı bildirin.\n" #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." -msgstr "Uyarý: `%s' bölümü çok büyük (negatif) dosya göreli konumu 0x%lx'e yazýlýyor." +msgstr "Uyarı: `%s' bölümü çok büyük (negatif) dosya göreli konumu 0x%lx'e yazılıyor." #: coff-a29k.c:119 msgid "Missing IHCONST" @@ -178,1337 +178,1584 @@ msgstr "IHCONST yok" msgid "Missing IHIHALF" msgstr "IHIHALF yok" -#: coff-a29k.c:212 +#: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" -msgstr "Tanýnmayan yer deðiþtirme" +msgstr "Tanınmayan yer değiştirme" #: coff-a29k.c:408 msgid "missing IHCONST reloc" -msgstr "eksik IHCONST yer deðiþtirmesi" +msgstr "eksik IHCONST yer değiştirmesi" #: coff-a29k.c:498 msgid "missing IHIHALF reloc" -msgstr "eksik IHIHALF yer deðiþtirmesi" +msgstr "eksik IHIHALF yer değiştirmesi" -#: coff-alpha.c:881 coff-alpha.c:918 +#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" -msgstr "GP tanýmlanmamýþken GP göreli yer deðiþtirmesi kullanýlmýþ" +msgstr "GP tanımlanmamışken GP göreli yer değiştirmesi kullanılmış" #: coff-alpha.c:1485 msgid "using multiple gp values" -msgstr "birden fazla gp deðeri kullanýlýyor" +msgstr "birden fazla gp değeri kullanılıyor" -#: coff-alpha.c:1989 coff-mips.c:1433 -msgid "GP relative relocation when GP not defined" -msgstr "GP tanýmlanmamýþken GP göreli yer deðiþtirmesi" - -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" -msgstr "%1$s: `%3$s' için THUMB birleþtiricisi '%2$s' bulunamadý " +msgstr "%1$s: `%3$s' için THUMB birleştiricisi '%2$s' bulunamadı " -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" -msgstr "%1$s: `%3$s' için ARM birleþtiricisi '%2$s' bulunamadý" +msgstr "%1$s: `%3$s' için ARM birleştiricisi '%2$s' bulunamadı" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:887 elf32-arm.h:991 #, c-format msgid "%s(%s): warning: interworking not enabled." -msgstr "%s(%s): uyarý: beraber çalýþma kipi etkin deðil." +msgstr "%s(%s): uyarı: beraber çalışma kipi etkin değil." -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1395 elf32-arm.h:994 #, c-format msgid " first occurrence: %s: arm call to thumb" -msgstr " ilk ortaya çýkýþ: %s: thumb'a arm'dan çaðrý" +msgstr " ilk ortaya çıkış: %s: thumb'a arm'dan çağrı" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1490 elf32-arm.h:890 #, c-format msgid " first occurrence: %s: thumb call to arm" -msgstr " ilk ortaya çýkýþ: %s: arm'a thumb'dan çaðrý" +msgstr " ilk ortaya çıkış: %s: arm'a thumb'dan çağrı" -#: coff-arm.c:1477 +#: coff-arm.c:1493 msgid " consider relinking with --support-old-code enabled" -msgstr " --support-old-code seçeneði ile yeniden baðlamayý deneyin" +msgstr " --support-old-code seçeneği ile yeniden bağlamayı deneyin" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" -msgstr "%1$s: `%3$s' bölümünde geçersiz yer deðiþtirme adresi 0x%2$lx" +msgstr "%1$s: `%3$s' bölümünde geçersiz yer değiştirme adresi 0x%2$lx" -#: coff-arm.c:2107 +#: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" -msgstr "%s: yer deðiþtirmede geçersiz sembol indeksi: %d" +msgstr "%s: yer değiştirmede geçersiz sembol indeksi: %d" -#: coff-arm.c:2235 +#: coff-arm.c:2255 #, c-format -msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" -msgstr "%s: HATA: APCS-%d için derlenmiþ fakat hedef %s APCS-%d kullanýyor" +msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgstr "Hata: %s APCS-%d için derlenmiş, fakat %s APCS-%d için derlenmiş" -#: coff-arm.c:2250 +#: coff-arm.c:2270 elf32-arm.h:2297 #, c-format -msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" -msgstr "%s: HATA: kayan sayýlarý kayan yazmaçlarda geçiriyor fakat hedef %s tamsayý yazmaç kullanýyor" +msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" +msgstr "" +"Hata: %s kayan sayıları kayan sayı yazmaçlarında geçiriyor, \n" +" fakat %s tamsayı yazmaçlarında geçiriyor" -#: coff-arm.c:2253 +#: coff-arm.c:2273 elf32-arm.h:2302 #, c-format -msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" -msgstr "%s: HATA: kayan sayýlarý tamsayý yazmaçlarda geçiriyor fakat hedef %s kayan yazmaç kullanýyor" +msgid "ERROR: %s passes floats in integer registers, whereas %s passes them in float registers" +msgstr "" +"Hata: %s kayan sayıları tamsayı yazmaçlarında geçiriyor, \n" +" fakat %s kayan sayı yazmaçlarında geçiriyor" -#: coff-arm.c:2268 +#: coff-arm.c:2288 #, c-format -msgid "%s: ERROR: compiled as position independent code, whereas target %s is absolute position" -msgstr "%s: HATA: yerden baðýmsýz kod olarak derlendi, fakat hedef %s yere baðýmlý" +msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" +msgstr "HATA: %s yerden bağımsız kod olarak derlendi, fakat hedef %s yere bağımlı" -#: coff-arm.c:2271 +#: coff-arm.c:2291 #, c-format -msgid "%s: ERROR: compiled as absolute position code, whereas target %s is position independent" -msgstr "%s: HATA: yere baðýmlý kod olarak derlendi, fakat hedef %s yerden baðýmsýz" +msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" +msgstr "HATA: %s yere bağımlı kod olarak derlendi, fakat hedef %s yerden bağımsız" -#: coff-arm.c:2300 +#: coff-arm.c:2320 elf32-arm.h:2358 #, c-format -msgid "Warning: input file %s supports interworking, whereas %s does not." -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý destekliyor, fakat %s desteklemiyor." +msgid "Warning: %s supports interworking, whereas %s does not" +msgstr "Uyarı: %s girdi dosyası beraber çalışmayı destekliyor, fakat %s desteklemiyor." -#: coff-arm.c:2303 +#: coff-arm.c:2323 elf32-arm.h:2365 #, c-format -msgid "Warning: input file %s does not support interworking, whereas %s does." -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý desteklemiyor, fakat %s destekliyor." +msgid "Warning: %s does not support interworking, whereas %s does" +msgstr "Uyarı: %s girdi dosyası beraber çalışmayı desteklemiyor, fakat %s destekliyor." -#: coff-arm.c:2330 +#: coff-arm.c:2350 #, c-format msgid "private flags = %x:" -msgstr "özel bayraklar = %x:" +msgstr "özel bayraklar = %x:" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2358 elf32-arm.h:2418 msgid " [floats passed in float registers]" -msgstr " [kayan sayýlar kayan yazmaçlarda geçirildi]" +msgstr " [kayan sayılar kayan yazmaçlarda geçirildi]" -#: coff-arm.c:2340 +#: coff-arm.c:2360 msgid " [floats passed in integer registers]" -msgstr " [kayan sayýlar tamsayý yazmaçlarda geçirildi]" +msgstr " [kayan sayılar tamsayı yazmaçlarda geçirildi]" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2363 elf32-arm.h:2421 msgid " [position independent]" -msgstr " [yerden baðýmsýz]" +msgstr " [yerden bağımsız]" -#: coff-arm.c:2345 +#: coff-arm.c:2365 msgid " [absolute position]" -msgstr " [yere baðýmlý]" +msgstr " [yere bağımlı]" -#: coff-arm.c:2349 +#: coff-arm.c:2369 msgid " [interworking flag not initialised]" -msgstr " [beraber çalýþma bayraðýna öndeðer atanmamýþ]" +msgstr " [beraber çalışma bayrağına öndeğer atanmamış]" -#: coff-arm.c:2351 +#: coff-arm.c:2371 msgid " [interworking supported]" -msgstr " [beraber çalýþma destekleniyor]" +msgstr " [beraber çalışma destekleniyor]" -#: coff-arm.c:2353 +#: coff-arm.c:2373 msgid " [interworking not supported]" -msgstr " [beraber çalýþma desteklenmiyor]" +msgstr " [beraber çalışma desteklenmiyor]" -#: coff-arm.c:2401 +#: coff-arm.c:2421 elf32-arm.h:2124 #, c-format -msgid "Warning: Not setting interworking flag of %s, since it has already been specified as non-interworking" -msgstr "Uyarý: %s beraber çalýþma bayraðý atanmadý, çünkü beraber çalýþma olmayacaðý önceden belirtilmiþ" +msgid "Warning: Not setting interworking flag of %s since it has already been specified as non-interworking" +msgstr "Uyarı: %s beraber çalışma bayrağı atanmadı, çünkü beraber çalışma olmayacağı önceden belirtilmiş" -#: coff-arm.c:2405 +#: coff-arm.c:2425 elf32-arm.h:2128 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" -msgstr "Uyarý: %s beraber çalýþma bayraðý dýþ istek üzerine temizlendi" +msgstr "Uyarı: %s beraber çalışma bayrağı dış istek üzerine temizlendi" #: coff-i960.c:136 coff-i960.c:485 msgid "uncertain calling convention for non-COFF symbol" -msgstr "COFF olmayan sembol için belirsiz çaðrý davranýþý" +msgstr "COFF olmayan sembol için belirsiz çağrı davranışı" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 +#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" -msgstr "desteklenmeyen yer deðiþtirme türü" +msgstr "desteklenmeyen yer değiştirme türü" -#: coff-mips.c:875 elf32-mips.c:1987 elf64-mips.c:1739 +#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" -msgstr "_gp tanýmsýz iken GP göreli yer deðiþtirmesi" +msgstr "_gp tanımsız iken GP göreli yer değiştirmesi" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2468 +#: coff-mips.c:2466 msgid "reloc against unsupported section" -msgstr "desteklenmeyen bölümde yer deðiþtirme" +msgstr "desteklenmeyen bölümde yer değiştirme" -#: coff-mips.c:2476 +#: coff-mips.c:2474 msgid "reloc not properly aligned" -msgstr "yer deðiþtirme doðru hizalanmamýþ" +msgstr "yer değiştirme doğru hizalanmamış" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" -msgstr "%s: desteklenmeyen yükleyici yerdeðiþimi 0x%02x" +msgstr "%s: desteklenmeyen yükleyici yerdeğişimi 0x%02x" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" -msgstr "%s: 0x%x'da TOC girdisi olmayan `%s' sembolüne TOC yerdeðiþimi" +msgstr "%s: 0x%x'da TOC girdisi olmayan `%s' sembolüne TOC yerdeğişimi" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" -msgstr "%s: `%s' sembolünde bilinmeyen %d var" +msgstr "%s: `%s' sembolünde bilinmeyen %d var" #: coff-tic54x.c:279 coff-tic80.c:449 #, c-format msgid "Unrecognized reloc type 0x%x" -msgstr "Bilinmeyen yer deðiþtirme türü 0x%x" +msgstr "Bilinmeyen yer değiştirme türü 0x%x" -#: coff-tic54x.c:390 coffcode.h:4847 +#: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" -msgstr "%s: uyarý: yer deðiþtirmelerde geçersiz sembol indeksi %ld" +msgstr "%s: uyarı: yer değiştirmelerde geçersiz sembol indeksi %ld" #: coff-w65.c:363 #, c-format msgid "ignoring reloc %s\n" -msgstr "yer deðiþtirme %s yoksayýldý\n" +msgstr "yer değiştirme %s yoksayıldı\n" -#: coffcode.h:1081 +#: coffcode.h:1086 #, c-format msgid "%s (%s): Section flag %s (0x%x) ignored" -msgstr "%s (%s): Bölüm bayraðý %s (0x%x) yoksayýldý" +msgstr "%s (%s): Bölüm bayrağı %s (0x%x) yoksayıldı" -#: coffcode.h:2125 +#: coffcode.h:2143 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" -msgstr "Tanýnmayan TI COFF hedef kimliði '0x%x'" +msgstr "Tanınmayan TI COFF hedef kimliği '0x%x'" -#: coffcode.h:4236 +#: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" -msgstr "%s: uyarý: satýr numaralarýnda geçersiz sembol indeksi %ld" +msgstr "%s: uyarı: satır numaralarında geçersiz sembol indeksi %ld" -#: coffcode.h:4250 +#: coffcode.h:4379 #, c-format msgid "%s: warning: duplicate line number information for `%s'" -msgstr "%s: uyarý: `%s' için tekrarlanmýþ satýr numarasý bilgisi" +msgstr "%s: uyarı: `%s' için tekrarlanmış satır numarası bilgisi" -#: coffcode.h:4609 +#: coffcode.h:4736 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" -msgstr "%1$s: %3$s sembolü `%4$s' için bilinmeyen saklama sýnýfý %2$d" +msgstr "%1$s: %3$s sembolü `%4$s' için bilinmeyen saklama sınıfı %2$d" -#: coffcode.h:4740 +#: coffcode.h:4867 #, c-format msgid "warning: %s: local symbol `%s' has no section" -msgstr "uyarý: %s: `%s' yerel sembolünün bölümü yok" +msgstr "uyarı: %s: `%s' yerel sembolünün bölümü yok" -#: coffcode.h:4885 +#: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" -msgstr "%1$s: 0x%3$lx adresinde geçersiz yer deðiþtirme türü %2$d" +msgstr "%1$s: 0x%3$lx adresinde geçersiz yer değiştirme türü %2$d" #: coffgen.c:1661 #, c-format msgid "%s: bad string table size %lu" -msgstr "%s: geçersiz dizge tablo boyu %lu" +msgstr "%s: geçersiz dizge tablo boyu %lu" -#: coffgen.c:2138 -#, c-format -msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" -msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld sonraki %ld" - -#: cofflink.c:536 elflink.h:1967 +#: cofflink.c:534 elflink.h:1912 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" -msgstr "Uyarý: %4$s içerisinde `%1$s' sembolünün türü %2$d'den %3$d'e deðiþtirildi" +msgstr "Uyarı: %4$s içerisinde `%1$s' sembolünün türü %2$d'den %3$d'e değiştirildi" -#: cofflink.c:2317 +#: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" -msgstr "%s: `%s' bölümünde yer deðiþtirmeler mevcut, fakat içi boþ" +msgstr "%s: `%s' bölümünde yer değiştirmeler mevcut, fakat içi boş" -#: cofflink.c:2653 coffswap.h:889 +#: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" -msgstr "%s: %s: yer deðiþtirme taþmasý: 0x%lx > 0xffff" +msgstr "%s: %s: yer değiştirme taşması: 0x%lx > 0xffff" -#: cofflink.c:2662 coffswap.h:876 +#: cofflink.c:2673 coffswap.h:864 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" -msgstr "%s: uyarý: %s: satýr numarasý taþmasý: 0x%lx > 0xffff" +msgstr "%s: uyarı: %s: satır numarası taşması: 0x%lx > 0xffff" -#: dwarf2.c:381 +#: dwarf2.c:382 msgid "Dwarf Error: Can't find .debug_str section." -msgstr "Dwarf Hatasý: .debug_str bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_str bölümü bulunamadı." -#: dwarf2.c:398 +#: dwarf2.c:399 #, c-format -msgid "Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)." +msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)." msgstr "" -"Dwarf Hatasý: DW_FORM_strp göreli konumu (%u) .debug_str boyutundan (%u) \n" -" daha büyük veya eþit." +"Dwarf Hatası: DW_FORM_strp göreli konumu (%lu) .debug_str boyutundan (%lu) \n" +" daha büyük veya eşit." -#: dwarf2.c:542 +#: dwarf2.c:543 msgid "Dwarf Error: Can't find .debug_abbrev section." -msgstr "Dwarf Hatasý: .debug_abbrev bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_abbrev bölümü bulunamadı." -#: dwarf2.c:559 +#: dwarf2.c:560 #, c-format -msgid "Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)." +msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." msgstr "" -"Dwarf Hatasý: Kýsaltma göreli konumu (%u) kýsaltma boyutundan (%u) \n" -" daha büyük veya eþit." +"Dwarf Hatası: Kısaltma göreli konumu (%lu) kısaltma boyutundan (%lu) \n" +" daha büyük veya eşit." -#: dwarf2.c:756 +#: dwarf2.c:757 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." -msgstr "Dwarf Hatasý: Geçersiz veya desteklenmeyen FORM deðeri: %d." +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." +msgstr "Dwarf Hatası: Geçersiz veya desteklenmeyen FORM değeri: %u." -#: dwarf2.c:843 +#: dwarf2.c:852 msgid "Dwarf Error: mangled line number section (bad file number)." -msgstr "Dwarf Hatasý: bozulmuþ satýr numarasý bölümü (geçersiz dosya numarasý)." +msgstr "Dwarf Hatası: bozulmuş satır numarası bölümü (geçersiz dosya numarası)." -#: dwarf2.c:929 +#: dwarf2.c:938 msgid "Dwarf Error: Can't find .debug_line section." -msgstr "Dwarf Hatasý: .debug_line bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_line bölümü bulunamadı." -#: dwarf2.c:952 +#: dwarf2.c:961 #, c-format -msgid "Dwarf Error: Line offset (%u) greater than or equal to line size (%u)." +msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)." msgstr "" -"Dwarf Hatasý: Satýr göreli konumu (%u) satýr boyutundan (%u)\n" -" daha büyük veya eþit." +"Dwarf Hatası: Satır göreli konumu (%lu) satır boyutundan (%lu)\n" +" daha büyük veya eşit." -#: dwarf2.c:1143 +#: dwarf2.c:1159 msgid "Dwarf Error: mangled line number section." -msgstr "Dwarf Hatasý: bozuk satýr numarasý bölümü." +msgstr "Dwarf Hatası: bozuk satır numarası bölümü." -#: dwarf2.c:1318 dwarf2.c:1532 +#: dwarf2.c:1355 dwarf2.c:1566 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." -msgstr "Dwarf Hatasý: Kýsaltma numarasý %d bulunamadý." +msgid "Dwarf Error: Could not find abbrev number %u." +msgstr "Dwarf Hatası: Kısaltma numarası %u bulunamadı." -#: dwarf2.c:1493 +#: dwarf2.c:1527 #, c-format -msgid "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 information." -msgstr "Dwarf Hatasý: dwarf sürümü '%hu' bulundu, bu okuyucu yalnýzca sürüm 2 bilgisini anlayabiliyor." +msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information." +msgstr "Dwarf Hatası: dwarf sürümü '%u' bulundu, bu okuyucu yalnızca sürüm 2 bilgisini anlayabiliyor." -#: dwarf2.c:1500 +#: dwarf2.c:1534 #, c-format msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'." -msgstr "Dwarf Hatasý: adres boyu '%u' bulundu, bu okuyucu '%u'dan daha büyük boylarý okuyamýyor." +msgstr "Dwarf Hatası: adres boyu '%u' bulundu, bu okuyucu '%u'dan daha büyük boyları okuyamıyor." -#: dwarf2.c:1523 +#: dwarf2.c:1557 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." -msgstr "Dwarf Hatasý: Geçersiz kýsaltma numarasý: %d." +msgid "Dwarf Error: Bad abbrev number: %u." +msgstr "Dwarf Hatası: Geçersiz kısaltma numarası: %u." -#: ecoff.c:1328 +#: ecoff.c:1318 #, c-format msgid "Unknown basic type %d" -msgstr "Bilinmeyen temel tür %d" +msgstr "Bilinmeyen temel tür %d" -#: ecoff.c:1597 +#: ecoff.c:1578 #, c-format -msgid "\n End+1 symbol: %ld" -msgstr "\n Son+1 sembolü: %ld" +msgid "" +"\n" +" End+1 symbol: %ld" +msgstr "" +"\n" +" Son+1 sembolü: %ld" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1585 ecoff.c:1588 #, c-format -msgid "\n First symbol: %ld" -msgstr "\n Ýlk sembol: %ld" +msgid "" +"\n" +" First symbol: %ld" +msgstr "" +"\n" +" İlk sembol: %ld" -#: ecoff.c:1619 +#: ecoff.c:1600 #, c-format -msgid "\n End+1 symbol: %-7ld Type: %s" -msgstr "\n Son+1 sembolü: %-7ld Tür: %s" +msgid "" +"\n" +" End+1 symbol: %-7ld Type: %s" +msgstr "" +"\n" +" Son+1 sembolü: %-7ld Tür: %s" -#: ecoff.c:1626 +#: ecoff.c:1607 #, c-format -msgid "\n Local symbol: %ld" -msgstr "\n Yerel sembol: %ld" +msgid "" +"\n" +" Local symbol: %ld" +msgstr "" +"\n" +" Yerel sembol: %ld" -#: ecoff.c:1634 +#: ecoff.c:1615 #, c-format -msgid "\n struct; End+1 symbol: %ld" -msgstr "\n yapý; Son+1 sembolü: %ld" +msgid "" +"\n" +" struct; End+1 symbol: %ld" +msgstr "" +"\n" +" yapı; Son+1 sembolü: %ld" -#: ecoff.c:1639 +#: ecoff.c:1620 #, c-format -msgid "\n union; End+1 symbol: %ld" -msgstr "\n birleþim; Son+1 sembolü: %ld" +msgid "" +"\n" +" union; End+1 symbol: %ld" +msgstr "" +"\n" +" birleşim; Son+1 sembolü: %ld" -#: ecoff.c:1644 +#: ecoff.c:1625 #, c-format -msgid "\n enum; End+1 symbol: %ld" -msgstr "\n enum; Son+1 sembolü: %ld" +msgid "" +"\n" +" enum; End+1 symbol: %ld" +msgstr "" +"\n" +" enum; Son+1 sembolü: %ld" -#: ecoff.c:1650 +#: ecoff.c:1631 #, c-format -msgid "\n Type: %s" -msgstr "\n Tür: %s" +msgid "" +"\n" +" Type: %s" +msgstr "" +"\n" +" Tür: %s" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 -#: elf64-x86-64.c:1275 +#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4213 +#: elf64-sh64.c:1659 #, c-format msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %3$s bölümünden `%2$s' sembolüne çözümlenemeyen yer deðiþimi" +msgstr "%1$s: uyarı: %3$s bölümünden `%2$s' sembolüne çözümlenemeyen yer değişimi" -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 -#: elf32-cris.c:1392 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 -#: elf32-i860.c:1048 elf32-m32r.c:1281 elf32-openrisc.c:455 elf32-v850.c:1691 -#: elf64-mmix.c:1164 +#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 +#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 +#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 +#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" -msgstr "iç hata: kapsam dýþý hatasý" +msgstr "iç hata: kapsam dışı hatası" -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 -#: elf32-cris.c:1396 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 -#: elf32-i860.c:1052 elf32-m32r.c:1285 elf32-mips.c:7565 elf32-openrisc.c:459 -#: elf32-v850.c:1695 elf64-mips.c:4464 elf64-mmix.c:1168 +#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 +#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 +#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 +#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" -msgstr "iç hata: desteklenmeyen yer deðiþim hatasý" +msgstr "iç hata: desteklenmeyen yer değişim hatası" -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 -#: elf32-h8300.c:555 elf32-m32r.c:1289 +#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 +#: elf32-h8300.c:556 elf32-m32r.c:1286 msgid "internal error: dangerous error" -msgstr "iç hata: ölümcül hata" +msgstr "iç hata: ölümcül hata" -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 -#: elf32-cris.c:1404 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 -#: elf32-i860.c:1060 elf32-m32r.c:1293 elf32-openrisc.c:467 elf32-v850.c:1715 -#: elf64-mmix.c:1176 +#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2096 elf32-avr.c:845 +#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 +#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1290 elf32-openrisc.c:451 +#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 msgid "internal error: unknown error" -msgstr "iç hata: bilinmeyen hata" +msgstr "iç hata: bilinmeyen hata" -#: elf.c:345 +#: elf.c:343 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" -msgstr "%1$s: `%4$s' bölümünde geçersiz dizge göreli konumu %2$u >= %3$lu" +msgstr "%1$s: `%4$s' bölümünde geçersiz dizge göreli konumu %2$u >= %3$lu" -#: elf.c:450 +#: elf.c:589 #, c-format msgid "%s: invalid SHT_GROUP entry" -msgstr "%s: geçersiz SHT_GROUP girdisi" +msgstr "%s: geçersiz SHT_GROUP girdisi" -#: elf.c:531 +#: elf.c:660 #, c-format msgid "%s: no group info for section %s" -msgstr "%s: %s bölümünde grup bilgisi yok" +msgstr "%s: %s bölümünde grup bilgisi yok" -#: elf.c:842 -msgid "\nProgram Header:\n" -msgstr "\nYazýlým Baþlýðý:\n" +#: elf.c:1023 +msgid "" +"\n" +"Program Header:\n" +msgstr "" +"\n" +"Yazılım Başlığı:\n" -#: elf.c:891 -msgid "\nDynamic Section:\n" -msgstr "\nDinamik Bölüm:\n" +#: elf.c:1073 +msgid "" +"\n" +"Dynamic Section:\n" +msgstr "" +"\n" +"Dinamik Bölüm:\n" -#: elf.c:1020 -msgid "\nVersion definitions:\n" -msgstr "\nSürüm tanýmlarý:\n" +#: elf.c:1202 +msgid "" +"\n" +"Version definitions:\n" +msgstr "" +"\n" +"Sürüm tanımları:\n" -#: elf.c:1043 -msgid "\nVersion References:\n" -msgstr "\nSürüm Referanslarý:\n" +#: elf.c:1225 +msgid "" +"\n" +"Version References:\n" +msgstr "" +"\n" +"Sürüm Referansları:\n" -#: elf.c:1048 +#: elf.c:1230 #, c-format msgid " required from %s:\n" msgstr " %s'den isteniyor:\n" -#: elf.c:1675 +#: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" -msgstr "%1$s: yerdeðiþim bölümü %3$s (indeks %4$u) için geçersiz bað %2$lu" +msgstr "%1$s: yerdeğişim bölümü %3$s (indeks %4$u) için geçersiz bağ %2$lu" -#: elf.c:3289 +#: elf.c:3603 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" -msgstr "%s: Yazýlým baþlýklarý için yeterli yer yok (%u ayrýldý, %u gerekli)" +msgstr "%s: Yazılım başlıkları için yeterli yer yok (%u ayrıldı, %u gerekli)" -#: elf.c:3393 +#: elf.c:3708 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" -msgstr "%s: yazýlým baþlýklarý için gerekli yer yok, -N ile baðlamayý deneyin" +msgstr "%s: yazılım başlıkları için gerekli yer yok, -N ile bağlamayı deneyin" -#: elf.c:3518 +#: elf.c:3833 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x" -msgstr "Hata: Parçadaki (%s) ilk bölüm 0x%x'de, parça ise 0x%x'de baþlýyor" +msgstr "Hata: Parçadaki (%s) ilk bölüm 0x%x'de, parça ise 0x%x'de başlıyor" -#: elf.c:3804 +#: elf.c:4148 #, c-format msgid "%s: warning: allocated section `%s' not in segment" -msgstr "%s: uyarý: ayrýlmýþ `%s' bölümü parça içinde deðil" +msgstr "%s: uyarı: ayrılmış `%s' bölümü parça içinde değil" -#: elf.c:4138 +#: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" -msgstr "%s: `%s' sembolü gerekli fakat mevcut deðil" - -#: elf.c:4147 -#, c-format -msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" -msgstr "bfd sembolünden elf sembolü:0x%.8lx, isim= %s, sem num = %d, bayrak = 0x%.8lx%s\n" +msgstr "%s: `%s' sembolü gerekli fakat mevcut değil" -#: elf.c:4391 +#: elf.c:4749 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "%s: uyarý: Boþ yüklenebilir parça bulundu\n" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "%s: uyarı: Boş yüklenebilir parça bulundu, bu isteyerek mi yapılıyor?\n" -#: elf.c:5804 +#: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" -msgstr "%s: desteklenmeyen yerdeðiþim türü %s" +msgstr "%s: desteklenmeyen yerdeğişim türü %s" -#: elf32-arm.h:1224 +#: elf32-arm.h:1221 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." -msgstr "%s: Uyarý: Arm BLX iþlemi Arm iþlevi '%s' hedefliyor." +msgstr "%s: Uyarı: Arm BLX işlemi Arm işlevi '%s' hedefliyor." -#: elf32-arm.h:1420 +#: elf32-arm.h:1417 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." -msgstr "%s: Uyarý: Thumb BLX iþlemi thumb iþlevi '%s'ý hedefliyor." +msgstr "%s: Uyarı: Thumb BLX işlemi thumb işlevi '%s'ı hedefliyor." -#: elf32-arm.h:1904 elf32-i386.c:1776 elf32-sh.c:3133 +#: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" -msgstr "%s(%s+0x%lx): SEC_MERGE bölümüne %s yerdeðiþimi" +msgstr "%s(%s+0x%lx): SEC_MERGE bölümüne %s yerdeğişimi" -#: elf32-arm.h:1998 +#: elf32-arm.h:2008 #, c-format msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$d yer deðiþimi" - -#: elf32-arm.h:2114 -#, c-format -msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" -msgstr "Uyarý: beraber çalýþmaz diye önceden belirtilmiþ olduðundan %s'nin beraber çalýþma bayraðý atanmadý" - -#: elf32-arm.h:2118 -#, c-format -msgid "Warning: Clearing the interwork flag of %s due to outside request" -msgstr "Uyarý: Dýþ isteðe uyularak %s'nin beraber çalýþma bayraðý temizlendi" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$d yer değişimi" -#: elf32-arm.h:2166 +#: elf32-arm.h:2176 #, c-format -msgid "Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it" -msgstr "Uyarý: %2$s'deki beraber çalýþmaz kod ona baðlandýðý için %1$s'nin beraber çalýþma bayraðý temizlendi" +msgid "Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it" +msgstr "Uyarı: %2$s'deki beraber çalışmaz kod ona bağlandığı için %1$s'nin beraber çalışma bayrağı temizlendi" -#: elf32-arm.h:2261 +#: elf32-arm.h:2271 #, c-format -msgid "Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "Hata: %s EABI sürüm %d için derlenmiþ, fakat %s %d sürümü için derlenmiþ" +msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" +msgstr "Hata: %s EABI sürüm %d için derlenmiş, fakat %s %d sürümü için derlenmiş" -#: elf32-arm.h:2275 +#: elf32-arm.h:2285 #, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "Hata: %s APCS-%d için derlenmiþ, fakat %s APCS-%d için derlenmiþ" +msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" +msgstr "HATA: %s, APCS-%d için derlenmiş fakat hedef %s APCS-%d kullanıyor" -#: elf32-arm.h:2287 +#: elf32-arm.h:2313 #, c-format -msgid "Error: %s passes floats in FP registers, whereas %s passes them in integer registers" -msgstr "" -"Hata: %s kayan sayýlarý kayan sayý yazmaçlarýnda geçiriyor, \n" -" fakat %s tamsayý yazmaçlarýnda geçiriyor" - -#: elf32-arm.h:2292 -#, c-format -msgid "Error: %s passes floats in integer registers, whereas %s passes them in FP registers" -msgstr "" -"Hata: %s kayan sayýlarý tamsayý yazmaçlarýnda geçiriyor, \n" -" fakat %s kayan sayý yazmaçlarýnda geçiriyor" +msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgstr "Hata: %s VFP işlemi kullanıyor, fakat %s FPA işlemi kullanıyor" -#: elf32-arm.h:2303 +#: elf32-arm.h:2318 #, c-format -msgid "Error: %s uses VFP instructions, whereas %s FPA instructions" -msgstr "Hata: %s VFP iþlemi kullanýyor, fakat %s FPA iþlemi kullanýyor" +msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgstr "Hata: %s FPA işlemi kullanıyor, fakat %s VFP işlemi kullanıyor" -#: elf32-arm.h:2308 +#: elf32-arm.h:2338 #, c-format -msgid "Error: %s uses FPA instructions, whereas %s VFP instructions" -msgstr "Hata: %s FPA iþlemi kullanýyor, fakat %s VFP iþlemi kullanýyor" - -#: elf32-arm.h:2328 -#, c-format -msgid "Error: %s uses software FP, whereas %s uses hardware FP" +msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" msgstr "" -"Hata: %s yazýlýmda kayan sayý kullanýyor,\n" -" fakat %s donanýmda kayan sayý kullanýyor" +"Hata: %s yazılımda kayan sayı kullanıyor,\n" +" fakat %s donanımda kayan sayı kullanıyor" -#: elf32-arm.h:2333 +#: elf32-arm.h:2343 #, c-format -msgid "Error: %s uses hardware FP, whereas %s uses software FP" +msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" msgstr "" -"Hata: %s donanýmda kayan sayý kullanýyor,\n" -" fakat %s yazýlýmda kayan sayý kullanýyor" - -#: elf32-arm.h:2348 -#, c-format -msgid "Warning: %s supports interworking, whereas %s does not" -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý destekliyor, fakat %s desteklemiyor." - -#: elf32-arm.h:2355 -#, c-format -msgid "Warning: %s does not support interworking, whereas %s does" -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý desteklemiyor, fakat %s destekliyor." +"Hata: %s donanımda kayan sayı kullanıyor,\n" +" fakat %s yazılımda kayan sayı kullanıyor" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2970 elf32-m68k.c:410 elf32-mips.c:3232 +#: elf32-arm.h:2396 elf32-cris.c:2988 elf32-m68k.c:410 elf32-vax.c:543 +#: elfxx-mips.c:7756 #, c-format msgid "private flags = %lx:" -msgstr "özel bayraklar = %lx:" +msgstr "özel bayraklar = %lx:" -#: elf32-arm.h:2395 +#: elf32-arm.h:2405 msgid " [interworking enabled]" -msgstr " [beraber çalýþma etkinleþtirilmiþ]" - -#: elf32-arm.h:2398 -msgid " [APCS-26]" -msgstr " [APCS-26]" +msgstr " [beraber çalışma etkinleştirilmiş]" -#: elf32-arm.h:2400 -msgid " [APCS-32]" -msgstr " [APCS-32]" - -#: elf32-arm.h:2403 +#: elf32-arm.h:2413 msgid " [VFP float format]" -msgstr " [VFP kayan nokta biçemi]" +msgstr " [VFP kayan nokta biçemi]" -#: elf32-arm.h:2405 +#: elf32-arm.h:2415 msgid " [FPA float format]" -msgstr " [FPA kayan nokta biçemi]" +msgstr " [FPA kayan nokta biçemi]" -#: elf32-arm.h:2414 +#: elf32-arm.h:2424 msgid " [new ABI]" msgstr " [yeni ABI]" -#: elf32-arm.h:2417 +#: elf32-arm.h:2427 msgid " [old ABI]" msgstr " [eski ABI]" -#: elf32-arm.h:2420 +#: elf32-arm.h:2430 msgid " [software FP]" -msgstr " [yazýlým FP]" +msgstr " [yazılım FP]" -#: elf32-arm.h:2428 +#: elf32-arm.h:2438 msgid " [Version1 EABI]" -msgstr " [Sürüm1 EABI]" +msgstr " [Sürüm1 EABI]" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2441 elf32-arm.h:2452 msgid " [sorted symbol table]" -msgstr " [sýralanmýþ sembol tablosu]" +msgstr " [sıralanmış sembol tablosu]" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2443 elf32-arm.h:2454 msgid " [unsorted symbol table]" -msgstr " [sýralanmamýþ sembol tablosu]" +msgstr " [sıralanmamış sembol tablosu]" -#: elf32-arm.h:2439 +#: elf32-arm.h:2449 msgid " [Version2 EABI]" -msgstr " [Sürüm2 EABI]" +msgstr " [Sürüm2 EABI]" -#: elf32-arm.h:2447 +#: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" -msgstr " [dinamik semboller bölüm indeksini kullanýyor]" +msgstr " [dinamik semboller bölüm indeksini kullanıyor]" -#: elf32-arm.h:2450 +#: elf32-arm.h:2460 msgid " [mapping symbols precede others]" -msgstr " [eþleþme sembolleri diðerlerinden önceliklidir]" +msgstr " [eşleşme sembolleri diğerlerinden önceliklidir]" -#: elf32-arm.h:2457 +#: elf32-arm.h:2467 msgid " " -msgstr " " +msgstr " " -#: elf32-arm.h:2464 +#: elf32-arm.h:2474 msgid " [relocatable executable]" -msgstr " [yer deðiþtirebilir uygulama]" +msgstr " [yer değiştirebilir uygulama]" -#: elf32-arm.h:2467 +#: elf32-arm.h:2477 msgid " [has entry point]" -msgstr " [girdi noktasý var]" +msgstr " [girdi noktası var]" -#: elf32-arm.h:2472 +#: elf32-arm.h:2482 msgid "" -msgstr "" +msgstr "" -#: elf32-avr.c:843 elf32-cris.c:1400 elf32-fr30.c:661 elf32-i860.c:1056 -#: elf32-openrisc.c:463 elf32-v850.c:1699 elf64-mmix.c:1172 +#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 +#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 +#: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" -msgstr "iç hata: tehlikeli yer deðiþim" +msgstr "iç hata: tehlikeli yer değişim" #: elf32-cris.c:949 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$s yer deðiþimi" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$s yer değişimi" #: elf32-cris.c:1012 #, c-format msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" -msgstr "%1$s: %4$s bölümünden `%3$s' sembolüne %2$s yer deðiþimi için PLT veya GOT yok" +msgstr "%1$s: %4$s bölümünden `%3$s' sembolüne %2$s yer değişimi için PLT veya GOT yok" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" -msgstr "[adý kaybolmuþ]" +msgstr "[adı kaybolmuş]" -#: elf32-cris.c:1131 +#: elf32-cris.c:1130 #, c-format msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" msgstr "" -"%1$s: %4$s bölümünden yerel sembol sýfýr olmayan %3$d eklemesi ile\n" -" %2$s yerdeðiþimi" +"%1$s: %4$s bölümünden yerel sembol sıfır olmayan %3$d eklemesi ile\n" +" %2$s yerdeğişimi" -#: elf32-cris.c:1138 +#: elf32-cris.c:1137 #, c-format msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" -msgstr "%1$s: %5$s bölümünden `%4$s' sembolüne sýfýr olmayan %3$d eklemesi ile %2$s yerdeðiþimi" +msgstr "%1$s: %5$s bölümünden `%4$s' sembolüne sıfır olmayan %3$d eklemesi ile %2$s yerdeğişimi" -#: elf32-cris.c:1156 +#: elf32-cris.c:1155 #, c-format msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" -msgstr "%1$s: %4$s bölümünden %3$s evrensel sembolü için %2$s yerdeðiþimi yapýlamaz" +msgstr "%1$s: %4$s bölümünden %3$s evrensel sembolü için %2$s yerdeğişimi yapılamaz" -#: elf32-cris.c:1275 +#: elf32-cris.c:1170 +#, c-format +msgid "%s: relocation %s in section %s with no GOT created" +msgstr "%1$s: `%3$s' bölümünde %2$s yer değiştirmesi mevcut, fakat GOT oluşturulmamış" + +#: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" -msgstr "%s: Ýç tutarsýzlýk; %s yerdeðiþim bölümü yok" +msgstr "%s: İç tutarsızlık; %s yerdeğişim bölümü yok" -#: elf32-cris.c:2508 +#: elf32-cris.c:2514 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -"%s, %s bölümü:\n" -" %s yer deðiþimi paylaþýmlý nesne oluþtururken kullanýlamaz;\n" +"%s, %s bölümü:\n" +" %s yer değişimi paylaşımlı nesne oluştururken kullanılamaz;\n" " -fPIC ile yeniden derleyin" -#: elf32-cris.c:2973 +#: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" -msgstr " [semboller _ önekine sahip]" +msgstr " [semboller _ önekine sahip]" -#: elf32-cris.c:3012 +#: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" -msgstr "%s: _-önekli sembolleri kullanýyor, fakat dosyaya öneksiz sembolleri yazýyor" +msgstr "%s: _-önekli sembolleri kullanıyor, fakat dosyaya öneksiz sembolleri yazıyor" -#: elf32-cris.c:3013 +#: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" -msgstr "%s: öneksiz sembolleri kullanýyor, fakat dosyaya _-önekli sembolleri yazýyor" +msgstr "%s: öneksiz sembolleri kullanıyor, fakat dosyaya _-önekli sembolleri yazıyor" + +#: elf32-frv.c:1217 +#, c-format +msgid "%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "%s: %s ile derlendi ve normal derlenmiş modüllerle bağlandı" + +#: elf32-frv.c:1267 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "%s: %s ile derlendi ve %s ile derlenmiş modüllerle bağlandı" + +#: elf32-frv.c:1279 +#, c-format +msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: önceki modüllerden farklı bilinmeyen e_flags (0x%lx) alanları kullanılıyor (0x%lx)" + +#: elf32-frv.c:1315 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "özel bayraklar = 0x%lx:" #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" -msgstr "%s: Normal ELF'de yerdeðiþimler (EM: %d)" +msgstr "%s: Normal ELF'de yerdeğişimler (EM: %d)" -#: elf32-hppa.c:646 +#: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format msgid "%s: cannot create stub entry %s" -msgstr "%s: koçan giriþi %s oluþturulamadý" +msgstr "%s: koçan girişi %s oluşturulamadı" -#: elf32-hppa.c:937 elf32-hppa.c:3540 +#: elf32-hppa.c:956 elf32-hppa.c:3555 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" -msgstr "%s(%s+0x%lx): %s'e ulaþýlamadý, -ffunction-sections ile derleyin" +msgstr "%s(%s+0x%lx): %s'e ulaşılamadı, -ffunction-sections ile derleyin" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" -msgstr "%s: %s yer deðiþimi paylaþýmlý nesne oluþturulurken kullanýlamaz; -fPIC ile yeniden derleyin" +msgstr "%s: %s yer değişimi paylaşımlı nesne oluşturulurken kullanılamaz; -fPIC ile yeniden derleyin" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1358 #, c-format msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" -msgstr "%s: %s yer deðiþimi paylaþýmlý nesne oluþtururken kullanýlamaz; -fPIC ile yeniden derleyin" +msgstr "%s: %s yer değişimi paylaşımlı nesne oluştururken kullanılamaz; -fPIC ile yeniden derleyin" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" -msgstr "%s için yer deðiþtirme bölümü bulunamadý" +msgstr "%s için yer değiştirme bölümü bulunamadı" -#: elf32-hppa.c:2862 +#: elf32-hppa.c:2855 #, c-format msgid "%s: duplicate export stub %s" -msgstr "%s: birden fazla ihraç koçaný %s" +msgstr "%s: birden fazla ihraç koçanı %s" -#: elf32-hppa.c:3424 +#: elf32-hppa.c:3433 #, c-format msgid "%s(%s+0x%lx): fixing %s" -msgstr "%s(%s+0x%lx): %s düzeltiliyor" +msgstr "%s(%s+0x%lx): %s düzeltiliyor" -#: elf32-hppa.c:4064 +#: elf32-hppa.c:4080 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" -msgstr "%1$s(%2$s+0x%3$lx): %5$s için %4$s iþlenemedi" +msgstr "%1$s(%2$s+0x%3$lx): %5$s için %4$s işlenemedi" -#: elf32-hppa.c:4403 +#: elf32-hppa.c:4393 msgid ".got section not immediately after .plt section" -msgstr ".got bölümü .plt bölümünün hemen arkasýnda deðil" +msgstr ".got bölümü .plt bölümünün hemen arkasında değil" -#: elf32-i386.c:298 +#: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" -msgstr "%s: geçersiz yer deðiþim türü %d" +msgstr "%s: geçersiz yer değişim türü %d" -#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" -msgstr "%s: geçersiz sembol indeksi: %d" +msgstr "%s: geçersiz sembol indeksi: %d" + +#: elf32-i386.c:948 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "%s: `%s'a hem normal, hem de dal yerel sembolü olarak erişildi" -#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2085 elf64-s390.c:759 +#: elf32-i386.c:1072 elf32-s390.c:808 elf64-ppc.c:2827 elf64-s390.c:759 +#: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" -msgstr "%s: geçersiz yerdeðiþim bölümü adý `%s'" +msgstr "%s: geçersiz yerdeğişim bölümü adı `%s'" -#: elf32-i386.c:2067 elf32-s390.c:1949 elf64-ppc.c:3908 elf64-s390.c:1953 +#: elf32-i386.c:1159 elf64-alpha.c:4768 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "%s: TLS yerel çalıştırma kodu paylaşımlı nesnelere bağlanamaz" + +#: elf32-i386.c:2747 elf32-s390.c:1981 elf32-sparc.c:1571 elf64-ppc.c:5918 +#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" -msgstr "%s(%s+0x%lx): `%s' sembolüne çözümlenemeyen yer deðiþimi" +msgstr "%s(%s+0x%lx): `%s' sembolüne çözümlenemeyen yer değişimi" -#: elf32-i386.c:2105 elf32-s390.c:1987 elf64-s390.c:1991 +#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 +#: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" -msgstr "%s(%s+0x%lx): %s'e yer deðiþimi: %d hatasý" +msgstr "%s(%s+0x%lx): %s'e yer değişimi: %d hatası" #: elf32-m32r.c:924 msgid "SDA relocation when _SDA_BASE_ not defined" -msgstr "_SDA_BASE_ tanýmlanmamýþ iken SDA yer deðiþimi" +msgstr "_SDA_BASE_ tanımlanmamış iken SDA yer değişimi" -#: elf32-ia64.c:3538 elf32-m32r.c:1008 elf32-ppc.c:2930 elf64-ia64.c:3538 +#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 +#: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" -msgstr "%s: bilinmeyen yer deðiþim türü %d" +msgstr "%s: bilinmeyen yer değişim türü %d" -#: elf32-m32r.c:1224 +#: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" -msgstr "%1$s: Bir %3$s yer deðiþiminin hedefi (%2$s) yanlýþ bölümde (%4$s)" +msgstr "%1$s: Bir %3$s yer değişiminin hedefi (%2$s) yanlış bölümde (%4$s)" -#: elf32-m32r.c:2001 +#: elf32-m32r.c:1947 #, c-format msgid "%s: Instruction set mismatch with previous modules" -msgstr "%s: Önceki modüllerle iþlem uyuþmazlýðý" +msgstr "%s: Önceki modüllerle işlem uyuşmazlığı" -#: elf32-m32r.c:2024 +#: elf32-m32r.c:1970 #, c-format msgid "private flags = %lx" -msgstr "özel bayraklar = %lx" +msgstr "özel bayraklar = %lx" -#: elf32-m32r.c:2029 +#: elf32-m32r.c:1975 msgid ": m32r instructions" -msgstr ": m32r iþlemleri" +msgstr ": m32r işlemleri" -#: elf32-m32r.c:2030 +#: elf32-m32r.c:1976 msgid ": m32rx instructions" -msgstr ": m32rx iþlemleri" +msgstr ": m32rx işlemleri" #: elf32-m68k.c:413 msgid " [cpu32]" msgstr " [cpu32]" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m68k.c:416 +msgid " [m68000]" +msgstr " [m68000]" + +#: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" -msgstr "%s: %s (%d) yer deðiþimi henüz desteklenmiyor.\n" +msgstr "%s: %s (%d) yer değişimi henüz desteklenmiyor.\n" -#: elf32-mcore.c:438 +#: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" -msgstr "%s: Bilinmeyen yer deðiþim türü %d\n" +msgstr "%s: Bilinmeyen yer değişim türü %d\n" -#: elf32-mips.c:2146 elf64-mips.c:1972 +#: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" -msgstr "32 bitlik gp göreceli yer deðiþim bir dýþ sembol için yapýlýyor" +msgstr "32 bitlik gp göreceli yer değişim bir dış sembol için yapılıyor" -#: elf32-mips.c:2295 +#: elf32-mips.c:1301 #, c-format msgid "Linking mips16 objects into %s format is not supported" -msgstr "mips16 nesnelerini %s biçemine baðlamak desteklenmiyor" +msgstr "mips16 nesnelerini %s biçemine bağlamak desteklenmiyor" -#: elf32-mips.c:3119 +#: elf32-ppc.c:1460 #, c-format -msgid "%s: linking PIC files with non-PIC files" -msgstr "%s: PIC dosyalarý PIC olmayan dosyalarla baðlanýyor" +msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" +msgstr "%s: -mrelocatable ile derlendi ve normal derlenmiş modüllerle bağlandı" -#: elf32-mips.c:3129 +#: elf32-ppc.c:1468 #, c-format -msgid "%s: linking abicalls files with non-abicalls files" -msgstr "%s: abicalls dosyalarý abicalls olmayan dosyalarla baðlanýyor" +msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" +msgstr "%s: normal derlendi ve -mrelocatable ile derlenmiş modüllere bağlandı" -#: elf32-mips.c:3158 +#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 #, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" -msgstr "%1$s: Önceki modüllerle (-mips%3$d) ile ISA uyumsuzluðu (-mips%2$d)" +msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%1$s: önceki modüllerden (0x%3$lx) farklı e_flags (0x%2$lx) alanları kullanılıyor" -#: elf32-mips.c:3167 +#: elf32-ppc.c:1592 #, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" -msgstr "%1$s: Önceki modüllerle (%3$d) ile ISA uyumsuzluðu (%2$d)" +msgid "%s: Unknown special linker type %d" +msgstr "%s: Bilinmeyen özel bağlayıcı türü %d" -#: elf32-mips.c:3190 +#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" -msgstr "%s: ABI uyumsuzluðu: %s modülü önceki %s modülle baðlanýyor" +msgid "%s: relocation %s cannot be used when making a shared object" +msgstr "%s: %s yerdeğişimi paylaşımlı nesne oluşturulurken kullanılamaz" -#: elf32-mips.c:3204 elf32-ppc.c:1470 elf64-ppc.c:1538 elf64-sparc.c:3033 +#: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format -msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" -msgstr "%1$s: önceki modüllerden (0x%3$lx) farklý e_flags (0x%2$lx) alanlarý kullanýlýyor" - -#: elf32-mips.c:3235 -msgid " [abi=O32]" -msgstr " [abi=O32]" - -#: elf32-mips.c:3237 -msgid " [abi=O64]" -msgstr " [abi=O64]" - -#: elf32-mips.c:3239 -msgid " [abi=EABI32]" -msgstr " [abi=EABI32]" - -#: elf32-mips.c:3241 -msgid " [abi=EABI64]" -msgstr " [abi=EABI64]" - -#: elf32-mips.c:3243 -msgid " [abi unknown]" -msgstr " [abi bilinmiyor]" - -#: elf32-mips.c:3245 -msgid " [abi=N32]" -msgstr " [abi=N32]" - -#: elf32-mips.c:3247 -msgid " [abi=64]" -msgstr " [abi=64]" - -#: elf32-mips.c:3249 -msgid " [no abi set]" -msgstr " [abi atanmamýþ]" - -#: elf32-mips.c:3252 -msgid " [mips1]" -msgstr " [mips1]" - -#: elf32-mips.c:3254 -msgid " [mips2]" -msgstr " [mips2]" - -#: elf32-mips.c:3256 -msgid " [mips3]" -msgstr " [mips3]" - -#: elf32-mips.c:3258 -msgid " [mips4]" -msgstr " [mips4]" - -#: elf32-mips.c:3260 -msgid " [mips5]" -msgstr " [mips5]" - -#: elf32-mips.c:3262 -msgid " [mips32]" -msgstr " [mips32]" - -#: elf32-mips.c:3264 -msgid " [mips64]" -msgstr " [mips64]" - -#: elf32-mips.c:3266 -msgid " [unknown ISA]" -msgstr " [bilinmeyen ISA]" - -#: elf32-mips.c:3269 -msgid " [32bitmode]" -msgstr " [32bitkipi]" - -#: elf32-mips.c:3271 -msgid " [not 32bitmode]" -msgstr " [32bitkipi deðil]" - -#: elf32-mips.c:4947 -msgid "static procedure (no name)" -msgstr "statik altyordam (isimsiz)" +msgid "%s: unknown relocation type %d for symbol %s" +msgstr "%1$s: %3$s sembolü için bilinmeyen %2$d türünde yerdeğişimi" -#: elf32-mips.c:5565 elf64-mips.c:6694 +#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format -msgid "%s: illegal section name `%s'" -msgstr "%s: geçersiz bölüm adý `%s'" - -#: elf32-mips.c:6132 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" -msgstr "yerel GOT girdileri için yeterli GOT yeri yok" +msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +msgstr "%1$s: %3$s yerdeğişiminin hedefi (%2$s) yanlış çıktı bölümünde (%4$s)" -#: elf32-mips.c:7238 elf64-mips.c:4203 +#: elf32-ppc.c:3619 #, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" -msgstr "%s: %s+0x%lx: jal olmayan koçan yordamýna sýçrama" +msgid "%s: Relocation %s is not yet supported for symbol %s." +msgstr "%s: %s yerdeğişimi %s sembolü için henüz desteklenmiyor." -#: elf32-mips.c:8237 elf64-mips.c:5891 +#: elf32-sh.c:1964 #, c-format -msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: %s bölümü için geçersiz yer deðiþim bulundu" +msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgstr "%s: 0x%lx: uyarı: hatalı R_SH_USES göreli konumu" -#: elf32-mips.c:8315 elf64-mips.c:5969 +#: elf32-sh.c:1976 #, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: 0x%lx'deki CALL16 yerdeðiþimi evrensel sembole göre deðil" +msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgstr "%s: 0x%lx: uyarı: R_SH_USES bilinmeyen insn 0x%x'ı imliyor" -#: elf32-ppc.c:1436 elf64-ppc.c:1503 +#: elf32-sh.c:1993 #, c-format -msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" -msgstr "%s: -mrelocatable ile derlendi ve normal derlenmiþ modüllerle baðlandý" +msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgstr "%s: 0x%lx: uyarı: hatalı R_SH_USES yükleme göreli konumu" -#: elf32-ppc.c:1444 elf64-ppc.c:1511 +#: elf32-sh.c:2008 #, c-format -msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" -msgstr "%s: normal derlendi ve -mrelocatable ile derlenmiþ modüllere baðlandý" +msgid "%s: 0x%lx: warning: could not find expected reloc" +msgstr "%s: 0x%lx: uyarı: beklenen yerdeğişim bulunamadı" -#: elf32-ppc.c:1568 +#: elf32-sh.c:2036 #, c-format -msgid "%s: Unknown special linker type %d" -msgstr "%s: Bilinmeyen özel baðlayýcý türü %d" +msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgstr "%s: 0x%lx: uyarı: beklenmeyen bölümde sembol" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf32-sh.c:2153 #, c-format -msgid "%s: relocation %s cannot be used when making a shared object" -msgstr "%s: %s yerdeðiþimi paylaþýmlý nesne oluþturulurken kullanýlamaz" +msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgstr "%s: 0x%lx: uyarı: beklenen COUNT yerdeğişimi bulunamadı" -#: elf32-ppc.c:3097 elf64-ppc.c:3500 +#: elf32-sh.c:2162 #, c-format -msgid "%s: unknown relocation type %d for symbol %s" -msgstr "%1$s: %3$s sembolü için bilinmeyen %2$d türünde yerdeðiþimi" +msgid "%s: 0x%lx: warning: bad count" +msgstr "%s: 0x%lx: uyarı: hatalı sayım" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 +#: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format -msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" -msgstr "%1$s: %3$s yerdeðiþiminin hedefi (%2$s) yanlýþ çýktý bölümünde (%4$s)" +msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +msgstr "%s: 0x%lx: ölümcül: gevşetilirken yerdeğişim taşması" -#: elf32-ppc.c:3589 -#, c-format -msgid "%s: Relocation %s is not yet supported for symbol %s." -msgstr "%s: %s yerdeðiþimi %s sembolü için henüz desteklenmiyor." +#: elf32-sh.c:4073 elf64-sh64.c:1576 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "Yerel sembolde STO_SH5_ISA32 desteklenmiyor" -#: elf32-sh.c:1101 +#: elf32-sh.c:4284 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES offset" -msgstr "%s: 0x%lx: uyarý: hatalý R_SH_USES göreli konumu" +msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgstr "%s: 0x%lx: ölümcül: gevşetme destek yerdeğişimi için hizalanmamış dal" -#: elf32-sh.c:1113 +#: elf32-sh64.c:203 elf64-sh64.c:2364 #, c-format -msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" -msgstr "%s: 0x%lx: uyarý: R_SH_USES bilinmeyen insn 0x%x'ý imliyor" +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "%s: 32 bitlik sistem için derlenmiş ve %s 64 bit" -#: elf32-sh.c:1130 +#: elf32-sh64.c:206 elf64-sh64.c:2367 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" -msgstr "%s: 0x%lx: uyarý: hatalý R_SH_USES yükleme göreli konumu" +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "%s: 64 bitlik sistem için derlenmiş ve %s 32 bit" -#: elf32-sh.c:1145 +#: elf32-sh64.c:208 elf64-sh64.c:2369 #, c-format -msgid "%s: 0x%lx: warning: could not find expected reloc" -msgstr "%s: 0x%lx: uyarý: beklenen yerdeðiþim bulunamadý" +msgid "%s: object size does not match that of target %s" +msgstr "%s: nesne boyu hedef %s'nin boyuyla eşleşmiyor" -#: elf32-sh.c:1202 +#: elf32-sh64.c:440 elf64-sh64.c:2941 #, c-format -msgid "%s: 0x%lx: warning: symbol in unexpected section" -msgstr "%s: 0x%lx: uyarý: beklenmeyen bölümde sembol" +msgid "%s: encountered datalabel symbol in input" +msgstr "%s: girdide veri etiketi sembolüne rastlandı" + +#: elf32-sh64.c:523 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "PTB uyumsuzluğu: SHmedia adresi (bit 0 == 1)" + +#: elf32-sh64.c:526 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "PTA uyumsuzluğu: SHcompact adresi (bit 0 == 0)" -#: elf32-sh.c:1323 +#: elf32-sh64.c:544 #, c-format -msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" -msgstr "%s: 0x%lx: uyarý: beklenen COUNT yerdeðiþimi bulunamadý" +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "%s: GAS hatası: R_SH_PT_16 içeren PTB yönergesi beklenmiyordu" -#: elf32-sh.c:1332 +#: elf32-sh64.c:593 elf64-sh64.c:1703 #, c-format -msgid "%s: 0x%lx: warning: bad count" -msgstr "%s: 0x%lx: uyarý: hatalý sayým" +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "%1$s: %3$08x ve %4$08x yerdeğiştirmesinde hizalanmamış yer değiştirme türü %2$d\n" -#: elf32-sh.c:1741 elf32-sh.c:2132 +#: elf32-sh64.c:677 #, c-format -msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" -msgstr "%s: 0x%lx: ölümcül: gevþetilirken yerdeðiþim taþmasý" +msgid "%s: could not write out added .cranges entries" +msgstr "%s: eklenen .cranges girdileri yazılamadı" -#: elf32-sh.c:3267 +#: elf32-sh64.c:739 #, c-format -msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" -msgstr "%s: 0x%lx: ölümcül: gevþetme destek yerdeðiþimi için hizalanmamýþ dal" +msgid "%s: could not write out sorted .cranges entries" +msgstr "%s: sıralanmış .cranges girdileri yazılamadı" -#: elf32-sparc.c:1554 elf64-sparc.c:2286 +#: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" -msgstr "%s: acaba -fPIC olmaksýzýn mý derlenmiþ?" +msgstr "%s: acaba -fPIC olmaksızın mı derlenmiş?" -#: elf32-sparc.c:2007 +#: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" -msgstr "%s: 64 bitlik sistem için derlenmiþ ve hedef 32 bit" +msgstr "%s: 64 bitlik sistem için derlenmiş ve hedef 32 bit" -#: elf32-sparc.c:2021 +#: elf32-sparc.c:2016 #, c-format msgid "%s: linking little endian files with big endian files" -msgstr "%s: küçük sonlu dosyalar büyük sonlu dosyalarla baðlanýyor" +msgstr "%s: küçük sonlu dosyalar büyük sonlu dosyalarla bağlanıyor" #: elf32-v850.c:682 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" -msgstr "`%s' deðiþkeni birden fazla küçük veri sahasýný kapsayamaz" +msgstr "`%s' değişkeni birden fazla küçük veri sahasını kapsayamaz" #: elf32-v850.c:685 #, c-format msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" -msgstr "`%s' deðiþkeni küçük, sýfýr ve ufak veri sahalarýndan yalnýz birinde olabilir" +msgstr "`%s' değişkeni küçük, sıfır ve ufak veri sahalarından yalnız birinde olabilir" #: elf32-v850.c:688 #, c-format msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem küçük hem sýfýr veri sahalarýnda bulunamaz" +msgstr "`%s' değişkeni aynı anda hem küçük hem sıfır veri sahalarında bulunamaz" #: elf32-v850.c:691 #, c-format msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem küçük hem ufak veri sahalarýnda bulunamaz" +msgstr "`%s' değişkeni aynı anda hem küçük hem ufak veri sahalarında bulunamaz" #: elf32-v850.c:694 #, c-format msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem sýfýr hem ufak veri sahalarýnda bulunamaz" +msgstr "`%s' değişkeni aynı anda hem sıfır hem ufak veri sahalarında bulunamaz" #: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" -msgstr "önceki HI16 yerdeðiþimi BULUNAMADI\n" +msgstr "önceki HI16 yerdeğişimi BULUNAMADI\n" #: elf32-v850.c:1703 msgid "could not locate special linker symbol __gp" -msgstr "özel baðlayýcý sembolü __gp bulunamadý" +msgstr "özel bağlayıcı sembolü __gp bulunamadı" #: elf32-v850.c:1707 msgid "could not locate special linker symbol __ep" -msgstr "özel baðlayýcý sembolü __ep bulunamadý" +msgstr "özel bağlayıcı sembolü __ep bulunamadı" #: elf32-v850.c:1711 msgid "could not locate special linker symbol __ctbp" -msgstr "özel baðlayýcý sembolü __ctbp bulunamadý" +msgstr "özel bağlayıcı sembolü __ctbp bulunamadı" -#: elf32-v850.c:1877 +#: elf32-v850.c:1875 #, c-format msgid "%s: Architecture mismatch with previous modules" -msgstr "%s: Önceki modüllerle platform uyumsuzluðu" +msgstr "%s: Önceki modüllerle platform uyumsuzluğu" -#: elf32-v850.c:1897 +#: elf32-v850.c:1895 #, c-format msgid "private flags = %lx: " -msgstr "özel bayraklar = %lx:" +msgstr "özel bayraklar = %lx:" -#: elf32-v850.c:1902 +#: elf32-v850.c:1900 msgid "v850 architecture" msgstr "v850 platformu" -#: elf32-v850.c:1903 +#: elf32-v850.c:1901 msgid "v850e architecture" msgstr "v850e platformu" -#: elf32-v850.c:1904 +#: elf32-v850.c:1902 msgid "v850ea architecture" msgstr "v850ea platformu" -#: elf64-alpha.c:858 +#: elf32-vax.c:546 +msgid " [nonpic]" +msgstr " [nonpic]" + +#: elf32-vax.c:549 +msgid " [d-float]" +msgstr " [d-float]" + +#: elf32-vax.c:552 +msgid " [g-float]" +msgstr " [g-float]" + +#: elf32-vax.c:674 +#, c-format +msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld" +msgstr "%1$s: uyarı: `%3$s'ye GOT %2$ld eklentisi bir önceki %4$ld GOT eklentisiyle eşleşmiyor" + +#: elf32-vax.c:1679 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne PLT eklentisi %2$d yok sayıldı" + +#: elf32-vax.c:1814 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne %2$s yer değişimi" + +#: elf32-vax.c:1820 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "%1$s: uyarı: %4$s bölümünden 0x%3$x'e %2$s yer değişimi" + +#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 +msgid "non-zero addend in @fptr reloc" +msgstr "@fptr yerdeğişiminde sıfır olmayan eklenti" + +#: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" -msgstr "GPDISP yerdeðiþimi ldah ve lda iþlemlerini bulamadý" +msgstr "GPDISP yerdeğişimi ldah ve lda işlemlerini bulamadı" -#: elf64-alpha.c:2934 +#: elf64-alpha.c:3675 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" -msgstr "%s: .got alt parçasý 64K'yý aþýyor (boy %d)" +msgstr "%s: .got alt parçası 64K'yı aşıyor (boy %d)" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" -msgstr "%s: %s dinamik sembolüne gp göreceli yer deðiþimi" +msgstr "%s: %s dinamik sembolüne gp göreceli yer değişimi" + +#: elf64-alpha.c:4536 elf64-alpha.c:4676 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne pc göreceli yer değişimi" + +#: elf64-alpha.c:4564 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "%s: gp içinde değişiklik: BRSGP %s" -#: elf64-hppa.c:2070 +#: elf64-alpha.c:4589 +msgid "" +msgstr "" + +#: elf64-alpha.c:4594 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "%s: .prologue olmaksızın sembole !samegp yerdeğişimi: %s" + +#: elf64-alpha.c:4639 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "%s: %s'e desteklenmeyen dinamik yerdeğişim" + +#: elf64-alpha.c:4752 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne dtp göreceli yer değişimi" + +#: elf64-alpha.c:4775 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne tp göreceli yer değişimi" + +#: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" -msgstr "%s için koçan girdisi .plt'yi yükleyemedi, dp görecesi = %ld" +msgstr "%s için koçan girdisi .plt'yi yükleyemedi, dp görecesi = %ld" -#: elf64-mmix.c:1268 +#: elf64-mmix.c:1002 #, c-format -msgid "%s: register relocation against non-register symbol: %s in %s" -msgstr "%1$s: yazmaç olmayan sembole yazmaç yerdeðiþimi: %3$s içinde %2$s" +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" +msgstr "" +"%s: bağlayıcı tarafından ayrılmış global yazmaç değeri için iç tutarsızlık hatası:\n" +" 0x%lx%08lx != gevşetilmiş: 0x%lx%08lx\n" -#: elf64-mmix.c:1270 -msgid "(unknown)" -msgstr "(bilinmeyen)" +#: elf64-mmix.c:1386 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "%s: yazmaç sembolüne temel artı görece yerdeğişimi: %s içinde (bilinmeyen)" + +#: elf64-mmix.c:1391 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "%1$s: yazmaç sembolüne temel artı görece yerdeğişimi: %3$s içinde %2$s" -#: elf64-mmix.c:1305 +#: elf64-mmix.c:1435 +#, c-format +msgid "%s: register relocation against non-register symbol: (unknown) in %s" +msgstr "%s: yazmaç olmayan sembole yazmaç yerdeğişimi: %s içinde (bilinmeyen)" + +#: elf64-mmix.c:1440 +#, c-format +msgid "%s: register relocation against non-register symbol: %s in %s" +msgstr "%1$s: yazmaç olmayan sembole yazmaç yerdeğişimi: %3$s içinde %2$s" + +#: elf64-mmix.c:1477 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" -msgstr "%s: YEREL (LOCAL) yönergesi yalnýz bir yazmaç veya kesin deðerle geçerlidir" +msgstr "%s: YEREL (LOCAL) yönergesi yalnız bir yazmaç veya kesin değerle geçerlidir" -#: elf64-mmix.c:1333 +#: elf64-mmix.c:1505 #, c-format msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld." msgstr "" -"%s: YEREL (LOCAL) yönergesi: $%ld yazmacý yerel yazmaç deðil.\n" -" Ýlk evrensel yazmaç: $%ld." +"%s: YEREL (LOCAL) yönergesi: $%ld yazmacı yerel yazmaç değil.\n" +" İlk evrensel yazmaç: $%ld." -#: elf64-mmix.c:1609 +#: elf64-mmix.c:1965 #, c-format msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n" msgstr "" -"%s: Hata: `%s' birden fazla defa tanýmlanmýþ; %s'nin baþlangýcý daha önce\n" -" baðlanan bir dosyada.\n" +"%s: Hata: `%s' birden fazla defa tanımlanmış; %s'nin başlangıcı daha önce\n" +" bağlanan bir dosyada.\n" -#: elf64-mmix.c:1668 +#: elf64-mmix.c:2024 msgid "Register section has contents\n" -msgstr "Yazmaç bölümünde içerik yok\n" +msgstr "Yazmaç bölümünde içerik yok\n" + +#: elf64-mmix.c:2186 +#, c-format +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." +msgstr "" +"İç uyumsuzluk: kalan %u != maksimum %u. \n" +" Lütfen bu hatayı bildirin." -#: elf64-ppc.c:1466 libbfd.c:1436 +#: elf64-ppc.c:1669 libbfd.c:1435 #, c-format msgid "%s: compiled for a big endian system and target is little endian" -msgstr "%s: büyük sonlu sistem için derlenmiþ ve hedef küçük sonlu" +msgstr "%s: büyük sonlu sistem için derlenmiş ve hedef küçük sonlu" -#: elf64-ppc.c:1468 libbfd.c:1438 +#: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" -msgstr "%s: küçük sonlu sistem için derlenmiþ ve hedef büyük sonlu" +msgstr "%s: küçük sonlu sistem için derlenmiş ve hedef büyük sonlu" -#: elf64-ppc.c:3166 +#: elf64-ppc.c:3610 #, c-format -msgid "linkage table overflow against `%s'" -msgstr "`%s'ye baðlama tablosu taþmasý" +msgid "%s: unexpected reloc type %u in .opd section" +msgstr "%s: opd bölümünde beklenmeyen yerdeğişim türü %u" -#: elf64-ppc.c:3244 -msgid "stub section size doesn't match calculated size" -msgstr "koçan bölümü boyu hesaplanan boyla eþleþmiyor" +#: elf64-ppc.c:3630 +#, c-format +msgid "%s: .opd is not a regular array of opd entries" +msgstr "%s: opd, opd girdilerinin düzenli dizisi değil" + +#: elf64-ppc.c:3672 +#, c-format +msgid "%s: undefined sym `%s' in .opd section" +msgstr "%s: opd bölümünde tanımlanmamış `%s' sembolü" + +#: elf64-ppc.c:4397 +#, c-format +msgid "can't find branch stub `%s'" +msgstr "`%s' dal koçanı bulunamadı" + +#: elf64-ppc.c:4436 elf64-ppc.c:4501 +#, c-format +msgid "linkage table error against `%s'" +msgstr "`%s'ye bağlama tablosu hatası" -#: elf64-ppc.c:3845 +#: elf64-ppc.c:4573 +#, c-format +msgid "can't build branch stub `%s'" +msgstr "`%s' dal koçanı derlenemedi" + +#: elf64-ppc.c:5179 +msgid "stubs don't match calculated size" +msgstr "koçanlar hesaplanan boyla eşleşmiyor" + +#: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." -msgstr "%s: %s yerdeðiþimi %s sembolü için henüz desteklenmiyor." +msgstr "%s: %s yerdeğişimi %s sembolü için henüz desteklenmiyor." -#: elf64-ppc.c:3889 +#: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" -msgstr "%s: hata: %s yerdeðiþimi 4'ün katý deðil" +msgstr "%s: hata: %s yerdeğişimi 4'ün katı değil" -#: elf64-sparc.c:1277 +#: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" -msgstr "%s: check_relocs: desteklenmeyen yerdeðiþim türü %d" +msgstr "%s: check_relocs: desteklenmeyen yerdeğişim türü %d" -#: elf64-sparc.c:1314 +#: elf64-sparc.c:1317 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" -msgstr "%s: Yalnýz %%g[2367] yazmaçlarý STT_REGISTER ile bildirilebilir" +msgstr "%s: Yalnız %%g[2367] yazmaçları STT_REGISTER ile bildirilebilir" -#: elf64-sparc.c:1334 +#: elf64-sparc.c:1337 #, c-format -msgid "Register %%g%d used incompatibly: %s in %s" -msgstr "%%g%1$d yazmacý uyumsuz kullanýlmýþ: %3$s içinde %2$s" +msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" +msgstr "%%g%1$d yazmacı uyumsuz kullanılmış: %3$s içinde %2$s, daha önce %5$s içinde %4$s idi" -#: elf64-sparc.c:1338 elf64-sparc.c:1362 elf64-sparc.c:1411 +#: elf64-sparc.c:1360 #, c-format -msgid " previously %s in %s" -msgstr " daha önce %2$s içinde %1$s" +msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" +msgstr "`%1$s' sembolünün farklı türleri var: %2$s içinde REGISTER (yazmaç), daha önce %4$s içinde %3$s" -#: elf64-sparc.c:1359 elf64-sparc.c:1408 +#: elf64-sparc.c:1406 #, c-format -msgid "Symbol `%s' has differing types: %s in %s" -msgstr "`%1$s' sembolünün farklý türleri var: %3$s içinde %2$s" +msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" +msgstr "" +"`%1$s' sembolünün farklı türleri var: %3$s içinde %2$s, \n" +" daha önce %4$s içinde REGISTER (yazmaç)" -#: elf64-sparc.c:3014 +#: elf64-sparc.c:2970 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" -msgstr "%s: UltraSPARC'a özel kod HAL'e özel kod ile baðlanýyor" +msgstr "%s: UltraSPARC'a özel kod HAL'e özel kod ile bağlanıyor" -#: elfcode.h:1218 +#: elfcode.h:1198 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" -msgstr "%s: sürüm sayýsý (%ld) sembol sayýsý (%ld) ile eþleþmiyor" +msgstr "%s: sürüm sayısı (%ld) sembol sayısı (%ld) ile eşleşmiyor" -#: elflink.c:434 +#: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" -msgstr "%s: %s bölümü içine %ld baytlýk bir delik koymak için fazla büyük" +msgstr "%s: %s bölümü içine %ld baytlık bir delik koymak için fazla büyük" -#: elflink.h:1113 +#: elflink.h:1090 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" -msgstr "%s: uyarý: `%s' için beklenmeyen yeniden tanýmlama" +msgstr "%s: uyarı: `%s' için beklenmeyen yeniden tanımlama" -#: elflink.h:1784 +#: elflink.h:1727 #, c-format msgid "%s: %s: invalid version %u (max %d)" -msgstr "%s: %s: geçersiz sürüm %u (maksimum %d)" +msgstr "%s: %s: geçersiz sürüm %u (maksimum %d)" -#: elflink.h:1825 +#: elflink.h:1768 #, c-format msgid "%s: %s: invalid needed version %d" -msgstr "%s: %s: geçersiz gerekli sürüm %d" +msgstr "%s: %s: geçersiz gerekli sürüm %d" -#: elflink.h:1945 +#: elflink.h:1890 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" -msgstr "Uyarý: `%s' sembolünün boyu %lu'dan %lu'ya %s içerisinde deðiþti" +msgstr "Uyarı: `%s' sembolünün boyu %lu'dan %lu'ya %s içerisinde değişti" -#: elflink.h:4020 +#: elflink.h:3174 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" +msgstr "%s: DSO içinde preinit_array'e izin verilmiyor" + +#: elflink.h:4030 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" -msgstr "uyarý: `%s' dinamik sembolünün türü ve boyu tanýmlý deðil" +msgstr "uyarı: `%s' dinamik sembolünün türü ve boyu tanımlı değil" -#: elflink.h:4329 +#: elflink.h:4345 #, c-format msgid "%s: undefined versioned symbol name %s" -msgstr "%s: sürümlü sembol ismi %s tanýmlý deðil" +msgstr "%s: sürümlü sembol ismi %s tanımlı değil" -#: elflink.h:4559 elflink.h:4567 elflink.h:6218 elflink.h:7295 +#: elflink.h:4611 elflink.h:4619 elflink.h:6508 elflink.h:7600 msgid "Error: out of memory" -msgstr "Hata: bellek tükendi" +msgstr "Hata: bellek tükendi" -#: elflink.h:4729 +#: elflink.h:4781 msgid "Not enough memory to sort relocations" -msgstr "Yerdeðiþimleri sýralamak için gerekli bellek yok" +msgstr "Yerdeğişimleri sıralamak için gerekli bellek yok" + +#: elflink.h:5682 elflink.h:5725 +#, c-format +msgid "%s: could not find output section %s" +msgstr "%s: çıktı bölümü %s bulunamadı" -#: elflink.h:5995 +#: elflink.h:5688 +#, c-format +msgid "warning: %s section has zero size" +msgstr "uyarı: %s bölümü sıfır boyunda" + +#: elflink.h:6275 #, c-format msgid "%s: could not find output section %s for input section %s" -msgstr "%1$s: girdi bölümü %3$s için çýktý bölümü %2$s bulunamadý" +msgstr "%1$s: girdi bölümü %3$s için çıktı bölümü %2$s bulunamadı" + +#: elflink.h:6486 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" +msgstr "%1$s: %3$s bölümünde %2$s içinde yerdeğişim boy uyuşmazlığı" -#: elflink.h:6568 +#: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" -msgstr "uyarý: silinmiþ bölüme yer deðiþim; sýfýrlandý" +msgstr "uyarı: silinmiş bölüme yer değişim; sıfırlandı" -#: elflink.h:6598 +#: elflink.h:6879 msgid "warning: relocation against removed section" -msgstr "%1$s: silinmiþ bölüme yerdeðiþim" +msgstr "%1$s: silinmiş bölüme yerdeğişim" -#: elflink.h:6611 +#: elflink.h:6892 #, c-format msgid "local symbols in discarded section %s" -msgstr "atýlmýþ %s bölümünde yerel semboller" +msgstr "atılmış %s bölümünde yerel semboller" + +#: elfxx-mips.c:734 +msgid "static procedure (no name)" +msgstr "statik altyordam (isimsiz)" + +#: elfxx-mips.c:1601 +msgid "not enough GOT space for local GOT entries" +msgstr "yerel GOT girdileri için yeterli GOT yeri yok" + +#: elfxx-mips.c:2750 +#, c-format +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgstr "%s: %s+0x%lx: jal olmayan koçan yordamına sıçrama" + +#: elfxx-mips.c:4270 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "%s: %s bölümü için geçersiz yer değişim bulundu" + +#: elfxx-mips.c:4348 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgstr "%s: 0x%lx'deki CALL16 yerdeğişimi evrensel sembole göre değil" + +#: elfxx-mips.c:7301 +#, c-format +msgid "%s: illegal section name `%s'" +msgstr "%s: geçersiz bölüm adı `%s'" + +#: elfxx-mips.c:7615 +#, c-format +msgid "%s: linking PIC files with non-PIC files" +msgstr "%s: PIC dosyaları PIC olmayan dosyalarla bağlanıyor" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: elfxx-mips.c:7625 +#, c-format +msgid "%s: linking abicalls files with non-abicalls files" +msgstr "%s: abicalls dosyaları abicalls olmayan dosyalarla bağlanıyor" + +#: elfxx-mips.c:7654 +#, c-format +msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgstr "%1$s: Önceki modüllerle (-mips%3$d) ile ISA uyumsuzluğu (-mips%2$d)" + +#: elfxx-mips.c:7676 +#, c-format +msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgstr "%1$s: Önceki modüllerle (%3$d) ile ISA uyumsuzluğu (%2$d)" + +#: elfxx-mips.c:7699 +#, c-format +msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgstr "%s: ABI uyumsuzluğu: %s modülü önceki %s modülle bağlanıyor" + +#: elfxx-mips.c:7759 +msgid " [abi=O32]" +msgstr " [abi=O32]" + +#: elfxx-mips.c:7761 +msgid " [abi=O64]" +msgstr " [abi=O64]" + +#: elfxx-mips.c:7763 +msgid " [abi=EABI32]" +msgstr " [abi=EABI32]" + +#: elfxx-mips.c:7765 +msgid " [abi=EABI64]" +msgstr " [abi=EABI64]" + +#: elfxx-mips.c:7767 +msgid " [abi unknown]" +msgstr " [abi bilinmiyor]" + +#: elfxx-mips.c:7769 +msgid " [abi=N32]" +msgstr " [abi=N32]" + +#: elfxx-mips.c:7771 +msgid " [abi=64]" +msgstr " [abi=64]" + +#: elfxx-mips.c:7773 +msgid " [no abi set]" +msgstr " [abi atanmamış]" + +#: elfxx-mips.c:7776 +msgid " [mips1]" +msgstr " [mips1]" + +#: elfxx-mips.c:7778 +msgid " [mips2]" +msgstr " [mips2]" + +#: elfxx-mips.c:7780 +msgid " [mips3]" +msgstr " [mips3]" + +#: elfxx-mips.c:7782 +msgid " [mips4]" +msgstr " [mips4]" + +#: elfxx-mips.c:7784 +msgid " [mips5]" +msgstr " [mips5]" + +#: elfxx-mips.c:7786 +msgid " [mips32]" +msgstr " [mips32]" + +#: elfxx-mips.c:7788 +msgid " [mips64]" +msgstr " [mips64]" + +#: elfxx-mips.c:7790 +msgid " [unknown ISA]" +msgstr " [bilinmeyen ISA]" + +#: elfxx-mips.c:7793 +msgid " [mdmx]" +msgstr " [mdmx]" + +#: elfxx-mips.c:7796 +msgid " [mips16]" +msgstr " [mips16]" + +#: elfxx-mips.c:7799 +msgid " [32bitmode]" +msgstr " [32bitkipi]" + +#: elfxx-mips.c:7801 +msgid " [not 32bitmode]" +msgstr " [32bitkipi değil]" + +#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 #, c-format msgid "Output file requires shared library `%s'\n" -msgstr "Çýktý dosyasý için paylaþýmlý kitaplýk `%s' gerekli\n" +msgstr "Çıktı dosyası için paylaşımlı kitaplık `%s' gerekli\n" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" -msgstr "Çýktý dosyasý için paylaþýmlý kitaplýk `%s.so.%s' gerekli\n" +msgstr "Çıktı dosyası için paylaşımlı kitaplık `%s.so.%s' gerekli\n" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 -#: sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 +#: sparclinux.c:657 sparclinux.c:707 #, c-format msgid "Symbol %s not defined for fixups\n" -msgstr "%s sembolü düzeltmeler için tanýmlý deðil\n" +msgstr "%s sembolü düzeltmeler için tanımlı değil\n" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 msgid "Warning: fixup count mismatch\n" -msgstr "Uyarý: düzeltme sayý uyumsuzluðu\n" +msgstr "Uyarı: düzeltme sayı uyumsuzluğu\n" #: ieee.c:235 #, c-format @@ -1518,261 +1765,261 @@ msgstr "%s: dizge fazla uzun (%d karakter, en fazla 65535)" #: ieee.c:365 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" -msgstr "%s: bilinmeyen `%s' sembol bayraklarý 0x%x" +msgstr "%s: bilinmeyen `%s' sembol bayrakları 0x%x" #: ieee.c:877 #, c-format -msgid "%s: unimplemented ATI record %u for symbol %u" -msgstr "%1$s: %3$u için desteklenmeyen ATI kaydý %2$u" +msgid "%s: unimplemented ATI record %u for symbol %u" +msgstr "%1$s: %3$u sembolü için desteklenmeyen ATI kaydı %2$u" #: ieee.c:902 #, c-format msgid "%s: unexpected ATN type %d in external part" -msgstr "%s: dýþ parçada beklenmeyen ATN türü %d" +msgstr "%s: dış parçada beklenmeyen ATN türü %d" #: ieee.c:924 #, c-format msgid "%s: unexpected type after ATN" -msgstr "%s: ATN'den sonra beklenmeyen tür" +msgstr "%s: ATN'den sonra beklenmeyen tür" #: ihex.c:258 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" -msgstr "%s:%d: Intel Onaltýlýk dosyasýnda beklenmeyen `%s' karakteri\n" +msgstr "%s:%d: Intel Onaltılık dosyasında beklenmeyen `%s' karakteri\n" -#: ihex.c:368 +#: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -"%s:%u: Intel Onaltýlýk dosyasýnda hatalý saðlama toplamý\n" +"%s:%u: Intel Onaltılık dosyasında hatalı sağlama toplamı\n" " (%u beklendi, %u bulundu)" -#: ihex.c:422 +#: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun adres kaydý uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun adres kaydı uzunluğu" -#: ihex.c:439 +#: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun baþlangýç adresi uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun başlangıç adresi uzunluğu" -#: ihex.c:456 +#: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun lineer adres kaydý uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun lineer adres kaydı uzunluğu" -#: ihex.c:473 +#: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun lineer baþlangýç adres uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun lineer başlangıç adres uzunluğu" -#: ihex.c:490 +#: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda bilinmeyen onaltýlýk türü %u\n" +msgstr "%s:%u: Intel Onaltılık dosyasında bilinmeyen onaltılık türü %u\n" -#: ihex.c:610 +#: ihex.c:607 #, c-format msgid "%s: internal error in ihex_read_section" -msgstr "%s: ihex_read_section'da iç hata" +msgstr "%s: ihex_read_section'da iç hata" -#: ihex.c:645 +#: ihex.c:642 #, c-format msgid "%s: bad section length in ihex_read_section" -msgstr "%s: ihex_read_section'da hatalý bölüm uzunluðu" +msgstr "%s: ihex_read_section'da hatalı bölüm uzunluğu" -#: ihex.c:863 +#: ihex.c:860 #, c-format -msgid "%s: address 0x%s out of range for Intex Hex file" -msgstr "%s: Intex Onaltýlýk dosyasý için 0x%s adresi kapsamdýþý" +msgid "%s: address 0x%s out of range for Intel Hex file" +msgstr "%s: Intex Onaltılık dosyası için 0x%s adresi kapsamdışı" #: libbfd.c:492 #, c-format msgid "not mapping: data=%lx mapped=%d\n" -msgstr "eþlenmeyen: veri=%lx eþleþen=%d\n" +msgstr "eşlenmeyen: veri=%lx eşleşen=%d\n" #: libbfd.c:495 msgid "not mapping: env var not set\n" -msgstr "eþlenmeyen: çevre deðiþkeni atanmamýþ\n" +msgstr "eşlenmeyen: çevre değişkeni atanmamış\n" -#: libbfd.c:1463 +#: libbfd.c:1466 #, c-format -msgid "Deprecated %s called" -msgstr "Geçerliliði kalkmýþ %s çaðrýldý" +msgid "Deprecated %s called at %s line %d in %s\n" +msgstr "Geçersizleşmiş %s, %s'da, %d satırı, %s içerisinde çağrıldı\n" -#: libbfd.c:1465 +#: libbfd.c:1469 #, c-format -msgid " at %s line %d in %s\n" -msgstr "%s, %d satýrý, %s içerisinde\n" +msgid "Deprecated %s called\n" +msgstr "Geçerliliği kalkmış %s çağrıldı\n" -#: linker.c:1849 +#: linker.c:1873 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" -msgstr "%1$s: `%3$s'den endirekt sembol `%2$s'e çevrim" +msgstr "%1$s: `%3$s'den endirekt sembol `%2$s'e çevrim" -#: linker.c:2745 +#: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" -msgstr "%s girdi ve %s çýktýsý ile yerdeðiþimli bað deneniyor" +msgstr "%s girdi ve %s çıktısı ile yerdeğişimli bağ deneniyor" -#: merge.c:897 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" -msgstr "%s: karýþtýrýlmýþ bölümün sonundan ileride eriþim (%ld + %ld)" +msgstr "%s: karıştırılmış bölümün sonundan ileride erişim (%ld + %ld)" #: mmo.c:460 #, c-format msgid "%s: No core to allocate section name %s\n" -msgstr "%s: %s bölüm adýný ayýracak `core' yok\n" +msgstr "%s: %s bölüm adını ayıracak `core' yok\n" -#: mmo.c:537 +#: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" -msgstr "%s: %d bayt uzunluðunda bir sembole yer ayýrmak için `core' yok\n" +msgstr "%s: %d bayt uzunluğunda bir sembole yer ayırmak için `core' yok\n" -#: mmo.c:1190 +#: mmo.c:1245 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" -msgstr "%s: geçersiz mmo dosyasý: $255 için baþlangýç deðeri `Main' deðil\n" +msgstr "%s: geçersiz mmo dosyası: $255 için başlangıç değeri `Main' değil\n" -#: mmo.c:1336 +#: mmo.c:1391 #, c-format msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" msgstr "" -"%1$s: `%4$s' ile baþlayan sembol adýndan sonra desteklenmeyen\n" -" geniþ karakter dizisi 0x%2$02X 0x%3$02X\n" +"%1$s: `%4$s' ile başlayan sembol adından sonra desteklenmeyen\n" +" geniş karakter dizisi 0x%2$02X 0x%3$02X\n" -#: mmo.c:1571 +#: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" -msgstr "%s: geçersiz mmo dosyasý: desteklenmeyen lopkod `%d'\n" +msgstr "%s: geçersiz mmo dosyası: desteklenmeyen lopkod `%d'\n" -#: mmo.c:1581 +#: mmo.c:1643 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" -msgstr "%s: geçersiz mmo dosyasý: YZ = 1 beklendi, lop_quote için YZ = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: YZ = 1 beklendi, lop_quote için YZ = %d bulundu\n" -#: mmo.c:1617 +#: mmo.c:1679 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -"%s: geçersiz mmo dosyasý: z = 1 veya z = 2 beklendi, \n" -" lop_loc için z = %d bulundu\n" +"%s: geçersiz mmo dosyası: z = 1 veya z = 2 beklendi, \n" +" lop_loc için z = %d bulundu\n" -#: mmo.c:1663 +#: mmo.c:1725 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" -msgstr "%s: geçersiz mmo dosyasý: z = 1 veya z = 2 beklendi; lop_fixo için z = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: z = 1 veya z = 2 beklendi; lop_fixo için z = %d bulundu\n" -#: mmo.c:1702 +#: mmo.c:1764 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" -msgstr "%s: geçersiz mmo dosyasý: y = 0 beklendi; lop_fixrx için y = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: y = 0 beklendi; lop_fixrx için y = %d bulundu\n" -#: mmo.c:1711 +#: mmo.c:1773 #, c-format msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -"%s: geçersiz mmo dosyasý: z = 16 veya z = 24 beklendi;\n" -" lop_fixrx için z = %d bulundu\n" +"%s: geçersiz mmo dosyası: z = 16 veya z = 24 beklendi;\n" +" lop_fixrx için z = %d bulundu\n" -#: mmo.c:1734 +#: mmo.c:1796 #, c-format msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n" msgstr "" -"%s: geçersiz mmo dosyasý: iþlenen word'un ilk baytý 0 veya 1 olmalý; \n" -" lop_fixrx için %d bulundu\n" +"%s: geçersiz mmo dosyası: işlenen word'un ilk baytı 0 veya 1 olmalı; \n" +" lop_fixrx için %d bulundu\n" -#: mmo.c:1757 +#: mmo.c:1819 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" -msgstr "%s: %d sayýlý dosya için dosya adý ayrýlamadý, %d bayt\n" +msgstr "%s: %d sayılı dosya için dosya adı ayrılamadı, %d bayt\n" -#: mmo.c:1777 +#: mmo.c:1839 #, c-format msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" -msgstr "%s: geçersiz mmo dosyasý: %d sayýlý dosya, `%s', zaten `%s' olarak girilmiþ\n" +msgstr "%s: geçersiz mmo dosyası: %d sayılı dosya, `%s', zaten `%s' olarak girilmiş\n" -#: mmo.c:1790 +#: mmo.c:1852 #, c-format msgid "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -"%s: geçersiz mmo dosyasý: %d sayýsý için dosya adý kullanýmdan\n" -" önce belirtilmemiþ\n" +"%s: geçersiz mmo dosyası: %d sayısı için dosya adı kullanımdan\n" +" önce belirtilmemiş\n" -#: mmo.c:1896 +#: mmo.c:1958 #, c-format msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -"%s: geçersiz mmo dosyasý: lop_stab'in y ve z alanlarý sýfýr deðil;\n" +"%s: geçersiz mmo dosyası: lop_stab'in y ve z alanları sıfır değil;\n" " y: %d, z: %d\n" -#: mmo.c:1932 +#: mmo.c:1994 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" -msgstr "%s: geçersiz mmo dosyasý: lop_end dosyadaki son girdi deðil\n" +msgstr "%s: geçersiz mmo dosyası: lop_end dosyadaki son girdi değil\n" -#: mmo.c:1945 +#: mmo.c:2007 #, c-format msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n" msgstr "" -"%s: geçersiz mmo dosyasý: lop_end'in YZ'si (%ld); bir önceki \n" -" lop_stab'in (%ld) dörtlü sayýsýna eþit deðil\n" +"%s: geçersiz mmo dosyası: lop_end'in YZ'si (%ld); bir önceki \n" +" lop_stab'in (%ld) dörtlü sayısına eşit değil\n" -#: mmo.c:2610 +#: mmo.c:2670 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" -msgstr "%s: geçersiz sembol tablosu: tekrarlanmýþ sembol `%s'\n" +msgstr "%s: geçersiz sembol tablosu: tekrarlanmış sembol `%s'\n" -#: mmo.c:2898 +#: mmo.c:2921 #, c-format msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n" msgstr "" -"%1$s: Hatalý sembol tanýmý: `Main' baþlangýç adresi %3$s yerine \n" -" %2$s olarak tanýmlanmýþ\n" +"%1$s: Hatalı sembol tanımı: `Main' başlangıç adresi %3$s yerine \n" +" %2$s olarak tanımlanmış\n" -#: mmo.c:2932 +#: mmo.c:3011 #, c-format msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n" msgstr "" -"%s: uyarý: sembol tablosu mmo için fazla büyük, 65535 32-bit word'den\n" -" fazla: %d. Yalnýz `Main' üretilecek. \n" +"%s: uyarı: sembol tablosu mmo için fazla büyük, 65535 32-bit word'den\n" +" fazla: %d. Yalnız `Main' üretilecek. \n" -#: mmo.c:2977 +#: mmo.c:3056 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" -msgstr "%s: iç hata, sembol tablosu büyüklüðü %d'den %d word'e deðiþti\n" +msgstr "%s: iç hata, sembol tablosu büyüklüğü %d'den %d word'e değişti\n" -#: mmo.c:3032 +#: mmo.c:3111 #, c-format msgid "%s: internal error, internal register section %s had contents\n" -msgstr "%s: iç hata, %s iç yazmaç bölümü içerik taþýyor\n" +msgstr "%s: iç hata, %s iç yazmaç bölümü içerik taşıyor\n" -#: mmo.c:3084 +#: mmo.c:3163 #, c-format msgid "%s: no initialized registers; section length 0\n" -msgstr "%s: ilklenen yazmaç yok; bölüm uzunluðu 0\n" +msgstr "%s: ilklenen yazmaç yok; bölüm uzunluğu 0\n" -#: mmo.c:3090 +#: mmo.c:3169 #, c-format msgid "%s: too many initialized registers; section length %ld\n" -msgstr "%s: çok fazla ilklenmiþ yazmaç; bölüm uzunluðu %ld\n" +msgstr "%s: çok fazla ilklenmiş yazmaç; bölüm uzunluğu %ld\n" -#: mmo.c:3095 +#: mmo.c:3174 #, c-format msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n" -msgstr "%s: %ld uzunluðunda ilklenmiþ yazmaçlar için hatalý baþlangýç adresi: 0x%lx%08lx\n" +msgstr "%s: %ld uzunluğunda ilklenmiş yazmaçlar için hatalı başlangıç adresi: 0x%lx%08lx\n" -#: oasys.c:1036 +#: oasys.c:1029 #, c-format msgid "%s: can not represent section `%s' in oasys" -msgstr "%s: oasys'de `%s' bölümü gösterilemiyor" +msgstr "%s: oasys'de `%s' bölümü gösterilemiyor" #: osf-core.c:132 #, c-format msgid "Unhandled OSF/1 core file section type %d\n" -msgstr "Desteklenmeyen OSF/1 core dosyasý bölüm türü %d\n" +msgstr "Desteklenmeyen OSF/1 core dosyası bölüm türü %d\n" #: pe-mips.c:658 #, c-format @@ -1787,62 +2034,66 @@ msgstr "%s: `ld -r' PE MIPS nesneleri ile birlikte desteklenmiyor\n" #: pe-mips.c:794 #, c-format msgid "%s: unimplemented %s\n" -msgstr "%s: tamamlanmamýþ %s\n" +msgstr "%s: tamamlanmamış %s\n" #: pe-mips.c:820 #, c-format msgid "%s: jump too far away\n" -msgstr "%s: sýçrama fazla uzak\n" +msgstr "%s: sıçrama fazla uzak\n" #: pe-mips.c:847 #, c-format msgid "%s: bad pair/reflo after refhi\n" -msgstr "%s: refhi'den sonra hatalý çift/reflo\n" +msgstr "%s: refhi'den sonra hatalı çift/reflo\n" #. XXX code yet to be written. #: peicode.h:785 #, c-format msgid "%s: Unhandled import type; %x" -msgstr "%s: Desteklenmeyen ithal türü; %x" +msgstr "%s: Desteklenmeyen ithal türü; %x" #: peicode.h:790 #, c-format msgid "%s: Unrecognised import type; %x" -msgstr "%s: Tanýnmayan ithal türü; %x" +msgstr "%s: Tanınmayan ithal türü; %x" #: peicode.h:804 #, c-format msgid "%s: Unrecognised import name type; %x" -msgstr "%s: Tanýnmayan ithal isim türü; %x" +msgstr "%s: Tanınmayan ithal isim türü; %x" #: peicode.h:1162 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) arþivinde tanýnmayan makina türü (0x%x) " +msgstr "%s: İthal Kitaplık Biçem (ILF) arşivinde tanınmayan makina türü (0x%x) " #: peicode.h:1174 #, c-format msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) arþivinde bilinen fakat desteklenmeyen makina türü (0x%x)" +msgstr "%s: İthal Kitaplık Biçem (ILF) arşivinde bilinen fakat desteklenmeyen makina türü (0x%x)" #: peicode.h:1191 #, c-format msgid "%s: size field is zero in Import Library Format header" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) baþlýðýnda boy alaný sýfýr" +msgstr "%s: İthal Kitaplık Biçem (ILF) başlığında boy alanı sıfır" #: peicode.h:1219 #, c-format msgid "%s: string not null terminated in ILF object file." -msgstr "%s: ILF nesne dosyasýnda dizge boþ deðerle sonlanmamýþ." +msgstr "%s: ILF nesne dosyasında dizge boş değerle sonlanmamış." #: ppcboot.c:416 -msgid "\nppcboot header:\n" -msgstr "\nppcboot baþlýðý:\n" +msgid "" +"\n" +"ppcboot header:\n" +msgstr "" +"\n" +"ppcboot başlığı:\n" #: ppcboot.c:417 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" -msgstr "Girdi göreli konumu = 0x%.8lx (%ld)\n" +msgstr "Girdi göreli konumu = 0x%.8lx (%ld)\n" #: ppcboot.c:418 #, c-format @@ -1852,702 +2103,807 @@ msgstr "Uzunluk = 0x%.8lx (%ld)\n" #: ppcboot.c:421 #, c-format msgid "Flag field = 0x%.2x\n" -msgstr "Bayrak alaný = 0x%.2x\n" +msgstr "Bayrak alanı = 0x%.2x\n" #: ppcboot.c:427 #, c-format msgid "Partition name = \"%s\"\n" -msgstr "Bölüm adý = \"%s\"\n" +msgstr "Bölüm adı = \"%s\"\n" #: ppcboot.c:446 #, c-format -msgid "\nPartition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "\nBölüm[%d] baþlangýcý = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgid "" +"\n" +"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgstr "" +"\n" +"Bölüm[%d] başlangıcı = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" #: ppcboot.c:452 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "Bölüm[%d] sonu = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgstr "Bölüm[%d] sonu = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" #: ppcboot.c:458 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" -msgstr "Bölüm[%d] sektörü = 0x%.8lx (%ld)\n" +msgstr "Bölüm[%d] sektörü = 0x%.8lx (%ld)\n" #: ppcboot.c:459 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" -msgstr "Bölüm[%d] uzunluðu = 0x%.8lx (%ld)\n" +msgstr "Bölüm[%d] uzunluğu = 0x%.8lx (%ld)\n" -#: som.c:5402 +#: som.c:5398 msgid "som_sizeof_headers unimplemented" -msgstr "som_sizeof_headers tamamlanmamýþ" +msgstr "som_sizeof_headers tamamlanmamış" #: srec.c:301 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" -msgstr "%s:%d: S-kayýt dosyasýnda beklenmeyen `%s' karakteri\n" +msgstr "%s:%d: S-kayıt dosyasında beklenmeyen `%s' karakteri\n" -#: syms.c:996 +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "%s(%s+0x%lx): Stabs girdisinde geçersiz dizge indeksi." + +#: syms.c:1044 msgid "Unsupported .stab relocation" -msgstr "Desteklenmeyen .stab yerdeðiþimi" +msgstr "Desteklenmeyen .stab yerdeğişimi" #: vms-gsd.c:356 #, c-format msgid "bfd_make_section (%s) failed" -msgstr "bfd_make_section (%s) baþarýsýz" +msgstr "bfd_make_section (%s) başarısız" #: vms-gsd.c:371 #, c-format msgid "bfd_set_section_flags (%s, %x) failed" -msgstr "bfd_set_section_flags (%s, %x) baþarýsýz" +msgstr "bfd_set_section_flags (%s, %x) başarısız" #: vms-gsd.c:407 #, c-format msgid "Size mismatch section %s=%lx, %s=%lx" -msgstr "Boy uyumsuzluðu bölümü %s=%lx, %s=%lx" +msgstr "Boy uyumsuzluğu bölümü %s=%lx, %s=%lx" -#: vms-gsd.c:704 +#: vms-gsd.c:702 #, c-format msgid "unknown gsd/egsd subtype %d" -msgstr "bilinmeyen gsd/egsd alt türü %d" +msgstr "bilinmeyen gsd/egsd alt türü %d" #: vms-hdr.c:406 msgid "Object module NOT error-free !\n" -msgstr "Nesne modülü hatasýz DEÐÝL !\n" +msgstr "Nesne modülü hatasız DEĞİL !\n" #: vms-misc.c:543 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" -msgstr "_bfd_vms_push'da yýðýt taþmasý (%d)" +msgstr "_bfd_vms_push'da yığıt taşması (%d)" #: vms-misc.c:561 msgid "Stack underflow in _bfd_vms_pop" -msgstr "_bfd_vms_pop'da yýðýt alt taþmasý" +msgstr "_bfd_vms_pop'da yığıt alt taşması" #: vms-misc.c:919 msgid "_bfd_vms_output_counted called with zero bytes" -msgstr "_bfd_vms_output_counted sýfýr bayt ile çaðrýldý" +msgstr "_bfd_vms_output_counted sıfır bayt ile çağrıldı" #: vms-misc.c:924 msgid "_bfd_vms_output_counted called with too many bytes" -msgstr "_bfd_vms_output_counted fazla bayt ile çaðrýldý" +msgstr "_bfd_vms_output_counted fazla bayt ile çağrıldı" #: vms-misc.c:1055 #, c-format msgid "Symbol %s replaced by %s\n" -msgstr "%s sembolü %s ile deðiþtirildi\n" +msgstr "%s sembolü %s ile değiştirildi\n" #: vms-misc.c:1117 #, c-format msgid "failed to enter %s" -msgstr "%s'e giriþ baþarýsýz" +msgstr "%s'e giriş başarısız" -#: vms-tir.c:78 +#: vms-tir.c:81 msgid "No Mem !" -msgstr "Hafýza Yok !" +msgstr "Hafıza Yok !" -#: vms-tir.c:313 -msgid "Bad section index in ETIR_S_C_STA_PQ" -msgstr "ETIR_S_C_STA_PQ'de hatalý bölüm indeksi" - -#: vms-tir.c:328 +#: vms-tir.c:362 #, c-format -msgid "Unsupported STA cmd %d" -msgstr "Desteklenmeyen STA komutu %d" +msgid "bad section index in %s" +msgstr "%s içinde hatalı bölüm indeksi" -#: vms-tir.c:333 vms-tir.c:1301 +#: vms-tir.c:375 #, c-format -msgid "Reserved STA cmd %d" -msgstr "Ayrýlmýþ STA komutu %d" +msgid "unsupported STA cmd %s" +msgstr "Desteklenmeyen STA komutu %s" -#: vms-tir.c:443 +#: vms-tir.c:380 vms-tir.c:1240 #, c-format -msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_GBL: sembol yok \"%s\"" +msgid "reserved STA cmd %d" +msgstr "Ayrılmış STA komutu %d" -#: vms-tir.c:465 +#: vms-tir.c:491 vms-tir.c:514 #, c-format -msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_CA: sembol yok \"%s\"" - -#: vms-tir.c:478 -msgid "ETIR_S_C_STO_RB/AB: Not supported" -msgstr "ETIR_S_C_STO_RB/AB: Desteklenmiyor" +msgid "%s: no symbol \"%s\"" +msgstr "%s: \"%s\" sembolü yok" -#: vms-tir.c:538 -msgid "ETIR_S_C_STO_LP_PSB: Not supported" -msgstr "ETIR_S_C_STO_LP_PSB: Desteklenmiyor" - -#: vms-tir.c:544 -msgid "ETIR_S_C_STO_HINT_GBL: not implemented" -msgstr "ETIR_S_C_STO_HINT_GBL: tamamlanmamýþ" - -#: vms-tir.c:550 -msgid "ETIR_S_C_STO_HINT_PS: not implemented" -msgstr "ETIR_S_C_STO_HINT_PS: tamamlanmamýþ" - -#: vms-tir.c:554 vms-tir.c:1473 +#. unsigned shift +#. rotate +#. Redefine symbol to current location. +#. Define a literal. +#: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 +#: vms-tir.c:838 vms-tir.c:1563 #, c-format -msgid "Reserved STO cmd %d" -msgstr "Ayrýlmýþ STO komutu %d" - -#: vms-tir.c:667 -msgid "ETIR_S_C_OPR_INSV: Not supported" -msgstr "ETIR_S_C_OPR_INSV: Desteklenmiyor" +msgid "%s: not supported" +msgstr "%s: desteklenmiyor" -#: vms-tir.c:685 -msgid "ETIR_S_C_OPR_USH: Not supported" -msgstr "ETIR_S_C_OPR_USH: Desteklenmiyor" - -#: vms-tir.c:691 -msgid "ETIR_S_C_OPR_ROT: Not supported" -msgstr "ETIR_S_C_OPR_ROT: Desteklenmiyor" - -#: vms-tir.c:710 -msgid "ETIR_S_C_OPR_REDEF: Not supported" -msgstr "ETIR_S_C_OPR_REDEF: Desteklenmiyor" - -#: vms-tir.c:716 -msgid "ETIR_S_C_OPR_DFLIT: Not supported" -msgstr "ETIR_S_C_OPR_DFLIT: Desteklenmiyor" - -#: vms-tir.c:720 vms-tir.c:1668 +#: vms-tir.c:586 vms-tir.c:1418 #, c-format -msgid "Reserved OPR cmd %d" -msgstr "Ayrýlmýþ OPR komutu %d" +msgid "%s: not implemented" +msgstr "%s: tamamlanmamış" -#: vms-tir.c:788 vms-tir.c:1737 +#: vms-tir.c:590 vms-tir.c:1422 #, c-format -msgid "Reserved CTL cmd %d" -msgstr "Ayrýlmýþ CTL komutu %d" +msgid "reserved STO cmd %d" +msgstr "Ayrılmış STO komutu %d" -#: vms-tir.c:816 -msgid "ETIR_S_C_STC_LP: not supported" -msgstr "ETIR_S_C_STC_LP: desteklenmiyor" +#: vms-tir.c:708 vms-tir.c:1568 +#, c-format +msgid "reserved OPR cmd %d" +msgstr "Ayrılmış OPR komutu %d" -#: vms-tir.c:834 -msgid "ETIR_S_C_STC_GBL: not supported" -msgstr "ETIR_S_C_STC_GBL: desteklenmiyor" +#: vms-tir.c:776 vms-tir.c:1632 +#, c-format +msgid "reserved CTL cmd %d" +msgstr "Ayrılmış CTL komutu %d" -#: vms-tir.c:842 -msgid "ETIR_S_C_STC_GCA: not supported" -msgstr "ETIR_S_C_STC_GCA: desteklenmiyor" +#. stack byte from image +#. arg: none. +#: vms-tir.c:1148 +msgid "stack-from-image not implemented" +msgstr "Görüntüden-yığıt tamamlanmamış" -#: vms-tir.c:851 -msgid "ETIR_S_C_STC_PS: not supported" -msgstr "ETIR_S_C_STC_PS: desteklenmiyor" +#: vms-tir.c:1166 +msgid "stack-entry-mask not fully implemented" +msgstr "Yığın girdi maskı tamamlanmamış" +#. compare procedure argument +#. arg: cs symbol name +#. by argument index +#. da argument descriptor #. -#. * stack byte from image -#. * arg: - -#. * -#. -#: vms-tir.c:1199 -msgid "Stack-from-image not implemented" -msgstr "Görüntüden-yýðýt tamamlanmamýþ" - -#: vms-tir.c:1219 -msgid "Stack-entry-mask not fully implemented" -msgstr "Yýðýn girdi maský tamamlanmamýþ" - -#. -#. * compare procedure argument -#. * arg: cs symbol name -#. * by argument index -#. * da argument descriptor -#. * -#. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) -#. * and stack TRUE (args match) or FALSE (args dont match) value -#. -#: vms-tir.c:1235 +#. compare argument descriptor with symbol argument (ARG$V_PASSMECH) +#. and stack TRUE (args match) or FALSE (args dont match) value. +#: vms-tir.c:1180 msgid "PASSMECH not fully implemented" -msgstr "PASSMECH tamamlanmamýþ" +msgstr "PASSMECH tamamlanmamış" -#: vms-tir.c:1256 -msgid "Stack-local-symbol not fully implemented" -msgstr "Yerel sembol yýðýtý tamamlanmamýþ" +#: vms-tir.c:1199 +msgid "stack-local-symbol not fully implemented" +msgstr "Yerel sembol yığıtı tamamlanmamış" -#: vms-tir.c:1271 -msgid "Stack-literal not fully implemented" -msgstr "Yýðýt sabiti tamamlanmamýþ" +#: vms-tir.c:1212 +msgid "stack-literal not fully implemented" +msgstr "Yığıt sabiti tamamlanmamış" -#: vms-tir.c:1294 -msgid "Stack-local-symbol-entry-point-mask not fully implemented" -msgstr "Yýðýn yerel sembol girdi nokta maský tamamlanmamýþ" +#: vms-tir.c:1233 +msgid "stack-local-symbol-entry-point-mask not fully implemented" +msgstr "Yığın yerel sembol girdi noktası maskı tamamlanmamış" -#: vms-tir.c:1469 +#: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 +#: vms-tir.c:1619 vms-tir.c:1627 #, c-format -msgid "Unimplemented STO cmd %d" -msgstr "Tamamlanmamýþ STO komutu %d" - -#: vms-tir.c:1608 -msgid "TIR_S_C_OPR_ASH incomplete" -msgstr "TIR_S_C_OPR_ASH tamamlanmamýþ" - -#: vms-tir.c:1622 -msgid "TIR_S_C_OPR_USH incomplete" -msgstr "TIR_S_C_OPR_USH tamamlanmamýþ" +msgid "%s: not fully implemented" +msgstr "%s: tamamlanmamış" -#: vms-tir.c:1636 -msgid "TIR_S_C_OPR_ROT incomplete" -msgstr "TIR_S_C_OPR_ROT tamamlanmamýþ" - -#. -#. * redefine symbol to current location -#. -#: vms-tir.c:1657 -msgid "TIR_S_C_OPR_REDEF not supported" -msgstr "TIR_S_C_OPR_REDEF desteklenmiyor" - -#. -#. * define a literal -#. -#: vms-tir.c:1664 -msgid "TIR_S_C_OPR_DFLIT not supported" -msgstr "TIR_S_C_OPR_DFLIT desteklenmiyor" - -#: vms-tir.c:1718 -msgid "TIR_S_C_CTL_DFLOC not fully implemented" -msgstr "TIR_S_C_CTL_DFLOC tamamlanmamýþ" - -#: vms-tir.c:1726 -msgid "TIR_S_C_CTL_STLOC not fully implemented" -msgstr "TIR_S_C_CTL_STLOC tamamlanmamýþ" - -#: vms-tir.c:1734 -msgid "TIR_S_C_CTL_STKDL not fully implemented" -msgstr "TIR_S_C_CTL_STKDL tamamlanmamýþ" - -#: vms-tir.c:1791 +#: vms-tir.c:1684 #, c-format -msgid "Obj code %d not found" -msgstr "Nesne kodu %d bulunmadý" +msgid "obj code %d not found" +msgstr "Nesne kodu %d bulunmadı" -#: vms-tir.c:2137 +#: vms-tir.c:2019 #, c-format msgid "SEC_RELOC with no relocs in section %s" -msgstr "%s bölümünde yerdeðiþim olmaksýzýn SEC_RELOC" +msgstr "%s bölümünde yerdeğişim olmaksızın SEC_RELOC" -#: vms-tir.c:2424 +#: vms-tir.c:2307 #, c-format msgid "Unhandled relocation %s" -msgstr "Desteklenmeyen yerdeðiþim %s" +msgstr "Desteklenmeyen yerdeğişim %s" -#: xcofflink.c:1241 +#: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" -msgstr "%s: `%s' satýr numaralarýna sahip fakat onu içeren bölümü yok" +msgstr "%s: `%s' satır numaralarına sahip fakat onu içeren bölümü yok" -#: xcofflink.c:1294 +#: xcofflink.c:1296 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" -msgstr "%s: sýnýf %d sembol `%s'un alternatif girdileri yok" +msgstr "%s: sınıf %d sembol `%s'un alternatif girdileri yok" -#: xcofflink.c:1317 +#: xcofflink.c:1319 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" -msgstr "%s: `%s' sembolünde bilinmeyen csect türü %d var" +msgstr "%s: `%s' sembolünde bilinmeyen csect türü %d var" -#: xcofflink.c:1329 +#: xcofflink.c:1331 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" -msgstr "%s: hatalý XTY_ER sembolü `%s': sýnýf %d scnum %d scnlen %d" +msgstr "%s: hatalı XTY_ER sembolü `%s': sınıf %d scnum %d scnlen %d" -#: xcofflink.c:1365 +#: xcofflink.c:1367 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" -msgstr "%s: XMC_TC0 sembolü `%s': sýnýf %d scnlen %d" +msgstr "%s: XMC_TC0 sembolü `%s': sınıf %d scnlen %d" -#: xcofflink.c:1517 +#: xcofflink.c:1519 #, c-format msgid "%s: csect `%s' not in enclosing section" -msgstr "%s: csect `%s' onu içeren bölümde deðil" +msgstr "%s: csect `%s' onu içeren bölümde değil" -#: xcofflink.c:1624 +#: xcofflink.c:1626 #, c-format msgid "%s: misplaced XTY_LD `%s'" -msgstr "%s: XTY_LD `%s'yanlýþ yerde" +msgstr "%s: XTY_LD `%s'yanlış yerde" -#: xcofflink.c:1948 +#: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" -msgstr "%s: yerdeðiþim %s:%d csect içinde deðil" +msgstr "%s: yerdeğişim %s:%d csect içinde değil" -#: xcofflink.c:2083 +#: xcofflink.c:2092 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" -msgstr "%s: XCOFF çýktýsý oluþturulmazken XCOFF paylaþýmlý nesnesi" +msgstr "%s: XCOFF çıktısı oluşturulmazken XCOFF paylaşımlı nesnesi" -#: xcofflink.c:2104 +#: xcofflink.c:2113 #, c-format msgid "%s: dynamic object with no .loader section" -msgstr "%s: .loader bölümü olmayan dinamik nesne" +msgstr "%s: .loader bölümü olmayan dinamik nesne" -#: xcofflink.c:2749 +#: xcofflink.c:2758 #, c-format msgid "%s: no such symbol" -msgstr "%s: böyle bir sembol yok" +msgstr "%s: böyle bir sembol yok" -#: xcofflink.c:2890 +#: xcofflink.c:2891 msgid "error: undefined symbol __rtinit" -msgstr "hata: tanýmlanmamýþ sembol __rtinit" +msgstr "hata: tanımlanmamış sembol __rtinit" -#: xcofflink.c:3458 +#: xcofflink.c:3453 #, c-format msgid "warning: attempt to export undefined symbol `%s'" -msgstr "uyarý: tanýmlanmamýþ `%s' sembolünü ihraç denemesi" +msgstr "uyarı: tanımlanmamış `%s' sembolünü ihraç denemesi" -#: xcofflink.c:4452 +#: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" -msgstr "TOC taþmasý: 0x%lx > 0x10000; -mminimal-toc ile derlemeyi deneyin" +msgstr "TOC taşması: 0x%lx > 0x10000; -mminimal-toc ile derlemeyi deneyin" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" -msgstr "%s: bilinmeyen `%s' bölümünde yükleyici yerdeðiþimi" +msgstr "%s: bilinmeyen `%s' bölümünde yükleyici yerdeğişimi" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" -msgstr "%s: `%s' yükleyici yerdeðiþiminde fakat yükleyici sembolü deðil" +msgstr "%s: `%s' yükleyici yerdeğişiminde fakat yükleyici sembolü değil" -#: xcofflink.c:5329 +#: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" -msgstr "%s: %s salt-okunur bölümünde yükleyici yerdeðiþimi" +msgstr "%s: %s salt-okunur bölümünde yükleyici yerdeğişimi" -#: elf32-ia64.c:2190 elf64-ia64.c:2190 +#: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" msgstr "yerel sembole @pltoff yerdegisimi" -#: elf32-ia64.c:2248 elf64-ia64.c:2248 -msgid "non-zero addend in @fptr reloc" -msgstr "@fptr yerdeðiþiminde sýfýr olmayan eklenti" - -#: elf32-ia64.c:3414 elf64-ia64.c:3414 +#: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" -msgstr "%s: kýsa veri bölümünde taþma (0x%lx >= 0x400000)" +msgstr "%s: kısa veri bölümünde taşma (0x%lx >= 0x400000)" -#: elf32-ia64.c:3425 elf64-ia64.c:3425 +#: elf32-ia64.c:3573 elf64-ia64.c:3573 #, c-format msgid "%s: __gp does not cover short data segment" -msgstr "%s: __gp kýsa veri bölümünü kapsamýyor" +msgstr "%s: __gp kısa veri bölümünü kapsamıyor" -#: elf32-ia64.c:3729 elf64-ia64.c:3729 +#: elf32-ia64.c:3858 elf64-ia64.c:3858 #, c-format msgid "%s: linking non-pic code in a shared library" -msgstr "%s: pic olmayan kod paylaþmalý kitaplýkta baðlanýyor" +msgstr "%s: pic olmayan kod paylaşmalı kitaplıkta bağlanıyor" -#: elf32-ia64.c:3762 elf64-ia64.c:3762 +#: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" -msgstr "%s: %s dinamik sembolüne @gprel yerdeðiþimi" +msgstr "%s: %s dinamik sembolüne @gprel yerdeğişimi" -#: elf32-ia64.c:3901 elf64-ia64.c:3901 +#: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" -msgstr "%s: kuþkulu düzeltmeye dinamik yerdeðiþim" +msgstr "%s: kuşkulu düzeltmeye dinamik yerdeğişim" -#: elf32-ia64.c:3909 elf64-ia64.c:3909 +#: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format msgid "%s: speculation fixup against undefined weak symbol" -msgstr "%s: tanýmlanmamýþ gevþek sembole tartýþmalý düzeltme" +msgstr "%s: tanımlanmamış gevşek sembole tartışmalı düzeltme" -#: elf32-ia64.c:4093 elf64-ia64.c:4093 +#: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" -msgstr "desteklenmeyen yerdeðiþim" +msgstr "desteklenmeyen yerdeğişim" -#: elf32-ia64.c:4373 elf64-ia64.c:4373 +#: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" -msgstr "%s: NULL-halinde-tuzakla karþý-baþvurusu tuzaklamayan dosyalarla baðlandý" +msgstr "%s: NULL-halinde-tuzakla karşı-başvurusu tuzaklamayan dosyalarla bağlandı" -#: elf32-ia64.c:4382 elf64-ia64.c:4382 +#: elf32-ia64.c:4560 elf64-ia64.c:4560 #, c-format msgid "%s: linking big-endian files with little-endian files" -msgstr "%s: büyük sonlu dosyalar küçük sonlu dosyalarla baðlanýyor" +msgstr "%s: büyük sonlu dosyalar küçük sonlu dosyalarla bağlanıyor" -#: elf32-ia64.c:4391 elf64-ia64.c:4391 +#: elf32-ia64.c:4569 elf64-ia64.c:4569 #, c-format msgid "%s: linking 64-bit files with 32-bit files" -msgstr "%s: 64 bitlik dosyalar 32 bitlik dosyalarla baðlanýyor" +msgstr "%s: 64 bitlik dosyalar 32 bitlik dosyalarla bağlanıyor" -#: elf32-ia64.c:4400 elf64-ia64.c:4400 +#: elf32-ia64.c:4578 elf64-ia64.c:4578 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" -msgstr "%s: constant-gp dosyalarý constant-gp olmayan dosyalarla baðlanýyor" +msgstr "%s: constant-gp dosyaları constant-gp olmayan dosyalarla bağlanıyor" -#: elf32-ia64.c:4410 elf64-ia64.c:4410 +#: elf32-ia64.c:4588 elf64-ia64.c:4588 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" -msgstr "%s: auto-pic dosyalarý auto-pic olmayan dosyalarla baðlanýyor" +msgstr "%s: auto-pic dosyaları auto-pic olmayan dosyalarla bağlanıyor" -#: peigen.c:964 pepigen.c:964 +#: peigen.c:962 pepigen.c:962 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" -msgstr "%s: satýr numarasý taþmasý: 0x%lx > 0xffff" +msgstr "%s: satır numarası taşması: 0x%lx > 0xffff" -#: peigen.c:981 pepigen.c:981 +#: peigen.c:979 pepigen.c:979 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" -msgstr "%s: yerdeðiþim taþmasý 1: 0x%lx > 0xffff" +msgstr "%s: yerdeğişim taşması 1: 0x%lx > 0xffff" -#: peigen.c:995 pepigen.c:995 +#: peigen.c:993 pepigen.c:993 msgid "Export Directory [.edata (or where ever we found it)]" -msgstr "Ýhraç Dizini [.edata (veya nerede bulundu ise)]" +msgstr "İhraç Dizini [.edata (veya nerede bulundu ise)]" -#: peigen.c:996 pepigen.c:996 +#: peigen.c:994 pepigen.c:994 msgid "Import Directory [parts of .idata]" -msgstr "Ýthal Dizini [.idata'nýn parçalarý]" +msgstr "İthal Dizini [.idata'nın parçaları]" -#: peigen.c:997 pepigen.c:997 +#: peigen.c:995 pepigen.c:995 msgid "Resource Directory [.rsrc]" msgstr "Kaynak Dizini [.rsrc]" -#: peigen.c:998 pepigen.c:998 +#: peigen.c:996 pepigen.c:996 msgid "Exception Directory [.pdata]" -msgstr "Ýstisna Dizini [.pdata]" +msgstr "İstisna Dizini [.pdata]" -#: peigen.c:999 pepigen.c:999 +#: peigen.c:997 pepigen.c:997 msgid "Security Directory" -msgstr "Güvenlik Dizini" +msgstr "Güvenlik Dizini" -#: peigen.c:1000 pepigen.c:1000 +#: peigen.c:998 pepigen.c:998 msgid "Base Relocation Directory [.reloc]" -msgstr "Temel Yerdeðiþim Dizini [.reloc]" +msgstr "Temel Yerdeğişim Dizini [.reloc]" -#: peigen.c:1001 pepigen.c:1001 +#: peigen.c:999 pepigen.c:999 msgid "Debug Directory" -msgstr "Hata Ayýklama Dizini" +msgstr "Hata Ayıklama Dizini" -#: peigen.c:1002 pepigen.c:1002 +#: peigen.c:1000 pepigen.c:1000 msgid "Description Directory" -msgstr "Açýklama Dizini" +msgstr "Açıklama Dizini" -#: peigen.c:1003 pepigen.c:1003 +#: peigen.c:1001 pepigen.c:1001 msgid "Special Directory" -msgstr "Özel Dizin" +msgstr "Özel Dizin" -#: peigen.c:1004 pepigen.c:1004 +#: peigen.c:1002 pepigen.c:1002 msgid "Thread Storage Directory [.tls]" msgstr "Dal Saklama Dizini [.tls]" -#: peigen.c:1005 pepigen.c:1005 +#: peigen.c:1003 pepigen.c:1003 msgid "Load Configuration Directory" -msgstr "Ayar Yükleme Dizini" +msgstr "Ayar Yükleme Dizini" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1004 pepigen.c:1004 msgid "Bound Import Directory" -msgstr "Sýnýr Ýthal Dizini" +msgstr "Sınır İthal Dizini" -#: peigen.c:1007 pepigen.c:1007 +#: peigen.c:1005 pepigen.c:1005 msgid "Import Address Table Directory" -msgstr "Adres Tablosu Ýthal Dizini" +msgstr "Adres Tablosu İthal Dizini" -#: peigen.c:1008 pepigen.c:1008 +#: peigen.c:1006 pepigen.c:1006 msgid "Delay Import Directory" -msgstr "Gecikmeli Ýthal Dizini" +msgstr "Gecikmeli İthal Dizini" -#: peigen.c:1009 peigen.c:1010 pepigen.c:1009 pepigen.c:1010 +#: peigen.c:1007 peigen.c:1008 pepigen.c:1007 pepigen.c:1008 msgid "Reserved" -msgstr "Ayrýlmýþ" +msgstr "Ayrılmış" -#: peigen.c:1073 pepigen.c:1073 -msgid "\nThere is an import table, but the section containing it could not be found\n" -msgstr "\nBir ithal tablosu var, fakat onu içeren bölüm bulunamadý\n" +#: peigen.c:1071 pepigen.c:1071 +msgid "" +"\n" +"There is an import table, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ithal tablosu var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1078 pepigen.c:1078 +#: peigen.c:1076 pepigen.c:1076 #, c-format -msgid "\nThere is an import table in %s at 0x%lx\n" -msgstr "\n%s içerisinde 0x%lx'de bir ithal tablosu var\n" +msgid "" +"\n" +"There is an import table in %s at 0x%lx\n" +msgstr "" +"\n" +"%s içerisinde 0x%lx'de bir ithal tablosu var\n" -#: peigen.c:1115 pepigen.c:1115 +#: peigen.c:1113 pepigen.c:1113 #, c-format -msgid "\nFunction descriptor located at the start address: %04lx\n" -msgstr "\nBaþlangýç adresinde iþlev betimleyicisi bulundu: %04lx\n" +msgid "" +"\n" +"Function descriptor located at the start address: %04lx\n" +msgstr "" +"\n" +"Başlangıç adresinde işlev betimleyicisi bulundu: %04lx\n" -#: peigen.c:1118 pepigen.c:1118 +#: peigen.c:1116 pepigen.c:1116 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" -msgstr "\tkod temeli %08lx toc (yüklenebilir/gerçek) %08lx/%08lx\n" +msgstr "\tkod temeli %08lx toc (yüklenebilir/gerçek) %08lx/%08lx\n" -#: peigen.c:1124 pepigen.c:1124 -msgid "\nNo reldata section! Function descriptor not decoded.\n" -msgstr "\nReldata bölümü yok! Ýþlev betimleyicisi çözümlenemedi.\n" +#: peigen.c:1122 pepigen.c:1122 +msgid "" +"\n" +"No reldata section! Function descriptor not decoded.\n" +msgstr "" +"\n" +"Reldata bölümü yok! İşlev betimleyicisi çözümlenemedi.\n" -#: peigen.c:1129 pepigen.c:1129 +#: peigen.c:1127 pepigen.c:1127 #, c-format -msgid "\nThe Import Tables (interpreted %s section contents)\n" -msgstr "\nÝthal Tablolarý (%s bölüm içeriði çözümlendi)\n" - -#: peigen.c:1132 pepigen.c:1132 -msgid " vma: Hint Time Forward DLL First\n" -msgstr " vma: Ýpucu Zaman Ýleri DLL Ýlk\n" +msgid "" +"\n" +"The Import Tables (interpreted %s section contents)\n" +msgstr "" +"\n" +"İthal Tabloları (%s bölüm içeriği çözümlendi)\n" -#: peigen.c:1134 pepigen.c:1134 -msgid " Table Stamp Chain Name Thunk\n" -msgstr " Tablo Damga Zincir Ýsim Parça\n" +#: peigen.c:1130 pepigen.c:1130 +msgid "" +" vma: Hint Time Forward DLL First\n" +" Table Stamp Chain Name Thunk\n" +msgstr "" +" vma: İpucu Zaman İleri DLL İlk\n" +" Tablo Damga Zincir İsim Parça\n" -#: peigen.c:1182 pepigen.c:1182 +#: peigen.c:1181 pepigen.c:1181 #, c-format -msgid "\n\tDLL Name: %s\n" -msgstr "\n\tDLL Adý: %s\n" - -#: peigen.c:1186 peigen.c:1249 pepigen.c:1186 pepigen.c:1249 -msgid "\tvma: Hint/Ord Member-Name\n" -msgstr "\tvma: Ýpucu/Sýra Üye-Adý\n" - -#: peigen.c:1248 pepigen.c:1248 -msgid "\tThe Import Address Table (difference found)\n" -msgstr "\tÝthal Adres Tablosu (fark bulundu)\n" +msgid "" +"\n" +"\tDLL Name: %s\n" +msgstr "" +"\n" +"\tDLL Adı: %s\n" -#: peigen.c:1255 pepigen.c:1255 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "\t>>> IAT üyeleri bitti!\n" +#: peigen.c:1192 pepigen.c:1192 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" +msgstr "\tvma: İpucu/Sıra Üye-Adı Sınır\n" -#: peigen.c:1273 pepigen.c:1273 -msgid "\tThe Import Address Table is identical\n" -msgstr "\tÝthal Adres Tablosu ayný\n" +#: peigen.c:1217 pepigen.c:1217 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ilk parça var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1345 pepigen.c:1345 -msgid "\nThere is an export table, but the section containing it could not be found\n" -msgstr "\nBir ihraç tablosu var, fakat onu içeren bölüm bulunamadý\n" +#: peigen.c:1357 pepigen.c:1357 +msgid "" +"\n" +"There is an export table, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ihraç tablosu var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1350 pepigen.c:1350 +#: peigen.c:1362 pepigen.c:1362 #, c-format -msgid "\nThere is an export table in %s at 0x%lx\n" -msgstr "\n%s içinde 0x%lx'de bir ihraç tablosu var\n" +msgid "" +"\n" +"There is an export table in %s at 0x%lx\n" +msgstr "" +"\n" +"%s içinde 0x%lx'de bir ihraç tablosu var\n" -#: peigen.c:1381 pepigen.c:1381 +#: peigen.c:1393 pepigen.c:1393 #, c-format -msgid "\nThe Export Tables (interpreted %s section contents)\n\n" -msgstr "\nÝhraç Tablolarý (%s bölüm içeriði çözümlendi)\n\n" +msgid "" +"\n" +"The Export Tables (interpreted %s section contents)\n" +"\n" +msgstr "" +"\n" +"İhraç Tabloları (%s bölüm içeriği çözümlendi)\n" +"\n" -#: peigen.c:1385 pepigen.c:1385 +#: peigen.c:1397 pepigen.c:1397 #, c-format msgid "Export Flags \t\t\t%lx\n" -msgstr "Ýhraç Bayraklarý \t\t\t%lx\n" +msgstr "İhraç Bayrakları \t\t\t%lx\n" -#: peigen.c:1388 pepigen.c:1388 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" -msgstr "Saat/Tarih damgasý \t\t%lx\n" +msgstr "Saat/Tarih damgası \t\t%lx\n" -#: peigen.c:1391 pepigen.c:1391 +#: peigen.c:1403 pepigen.c:1403 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" -msgstr "Majör/Minör \t\t\t%d/%d\n" +msgstr "Majör/Minör \t\t\t%d/%d\n" -#: peigen.c:1394 pepigen.c:1394 +#: peigen.c:1406 pepigen.c:1406 msgid "Name \t\t\t\t" -msgstr "Ýsim \t\t\t\t" +msgstr "İsim \t\t\t\t" -#: peigen.c:1400 pepigen.c:1400 +#: peigen.c:1412 pepigen.c:1412 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "Onluk Sistem \t\t\t%ld\n" -#: peigen.c:1403 pepigen.c:1403 +#: peigen.c:1415 pepigen.c:1415 msgid "Number in:\n" -msgstr "Sayý içinde:\n" +msgstr "Sayı içinde:\n" -#: peigen.c:1406 pepigen.c:1406 +#: peigen.c:1418 pepigen.c:1418 #, c-format msgid "\tExport Address Table \t\t%08lx\n" -msgstr "\tÝhraç Adres Tablosu \t\t%08lx\n" +msgstr "\tİhraç Adres Tablosu \t\t%08lx\n" -#: peigen.c:1410 pepigen.c:1410 +#: peigen.c:1422 pepigen.c:1422 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" -msgstr "\t[Ýsim Gösterge/Onluk] Tablo\t%08lx\n" +msgstr "\t[İsim Gösterge/Onluk] Tablo\t%08lx\n" -#: peigen.c:1413 pepigen.c:1413 +#: peigen.c:1425 pepigen.c:1425 msgid "Table Addresses\n" msgstr "Tablo Adresleri\n" -#: peigen.c:1416 pepigen.c:1416 +#: peigen.c:1428 pepigen.c:1428 msgid "\tExport Address Table \t\t" -msgstr "\tÝhraç Adres Tablosu \t\t" +msgstr "\tİhraç Adres Tablosu \t\t" -#: peigen.c:1421 pepigen.c:1421 +#: peigen.c:1433 pepigen.c:1433 msgid "\tName Pointer Table \t\t" -msgstr "\tÝsim Gösterge Tablosu \t\t" +msgstr "\tİsim Gösterge Tablosu \t\t" -#: peigen.c:1426 pepigen.c:1426 +#: peigen.c:1438 pepigen.c:1438 msgid "\tOrdinal Table \t\t\t" msgstr "\tOnluk Tablo \t\t\t" -#: peigen.c:1441 pepigen.c:1441 +#: peigen.c:1453 pepigen.c:1453 #, c-format -msgid "\nExport Address Table -- Ordinal Base %ld\n" -msgstr "\nÝhraç Adres Tablosu -- Onluk Sistem %ld\n" +msgid "" +"\n" +"Export Address Table -- Ordinal Base %ld\n" +msgstr "" +"\n" +"İhraç Adres Tablosu -- Onluk Sistem %ld\n" -#: peigen.c:1460 pepigen.c:1460 +#: peigen.c:1472 pepigen.c:1472 msgid "Forwarder RVA" -msgstr "RVA Yönlendiricisi" +msgstr "RVA Yönlendiricisi" -#: peigen.c:1471 pepigen.c:1471 +#: peigen.c:1483 pepigen.c:1483 msgid "Export RVA" -msgstr "RVA Ýhracý" +msgstr "RVA İhracı" -#: peigen.c:1478 pepigen.c:1478 -msgid "\n[Ordinal/Name Pointer] Table\n" -msgstr "\n[Onluk/Ýsim Gösterge] Tablosu\n" +#: peigen.c:1490 pepigen.c:1490 +msgid "" +"\n" +"[Ordinal/Name Pointer] Table\n" +msgstr "" +"\n" +"[Onluk/İsim Gösterge] Tablosu\n" -#: peigen.c:1533 pepigen.c:1533 +#: peigen.c:1545 pepigen.c:1545 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" -msgstr "Uyarý, .pdata bölüm boyu (%ld) %d'nin katý deðil\n" +msgstr "Uyarı, .pdata bölüm boyu (%ld) %d'nin katı değil\n" -#: peigen.c:1537 pepigen.c:1537 -msgid "\nThe Function Table (interpreted .pdata section contents)\n" -msgstr "\nÝþlev Tablosu (.pdata bölüm içeriði çözümlendi)\n" +#: peigen.c:1549 pepigen.c:1549 +msgid "" +"\n" +"The Function Table (interpreted .pdata section contents)\n" +msgstr "" +"\n" +"İşlev Tablosu (.pdata bölüm içeriği çözümlendi)\n" -#: peigen.c:1540 pepigen.c:1540 +#: peigen.c:1552 pepigen.c:1552 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" -msgstr " vma:\t\t\tBaþlangýç Adresi Sonlanma Adresi Geri Al Bilgisi\n" - -#: peigen.c:1543 pepigen.c:1543 -msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" -msgstr " vma:\t\tBaþl. Son EH EH PrologSon Ýstisna\n" +msgstr " vma:\t\t\tBaşlangıç Adresi Sonlanma Adresi Geri Al Bilgisi\n" -#: peigen.c:1545 pepigen.c:1545 -msgid " \t\tAddress Address Handler Data Address Mask\n" -msgstr " \t\tAdres Adres Yön. Veri Adres Mask\n" +#: peigen.c:1554 pepigen.c:1554 +msgid "" +" vma:\t\tBegin End EH EH PrologEnd Exception\n" +" \t\tAddress Address Handler Data Address Mask\n" +msgstr "" +" vma:\t\tBaşl. Son EH EH PrologSon İstisna\n" +" \t\tAdres Adres Yakalay Veri Adres Maske\n" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" msgstr " Yazma milikodunu kaydet" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1627 pepigen.c:1627 msgid " Register restore millicode" msgstr " Geri alma milikodunu kaydet" -#: peigen.c:1619 pepigen.c:1619 +#: peigen.c:1630 pepigen.c:1630 msgid " Glue code sequence" -msgstr " Birleþtirici kod dizisi" +msgstr " Birleştirici kod dizisi" -#: peigen.c:1671 pepigen.c:1671 -msgid "\n\nPE File Base Relocations (interpreted .reloc section contents)\n" -msgstr "\n\nPE Dosya Temel Yerdeðiþimi (.reloc bölüm içeriði çözümlendi)\n" +#: peigen.c:1682 pepigen.c:1682 +msgid "" +"\n" +"\n" +"PE File Base Relocations (interpreted .reloc section contents)\n" +msgstr "" +"\n" +"\n" +"PE Dosya Temel Yerdeğişimi (.reloc bölüm içeriği çözümlendi)\n" -#: peigen.c:1701 pepigen.c:1701 +#: peigen.c:1712 pepigen.c:1712 #, c-format -msgid "\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" -msgstr "\nSanal Adres: %08lx Parça boyu %ld (0x%lx) Düzeltme Sayýsý %ld\n" +msgid "" +"\n" +"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" +msgstr "" +"\n" +"Sanal Adres: %08lx Parça boyu %ld (0x%lx) Düzeltme Sayısı %ld\n" -#: peigen.c:1714 pepigen.c:1714 +#: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" -msgstr "\tyer deðiþim %4d göreli konum %4x [%4lx] %s" +msgstr "\tyer değişim %4d göreli konum %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1754 pepigen.c:1754 +#: peigen.c:1765 pepigen.c:1765 #, c-format -msgid "\nCharacteristics 0x%x\n" -msgstr "\nÖzellikler 0x%x\n" +msgid "" +"\n" +"Characteristics 0x%x\n" +msgstr "" +"\n" +"Özellikler 0x%x\n" + +#~ msgid "GP relative relocation when GP not defined" +#~ msgstr "GP tanımlanmamışken GP göreli yer değiştirmesi" + +#~ msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" +#~ msgstr "%s: HATA: kayan sayıları kayan yazmaçlarda geçiriyor fakat hedef %s tamsayı yazmaç kullanıyor" + +#~ msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" +#~ msgstr "%s: HATA: kayan sayıları tamsayı yazmaçlarda geçiriyor fakat hedef %s kayan yazmaç kullanıyor" + +#~ msgid "Warning: input file %s supports interworking, whereas %s does not." +#~ msgstr "Uyarı: %s girdi dosyası beraber çalışmayı destekliyor, fakat %s desteklemiyor." + +#~ msgid "Warning: input file %s does not support interworking, whereas %s does." +#~ msgstr "Uyarı: %s girdi dosyası beraber çalışmayı desteklemiyor, fakat %s destekliyor." + +#~ msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" +#~ msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld sonraki %ld" + +#~ msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" +#~ msgstr "bfd sembolünden elf sembolü:0x%.8lx, isim= %s, sem num = %d, bayrak = 0x%.8lx%s\n" + +#~ msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" +#~ msgstr "Uyarı: beraber çalışmaz diye önceden belirtilmiş olduğundan %s'nin beraber çalışma bayrağı atanmadı" + +#~ msgid "Warning: Clearing the interwork flag of %s due to outside request" +#~ msgstr "Uyarı: Dış isteğe uyularak %s'nin beraber çalışma bayrağı temizlendi" + +#~ msgid " [APCS-26]" +#~ msgstr " [APCS-26]" + +#~ msgid " [APCS-32]" +#~ msgstr " [APCS-32]" + +#~ msgid "(unknown)" +#~ msgstr "(bilinmeyen)" + +#~ msgid " previously %s in %s" +#~ msgstr " daha önce %2$s içinde %1$s" + +#~ msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_GBL: sembol yok \"%s\"" + +#~ msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_CA: sembol yok \"%s\"" + +#~ msgid "ETIR_S_C_STO_RB/AB: Not supported" +#~ msgstr "ETIR_S_C_STO_RB/AB: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STO_LP_PSB: Not supported" +#~ msgstr "ETIR_S_C_STO_LP_PSB: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STO_HINT_GBL: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_GBL: tamamlanmamış" + +#~ msgid "ETIR_S_C_STO_HINT_PS: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_PS: tamamlanmamış" + +#~ msgid "ETIR_S_C_OPR_INSV: Not supported" +#~ msgstr "ETIR_S_C_OPR_INSV: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_USH: Not supported" +#~ msgstr "ETIR_S_C_OPR_USH: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_ROT: Not supported" +#~ msgstr "ETIR_S_C_OPR_ROT: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_REDEF: Not supported" +#~ msgstr "ETIR_S_C_OPR_REDEF: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_DFLIT: Not supported" +#~ msgstr "ETIR_S_C_OPR_DFLIT: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_GBL: not supported" +#~ msgstr "ETIR_S_C_STC_GBL: desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_GCA: not supported" +#~ msgstr "ETIR_S_C_STC_GCA: desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_PS: not supported" +#~ msgstr "ETIR_S_C_STC_PS: desteklenmiyor" + +#~ msgid "Unimplemented STO cmd %d" +#~ msgstr "Tamamlanmamış STO komutu %d" + +#~ msgid "TIR_S_C_OPR_ASH incomplete" +#~ msgstr "TIR_S_C_OPR_ASH tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_USH incomplete" +#~ msgstr "TIR_S_C_OPR_USH tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_ROT incomplete" +#~ msgstr "TIR_S_C_OPR_ROT tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_REDEF not supported" +#~ msgstr "TIR_S_C_OPR_REDEF desteklenmiyor" + +#~ msgid "TIR_S_C_OPR_DFLIT not supported" +#~ msgstr "TIR_S_C_OPR_DFLIT desteklenmiyor" + +#~ msgid "TIR_S_C_CTL_DFLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_DFLOC tamamlanmamış" + +#~ msgid "TIR_S_C_CTL_STLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_STLOC tamamlanmamış" + +#~ msgid "TIR_S_C_CTL_STKDL not fully implemented" +#~ msgstr "TIR_S_C_CTL_STKDL tamamlanmamış" + +#~ msgid " vma: Hint Time Forward DLL First\n" +#~ msgstr " vma: İpucu Zaman İleri DLL İlk\n" + +#~ msgid "\tThe Import Address Table (difference found)\n" +#~ msgstr "\tİthal Adres Tablosu (fark bulundu)\n" + +#~ msgid "\t>>> Ran out of IAT members!\n" +#~ msgstr "\t>>> IAT üyeleri bitti!\n" + +#~ msgid "\tThe Import Address Table is identical\n" +#~ msgstr "\tİthal Adres Tablosu aynı\n" + +#~ msgid " \t\tAddress Address Handler Data Address Mask\n" +#~ msgstr " \t\tAdres Adres Yön. Veri Adres Mask\n" diff --git a/bfd/reloc.c b/bfd/reloc.c index 5f76db1583f..e60c26e0512 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2788,8 +2788,18 @@ ENUM BFD_RELOC_V850_CALLT_16_16_OFFSET ENUMDOC This is a 16 bit offset from the call table base pointer. -COMMENT - +ENUM + BFD_RELOC_V850_LONGCALL +ENUMDOC + Used for relaxing indirect function calls. +ENUM + BFD_RELOC_V850_LONGJUMP +ENUMDOC + Used for relaxing indirect jumps. +ENUM + BFD_RELOC_V850_ALIGN +ENUMDOC + Used to maintain alignment whilst relaxing. ENUM BFD_RELOC_MN10300_32_PCREL ENUMDOC @@ -3359,17 +3369,53 @@ ENUM BFD_RELOC_M68HC11_HI8 ENUMDOC Motorola 68HC11 reloc. - This is the 8 bits high part of an absolute address. + This is the 8 bit high part of an absolute address. ENUM BFD_RELOC_M68HC11_LO8 ENUMDOC Motorola 68HC11 reloc. - This is the 8 bits low part of an absolute address. + This is the 8 bit low part of an absolute address. ENUM BFD_RELOC_M68HC11_3B ENUMDOC Motorola 68HC11 reloc. - This is the 3 bits of a value. + This is the 3 bit of a value. +ENUM + BFD_RELOC_M68HC11_RL_JUMP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks the beginning of a jump/call instruction. + It is used for linker relaxation to correctly identify beginning + of instruction and change some branchs to use PC-relative + addressing mode. +ENUM + BFD_RELOC_M68HC11_RL_GROUP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks a group of several instructions that gcc generates + and for which the linker relaxation pass can modify and/or remove + some of them. +ENUM + BFD_RELOC_M68HC11_LO16 +ENUMDOC + Motorola 68HC11 reloc. + This is the 16-bit lower part of an address. It is used for 'call' + instruction to specify the symbol address without any special + transformation (due to memory bank window). +ENUM + BFD_RELOC_M68HC11_PAGE +ENUMDOC + Motorola 68HC11 reloc. + This is a 8-bit reloc that specifies the page number of an address. + It is used by 'call' instruction to specify the page number of + the symbol. +ENUM + BFD_RELOC_M68HC11_24 +ENUMDOC + Motorola 68HC11 reloc. + This is a 24-bit reloc that represents the address with a 16-bit + value and a 8-bit page number. The symbol address is transformed + to follow the 16K memory bank of 68HC12 (seen as mapped in the window). ENUM BFD_RELOC_CRIS_BDISP8 diff --git a/bfd/syms.c b/bfd/syms.c index 8a8abf45387..6eea2d807df 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -806,6 +806,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) return symcount; error_return: + bfd_set_error (bfd_error_no_symbols); if (syms != NULL) free (syms); return -1; diff --git a/bfd/targets.c b/bfd/targets.c index ee378284da5..8d893eb2575 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -565,7 +565,9 @@ extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; +extern const bfd_target bfd_elf32_shlqnx_vec; extern const bfd_target bfd_elf32_shnbsd_vec; +extern const bfd_target bfd_elf32_shqnx_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; @@ -681,6 +683,12 @@ extern const bfd_target sparcnetbsd_vec; extern const bfd_target sunos_big_vec; extern const bfd_target tic30_aout_vec; extern const bfd_target tic30_coff_vec; +extern const bfd_target tic4x_coff0_beh_vec; +extern const bfd_target tic4x_coff0_vec; +extern const bfd_target tic4x_coff1_beh_vec; +extern const bfd_target tic4x_coff1_vec; +extern const bfd_target tic4x_coff2_beh_vec; +extern const bfd_target tic4x_coff2_vec; extern const bfd_target tic54x_coff0_beh_vec; extern const bfd_target tic54x_coff0_vec; extern const bfd_target tic54x_coff1_beh_vec; diff --git a/bfd/version.h b/bfd/version.h index dd782ce4836..d2a49164f98 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1 +1 @@ -#define BFD_VERSION_DATE 20020809 +#define BFD_VERSION_DATE 20020829 diff --git a/config.guess b/config.guess index ffcb6435df7..c5438deabca 100755 --- a/config.guess +++ b/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2002-07-09' +timestamp='2002-08-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -231,6 +231,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build cat <$dummy.s .data \$Lformat: @@ -256,7 +257,6 @@ main: jsr \$26,exit .end main EOF - eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `$dummy` in @@ -281,6 +281,9 @@ EOF 2-1307) UNAME_MACHINE="alphaev68" ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; esac fi rm -f $dummy.s $dummy && rmdir $tmpdir @@ -875,7 +878,7 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; @@ -986,6 +989,9 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) @@ -1079,6 +1085,9 @@ EOF SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; diff --git a/config.sub b/config.sub index 9ff085efaf7..b0222f7ea0b 100755 --- a/config.sub +++ b/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2002-07-03' +timestamp='2002-08-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -239,6 +239,7 @@ case $basic_machine in | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ + | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ @@ -246,6 +247,7 @@ case $basic_machine in | mipsisa32 | mipsisa32el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ns16k | ns32k \ @@ -307,6 +309,7 @@ case $basic_machine in | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ @@ -314,6 +317,7 @@ case $basic_machine in | mipsisa32-* | mipsisa32el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39 | mipstx39el \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ @@ -745,13 +749,13 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -772,22 +776,22 @@ case $basic_machine in power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown - ;; + ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown - ;; + ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; @@ -818,6 +822,12 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; sequent) basic_machine=i386-sequent ;; @@ -883,7 +893,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -941,8 +951,8 @@ case $basic_machine in os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -967,7 +977,7 @@ case $basic_machine in basic_machine=i386-pc os=-windows32-msvcrt ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; ymp) @@ -1022,7 +1032,7 @@ case $basic_machine in sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -1172,7 +1182,7 @@ case $os in os=-rtmk-nova ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; -nsk*) os=-nsk @@ -1211,8 +1221,8 @@ case $os in -xenix) os=-xenix ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; -none) ;; @@ -1249,7 +1259,7 @@ case $basic_machine in pdp10-*) os=-tops20 ;; - pdp11-*) + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1342,19 +1352,19 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) diff --git a/configure.in b/configure.in index 36bdf20dde1..a945dcb2432 100644 --- a/configure.in +++ b/configure.in @@ -1554,10 +1554,10 @@ cat >$sedtemp < + + * stack.c (print_frame_info_base): Always set current_source_symtab + and current_source_line. + +2002-08-29 Donn Terry + + * proc-api.c (rw_table): Fix typo in #ifdef PCSHOLD (missing S). + +2002-08-28 Keith Seitz + + * stack.c (select_frame): Add FIXME concerning selected-frame + events. + (select_frame_command): Send selected-frame-level-changed + event notification, but only if the level actually changed. + (up_silently_base): Add selected-frame-level-changed event + notification. + (down_silently_base): Likewise. + +2002-08-28 Andrew Cagney + + * Makefile.in: Update dependencies for all gdb/*.c files. + +2002-08-27 Tom Tromey + + * Makefile.in (osabi.o, i387-tdep.o, i386-linux-nat.o, lin-lwp.o, + ax-gdb.o, signals.o, jv-valprint.o, c-valprint.o, cp-abi.o): + Update dependencies. + * i387-tdep.c: Include gdb_string.h. + * osabi.c: Likewise. + * i386-linux-nat.c: Likewise. + * lin-lwp.c: Likewise. + * ax-gdb.c: Likewise. + * signals/signals.c: Likewise. + * jv-valprint.c: Likewise. + * p-lang.c: Likewise. + * c-valprint.c: Likewise. + * cp-abi.c: Likewise. + +2002-08-27 Elena Zannoni + + * cli/cli-script.h (copy_command_lines): Export. + * breakpoint.c: Include cli/cli-script.h. + * Makefile.in (breakpoint.o): Update dependencies. + +2002-08-26 Joel Brobecker + + * cli/cli-script.c (copy_command_lines): New function. + * defs.h (copy_command_lines): Export. + * testsuite/gdb.base/commands.exp: New tests for commands + attached to a temporary breakpoint, and for commands that + delete the breakpoint they are attached to. + +2002-08-26 Michael Snyder + + * breakpoint.c (bpstat_stop_status): Instead of copying the + pointer to the breakpoint commands struct, make a new copy + of the struct and point to that. + (bpstat_clear): Free the commands struct. + (bpstat_clear_actions): Free the commands struct. + (bpstat_do_actions): Free the command actions. Also execute + the local cleanups, instead of deleting them. + (delete_breakpoint): Leave the commands field of the bpstat + chain alone -- it will be freed later. + +2002-08-26 Kevin Buettner + + * rs6000-tdep.c (altivec_register_p): Restore function inadvertently + deleted in 2002-08-20 commit. This function is still used by + ppc-linux-nat.c. + +2002-08-26 Keith Seitz + + * gdb-events.sh: Add selected-frame-level-changed event. + * gdb-events.c: Regenerated. + * gdb-events.h: Regenerated. + +2002-08-26 Stephane Carrez + + Fix PR gdb/393: + * inflow.c (terminal_save_ours): New function to save terminal + settings. + * inferior.h (terminal_save_ours): Declare. + * target.c (debug_to_terminal_save_ours): New function. + (cleanup_target): Defaults to_terminal_save_ours. + (update_current_target): Inherit to_terminal_save_ours. + (setup_target_debug): Set to_terminal_save_ours. + * target.h (target_terminal_save_ours): New to save terminal settings. + (target_ops): New member to_terminal_save_ours. + * gnu-nat.c (init_gnu_ops): Set to_terminal_save_ours. + * hpux-thread.c (init_hpux_thread_ops): Likewise. + * inftarg.c (init_child_ops): Likewise. + * m3-nat.c (init_m3_ops): Likewise. + * procfs.c (init_procfs_ops): Likewise. + * wince.c (init_child_ops): Likewise. + * win32-nat.c (init_child_ops): Likewise. + * sol-thread.c (init_sol_thread_ops): Likewise. + +2002-08-26 Mark Kettenis + + * i386-tdep.c (i386_store_return_value): Undeprecate. Convert to + use regcache_* functions. + (i386_gdbarch_init): Set store_return_value instead of + deprecated_store_return_value. + + * regcache.c (regcache_raw_write_signed, + regcache_raw_write_unsigned): New functions. + * regcache.h (regcache_raw_write_signed, + regcache_raw_write_unsigned): New prototypes. + +2002-08-25 Andrew Cagney + + * Makefile.in (c-exp.tab.o, jv-exp.tab.o, f-exp.tab.o) + (m2-exp.tab.o, p-exp.tab.o, ada-exp.tab.o): Move to before the + source file dependencies. Cleanup corresponding generator rules. + +2002-08-25 Andrew Cagney + + * regcache.h (register_offset_hack): Declare. + (regcache_cooked_read_using_offset_hack): Declare. + (regcache_cooked_write_using_offset_hack): Declare. + + * regcache.c (register_offset_hack): New function. + (regcache_cooked_read_using_offset_hack): New function. + (regcache_cooked_write_using_offset_hack): New function. + (regcache_dump): Check that the registers, according to their + offset, are packed hard against each other. + (cooked_xfer_using_offset_hack): New function. + +2002-08-25 Andrew Cagney + + * regcache.c (struct regcache_descr): Add field register_type. + (init_legacy_regcache_descr): Pass a pre-allocated regcache_descr + in as a parameter + (init_regcache_descr): Initialize register_type. Pass the descr + to init_legacy_regcache_descr. Use register_type instead of + REGISTER_VIRTUAL_TYPE. + (register_type): New function. + (regcache_dump): Replace REGISTER_VIRTUAL_TYPE with register_type. + * regcache.h (register_type): Declare. + +2002-08-25 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Set store_struct_return + instead of deprecated_store_return_value. Fix fallout from + 2002-08-23 Andrew Cagney . + +2002-08-25 Andrew Cagney + + * regcache.c (max_register_size): New function. + (init_legacy_regcache_descr): Ensure that max_register_size is + large enough for REGISTER_VIRTUAL_SIZE. + * regcache.h (max_register_size): Declare. + +2002-08-24 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Use deprecated version of + store_return_value. + (e500_extract_return_value): Change type of valbuf pointer to + void. + +2002-08-24 Mark Kettenis + + * PROBLEMS: Clarify problems with FreeBSD's compiler and suggest + workaround. + + * valprint.c (print_longest) [CC_HAS_LONG_LONG && + PRINTF_HAS_LONG_LONG]: Cast val_long to (long long) or (unsigned + long long) to prevent compiler warning on 64-bit systems. + +2002-08-23 Andrew Cagney + + * gdbarch.sh (STORE_RETURN_VALUE): Add regcache parameter. + (DEPRECATED_STORE_RETURN_VALUE): New method. + (EXTRACT_RETURN_VALUE): Make buffer parameter a void pointer. + * gdbarch.h, gdbarch.c: Re-generate. + + * values.c (set_return_value): Pass current_regcache to + STORE_RETURN_VALUE. + * arch-utils.h (legacy_store_return_value): Declare. + * arch-utils.c (legacy_store_return_value): New function. + (legacy_extract_return_value): Update parameters. + + * config/pa/tm-hppa.h (DEPRECATED_STORE_RETURN_VALUE): Rename + STORE_RETURN_VALUE. + * config/pa/tm-hppa64.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/z8k/tm-z8k.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/sparc/tm-sparclet.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/mn10200/tm-mn10200.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m68k/tm-linux.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m68k/tm-delta68.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m32r/tm-m32r.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/h8500/tm-h8500.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/h8300/tm-h8300.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * i386-tdep.c (i386_extract_return_value): Update. + * arch-utils.c (legacy_extract_return_value): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + +2002-08-23 Andrew Cagney + + * config/djgpp/fnchange.lst: Add entries for bfd/elf32-ppcqnx.c, + bfd/elf32-ppc.c, bfd/elf32-sh.c and bfd/elf32-shqnx.c. + +2002-08-24 Mark Kettenis + + * PROBLEMS: Refer to GDB 5.3 instead of 5.2. Mention FreeBSD + problems. + +2002-08-23 Joel Brobecker + + * infrun.c (handle_inferior_event): Move a comment outside of a + function call, in order to avoid indent reformatting this part + of the code in an unreadable way. + +2002-08-23 Grace Sainsbury + + * infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg + when breakpoints fail. Move general breakpoint error messages to + insert_breakpoints. + * breakpoint.c (insert_breakpoints): Change warnings when + breakpoints are nto inserted to specify the type. Remove call to + memory_error when hardware breakpoints can't be inserted. Remove + multiple calls to warning so all messages are sent to the user at + once. + (delete_breakpoints): Make insert error messsages more explicit. + +2002-08-23 Daniel Jacobowitz + + * ChangeLog: Move gdbserver entries after GDB 5.2 to + gdbserver/ChangeLog. + +2002-08-23 Mark Kettenis + + * i386-tdep.c: Include "objfiles.h". + (i386_svr4_init_abi): Set in_solib_call_trampoline and + skip_trampoline_code. + * config/i386/tm-i386v4.h: Don't include "config/tm-sysv4.h". + (CPLUS_MARKER): Define to '.'. + + * linux-proc.c (struct linux_corefile_thread_data): Add num_notes + member. + (linux_corefile_thread_callback): Increase args->num_notes. + (linux_make_note_section): Initialize thread_args.num_notes, and + use it to determine whether notes for any threads were created. + +2002-08-23 Donn Terry + + * proc-api.c (rw_table): Do not include a row for PCDSTOP if the + corresponding macro is not defined. Likewise for PCNICE, PCSHOLD + and PCUNKILL. + (write_with_trace): Conditionalize out the switch branch handling + PCSHOLD if the corresponding macro is not defined. Likewise for + PRSABORT and PRSTOP. + This change will be needed by the Interix port. + +2002-08-22 Elena Zannoni + + * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): use + write_register wherever possible instead of manipulating the + register bytes directly. + Assign VALUE_CONTENTS to a variable and use that. + The GPR numbers are now dependent on the architecture. + +2002-08-22 Elena Zannoni + + * rs6000-tdep.c (struct rs6000_framedata): Add saved_ev and + ev_offset fields. + (skip_prologue): Add support for BookE/e500 instructions. + (e500_extract_return_value): New function. + (frame_get_saved_regs): Add support for saving ev registers and + pseudo gpr's. + (e500_store_return_value): New function. + (rs6000_gdbarch_init): Move up default intializations of + deprecated_extract_return_value and store_return_value. Overwrite + init of store_return_value with e500 specific version. + Set extract_return_value for e500. + +2002-08-22 Elena Zannoni + + * blockframe.c (generic_call_dummy_register_unwind): Use + regcache_cooked_read to catch cases in which the variable is + stored in a pseudo register. + +2002-08-22 Andrew Cagney + + * NEWS: Mention that the i960 has been made obsolete. + * Makefile.in (SFILES): Delete remote-nrom.c, remote-nindy.c and + i960-tdep.c + (remote-nrom.o): Obsolete target. + (remote-nindy.o, i960-tdep.o): Ditto. + * remote-nrom.c: Make file obsolete. + * remote-nindy.c, remote-vx960.c: Ditto. + * config/i960/vxworks960.mt, config/i960/nindy960.mt: Ditto. + * config/i960/mon960.mt, config/i960/tm-i960.h: Ditto. + * config/i960/tm-vx960.h, config/i960/tm-nindy960.h: Ditto. + * config/i960/tm-mon960.h, i960-tdep.c: Ditto. + * configure.tgt: Make i960-*-bout*, i960-nindy-coff*, + i960-*-coff*, i960-nindy-elf*, i960-*-elf*, i960-*-nindy* and + i960-*-vxworks* obsolete. + * MAINTAINERS: Note that the i960 is obsolete. + +2002-08-21 Corinna Vinschen + + * MAINTAINERS: Change the s390 target to s390-linux-gnu (second + attempt). + +2002-08-22 Jim Blandy + + * coffread.c (coff_symfile_read): Don't try to read the line + number table from disk if the image file doesn't have a symbol + table; we'll never actually look at the info anyway, and Windows + ships DLL's with bogus file offsets for the line number data. + +2002-08-21 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have + an e500 executable. + +2002-08-21 Michael Snyder + + * mips-tdep.c (MSYMBOL_IS_SPECIAL): Replace macro with function. + (MSYMBOL_SIZE): Replace macro with function. + (DEFAULT_MIPS_TYPE): Delete unused macro. + * config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): Delete unused macro. + * config/mips/tm-embed.h (DEFAULT_MIPS_TYPE): Delete unused macro. + +2002-08-21 Jim Blandy + + * valops.c (value_cast): Simplify and correct logic for doing a + static cast from a pointer to a base class to a pointer to a + derived class. + +2002-08-21 Andrew Cagney + + * infcmd.c (default_print_registers_info): Replace + do_registers_info. + (registers_info): Use gdbarch_print_registers_info instead of + DO_REGISTERS_INFO. + * inferior.h (default_print_registers_info): Replace + do_registers_info. + * gdbarch.sh (PRINT_REGISTERS_INFO): New method. + (DO_REGISTERS_INFO): Change to a predicate function. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-21 Keith Seitz + + * gdb-events.sh: Add target-changed event. + * gdb-events.c: Regenerated. + * gdb-events.c: Regenerated. + * valops.c (value_assign): Add target-changed event notification + to inlval_register, lval_memory, and lval_reg_frame_relative. + +2002-08-21 Joel Brobecker + + * NEWS: Add an entry regarding the improvement of the next/step + operation on Alpha Tru64 multi-processor machines. + +2002-08-21 Andrew Cagney + + * Makefile.in: Update dependencies for mi/ cli/ and tui/ + directores. + * Makefile.in: Update all _h macro definitions. + * Makefile.in (install-gdbtk): Move to install section. + (rdi-share/libangsd.a): Move to end of file. + +2002-08-19 Andrew Cagney + + * frame.c (frame_register_unwind): When a register, set addrp to + the register's byte. + +2002-08-20 Michael Snyder + + * mips-tdep.c (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): These are only + used locally, so move them from the target machine header to here. + (mips_set_processor_type, mips_register_name, mips32_next_pc, + mips16_next_pc, cached_proc_desc, mips_set_processor_type): + Make static. + * config/mips/tm-mips.h (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Delete. + +2002-08-20 Andrew Cagney + + * NEWS: Mention that the Apollo line was made obsolete. + * configure.tgt: Make m68*-apollo*-bsd*, m68*-hp-bsd*, and + m68*-hp-hpux* obsolete. + * configure.host: Make m68*-apollo*-sysv*, m68*-apollo*-bsd*, + m68*-hp-bsd* and m68*-hp-hpux* obsolete. + * buildsym.c (make_blockvector): Make static. + * buildsym.h (make_blockvector): Make extern declaration obsolete. + * Makefile.in (HFILES_NO_SRCDIR): Remove dst.h + (ALLDEPFILES): Remove dstread.c. + (dstread.o): Obsolete make rule. + * dstread.c: Makefile obsolete. + * dst.h: Ditto. + * config/m68k/hp300hpux.mt: Ditto. + * config/m68k/hp300hpux.mh: Ditto. + * config/m68k/hp300bsd.mt: Ditto. + * config/m68k/hp300bsd.mh: Ditto. + * config/m68k/apollo68b.mt: Ditto. + * config/m68k/apollo68v.mh: Ditto. + * config/m68k/apollo68b.mh: Ditto. + +2002-08-20 Michael Snyder + + * mips-tdep.c (mips_in_return_stub): Make static. + (mips_gdbarch_init): Set in_solib_return_trampoline. + * config/mips/tm-mips.h (IN_SOLIB_RETURN_TRAMPOLINE): Delete. + +2002-08-20 Michael Snyder + + * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Add. + * gdbarch.c, gdbarch.h: Regenerate. + * arch-utils.c, arch-utils.h (generic_in_solib_return_trampoline): + Add. + * infrun.c (IN_SOLIB_RETURN_TRAMPOLINE): Delete default definition. + +2002-08-20 Michael Snyder + + * mips-tdep.c (mips_skip_stub, mips_in_call_stub): Make static. + (mips_gdbarch_init): Set skip_trampoline_code, + in_solib_call_trampoline. + * config/mips/tm-mips.h (REGISTER_NAME): Delete. + (IN_SOLIB_CALL_TRAMPOLINE, SKIP_TRAMPOLINE_CODE): Delete. + +2002-08-20 Elena Zannoni + + * ppc-tdep.h (struct gdbarch_tdep): Add ev registers. + + * rs6000-tdep.c (rs6000_register_virtual_type): Return 64 bit + vector type for ev registers. + (e500_pseudo_register_read): New function. + (e500_pseudo_register_write): New function. + (e500_dwarf2_reg_to_regnum): New function. + (PPC_UISA_NOFP_SPRS): New macro. + (PPC_EV_REGS): New macro. + (PPC_GPRS_PSEUDO_REGS): New macro. + (registers_e500): New register set for e500. + (variants): Add e500 variant. + (rs6000_gdbarch_init): Move setting of pc, sp, fp regnums to + before setting architectural dependent variations. Initialize ev + registers numbers. Add case for e500 architecture. Set the + number of pseudo registers. + +2002-08-20 Elena Zannoni + + * rs6000-tdep.c: Clean up comments. + +2002-08-20 Andrew Cagney + + * h8300-tdep.c: Re-indent file. + +2002-08-20 Jim Blandy + + * Makefile.in (LDFLAGS): Allow the configure script to establish a + default for this. + +2002-08-20 Keith Seitz + + * breakpoints.c (watch_command_1): Use internal breakpoint + when setting a watchpoint_scope breakpoint. + +2002-08-20 Elena Zannoni + + * gdbtypes.c (build_builtin_type_vec64): Add name to type. + (build_builtin_type_vec64i): Ditto. + (build_builtin_type_vec128): Ditto. + (build_builtin_type_vec128i): Ditto. + +2002-08-19 Michael Snyder + + * config/mips/tm-mips.h (ELF_MAKE_MSYMBOL_SPECIAL): Delete. + (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Change into functions. + (FIX_CALL_DUMMY, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, + POP_FRAME, INIT_EXTRA_FRAME_INFO): Delete. + (CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET, + CALL_DUMMY_ADDRESS): Delete. + * mips-tdep.c (mips_elf_make_msymbol_special, mips_msymbol_size, + mips_msymbol_is_special, mips_fix_call_dummy): New functions. + (mips_gdbarch_init): Set elf_make_msymbol_special, pop_frame, + push_dummy_frame, fix_call_dummy, init_extra_frame_info, + push_return_address. + (mips_register_raw_size, mips_eabi_use_struct_convention, + mips_n32n64_use_struct_convention, mips_o32_use_struct_convention, + mips_o32_reg_struct_has_addr, mips_frame_saved_pc, mips_frame_chain, + mips_init_extra_frame_info, mips_eabi_push_arguments, + mips_n32n64_push_arguments, mips_push_return_address, + mips_push_dummy_frame, mips_pop_frame, mips_skip_prologue, + mips_breakpoint_from_pc, mips_call_dummy_address): Make static. + +2002-08-19 Michael Snyder + + * mips-tdep.c (mips_frame_num_args): New function. + (mips_gdbarch_init): Set frame_chain, frameless_function_invocation, + frame_saved_pc, frame_args_address, frame_locals_address, + frame_num_args, and frame_args_skip. + * config/mips/tm-mips.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, + FRAME_SAVED_PC, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, + FRAME_NUM_ARGS, FRAME_ARGS_SKIP): Delete. + * config/mips/tm-mipsv4.h (FRAME_CHAIN_VALID): Delete. + +2002-08-20 Michael Snyder + + * config/mips/tm-mips.h (STORE_STRUCT_RETURN): Delete. + (EXTRACT_STRUCT_VALUE_ADDRESS): Delete. + * mips-tdep.c (mips_store_struct_return): New function. + (mips_extract_struct_value_address): New function. + (mips_gdbarch_init): Set store_struct_return and + extract_struct_value_address. + +2002-08-20 David Carlton + + * dwarf2read.c (dwarf2_build_psymtabs): Check that + dwarf_line_offset is nonzero before creating dwarf_line_buffer. + (read_file_scope): Check that line_header is nonzero before + decoding macro information. + +2002-08-20 Mark Kettenis + + * i386-tdep.h (FP_REGNUM_P): Change such that we don't incorrectly + flag the general-purpose registers as floating-point on targets + that don't support the floating-point registers. + +2002-08-20 Elena Zannoni + + * rs6000-tdep.c (altivec_register_p): Delete. + (rs6000_do_altivec_registers): Delete. + (rs6000_altivec_registers_info): Delete. + (rs6000_do_registers_info): Delete. + (_initialize_rs6000_tdep): Remove command 'info powerpc altivec'. + (rs6000_gdbarch_init): Remove setting of do_registers_info. + +2002-08-20 Elena Zannoni + + * infcmd.c (do_registers_info): Print vector registers in hex + format only. + (print_vector_info): Check that printing registers + makes sense. + (print_float_info): Ditto. + +2002-08-20 Andrew Cagney + + * mips-tdep.c (mips_gdbarch_init): Update. + (mips_o32_extract_return_value): Rewrite. + (mips_o32_store_return_value): Rewrite. + (mips_o32_xfer_return_value): New function. + (mips_xfer_register): Tweak debug print message. Allow for + buf_offset when dumping the value transfered. + +2002-08-20 Andrew Cagney + + * config/mips/tm-nbsd.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-linux.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-irix5.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-irix6.h (MIPS_DEFAULT_ABI): Delete. + * mips-tdep.c (mips_gdbarch_init) [MIPS_DEFAULT_ABI]: Delete code. + +2002-08-14 Michael Snyder + + * mips-tdep.c (mips_frame_chain): Check for call-dummy frames. + +2002-08-19 Elena Zannoni + + * rs6000-tdep.c (struct reg): Add field to indicate a pseudo + register. + (P): New macro to define a register as a pseudo register. + (R, R4, R8, R16, FR32, R64, R0): Updated. + (struct variant): Add new fields for number of pseudo registers + and number of total registers. + (tot_num_registers): New macro replacing.... + (num_registers): ...deleted macro. + (num_registers): New function. + (num_pseudo_registers): New function. + (variants): Update all variants to intialize new fields correctly. + Postpone initialization of number of pseudo regs and real regs. + (init_variants): New function. + (rs6000_gdbarch_init): Initialize variants. Update calculation of + registers offsets. + +2002-08-19 David Carlton + + * valops.c (search_struct_field): Change error message to treat + return value of 0 from value_static_field as meaning that field is + optimized out. + (value_struct_elt_for_reference): Ditto. + * values.c (value_static_field): Treat an unresolved location the + same as a nonexistent symbol. Fix PR gdb/635. + * gnu-v2-abi.c (gnuv2_value_rtti_type): Eliminate test for being + enclosed. Fix PR gdb/574. + * MAINTAINERS: Add self to Write After Approval list. + +2002-08-19 Andrew Cagney + + * mips-tdep.c (mips_xfer_register): New function. + (mips_n32n64_extract_return_value): Rewrite. + (mips_gdbarch_init): For N32 and N64, set extract_return_value + instead of deprecated_extract_return_value. + +2002-08-19 Elena Zannoni + + * rs6000-tdep.c (TDEP): Delete macro. + (branch_dest): Replace use of TDEP macro with its body. + (rs6000_pop_frame): Ditto. + (rs6000_push_arguments): Ditto. + (rs6000_skip_trampoline_code): Ditto. + (rs6000_frame_saved_pc): Ditto. + (rs6000_frame_chain): Ditto. + (rs6000_register_name): Ditto. + (rs6000_register_byte): Ditto. + (rs6000_register_raw_size): Ditto. + (rs6000_register_virtual_type): Ditto. + (rs6000_register_convertible): Ditto. + (rs6000_convert_from_func_ptr_addr): Ditto. + +2002-08-19 Daniel Jacobowitz + + * config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define + conditionally. + (JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + * mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca + for MAX_REGISTER_RAW_SIZE arrays. + (mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + +2002-08-19 Pierre Muller + + * i387-tdep.c (i387_print_float_info): Fix typo in comment. + +2002-08-19 Aidan Skinner + + * Makefile.in (SFILES): Add ada-exp.y ada-lang.c ada-typeprint.c + ada-valprint.c ada-tasks.c. + (YYFILES): Add ada-exp.y. + (ada-exp.tab.c ada-lex.c ada-lang.o): New target. + (ada-tasks.o ada-typeprint.o ada-valprint.o): New target. + (ada-exp.tab.o): New target. + +2002-08-18 Andrew Cagney + + * regcache.c (regcache_xfer_part): New function. + (regcache_raw_read_part): New function. + (regcache_raw_write_part): New function. + (regcache_cooked_read_part): New function. + (regcache_cooked_write_part): New function. + * regcache.h (regcache_raw_read_part): Declare. + (regcache_raw_write_part): Declare. + (regcache_cooked_read_part): Declare. + (regcache_cooked_write_part): Declare. + +2002-08-18 Daniel Jacobowitz + + * remote.c (remote_open_1): Add async_p. + (remote_async_open_1): Delete. + (open_remote_target): Delete. + (remote_open, extended_remote_open): Update calls to remote_open_1. + (remote_async_open, extended_remote_async_open): Call + remote_open_1 instead of remote_async_open_1. + +2002-08-19 Mark Kettenis + + * blockframe.c: Fix a few coding standard violations. + +2002-08-19 Mark Kettenis + + * config/i386/nm-i386sco5.h (START_INFERIOR_TRAPS_EXPECTED): Moved + here from ... + * config/i386/tm-i386sco5.h: ... here. File removed. + * config/i386/i386sco5.mt (TM_FILE): Set to tm-i386v4.h. + + * config/i386/nm-i386v.h (START_INFERIOR_TRAPS_EXPECTED): New define. + * config/i386/i386aout.mt (TDEPFILES): Add i387-tdep.o + (TM_FILE): Set to tm-i386.h. + * config/i386/i386v.mt (TM_FILE): Set to tm-i386.h. + * config/i386/tm-i386v.h: Remove file. + * config/i386/tm-ptx.h [!SEQUENT_PTX4]: Include "i386/tm-i386.h" + instead of "i386/tm-i386v.h". + (START_INFERIOR_TRAPS_EXPECTED): Remove define. + * config/i386/tm-symmetry: Include "i386/tm-i386.h" instead of + "i386/tm-i386v.h". + (START_INFERIOR_TRAPS_EXPECTED): Remove define. + * config/i386/tm-vxworks.h: Include "i386/tm-i386.h" instead of + "i386/tm-i386.h". + +2002-08-18 Mark Kettenis + + * config/i386/nm-i386v.h: Add protection against + multiple-inclusion. + (i386_register_u_addr): Remove prototype. + (register_u_addr): New prototype. + (REGISTER_U_ADDR): Redefine accordingly. + * i386v-nat.c: Improve several comments. + (i386_register_u_addr): Change signature and rename to + register_u_addr. Use FP_REGNUM_P. Rewrite slightly to get rid of + ubase variable. + +2002-08-18 Andrew Cagney + + * config/mips/tm-mips.h (STORE_RETURN_VALUE): Delete macro. + (DEPRECATED_EXTRACT_RETURN_VALUE): Delete macro. + * mips-tdep.c (mips_gdbarch_init): Set store_return_value and + deprecated_extract_return_value. + (mips_o32_push_arguments, mips_o64_push_arguments): Clone and + rename mips_o32o64_push_arguments. + (mips_gdbarch_init): Update. + (mips_extract_return_value): Delete. + (mips_o32_extract_return_value): Clone mips_extract_return_value. + (mips_o64_extract_return_value): Clone mips_extract_return_value. + (mips_eabi_extract_return_value): Clone mips_extract_return_value. + (mips_n32n64_extract_return_value): Clone + mips_extract_return_value. + (mips_store_return_value): Delete. + (mips_o32_store_return_value): Clone mips_store_return_value. + (mips_o64_store_return_value): Clone mips_store_return_value. + (mips_eabi_store_return_value): Clone mips_store_return_value. + (mips_n32n64_store_return_value): Clone mips_store_return_value. + +2002-08-18 Aidan Skinner + + * ada-lang.c: Use gdb_string.h instead of . + * ada-typeprint.c: Use gdb_string.h instead of . + +2002-08-18 Aidan Skinner + + * ada-lang.c: Run through gdb_indent.sh. + * ada-lang.h: Run through gdb_indent.sh. + * ada-tasks.c: Run through gdb_indent.sh. + * ada-typeprint.c: Run through gdb_indent.sh. + * ada-valprint.c: Run through gdb_indent.sh. + +2002-08-18 Andrew Cagney + + * osabi.c (gdbarch_init_osabi): Don't complain about an unknown + ABI. + +2002-08-18 Mark Kettenis + + * i386b-nat.c [FETCH_INFERIOR_REGISTERS]: Remove dead code. + + * config/i386/nm-i386bsd.h (FLOAT_INFO): Remove redundant #undef. + * i386b-nat.c [FLOAT_INFO]: Remove dead code. + + * i386-tdep.c (i386_do_pop_frame, i386_store_return_value): Call + write_register_gen instead of write_register_bytes. + + * NEWS: Mention that the i[3456]-*mach3*, i[3456]-*-mach* and + i[3456]-*-osf1mk* configurations have been made obsolete. + * configure.host: Make i[3456]86-*-mach3*, i[3456]86-*mach* and + i[3456]86-*-osf1mk* hosts obsolete. + * confighure.tgt: Make i[3456]86-*-mach3*, i[3456]86-*-osf1mk* + targets obsolete. + * config/i386/i386mach.mh, config/i386/nm-i386mach.h, + config/i386/xm-i386mach.h, config/i386/i386m3.mh, + config/i386/i386m3.mt, config/i386/nm-m3.h, + config/i386/tm-i386m3.h, config/i386/xm-i386m3.h, + config/i386/i386mk.mh, config/i386/i386mk.mt, + config/i386/tm-i386mk.h, config/i386/xm-i386mk.h: Make files + obsolete. + * i386mach-nat.c, i386m3-nat.c: Make files obsolete. + * Makefile.in (ALLDEPFILES): Remove i386mach.c i386m3-nat.c + (i386mach-nat.o, i386m3-nat.o):Make targets obsolete. + +2002-08-18 Andrew Cagney + + * config/pa/tm-hppa.h (hppa_store_return_value): Declare. + (hppa_value_returned_from_stack): Declare. + (hppa_extract_return_value): Declare. + * config/pa/hppa.mt: New file. + * configure.tgt: Recognize hppa*-*-*. + * MAINTAINERS: Change HPPA target to hppa-elf. Still broken. + +2002-08-18 Mark Kettenis + + * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Fix typo in + comment. + +2002-08-17 Mark Kettenis + + * top.c (gdb_rl_operate_and_get_next): Make sure + operate-and-get-next functions correctly even when the history + list is completely filled. + +2002-08-18 Andrew Cagney + + * MAINTAINERS (Target Instruction Set Architectures): Rename + Target/Architectures. Replace vax-dec-vms5.5 with vax-netbsd. + Replace s390-linux with s390-linux-gnu. Remove i386-aout, + mcore-pe, mips64-elf, sparc64-elf. Remove i586-pc-msdosdjgpp, + already listed under Host/Native. + + * configure.tgt: Combine i[3456]86-*-coff*, i[3456]86-*-elf*, + i[3456]86-*-pe*, and i[3456]86-*-aout* into i[3456]86-*-*. Add + mips*-*-*. + +2002-08-17 Andrew Cagney + + * config/ia64/ia64.mt: New file. + * config/alpha/alpha.mt: New file. + * MAINTAINERS: Change the alpha target to alpha-elf and IA-64 to + ia64-linux-gnu. Mention that ia64-elf is broken. + * configure.tgt: Add alpha*-*-* and ia64*-*-* patterns. + +2002-08-17 Mark Kettenis + + * i386-tdep.c (i386_svr4_init_abi, i386_nw_init_abi): Use + generic_func_frame_valid instead of func_frame_valid. + +2002-08-16 Joel Brobecker + + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately, + procfs appears to be broken when debugging on multi-processor + machines. So enable software single stepping in order to avoid + using the procfs interface to do next/step operations, using + internal breakpoints instead. + + * infrun.c (handle_inferior_event): Readjust the stop_pc by + DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to + make this pc address equal to the value it would have if the + system stepping capability was used. Also set a new flag used + to ensure that we don't readjust the PC one more time later. + + * breakpoint.c (bpstat_stop_status): Do not adjust the PC + address by DECR_PC_AFTER_BREAK when software single step is + in use for this architecture, as this has already been taken + care of in handle_inferior_event(). + +2002-08-16 Joel Brobecker + + * infrun.c (handle_inferior_event): Minor reformatting, to make + a rather long condition expression easier to read. + +2002-08-16 Andrew Cagney + + * Makefile.in (gdbtk.o): Move to end of file. + (gdbtk-bp.o, gdbtk-cmds.o): Ditto. + (gdbtk-hooks.o, gdbtk-register.o): Ditto. + (gdbtk-stack.o, gdbtk-varobj.o): Ditto. + (gdbtk-wrapper.o, gdbres.o): Ditto. + +2002-08-16 Andrew Cagney + + * Makefile.in (copying.o): Separate out compile rule. + (hpux-thread.o, procfs.o, signals.o): Ditto. + (v850ice.o, z8k-tdep.o): Ditto. + (tui-file.o): Move to TUI section. + (xdr_ptrace.o, xdr_rdb.o, xdr_ld.o): Move to separate section. + (nindy.o, Onindy.o, ttyflush.o): Move to separate section. + +2002-08-16 Joel Brobecker + + * i386-tdep.c (i386_pe_skip_trampoline_code): renamed from + skip_trampoline_code, for better namespace-proofing. + + * i386-tdep.h (i386_pe_skip_trampoline_code): Add declaration. + +2002-08-16 Joel Brobecker + + * config/i386/tm-cygwin.h: Remove some "#if 0"'ed macros. + +2002-08-16 Joel Brobecker + + * infrun.c (handle_inferior_event): When receiving a SIGTRAP + signal, check whether we hit a breakpoint before checking for a + single step breakpoint. Otherwise, GDB fails to notice that a + breakpoint has been hit when stepping onto a breakpoint. + +2002-08-16 Keith Seitz + + * gdb-events.sh (clear_gdb_event_hooks): New function. + * gdb-events.c: Regenerate. + * gdb-events.h: Regenerate. + +2002-08-16 Andrew Cagney + + * breakpoint.c (bpstat_stop_status): Rename not_a_breakpoint to + not_a_sw_breakpoint. + * breakpoint.h (bpstat_stop_status): Add parameter names. + +2002-08-16 Grace Sainsbury + + * remote.c (remote_insert_hw_breakpoint) + (remote_remove_hw_breakpoint): Fix calculation of length field + for Z-packet. + +2002-08-15 Michael Snyder + + * irix5-nat.c (supply_gregset): Allocate plenty-big buffer + (32 bytes) instead of using MAX_REGISTER_RAW_SIZE. + (supply_fpregset): Ditto. + + * config/mips/tm-mips.h (REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW, REGISTER_CONVERTIBLE, + MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE): Delete. + (TARGET_READ_SP): Delete. + (DO_REGISTERS_INFO): Delete. + (FUNCTION_START_OFFSET, IN_SIGTRAMP, REGISTER_VIRTUAL_SIZE): + Delete. + (REGISTER_CONVERT_FROM_TYPE, REGISTER_CONVERT_TO_TYPE): Convert + from macros to functions. + + * mips-tdep.c (mips_gdbarch_init): Set the above in the gdbarch. + (mips_register_convertible, mips_register_convert_to_virtual, + mips_register_convert_to_raw): Make static. + (mips_read_sp): New function. + (mips_gdbarch_init): Set gdbarch read_sp to mips_read_sp. + (mips_do_registers_info): Make static. + (mips_gdbarch_init): Insert mips_do_registers_info into gdbarch. + (in_sigtramp): Make static, rename to mips_pc_in_sigtramp. + (mips_register_convert_from_type, mips_register_convert_to_type): + New functions. + (mips_gdbarch_init): Set up function_start_offset, + register_virtual_size, pc_in_sigtramp. + +2002-08-15 Andrew Cagney + + * infcmd.c (vector_info): New function. + (_initialize_infcmd): Add command "info vector". + (print_vector_info): New function. + + * gdbarch.sh (PRINT_VECTOR_INFO): New method + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-15 Andrew Cagney + + * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to + ``print_all''. Only print vector registers when ``print_all''. + +2002-08-15 Andrew Cagney + + * i387-tdep.h (i387_print_float_info): Add `args' parameter. + * i387-tdep.c (i387_print_float_info): Add `args' parameter. + + * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method. + Add `args' parameter. + * gdbarch.h, gdbarch.c: Regenerate. + + * arm-tdep.c (arm_print_float_info): Add the parameter `args'. + + * infcmd.c (float_info): Call print_float_info. + (print_float_info): New function. By default, print the + floating-point registers. + + * arch-utils.h (default_print_float_info): Delete declaration. + * arch-utils.c (default_print_float_info): Delete function. + +2002-08-16 Mark Kettenis + + * config/i386/nm-i386v.h (FLOAT_INFO): Remove already commented + out define. + + * i387-tdep.c (i387_print_float_info): Add comment about ignoring + FRAME. + + * NEWS: Mention that the i[3456]-*-aix target has been made obsolete. + * configure.host: Make i[3456]86-*-aix host obsolete. + * configure.tgt: Make i[3456]86-*-aix target obsolete. + * config/i386/i386aix.mh, config/i386/i386aix.mt, + config/i386/nm-i386aix.h, condig/i386/tm-i386aix.h, + config/i386/xm-i386aix.h: Make files obsolete. + * i386aix-nat.c: Make file obsolete. + * Makefile.in (ALLDEPFILES): Remove i386aix-nat.c. + (i386aix-nat.o): Make target obsolete. + + * config/i386/nm-gnu.h: Removed. + * config/i386/nm-i386gnu.h: New file. + (THREAD_STATE_FLAVOR, THREAD_STATE_SIZE, + THREAD_STATE_SET_TRACED, THREAD_STATE_CLEAR_STATE, ATTACH_DETACH): + Moved here from ... + * config/i386/tm-i386gnu.h: ... here. Removed. + * config/i386/xm-i386gnu.h: Removed. + * config/i386/i386gnu.mh (XM_FILE): Set to xm-i386.h. + (NAT_FILE): Set to nm-i386gnu.h. + * config/i386/i386gnu.mt (TDEPFILES): Add i386gnu-tdep.o. + * i386-tdep.c: New file. + * Makefile.in (ALLDEPFILES): Add i386gnu-nat.c and i386gnu-tdep.c. + (i386gnu-tdep.o): Specify dependencies. + +2002-08-15 Mark Kettenis + + * config/i386/tm-i386sco5.h: Include "i386/tm-i386v4.h" instead of + "i386/tm-i386.h", "i386/tm-i386v.h" and "config/tm-sysv.h". + Adjust a few comments to reflect reality a bit closer. + (KERNEL_U_SIZE, TARGET_HAS_HARDWARE_WATCHPOINTS, + TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUEABLE_WATCHPOINT, + HAVE_STEPPABLE_WATCHPOINT, STOPPED_BY_WATCHPOINT, + target_insert_watchpoint, target_remove_watchpoint): + Move defines to ... + * config/i386/nm-i386sco5.h: ... here. + (kernel_u_size): Add prototype. Improve a few comments and add + protection against multiple inclusion. + + * config/i386/nm-i386sco.h (FLOAT_INFO): Remove already commented + out define. + + * uw-thread.c (SP_ARG0): Define if not already defined. + * config/i386/tm-i386.h (SO_ARG0): Remove define. + + * config/i386/tm-i386v4.h (HAVE_I387_REGS): Remove define. + + * config/i386/tm-i386.h: Don't include "regcache.h". + + * i387-tdep.h (i387_print_float_info): New prototype. + * i387-tdep.c (print_i387_value, print_i387_ext, + print_i387_status_word, print_i387_control_word): Add `struct + ui_file *' argument and use it for output. + (i387_print_float_info): Renamed from i387_float_info. Add + `struct gdbarch *' and `struct ui_file *' arguments and use the + latter for output. + * i386-tdep.c: Include "i387-tdep.h". + (i386_gdbarch_init): Set print_float_info. + * config/i386/tm-i386.h (i387_float_info): Remove prototype. + (FLOAT_INFO): Remove define. + +2002-08-13 Michael Snyder + + * mips-tdep.c (mips_push_arguments): Rename to + mips_eabi_push_arguments, and tune for EABI. + (MIPS_REGS_HAVE_HOME_P): Delete. + (struct gdbarch_tdep): Remove mips_regs_have_home_p field. + (mips_gdbarch_init): Set gdbarch push_arguments for eabi. + Delete references to mips_regs_have_home_p. + +2002-08-14 Keith Seitz + + * Makefile.in (install-gdbtk): Create insight plugin directory. + Install plugins.tcl file. + +2002-08-14 Keith Seitz + + * configure.in: Move SUBDIRS to near top of the file so that + --enable options may add things to it. + If gdbtk is enabled, add gdbtk directory to SUBDIRS and configdirs. + * configure: Regenerate. + +2002-08-13 Michael Snyder + + * mips-tdep.c (mips_o32o64_push_arguments): New function, + cloned from mips_push_arguments, tuned for o32/o64 ABI. + (mips_gdbarch_init): Set gdbarch_push_arguments to new func. + +2002-08-13 Andrew Cagney + + * vax-tdep.c (vax_get_saved_register): Delete function. + (vax_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_get_saved_register): Delete function. + (ns32k_gdbarch_init): Update. + * alpha-tdep.c (alpha_get_saved_register): Delete function. + (alpha_gdbarch_init): Update. + +2002-08-13 Andrew Cagney + + * regcache.c (init_regcache_descr): Overallocate the + raw_register_valid_p array including space for NUM_PSEUDO_REGS. + (registers_changed): Replace NUM_REGS+NUM_PSEUDO_REGS with + nr_raw_registers. + (set_register_cached): Add range checking assertions. Use + current_regcache. + +2002-08-13 Mark Kettenis + + * i386-tdep.c (i386_stab_reg_to_regnum): Return correct register + numbers for MMX registers. + +2002-08-13 Andrew Cagney + + * i386-tdep.c (i386_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-08-13 Kevin Buettner + + * procfs.c (procfs_can_use_hw_breakpoint): New function. + (init_procfs_ops): Define ``to_can_use_hw_breakpoint'' for procfs + target vector. + * config/mips/nm-irix5.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT): + Delete. Add comment regarding this now-deleted target method. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (M68HC12_NUM_PSEUDO_REGS): New define. + (M68HC12_HARD_PC_REGNUM): Define specific PC for 68HC12 (pseudo reg). + (m68hc11_pseudo_register_read): Compute the 68HC12 PC using the + real PC and the page number (if it's within the memory bank window). + (m68hc11_pseudo_register_write): Likewise when saving. + (m68hc11_register_name): Name the virtual pc 'pc' and the real one ppc. + (m68hc11_register_virtual_type): Return uint32 for virtual pc. + (m68hc11_register_raw_size): And use 32-bit for it. + (m68hc11_gdbarch_init): Use 32-bit address for 68HC12 if the + 16K memory bank is used by the prog; also use the virtual pc. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_elf_make_msymbol_special): New function. + (m68hc11_gdbarch_init): Install it in gdbarch. + (MSYMBOL_SET_RTC, MSYMBOL_SET_RTI): New to set symbol specific flags. + (MSYMBOL_IS_RTC, MSYMBOL_IS_RTI): New to test these flags. + (MSYMBOL_SIZE): New for documentation. + (insn_return_kind): Enum to specify how a function returns. + (frame_extra_info): Cleanup and record the return mode. + (gdbarch_tdep, USE_PAGE_REGISTER): New to control the use of page + register in address computation. + (m68hc11_get_return_insn): New to obtain the return instruction used + by the function. + (m68hc11_frame_init_saved_regs): Take into account the return + instruction used by the function for far and interrupt functions. + (m68hc11_init_extra_frame_info): Take into account page register. + (m68hc11_frame_args_address): Adjust according to the return mode. + (show_regs): Print page register only when it's used. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register. + (M68HC11_LAST_HARD_REG, m68hc11_register_names): Update. + (m68hc11_register_virtual_type): Return a 8-bit type for 8-bit + registers. + (m68hc11_register_raw_size): Likewise. + +2002-08-13 Andrew Cagney + + * i386-tdep.c (i386_register_name): Handle mmx registers. + (mmx_regnum_p): New function. + (i386_mmx_names): New array. + (mmx_num_regs): New variable. + (i386_pseudo_register_read): New function. + (i386_pseudo_register_write): New function. + (mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser. + + * regcache.c (regcache_raw_read_unsigned): New function. + (regcache_raw_read_signed): New function. + * regcache.h (regcache_raw_read_unsigned): Declare. + (regcache_raw_read_signed): Declare. + +2002-08-13 Andrew Cagney + + * regcache.c (regcache_raw_read_as_address): Delete function. + (regcache_cooked_read_signed): New function. + (regcache_cooked_read_unsigned): New function. + * regcache.h (regcache_cooked_read_signed): Declare. + (regcache_cooked_read_unsigned): Declare. + (regcache_raw_read_as_address): Delete declaration. + + * blockframe.c (generic_read_register_dummy): Use + regcache_cooked_read_unsigned. + * i386-tdep.c (i386_extract_struct_value_address): Use + regcache_cooked_read_unsigned. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_gdbarch_init): Set int, double and long + double sizes according to ELF ABI flags. + (gdbarch_tdep): Record elf_flags. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (M6812_OP_PSHX, M6812_OP_PSHY): New defines. + (m6812_prolog): They can appear in 68HC12 function prologue. + (m68hc11_frame_chain): Cleanup. + +2002-08-12 Andrew Cagney + + * i386-tdep.h (i386_register_byte, i386_register_raw_size): Delete + declarations. + * i386-linux-tdep.c (i386_linux_register_byte): Delete function. + (i386_linux_register_raw_size): Delete function. + (i386_linux_init_abi): Update. + * i386-tdep.c (i386_register_raw_size): Delete function. + (i386_register_byte): Delete function. + (i386_gdbarch_init): Update. + (i386_register_size): Delete array. + (i386_register_offset): Delete array. + + * config/i386/tm-symmetry.h (REGISTER_BYTE): Delete macro. + (REGISTER_RAW_SIZE): Delete macro. + * config/i386/tm-ptx.h (REGISTER_RAW_SIZE): Delete macro. + (REGISTER_BYTE): Delete macro. + +2002-08-11 Aidan Skinner + + * ada-lang.c (ada_lookup_partial_symbol) + (to_fixed_variant_branch_type) (find_line_in_linetable): Fix + prototype names so that grep ^func works properly. + + * ada-lang.c (ada_array_element_type) + (ada_lookup_partial_symbol): Fix typos in parameter list. + + * ada-valprint.c (val_print_packed_array_elements) (ada_val_print_1): + Fix prototype names so that grep ^func works properly. + +2002-08-10 Andrew Cagney + Elena Zannoni + Martin M. Hunt + + * gdbtypes.c (build_builtin_type_vec128): Set the vector bit. + (build_builtin_type_vec128i): Set the vector bit. + * gdbtypes.h (builtin_type_vec64, builtin_type_vec64i): Declare. + * gdbtypes.c (builtin_type_vec64, builtin_type_vec64i): Define. + (build_builtin_type_vec64): New function. + (build_builtin_type_vec64i): New function. + (build_gdbtypes): Initialize builtin_type_vec64 and + builtin_type_vec64i. + +2002-08-09 Andrew Cagney + + * regcache.c (regcache_dump): Compare the register offset + with REGISTER_BYTE. + * arch-utils.c (generic_register_byte): New function. + * arch-utils.h (generic_register_byte): Declare. + * gdbarch.sh (REGISTER_BYTE): Default to generic_register_byte. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-09 Andrew Cagney + + * regcache.c: Include "gdbcmd.h" + (_initialize_regcache): Add commands "maintenance print + registers", "maintenance print raw-registers" and "maintenance + print cooked-registers". + (enum regcache_dump_what): Define. + (dump_endian_bytes): New function. + (regcache_dump): New function. + (regcache_print): New function. + (maintenance_print_registers): New function. + (maintenance_print_raw_registers): New function. + (maintenance_print_cooked_registers): New function. + * Makefile.in (regcache.o): Update dependencies. + +2002-08-09 Michael Snyder + + * mips-tdep.c (ROUND_DOWN, ROUND_UP): Move to global scope. + (mips_push_arguments): Correct some comments. Use paddr_nz + for printing addresses in debug output. Replace static + allocation using MAX_REGISTER_RAW_SIZE with alloca. + (mips_n32n64_push_arguments): New function, cloned from + mips_push_arguments and tuned for the n32/n64 ABI. + (mips_push_register): Buffer needs dynamic allocation. + (mips_print_register): Ditto. + (do_gp_register_row): Ditto. + (mips_store_return_value): Ditto. + (mips_gdbarch_init): Set gdbarch_push_arguments per ABI. + +2002-08-09 Don Howard + + * memattr.c (mem_info_command): Print special case of upper bound + as max CORE_ADDR + 1. + +2002-08-08 Michael Snyder + + * mips-tdep.c (mips_n32n64_use_struct_convention): N32 only + returns structs by ref if they're too big to fit in two registers. + +2002-08-09 Kevin Buettner + + * mips-tdep.c (mips_init_extra_frame_info): Initialize SP_REGNUM's + saved regs value. + (read_next_frame_reg): Call FRAME_INIT_SAVED_REGS instead of + mips_find_saved_regs(). + (mips_pop_frame): Likewise. + +2002-08-09 Kevin Buettner + + * blockframe.c (frame_saved_regs_register_unwind): Revise + PC_IN_CALL_DUMMY assertion to only apply when generic dummy + frames are in use. + 2002-08-09 Grace Sainsbury * remote.c: (remote_wait, remote_async_wait): Add check for awatch @@ -313,7 +1600,7 @@ 2002-08-05 Theodore A. Roth - * gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc. + * avr-tdep.c (avr_skip_prologue): Fix to return the correct pc. 2002-08-05 Andrew Cagney @@ -467,7 +1754,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney * NEWS: Menion that CHILL has been made obsolete. * gdbtypes.c (chill_varying_type): Make chill references obsolete. - * gdbserver/Makefile.in: Ditto. * stabsread.c (read_range_type): Ditto. * gdbtypes.h: Ditto. * language.c (binop_type_check): Ditto. @@ -814,12 +2100,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney * defs.h (extract_unsigned_integer): Update. (extract_signed_integer): Update. -2002-07-24 Kevin Buettner - - * gdbserver/configure.in (unistd.h): Add to AC_CHECK_HEADERS list. - * gdbserver/configure: Regenerate. - * gdbserver/config.in: Regenerate. - 2002-07-24 Andrew Cagney * regcache.c (regcache_raw_write): Change buf parameter to a @@ -1344,11 +2624,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney * config/m68k/tm-m68k.h: Remove macros wrapped in #if !GDB_MULTI_ARCH. -2002-07-09 David O'Brien - - * gdbserver/gdbreplay.c (stdlib.h, unistd.h): Conditionaly include. - (perror_with_name, remote_close, remote_open, expect, play): Static. - 2002-07-08 Andrew Cagney * config.in, configure: Regenerate. @@ -1468,12 +2743,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney i386_push_return_address and set frame_chain_valid to generic_file_frame_chain_valid. -2002-07-04 Michal Ludvig - - * gdbserver/linux-x86-64-low.c (x86_64_regmap): Make it an array of - byte offsets instead of an array of indexes. - (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const. - 2002-07-03 Andrew Cagney * gdbarch.sh (struct regcache): Add opaque declaration. @@ -2794,10 +4063,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney * MAINTAINERS: Mention NEWS. -2002-06-13 Daniel Jacobowitz - - * gdbserver/regcache.c: Add comment. - 2002-06-13 Daniel Jacobowitz * mips-tdep.c (PROC_SYMBOL): Add warning comment. @@ -2853,158 +4118,6 @@ Fri Aug 2 15:53:50 2002 Andrew Cagney * config/mips/tm-mips.h (MIPS_EABI, MIPS_LAST_ARG_REGNUM, MIPS_LAST_FP_ARG_REGNUM): Remove. -2002-06-11 Daniel Jacobowitz - - * gdbserver/thread-db.c: New file. - * gdbserver/proc-service.c: New file. - * gdbserver/acinclude.m4: New file. - * gdbserver/Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h, - proc-service.o, and thread-db.o. - (linux-low.o): Add USE_THREAD_DB. - * gdbserver/acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, - HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN. - * gdbserver/aclocal.m4: Regenerated. - * gdbserver/config.in: Regenerated. - * gdbserver/configure: Regenerated. - * gdbserver/configure.in: Check for proc_service.h, sys/procfs.h, - thread_db.h, and linux/elf.h headrs. - Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and - PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB. - Check for -lthread_db and thread support. - * gdbserver/configure.srv: Enable thread_db support for ARM, i386, MIPS, - PowerPC, and SuperH. - * gdbserver/i387-fp.c: Constify arguments. - * gdbserver/i387-fp.h: Likewise. - * gdbserver/inferiors.c: (struct thread_info): Renamed from - `struct inferior_info'. Remove PID member. Use generic inferior - list header. All uses updated. - (inferiors, signal_pid): Removed. - (all_threads): New variable. - (get_thread): Define. - (add_inferior_to_list): New function. - (for_each_inferior): New function. - (change_inferior_id): New function. - (add_inferior): Removed. - (remove_inferior): New function. - (add_thread): New function. - (free_one_thread): New function. - (remove_thread): New function. - (clear_inferiors): Use for_each_inferior and free_one_thread. - (find_inferior): New function. - (find_inferior_id): New function. - (inferior_target_data): Update argument type. - (set_inferior_target_data): Likewise. - (inferior_regcache_data): Likewise. - (set_inferior_regcache_data): Likewise. - * gdbserver/linux-low.c (linux_bp_reinsert): Remove. - (all_processes, stopping_threads, using_thrads) - (struct pending_signals, debug_threads, pid_of): New. - (inferior_pid): Replace with macro. - (struct inferior_linux_data): Remove. - (get_stop_pc, add_process): New functions. - (linux_create_inferior): Restore SIGRTMIN+1 before calling exec. - Use add_process and add_thread. - (linux_attach_lwp): New function, based on old linux_attach. Use - add_process and add_thread. Set stop_expected for new threads. - (linux_attach): New function. - (linux_kill_one_process): New function. - (linux_kill): Kill all LWPs. - (linux_thread_alive): Use find_inferior_id. - (check_removed_breakpoints, status_pending_p): New functions. - (linux_wait_for_process): Renamed from linux_wait_for_one_inferior. - Update. Use WNOHANG. Wait for cloned processes also. Update process - struct for the found process. - (linux_wait_for_event): New function. - (linux_wait): Use it. Support LWPs. - (send_sigstop, wait_for_sigstop, stop_all_processes) - (linux_resume_one_process, linux_continue_one_process): New functions. - (linux_resume): Support LWPs. - (REGISTER_RAW_SIZE): Remove. - (fetch_register): Use register_size instead. Call supply_register. - (usr_store_inferior_registers): Likewise. Call collect_register. - Fix recursive case. - (regsets_fetch_inferior_registers): Improve error message. - (regsets_store_inferior_registers): Add debugging. - (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB. - (unstopped_p, linux_signal_pid): New functions. - (linux_target_ops): Add linux_signal_pid. - (linux_init_signals): New function. - (initialize_low): Call it. Initialize using_threads. - * gdbserver/regcache.c (inferior_regcache_data): Add valid - flag. - (get_regcache): Fetch registers lazily. Add fetch argument - and update all callers. - (regcache_invalidate_one, regcache_invalidate): New - functions. - (new_register_cache): Renamed from create_register_cache. - Return the new regcache. - (free_register_cache): Change argument to a void *. - (registers_to_string, registers_from_string): Call get_regcache - with fetch flag set. - (register_data): Make static. Pass fetch flag to get_regcache. - (supply_register): Call get_regcache with fetch flag clear. - (collect_register): Call get_regcache with fetch flag set. - (collect_register_as_string): New function. - * gdbserver/regcache.h: Update. - * gdbserver/remote-utils.c (putpkt): Flush after debug output and use - stderr. - Handle input interrupts while waiting for an ACK. - (input_interrupt): Use signal_pid method. - (getpkt): Flush after debug output and use stderr. - (outreg): Use collect_register_as_string. - (new_thread_notify, dead_thread_notify): New functions. - (prepare_resume_reply): Check using_threads. Set thread_from_wait - and general_thread. - (look_up_one_symbol): Flush after debug output. - * gdbserver/server.c (step_thread, server_waiting): New variables. - (start_inferior): Don't use signal_pid. Update call to mywait. - (attach_inferior): Update call to mywait. - (handle_query): Handle qfThreadInfo and qsThreadInfo. - (main): Don't fetch/store registers explicitly. Use - set_desired_inferior. Support proposed ``Hs'' packet. Update - calls to mywait. - * gdbserver/server.h: Update. - (struct inferior_list, struct_inferior_list_entry): New. - * gdbserver/target.c (set_desired_inferior): New. - (write_inferior_memory): Constify. - (mywait): New function. - * gdbserver/target.h: Update. - (struct target_ops): New signal_pid method. - (mywait): Removed macro, added prototype. - - * gdbserver/linux-low.h (regset_func): Removed. - (regset_fill_func, regset_store_func): New. - (enum regset_type): New. - (struct regset_info): Add type field. Use new operation types. - (struct linux_target_ops): stop_pc renamed to get_pc. - Add decr_pc_after_break and breakpoint_at. - (get_process, get_thread_proess, get_process_thread) - (strut process_info, all_processes, linux_attach_lwp) - (thread_db_init): New. - - * gdbserver/linux-arm-low.c (arm_get_pc, arm_set_pc, - arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New. - (the_low_target): Add new members. - * gdbserver/linux-i386-low.c (i386_store_gregset, i386_store_fpregset) - (i386_store_fpxregset): Constify. - (target_regsets): Add new kind identifier. - (i386_get_pc): Renamed from i386_stop_pc. Simplify. - (i386_set_pc): Add debugging. - (i386_breakpoint_at): New function. - (the_low_target): Add new members. - * gdbserver/linux-mips-low.c (mips_get_pc, mips_set_pc) - (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr) - (mips_breakpoint_at): New. - (the_low_target): Add new members. - * gdbserver/linux-ppc-low.c (ppc_get_pc, ppc_set_pc) - (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New. - (the_low_target): Add new members. - * gdbserver/linux-sh-low.c (sh_get_pc, sh_set_pc) - (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New. - (the_low_target): Add new members. - * gdbserver/linux-x86-64-low.c (target_regsets): Add new kind - identifier. - 2002-06-11 Michal Ludvig * dwarf2cfi.c (unwind_tmp_obstack_init): New. @@ -4013,12 +5126,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke * hpread.c (hpread_read_struct_type): Remove assignments to args. (fixup_class_method_type): Likewise. -2002-05-15 Daniel Jacobowitz - - From Martin Pool : - * gdbserver/server.c (gdbserver_usage): New function. - (main): Call it. - 2002-05-15 Jim Blandy Add macro structures to GDB's symbol tables. Nobody puts anything @@ -4057,11 +5164,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke * arm-linux-tdep.c (ARM_LINUX_JB_PC): Renamed from JB_PC. (ARM_LINUX_JB_ELEMENT_SIZE): Likewise. -2002-05-14 Daniel Jacobowitz - - * gdbserver/mem-break.c (reinsert_breakpoint_by_bp): Correct typo - stop_at -> stop_pc. - 2002-05-14 Andrew Cagney * regcache.c (register_valid): Revise comments refering to "Not @@ -4916,7 +6018,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke * remote-eb.c: Delete. * remote-adapt.c: Delete. * Makefile.in: Remove obsolete code. - * gdbserver/Makefile.in: Ditto. * config/s390/s390x.mt: Ditto. * config/s390/s390.mt: Ditto. * config/sparc/sparclynx.mh: Ditto. @@ -5431,13 +6532,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney * i386-linux-tdep.c: Update comments. * breakpoint.c (bpstat_what): Update comment. -2002-04-24 Michal Ludvig - - * gdbserver/linux-low.c (regsets_fetch_inferior_registers), - (regsets_store_inferior_registers): Removed cast to int from - ptrace() calls. - * gdbserver/regcache.h: Added declaration of struct inferior_info. - 2002-04-24 David S. Miller * i960-tdep.c (register_in_window_p): New function. @@ -5784,55 +6878,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney sorted in most most-recent-used order. Document. * gdbarch.h, gdbarch.c: Regenerate. -2002-04-20 Daniel Jacobowitz - - * gdbserver/inferiors.c (struct inferior_info): Add regcache_data. - (add_inferior): Call create_register_cache. - (clear_inferiors): Call free_register_cache. - (inferior_regcache_data, set_inferior_regcache_data): New functions. - * gdbserver/regcache.c (struct inferior_regcache_data): New. - (registers): Remove. - (get_regcache): New function. - (create_register_cache, free_register_cache): New functions. - (set_register_cache): Don't initialize the register cache here. - (registers_to_string, registers_from_string, register_data): Call - get_regcache. - * gdbserver/regcache.h: Add prototypes. - * gdbserver/server.h: Likewise. - -2002-04-20 Daniel Jacobowitz - - * gdbserver/mem-break.c: New file. - * gdbserver/mem-break.h: New file. - * gdbserver/Makefile.in: Add mem-break.o rule; update server.h - dependencies. - * gdbserver/inferiors.c (struct inferior_info): Add target_data - member. - (clear_inferiors): Free target_data member if set. - (inferior_target_data, set_inferior_target_data): New functions. - * gdbserver/linux-i386-low.c (i386_breakpoint, i386_breakpoint_len) - (i386_stop_pc, i386_set_pc): New. Add to the_low_target. - * gdbserver/linux-low.c (linux_bp_reinsert): New variable. - (struct inferior_linux_data): New. - (linux_create_inferior): Use set_inferior_target_data. - (linux_attach): Likewise. Call add_inferior. - (linux_wait_for_one_inferior): New function. - (linux_wait): Call it. - (linux_write_memory): Add const. - (initialize_low): Call set_breakpoint_data. - * gdbserver/linux-low.h (struct linux_target_ops): Add breakpoint - handling members. - * gdbserver/server.c (attach_inferior): Remove extra add_inferior - call. - * gdbserver/server.h: Include mem-break.h. Update inferior.c - prototypes. - * gdbserver/target.c (read_inferior_memory) - (write_inferior_memory): New functions. - * gdbserver/target.h (read_inferior_memory) - (write_inferior_memory): Change macros to prototypes. - (struct target_ops): Update comments. Add const to write_memory - definition. - 2002-04-19 Andrew Cagney * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame @@ -6034,11 +7079,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney 2002-04-11 Daniel Jacobowitz - * gdbserver/linux-low.c (usr_store_inferior_registers): Support - registers which are allowed to fail to store. - * gdbserver/linux-low.h (linux_target_ops): Likewise. - * gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR. - (ppc_cannot_store_register): FPSCR may not be storable. * regformats/reg-ppc.dat: Support FPSCR. 2002-04-11 Kevin Buettner @@ -6114,88 +7154,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney * server.h (look_up_one_symbol): Add prototype. * target.h (struct target_ops): Add look_up_symbols hook. -2002-04-09 Daniel Jacobowitz - - * gdbserver/server.h: Include if HAVE_STRING_H. - * ChangeLog: Correct paths in last ChangeLog entry. - -2002-04-09 Daniel Jacobowitz - - * gdbserver/linux-low.h: Remove obsolete prototypes. - (struct linux_target_ops): New. - (extern the_low_target): New. - * gdbserver/linux-low.c (num_regs, regmap): Remove declarations. - (register_addr): Use the_low_target explicitly. - (fetch_register): Likewise. - (usr_fetch_inferior_registers): Likewise. - (usr_store_inferior_registers): Likewise. - * gdbserver/linux-arm-low.c (num_regs): Remove. - (arm_num_regs): Define. - (arm_regmap): Renamed from regmap, made static. - (arm_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (arm_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-i386-low.c (num_regs): Remove. - (i386_num_regs): Define. - (i386_regmap): Renamed from regmap, made static. - (i386_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (i386_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-ia64-low.c (num_regs): Remove. - (ia64_num_regs): Define. - (ia64_regmap): Renamed from regmap, made static. - (ia64_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ia64_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-m68k-low.c (num_regs): Remove. - (m68k_num_regs): Define. - (m68k_regmap): Renamed from regmap, made static. - (m68k_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (m68k_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-mips-low.c (num_regs): Remove. - (mips_num_regs): Define. - (mips_regmap): Renamed from regmap, made static. - (mips_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (mips_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-ppc-low.c (num_regs): Remove. - (ppc_num_regs): Define. - (ppc_regmap): Renamed from regmap, made static. - (ppc_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ppc_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-s390-low.c (num_regs): Remove. - (s390_num_regs): Define. - (s390_regmap): Renamed from regmap, made static. - (s390_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (s390_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-sh-low.c (num_regs): Remove. - (sh_num_regs): Define. - (sh_regmap): Renamed from regmap, made static. - (sh_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (sh_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * gdbserver/linux-x86-64-low.c (x86_64_regmap): Renamed from regmap. - (the_low_target): New. - 2002-04-09 Andrew Cagney * frame.c (read_relative_register_raw_bytes_for_frame): Do not @@ -6207,71 +7165,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney declarations. Update copyright. Fix PR gdb/251. -2002-04-09 Daniel Jacobowitz - - * gdbserver/Makefile.in: Add stamp-h target. - * gdbserver/configure.in: Create stamp-h. - * gdbserver/configure: Regenerated. - -2002-04-09 Daniel Jacobowitz - - * gdbserver/inferiors.c: New file. - * gdbserver/target.c: New file. - * gdbserver/target.h: New file. - * gdbserver/Makefile.in: Add target.o and inferiors.o. Update - dependencies. - * gdbserver/linux-low.c (inferior_pid): New static variable, - moved from server.c. - (linux_create_inferior): Renamed from create_inferior. - Call add_inferior. Return 0 on success instead of a PID. - (linux_attach): Renamed from myattach. - (linux_kill): Renamed from kill_inferior. Call clear_inferiors (). - (linux_thread_alive): Renamed from mythread_alive. - (linux_wait): Renamed from mywait. Call clear_inferiors () if the - child dies. - (linux_resume): Renamed from myresume. Add missing ``return 0''. - (regsets_store_inferior_registers): Correct error message. - Add missing ``return 0''. - (linux_fetch_registers): Renamed from fetch_inferior_registers. - (linux_store_registers): Renamed from store_inferior_registers. - (linux_read_memory): Renamed from read_inferior_memory. - (linux_write_memory): Renamed from write_inferior_memory. - (linux_target_ops): New structure. - (initialize_low): Call set_target_ops (). - * gdbserver/remote-utils.c (unhexify): New function. - (hexify): New function. - (input_interrupt): Send signals to ``signal_pid''. - * gdbserver/server.c (inferior_pid): Remove. - (start_inferior): Update create_inferior call. - (attach_inferior): Call add_inferior. - (handle_query): New function. - (main): Call handle_query for `q' packets. - * gdbserver/server.h: Include "target.h". Remove obsolete prototypes. - Add prototypes for "inferiors.c", "target.c", hexify, and unhexify. - -2002-04-09 Daniel Jacobowitz - - * gdbserver/Makefile.in: Add WARN_CFLAGS. Update configury - dependencies. - * gdbserver/configure.in: Check for - * gdbserver/configure: Regenerate. - * gdbserver/config.in: Regenerate. - * gdbserver/gdbreplay.c: Include needed system headers. - (remote_open): Remove strchr prototype. - * gdbserver/linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS. - * gdbserver/regcache.c (supply_register): Change buf argument to const void *. - (supply_register_by_name): Likewise. - (collect_register): Change buf argument to void *. - (collect_register_by_name): Likewise. - * gdbserver/regcache.h: Add missing prototypes. - * gdbserver/remote-utils.c: Include for inet_ntoa. - * gdbserver/server.c (handle_query): New function. - (attached): New static variable, moved out of main. - (main): Quiet longjmp clobber warnings. - * gdbserver/server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes. - * gdbserver/utils.c (error): Remove NORETURN. - (fatal): Likewise. - 2002-04-09 Daniel Jacobowitz * symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 0b4f553172c..212007e5b70 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -47,7 +47,7 @@ fix, since such a change without discussion will result in instantaneous and loud complaints. -Target/Architecture: +Target Instruction Set Architectures: Generic ISA (Instruction Set Architecture) issues, API variants, CPU variants. *-tdep.c. The Target/Architecture maintainer works with the @@ -56,7 +56,7 @@ maintainer works with the native maintainer when resolving API issues. a29k Deleted. - alpha --target=alpha-dec-osf4.0a -Werror + alpha --target=alpha-elf -Werror Maintenance only arc (--target=arc-elf OBSOLETE) @@ -78,9 +78,6 @@ maintainer works with the native maintainer when resolving API issues. d30v (--target=d30v-elf OBSOLETE) - djgpp --target=i586-pc-msdosdjgpp ,-Werror - (See native and host) - fr30 (--target=fr30-elf OBSOLETE) h8300 --target=h8300hms -Werror @@ -91,14 +88,13 @@ maintainer works with the native maintainer when resolving API issues. Maintenance only Not multi-arch, work in progress - i386 --target=i386-elf,i386-aout ,-Werror + i386 --target=i386-elf ,-Werror Mark Kettenis kettenis@gnu.org - i960 --target=i960-coff ,-Werror - Maintenance only - OBSOLETE candidate, not multi-arch + i960 (--target=i960-coff OBSOLETE) - ia64 --target=ia64-linux ,-Werror + ia64 --target=ia64-linux-gnu ,-Werror + (--target=ia64-elf broken) Kevin Buettner kevinb@redhat.com m32r (--target=m32r-elf broken) @@ -113,10 +109,10 @@ maintainer works with the native maintainer when resolving API issues. m88k (--target=m88k OBSOLETE) - mcore --target=mcore-elf,mcore-pe ,-Werror + mcore --target=mcore-elf ,-Werror Maintenance only - mips --target=mips-elf,mips64-elf ,-Werror + mips --target=mips-elf ,-Werror Andrew Cagney cagney@redhat.com mn10200 --target=mn10200-elf ,-Werror @@ -129,20 +125,20 @@ maintainer works with the native maintainer when resolving API issues. ns32k --target=ns32k-netbsd ,-Werror Maintenance only - pa (--target=hppa1.1-hp-proelf broken) + pa (--target=hppa-elf broken) Maintenance only OBSOLETE candidate, not multi-arch powerpc --target=powerpc-eabi ,-Werror Kevin Buettner kevinb@redhat.com - s390 --target=s390-linux ,-Werror + s390 --target=s390-linux-gnu ,-Werror (contact DJ Barrow djbarrow@de.ibm.com) sh --target=sh-elf ,-Werror Elena Zannoni ezannoni@redhat.com - sparc --target=sparc-elf,sparc64-elf ,-Werror + sparc --target=sparc-elf ,-Werror Maintenance only tic80 Deleted. @@ -150,7 +146,7 @@ maintainer works with the native maintainer when resolving API issues. v850 --target=v850-elf ,-Werror Maintenance only - vax --target=vax-dec-vms5.5 ,-Werror + vax --target=vax-netbsd ,-Werror Maintenance only w65 Deleted. @@ -366,6 +362,7 @@ Joel Brobecker brobecker@act-europe.fr Dave Brolley brolley@redhat.com Kevin Buettner kevinb@redhat.com Andrew Cagney ac131313@redhat.com +David Carlton carlton@math.stanford.edu Stephane Carrez stcarrez@nerim.fr Michael Chastain mec@shout.net Eric Christopher echristo@redhat.com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 31d54bc10d6..0c6f922452c 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -79,6 +79,11 @@ VPATH = @srcdir@ YACC=@YACC@ +# This is used to rebuild ada-lex.c from ada-lex.l. If the program is +# not defined, but ada-lex.c is present, compilation will continue, +# possibly with a warning. +FLEX = flex + YLWRAP = $(srcdir)/../ylwrap # where to find makeinfo, preferably one designed for texinfo-2 @@ -341,6 +346,7 @@ INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) # LDFLAGS is specifically reserved for setting from the command line # when running make. +LDFLAGS = @LDFLAGS@ # Profiling options need to go here to work. # I think it's perfectly reasonable for a user to set -pg in CFLAGS @@ -518,7 +524,8 @@ TARGET_FLAGS_TO_PASS = \ # Links made at configuration time should not be specified here, since # SFILES is used in building the distribution archive. -SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ +SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ + ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ coffread.c \ complaints.c completer.c corefile.c cp-valprint.c dbxread.c \ @@ -535,7 +542,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \ p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \ macrotab.c macroexp.c macrocmd.c macroscope.c \ - printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \ + printcmd.c remote.c scm-exp.c scm-lang.c \ scm-valprint.c source.c stabsread.c stack.c symfile.c \ symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \ typeprint.c utils.c valarith.c valops.c valprint.c values.c \ @@ -593,91 +600,172 @@ xm_h = @xm_h@ tm_h = @tm_h@ nm_h = @nm_h@ -alpha_tdep_h = alpha-tdep.h osabi.h -annotate_h = annotate.h $(symtab_h) $(gdbtypes_h) -arch_utils_h = arch-utils.h -arm_tdep_h = arm-tdep.h osabi.h -ax_h = ax.h $(doublest_h) -bcache_h = bcache.h +# +# gdb/ header files +# + +acconfig_h = acconfig.h +ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h) +alpha_tdep_h = alpha-tdep.h $(osabi_h) +alphabsd_tdep_h = alphabsd-tdep.h +annotate_h = annotate.h $(symtab_h) $(gdbtypes_h) +arch_utils_h = arch-utils.h +arm_tdep_h = arm-tdep.h $(osabi_h) +ax_gdb_h = ax-gdb.h +ax_h = ax.h $(doublest_h) +bcache_h = bcache.h +breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) +buildsym_h = buildsym.h builtin_regs_h = builtin-regs.h -breakpoint_h = breakpoint.h $(frame_h) $(value_h) -buildsym_h = buildsym.h -c_lang_h = c-lang.h $(value_h) $(macroexp_h) -call_cmds_h = call-cmds.h -cli_cmds_h = $(srcdir)/cli/cli-cmds.h -cli_decode_h = $(srcdir)/cli/cli-decode.h $(command_h) -cli_dump_h = $(srcdir)/cli/cli-dump.h -cli_out_h = cli-out.h -cli_script_h = $(srcdir)/cli/cli-script.h -cli_setshow_h = $(srcdir)/cli/cli-setshow.h -cli_utils_h = $(srcdir)/cli/cli-utils.h -command_h = command.h -complaints_h = complaints.h -completer_h = completer.h -cp_abi_h = cp-abi.h -dcache_h = dcache.h -defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h \ - gdbarch.h ui-file.h $(INCLUDE_DIR)/gdb/signals.h gdb_locale.h -doublest_h = doublest.h $(floatformat_h) -dwarf2cfi_h = dwarf2cfi.h -event_loop_h = event-loop.h -event_top_h = event-top.h -expression_h = expression.h $(doublest_h) $(symtab_h) -f_lang_h = f-lang.h -frame_h = frame.h -gdb_h = gdb.h -gdb_assert_h = gdb_assert.h -gdb_events_h = gdb-events.h -gdb_obstack_h = $(obstack_h) -gdb_stabs_h = gdb-stabs.h -gdb_string_h = gdb_string.h -gdb_wait_h = gdb_wait.h -gdb_regex_h = gdb_regex.h -gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) -gdbcore_h = gdbcore.h $(bfd_h) -gdbthread_h = gdbthread.h $(breakpoint_h) -gdbtypes_h = gdbtypes.h -i386_tdep_h = i386-tdep.h +c_lang_h = c-lang.h $(value_h) $(macroexp_h) +call_cmds_h = call-cmds.h +ch_lang_h = ch-lang.h +cli_out_h = cli-out.h +coff_solib_h = coff-solib.h +command_h = command.h +complaints_h = complaints.h +completer_h = completer.h +cp_abi_h = cp-abi.h +dcache_h = dcache.h +defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \ + $(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \ + $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h) $(arch_utils_h) +doublest_h = doublest.h $(floatformat_h) +dst_h = dst.h +dwarf2cfi_h = dwarf2cfi.h +environ_h = environ.h +event_loop_h = event-loop.h +event_top_h = event-top.h +expression_h = expression.h $(symtab_h) $(doublest_h) +f_lang_h = f-lang.h +frame_h = frame.h +gdb_events_h = gdb-events.h +gdb_stabs_h = gdb-stabs.h +gdb_h = gdb.h +gdb_assert_h = gdb_assert.h +gdb_dirent_h = gdb_dirent.h +gdb_locale_h = gdb_locale.h +gdb_obstack_h = gdb_obstack.h $(obstack_h) +gdb_proc_service_h = gdb_proc_service.h $(gregset_h) +gdb_regex_h = gdb_regex.h $(xregex_h) +gdb_stat_h = gdb_stat.h +gdb_string_h = gdb_string.h +gdb_thread_db_h = gdb_thread_db.h +gdb_vfork_h = gdb_vfork.h +gdb_wait_h = gdb_wait.h +gdbarch_h = gdbarch.h $(dis_asm_h) $(value_h) $(inferior_h) +gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) +gdbcore_h = gdbcore.h $(bfd_h) +gdbthread_h = gdbthread.h $(breakpoint_h) +gdbtypes_h = gdbtypes.h +gnu_nat_h = gnu-nat.h +gregset_h = gregset.h i386_linux_tdep_h = i386-linux-tdep.h -i387_tdep_h = i387-tdep.h -inf_loop_h = inf-loop.h -inferior_h = inferior.h $(breakpoint_h) -interps_h = interps.h -language_h = language.h -linespec_h = linespec.h -macroexp_h = macroexp.h -macrotab_h = macrotab.h -macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) -memattr_h = memattr.h -monitor_h = monitor.h -objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) -parser_defs_h = parser-defs.h $(doublest_h) -ppc_tdep_h = ppc-tdep.h osabi.h -regcache_h = regcache.h -remote_h = remote.h -remote_utils_h = remote-utils.h $(target_h) -ser_unix_h = ser-unix.h -serial_h = serial.h -sh_tdep_h = sh-tdep.h osabi.h -sim_regno_h = sim-regno.h -solist_h = solist.h -source_h = source.h -stabsread_h = stabsread.h -symfile_h = symfile.h -symtab_h = symtab.h -target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) -terminal_h = terminal.h -top_h = top.h -tracepoint_h = tracepoint.h -typeprint_h = typeprint.h -ui_out_h = ui-out.h -valprint_h = valprint.h -value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) $(doublest_h) -varobj_h = varobj.h $(symtab_h) $(gdbtypes_h) -vax_tdep_h = vax-tdep.h osabi.h -version_h = version.h -wrapper_h = wrapper.h -xcoffsolib_h = xcoffsolib.h +i386_tdep_h = i386-tdep.h $(osabi_h) +i387_tdep_h = i387-tdep.h +inf_loop_h = inf-loop.h +inferior_h = inferior.h $(breakpoint_h) $(target_h) +interps_h = interps.h +jv_lang_h = jv-lang.h +kod_h = kod.h +language_h = language.h +linespec_h = linespec.h +m2_lang_h = m2-lang.h +macroexp_h = macroexp.h +macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) +macrotab_h = macrotab.h +memattr_h = memattr.h +minimon_h = minimon.h +mipsnbsd_tdep_h = mipsnbsd-tdep.h +monitor_h = monitor.h +nbsd_tdep_h = nbsd-tdep.h +ns32k_tdep_h = ns32k-tdep.h $(osabi_h) +objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) +ocd_h = ocd.h +osabi_h = osabi.h +p_lang_h = p-lang.h +pa64solib_h = pa64solib.h +parser_defs_h = parser-defs.h $(doublest_h) +ppc_tdep_h = ppc-tdep.h $(osabi_h) +ppcnbsd_tdep_h = ppcnbsd-tdep.h +proc_utils_h = proc-utils.h +regcache_h = regcache.h +remote_utils_h = remote-utils.h $(target_h) +remote_h = remote.h +scm_lang_h = scm-lang.h $(scm_tags_h) +scm_tags_h = scm-tags.h +ser_unix_h = ser-unix.h +serial_h = serial.h +sh_tdep_h = sh-tdep.h $(osabi_h) +shnbsd_tdep_h = shnbsd-tdep.h +sim_regno_h = sim-regno.h +solib_svr4_h = solib-svr4.h +solib_h = solib.h +solist_h = solist.h +somsolib_h = somsolib.h +source_h = source.h +sparcnbsd_tdep_h = sparcnbsd-tdep.h +srec_h = srec.h +stabsread_h = stabsread.h +symfile_h = symfile.h +symtab_h = symtab.h +target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) +terminal_h = terminal.h +top_h = top.h +tracepoint_h = tracepoint.h +typeprint_h = typeprint.h +ui_file_h = ui-file.h +ui_out_h = ui-out.h +valprint_h = valprint.h +value_h = value.h $(doublest_h) $(symtab_h) $(gdbtypes_h) $(expression_h) +varobj_h = varobj.h $(symtab_h) $(gdbtypes_h) +vax_tdep_h = vax-tdep.h $(osabi_h) +version_h = version.h +wince_stub_h = wince-stub.h +wrapper_h = wrapper.h $(gdb_h) +x86_64_tdep_h = x86-64-tdep.h $(i386_tdep_h) +xcoffsolib_h = xcoffsolib.h +xmodem_h = xmodem.h + +# +# gdb/cli/ headers +# + +cli_cmds_h = $(srcdir)/cli/cli-cmds.h +cli_decode_h = $(srcdir)/cli/cli-decode.h $(gdb_regex_h) $(command_h) +cli_dump_h = $(srcdir)/cli/cli-dump.h +cli_script_h = $(srcdir)/cli/cli-script.h +cli_setshow_h = $(srcdir)/cli/cli-setshow.h +cli_utils_h = $(srcdir)/cli/cli-utils.h + +# +# gdb/mi/ headers +# + +mi_cmds_h = $(srcdir)/mi/mi-cmds.h +mi_console_h = $(srcdir)/mi/mi-console.h +mi_getopt_h = $(srcdir)/mi/mi-getopt.h +mi_out_h = $(srcdir)/mi/mi-out.h +mi_parse_h = $(srcdir)/mi/mi-parse.h + +# +# gdb/tui/ headers +# + +tui_file_h = $(srcdir)/tui/tui-file.h +tui_h = $(srcdir)/tui/tui.h $(ansidecl_h) +tuiCommand_h = $(srcdir)/tui/tuiCommand.h +tuiData_h = $(srcdir)/tui/tuiData.h +tuiDataWin_h = $(srcdir)/tui/tuiDataWin.h +tuiDisassem_h = $(srcdir)/tui/tuiDisassem.h +tuiGeneralWin_h = $(srcdir)/tui/tuiGeneralWin.h +tuiIO_h = $(srcdir)/tui/tuiIO.h +tuiLayout_h = $(srcdir)/tui/tuiLayout.h +tuiRegs_h = $(srcdir)/tui/tuiRegs.h +tuiSource_h = $(srcdir)/tui/tuiSource.h $(defs_h) +tuiSourceWin_h = $(srcdir)/tui/tuiSourceWin.h +tuiStack_h = $(srcdir)/tui/tuiStack.h +tuiWin_h = $(srcdir)/tui/tuiWin.h # Header files that need to have srcdir added. Note that in the cases # where we use a macro like $(gdbcmd_h), things are carefully arranged @@ -686,7 +774,7 @@ xcoffsolib_h = xcoffsolib.h # right, it is probably easiest just to list .h files here directly. HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \ - dst.h environ.h $(gdbcmd_h) gdb.h gdbcore.h \ + environ.h $(gdbcmd_h) gdb.h gdbcore.h \ gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \ objfiles.h parser-defs.h serial.h solib.h \ symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \ @@ -765,6 +853,7 @@ SUBDIRS = @SUBDIRS@ # For now, shortcut the "configure GDB for fewer languages" stuff. YYFILES = c-exp.tab.c \ + ada-exp.tab.c \ jv-exp.tab.c \ f-exp.tab.c m2-exp.tab.c p-exp.tab.c YYOBJ = c-exp.tab.o \ @@ -835,6 +924,22 @@ uninstall: force $(CONFIG_UNINSTALL) rm -rf $(GDBTK_LIBRARY) @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do +install-gdbtk: + $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \ + $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \ + $(SHELL) $(srcdir)/../mkinstalldirs \ + $(GDBTK_LIBRARY)/images \ + $(GDBTK_LIBRARY)/images2 ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \ + $(GDBTK_LIBRARY)/help/images \ + $(GDBTK_LIBRARY)/help/trace ; \ + cd $(srcdir)/gdbtk/library ; \ + for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \ + do \ + $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \ + done ; + # We do this by grepping through sources. If that turns out to be too slow, # maybe we could just require every .o file to have an initialization routine # of a given name (top.o -> _initialize_top, etc.). @@ -1026,6 +1131,7 @@ local-maintainer-clean: @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f c-exp.tab.c \ + ada-lex.c ada-exp.tab.c \ jv-exp.tab \ f-exp.tab.c m2-exp.tab.c p-exp.tab.c rm -f TAGS $(INFOFILES) @@ -1093,15 +1199,20 @@ version.c: Makefile version.in mv version.c-tmp version.c version.o: version.c $(version_h) -# c-exp.tab.c is generated in objdir from c-exp.y if it doesn't exist -# in srcdir, then compiled in objdir to c-exp.tab.o. -# If we said c-exp.tab.c rather than ./c-exp.tab.c some makes -# would sometimes re-write it into $(srcdir)/c-exp.tab.c. +# LANG-exp.tab.c is generated in objdir from LANG-exp.y if it doesn't +# exist in srcdir, then compiled in objdir to LANG-exp.tab.o. + +# If we said LANG-exp.tab.c rather than ./c-exp.tab.c some makes would +# sometimes re-write it into $(srcdir)/c-exp.tab.c. + +# Remove bogus decls for malloc/realloc/free which conflict with +# everything else. Strictly speaking c-exp.tab.c should therefore +# depend on Makefile.in, but that was a pretty big annoyance. -# Remove bogus decls for malloc/realloc/free which conflict with everything -# else. Strictly speaking c-exp.tab.c should therefore depend on -# Makefile.in, but that was a pretty big annoyance. +# See comments above ... +.PRECIOUS: c-exp.tab.c +c-exp.tab.o: c-exp.tab.c c-exp.tab.c: c-exp.y $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS) -sed -e '/extern.*malloc/d' \ @@ -1115,6 +1226,8 @@ c-exp.tab.c: c-exp.y -rm c-exp.tmp mv c-exp.new ./c-exp.tab.c +# See comments above ... +.PRECIOUS: jv-exp.tab.c jv-exp.tab.o: jv-exp.tab.c jv-exp.tab.c: jv-exp.y $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS) @@ -1129,6 +1242,8 @@ jv-exp.tab.c: jv-exp.y -rm jv-exp.tmp mv jv-exp.new ./jv-exp.tab.c +# See comments above ... +.PRECIOUS: f-exp.tab.c f-exp.tab.o: f-exp.tab.c f-exp.tab.c: f-exp.y c-exp.tab.c $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS) @@ -1143,10 +1258,8 @@ f-exp.tab.c: f-exp.y c-exp.tab.c -rm f-exp.tmp mv f-exp.new ./f-exp.tab.c -# m2-exp.tab.c is generated in objdir from m2-exp.y if it doesn't exist -# in srcdir, then compiled in objdir to m2-exp.tab.o. -# Remove bogus decls for malloc/realloc/free which conflict with everything -# else. +# See comments above ... +.PRECIOUS: m2-exp.tab.c m2-exp.tab.o: m2-exp.tab.c m2-exp.tab.c: m2-exp.y $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS) @@ -1161,10 +1274,37 @@ m2-exp.tab.c: m2-exp.y -rm m2-exp.tmp mv m2-exp.new ./m2-exp.tab.c -# p-exp.tab.c is generated in objdir from p-exp.y if it doesn't exist -# in srcdir, then compiled in objdir to p-exp.tab.o. -# Remove bogus decls for malloc/realloc/free which conflict with everything -# else. +# See comments above ... +.PRECIOUS: ada-exp.tab.c +ada-exp.tab.o: ada-exp.tab.c +ada-exp.tab.c: ada-exp.y + $(YACC) $(YFLAGS) $(srcdir)/ada-exp.y + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + < y.tab.c > ada-exp.new + -rm y.tab.c + mv ada-exp.new ./ada-exp.tab.c + +# See comments above ... +.PRECIOUS: ada-lex.c +ada-lex.o: ada-lex.c +ada-lex.c: ada-lex.l + @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \ + echo $(FLEX) -Isit $(srcdir)/ada-lex.l ">" ada-lex.c; \ + $(FLEX) -Isit $(srcdir)/ada-lex.l > ada-lex.c; \ + elif [ ! -f ada-lex.c -a ! -f $(srcdir)/ada-lex.c ]; then \ + echo "ada-lex.c missing and flex not available."; \ + false; \ + elif [ ! -f ada-lex.c ]; then \ + echo "Warning: ada-lex.c older than ada-lex.l and flex not available."; \ + fi + +# See comments above ... +.PRECIOUS: p-exp.tab.c p-exp.tab.o: p-exp.tab.c p-exp.tab.c: p-exp.y $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/p-exp.y y.tab.c p-exp.tmp -- $(YFLAGS) @@ -1179,10 +1319,6 @@ p-exp.tab.c: p-exp.y -rm p-exp.tmp mv p-exp.new ./p-exp.tab.c -# These files are updated atomically, so make never has to remove them -.PRECIOUS: m2-exp.tab.c f-exp.tab.c c-exp.tab.c -.PRECIOUS: jv-exp.tab.c p-exp.tab.c - lint: $(LINTFILES) $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \ `echo $(DEPFILES) | sed 's/\.o /\.c /g'` @@ -1218,15 +1354,15 @@ ALLDEPFILES = a68v-nat.c \ avr-tdep.c \ coff-solib.c \ core-sol2.c core-regset.c core-aout.c corelow.c \ - dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \ + dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \ go32-nat.c h8300-tdep.c h8500-tdep.c \ hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c hpread.c \ - i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \ - i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \ + i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \ + i386v4-nat.c i386ly-tdep.c \ i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \ i387-tdep.c \ i386-linux-tdep.c i386-nat.c \ - i960-tdep.c \ + i386gnu-nat.c i386gnu-tdep.c \ ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \ infptrace.c inftarg.c irix4-nat.c irix5-nat.c \ lynx-nat.c m3-nat.c \ @@ -1248,7 +1384,7 @@ ALLDEPFILES = a68v-nat.c \ procfs.c \ remote-array.c remote-e7000.c \ remote-es.c remote-hms.c remote-mips.c \ - remote-nindy.c remote-rdp.c remote-sim.c \ + remote-rdp.c remote-sim.c \ remote-st.c remote-utils.c dcache.c \ remote-vx.c \ rs6000-nat.c rs6000-tdep.c \ @@ -1267,253 +1403,936 @@ ALLDEPFILES = a68v-nat.c \ xstormy16-tdep.c \ z8k-tdep.c -a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(regcache_h) +# Some files need explict build rules (due to -Werror problems) or due +# to sub-directory fun 'n' games. -aix-thread.o: aix-thread.c $(defs_h) $(gdbcore_h) $(gdbthread_h) \ - $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) $(gdb_assert_h) \ - $(ppc_tdep_h) $(language_h) +# Provide explicit rule/dependency - works for more makes. +copying.o: $(srcdir)/copying.c + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c -alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \ - $(regcache_h) $(alpha_tdep_h) +hpux-thread.o: $(srcdir)/hpux-thread.c + $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \ + -I$(srcdir)/osf-share/HP800 -I/usr/include/dce \ + $(srcdir)/hpux-thread.c -alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(alpha_tdep_h) alphabsd-tdep.h +# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't +# match output format strings. +procfs.o: $(srcdir)/procfs.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c -alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(symtab_h) $(dis_asm_h) $(gdb_string_h) $(linespec_h) \ - $(regcache_h) $(doublest_h) $(BFD_SRC)/elf-bfd.h $(alpha_tdep_h) +v850ice.o: $(srcdir)/v850ice.c + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) \ + $(srcdir)/v850ice.c -alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h) +# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't +# declared -Wimplicit fails. It should be using the GDBARCH framework. +# cagney 1999-09-02. +z8k-tdep.o: $(srcdir)/z8k-tdep.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ + $(srcdir)/z8k-tdep.c -alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h) +# +# Generated YACC/LEX dependencies +# -alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) alphabsd-tdep.h +c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ + $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) -alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h) +jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ + $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) -alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ - $(value_h) $(alpha_tdep_h) solib-svr4.h alphabsd-tdep.h nbsd-tdep.h +f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ + $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ + $(symfile_h) -annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) $(gdbtypes_h) +m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ + $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) -arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(gdb_string_h) $(regcache_h) $(arm_tdep_h) +p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ + $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) -arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ - $(gdbtypes_h) $(floatformat_h) $(regcache_h) $(doublest_h) $(arm_tdep_h) +ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ + $(defs_h) $(expression_h) \ + $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ + $(bfd_h) objfiles.h symfile.h -arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ - $(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) $(doublest_h) \ - $(value_h) $(arch_utils_h) $(solib_svr4_h) $(arm_tdep_h) \ - $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/coff/internal.h \ - $(INCLUDE_DIR)/elf/arm.h $(sim_arm_h) $(gdb_assert_h) +# +# The dependencies. In aphabetic order. +# +a68v-nat.o: a68v-nat.c $(defs_h) $(inferior_h) $(regcache_h) +abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \ + $(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ + $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) +ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \ + $(inferior_h) $(symtab_h) $(target_h) $(gdbcore_h) $(gregset_h) \ + $(ada_lang_h) +ada-typeprint.o: ada-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \ + $(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \ + $(target_h) $(command_h) $(gdbcmd_h) $(language_h) $(demangle_h) \ + $(c_lang_h) $(typeprint_h) $(ada_lang_h) $(gdb_string_h) +ada-valprint.o: ada-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(demangle_h) $(valprint_h) $(language_h) \ + $(annotate_h) $(ada_lang_h) $(c_lang_h) +aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \ + $(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(language_h) \ + $(ppc_tdep_h) +alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ + $(value_h) $(alpha_tdep_h) +alpha-nat.o: alpha-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(alpha_tdep_h) $(gregset_h) +alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ + $(value_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) \ + $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) +alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h) +alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ + $(alphabsd_tdep_h) +alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h) +alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(value_h) $(solib_svr4_h) $(alpha_tdep_h) $(alphabsd_tdep_h) \ + $(nbsd_tdep_h) +annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \ + $(gdbtypes_h) $(breakpoint_h) +# OBSOLETE arc-tdep.o: arc-tdep.c +arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) \ + $(inferior_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ + $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(annotate_h) \ + $(gdb_string_h) $(regcache_h) $(gdb_assert_h) $(sim_regno_h) \ + $(version_h) $(floatformat_h) +arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h) +arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ + $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \ + $(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_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) 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) solib-svr4.h \ - nbsd-tdep.h - +armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(arm_tdep_h) $(nbsd_tdep_h) \ + $(solib_svr4_h) avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) - +ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ + $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) +ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) - -blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h) - -breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(language_h) $(target_h) $(gdbthread_h) \ - $(gdb_string_h) $(gdb_events_h) $(linespec_h) $(ui_out_h) \ - $(completer_h) $(gdb_h) - +blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \ + $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) +breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ + $(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \ + $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ + $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ + $(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \ + $(cli_script_h) $(gdb_events_h) buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(complaints_h) \ $(gdb_string_h) $(expression_h) $(language_h) $(bcache_h) \ - $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) $(stabsread_h) - -builtin-regs.o: builtin-regs.c $(defs.h) $(builtin_regs_h) $(gdbtypes_h) \ - $(gdb_string_h) $(value_h) $(frame_h) - -c-lang.o: c-lang.c $(c_lang_h) $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(parser_defs_h) $(symtab_h) $(macroscope_h) \ - gdb_assert.h - + $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ + $(stabsread_h) +builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ + $(gdb_string_h) $(gdb_assert_h) +c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(c_lang_h) $(valprint_h) \ + $(macroscope_h) $(gdb_assert_h) c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ $(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \ $(gdb_string_h) - -c-valprint.o: c-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(cp_abi_h) - -doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) $(gdbtypes_h) \ - $(gdb_assert_h) $(gdb_string_h) - -f-lang.o: f-lang.c f-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h) - -f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ - $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ - $(f_lang_h) $(gdb_string_h) - -f-valprint.o: f-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h) - -# OBSOLETE ch-exp.o: ch-exp.c ch-lang.h $(defs_h) $(language_h) $(parser_defs_h) \ -# OBSOLETE $(bfd_h) $(symfile_h) $(objfiles_h) $(value_h) - -# OBSOLETE ch-lang.o: ch-lang.c ch-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ -# OBSOLETE $(language_h) $(parser_defs_h) $(symtab_h) - -# OBSOLETE ch-typeprint.o: ch-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \ -# OBSOLETE $(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \ -# OBSOLETE $(target_h) $(language_h) $(ch_lang_h) $(typeprint_h) $(gdb_string_h) - -# OBSOLETE ch-valprint.o: ch-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ -# OBSOLETE $(gdbtypes_h) $(valprint_h) $(expression_h) $(value_h) $(language_h) \ -# OBSOLETE $(demangle_h) $(c_lang_h) $(typeprint_h) $(ch_lang_h) $(annotate_h) - -coff-solib.o: coff-solib.c $(defs_h) - +c-valprint.o: c-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ + $(c_lang_h) $(cp_abi_h) +# OBSOLETE ch-exp.o: ch-exp.c +# OBSOLETE ch-lang.o: ch-lang.c +# OBSOLETE ch-typeprint.o: ch-typeprint.c +# OBSOLETE ch-valprint.o: ch-valprint.c +cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(gdb_string_h) \ + $(gdb_assert_h) +coff-solib.o: coff-solib.c $(defs_h) $(frame_h) $(bfd_h) $(gdbcore_h) \ + $(symtab_h) $(symfile_h) $(objfiles_h) coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \ $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \ $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \ $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \ $(target_h) $(gdb_assert_h) - -complaints.o: complaints.c $(complaints_h) $(defs_h) $(gdbcmd_h) - -# Provide explicit rule/dependency - works for more makes. -copying.o: $(srcdir)/copying.c $(defs_h) $(gdbcmd_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c - -core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h) \ - $(regcache_h) - -core-sol2.o: core-sol2.c $(command_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(gdb_string_h) $(regcache_h) - -core-regset.o: core-regset.c $(command_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(gdb_string_h) - -corefile.o: corefile.c $(dis_asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(language_h) $(gdb_string_h) \ - $(completer_h) $(symfile_h) - -corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(gdbthread_h) $(gdb_string_h) $(regcache_h) - -gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \ - $(elf_bfd_h) $(symfile_h) $(objfiles_h) - -linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) $(gregset_h) \ - $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) $(cli_decode_h) \ - $(gdb_string_h) - -cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) - +complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdbcmd_h) +completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) +copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h) +core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \ + $(gdb_dirent_h) $(gdb_stat_h) +core-regset.o: core-regset.c $(defs_h) $(gdb_string_h) $(inferior_h) \ + $(target_h) $(command_h) $(gdbcore_h) $(gregset_h) +core-sol2.o: core-sol2.c $(defs_h) $(gdb_string_h) $(regcache_h) \ + $(inferior_h) $(target_h) $(command_h) $(gdbcore_h) $(gregset_h) +corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ + $(command_h) $(gdbcmd_h) $(bfd_h) $(target_h) $(gdbcore_h) \ + $(dis_asm_h) $(gdb_stat_h) $(completer_h) +corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \ + $(gdbthread_h) $(regcache_h) $(symfile_h) +cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(gdb_string_h) cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ $(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \ $(cp_abi_h) - -dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) $(gdb_string_h) \ - $(gdbcore_h) $(target_h) - +cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(monitor_h) $(serial_h) $(regcache_h) +cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ + $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \ + $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \ + $(solib_h) $(solib_svr4_h) +# OBSOLETE cxux-nat.o: cxux-nat.c d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \ - $(dis_asm_h) $(symfile_h) $(objfiles_h) $(language_h) $(arch_utils_h) \ - $(regcache_h) $(floatformat_h) $(sim_d10v_h) $(sim_regno_h) - -dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) $(gdb_stat_h) \ - $(symtab_h) $(breakpoint_h) $(target_h) $(gdbcore_h) $(libaout_h) \ - $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ + $(dis_asm_h) $(symfile_h) $(objfiles_h) $(language_h) \ + $(arch_utils_h) $(regcache_h) $(floatformat_h) $(gdb_sim_d10v_h) \ + $(sim_regno_h) +# OBSOLETE d30v-tdep.o: d30v-tdep.c +dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \ + $(gdb_stat_h) $(symtab_h) $(breakpoint_h) $(target_h) $(gdbcore_h) \ + $(libaout_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ $(gdb_stabs_h) $(demangle_h) $(language_h) $(complaints_h) \ $(cp_abi_h) $(aout_aout64_h) $(aout_stab_gnu_h) - +dcache.o: dcache.c $(defs_h) $(dcache_h) $(gdbcmd_h) $(gdb_string_h) \ + $(gdbcore_h) $(target_h) delta68-nat.o: delta68-nat.c $(defs_h) - -demangle.o: demangle.c $(defs_h) $(gdbcmd_h) $(gdb_string_h) - -dink32-rom.o: dink32-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \ - $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \ - $(symfile_h) $(regcache_h) - +demangle.o: demangle.c $(defs_h) $(command_h) $(gdbcmd_h) $(demangle_h) \ + $(gdb_string_h) +dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(symfile_h) $(inferior_h) $(regcache_h) +doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \ + $(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h) dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) - -dstread.o: dstread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(breakpoint_h) \ - $(bfd_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(gdb_obstack_h) \ - $(gdb_string_h) $(dst_h) - -dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(symtab_h) $(symfile_h) $(objfiles_h) \ - $(target_h) $(inferior_h) $(regcache_h) $(dwarf2cfi_h) - -dwarfread.o: dwarfread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \ - $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \ - $(symfile_h) $(symtab_h) $(gdb_string_h) - -dwarf2read.o: dwarf2read.c $(bfd_h) $(buildsym_h) $(defs_h) \ - $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \ - $(symfile_h) $(symtab_h) $(gdb_string_h) $(macrotab_h) - -elfread.o: elfread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \ - $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h) \ - $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/elf/mips.h - -environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) $(gdb_string_h) - -eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \ - $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) $(value_h) \ - $(gdb_string_h) $(cp_abi_h) - -event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h) $(event_top_h) - -event-top.o: event-top.c $(top_h) $(readline_headers) \ - $(defs_h) $(inferior_h) $(event_loop_h) $(event_top_h) $(terminal_h) \ - $(gdbcmd_h) $(target_h) $(cli_decode_h) $(interps_h) - -inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(inf_loop_h) $(event_loop_h) \ - $(event_top_h) - -exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(language_h) $(gdb_string_h) $(completer_h) $(value_h) - -expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) - -fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) $(gdb_string_h) \ - $(elf_bfd_h) $(gregset_h) - -findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \ - $(gdb_string_h) $(regcache_h) $(builtin_regs_h) - +dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) +# OBSOLETE dstread.o: dstread.c +dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h) +dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(target_h) $(elf_dwarf2_h) $(inferior_h) \ + $(regcache_h) $(dwarf2cfi_h) $(gdb_assert_h) +dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ + $(symfile_h) $(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) \ + $(demangle_h) $(expression_h) $(filenames_h) $(macrotab_h) \ + $(language_h) $(complaints_h) $(bcache_h) $(gdb_string_h) \ + $(gdb_assert_h) +dwarfread.o: dwarfread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ + $(objfiles_h) $(elf_dwarf_h) $(buildsym_h) $(demangle_h) \ + $(expression_h) $(language_h) $(complaints_h) $(gdb_string_h) +elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \ + $(elf_mips_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ + $(stabsread_h) $(gdb_stabs_h) $(complaints_h) $(demangle_h) +environ.o: environ.c $(defs_h) $(environ_h) $(gdb_string_h) +eval.o: eval.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(expression_h) $(target_h) $(frame_h) $(language_h) \ + $(f_lang_h) $(cp_abi_h) +event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \ + $(gdb_string_h) +event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ + $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) $(interps_h) +exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ + $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ + $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) +expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(value_h) $(language_h) $(parser_defs_h) +f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ + $(valprint_h) +f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ + $(f_lang_h) $(gdb_string_h) +f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ + $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) +fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(gdb_string_h) $(elf_bfd_h) $(gregset_h) +findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \ + $(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \ + $(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \ + $(builtin_regs_h) +fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \ + $(terminal_h) $(gdbthread_h) $(command_h) +# OBSOLETE fr30-tdep.o: fr30-tdep.c frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ - $(regcache_h) - + $(regcache_h) $(gdb_assert_h) frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ $(arch_utils_h) $(regcache_h) - +gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \ + $(elf_bfd_h) $(symfile_h) $(objfiles_h) +gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h) +gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \ + $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ + $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \ + $(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \ + $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h) +gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \ + $(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \ + $(gdbcmd_h) $(wrapper_h) $(cp_abi_h) $(gdb_assert_h) +gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \ + $(value_h) $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) \ + $(gdbcore_h) $(gdbthread_h) $(gdb_assert_h) $(gnu_nat_h) \ + $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \ + $(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h) +gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) +gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \ + $(gdb_assert_h) $(gdb_string_h) +go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \ + $(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \ + $(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \ + $(gdb_string_h) +interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ + $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) $(gdb_events_h) +h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \ + $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ + $(regcache_h) +h8500-tdep.o: h8500-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcmd_h) $(value_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) +hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(regcache_h) +hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ + $(gdbtypes_h) $(gdbcore_h) $(cp_abi_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) +hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) +hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(gdb_wait_h) $(regcache_h) +hppam3-nat.o: hppam3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ + $(regcache_h) +hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \ + $(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ + $(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \ + $(gdb_string_h) +hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ + $(inferior_h) $(regcache_h) $(gdbcore_h) +i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \ + $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) +i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(value_h) $(regcache_h) $(inferior_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(solib_svr4_h) $(i386_tdep_h) $(i386_linux_tdep_h) +i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) +i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(i386_tdep_h) +i386-stub.o: i386-stub.c +i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(gdbcore_h) $(objfiles_h) $(target_h) $(floatformat_h) $(symfile_h) \ + $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) \ + $(doublest_h) $(value_h) $(gdb_assert_h) $(i386_tdep_h) \ + $(i387_tdep_h) +# OBSOLETE i386aix-nat.o: i386aix-nat.c +i386b-nat.o: i386b-nat.c $(defs_h) +i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h) +i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(gdbcore_h) $(regcache_h) $(gdb_string_h) $(i386_tdep_h) +i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) +i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ + $(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \ + $(i387_tdep_h) +i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(i386_tdep_h) +i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(target_h) $(i386_tdep_h) +# OBSOLETE i386m3-nat.o: i386m3-nat.c +# OBSOLETE i386mach-nat.o: i386mach-nat.c +i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \ + $(regcache_h) $(i387_tdep_h) +i386obsd-nat.o: i386obsd-nat.c $(defs_h) +i386v-nat.o: i386v-nat.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \ + $(gdbcore_h) $(gdb_stat_h) $(floatformat_h) $(target_h) +i386v4-nat.o: i386v4-nat.c $(defs_h) $(value_h) $(inferior_h) $(regcache_h) \ + $(i386_tdep_h) $(i387_tdep_h) $(gregset_h) +i387-tdep.o: i387-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \ + $(value_h) $(gdbcore_h) $(floatformat_h) $(regcache_h) \ + $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h) +# OBSOLETE i960-tdep.o: i960-tdep.c +ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdb_stat_h) +ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h) +ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) $(gregset_h) +ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) +ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ + $(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \ + $(value_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h) +inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \ + $(event_top_h) $(inf_loop_h) $(remote_h) +infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \ + $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \ + $(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \ + $(parser_defs_h) $(regcache_h) +inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ + $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) +infptrace.o: infptrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdb_string_h) $(regcache_h) $(gdb_wait_h) $(command_h) \ + $(gdb_dirent_h) $(gdbcore_h) $(gdb_stat_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) +inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) +infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbcore_h) +irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \ + $(gregset_h) +irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(gdb_string_h) $(gregset_h) +jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ + $(jv_lang_h) $(gdbcore_h) +jv-typeprint.o: jv-typeprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(demangle_h) $(jv_lang_h) $(gdb_string_h) $(typeprint_h) \ + $(c_lang_h) $(cp_abi_h) +jv-valprint.o: jv-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcore_h) $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \ + $(language_h) $(jv_lang_h) $(c_lang_h) $(annotate_h) $(gdb_string_h) +kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) $(kod_h) +kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) $(target_h) $(gdb_string_h) \ + $(kod_h) +language.o: language.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcmd_h) $(expression_h) $(language_h) $(target_h) \ + $(parser_defs_h) $(jv_lang_h) +lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \ + $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) +linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ + $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \ + $(cp_abi_h) +linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ + $(cli_decode_h) $(gdb_string_h) +lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) +m2-lang.o: m2-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(m2_lang_h) $(c_lang_h) \ + $(valprint_h) +m2-typeprint.o: m2-typeprint.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(gdbcore_h) $(target_h) $(m2_lang_h) +m2-valprint.o: m2-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(m2_lang_h) +m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(symtab_h) $(value_h) \ + $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) $(gdbcore_h) \ + $(regcache_h) +m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \ + $(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h) +m32r-stub.o: m32r-stub.c $(syscall_h) +m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ + $(regcache_h) +m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ + $(inferior_h) $(dis_asm_h) $(symfile_h) $(objfiles_h) \ + $(arch_utils_h) $(regcache_h) $(target_h) $(opcode_m68hc11_h) \ + $(elf_m68hc11_h) $(elf_bfd_h) +m68k-stub.o: m68k-stub.c +m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \ + $(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \ + $(arch_utils_h) $(gregset_h) +m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(language_h) $(gdbcore_h) $(regcache_h) $(gdb_stat_h) \ + $(floatformat_h) $(target_h) $(gregset_h) +m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) +m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h) +# OBSOLETE m88k-nat.o: m88k-nat.c +# OBSOLETE m88k-tdep.o: m88k-tdep.c +macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) $(macroscope_h) \ + $(command_h) $(gdbcmd_h) +macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \ + $(macroexp_h) $(gdb_assert_h) +macroscope.o: macroscope.c $(defs_h) $(macroscope_h) $(symtab_h) $(target_h) \ + $(frame_h) $(inferior_h) +macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) \ + $(symtab_h) $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) \ + $(bcache_h) $(complaints_h) +main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \ + $(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \ + $(event_loop_h) $(ui_out_h) +maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \ + $(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \ + $(language_h) $(symfile_h) $(objfiles_h) $(value_h) $(cli_decode_h) +mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(gdb_string_h) $(regcache_h) $(serial_h) +mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ + $(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \ + $(arch_utils_h) +mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \ + $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ + $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ + $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ + $(aout_stab_gnu_h) $(expression_h) $(language_h) +mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \ + $(target_h) +memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \ + $(target_h) $(value_h) $(language_h) $(gdb_string_h) +minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(cp_abi_h) +mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h) +mips-linux-nat.o: mips-linux-nat.c $(defs_h) +mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(solib_svr4_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) $(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) \ + $(mipsnbsd_tdep_h) +mipsnbsd-tdep.o: mipsnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(value_h) $(osabi_h) $(mipsnbsd_tdep_h) $(solib_svr4_h) +mipsread.o: mipsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ + $(coff_sym_h) $(coff_internal_h) $(coff_ecoff_h) $(libcoff_h) \ + $(libecoff_h) $(elf_common_h) $(elf_mips_h) +mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(gregset_h) +mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ + $(symfile_h) $(regcache_h) +mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ + $(symfile_h) $(regcache_h) $(arch_utils_h) +mon960-rom.o: mon960-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(srec_h) $(xmodem_h) $(symtab_h) $(symfile_h) \ + $(inferior_h) $(gdb_string_h) +monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ + $(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) $(inferior_h) \ + $(gdb_regex_h) $(srec_h) $(regcache_h) +nbsd-tdep.o: nbsd-tdep.c $(defs_h) $(solib_svr4_h) +nindy-tdep.o: nindy-tdep.c $(defs_h) $(symtab_h) $(frame_h) $(gdbcore_h) +nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) +ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \ + $(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) \ + $(ns32k_tdep_h) +ns32knbsd-nat.o: ns32knbsd-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) +ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h) +objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ + $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) +ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ + $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h) +op50-rom.o: op50-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) +# OBSOLETE os9kread.o: os9kread.c +osabi.o: osabi.c $(defs_h) $(gdb_string_h) $(osabi_h) $(elf_bfd_h) +osfsolib.o: osfsolib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) \ + $(frame_h) $(gdb_regex_h) $(inferior_h) $(language_h) $(gdbcmd_h) +p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \ + $(valprint_h) +p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ + $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h) +p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ + $(gdbcore_h) $(demangle_h) $(valprint_h) $(typeprint_h) \ + $(language_h) $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h) +pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_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) +parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \ + $(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \ + $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) +ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \ + $(regcache_h) +ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(gdbcore_h) $(regcache_h) $(gregset_h) $(ppc_tdep_h) +ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ + $(objfiles_h) $(regcache_h) $(value_h) $(solib_svr4_h) $(ppc_tdep_h) +ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(value_h) $(ppc_tdep_h) +ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \ + $(ppcnbsd_tdep_h) +ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(breakpoint_h) $(value_h) $(ppc_tdep_h) \ + $(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) +printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ + $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ + $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ + $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ + $(gdb_assert_h) +proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(proc_utils_h) +proc-events.o: proc-events.c $(defs_h) +proc-flags.o: proc-flags.c $(defs_h) +proc-service.o: proc-service.c $(defs_h) $(gdb_proc_service_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gregset_h) +proc-why.o: proc-why.c $(defs_h) $(proc_utils_h) +procfs.o: procfs.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(elf_bfd_h) $(gdbcmd_h) $(gdbthread_h) $(gdb_dirent_h) $(X_OK) \ + $(gdb_stat_h) $(proc_utils_h) $(gregset_h) +ptx4-nat.o: ptx4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \ + $(gregset_h) regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \ - $(gdbcmd_h) $(regcache_h) $(gdb_assert_h) $(gdb_string_h) - -fork-child.o: fork-child.c $(gdb_wait_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h) - -install-gdbtk: - $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \ - $(SHELL) $(srcdir)/../mkinstalldirs \ - $(GDBTK_LIBRARY)/images \ - $(GDBTK_LIBRARY)/images2 ; \ - $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \ - $(GDBTK_LIBRARY)/help/images \ - $(GDBTK_LIBRARY)/help/trace ; \ - cd $(srcdir)/gdbtk/library ; \ - for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \ - do \ - $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \ - done ; + $(gdbcmd_h) $(regcache_h) $(gdb_assert_h) $(gdb_string_h) \ + $(gdbcmd_h) +remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) \ + $(remote_utils_h) $(inferior_h) $(version_h) $(regcache_h) +# OBSOLETE remote-bug.o: remote-bug.c +remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \ + $(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \ + $(gdbcmd_h) $(serial_h) $(remote_utils_h) $(symfile_h) $(regcache_h) +remote-es.o: remote-es.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(target_h) $(command_h) $(symfile_h) $(remote_utils_h) $(gdbcore_h) \ + $(serial_h) $(regcache_h) $(value_h) +remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +remote-mips.o: remote-mips.c $(defs_h) $(inferior_h) $(bfd_h) $(symfile_h) \ + $(gdbcmd_h) $(gdbcore_h) $(serial_h) $(target_h) $(remote_utils_h) \ + $(gdb_string_h) $(gdb_stat_h) $(regcache_h) +# OBSOLETE remote-nindy.o: remote-nindy.c +# OBSOLETE remote-nrom.o: remote-nrom.c +# OBSOLETE remote-os9k.o: remote-os9k.c +remote-rdi.o: remote-rdi.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \ + $(breakpoint_h) $(completer_h) $(regcache_h) $(arm_tdep_h) \ + $(rdi_share_ardi_h) $(rdi_share_adp_h) $(rdi_share_hsys_h) +remote-rdp.o: remote-rdp.c $(defs_h) $(inferior_h) $(value_h) \ + $(gdb_callback_h) $(command_h) $(symfile_h) $(remote_utils_h) \ + $(gdb_string_h) $(gdbcore_h) $(regcache_h) $(serial_h) $(arm_tdep_h) +remote-sds.o: remote-sds.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \ + $(regcache_h) $(serial_h) +remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) \ + $(gdb_string_h) $(terminal_h) $(target_h) $(gdbcore_h) \ + $(gdb_callback_h) $(gdb_remote_sim_h) $(remote_utils_h) $(command_h) \ + $(regcache_h) $(gdb_assert_h) $(sim_regno_h) +remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ + $(serial_h) $(regcache_h) +remote-utils.o: remote-utils.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \ + $(target_h) $(serial_h) $(gdbcore_h) $(inferior_h) $(remote_utils_h) \ + $(regcache_h) +remote-vx.o: remote-vx.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(command_h) $(symtab_h) $(complaints_h) $(gdbcmd_h) \ + $(bfd_h) $(symfile_h) $(objfiles_h) $(gdb_stabs_h) $(regcache_h) \ + $(gdb_string_h) $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) \ + $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote-vx68.o: remote-vx68.c $(defs_h) $(vx_share_regPacket_h) $(frame_h) \ + $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) $(symtab_h) \ + $(symfile_h) $(regcache_h) $(gdb_string_h) $(vx_share_ptrace_h) \ + $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) \ + $(vx_share_dbgRpcLib_h) +# OBSOLETE remote-vx960.o: remote-vx960.c +remote-vxmips.o: remote-vxmips.c $(defs_h) $(vx_share_regPacket_h) \ + $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \ + $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \ + $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \ + $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote-vxsparc.o: remote-vxsparc.c $(defs_h) $(vx_share_regPacket_h) \ + $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \ + $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \ + $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \ + $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ + $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \ + $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \ + $(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \ + $(gdbcore_h) +rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) $(value_h) +rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(xcoffsolib_h) $(symfile_h) $(objfiles_h) $(libbfd_h) $(bfd_h) \ + $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \ + $(ppc_tdep_h) $(gdb_stat_h) +rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) $(objfiles_h) \ + $(arch_utils_h) $(regcache_h) $(doublest_h) $(value_h) \ + $(parser_defs_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \ + $(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \ + $(ppc_tdep_h) +s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) +s390-tdep.o: s390-tdep.c $(arch_utils_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ + $(objfiles_h) $(tm_h) $(__bfd_bfd_h) $(floatformat_h) $(regcache_h) \ + $(value_h) $(gdb_assert_h) +scm-exp.o: scm-exp.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \ + $(scm_tags_h) +scm-lang.o: scm-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \ + $(scm_tags_h) $(gdb_string_h) $(gdbcore_h) +scm-valprint.o: scm-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(value_h) \ + $(scm_lang_h) $(valprint_h) $(gdbcore_h) +ser-e7kpc.o: ser-e7kpc.c $(defs_h) $(serial_h) $(gdb_string_h) +ser-go32.o: ser-go32.c $(defs_h) $(gdbcmd_h) $(serial_h) $(gdb_string_h) +ser-pipe.o: ser-pipe.c $(defs_h) $(serial_h) $(ser_unix_h) $(gdb_vfork_h) \ + $(gdb_string_h) +ser-tcp.o: ser-tcp.c $(defs_h) $(serial_h) $(ser_unix_h) $(gdb_string_h) +ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h) $(terminal_h) \ + $(gdb_string_h) $(event_loop_h) +serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h) $(gdbcmd_h) +sh-stub.o: sh-stub.c +sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) \ + $(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \ + $(regcache_h) $(doublest_h) $(sh_tdep_h) $(elf_bfd_h) \ + $(solib_svr4_h) $(elf_sh_h) $(gdb_sim_sh_h) +sh3-rom.o: sh3-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(srec_h) $(arch_utils_h) $(regcache_h) $(sh_tdep_h) +shnbsd-nat.o: shnbsd-nat.c $(defs_h) $(inferior_h) $(shnbsd_tdep_h) +shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) $(value_h) \ + $(solib_svr4_h) $(nbsd_tdep_h) $(sh_tdep_h) $(shnbsd_tdep_h) +sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ + $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h) $(symfile_h) \ + $(gregset_h) +solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \ + $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(gdbcore_h) \ + $(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \ + $(environ_h) $(language_h) $(gdbcmd_h) $(solist_h) +solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) +solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h) +solib-osf.o: solib-osf.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(target_h) $(inferior_h) $(solist_h) +solib-sunos.o: solib-sunos.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) $(solist_h) +solib-svr4.o: solib-svr4.c $(defs_h) $(elf_external_h) $(elf_common_h) \ + $(elf_mips_h) $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) $(solib_svr4_h) +solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \ + $(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \ + $(completer_h) $(filenames_h) $(solist_h) +somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(gdb_stabs_h) \ + $(complaints_h) $(gdb_string_h) $(demangle_h) $(som_h) $(libhppa_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) +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) \ + $(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \ + $(filenames_h) $(completer_h) $(ui_out_h) +sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h) +sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(regcache_h) +sparc-stub.o: sparc-stub.c +sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(inferior_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \ + $(regcache_h) $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h) +sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(sparcnbsd_tdep_h) +sparcl-stub.o: sparcl-stub.c +sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(breakpoint_h) \ + $(target_h) $(serial_h) $(regcache_h) +sparclet-rom.o: sparclet-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(monitor_h) $(serial_h) $(srec_h) $(symtab_h) $(symfile_h) \ + $(regcache_h) +sparclet-stub.o: sparclet-stub.c +sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(sparcnbsd_tdep_h) +sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(value_h) $(osabi_h) $(sparcnbsd_tdep_h) $(nbsd_tdep_h) \ + $(solib_svr4_h) +stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \ + $(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \ + $(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \ + $(buildsym_h) $(complaints_h) $(demangle_h) $(language_h) \ + $(doublest_h) $(stabsread_h) +stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \ + $(gdbcore_h) $(target_h) $(breakpoint_h) $(demangle_h) $(inferior_h) \ + $(annotate_h) $(ui_out_h) +standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \ + $(inferior_h) $(gdb_wait_h) +std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ + $(value_h) $(gdb_string_h) +stop-gdb.o: stop-gdb.c $(defs_h) +sun3-nat.o: sun3-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) +symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ + $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ + $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ + $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) +symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(target_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) $(gdbcore_h) +symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(gdb_stat_h) $(gdbcore_h) +symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ + $(gdb_obstack_h) $(language_h) $(bcache_h) $(gdb_string_h) +symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ + $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ + $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ + $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ + $(cp_abi_h) +target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ + $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(gdb_wait_h) $(dcache_h) $(regcache_h) +thread-db.o: thread-db.c $(defs_h) $(gdb_assert_h) $(gdb_proc_service_h) \ + $(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) $(inferior_h) \ + $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) +thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \ + $(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \ + $(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h) +top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \ + $(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \ + $(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \ + $(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \ + $(gdb_assert_h) $(event_top_h) $(gdb_string_h) $(gdb_stat_h) \ + $(ui_out_h) $(cli_out_h) +tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ + $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ + $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ + $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ + $(ax_gdb_h) +typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ + $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) +ui-file.o: ui-file.c $(defs_h) $(ui_file_h) $(gdb_string_h) +ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ + $(ui_out_h) $(gdb_assert_h) +utils.o: utils.c $(config_h) $(defs_h) $(gdb_assert_h) $(gdb_string_h) \ + $(event_top_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) \ + $(demangle_h) $(expression_h) $(language_h) $(annotate_h) \ + $(filenames_h) $(inferior_h) $(mmalloc_h) +uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \ + $(regcache_h) $(gregset_h) +v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ + $(arch_utils_h) $(regcache_h) $(symtab_h) +v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ + $(inferior_h) $(breakpoint_h) $(symfile_h) $(target_h) $(objfiles_h) \ + $(gdbcore_h) $(value_h) $(command_h) $(regcache_h) +valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(target_h) $(language_h) $(gdb_string_h) \ + $(doublest_h) +valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ + $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ + $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \ + $(gdb_assert_h) +valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ + $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) +values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) $(target_h) \ + $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \ + $(gdb_assert_h) $(regcache_h) +varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \ + $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h) +vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \ + $(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \ + $(vax_tdep_h) +w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(xmodem_h) $(regcache_h) +win32-nat.o: win32-nat.c $(defs_h) $(tm_h) $(frame_h) $(inferior_h) \ + $(target_h) $(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) \ + $(top_h) $(i386_tdep_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ + $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) +wince-stub.o: wince-stub.c $(wince_stub_h) +wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ + $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \ + $(regcache_h) +wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h) +x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) $(gdb_assert_h) $(x86_64_tdep_h) +x86-64-linux-tdep.o: x86-64-linux-tdep.c $(defs_h) $(inferior_h) \ + $(gdbcore_h) $(regcache_h) $(x86_64_tdep_h) $(dwarf2cfi_h) +x86-64-tdep.o: x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) $(objfiles_h) \ + $(x86_64_tdep_h) $(dwarf2cfi_h) $(gdb_assert_h) +xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \ + $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \ + $(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(expression_h) \ + $(complaints_h) $(gdb_stabs_h) $(aout_stab_gnu_h) +xcoffsolib.o: xcoffsolib.c $(defs_h) $(bfd_h) $(xcoffsolib_h) $(inferior_h) \ + $(gdbcmd_h) $(symfile_h) $(frame_h) $(gdb_regex_h) +xmodem.o: xmodem.c $(defs_h) $(serial_h) $(target_h) $(xmodem_h) +xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \ + $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h) \ + $(objfiles_h) +z8k-tdep.o: z8k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcmd_h) \ + $(gdbtypes_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) $(value_h) + +# +# gdb/cli/ dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \ + $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \ + $(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \ + $(cli_setshow_h) $(cli_cmds_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c +cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \ + $(cli_decode_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c +cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) \ + $(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \ + $(cli_dump_h) $(gdb_assert_h) $(target_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c +cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(value_h) \ + $(wrapper_h) $(event_top_h) $(ui_out_h) $(cli_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c +cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \ + $(ui_out_h) $(gdb_string_h) $(top_h) $(cli_cmds_h) $(cli_decode_h) \ + $(cli_script_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c +cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(value_h) \ + $(gdb_string_h) $(ui_out_h) $(cli_decode_h) $(cli_cmds_h) \ + $(cli_setshow_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c +cli-utils.o: $(srcdir)/cli/cli-utils.c $(defs_h) $(cli_utils_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c + +# +# GDBTK sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o @@ -1590,938 +2409,184 @@ gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-wrapper.c -v850ice.o: v850ice.c $(defs_h) $(symtab_h) $(inferior_h) $(command_h) \ - $(frame_h) $(breakpoint_h) $(gdbcore_h) $(value_h) $(symfile_h) \ - $(gdb_string_h) $(target_h) $(objfiles_h) $(regcache_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ - $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ - $(srcdir)/v850ice.c - -v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ - $(arch_utils_h) $(regcache_h) $(symtab_h) - -tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \ - $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) \ - $(language_h) $(gdb_string_h) $(readline_headers) $(remote_h) \ - $(linespec_h) $(regcache_h) $(completer_h) - -gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \ - $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ - $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \ - $(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \ - $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h) - -arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \ - $(arch_utils_h) $(gdb_assert_h) $(inferior_h) \ - $(gdb_string_h) $(symtab.h) $(frame_h) $(breakpoint_h) $(gdb_wait_h) \ - $(gdbcore_h) $(target_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \ - $(version_h) $(floatformat_h) $(sim_regno_h) - -gdbtypes.o: gdbtypes.c $(bfd_h) $(complaints_h) $(defs_h) $(expression_h) \ - $(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \ - $(target_h) $(value_h) $(gdb_string_h) $(wrapper_h) $(cp_abi_h) - -osabi.o: osabi.c $(defs_h) $(BFD_SRC)/elf-bfd.h - -go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \ - $(command_h) $(floatformat_h) $(target_h) i387-tdep.h $(regcache_h) - -gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \ - exc_request_U.h msg_U.h gnu-nat.h - -gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \ - $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) - -gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \ - $(gdb_assert_h) $(gdb_string_h) - -h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \ - $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ - $(regcache_h) - -h8500-tdep.o: h8500-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ - $(gdbcmd_h) $(value_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) - -hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) - -hpacc-abi.o: hpacc-abi.c $(defs_h) $(cp_abi_h) $(gdb_string_h) $(gdbtypes_h) \ - $(value_h) $(gdbcore_h) - -hppa-tdep.o: hppa-tdep.c $(gdb_wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h) \ - $(completer_h) - -hppab-nat.o: hppab-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \ - $(regcache_h) - -hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \ - $(regcache_h) - -i386gnu-nat.o: gnu-nat.h - -i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) \ - $(inferior_h) $(gdbcore_h) $(target_h) $(floatformat_h) \ - $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) \ - $(doublest_h) $(value_h) - -i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) - -i386aix-nat.o: i386aix-nat.c $(defs_h) $(frame_h) $(inferior_h) \ - $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h) - -i386b-nat.o: i386b-nat.c $(defs_h) $(regcache_h) - -i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(frame_h) $(gdb_core_h) \ - $(regcache_h) - -i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) - -i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) - -i386ly-nat.o: i386ly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) - -i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ - $(regcache_h) - -i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) $(target_h) \ - $(regcache_h) - -i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(regcache_h) - -i386v-nat.o: i386v-nat.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(language_h) $(target_h) - -i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(symtab_h) $(symfile_h) $(objfiles_h) $(regcache_h) \ - $(i386_linux_tdep_h) $(i386_tdep_h) $(i387_tdep_h) - -i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ - $(value_h) $(regcache_h) - -i386v4-nat.o: i386v4-nat.c $(defs_h) $(regcache_h) - -i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(language_h) $(regcache_h) $(doublest_h) i386-tdep.h - -i960-tdep.o: i960-tdep.c $(defs_h) $(symtab_h) $(value_h) $(frame_h) \ - $(floatformat_h) $(target_h) $(gdbcore_h) $(inferior_h) $(regcache_h) - -ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \ - $(gdbcore_h) $(regcache_h) - -ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) - -ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ - $(arch_utils_h) $(floatformat_h) $(objfiles_h) $(value_h) \ - $(INCLUDE_DIR)/elf/common.h $(regcache_h) $(doublest_h) - -infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(language_h) $(symfile_h) $(gdb_string_h) \ - $(ui_out_h) $(completer_h) $(regcache_h) - -inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \ - $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h) - -infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \ - $(gdb_string_h) $(gdb_wait_h) $(command_h) $(regcache_h) - -infrun.o: infrun.c $(gdb_wait_h) $(defs_h) $(gdbcmd_h) $(cli_script_h) \ - $(gdbcore_h) $(value_h) \ - $(inferior_h) $(target_h) $(gdbthread_h) $(gdb_string_h) $(event_loop_h) \ - $(event_top_h) $(regcache_h) - -inftarg.o: inftarg.c $(gdb_wait_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(terminal_h) $(command_h) - -irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) -irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ - $(symtab_h) $(symfile_h) $(objfiles_h) $(command_h) $(frame_h) \ - $(gdb_regex_h) $(language_h) $(gdb_string_h) $(regcache_h) - -jv-lang.o: jv-lang.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ - $(expression_h) $(parser_defs_h) $(language_h) $(symfile_h) \ - $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) jv-lang.h \ - $(gdbcore_h) - -jv-typeprint.o: jv-typeprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ - $(value_h) $(demangle_h) jv-lang.h $(gdb_string_h) \ - $(typeprint_h) $(c_lang_h) $(cp_abi_h) - -jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ - $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \ - $(language_h) jv-lang.h $(c_lang_h) gdbcore.h $(annotate_h) - -kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) $(target_h) $(gdb_string_h) \ - kod.h - -kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) kod.h - -language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \ - $(gdbcmd_h) $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) \ - $(target_h) $(value_h) $(gdb_string_h) - -lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcore_h) \ - $(target_h) $(regcache_h) - -m2-lang.o: m2-lang.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) - -m2-typeprint.o: m2-typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ - $(gdbcore_h) $(gdbtypes_h) $(language_h) m2-lang.h $(symtab_h) \ - $(target_h) $(value_h) $(gdb_string_h) - -m2-valprint.o: m2-valprint.c $(defs_h) $(gdbtypes_h) $(symtab_h) \ - $(valprint_h) m2-lang.h - -m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) $(language_h) \ - $(target_h) $(gdb_wait_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h) - -m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ - $(regcache_h) - -p-lang.o: p-lang.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h) +# +# gdb/mi/ dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. -p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ - $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ - $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h) +mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ + $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \ + $(mi_getopt_h) $(gdb_events_h) $(gdb_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c +mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ + $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c +mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ + $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c +mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ + $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c +mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c +mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c +mi-events.o: $(srcdir)/mi/mi-events.c $(defs_h) $(ui_out_h) $(interps_h) \ + $(gdb_h) $(breakpoint_h) $(mi_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-events.c +mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(defs_h) $(mi_getopt_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c +mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(interps_h) \ + $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) \ + $(top_h) $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c +mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \ + $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \ + $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \ + $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \ + $(gdb_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c +mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c +mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c -p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ - $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ - $(gdbcore_h) $(demangle_h) $(valprint_h) $(typeprint_h) $(language_h) \ - $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h) +# +# nindy-share sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. -m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ - $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \ - $(dis_asm_h) $(symfile_h) $(objfiles_h) $(arch_utils_h) $(regcache_h) \ - $(target_h) $(opcode_m68hc11_h) +Onindy.o: nindy-share/Onindy.c $(gdb_wait_h) nindy-share/block_io.h \ + nindy-share/env.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c -m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ - $(gdbcore_h) $(gdb_string_h) $(regcache_h) +nindy.o: nindy-share/nindy.c $(gdb_wait_h) nindy-share/block_io.h \ + nindy-share/env.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c -m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) +ttyflush.o: nindy-share/ttyflush.c $(srcdir)/nindy-share/ttyflush.c + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c -m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ - $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h) +# +# rdi-share sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. -mac-nat.o: mac-nat.c $(defs_h) $(gdb_string_h) $(regcache_h) +rdi-share/libangsd.a: force + @dir=rdi-share; \ + if [ -f ./$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + srcroot=`cd $(srcdir); pwd`; export srcroot; \ + (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ + else \ + true; \ + fi -main.o: main.c $(top_h) $(defs_h) $(gdb_string_h) $(event_loop_h) \ - $(symfile_h) $(gdbcore_h) $(ui_out_h) $(inferior_h) +# +# Signals sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. -maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) \ - $(language_h) $(expression_h) $(objfiles_h) $(symfile_h) \ - $(cli_decode_h) +signals.o: $(srcdir)/signals/signals.c $(defs_h) $(target_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/signals/signals.c -mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) \ - $(symtab_h) $(symfile_h) $(gdbcore_h) $(inferior_h) +# +# TUI dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. -mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(gdb_string_h) $(regcache_h) $(serial_h) +tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \ + $(tui_tuiIO_h) $(tui_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c +tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(config_h) $(defs_h) $(symtab_h) \ + $(inferior_h) $(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(target_h) $(gdbcore_h) $(event_loop_h) $(frame_h) $(breakpoint_h) \ + $(gdb_events_h) $(tui_h) $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) \ + $(tuiRegs_h) $(tuiWin_h) $(tuiStack_h) $(tuiDataWin_h) \ + $(tuiSourceWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c +tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \ + $(gdb_string_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-out.c +tui.o: $(srcdir)/tui/tui.c $(config_h) $(defs_h) $(gdbcmd_h) $(tui_h) \ + $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) $(tuiRegs_h) $(tuiStack_h) \ + $(tuiWin_h) $(tuiSourceWin_h) $(readline_h) $(target_h) $(frame_h) \ + $(breakpoint_h) $(inferior_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui.c +tuiCommand.o: $(srcdir)/tui/tuiCommand.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiWin_h) $(tuiIO_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiCommand.c +tuiData.o: $(srcdir)/tui/tuiData.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiData.c +tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) $(tuiRegs_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDataWin.c +tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c $(config_h) $(defs_h) $(symtab_h) \ + $(breakpoint_h) $(frame_h) $(value_h) $(tui_h) $(tuiData_h) \ + $(tuiWin_h) $(tuiLayout_h) $(tuiSourceWin_h) $(tuiStack_h) \ + $(tui_file_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDisassem.c +tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c $(config_h) $(defs_h) \ + $(tui_h) $(tuiData_h) $(tuiGeneralWin_h) $(tuiWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c +tuiIO.o: $(srcdir)/tui/tuiIO.c $(config_h) $(defs_h) $(terminal_h) \ + $(target_h) $(event_loop_h) $(command_h) $(top_h) $(readline_h) \ + $(tui_h) $(tuiData_h) $(tuiIO_h) $(tuiCommand_h) $(tuiWin_h) \ + $(tuiGeneralWin_h) $(tui_file_h) $(ui_out_h) $(cli_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiIO.c +tuiLayout.o: $(srcdir)/tui/tuiLayout.c $(config_h) $(defs_h) $(command_h) \ + $(symtab_h) $(frame_h) $(tui_h) $(tuiData_h) $(tuiDataWin_h) \ + $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) $(tuiWin_h) \ + $(tuiSourceWin_h) $(tuiDisassem_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiLayout.c +tuiRegs.o: $(srcdir)/tui/tuiRegs.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) \ + $(inferior_h) $(target_h) $(tuiLayout_h) $(tuiWin_h) $(tuiDataWin_h) \ + $(tuiGeneralWin_h) $(tui_file_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiRegs.c +tuiSource.o: $(srcdir)/tui/tuiSource.c $(config_h) $(defs_h) $(symtab_h) \ + $(frame_h) $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) \ + $(tuiData_h) $(tuiStack_h) $(tuiSourceWin_h) $(tuiSource_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSource.c +tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c $(config_h) $(defs_h) \ + $(symtab_h) $(frame_h) $(breakpoint_h) $(value_h) $(tui_h) \ + $(tuiData_h) $(tuiStack_h) $(tuiWin_h) $(tuiGeneralWin_h) \ + $(tuiSourceWin_h) $(tuiSource_h) $(tuiDisassem_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSourceWin.c +tuiStack.o: $(srcdir)/tui/tuiStack.c $(config_h) $(defs_h) $(symtab_h) \ + $(breakpoint_h) $(frame_h) $(command_h) $(tui_h) $(tuiData_h) \ + $(tuiStack_h) $(tuiGeneralWin_h) $(tuiSource_h) $(tuiSourceWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiStack.c +tuiWin.o: $(srcdir)/tui/tuiWin.c $(config_h) $(defs_h) $(command_h) \ + $(symtab_h) $(breakpoint_h) $(frame_h) $(cli_cmds_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) \ + $(tuiDisassem_h) $(tuiSource_h) $(tuiSourceWin_h) $(tuiDataWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiWin.c -mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ - $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \ - $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ - $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ - $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ - $(aout_stab_gnu_h) $(expression_h) $(language_h) +# +# vx-share sub-directory +# -mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) +xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/xdr_ld.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c -# OBSOLETE # os9kread assumes that sizeof(char*) <= sizeof(int). This looses on -# OBSOLETE # 64 bit targets where often, sizeof(int)=4 but sizeof(char*)=9. -# OBSOLETE os9kread.o: os9kread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \ -# OBSOLETE $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \ -# OBSOLETE $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \ -# OBSOLETE $(symtab_h) $(target_h) $(gdb_string_h) -# OBSOLETE $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ -# OBSOLETE $(srcdir)/os9kread.c - -mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \ - $(target_h) - -memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \ - $(target_h) $(value_h) $(language_h) $(gdb_string_h) - -minsyms.o: minsyms.c $(bfd_h) $(defs_h) $(objfiles_h) $(symfile_h) \ - $(symtab_h) $(gdb_string_h) $(value_h) $(cp_abi_h) - -mips-linux-nat.o: mips-linux-nat.c $(defs_h) - -mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ - solib-svr4.h - -mips-nat.o: mips-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) - -mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) osabi.h $(BFD_SRC)/elf-bfd.h - -mips-tdep.o: mips-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(arch_utils_h) $(regcache_h) \ - $(inferior_h) $(language_h) $(objfiles_h) $(symfile_h) \ - $(gdb_string_h) osabi.h - -mipsread.o: mipsread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \ - $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \ - $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) $(symtab_h) \ - $(gdb_string_h) - -mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \ - $(regcache_h) - -mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - mipsnbsd-tdep.h - -mipsnbsd-tdep.o: mipsnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ - $(target_h) $(value_h) osabi.h solib-svr4.h mipsnbsd-tdep.h - -mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ - $(regcache_h) - -mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ - $(regcache_h) $(arch_utils_h) - -monitor.o: monitor.c $(monitor_h) $(bfd_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(gdb_string_h) \ - $(regcache_h) - -nbsd-tdep.o: nbsd-tdep.c $(defs_h) solib-svr4.h - -Onindy.o: nindy-share/Onindy.c $(gdb_wait_h) nindy-share/block_io.h \ - nindy-share/env.h - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c - -nindy.o: nindy-share/nindy.c $(gdb_wait_h) nindy-share/block_io.h \ - nindy-share/env.h - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c - -nlmread.o: nlmread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \ - $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(stabsread_h) \ - $(gdb_string_h) - -ttyflush.o: nindy-share/ttyflush.c - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c - -nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) - -ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h) - -objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ - $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ - $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) - -solib-osf.o: solib-osf.c $(defs_h) $(inferior_h) $(symtab_h) $(objfiles_h) \ - $(symfile_h) $(target_h) $(gdb_string_h) $(solist_h) - -somread.o: somread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \ - $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h) - -somsolib.o: somsolib.c $(defs_h) $(regcache_h) - -std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ - $(value_h) $(gdb_string_h) - -pa64solib.o: pa64solib.c $(defs_h) $(regcache_h) - -hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) inferior.h \ - $(regcache_h) - $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \ - -I$(srcdir)/osf-share/HP800 -I/usr/include/dce $(srcdir)/hpux-thread.c - -hpread.o: hpread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \ - $(demangle_h) $(gdb_stabs_h) $(gdbtypes_h) $(objfiles_h) \ - $(symfile_h) $(syms_h) $(symtab_h) $(gdb_string_h) \ - $(INCLUDE_DIR)/hp-symtab.h - -parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \ - $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(gdb_string_h) $(linespec_h) $(doublest_h) - -ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ - $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ - $(objfiles_h) $(gdb_stabs_h) $(serial_h) ocd.h $(regcache_h) - -ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdbcore_h) $(frame_h) \ - $(inferior_h) $(target_h) $(regcache_h) $(ppc_tdep_h) - -ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(ppc_tdep_h) $(regcache_h) $(value_h) - -ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(value_h) $(regcache_h) $(ppc_tdep_h) - -ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \ - ppcnbsd-tdep.h - -ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ - $(target_h) $(breakpoint_h) $(value_h) $(ppc_tdep_t) ppcnbsd-tdep.h \ - nbsd-tdep.h - -ppcbug-rom.o: ppcbug-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \ - $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \ - $(regcache_h) - -printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \ - $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \ - $(symfile_h) $(symtab_h) $(target_h) $(gdb_string_h) $(ui_out_h) \ - $(completer_h) - -# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't -# match output format strings. -procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(gdb_string_h) $(gdbthread_h) proc-utils.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c - -proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) proc-utils.h $(completer_h) - -proc-events.o: proc-events.c $(defs_h) - -proc-flags.o: proc-flags.c $(defs_h) - -proc-why.o: proc-why.c $(defs_h) proc-utils.h - -sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \ - $(gdbcmd_h) $(regcache_h) - -linux-proc.o: linux-proc.c $(defs_h) - -thread-db.o: thread-db.c $(defs_h) $(gdb_assert_h) gdb_proc_service.h \ - gdb_thread_db.h $(bfd_h) $(gdbthread_h) $(inferior_h) $(symfile_h) \ - $(objfiles_h) $(target_h) $(regcache_h) - -lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_wait_h) $(gdbthread_h) \ - $(inferior_h) $(target_h) $(gdbcmd_h) $(regcache_h) - -proc-service.o: proc-service.c $(defs_h) $(inferior_h) gdb_proc_service.h \ - $(symtab_h) $(target_h) gregset.h - -remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) $(remote_utils_h) \ - $(version_h) $(regcache_h) - -remote-rdi.o: remote-rdi.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(gdb_string_h) $(completer_h) $(arm_tdep_h) - -rdi-share/libangsd.a: force - @dir=rdi-share; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ - else \ - true; \ - fi - -remote-rdp.o: remote-rdp.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(gdb_string_h) $(arm_tdep_h) $(callback_h) - -remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(serial_h) $(gdb_string_h) $(regcache_h) - -remote-es.o: remote-es.c $(bfd_h) $(command_h) $(defs_h) \ - $(inferior_h) $(remote_utils_h) $(terminal_h) $(gdb_string_h) \ - $(symfile_h) $(regcache_h) $(value_h) - -remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(serial_h) $(target_h) $(terminal_h) $(regcache_h) - -remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(serial_h) $(target_h) $(terminal_h) $(regcache_h) - -remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \ - $(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \ - $(regcache_h) - -remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \ - $(defs_h) $(gdbcore_h) $(inferior_h) \ - nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \ - $(symfile_h) $(regcache_h) - -# OBSOLETE remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \ -# OBSOLETE $(command_h) $(monitor_h) $(remote_utils_h) $(symtab_h) $(symfile_h) \ -# OBSOLETE $(objfiles_h) $(gdb_stabs_h) $(gdb_string_h) $(regcache_h) - -remote-sds.o: remote-sds.c $(bfd_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) \ - $(gdb_string_h) $(regcache_h) - -remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) $(gdb_string_h) \ - $(terminal_h) $(target_h) $(gdbcore_h) $(callback_h) \ - $(remote_sim_h) $(remote_utils_h) $(command_h) $(regcache_h) \ - $(sim_regno_h) - -remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(serial_h) \ - $(target_h) $(gdb_string_h) $(regcache_h) - -remote-vx.o: remote-vx.c $(complaints_h) $(defs_h) $(gdbcmd_h) \ - $(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \ - vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ - vx-share/xdr_rdb.h $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(bfd_h) \ - $(gdb_string_h) $(regcache_h) - -remote-vx29k.o: remote-vx29k.c $(complaints_h) $(defs_h) $(gdbcmd_h) \ - $(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \ - vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ - vx-share/xdr_rdb.h $(gdb_string_h) $(regcache_h) - -ocd.o: ocd.c ocd.h $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ - $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ - $(gdb_stabs_h) $(dcache_h) $(serial_h) $(regcache_h) - -remote-utils.o: remote-utils.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(remote_utils_h) $(gdb_string_h) $(regcache_h) - -remote.o: remote.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) \ - $(gdb_string_h) $(event_loop_h) $(event_top_h) $(remote_h) \ - $(inf_loop_h) $(value_h) - -remote-nrom.o: remote-nrom.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) - -rom68k-rom.o: rom68k-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \ - $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \ - $(regcache_h) $(value_h) - -rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \ - $(gdbcore_h) $(xcoffsolib_h) $(symfile_h) $(objfiles_h) \ - $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \ - $(ppc_tdep_h) - -rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(target_h) $(ppc_tdep_h) $(regcache_h) $(value_h) $(parser_defs_h) - -s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \ - $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ - $(objfiles_h) $(bfd_h) $(floatformat_h) $(regcache_h) $(value_h) - -s390-nat.o: s390-nat.c $(defs_h) $(regcache_h) - -scm-exp.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) \ - scm-lang.h scm-tags.h - -scm-lang.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) \ - scm-lang.h scm-tags.h $(gdb_string_h) $(gdbcore_h) - -scm-valprint.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) \ - scm-lang.h $(valprint_h) $(gdbcore_h) - -ser-go32.o: ser-go32.c $(defs_h) $(serial_h) - -ser-pipe.o: ser-pipe.c $(defs_h) $(serial_h) $(gdb_string_h) $(ser_unix_h) - -ser-tcp.o: ser-tcp.c $(defs_h) $(serial_h) $(gdb_string_h) $(ser_unix_h) - -ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h) - -serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h) - -sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \ - $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) \ - $(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \ - $(regcache_h) $(doublest_h) $(sh_tdep_h) $(elf_bfd_h) $(solib_svr4_h) \ - $(elf_sh_h) $(gdb_sim_sh_h) - -shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ - $(value_h) $(sh_tdep_h) solib-svr4.h shnbsd-tdep.h nbsd-tdep.h - -shnbsd-nat.o: shnbsd-nat.c $(defs_h) $(inferior_h) shnbsd-tdep.h - -sh3-rom.o: sh3-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(arch_utils_h) \ - $(regcache_h) $(sh_tdep_h) - -signals.o: signals/signals.c $(defs_h) $(target_h) - $(CC) -c $(INTERNAL_CFLAGS) $< - -mon960-rom.o: mon960-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(serial_h) $(srec_h) $(xmodem_h) $(symtab_h) $(symfile_h) \ - $(inferior_h) - -solib.o: solib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(objfiles_h) $(gdb_regex_h) $(symfile_h) $(target_h) $(gdb_string_h) \ - $(solist_h) $(completer_h) - -solib-irix.o: solib-irix.c $(defs_h) $(gdbcore_h) $(inferior_h) $(objfiles_h) \ - $(symfile_h) $(target_h) $(solist_h) solib-svr4.h - -solib-sunos.o: solib-sunos.c $(defs_h) $(symfile_h) $(objfiles_h) \ - $(gdbcore_h) $(inferior_h) $(solist_h) - -solib-svr4.o: solib-svr4.c $(defs_h) $(gdbcore_h) $(inferior_h) $(objfiles_h) \ - $(symfile_h) $(target_h) $(solist_h) solib-svr4.h - -solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) solib-svr4.h - -source.o: source.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ - $(gdbcore_h) $(language_h) $(objfiles_h) $(gdb_regex_h) $(symfile_h) \ - $(symtab_h) $(gdb_string_h) $(source_h) $(completer_h) $(linespec_h) \ - $(ui_out_h) $(value_h) - -sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) - -sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(target_h) $(regcache_h) - -sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \ - $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(regcache_h) \ - $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h) - -sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(target_h) $(regcache_h) - -sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - sparcnbsd-tdep.h - -sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - sparcnbsd-tdep.h - -sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ - $(target_h) $(value_h) osabi.h sparcnbsd-tdep.h nbsd-tdep.h \ - solib-svr4.h - -xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \ - $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h) - -dsrec.o: dsrec.c $(defs_h) srec.h - -stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \ - $(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \ - $(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \ - $(buildsym_h) $(complaints_h) $(demangle_h) $(language_h) \ - $(doublest_h) $(stabsread_h) - -stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ - $(language_h) $(target_h) $(gdb_string_h) $(ui_out_h) - -ui-file.o: ui-file.c $(defs_h) ui-file.h -tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h \ - $(srcdir)/tui/tuiIO.h - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c - -ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) - -ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ - $(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h - -sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) - -symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ - $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ - $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ - $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ - $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) - -symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) - -symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) - -symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ - $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ - $(gdb_obstack_h) $(language_h) $(bcache_h) $(gdb_string_h) - -symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ - $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ - $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ - $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ - $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ - $(cp_abi_h) - -linespec.o: linespec.c $(linespec_h) $(defs_h) $(frame_h) $(value_h) \ - $(objfiles_h) $(symfile_h) $(completer_h) $(symtab_h) \ - $(demangle_h) $(command_h) $(cp_abi_h) - -macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \ - $(macroexp_h) $(gdb_assert_h) - -macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) $(symtab_h) \ - $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) $(bcache_h) \ - $(complaints_h) - -macroscope.o: macroscope.c $(defs_h) $(macroscope_h) - -macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) \ - $(macroscope_h) $(command_h) $(gdbcmd_h) - -target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \ - $(objfiles_h) $(symfile_h) $(target_h) $(gdb_string_h) $(regcache_h) - -thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \ - $(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \ - $(gdbcmd_h) $(regcache_h) $(gdb_h) $(ui_out_h) - -completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \ - $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) \ - $(cli_decode_h) - -top.o: top.c $(top_h) $(bfd_h) $(getopt_h) $(readline_headers) $(call_cmds_h) \ - $(cli_cmds_h) $(cli_script_h) $(cli_setshow_h) \ - $(defs_h) $(gdbcmd_h) $(inferior_h) $(language_h) \ - $(remote_utils_h) $(gdb_string_h) $(event_loop_h) $(event_top_h) \ - $(completer_h) $(version_h) $(ui_out_h) $(doublest_h) \ - $(serial_h) $(interps_h) - -typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ - $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ - $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) - -utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \ - $(language_h) $(target_h) $(terminal_h) $(readline_headers) \ - $(gdb_string_h) $(event_loop_h) $(event_top_h) $(inferior_h) - -valarith.o: valarith.c $(bfd_h) $(defs_h) $(expression_h) \ - $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) $(value_h) \ - $(gdb_string_h) $(doublest_h) - -valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \ - $(gdb_string_h) $(regcache_h) $(cp_abi_h) $(gdb_assert_h) - -valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ - $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(obstack_h) \ - $(language_h) $(annotate_h) $(valprint_h) $(floatformat_h) \ - $(doublest_h) - -values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ - $(gdbcore_h) $(gdbtypes_h) $(symtab_h) $(target_h) $(value_h) \ - $(gdb_string_h) scm-lang.h $(doublest_h) $(regcache_h) - -vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) \ - $(arch_utils_h) $(inferior_h) $(vax_tdep_h) - -x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \ - $(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h) - -x86-64-tdep.o : x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) x86-64-tdep.h \ - i386-tdep.h $(dwarf2cfi_h) $(gdb_assert_h) $(objfiles_h) - -x86-64-linux-nat.o : x86-64-linux-nat.c $(defs_h) $(inferior_h) \ - $(gdbcore_h) $(regcache_h) $(gdb_assert_h) x86-64-tdep.h \ - i386-tdep.h - -win32-nat.o: win32-nat.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \ - $(gdb_string_h) $(regcache_h) $(completer_h) - -xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \ - vx-share/vxWorks.h vx-share/xdr_ld.h - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c - -xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \ - vx-share/vxWorks.h vx-share/xdr_ptrace.h - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c +xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/xdr_ptrace.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \ vx-share/vxWorks.h vx-share/xdr_rdb.h $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_rdb.c -xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \ - $(INCLUDE_DIR)/aout/stab_gnu.h $(INCLUDE_DIR)/coff/internal.h \ - $(INCLUDE_DIR)/coff/rs6000.h $(BFD_SRC)/libcoff.h $(buildsym_h) \ - $(complaints_h) $(defs_h) $(gdbtypes_h) $(objfiles_h) $(stabsread_h) \ - $(symfile_h) $(symtab_h) $(gdb_string_h) - -xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) $(xcoffsolib_h) $(inferior_h) \ - $(gdbcmd_h) $(symfile_h) $(frame_h) $(gdb_regex_h) - -# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't -# declared -Wimplicit fails. It should be using the GDBARCH framework. -# cagney 1999-09-02. -z8k-tdep.o: z8k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcmd_h) \ - $(gdbtypes_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ - $(srcdir)/z8k-tdep.c - -c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ - $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ - $(symfile_h) $(objfiles_h) - -jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ - $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) - -f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ - $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ - $(symfile_h) - -m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) - -p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) - -gdb-events.o: gdb-events.c $(gdb_events_h) $(defs_h) $(gdbcmd_h) - -ui-out.o: ui-out.c $(defs_h) $(ui_out_h) $(expression_h) $(language_h) -cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(interps_h) -interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ - $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) $(gdb_events_h) -varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \ - $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h) - -wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) $(wrapper_h) - -# -# CLI dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the cli directory. - -cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \ - $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \ - $(ui_out_h) $(top_h) $(cli_cli_decode_h) $(cli_cli_script_h) \ - $(cli_cli_setshow_h) $(cli_cli_cmds_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c - -cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) $(gdb_regex_h) \ - $(gdb_string_h) $(ui_out_h) $(cli_cli_cmds_h) \ - $(cli_cli_decode_h) $(gdb_assert_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c - -cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) $(command_h) \ - $(value_h) $(gdbcmd_h) $(completer_h) $(cli_dump_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c - -cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(value_h) \ - $(wrapper_h) $(event_top_h) $(ui_out_h) $(cli_out_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c - -cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(value_h) \ - $(gdb_string_h) $(ui_out_h) $(cli_cli_decode_h) \ - $(cli_cli_cmds_h) $(cli_cli_setshow_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c - -cli-script.o: $(srcdir)/cli//cli-script.c $(defs_h) $(value_h) $(language_h) \ - $(ui_out_h) $(top_h) $(cli_cli_cmds_h) $(cli_cli_decode_h) \ - $(cli_cli_script_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c - -cli-utils.o: $(srcdir)/cli/cli-utils.c $(cli_utils_h) $(defs_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c - -# -# MI dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the mi directory. - -mi_h = $(srcdir)/mi/mi.h -mi_cmds_h = $(srcdir)/mi/mi-cmds.h -mi_out_h = $(srcdir)/mi/mi-out.h -mi_parse_h = $(srcdir)/mi/mi-parse.h -mi_getopt_h = $(srcdir)/mi/mi-getopt.h -mi_console_h = $(srcdir)/mi/mi-console.h - -mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c -mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ - $(mi_out_h) $(varobj_h) $(value_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c -mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(top_h) $(mi_cmds_h) \ - $(ui_out_h) $(frame_h) $(value_h) $(target_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c -mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ - $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \ - $(gdb_events_h) $(mi_getopt_h) $(gdb_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c -mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ - $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c -mi-events.o: $(srcdir)/mi/mi-events.c $(defs_h) $(ui_out_h) $(interps_h) \ - $(gdb_h) $(breakpoint_h) $(mi_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-events.c -mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(interps_h) \ - $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) \ - $(top_h) $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c -mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \ - $(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \ - $(mi_getopt_h) $(regcache_h) $(gdb_h) $(target_h) \ - $(inferior_h) $(gdb_string_h) $(gdbthread_h) $(mi_out_h) \ - $(gdbcore_h) $(value_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c -mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c -mi-console.o: $(srcdir)/mi/mi-console.c $(mi_out_h) $(defs_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c -mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_parse_h) $(mi_cmds_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c -mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c - -# -# TUI dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the mi directory. - -tui.o: $(srcdir)/tui/tui.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiIO.h \ - $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui.c -tui-out.o: $(srcdir)/tui/tui-out.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-out.c -tui-hooks.o: $(srcdir)/tui/tui-hooks.c \ - $(srcdir)/tui/tui.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-hooks.c -tuiCommand.o: $(srcdir)/tui/tuiCommand.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiWin.h $(srcdir)/tui/tuiIO.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiCommand.c -tuiData.o: $(srcdir)/tui/tuiData.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiData.c -tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiRegs.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDataWin.c -tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiSourceWin.h \ - $(srcdir)/tui/tuiStack.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDisassem.c -tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiGeneralWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c -tuiIO.o: $(srcdir)/tui/tuiIO.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiIO.h $(srcdir)/tui/tuiCommand.h \ - $(srcdir)/tui/tuiWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiIO.c -tuiLayout.o: $(srcdir)/tui/tuiLayout.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \ - $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiDisassem.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiLayout.c -tuiRegs.o: $(srcdir)/tui/tuiRegs.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiRegs.c -tuiSource.o: $(srcdir)/tui/tuiSource.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \ - $(srcdir)/tui/tuiSource.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSource.c -tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \ - $(srcdir)/tui/tuiSource.h $(srcdir)/tui/tuiDisassem.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSourceWin.c -tuiStack.o: $(srcdir)/tui/tuiStack.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiStack.c -tuiWin.o: $(srcdir)/tui/tuiWin.c \ - $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ - $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \ - $(srcdir)/tui/tuiSourceWin.h $(srcdir)/tui/tuiDataWin.h - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiWin.c - ### end of the gdb Makefile.in. diff --git a/gdb/NEWS b/gdb/NEWS index fdfd0339ef3..8b09cf60b7f 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -57,9 +57,17 @@ permanently REMOVED. Mitsubishi D30V d30v-*-* OS/9000 i[34]86-*-os9k +IBM AIX PS/2 i[3456]86-*-aix Fujitsu FR30 fr30-*-elf* Motorola Delta 88000 running Sys V m88k-motorola-sysv or delta88 Argonaut Risc Chip (ARC) arc-*-* +i386 running Mach 3.0 i[3456]86-*-mach3* +i386 running Mach i[3456]86-*-mach* +i386 running OSF/1 i[3456]86-*osf1mk* +HP/Apollo 68k Family m68*-apollo*-sysv*, + m68*-apollo*-bsd*, + m68*-hp-bsd*, m68*-hp-hpux* +I960 with MON960 i960-*-coff * OBSOLETE languages @@ -90,6 +98,12 @@ These commands allow data to be copied from target memory to a bfd-format or binary file (dump and append), and back from a file into memory (restore). +* Improved "next/step" support on multi-processor Alpha Tru64. + +The previous single-step mechanism could cause unpredictable problems, +including the random appearance of SIGSEGV or SIGTRAP signals. The use +of a software single-step mechanism prevents this. + *** Changes in GDB 5.2.1: * New targets. diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS index 49d27967daa..4c460d6eb80 100644 --- a/gdb/PROBLEMS +++ b/gdb/PROBLEMS @@ -1,9 +1,29 @@ - Known problems in GDB 5.2 + Known problems in GDB 5.3 See also: http://www.gnu.org/software/gdb/bugs/ +*-*-freebsd* +--------------- + +Due to a kernel bug (kern/35175), detaching from an attached process +will very likely cause the process to be stop or die with a Trace/BPT +trap. + + +i386-*-freebsd[34]* +------------------- + +There is a bug (bin/41671) in FreeBSD's gcc that causes it to emit bad +debug information when using the stabs format (which is the default). +As a result GDB tends to place breakpoints on functions before the +function prologue, and information about function parameters and local +variables is lost. In earlier versions of GDB the effects were rather +limited, but starting with GDB 5.3 the influence is much more +prominent. As a workaround, compile your code with -gdwarf-2. + + hppa2.0-hp-hpux10.20 -------------------- diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3fd30752ad5..c58d46338ea 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include "gdb_string.h" #include #include #include "demangle.h" @@ -40,153 +40,165 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ui-out.h" #endif -struct cleanup* unresolved_names; +struct cleanup *unresolved_names; void extract_string (CORE_ADDR addr, char *buf); -static struct type * ada_create_fundamental_type (struct objfile *, int); +static struct type *ada_create_fundamental_type (struct objfile *, int); static void modify_general_field (char *, LONGEST, int, int); -static struct type* desc_base_type (struct type*); +static struct type *desc_base_type (struct type *); -static struct type* desc_bounds_type (struct type*); +static struct type *desc_bounds_type (struct type *); -static struct value* desc_bounds (struct value*); +static struct value *desc_bounds (struct value *); -static int fat_pntr_bounds_bitpos (struct type*); +static int fat_pntr_bounds_bitpos (struct type *); -static int fat_pntr_bounds_bitsize (struct type*); +static int fat_pntr_bounds_bitsize (struct type *); -static struct type* desc_data_type (struct type*); +static struct type *desc_data_type (struct type *); -static struct value* desc_data (struct value*); +static struct value *desc_data (struct value *); -static int fat_pntr_data_bitpos (struct type*); +static int fat_pntr_data_bitpos (struct type *); -static int fat_pntr_data_bitsize (struct type*); +static int fat_pntr_data_bitsize (struct type *); -static struct value* desc_one_bound (struct value*, int, int); +static struct value *desc_one_bound (struct value *, int, int); -static int desc_bound_bitpos (struct type*, int, int); +static int desc_bound_bitpos (struct type *, int, int); -static int desc_bound_bitsize (struct type*, int, int); +static int desc_bound_bitsize (struct type *, int, int); -static struct type* desc_index_type (struct type*, int); +static struct type *desc_index_type (struct type *, int); -static int desc_arity (struct type*); +static int desc_arity (struct type *); -static int ada_type_match (struct type*, struct type*, int); +static int ada_type_match (struct type *, struct type *, int); -static int ada_args_match (struct symbol*, struct value**, int); +static int ada_args_match (struct symbol *, struct value **, int); -static struct value* place_on_stack (struct value*, CORE_ADDR*); +static struct value *place_on_stack (struct value *, CORE_ADDR *); -static struct value* convert_actual (struct value*, struct type*, CORE_ADDR*); +static struct value *convert_actual (struct value *, struct type *, + CORE_ADDR *); -static struct value* make_array_descriptor (struct type*, struct value*, CORE_ADDR*); +static struct value *make_array_descriptor (struct type *, struct value *, + CORE_ADDR *); -static void ada_add_block_symbols (struct block*, const char*, - namespace_enum, struct objfile*, int); +static void ada_add_block_symbols (struct block *, const char *, + namespace_enum, struct objfile *, int); -static void fill_in_ada_prototype (struct symbol*); +static void fill_in_ada_prototype (struct symbol *); -static int is_nonfunction (struct symbol**, int); +static int is_nonfunction (struct symbol **, int); -static void add_defn_to_vec (struct symbol*, struct block*); +static void add_defn_to_vec (struct symbol *, struct block *); -static struct partial_symbol* -ada_lookup_partial_symbol (struct partial_symtab*, const char*, - int, namespace_enum, int); +static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab + *, const char *, int, + namespace_enum, int); -static struct symtab* symtab_for_sym (struct symbol*); +static struct symtab *symtab_for_sym (struct symbol *); -static struct value* ada_resolve_subexp (struct expression**, int*, int, struct type*); +static struct value *ada_resolve_subexp (struct expression **, int *, int, + struct type *); -static void replace_operator_with_call (struct expression**, int, int, int, - struct symbol*, struct block*); +static void replace_operator_with_call (struct expression **, int, int, int, + struct symbol *, struct block *); -static int possible_user_operator_p (enum exp_opcode, struct value**); +static int possible_user_operator_p (enum exp_opcode, struct value **); -static const char* ada_op_name (enum exp_opcode); +static const char *ada_op_name (enum exp_opcode); -static int numeric_type_p (struct type*); +static int numeric_type_p (struct type *); -static int integer_type_p (struct type*); +static int integer_type_p (struct type *); -static int scalar_type_p (struct type*); +static int scalar_type_p (struct type *); -static int discrete_type_p (struct type*); +static int discrete_type_p (struct type *); -static char* extended_canonical_line_spec (struct symtab_and_line, const char*); +static char *extended_canonical_line_spec (struct symtab_and_line, + const char *); -static struct value* evaluate_subexp (struct type*, struct expression*, int*, enum noside); +static struct value *evaluate_subexp (struct type *, struct expression *, + int *, enum noside); -static struct value* evaluate_subexp_type (struct expression*, int*); +static struct value *evaluate_subexp_type (struct expression *, int *); -static struct type * ada_create_fundamental_type (struct objfile*, int); +static struct type *ada_create_fundamental_type (struct objfile *, int); -static int is_dynamic_field (struct type *, int); +static int is_dynamic_field (struct type *, int); -static struct type* -to_fixed_variant_branch_type (struct type*, char*, CORE_ADDR, struct value*); +static struct type *to_fixed_variant_branch_type (struct type *, char *, + CORE_ADDR, struct value *); -static struct type* to_fixed_range_type (char*, struct value*, struct objfile*); +static struct type *to_fixed_range_type (char *, struct value *, + struct objfile *); -static struct type* to_static_fixed_type (struct type*); +static struct type *to_static_fixed_type (struct type *); -static struct value* unwrap_value (struct value*); +static struct value *unwrap_value (struct value *); -static struct type* packed_array_type (struct type*, long*); +static struct type *packed_array_type (struct type *, long *); -static struct type* decode_packed_array_type (struct type*); +static struct type *decode_packed_array_type (struct type *); -static struct value* decode_packed_array (struct value*); +static struct value *decode_packed_array (struct value *); -static struct value* value_subscript_packed (struct value*, int, struct value**); +static struct value *value_subscript_packed (struct value *, int, + struct value **); -static struct value* coerce_unspec_val_to_type (struct value*, long, struct type*); +static struct value *coerce_unspec_val_to_type (struct value *, long, + struct type *); -static struct value* get_var_value (char*, char*); +static struct value *get_var_value (char *, char *); -static int lesseq_defined_than (struct symbol*, struct symbol*); +static int lesseq_defined_than (struct symbol *, struct symbol *); -static int equiv_types (struct type*, struct type*); +static int equiv_types (struct type *, struct type *); -static int is_name_suffix (const char*); +static int is_name_suffix (const char *); -static int wild_match (const char*, int, const char*); +static int wild_match (const char *, int, const char *); -static struct symtabs_and_lines find_sal_from_funcs_and_line (const char*, int, struct symbol**, int); +static struct symtabs_and_lines find_sal_from_funcs_and_line (const char *, + int, + struct symbol + **, int); -static int -find_line_in_linetable (struct linetable*, int, struct symbol**, int, int*); +static int find_line_in_linetable (struct linetable *, int, struct symbol **, + int, int *); -static int find_next_line_in_linetable (struct linetable*, int, int, int); +static int find_next_line_in_linetable (struct linetable *, int, int, int); -static struct symtabs_and_lines all_sals_for_line (const char*, int, char***); +static struct symtabs_and_lines all_sals_for_line (const char *, int, + char ***); -static void read_all_symtabs (const char*); +static void read_all_symtabs (const char *); -static int is_plausible_func_for_line (struct symbol*, int); +static int is_plausible_func_for_line (struct symbol *, int); -static struct value* ada_coerce_ref (struct value*); +static struct value *ada_coerce_ref (struct value *); -static struct value* value_pos_atr (struct value*); +static struct value *value_pos_atr (struct value *); -static struct value* value_val_atr (struct type*, struct value*); +static struct value *value_val_atr (struct type *, struct value *); -static struct symbol* standard_lookup (const char*, namespace_enum); +static struct symbol *standard_lookup (const char *, namespace_enum); extern void markTimeStart (int index); extern void markTimeStop (int index); - + /* Maximum-sized dynamic type. */ static unsigned int varsize_limit; -static const char* ada_completer_word_break_characters = +static const char *ada_completer_word_break_characters = " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-"; /* The name of the symbol to use to get the name of the main subprogram */ @@ -202,18 +214,17 @@ static const char* ada_completer_word_break_characters = void extract_string (CORE_ADDR addr, char *buf) { - int char_index = 0; + int char_index = 0; - /* Loop, reading one byte at a time, until we reach the '\000' - end-of-string marker */ - do - { - target_read_memory (addr + char_index * sizeof (char), - buf + char_index * sizeof (char), - sizeof (char)); - char_index++; - } - while (buf[char_index - 1] != '\000'); + /* Loop, reading one byte at a time, until we reach the '\000' + end-of-string marker */ + do + { + target_read_memory (addr + char_index * sizeof (char), + buf + char_index * sizeof (char), sizeof (char)); + char_index++; + } + while (buf[char_index - 1] != '\000'); } /* Assuming *OLD_VECT points to an array of *SIZE objects of size @@ -221,14 +232,15 @@ extract_string (CORE_ADDR addr, char *buf) updating *OLD_VECT and *SIZE as necessary. */ void -grow_vect (void** old_vect, size_t* size, size_t min_size, int element_size) +grow_vect (void **old_vect, size_t * size, size_t min_size, int element_size) { - if (*size < min_size) { - *size *= 2; - if (*size < min_size) - *size = min_size; - *old_vect = xrealloc (*old_vect, *size * element_size); - } + if (*size < min_size) + { + *size *= 2; + if (*size < min_size) + *size = min_size; + *old_vect = xrealloc (*old_vect, *size * element_size); + } } /* True (non-zero) iff TARGET matches FIELD_NAME up to any trailing @@ -238,24 +250,24 @@ static int field_name_match (const char *field_name, const char *target) { int len = strlen (target); - return - STREQN (field_name, target, len) - && (field_name[len] == '\0' + return + STREQN (field_name, target, len) + && (field_name[len] == '\0' || (STREQN (field_name + len, "___", 3) - && ! STREQ (field_name + strlen (field_name) - 6, "___XVN"))); + && !STREQ (field_name + strlen (field_name) - 6, "___XVN"))); } /* The length of the prefix of NAME prior to any "___" suffix. */ int -ada_name_prefix_len (const char* name) +ada_name_prefix_len (const char *name) { if (name == NULL) return 0; - else + else { - const char* p = strstr (name, "___"); + const char *p = strstr (name, "___"); if (p == NULL) return strlen (name); else @@ -265,7 +277,7 @@ ada_name_prefix_len (const char* name) /* SUFFIX is a suffix of STR. False if STR is null. */ static int -is_suffix (const char* str, const char* suffix) +is_suffix (const char *str, const char *suffix) { int len1, len2; if (str == NULL) @@ -278,11 +290,12 @@ is_suffix (const char* str, const char* suffix) /* Create a value of type TYPE whose contents come from VALADDR, if it * is non-null, and whose memory address (in the inferior) is * ADDRESS. */ -struct value* -value_from_contents_and_address (struct type* type, char* valaddr, CORE_ADDR address) +struct value * +value_from_contents_and_address (struct type *type, char *valaddr, + CORE_ADDR address) { - struct value* v = allocate_value (type); - if (valaddr == NULL) + struct value *v = allocate_value (type); + if (valaddr == NULL) VALUE_LAZY (v) = 1; else memcpy (VALUE_CONTENTS_RAW (v), valaddr, TYPE_LENGTH (type)); @@ -295,24 +308,25 @@ value_from_contents_and_address (struct type* type, char* valaddr, CORE_ADDR add /* The contents of value VAL, beginning at offset OFFSET, treated as a value of type TYPE. The result is an lval in memory if VAL is. */ -static struct value* -coerce_unspec_val_to_type (struct value* val, long offset, struct type *type) +static struct value * +coerce_unspec_val_to_type (struct value *val, long offset, struct type *type) { CHECK_TYPEDEF (type); if (VALUE_LVAL (val) == lval_memory) return value_at_lazy (type, - VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset, NULL); - else + VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset, + NULL); + else { - struct value* result = allocate_value (type); + struct value *result = allocate_value (type); VALUE_LVAL (result) = not_lval; - if (VALUE_ADDRESS (val) == 0) + if (VALUE_ADDRESS (val) == 0) memcpy (VALUE_CONTENTS_RAW (result), VALUE_CONTENTS (val) + offset, - TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val)) + TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val)) ? TYPE_LENGTH (VALUE_TYPE (val)) : TYPE_LENGTH (type)); - else + else { - VALUE_ADDRESS (result) = + VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset; VALUE_LAZY (result) = 1; } @@ -320,8 +334,8 @@ coerce_unspec_val_to_type (struct value* val, long offset, struct type *type) } } -static char* -cond_offset_host (char* valaddr, long offset) +static char * +cond_offset_host (char *valaddr, long offset) { if (valaddr == NULL) return NULL; @@ -334,29 +348,29 @@ cond_offset_target (CORE_ADDR address, long offset) { if (address == 0) return 0; - else + else return address + offset; } /* Perform execute_command on the result of concatenating all arguments up to NULL. */ static void -do_command (const char* arg, ...) +do_command (const char *arg, ...) { int len; - char* cmd; - const char* s; + char *cmd; + const char *s; va_list ap; va_start (ap, arg); len = 0; s = arg; cmd = ""; - for (; s != NULL; s = va_arg (ap, const char*)) + for (; s != NULL; s = va_arg (ap, const char *)) { - char* cmd1; + char *cmd1; len += strlen (s); - cmd1 = alloca (len+1); + cmd1 = alloca (len + 1); strcpy (cmd1, cmd); strcat (cmd1, s); cmd = cmd1; @@ -364,62 +378,62 @@ do_command (const char* arg, ...) va_end (ap); execute_command (cmd, 0); } - + /* Language Selection */ /* If the main program is in Ada, return language_ada, otherwise return LANG (the main program is in Ada iif the adainit symbol is found). MAIN_PST is not used. */ - + enum language -ada_update_initial_language (enum language lang, struct partial_symtab* main_pst) +ada_update_initial_language (enum language lang, + struct partial_symtab *main_pst) { - if (lookup_minimal_symbol ("adainit", (const char*) NULL, - (struct objfile*) NULL) != NULL) + if (lookup_minimal_symbol ("adainit", (const char *) NULL, + (struct objfile *) NULL) != NULL) /* return language_ada; */ /* FIXME: language_ada should be defined in defs.h */ return language_unknown; return lang; } - + /* Symbols */ /* Table of Ada operators and their GNAT-mangled names. Last entry is pair of NULLs. */ -const struct ada_opname_map ada_opname_table[] = -{ - { "Oadd", "\"+\"", BINOP_ADD }, - { "Osubtract", "\"-\"", BINOP_SUB }, - { "Omultiply", "\"*\"", BINOP_MUL }, - { "Odivide", "\"/\"", BINOP_DIV }, - { "Omod", "\"mod\"", BINOP_MOD }, - { "Orem", "\"rem\"", BINOP_REM }, - { "Oexpon", "\"**\"", BINOP_EXP }, - { "Olt", "\"<\"", BINOP_LESS }, - { "Ole", "\"<=\"", BINOP_LEQ }, - { "Ogt", "\">\"", BINOP_GTR }, - { "Oge", "\">=\"", BINOP_GEQ }, - { "Oeq", "\"=\"", BINOP_EQUAL }, - { "One", "\"/=\"", BINOP_NOTEQUAL }, - { "Oand", "\"and\"", BINOP_BITWISE_AND }, - { "Oor", "\"or\"", BINOP_BITWISE_IOR }, - { "Oxor", "\"xor\"", BINOP_BITWISE_XOR }, - { "Oconcat", "\"&\"", BINOP_CONCAT }, - { "Oabs", "\"abs\"", UNOP_ABS }, - { "Onot", "\"not\"", UNOP_LOGICAL_NOT }, - { "Oadd", "\"+\"", UNOP_PLUS }, - { "Osubtract", "\"-\"", UNOP_NEG }, - { NULL, NULL } +const struct ada_opname_map ada_opname_table[] = { + {"Oadd", "\"+\"", BINOP_ADD}, + {"Osubtract", "\"-\"", BINOP_SUB}, + {"Omultiply", "\"*\"", BINOP_MUL}, + {"Odivide", "\"/\"", BINOP_DIV}, + {"Omod", "\"mod\"", BINOP_MOD}, + {"Orem", "\"rem\"", BINOP_REM}, + {"Oexpon", "\"**\"", BINOP_EXP}, + {"Olt", "\"<\"", BINOP_LESS}, + {"Ole", "\"<=\"", BINOP_LEQ}, + {"Ogt", "\">\"", BINOP_GTR}, + {"Oge", "\">=\"", BINOP_GEQ}, + {"Oeq", "\"=\"", BINOP_EQUAL}, + {"One", "\"/=\"", BINOP_NOTEQUAL}, + {"Oand", "\"and\"", BINOP_BITWISE_AND}, + {"Oor", "\"or\"", BINOP_BITWISE_IOR}, + {"Oxor", "\"xor\"", BINOP_BITWISE_XOR}, + {"Oconcat", "\"&\"", BINOP_CONCAT}, + {"Oabs", "\"abs\"", UNOP_ABS}, + {"Onot", "\"not\"", UNOP_LOGICAL_NOT}, + {"Oadd", "\"+\"", UNOP_PLUS}, + {"Osubtract", "\"-\"", UNOP_NEG}, + {NULL, NULL} }; /* True if STR should be suppressed in info listings. */ static int -is_suppressed_name (const char* str) +is_suppressed_name (const char *str) { if (STREQN (str, "_ada_", 5)) str += 5; @@ -427,13 +441,13 @@ is_suppressed_name (const char* str) return 1; else { - const char* p; - const char* suffix = strstr (str, "___"); + const char *p; + const char *suffix = strstr (str, "___"); if (suffix != NULL && suffix[3] != 'X') return 1; if (suffix == NULL) suffix = str + strlen (str); - for (p = suffix-1; p != str; p -= 1) + for (p = suffix - 1; p != str; p -= 1) if (isupper (*p)) { int i; @@ -442,11 +456,11 @@ is_suppressed_name (const char* str) if (*p != 'O') return 1; for (i = 0; ada_opname_table[i].mangled != NULL; i += 1) - if (STREQN (ada_opname_table[i].mangled, p, + if (STREQN (ada_opname_table[i].mangled, p, strlen (ada_opname_table[i].mangled))) goto OK; return 1; - OK: ; + OK:; } return 0; } @@ -455,42 +469,43 @@ is_suppressed_name (const char* str) /* The "mangled" form of DEMANGLED, according to GNAT conventions. * The result is valid until the next call to ada_mangle. */ char * -ada_mangle (const char* demangled) +ada_mangle (const char *demangled) { - static char* mangling_buffer = NULL; + static char *mangling_buffer = NULL; static size_t mangling_buffer_size = 0; - const char* p; + const char *p; int k; - + if (demangled == NULL) return NULL; - GROW_VECT (mangling_buffer, mangling_buffer_size, 2*strlen (demangled) + 10); + GROW_VECT (mangling_buffer, mangling_buffer_size, + 2 * strlen (demangled) + 10); k = 0; for (p = demangled; *p != '\0'; p += 1) { - if (*p == '.') + if (*p == '.') { - mangling_buffer[k] = mangling_buffer[k+1] = '_'; + mangling_buffer[k] = mangling_buffer[k + 1] = '_'; k += 2; } else if (*p == '"') { - const struct ada_opname_map* mapping; + const struct ada_opname_map *mapping; for (mapping = ada_opname_table; - mapping->mangled != NULL && - ! STREQN (mapping->demangled, p, strlen (mapping->demangled)); + mapping->mangled != NULL && + !STREQN (mapping->demangled, p, strlen (mapping->demangled)); p += 1) ; if (mapping->mangled == NULL) error ("invalid Ada operator name: %s", p); - strcpy (mangling_buffer+k, mapping->mangled); + strcpy (mangling_buffer + k, mapping->mangled); k += strlen (mapping->mangled); break; } - else + else { mangling_buffer[k] = *p; k += 1; @@ -504,19 +519,19 @@ ada_mangle (const char* demangled) /* Return NAME folded to lower case, or, if surrounded by single * quotes, unfolded, but with the quotes stripped away. Result good * to next call. */ -char* -ada_fold_name (const char* name) +char * +ada_fold_name (const char *name) { - static char* fold_buffer = NULL; + static char *fold_buffer = NULL; static size_t fold_buffer_size = 0; int len = strlen (name); - GROW_VECT (fold_buffer, fold_buffer_size, len+1); + GROW_VECT (fold_buffer, fold_buffer_size, len + 1); if (name[0] == '\'') { - strncpy (fold_buffer, name+1, len-2); - fold_buffer[len-2] = '\000'; + strncpy (fold_buffer, name + 1, len - 2); + fold_buffer[len - 2] = '\000'; } else { @@ -542,16 +557,16 @@ ada_fold_name (const char* name) */ char * -ada_demangle (const char* mangled) +ada_demangle (const char *mangled) { int i, j; int len0; - const char* p; - char* demangled; + const char *p; + char *demangled; int at_start_name; - static char* demangling_buffer = NULL; + static char *demangling_buffer = NULL; static size_t demangling_buffer_size = 0; - + if (STREQN (mangled, "_ada_", 5)) mangled += 5; @@ -561,7 +576,7 @@ ada_demangle (const char* mangled) p = strstr (mangled, "___"); if (p == NULL) len0 = strlen (mangled); - else + else { if (p[3] == 'X') len0 = p - mangled; @@ -574,19 +589,20 @@ ada_demangle (const char* mangled) len0 -= 1; /* Make demangled big enough for possible expansion by operator name. */ - GROW_VECT (demangling_buffer, demangling_buffer_size, 2*len0+1); + GROW_VECT (demangling_buffer, demangling_buffer_size, 2 * len0 + 1); demangled = demangling_buffer; - if (isdigit (mangled[len0 - 1])) { - for (i = len0-2; i >= 0 && isdigit (mangled[i]); i -= 1) - ; - if (i > 1 && mangled[i] == '_' && mangled[i-1] == '_') - len0 = i - 1; - else if (mangled[i] == '$') - len0 = i; - } + if (isdigit (mangled[len0 - 1])) + { + for (i = len0 - 2; i >= 0 && isdigit (mangled[i]); i -= 1) + ; + if (i > 1 && mangled[i] == '_' && mangled[i - 1] == '_') + len0 = i - 1; + else if (mangled[i] == '$') + len0 = i; + } - for (i = 0, j = 0; i < len0 && ! isalpha (mangled[i]); i += 1, j += 1) + for (i = 0, j = 0; i < len0 && !isalpha (mangled[i]); i += 1, j += 1) demangled[j] = mangled[i]; at_start_name = 1; @@ -597,9 +613,10 @@ ada_demangle (const char* mangled) int k; for (k = 0; ada_opname_table[k].mangled != NULL; k += 1) { - int op_len = strlen (ada_opname_table[k].mangled); - if (STREQN (ada_opname_table[k].mangled+1, mangled+i+1, op_len-1) - && ! isalnum (mangled[i + op_len])) + int op_len = strlen (ada_opname_table[k].mangled); + if (STREQN + (ada_opname_table[k].mangled + 1, mangled + i + 1, + op_len - 1) && !isalnum (mangled[i + op_len])) { strcpy (demangled + j, ada_opname_table[k].demangled); at_start_name = 0; @@ -613,9 +630,9 @@ ada_demangle (const char* mangled) } at_start_name = 0; - if (i < len0-4 && STREQN (mangled+i, "TK__", 4)) + if (i < len0 - 4 && STREQN (mangled + i, "TK__", 4)) i += 2; - if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i-1])) + if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i - 1])) { do i += 1; @@ -623,16 +640,18 @@ ada_demangle (const char* mangled) if (i < len0) goto Suppress; } - else if (i < len0-2 && mangled[i] == '_' && mangled[i+1] == '_') + else if (i < len0 - 2 && mangled[i] == '_' && mangled[i + 1] == '_') { demangled[j] = '.'; at_start_name = 1; - i += 2; j += 1; + i += 2; + j += 1; } else { demangled[j] = mangled[i]; - i += 1; j += 1; + i += 1; + j += 1; } } demangled[j] = '\000'; @@ -644,8 +663,7 @@ ada_demangle (const char* mangled) return demangled; Suppress: - GROW_VECT (demangling_buffer, demangling_buffer_size, - strlen (mangled) + 3); + GROW_VECT (demangling_buffer, demangling_buffer_size, strlen (mangled) + 3); demangled = demangling_buffer; if (mangled[0] == '<') strcpy (demangled, mangled); @@ -663,20 +681,21 @@ Suppress: * either argument is NULL. */ int -ada_match_name (const char* sym_name, const char* name, int wild) +ada_match_name (const char *sym_name, const char *name, int wild) { if (sym_name == NULL || name == NULL) return 0; else if (wild) return wild_match (name, strlen (name), sym_name); - else { - int len_name = strlen (name); - return (STREQN (sym_name, name, len_name) - && is_name_suffix (sym_name+len_name)) - || (STREQN (sym_name, "_ada_", 5) - && STREQN (sym_name+5, name, len_name) - && is_name_suffix (sym_name+len_name+5)); - } + else + { + int len_name = strlen (name); + return (STREQN (sym_name, name, len_name) + && is_name_suffix (sym_name + len_name)) + || (STREQN (sym_name, "_ada_", 5) + && STREQN (sym_name + 5, name, len_name) + && is_name_suffix (sym_name + len_name + 5)); + } } /* True (non-zero) iff in Ada mode, the symbol SYM should be @@ -687,18 +706,18 @@ ada_suppress_symbol_printing (struct symbol *sym) { if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) return 1; - else + else return is_suppressed_name (SYMBOL_NAME (sym)); } - + /* Arrays */ /* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of array descriptors. */ -static char* bound_name[] = { - "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3", +static char *bound_name[] = { + "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3", "LB4", "UB4", "LB5", "UB5", "LB6", "UB6", "LB7", "UB7" }; @@ -711,9 +730,8 @@ static char* bound_name[] = { static void modify_general_field (char *addr, LONGEST fieldval, int bitpos, int bitsize) { - modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)), - fieldval, bitpos % (8 * sizeof (LONGEST)), - bitsize); + modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)), + fieldval, bitpos % (8 * sizeof (LONGEST)), bitsize); } @@ -722,8 +740,8 @@ modify_general_field (char *addr, LONGEST fieldval, int bitpos, int bitsize) /* The descriptor or array type, if any, indicated by TYPE; removes level of indirection, if needed. */ -static struct type* -desc_base_type (struct type* type) +static struct type * +desc_base_type (struct type *type) { if (type == NULL) return NULL; @@ -736,26 +754,25 @@ desc_base_type (struct type* type) /* True iff TYPE indicates a "thin" array pointer type. */ static int -is_thin_pntr (struct type* type) +is_thin_pntr (struct type *type) { - return + return is_suffix (ada_type_name (desc_base_type (type)), "___XUT") || is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE"); } /* The descriptor type for thin pointer type TYPE. */ -static struct type* -thin_descriptor_type (struct type* type) +static struct type * +thin_descriptor_type (struct type *type) { - struct type* base_type = desc_base_type (type); + struct type *base_type = desc_base_type (type); if (base_type == NULL) return NULL; if (is_suffix (ada_type_name (base_type), "___XVE")) return base_type; - else + else { - struct type* alt_type = - ada_find_parallel_type (base_type, "___XVE"); + struct type *alt_type = ada_find_parallel_type (base_type, "___XVE"); if (alt_type == NULL) return base_type; else @@ -764,21 +781,21 @@ thin_descriptor_type (struct type* type) } /* A pointer to the array data for thin-pointer value VAL. */ -static struct value* -thin_data_pntr (struct value* val) +static struct value * +thin_data_pntr (struct value *val) { - struct type* type = VALUE_TYPE (val); + struct type *type = VALUE_TYPE (val); if (TYPE_CODE (type) == TYPE_CODE_PTR) - return value_cast (desc_data_type (thin_descriptor_type (type)), + return value_cast (desc_data_type (thin_descriptor_type (type)), value_copy (val)); - else + else return value_from_longest (desc_data_type (thin_descriptor_type (type)), VALUE_ADDRESS (val) + VALUE_OFFSET (val)); } /* True iff TYPE indicates a "thick" array pointer type. */ static int -is_thick_pntr (struct type* type) +is_thick_pntr (struct type *type) { type = desc_base_type (type); return (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT @@ -787,10 +804,10 @@ is_thick_pntr (struct type* type) /* If TYPE is the type of an array descriptor (fat or thin pointer) or a pointer to one, the type of its bounds data; otherwise, NULL. */ -static struct type* -desc_bounds_type (struct type* type) +static struct type * +desc_bounds_type (struct type *type) { - struct type* r; + struct type *r; type = desc_base_type (type); @@ -816,33 +833,34 @@ desc_bounds_type (struct type* type) /* If ARR is an array descriptor (fat or thin pointer), or pointer to one, a pointer to its bounds data. Otherwise NULL. */ -static struct value* -desc_bounds (struct value* arr) +static struct value * +desc_bounds (struct value *arr) { - struct type* type = check_typedef (VALUE_TYPE (arr)); - if (is_thin_pntr (type)) + struct type *type = check_typedef (VALUE_TYPE (arr)); + if (is_thin_pntr (type)) { - struct type* bounds_type = desc_bounds_type (thin_descriptor_type (type)); + struct type *bounds_type = + desc_bounds_type (thin_descriptor_type (type)); LONGEST addr; if (desc_bounds_type == NULL) error ("Bad GNAT array descriptor"); /* NOTE: The following calculation is not really kosher, but - since desc_type is an XVE-encoded type (and shouldn't be), - the correct calculation is a real pain. FIXME (and fix GCC). */ + since desc_type is an XVE-encoded type (and shouldn't be), + the correct calculation is a real pain. FIXME (and fix GCC). */ if (TYPE_CODE (type) == TYPE_CODE_PTR) addr = value_as_long (arr); - else + else addr = VALUE_ADDRESS (arr) + VALUE_OFFSET (arr); - return - value_from_longest (lookup_pointer_type (bounds_type), - addr - TYPE_LENGTH (bounds_type)); + return + value_from_longest (lookup_pointer_type (bounds_type), + addr - TYPE_LENGTH (bounds_type)); } else if (is_thick_pntr (type)) - return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL, + return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL, "Bad GNAT array descriptor"); else return NULL; @@ -851,7 +869,7 @@ desc_bounds (struct value* arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ static int -fat_pntr_bounds_bitpos (struct type* type) +fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); } @@ -859,11 +877,11 @@ fat_pntr_bounds_bitpos (struct type* type) /* If TYPE is the type of an array-descriptor (fat pointer), the bit size of the field containing the address of the bounds data. */ static int -fat_pntr_bounds_bitsize (struct type* type) +fat_pntr_bounds_bitsize (struct type *type) { type = desc_base_type (type); - if (TYPE_FIELD_BITSIZE (type, 1) > 0) + if (TYPE_FIELD_BITSIZE (type, 1) > 0) return TYPE_FIELD_BITSIZE (type, 1); else return 8 * TYPE_LENGTH (check_typedef (TYPE_FIELD_TYPE (type, 1))); @@ -873,15 +891,15 @@ fat_pntr_bounds_bitsize (struct type* type) pointer to one, the type of its array data (a pointer-to-array-with-no-bounds type); otherwise, NULL. Use ada_type_of_array to get an array type with bounds data. */ -static struct type* -desc_data_type (struct type* type) +static struct type * +desc_data_type (struct type *type) { type = desc_base_type (type); /* NOTE: The following is bogus; see comment in desc_bounds. */ if (is_thin_pntr (type)) - return lookup_pointer_type - (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type),1))); + return lookup_pointer_type + (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type), 1))); else if (is_thick_pntr (type)) return lookup_struct_elt_type (type, "P_ARRAY", 1); else @@ -890,14 +908,14 @@ desc_data_type (struct type* type) /* If ARR is an array descriptor (fat or thin pointer), a pointer to its array data. */ -static struct value* -desc_data (struct value* arr) +static struct value * +desc_data (struct value *arr) { - struct type* type = VALUE_TYPE (arr); + struct type *type = VALUE_TYPE (arr); if (is_thin_pntr (type)) return thin_data_pntr (arr); else if (is_thick_pntr (type)) - return value_struct_elt (&arr, NULL, "P_ARRAY", NULL, + return value_struct_elt (&arr, NULL, "P_ARRAY", NULL, "Bad GNAT array descriptor"); else return NULL; @@ -907,7 +925,7 @@ desc_data (struct value* arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ static int -fat_pntr_data_bitpos (struct type* type) +fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); } @@ -915,23 +933,23 @@ fat_pntr_data_bitpos (struct type* type) /* If TYPE is the type of an array-descriptor (fat pointer), the bit size of the field containing the address of the data. */ static int -fat_pntr_data_bitsize (struct type* type) +fat_pntr_data_bitsize (struct type *type) { type = desc_base_type (type); if (TYPE_FIELD_BITSIZE (type, 0) > 0) return TYPE_FIELD_BITSIZE (type, 0); - else + else return TARGET_CHAR_BIT * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)); } /* If BOUNDS is an array-bounds structure (or pointer to one), return the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ -static struct value* -desc_one_bound (struct value* bounds, int i, int which) +static struct value * +desc_one_bound (struct value *bounds, int i, int which) { - return value_struct_elt (&bounds, NULL, bound_name[2*i+which-2], NULL, + return value_struct_elt (&bounds, NULL, bound_name[2 * i + which - 2], NULL, "Bad GNAT array descriptor bounds"); } @@ -939,42 +957,42 @@ desc_one_bound (struct value* bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ static int -desc_bound_bitpos (struct type* type, int i, int which) +desc_bound_bitpos (struct type *type, int i, int which) { - return TYPE_FIELD_BITPOS (desc_base_type (type), 2*i+which-2); + return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); } /* If BOUNDS is an array-bounds structure type, return the bit field size of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ static int -desc_bound_bitsize (struct type* type, int i, int which) +desc_bound_bitsize (struct type *type, int i, int which) { type = desc_base_type (type); - if (TYPE_FIELD_BITSIZE (type, 2*i+which-2) > 0) - return TYPE_FIELD_BITSIZE (type, 2*i+which-2); - else - return 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 2*i+which-2)); + if (TYPE_FIELD_BITSIZE (type, 2 * i + which - 2) > 0) + return TYPE_FIELD_BITSIZE (type, 2 * i + which - 2); + else + return 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 2 * i + which - 2)); } /* If TYPE is the type of an array-bounds structure, the type of its - Ith bound (numbering from 1). Otherwise, NULL. */ -static struct type* -desc_index_type (struct type* type, int i) + Ith bound (numbering from 1). Otherwise, NULL. */ +static struct type * +desc_index_type (struct type *type, int i) { type = desc_base_type (type); if (TYPE_CODE (type) == TYPE_CODE_STRUCT) - return lookup_struct_elt_type (type, bound_name[2*i-2], 1); - else + return lookup_struct_elt_type (type, bound_name[2 * i - 2], 1); + else return NULL; } /* The number of index positions in the array-bounds type TYPE. 0 if TYPE is NULL. */ static int -desc_arity (struct type* type) +desc_arity (struct type *type) { type = desc_base_type (type); @@ -986,7 +1004,7 @@ desc_arity (struct type* type) /* Non-zero iff type is a simple array type (or pointer to one). */ int -ada_is_simple_array (struct type* type) +ada_is_simple_array (struct type *type) { if (type == NULL) return 0; @@ -998,19 +1016,19 @@ ada_is_simple_array (struct type* type) /* Non-zero iff type belongs to a GNAT array descriptor. */ int -ada_is_array_descriptor (struct type* type) +ada_is_array_descriptor (struct type *type) { - struct type* data_type = desc_data_type (type); + struct type *data_type = desc_data_type (type); if (type == NULL) return 0; CHECK_TYPEDEF (type); - return + return data_type != NULL && ((TYPE_CODE (data_type) == TYPE_CODE_PTR && TYPE_TARGET_TYPE (data_type) != NULL && TYPE_CODE (TYPE_TARGET_TYPE (data_type)) == TYPE_CODE_ARRAY) - || + || TYPE_CODE (data_type) == TYPE_CODE_ARRAY) && desc_arity (desc_bounds_type (type)) > 0; } @@ -1022,12 +1040,12 @@ ada_is_array_descriptor (struct type* type) int ada_is_bogus_array_descriptor (struct type *type) { - return + return type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL) - && ! ada_is_array_descriptor (type); + && !ada_is_array_descriptor (type); } @@ -1038,45 +1056,47 @@ ada_is_bogus_array_descriptor (struct type *type) the ARR denotes a null array descriptor and BOUNDS is non-zero, returns NULL. The result is simply the type of ARR if ARR is not a descriptor. */ -struct type* -ada_type_of_array (struct value* arr, int bounds) +struct type * +ada_type_of_array (struct value *arr, int bounds) { if (ada_is_packed_array_type (VALUE_TYPE (arr))) return decode_packed_array_type (VALUE_TYPE (arr)); - if (! ada_is_array_descriptor (VALUE_TYPE (arr))) + if (!ada_is_array_descriptor (VALUE_TYPE (arr))) return VALUE_TYPE (arr); - - if (! bounds) - return check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr)))); + + if (!bounds) + return + check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr)))); else { - struct type* elt_type; + struct type *elt_type; int arity; - struct value* descriptor; + struct value *descriptor; struct objfile *objf = TYPE_OBJFILE (VALUE_TYPE (arr)); elt_type = ada_array_element_type (VALUE_TYPE (arr), -1); arity = ada_array_arity (VALUE_TYPE (arr)); - if (elt_type == NULL || arity == 0) + if (elt_type == NULL || arity == 0) return check_typedef (VALUE_TYPE (arr)); descriptor = desc_bounds (arr); - if (value_as_long (descriptor) == 0) + if (value_as_long (descriptor) == 0) return NULL; - while (arity > 0) { - struct type* range_type = alloc_type (objf); - struct type* array_type = alloc_type (objf); - struct value* low = desc_one_bound (descriptor, arity, 0); - struct value* high = desc_one_bound (descriptor, arity, 1); - arity -= 1; - - create_range_type (range_type, VALUE_TYPE (low), - (int) value_as_long (low), - (int) value_as_long (high)); - elt_type = create_array_type (array_type, elt_type, range_type); - } + while (arity > 0) + { + struct type *range_type = alloc_type (objf); + struct type *array_type = alloc_type (objf); + struct value *low = desc_one_bound (descriptor, arity, 0); + struct value *high = desc_one_bound (descriptor, arity, 1); + arity -= 1; + + create_range_type (range_type, VALUE_TYPE (low), + (int) value_as_long (low), + (int) value_as_long (high)); + elt_type = create_array_type (array_type, elt_type, range_type); + } return lookup_pointer_type (elt_type); } @@ -1086,12 +1106,12 @@ ada_type_of_array (struct value* arr, int bounds) Otherwise, returns either a standard GDB array with bounds set appropriately or, if ARR is a non-null fat pointer, a pointer to a standard GDB array. Returns NULL if ARR is a null fat pointer. */ -struct value* -ada_coerce_to_simple_array_ptr (struct value* arr) +struct value * +ada_coerce_to_simple_array_ptr (struct value *arr) { if (ada_is_array_descriptor (VALUE_TYPE (arr))) { - struct type* arrType = ada_type_of_array (arr, 1); + struct type *arrType = ada_type_of_array (arr, 1); if (arrType == NULL) return NULL; return value_cast (arrType, value_copy (desc_data (arr))); @@ -1105,31 +1125,31 @@ ada_coerce_to_simple_array_ptr (struct value* arr) /* If ARR does not represent an array, returns ARR unchanged. Otherwise, returns a standard GDB array describing ARR (which may be ARR itself if it already is in the proper form). */ -struct value* -ada_coerce_to_simple_array (struct value* arr) +struct value * +ada_coerce_to_simple_array (struct value *arr) { if (ada_is_array_descriptor (VALUE_TYPE (arr))) { - struct value* arrVal = ada_coerce_to_simple_array_ptr (arr); + struct value *arrVal = ada_coerce_to_simple_array_ptr (arr); if (arrVal == NULL) error ("Bounds unavailable for null array pointer."); return value_ind (arrVal); } else if (ada_is_packed_array_type (VALUE_TYPE (arr))) return decode_packed_array (arr); - else + else return arr; } /* If TYPE represents a GNAT array type, return it translated to an ordinary GDB array type (possibly with BITSIZE fields indicating packing). For other types, is the identity. */ -struct type* -ada_coerce_to_simple_array_type (struct type*type) +struct type * +ada_coerce_to_simple_array_type (struct type *type) { - struct value* mark = value_mark (); - struct value* dummy = value_from_longest (builtin_type_long, 0); - struct type* result; + struct value *mark = value_mark (); + struct value *dummy = value_from_longest (builtin_type_long, 0); + struct type *result; VALUE_TYPE (dummy) = type; result = ada_type_of_array (dummy, 0); value_free_to_mark (dummy); @@ -1138,12 +1158,12 @@ ada_coerce_to_simple_array_type (struct type*type) /* Non-zero iff TYPE represents a standard GNAT packed-array type. */ int -ada_is_packed_array_type (struct type* type) +ada_is_packed_array_type (struct type *type) { if (type == NULL) return 0; CHECK_TYPEDEF (type); - return + return ada_type_name (type) != NULL && strstr (ada_type_name (type), "___XP") != NULL; } @@ -1156,11 +1176,11 @@ ada_is_packed_array_type (struct type* type) constituent arrays) recorded in the BITSIZE components of its TYPE_FIELD_BITSIZE values, and with *ELT_BITS set to its total size in bits. */ -static struct type* -packed_array_type (struct type* type, long* elt_bits) +static struct type * +packed_array_type (struct type *type, long *elt_bits) { - struct type* new_elt_type; - struct type* new_type; + struct type *new_elt_type; + struct type *new_type; LONGEST low_bound, high_bound; CHECK_TYPEDEF (type); @@ -1174,15 +1194,15 @@ packed_array_type (struct type* type, long* elt_bits) TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits; TYPE_NAME (new_type) = ada_type_name (type); - if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0), + if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0), &low_bound, &high_bound) < 0) low_bound = high_bound = 0; if (high_bound < low_bound) *elt_bits = TYPE_LENGTH (new_type) = 0; - else + else { *elt_bits *= (high_bound - low_bound + 1); - TYPE_LENGTH (new_type) = + TYPE_LENGTH (new_type) = (*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; } @@ -1193,15 +1213,15 @@ packed_array_type (struct type* type, long* elt_bits) /* The array type encoded by TYPE, where ada_is_packed_array_type (TYPE). */ -static struct type* -decode_packed_array_type (struct type* type) -{ - struct symbol** syms; - struct block** blocks; - const char* raw_name = ada_type_name (check_typedef (type)); - char* name = (char*) alloca (strlen (raw_name) + 1); - char* tail = strstr (raw_name, "___XP"); - struct type* shadow_type; +static struct type * +decode_packed_array_type (struct type *type) +{ + struct symbol **syms; + struct block **blocks; + const char *raw_name = ada_type_name (check_typedef (type)); + char *name = (char *) alloca (strlen (raw_name) + 1); + char *tail = strstr (raw_name, "___XP"); + struct type *shadow_type; long bits; int i, n; @@ -1210,7 +1230,7 @@ decode_packed_array_type (struct type* type) /* NOTE: Use ada_lookup_symbol_list because of bug in some versions * of gcc (Solaris, e.g.). FIXME when compiler is fixed. */ - n = ada_lookup_symbol_list (name, get_selected_block (NULL), + n = ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE, &syms, &blocks); for (i = 0; i < n; i += 1) if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF @@ -1228,13 +1248,13 @@ decode_packed_array_type (struct type* type) warning ("could not understand bounds information on packed array"); return NULL; } - + if (sscanf (tail + sizeof ("___XP") - 1, "%ld", &bits) != 1) { warning ("could not understand bit size information on packed array"); return NULL; } - + return packed_array_type (shadow_type, &bits); } @@ -1244,10 +1264,10 @@ decode_packed_array_type (struct type* type) target types are set to the number of bits in each element, and the type length is set appropriately. */ -static struct value* -decode_packed_array (struct value* arr) +static struct value * +decode_packed_array (struct value *arr) { - struct type* type = decode_packed_array_type (VALUE_TYPE (arr)); + struct type *type = decode_packed_array_type (VALUE_TYPE (arr)); if (type == NULL) { @@ -1262,36 +1282,36 @@ decode_packed_array (struct value* arr) /* The value of the element of packed array ARR at the ARITY indices given in IND. ARR must be a simple array. */ -static struct value* -value_subscript_packed (struct value* arr, int arity, struct value** ind) +static struct value * +value_subscript_packed (struct value *arr, int arity, struct value **ind) { int i; int bits, elt_off, bit_off; long elt_total_bit_offset; - struct type* elt_type; - struct value* v; + struct type *elt_type; + struct value *v; bits = 0; elt_total_bit_offset = 0; elt_type = check_typedef (VALUE_TYPE (arr)); - for (i = 0; i < arity; i += 1) + for (i = 0; i < arity; i += 1) { - if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY + if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY || TYPE_FIELD_BITSIZE (elt_type, 0) == 0) - error ("attempt to do packed indexing of something other than a packed array"); + error + ("attempt to do packed indexing of something other than a packed array"); else { struct type *range_type = TYPE_INDEX_TYPE (elt_type); LONGEST lowerbound, upperbound; LONGEST idx; - if (get_discrete_bounds (range_type, &lowerbound, - &upperbound) < 0) + if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) { warning ("don't know bounds of array"); lowerbound = upperbound = 0; } - + idx = value_as_long (value_pos_atr (ind[i])); if (idx < lowerbound || idx > upperbound) warning ("packed array index %ld out of bounds", (long) idx); @@ -1302,8 +1322,8 @@ value_subscript_packed (struct value* arr, int arity, struct value** ind) } elt_off = elt_total_bit_offset / HOST_CHAR_BIT; bit_off = elt_total_bit_offset % HOST_CHAR_BIT; - - v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off, + + v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off, bits, elt_type); if (VALUE_LVAL (arr) == lval_internalvar) VALUE_LVAL (v) = lval_internalvar_component; @@ -1315,18 +1335,19 @@ value_subscript_packed (struct value* arr, int arity, struct value** ind) /* Non-zero iff TYPE includes negative integer values. */ static int -has_negatives (struct type* type) +has_negatives (struct type *type) { - switch (TYPE_CODE (type)) { - default: - return 0; - case TYPE_CODE_INT: - return ! TYPE_UNSIGNED (type); - case TYPE_CODE_RANGE: - return TYPE_LOW_BOUND (type) < 0; - } + switch (TYPE_CODE (type)) + { + default: + return 0; + case TYPE_CODE_INT: + return !TYPE_UNSIGNED (type); + case TYPE_CODE_RANGE: + return TYPE_LOW_BOUND (type) < 0; + } } - + /* Create a new value of type TYPE from the contents of OBJ starting at byte OFFSET, and bit offset BIT_OFFSET within that byte, @@ -1337,26 +1358,26 @@ has_negatives (struct type* type) in this case is never an lval. Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */ -struct value* -ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, int bit_offset, - int bit_size, struct type* type) +struct value * +ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset, + int bit_offset, int bit_size, + struct type *type) { - struct value* v; + struct value *v; int src, /* Index into the source area. */ targ, /* Index into the target area. */ - i, - srcBitsLeft, /* Number of source bits left to move. */ + i, srcBitsLeft, /* Number of source bits left to move. */ nsrc, ntarg, /* Number of source and target bytes. */ unusedLS, /* Number of bits in next significant * byte of source that are unused. */ accumSize; /* Number of meaningful bits in accum */ - unsigned char* bytes; /* First byte containing data to unpack. */ - unsigned char* unpacked; + unsigned char *bytes; /* First byte containing data to unpack. */ + unsigned char *unpacked; unsigned long accum; /* Staging area for bits being transferred */ unsigned char sign; int len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8; /* Transmit bytes from least to most significant; delta is the - * direction the indices move. */ + * direction the indices move. */ int delta = BITS_BIG_ENDIAN ? -1 : 1; CHECK_TYPEDEF (type); @@ -1364,22 +1385,22 @@ ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, i if (obj == NULL) { v = allocate_value (type); - bytes = (unsigned char*) (valaddr + offset); + bytes = (unsigned char *) (valaddr + offset); } else if (VALUE_LAZY (obj)) { v = value_at (type, VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL); - bytes = (unsigned char*) alloca (len); + bytes = (unsigned char *) alloca (len); read_memory (VALUE_ADDRESS (v), bytes, len); } - else + else { v = allocate_value (type); - bytes = (unsigned char*) VALUE_CONTENTS (obj) + offset; + bytes = (unsigned char *) VALUE_CONTENTS (obj) + offset; } - - if (obj != NULL) + + if (obj != NULL) { VALUE_LVAL (v) = VALUE_LVAL (obj); if (VALUE_LVAL (obj) == lval_internalvar) @@ -1388,14 +1409,14 @@ ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, i VALUE_BITPOS (v) = bit_offset + VALUE_BITPOS (obj); VALUE_BITSIZE (v) = bit_size; if (VALUE_BITPOS (v) >= HOST_CHAR_BIT) - { - VALUE_ADDRESS (v) += 1; - VALUE_BITPOS (v) -= HOST_CHAR_BIT; - } + { + VALUE_ADDRESS (v) += 1; + VALUE_BITPOS (v) -= HOST_CHAR_BIT; + } } else VALUE_BITSIZE (v) = bit_size; - unpacked = (unsigned char*) VALUE_CONTENTS (v); + unpacked = (unsigned char *) VALUE_CONTENTS (v); srcBitsLeft = bit_size; nsrc = len; @@ -1408,34 +1429,34 @@ ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, i } else if (BITS_BIG_ENDIAN) { - src = len-1; - if (has_negatives (type) && - ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT-1)))) + src = len - 1; + if (has_negatives (type) && + ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1)))) sign = ~0; - - unusedLS = + + unusedLS = (HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT) % HOST_CHAR_BIT; switch (TYPE_CODE (type)) - { - case TYPE_CODE_ARRAY: - case TYPE_CODE_UNION: - case TYPE_CODE_STRUCT: - /* Non-scalar values must be aligned at a byte boundary. */ - accumSize = - (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT; + { + case TYPE_CODE_ARRAY: + case TYPE_CODE_UNION: + case TYPE_CODE_STRUCT: + /* Non-scalar values must be aligned at a byte boundary. */ + accumSize = + (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT; /* And are placed at the beginning (most-significant) bytes * of the target. */ targ = src; - break; - default: + break; + default: accumSize = 0; targ = TYPE_LENGTH (type) - 1; - break; - } + break; + } } - else + else { int sign_bit_offset = (bit_size + bit_offset - 1) % 8; @@ -1443,23 +1464,24 @@ ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, i unusedLS = bit_offset; accumSize = 0; - if (has_negatives (type) && (bytes[len-1] & (1 << sign_bit_offset))) + if (has_negatives (type) && (bytes[len - 1] & (1 << sign_bit_offset))) sign = ~0; } - + accum = 0; while (nsrc > 0) { /* Mask for removing bits of the next source byte that are not * part of the value. */ - unsigned int unusedMSMask = - (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft))-1; + unsigned int unusedMSMask = + (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) - + 1; /* Sign-extend bits for this byte. */ unsigned int signMask = sign & ~unusedMSMask; - accum |= + accum |= (((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize; accumSize += HOST_CHAR_BIT - unusedLS; - if (accumSize >= HOST_CHAR_BIT) + if (accumSize >= HOST_CHAR_BIT) { unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT); accumSize -= HOST_CHAR_BIT; @@ -1484,12 +1506,12 @@ ada_value_primitive_packed_val (struct value* obj, char* valaddr, long offset, i return v; } - + /* Move N bits from SOURCE, starting at bit offset SRC_OFFSET to TARGET, starting at bit offset TARG_OFFSET. SOURCE and TARGET must not overlap. */ static void -move_bits (char* target, int targ_offset, char* source, int src_offset, int n) +move_bits (char *target, int targ_offset, char *source, int src_offset, int n) { unsigned int accum, mask; int accum_bits, chunk_size; @@ -1498,13 +1520,13 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n) targ_offset %= HOST_CHAR_BIT; source += src_offset / HOST_CHAR_BIT; src_offset %= HOST_CHAR_BIT; - if (BITS_BIG_ENDIAN) + if (BITS_BIG_ENDIAN) { accum = (unsigned char) *source; source += 1; accum_bits = HOST_CHAR_BIT - src_offset; - while (n > 0) + while (n > 0) { int unused_right; accum = (accum << HOST_CHAR_BIT) + (unsigned char) *source; @@ -1515,8 +1537,8 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n) chunk_size = n; unused_right = HOST_CHAR_BIT - (chunk_size + targ_offset); mask = ((1 << chunk_size) - 1) << unused_right; - *target = - (*target & ~mask) + *target = + (*target & ~mask) | ((accum >> (accum_bits - chunk_size - unused_right)) & mask); n -= chunk_size; accum_bits -= chunk_size; @@ -1530,7 +1552,7 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n) source += 1; accum_bits = HOST_CHAR_BIT - src_offset; - while (n > 0) + while (n > 0) { accum = accum + ((unsigned char) *source << accum_bits); accum_bits += HOST_CHAR_BIT; @@ -1539,8 +1561,7 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n) if (chunk_size > n) chunk_size = n; mask = ((1 << chunk_size) - 1) << targ_offset; - *target = - (*target & ~mask) | ((accum << targ_offset) & mask); + *target = (*target & ~mask) | ((accum << targ_offset) & mask); n -= chunk_size; accum_bits -= chunk_size; accum >>= chunk_size; @@ -1556,10 +1577,10 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n) FROMVAL. Handles assignment into packed fields that have floating-point or non-scalar types. */ -static struct value* -ada_value_assign (struct value* toval, struct value* fromval) +static struct value * +ada_value_assign (struct value *toval, struct value *fromval) { - struct type* type = VALUE_TYPE (toval); + struct type *type = VALUE_TYPE (toval); int bits = VALUE_BITSIZE (toval); if (!toval->modifiable) @@ -1567,36 +1588,36 @@ ada_value_assign (struct value* toval, struct value* fromval) COERCE_REF (toval); - if (VALUE_LVAL (toval) == lval_memory + if (VALUE_LVAL (toval) == lval_memory && bits > 0 - && (TYPE_CODE (type) == TYPE_CODE_FLT + && (TYPE_CODE (type) == TYPE_CODE_FLT || TYPE_CODE (type) == TYPE_CODE_STRUCT)) { - int len = - (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) - / HOST_CHAR_BIT; - char* buffer = (char*) alloca (len); - struct value* val; + int len = + (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; + char *buffer = (char *) alloca (len); + struct value *val; if (TYPE_CODE (type) == TYPE_CODE_FLT) fromval = value_cast (type, fromval); read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len); if (BITS_BIG_ENDIAN) - move_bits (buffer, VALUE_BITPOS (toval), - VALUE_CONTENTS (fromval), - TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT - bits, - bits); + move_bits (buffer, VALUE_BITPOS (toval), + VALUE_CONTENTS (fromval), + TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT - + bits, bits); else - move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval), + move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval), 0, bits); - write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len); + write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, + len); val = value_copy (toval); memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval), TYPE_LENGTH (type)); VALUE_TYPE (val) = type; - + return val; } @@ -1608,24 +1629,24 @@ ada_value_assign (struct value* toval, struct value* fromval) ARR may be either a simple array, GNAT array descriptor, or pointer thereto. */ -struct value* -ada_value_subscript (struct value* arr, int arity, struct value** ind) +struct value * +ada_value_subscript (struct value *arr, int arity, struct value **ind) { int k; - struct value* elt; - struct type* elt_type; + struct value *elt; + struct type *elt_type; elt = ada_coerce_to_simple_array (arr); elt_type = check_typedef (VALUE_TYPE (elt)); - if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY + if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY && TYPE_FIELD_BITSIZE (elt_type, 0) > 0) return value_subscript_packed (elt, arity, ind); for (k = 0; k < arity; k += 1) { if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY) - error("too many subscripts (%d expected)", k); + error ("too many subscripts (%d expected)", k); elt = value_subscript (elt, value_pos_atr (ind[k])); } return elt; @@ -1635,22 +1656,23 @@ ada_value_subscript (struct value* arr, int arity, struct value** ind) value of the element of *ARR at the ARITY indices given in IND. Does not read the entire array into memory. */ -struct value* -ada_value_ptr_subscript (struct value* arr, struct type* type, int arity, struct value** ind) +struct value * +ada_value_ptr_subscript (struct value *arr, struct type *type, int arity, + struct value **ind) { int k; for (k = 0; k < arity; k += 1) { LONGEST lwb, upb; - struct value* idx; + struct value *idx; if (TYPE_CODE (type) != TYPE_CODE_ARRAY) - error("too many subscripts (%d expected)", k); - arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), + error ("too many subscripts (%d expected)", k); + arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), value_copy (arr)); get_discrete_bounds (TYPE_INDEX_TYPE (type), &lwb, &upb); - if (lwb == 0) + if (lwb == 0) idx = ind[k]; else idx = value_sub (ind[k], value_from_longest (builtin_type_int, lwb)); @@ -1667,7 +1689,7 @@ ada_value_ptr_subscript (struct value* arr, struct type* type, int arity, struct type designation. Otherwise, returns 0. */ int -ada_array_arity (struct type* type) +ada_array_arity (struct type *type) { int arity; @@ -1677,15 +1699,15 @@ ada_array_arity (struct type* type) type = desc_base_type (type); arity = 0; - if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) return desc_arity (desc_bounds_type (type)); - else - while (TYPE_CODE (type) == TYPE_CODE_ARRAY) + else + while (TYPE_CODE (type) == TYPE_CODE_ARRAY) { arity += 1; type = check_typedef (TYPE_TARGET_TYPE (type)); } - + return arity; } @@ -1694,27 +1716,27 @@ ada_array_arity (struct type* type) TYPE after indexing by NINDICES indices, or by all indices if NINDICES is -1. Otherwise, returns NULL. */ -struct type* -ada_array_element_type (struct btype* type, int nindices) +struct type * +ada_array_element_type (struct type *type, int nindices) { type = desc_base_type (type); - if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) { int k; - struct type* p_array_type; + struct type *p_array_type; p_array_type = desc_data_type (type); k = ada_array_arity (type); if (k == 0) return NULL; - + /* Initially p_array_type = elt_type(*)[]...(k times)...[] */ if (nindices >= 0 && k > nindices) k = nindices; p_array_type = TYPE_TARGET_TYPE (p_array_type); - while (k > 0 && p_array_type != NULL) + while (k > 0 && p_array_type != NULL) { p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type)); k -= 1; @@ -1737,8 +1759,8 @@ ada_array_element_type (struct btype* type, int nindices) /* The type of nth index in arrays of given type (n numbering from 1). Does not examine memory. */ -struct type* -ada_index_type (struct type* type, int n) +struct type * +ada_index_type (struct type *type, int n) { type = desc_base_type (type); @@ -1754,7 +1776,7 @@ ada_index_type (struct type* type, int n) return TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)); } - else + else return desc_index_type (desc_bounds_type (type), n); } @@ -1766,19 +1788,20 @@ ada_index_type (struct type* type, int n) run-time quantities other than discriminants. */ LONGEST -ada_array_bound_from_type (struct type* arr_type, int n, int which, struct type** typep) +ada_array_bound_from_type (struct type * arr_type, int n, int which, + struct type ** typep) { - struct type* type; - struct type* index_type_desc; + struct type *type; + struct type *index_type_desc; if (ada_is_packed_array_type (arr_type)) arr_type = decode_packed_array_type (arr_type); - if (arr_type == NULL || ! ada_is_simple_array (arr_type)) + if (arr_type == NULL || !ada_is_simple_array (arr_type)) { if (typep != NULL) *typep = builtin_type_int; - return (LONGEST) -which; + return (LONGEST) - which; } if (TYPE_CODE (arr_type) == TYPE_CODE_PTR) @@ -1787,12 +1810,12 @@ ada_array_bound_from_type (struct type* arr_type, int n, int which, struct type* type = arr_type; index_type_desc = ada_find_parallel_type (type, "___XA"); - if (index_type_desc == NULL) + if (index_type_desc == NULL) { - struct type* range_type; - struct type* index_type; + struct type *range_type; + struct type *index_type; - while (n > 1) + while (n > 1) { type = TYPE_TARGET_TYPE (type); n -= 1; @@ -1801,23 +1824,23 @@ ada_array_bound_from_type (struct type* arr_type, int n, int which, struct type* range_type = TYPE_INDEX_TYPE (type); index_type = TYPE_TARGET_TYPE (range_type); if (TYPE_CODE (index_type) == TYPE_CODE_UNDEF) - index_type = builtin_type_long; + index_type = builtin_type_long; if (typep != NULL) *typep = index_type; - return - (LONGEST) (which == 0 + return + (LONGEST) (which == 0 ? TYPE_LOW_BOUND (range_type) : TYPE_HIGH_BOUND (range_type)); } - else + else { - struct type* index_type = - to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n-1), + struct type *index_type = + to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n - 1), NULL, TYPE_OBJFILE (arr_type)); if (typep != NULL) *typep = TYPE_TARGET_TYPE (index_type); - return - (LONGEST) (which == 0 + return + (LONGEST) (which == 0 ? TYPE_LOW_BOUND (index_type) : TYPE_HIGH_BOUND (index_type)); } @@ -1828,19 +1851,19 @@ ada_array_bound_from_type (struct type* arr_type, int n, int which, struct type* which is 1. This routine will also work for arrays with bounds supplied by run-time quantities other than discriminants. */ -struct value* +struct value * ada_array_bound (arr, n, which) - struct value* arr; - int n; + struct value *arr; + int n; int which; { - struct type* arr_type = VALUE_TYPE (arr); + struct type *arr_type = VALUE_TYPE (arr); if (ada_is_packed_array_type (arr_type)) return ada_array_bound (decode_packed_array (arr), n, which); - else if (ada_is_simple_array (arr_type)) + else if (ada_is_simple_array (arr_type)) { - struct type* type; + struct type *type; LONGEST v = ada_array_bound_from_type (arr_type, n, which, &type); return value_from_longest (type, v); } @@ -1852,42 +1875,41 @@ ada_array_bound (arr, n, which) nth index. This routine will also work for arrays with bounds supplied by run-time quantities other than discriminants. Does not work for arrays indexed by enumeration types with representation - clauses at the moment. */ + clauses at the moment. */ -struct value* -ada_array_length (struct value* arr, int n) +struct value * +ada_array_length (struct value *arr, int n) { - struct type* arr_type = check_typedef (VALUE_TYPE (arr)); - struct type* index_type_desc; + struct type *arr_type = check_typedef (VALUE_TYPE (arr)); + struct type *index_type_desc; if (ada_is_packed_array_type (arr_type)) return ada_array_length (decode_packed_array (arr), n); if (ada_is_simple_array (arr_type)) { - struct type* type; + struct type *type; LONGEST v = ada_array_bound_from_type (arr_type, n, 1, &type) - ada_array_bound_from_type (arr_type, n, 0, NULL) + 1; return value_from_longest (type, v); } else - return + return value_from_longest (builtin_type_ada_int, value_as_long (desc_one_bound (desc_bounds (arr), n, 1)) - value_as_long (desc_one_bound (desc_bounds (arr), - n, 0)) - + 1); + n, 0)) + 1); } - + /* Name resolution */ /* The "demangled" name for the user-definable Ada operator corresponding to op. */ -static const char* +static const char * ada_op_name (enum exp_opcode op) { int i; @@ -1912,7 +1934,7 @@ ada_op_name (enum exp_opcode op) May change (expand) *EXP. */ void -ada_resolve (struct expression** expp, struct type* context_type) +ada_resolve (struct expression **expp, struct type *context_type) { int pc; pc = 0; @@ -1927,14 +1949,15 @@ ada_resolve (struct expression** expp, struct type* context_type) function-valued variables into parameterless calls. May expand EXP. The CONTEXT_TYPE functions as in ada_resolve, above. */ -static struct value* -ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struct type* context_type) +static struct value * +ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, + struct type *context_type) { int pc = *pos; int i; - struct expression* exp; /* Convenience: == *expp */ + struct expression *exp; /* Convenience: == *expp */ enum exp_opcode op = (*expp)->elts[pc].opcode; - struct value** argvec; /* Vector of operand types (alloca'ed). */ + struct value **argvec; /* Vector of operand types (alloca'ed). */ int nargs; /* Number of operands */ argvec = NULL; @@ -1945,7 +1968,7 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc switch (op) { case OP_VAR_VALUE: - /* case OP_UNRESOLVED_VALUE:*/ + /* case OP_UNRESOLVED_VALUE: */ /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ *pos += 4; break; @@ -1953,43 +1976,43 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc case OP_FUNCALL: nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ - /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) - { - *pos += 7; - - argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1)); - for (i = 0; i < nargs-1; i += 1) - argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL); - argvec[i] = NULL; - } - else - { - *pos += 3; - ada_resolve_subexp (expp, pos, 0, NULL); - for (i = 1; i < nargs; i += 1) - ada_resolve_subexp (expp, pos, 1, NULL); - } - */ + /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) + { + *pos += 7; + + argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1)); + for (i = 0; i < nargs-1; i += 1) + argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL); + argvec[i] = NULL; + } + else + { + *pos += 3; + ada_resolve_subexp (expp, pos, 0, NULL); + for (i = 1; i < nargs; i += 1) + ada_resolve_subexp (expp, pos, 1, NULL); + } + */ exp = *expp; break; /* FIXME: UNOP_QUAL should be defined in expression.h */ /* case UNOP_QUAL: - nargs = 1; - *pos += 3; - ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type); - exp = *expp; - break; - */ - /* FIXME: OP_ATTRIBUTE should be defined in expression.h */ + nargs = 1; + *pos += 3; + ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type); + exp = *expp; + break; + */ + /* FIXME: OP_ATTRIBUTE should be defined in expression.h */ /* case OP_ATTRIBUTE: - nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; - *pos += 4; - for (i = 0; i < nargs; i += 1) - ada_resolve_subexp (expp, pos, 1, NULL); - exp = *expp; - break; - */ + nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; + *pos += 4; + for (i = 0; i < nargs; i += 1) + ada_resolve_subexp (expp, pos, 1, NULL); + exp = *expp; + break; + */ case UNOP_ADDR: nargs = 1; *pos += 1; @@ -1999,7 +2022,7 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc case BINOP_ASSIGN: { - struct value* arg1; + struct value *arg1; nargs = 2; *pos += 1; arg1 = ada_resolve_subexp (expp, pos, 0, NULL); @@ -2011,16 +2034,16 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc } default: - switch (op) + switch (op) { default: error ("Unexpected operator during name resolution"); case UNOP_CAST: - /* case UNOP_MBR: - nargs = 1; - *pos += 3; - break; - */ + /* case UNOP_MBR: + nargs = 1; + *pos += 3; + break; + */ case BINOP_ADD: case BINOP_SUB: case BINOP_MUL: @@ -2084,29 +2107,30 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc break; case OP_ARRAY: - *pos += 4; + *pos += 4; nargs = longest_to_int (exp->elts[pc + 2].longconst) + 1; nargs -= longest_to_int (exp->elts[pc + 1].longconst); /* A null array contains one dummy element to give the type. */ - /* if (nargs == 0) - nargs = 1; - break;*/ + /* if (nargs == 0) + nargs = 1; + break; */ case TERNOP_SLICE: /* FIXME: TERNOP_MBR should be defined in expression.h */ - /* case TERNOP_MBR: - *pos += 1; - nargs = 3; - break; - */ + /* case TERNOP_MBR: + *pos += 1; + nargs = 3; + break; + */ /* FIXME: BINOP_MBR should be defined in expression.h */ - /* case BINOP_MBR: - *pos += 3; - nargs = 2; - break;*/ + /* case BINOP_MBR: + *pos += 3; + nargs = 2; + break; */ } - argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1)); + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 1)); for (i = 0; i < nargs; i += 1) argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL); argvec[i] = NULL; @@ -2122,97 +2146,98 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ /* case OP_UNRESOLVED_VALUE: - { - struct symbol** candidate_syms; - struct block** candidate_blocks; - int n_candidates; - - n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name, - exp->elts[pc + 1].block, - VAR_NAMESPACE, - &candidate_syms, - &candidate_blocks); - - if (n_candidates > 1) - {*/ - /* Types tend to get re-introduced locally, so if there - are any local symbols that are not types, first filter - out all types.*/ /* - int j; - for (j = 0; j < n_candidates; j += 1) - switch (SYMBOL_CLASS (candidate_syms[j])) - { - case LOC_REGISTER: - case LOC_ARG: - case LOC_REF_ARG: - case LOC_REGPARM: - case LOC_REGPARM_ADDR: - case LOC_LOCAL: - case LOC_LOCAL_ARG: - case LOC_BASEREG: - case LOC_BASEREG_ARG: - goto FoundNonType; - default: - break; - } - FoundNonType: - if (j < n_candidates) - { - j = 0; - while (j < n_candidates) - { - if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF) - { - candidate_syms[j] = candidate_syms[n_candidates-1]; - candidate_blocks[j] = candidate_blocks[n_candidates-1]; - n_candidates -= 1; - } - else - j += 1; - } - } - } + { + struct symbol** candidate_syms; + struct block** candidate_blocks; + int n_candidates; + + n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name, + exp->elts[pc + 1].block, + VAR_NAMESPACE, + &candidate_syms, + &candidate_blocks); + + if (n_candidates > 1) + { */ + /* Types tend to get re-introduced locally, so if there + are any local symbols that are not types, first filter + out all types. *//* + int j; + for (j = 0; j < n_candidates; j += 1) + switch (SYMBOL_CLASS (candidate_syms[j])) + { + case LOC_REGISTER: + case LOC_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_LOCAL: + case LOC_LOCAL_ARG: + case LOC_BASEREG: + case LOC_BASEREG_ARG: + goto FoundNonType; + default: + break; + } + FoundNonType: + if (j < n_candidates) + { + j = 0; + while (j < n_candidates) + { + if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF) + { + candidate_syms[j] = candidate_syms[n_candidates-1]; + candidate_blocks[j] = candidate_blocks[n_candidates-1]; + n_candidates -= 1; + } + else + j += 1; + } + } + } - if (n_candidates == 0) - error ("No definition found for %s", - ada_demangle (exp->elts[pc + 2].name)); - else if (n_candidates == 1) - i = 0; - else if (deprocedure_p - && ! is_nonfunction (candidate_syms, n_candidates)) - { - i = ada_resolve_function (candidate_syms, candidate_blocks, - n_candidates, NULL, 0, - exp->elts[pc + 2].name, context_type); - if (i < 0) - error ("Could not find a match for %s", - ada_demangle (exp->elts[pc + 2].name)); - } - else - { - printf_filtered ("Multiple matches for %s\n", - ada_demangle (exp->elts[pc+2].name)); - user_select_syms (candidate_syms, candidate_blocks, - n_candidates, 1); - i = 0; - } + if (n_candidates == 0) + error ("No definition found for %s", + ada_demangle (exp->elts[pc + 2].name)); + else if (n_candidates == 1) + i = 0; + else if (deprocedure_p + && ! is_nonfunction (candidate_syms, n_candidates)) + { + i = ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, NULL, 0, + exp->elts[pc + 2].name, context_type); + if (i < 0) + error ("Could not find a match for %s", + ada_demangle (exp->elts[pc + 2].name)); + } + else + { + printf_filtered ("Multiple matches for %s\n", + ada_demangle (exp->elts[pc+2].name)); + user_select_syms (candidate_syms, candidate_blocks, + n_candidates, 1); + i = 0; + } - exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE; - exp->elts[pc + 1].block = candidate_blocks[i]; - exp->elts[pc + 2].symbol = candidate_syms[i]; - if (innermost_block == NULL || - contained_in (candidate_blocks[i], innermost_block)) - innermost_block = candidate_blocks[i]; - }*/ + exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE; + exp->elts[pc + 1].block = candidate_blocks[i]; + exp->elts[pc + 2].symbol = candidate_syms[i]; + if (innermost_block == NULL || + contained_in (candidate_blocks[i], innermost_block)) + innermost_block = candidate_blocks[i]; + } */ /* FALL THROUGH */ case OP_VAR_VALUE: - if (deprocedure_p && - TYPE_CODE (SYMBOL_TYPE (exp->elts[pc+2].symbol)) == TYPE_CODE_FUNC) + if (deprocedure_p && + TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 2].symbol)) == + TYPE_CODE_FUNC) { - replace_operator_with_call (expp, pc, 0, 0, - exp->elts[pc+2].symbol, - exp->elts[pc+1].block); + replace_operator_with_call (expp, pc, 0, 0, + exp->elts[pc + 2].symbol, + exp->elts[pc + 1].block); exp = *expp; } break; @@ -2220,37 +2245,37 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc case OP_FUNCALL: { /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ - /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) - { - struct symbol** candidate_syms; - struct block** candidate_blocks; - int n_candidates; - - n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name, - exp->elts[pc + 4].block, - VAR_NAMESPACE, - &candidate_syms, - &candidate_blocks); - if (n_candidates == 1) - i = 0; - else - { - i = ada_resolve_function (candidate_syms, candidate_blocks, - n_candidates, argvec, nargs-1, - exp->elts[pc + 5].name, context_type); - if (i < 0) - error ("Could not find a match for %s", - ada_demangle (exp->elts[pc + 5].name)); - } + /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) + { + struct symbol** candidate_syms; + struct block** candidate_blocks; + int n_candidates; + + n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name, + exp->elts[pc + 4].block, + VAR_NAMESPACE, + &candidate_syms, + &candidate_blocks); + if (n_candidates == 1) + i = 0; + else + { + i = ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, argvec, nargs-1, + exp->elts[pc + 5].name, context_type); + if (i < 0) + error ("Could not find a match for %s", + ada_demangle (exp->elts[pc + 5].name)); + } + + exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE; + exp->elts[pc + 4].block = candidate_blocks[i]; + exp->elts[pc + 5].symbol = candidate_syms[i]; + if (innermost_block == NULL || + contained_in (candidate_blocks[i], innermost_block)) + innermost_block = candidate_blocks[i]; + } */ - exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE; - exp->elts[pc + 4].block = candidate_blocks[i]; - exp->elts[pc + 5].symbol = candidate_syms[i]; - if (innermost_block == NULL || - contained_in (candidate_blocks[i], innermost_block)) - innermost_block = candidate_blocks[i]; - }*/ - } break; case BINOP_ADD: @@ -2276,18 +2301,18 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc case UNOP_ABS: if (possible_user_operator_p (op, argvec)) { - struct symbol** candidate_syms; - struct block** candidate_blocks; + struct symbol **candidate_syms; + struct block **candidate_blocks; int n_candidates; - n_candidates = ada_lookup_symbol_list (ada_mangle (ada_op_name (op)), - (struct block*) NULL, - VAR_NAMESPACE, - &candidate_syms, - &candidate_blocks); - i = ada_resolve_function (candidate_syms, candidate_blocks, - n_candidates, argvec, nargs, - ada_op_name (op), NULL); + n_candidates = + ada_lookup_symbol_list (ada_mangle (ada_op_name (op)), + (struct block *) NULL, VAR_NAMESPACE, + &candidate_syms, &candidate_blocks); + i = + ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, argvec, nargs, + ada_op_name (op), NULL); if (i < 0) break; @@ -2304,14 +2329,14 @@ ada_resolve_subexp (struct expression** expp, int *pos, int deprocedure_p, struc /* Return non-zero if formal type FTYPE matches actual type ATYPE. If MAY_DEREF is non-zero, the formal may be a pointer and the actual - a non-pointer. */ + a non-pointer. */ /* The term "match" here is rather loose. The match is heuristic and liberal. FIXME: TOO liberal, in fact. */ static int ada_type_match (ftype, atype, may_deref) - struct type* ftype; - struct type* atype; + struct type *ftype; + struct type *atype; int may_deref; { CHECK_TYPEDEF (ftype); @@ -2322,11 +2347,11 @@ ada_type_match (ftype, atype, may_deref) if (TYPE_CODE (atype) == TYPE_CODE_REF) atype = TYPE_TARGET_TYPE (atype); - if (TYPE_CODE (ftype) == TYPE_CODE_VOID + if (TYPE_CODE (ftype) == TYPE_CODE_VOID || TYPE_CODE (atype) == TYPE_CODE_VOID) return 1; - switch (TYPE_CODE (ftype)) + switch (TYPE_CODE (ftype)) { default: return 1; @@ -2334,8 +2359,9 @@ ada_type_match (ftype, atype, may_deref) if (TYPE_CODE (atype) == TYPE_CODE_PTR) return ada_type_match (TYPE_TARGET_TYPE (ftype), TYPE_TARGET_TYPE (atype), 0); - else return (may_deref && - ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0)); + else + return (may_deref && + ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0)); case TYPE_CODE_INT: case TYPE_CODE_ENUM: case TYPE_CODE_RANGE: @@ -2350,16 +2376,16 @@ ada_type_match (ftype, atype, may_deref) } case TYPE_CODE_ARRAY: - return (TYPE_CODE (atype) == TYPE_CODE_ARRAY + return (TYPE_CODE (atype) == TYPE_CODE_ARRAY || ada_is_array_descriptor (atype)); case TYPE_CODE_STRUCT: if (ada_is_array_descriptor (ftype)) - return (TYPE_CODE (atype) == TYPE_CODE_ARRAY + return (TYPE_CODE (atype) == TYPE_CODE_ARRAY || ada_is_array_descriptor (atype)); else return (TYPE_CODE (atype) == TYPE_CODE_STRUCT - && ! ada_is_array_descriptor (atype)); + && !ada_is_array_descriptor (atype)); case TYPE_CODE_UNION: case TYPE_CODE_FLT: @@ -2373,12 +2399,12 @@ ada_type_match (ftype, atype, may_deref) argument function. */ static int -ada_args_match (struct symbol* func, struct value** actuals, int n_actuals) +ada_args_match (struct symbol *func, struct value **actuals, int n_actuals) { int i; - struct type* func_type = SYMBOL_TYPE (func); + struct type *func_type = SYMBOL_TYPE (func); - if (SYMBOL_CLASS (func) == LOC_CONST && + if (SYMBOL_CLASS (func) == LOC_CONST && TYPE_CODE (func_type) == TYPE_CODE_ENUM) return (n_actuals == 0); else if (func_type == NULL || TYPE_CODE (func_type) != TYPE_CODE_FUNC) @@ -2389,11 +2415,11 @@ ada_args_match (struct symbol* func, struct value** actuals, int n_actuals) for (i = 0; i < n_actuals; i += 1) { - struct type* ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i)); - struct type* atype = check_typedef (VALUE_TYPE (actuals[i])); + struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i)); + struct type *atype = check_typedef (VALUE_TYPE (actuals[i])); - if (! ada_type_match (TYPE_FIELD_TYPE (func_type, i), - VALUE_TYPE (actuals[i]), 1)) + if (!ada_type_match (TYPE_FIELD_TYPE (func_type, i), + VALUE_TYPE (actuals[i]), 1)) return 0; } return 1; @@ -2405,23 +2431,23 @@ ada_args_match (struct symbol* func, struct value** actuals, int n_actuals) or an enumerated type. A null CONTEXT_TYPE indicates any non-void type. */ static int -return_match (struct type* func_type, struct type* context_type) +return_match (struct type *func_type, struct type *context_type) { - struct type* return_type; + struct type *return_type; if (func_type == NULL) return 1; /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */ /* if (TYPE_CODE (func_type) == TYPE_CODE_FUNC) - return_type = base_type (TYPE_TARGET_TYPE (func_type)); - else - return_type = base_type (func_type);*/ + return_type = base_type (TYPE_TARGET_TYPE (func_type)); + else + return_type = base_type (func_type); */ if (return_type == NULL) return 1; /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */ - /* context_type = base_type (context_type);*/ + /* context_type = base_type (context_type); */ if (TYPE_CODE (return_type) == TYPE_CODE_ENUM) return context_type == NULL || return_type == context_type; @@ -2444,14 +2470,14 @@ return_match (struct type* func_type, struct type* context_type) is modified in parallel to SYMS. */ int -ada_resolve_function (struct symbol* syms[], struct block* blocks[], int nsyms, - struct value** args, int nargs, const char* name, - struct type* context_type) +ada_resolve_function (struct symbol *syms[], struct block *blocks[], + int nsyms, struct value **args, int nargs, + const char *name, struct type *context_type) { int k; int m; /* Number of hits */ - struct type* fallback; - struct type* return_type; + struct type *fallback; + struct type *return_type; return_type = context_type; if (context_type == NULL) @@ -2459,12 +2485,12 @@ ada_resolve_function (struct symbol* syms[], struct block* blocks[], int nsyms, else fallback = NULL; - m = 0; + m = 0; while (1) { for (k = 0; k < nsyms; k += 1) { - struct type* type = check_typedef (SYMBOL_TYPE (syms[k])); + struct type *type = check_typedef (SYMBOL_TYPE (syms[k])); if (ada_args_match (syms[k], args, nargs) && return_match (SYMBOL_TYPE (syms[k]), return_type)) @@ -2498,7 +2524,7 @@ ada_resolve_function (struct symbol* syms[], struct block* blocks[], int nsyms, /* same package should sort in their source order. We settle for ordering */ /* such symbols by their trailing number (__N or $N). */ static int -mangled_ordered_before (char* N0, char* N1) +mangled_ordered_before (char *N0, char *N1) { if (N1 == NULL) return 0; @@ -2507,50 +2533,50 @@ mangled_ordered_before (char* N0, char* N1) else { int k0, k1; - for (k0 = strlen (N0)-1; k0 > 0 && isdigit (N0[k0]); k0 -= 1) + for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1) ; - for (k1 = strlen (N1)-1; k1 > 0 && isdigit (N1[k1]); k1 -= 1) + for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1) ; - if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0+1] != '\000' - && (N1[k1] == '_' || N1[k1] == '$') && N1[k1+1] != '\000') + if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0 + 1] != '\000' + && (N1[k1] == '_' || N1[k1] == '$') && N1[k1 + 1] != '\000') { int n0, n1; n0 = k0; - while (N0[n0] == '_' && n0 > 0 && N0[n0-1] == '_') + while (N0[n0] == '_' && n0 > 0 && N0[n0 - 1] == '_') n0 -= 1; n1 = k1; - while (N1[n1] == '_' && n1 > 0 && N1[n1-1] == '_') + while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_') n1 -= 1; if (n0 == n1 && STREQN (N0, N1, n0)) - return (atoi (N0+k0+1) < atoi (N1+k1+1)); + return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1)); } return (strcmp (N0, N1) < 0); } } - + /* Sort SYMS[0..NSYMS-1] to put the choices in a canonical order by their */ /* mangled names, rearranging BLOCKS[0..NSYMS-1] according to the same */ /* permutation. */ -static void -sort_choices (struct symbol* syms[], struct block* blocks[], int nsyms) +static void +sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms) { int i, j; - for (i = 1; i < nsyms; i += 1) + for (i = 1; i < nsyms; i += 1) { - struct symbol* sym = syms[i]; - struct block* block = blocks[i]; + struct symbol *sym = syms[i]; + struct block *block = blocks[i]; int j; - for (j = i-1; j >= 0; j -= 1) + for (j = i - 1; j >= 0; j -= 1) { if (mangled_ordered_before (SYMBOL_NAME (syms[j]), SYMBOL_NAME (sym))) break; - syms[j+1] = syms[j]; - blocks[j+1] = blocks[j]; + syms[j + 1] = syms[j]; + blocks[j + 1] = blocks[j]; } - syms[j+1] = sym; - blocks[j+1] = block; + syms[j + 1] = sym; + blocks[j + 1] = block; } } @@ -2565,11 +2591,11 @@ sort_choices (struct symbol* syms[], struct block* blocks[], int nsyms) to be re-integrated one of these days. */ int -user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, +user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms, int max_results) { int i; - int* chosen = (int*) alloca (sizeof(int) * nsyms); + int *chosen = (int *) alloca (sizeof (int) * nsyms); int n_chosen; int first_choice = (max_results == 1) ? 1 : 2; @@ -2578,9 +2604,9 @@ user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, if (nsyms <= 1) return nsyms; - printf_unfiltered("[0] cancel\n"); + printf_unfiltered ("[0] cancel\n"); if (max_results > 1) - printf_unfiltered("[1] all\n"); + printf_unfiltered ("[1] all\n"); sort_choices (syms, blocks, nsyms); @@ -2593,30 +2619,27 @@ user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, { struct symtab_and_line sal = find_function_start_sal (syms[i], 1); printf_unfiltered ("[%d] %s at %s:%d\n", - i + first_choice, + i + first_choice, SYMBOL_SOURCE_NAME (syms[i]), - sal.symtab == NULL - ? "" - : sal.symtab->filename, - sal.line); + sal.symtab == NULL + ? "" + : sal.symtab->filename, sal.line); continue; } - else + else { - int is_enumeral = + int is_enumeral = (SYMBOL_CLASS (syms[i]) == LOC_CONST && SYMBOL_TYPE (syms[i]) != NULL - && TYPE_CODE (SYMBOL_TYPE (syms[i])) - == TYPE_CODE_ENUM); - struct symtab* symtab = symtab_for_sym (syms[i]); + && TYPE_CODE (SYMBOL_TYPE (syms[i])) == TYPE_CODE_ENUM); + struct symtab *symtab = symtab_for_sym (syms[i]); if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL) printf_unfiltered ("[%d] %s at %s:%d\n", i + first_choice, SYMBOL_SOURCE_NAME (syms[i]), symtab->filename, SYMBOL_LINE (syms[i])); - else if (is_enumeral && - TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL) + else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL) { printf_unfiltered ("[%d] ", i + first_choice); ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0); @@ -2624,7 +2647,7 @@ user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, SYMBOL_SOURCE_NAME (syms[i])); } else if (symtab != NULL) - printf_unfiltered (is_enumeral + printf_unfiltered (is_enumeral ? "[%d] %s in %s (enumeral)\n" : "[%d] %s at %s:?\n", i + first_choice, @@ -2634,17 +2657,18 @@ user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, printf_unfiltered (is_enumeral ? "[%d] %s (enumeral)\n" : "[%d] %s at ?\n", - i + first_choice, SYMBOL_SOURCE_NAME (syms[i])); + i + first_choice, + SYMBOL_SOURCE_NAME (syms[i])); } } - + n_chosen = get_selections (chosen, nsyms, max_results, max_results > 1, "overload-choice"); for (i = 0; i < n_chosen; i += 1) { syms[i] = syms[chosen[i]]; - if (blocks != NULL) + if (blocks != NULL) blocks[i] = blocks[chosen[i]]; } @@ -2668,15 +2692,15 @@ user_select_syms (struct symbol* syms[], struct block* blocks[], int nsyms, prompts (for use with the -f switch). */ int -get_selections (int* choices, int n_choices, int max_results, - int is_all_choice, char* annotation_suffix) +get_selections (int *choices, int n_choices, int max_results, + int is_all_choice, char *annotation_suffix) { int i; - char* args; - const char* prompt; + char *args; + const char *prompt; int n_chosen; int first_choice = is_all_choice ? 2 : 1; - + prompt = getenv ("PS2"); if (prompt == NULL) prompt = ">"; @@ -2685,7 +2709,7 @@ get_selections (int* choices, int n_choices, int max_results, gdb_flush (gdb_stdout); args = command_line_input ((char *) NULL, 0, annotation_suffix); - + if (args == NULL) error_no_arg ("one or more choice numbers"); @@ -2695,7 +2719,7 @@ get_selections (int* choices, int n_choices, int max_results, order, as given in args. Choices are validated. */ while (1) { - char* args2; + char *args2; int choice, j; while (isspace (*args)) @@ -2706,11 +2730,12 @@ get_selections (int* choices, int n_choices, int max_results, break; choice = strtol (args, &args2, 10); - if (args == args2 || choice < 0 || choice > n_choices + first_choice - 1) + if (args == args2 || choice < 0 + || choice > n_choices + first_choice - 1) error ("Argument must be choice number"); args = args2; - if (choice == 0) + if (choice == 0) error ("cancelled"); if (choice < first_choice) @@ -2722,22 +2747,23 @@ get_selections (int* choices, int n_choices, int max_results, } choice -= first_choice; - for (j = n_chosen-1; j >= 0 && choice < choices[j]; j -= 1) - {} + for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1) + { + } if (j < 0 || choice != choices[j]) { int k; - for (k = n_chosen-1; k > j; k -= 1) - choices[k+1] = choices[k]; - choices[j+1] = choice; + for (k = n_chosen - 1; k > j; k -= 1) + choices[k + 1] = choices[k]; + choices[j + 1] = choice; n_chosen += 1; } } if (n_chosen > max_results) error ("Select no more than %d of the above", max_results); - + return n_chosen; } @@ -2746,21 +2772,21 @@ get_selections (int* choices, int n_choices, int max_results, /* arguments. Update *EXPP as needed to hold more space. */ static void -replace_operator_with_call (struct expression** expp, int pc, int nargs, - int oplen, struct symbol* sym, - struct block* block) +replace_operator_with_call (struct expression **expp, int pc, int nargs, + int oplen, struct symbol *sym, + struct block *block) { /* A new expression, with 6 more elements (3 for funcall, 4 for function symbol, -oplen for operator being replaced). */ - struct expression* newexp = (struct expression*) + struct expression *newexp = (struct expression *) xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen)); - struct expression* exp = *expp; + struct expression *exp = *expp; newexp->nelts = exp->nelts + 7 - oplen; newexp->language_defn = exp->language_defn; memcpy (newexp->elts, exp->elts, EXP_ELEM_TO_BYTES (pc)); - memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen, + memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen, EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen)); newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL; @@ -2772,7 +2798,7 @@ replace_operator_with_call (struct expression** expp, int pc, int nargs, *expp = newexp; xfree (exp); -} +} /* Type-class predicates */ @@ -2780,85 +2806,89 @@ replace_operator_with_call (struct expression** expp, int pc, int nargs, /* FLOAT.) */ static int -numeric_type_p (struct type* type) +numeric_type_p (struct type *type) { if (type == NULL) return 0; - else { - switch (TYPE_CODE (type)) - { - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - return 1; - case TYPE_CODE_RANGE: - return (type == TYPE_TARGET_TYPE (type) - || numeric_type_p (TYPE_TARGET_TYPE (type))); - default: - return 0; - } - } + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_FLT: + return 1; + case TYPE_CODE_RANGE: + return (type == TYPE_TARGET_TYPE (type) + || numeric_type_p (TYPE_TARGET_TYPE (type))); + default: + return 0; + } + } } /* True iff TYPE is integral (an INT or RANGE of INTs). */ static int -integer_type_p (struct type* type) +integer_type_p (struct type *type) { if (type == NULL) return 0; - else { - switch (TYPE_CODE (type)) - { - case TYPE_CODE_INT: - return 1; - case TYPE_CODE_RANGE: - return (type == TYPE_TARGET_TYPE (type) - || integer_type_p (TYPE_TARGET_TYPE (type))); - default: - return 0; - } - } + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + return 1; + case TYPE_CODE_RANGE: + return (type == TYPE_TARGET_TYPE (type) + || integer_type_p (TYPE_TARGET_TYPE (type))); + default: + return 0; + } + } } /* True iff TYPE is scalar (INT, RANGE, FLOAT, ENUM). */ static int -scalar_type_p (struct type* type) +scalar_type_p (struct type *type) { if (type == NULL) return 0; - else { - switch (TYPE_CODE (type)) - { - case TYPE_CODE_INT: - case TYPE_CODE_RANGE: - case TYPE_CODE_ENUM: - case TYPE_CODE_FLT: - return 1; - default: - return 0; - } - } + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_RANGE: + case TYPE_CODE_ENUM: + case TYPE_CODE_FLT: + return 1; + default: + return 0; + } + } } /* True iff TYPE is discrete (INT, RANGE, ENUM). */ static int -discrete_type_p (struct type* type) +discrete_type_p (struct type *type) { if (type == NULL) return 0; - else { - switch (TYPE_CODE (type)) - { - case TYPE_CODE_INT: - case TYPE_CODE_RANGE: - case TYPE_CODE_ENUM: - return 1; - default: - return 0; - } - } + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_RANGE: + case TYPE_CODE_ENUM: + return 1; + default: + return 0; + } + } } /* Returns non-zero if OP with operatands in the vector ARGS could be @@ -2866,12 +2896,12 @@ discrete_type_p (struct type* type) (i.e., result 0). */ static int -possible_user_operator_p (enum exp_opcode op, struct value* args[]) +possible_user_operator_p (enum exp_opcode op, struct value *args[]) { - struct type* type0 = check_typedef (VALUE_TYPE (args[0])); - struct type* type1 = + struct type *type0 = check_typedef (VALUE_TYPE (args[0])); + struct type *type1 = (args[1] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[1])); - + switch (op) { default: @@ -2881,14 +2911,14 @@ possible_user_operator_p (enum exp_opcode op, struct value* args[]) case BINOP_SUB: case BINOP_MUL: case BINOP_DIV: - return (! (numeric_type_p (type0) && numeric_type_p (type1))); + return (!(numeric_type_p (type0) && numeric_type_p (type1))); case BINOP_REM: case BINOP_MOD: case BINOP_BITWISE_AND: case BINOP_BITWISE_IOR: case BINOP_BITWISE_XOR: - return (! (integer_type_p (type0) && integer_type_p (type1))); + return (!(integer_type_p (type0) && integer_type_p (type1))); case BINOP_EQUAL: case BINOP_NOTEQUAL: @@ -2896,26 +2926,25 @@ possible_user_operator_p (enum exp_opcode op, struct value* args[]) case BINOP_GTR: case BINOP_LEQ: case BINOP_GEQ: - return (! (scalar_type_p (type0) && scalar_type_p (type1))); + return (!(scalar_type_p (type0) && scalar_type_p (type1))); case BINOP_CONCAT: - return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY && - (TYPE_CODE (type0) != TYPE_CODE_PTR || - TYPE_CODE (TYPE_TARGET_TYPE (type0)) - != TYPE_CODE_ARRAY)) - || (TYPE_CODE (type1) != TYPE_CODE_ARRAY && - (TYPE_CODE (type1) != TYPE_CODE_PTR || - TYPE_CODE (TYPE_TARGET_TYPE (type1)) - != TYPE_CODE_ARRAY))); + return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY && + (TYPE_CODE (type0) != TYPE_CODE_PTR || + TYPE_CODE (TYPE_TARGET_TYPE (type0)) + != TYPE_CODE_ARRAY)) + || (TYPE_CODE (type1) != TYPE_CODE_ARRAY && + (TYPE_CODE (type1) != TYPE_CODE_PTR || + TYPE_CODE (TYPE_TARGET_TYPE (type1)) != TYPE_CODE_ARRAY))); case BINOP_EXP: - return (! (numeric_type_p (type0) && integer_type_p (type1))); + return (!(numeric_type_p (type0) && integer_type_p (type1))); case UNOP_NEG: case UNOP_PLUS: case UNOP_LOGICAL_NOT: - case UNOP_ABS: - return (! numeric_type_p (type0)); + case UNOP_ABS: + return (!numeric_type_p (type0)); } } @@ -2930,15 +2959,15 @@ possible_user_operator_p (enum exp_opcode op, struct value* args[]) * is XR for an object renaming, XRP for a procedure renaming, XRE for * an exception renaming, and XRS for a subprogram renaming. Returns * NULL if NAME encodes none of these. */ -const char* -ada_renaming_type (struct type* type) +const char * +ada_renaming_type (struct type *type) { if (type != NULL && TYPE_CODE (type) == TYPE_CODE_ENUM) { - const char* name = type_name_no_tag (type); - const char* suffix = (name == NULL) ? NULL : strstr (name, "___XR"); - if (suffix == NULL - || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL)) + const char *name = type_name_no_tag (type); + const char *suffix = (name == NULL) ? NULL : strstr (name, "___XR"); + if (suffix == NULL + || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL)) return NULL; else return suffix + 3; @@ -2949,23 +2978,23 @@ ada_renaming_type (struct type* type) /* Return non-zero iff SYM encodes an object renaming. */ int -ada_is_object_renaming (struct symbol* sym) +ada_is_object_renaming (struct symbol *sym) { - const char* renaming_type = ada_renaming_type (SYMBOL_TYPE (sym)); - return renaming_type != NULL + const char *renaming_type = ada_renaming_type (SYMBOL_TYPE (sym)); + return renaming_type != NULL && (renaming_type[2] == '\0' || renaming_type[2] == '_'); } /* Assuming that SYM encodes a non-object renaming, returns the original * name of the renamed entity. The name is good until the end of * parsing. */ -const char* -ada_simple_renamed_entity (struct symbol* sym) +const char * +ada_simple_renamed_entity (struct symbol *sym) { - struct type* type; - const char* raw_name; + struct type *type; + const char *raw_name; int len; - char* result; + char *result; type = SYMBOL_TYPE (sym); if (type == NULL || TYPE_NFIELDS (type) < 1) @@ -2977,29 +3006,30 @@ ada_simple_renamed_entity (struct symbol* sym) error ("Improperly encoded renaming."); result = xmalloc (len + 1); - /* FIXME: add_name_string_cleanup should be defined in parse.c */ - /* add_name_string_cleanup (result);*/ + /* FIXME: add_name_string_cleanup should be defined in parse.c */ + /* add_name_string_cleanup (result); */ strncpy (result, raw_name, len); result[len] = '\000'; return result; } - + /* Evaluation: Function Calls */ /* Copy VAL onto the stack, using and updating *SP as the stack pointer. Return VAL as an lvalue. */ -static struct value* -place_on_stack (struct value* val, CORE_ADDR* sp) +static struct value * +place_on_stack (struct value *val, CORE_ADDR *sp) { CORE_ADDR old_sp = *sp; #ifdef STACK_ALIGN - *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), - STACK_ALIGN (TYPE_LENGTH (check_typedef (VALUE_TYPE (val))))); + *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), + STACK_ALIGN (TYPE_LENGTH + (check_typedef (VALUE_TYPE (val))))); #else - *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), + *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), TYPE_LENGTH (check_typedef (VALUE_TYPE (val)))); #endif @@ -3015,19 +3045,20 @@ place_on_stack (struct value* val, CORE_ADDR* sp) /* Return the value ACTUAL, converted to be an appropriate value for a formal of type FORMAL_TYPE. Use *SP as a stack pointer for allocating any necessary descriptors (fat pointers), or copies of - values not residing in memory, updating it as needed. */ + values not residing in memory, updating it as needed. */ -static struct value* -convert_actual (struct value* actual, struct type* formal_type0, CORE_ADDR* sp) +static struct value * +convert_actual (struct value *actual, struct type *formal_type0, + CORE_ADDR *sp) { - struct type* actual_type = check_typedef (VALUE_TYPE (actual)); - struct type* formal_type = check_typedef (formal_type0); - struct type* formal_target = - TYPE_CODE (formal_type) == TYPE_CODE_PTR - ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type; - struct type* actual_target = - TYPE_CODE (actual_type) == TYPE_CODE_PTR - ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type; + struct type *actual_type = check_typedef (VALUE_TYPE (actual)); + struct type *formal_type = check_typedef (formal_type0); + struct type *formal_target = + TYPE_CODE (formal_type) == TYPE_CODE_PTR + ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type; + struct type *actual_target = + TYPE_CODE (actual_type) == TYPE_CODE_PTR + ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type; if (ada_is_array_descriptor (formal_target) && TYPE_CODE (actual_target) == TYPE_CODE_ARRAY) @@ -3035,17 +3066,17 @@ convert_actual (struct value* actual, struct type* formal_type0, CORE_ADDR* sp) else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR) { if (TYPE_CODE (formal_target) == TYPE_CODE_ARRAY - && ada_is_array_descriptor (actual_target)) + && ada_is_array_descriptor (actual_target)) return desc_data (actual); else if (TYPE_CODE (actual_type) != TYPE_CODE_PTR) { if (VALUE_LVAL (actual) != lval_memory) { - struct value* val; + struct value *val; actual_type = check_typedef (VALUE_TYPE (actual)); val = allocate_value (actual_type); - memcpy ((char*) VALUE_CONTENTS_RAW (val), - (char*) VALUE_CONTENTS (actual), + memcpy ((char *) VALUE_CONTENTS_RAW (val), + (char *) VALUE_CONTENTS (actual), TYPE_LENGTH (actual_type)); actual = place_on_stack (val, sp); } @@ -3065,30 +3096,30 @@ convert_actual (struct value* actual, struct type* formal_type0, CORE_ADDR* sp) to-descriptor type rather than a descriptor type), a struct value* representing a pointer to this descriptor. */ -static struct value* -make_array_descriptor (struct type* type, struct value* arr, CORE_ADDR* sp) +static struct value * +make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp) { - struct type* bounds_type = desc_bounds_type (type); - struct type* desc_type = desc_base_type (type); - struct value* descriptor = allocate_value (desc_type); - struct value* bounds = allocate_value (bounds_type); + struct type *bounds_type = desc_bounds_type (type); + struct type *desc_type = desc_base_type (type); + struct value *descriptor = allocate_value (desc_type); + struct value *bounds = allocate_value (bounds_type); CORE_ADDR bounds_addr; int i; - + for (i = ada_array_arity (check_typedef (VALUE_TYPE (arr))); i > 0; i -= 1) { modify_general_field (VALUE_CONTENTS (bounds), - value_as_long (ada_array_bound (arr, i, 0)), + value_as_long (ada_array_bound (arr, i, 0)), desc_bound_bitpos (bounds_type, i, 0), desc_bound_bitsize (bounds_type, i, 0)); modify_general_field (VALUE_CONTENTS (bounds), - value_as_long (ada_array_bound (arr, i, 1)), + value_as_long (ada_array_bound (arr, i, 1)), desc_bound_bitpos (bounds_type, i, 1), desc_bound_bitsize (bounds_type, i, 1)); } - + bounds = place_on_stack (bounds, sp); - + modify_general_field (VALUE_CONTENTS (descriptor), arr, fat_pntr_data_bitpos (desc_type), @@ -3116,22 +3147,21 @@ make_array_descriptor (struct type* type, struct value* arr, CORE_ADDR* sp) value as needed. */ void -ada_convert_actuals (struct value* func, int nargs, struct value* args[], CORE_ADDR* sp) +ada_convert_actuals (struct value *func, int nargs, struct value *args[], + CORE_ADDR *sp) { int i; - if (TYPE_NFIELDS (VALUE_TYPE (func)) == 0 + if (TYPE_NFIELDS (VALUE_TYPE (func)) == 0 || nargs != TYPE_NFIELDS (VALUE_TYPE (func))) return; for (i = 0; i < nargs; i += 1) - args[i] = - convert_actual (args[i], - TYPE_FIELD_TYPE (VALUE_TYPE (func), i), - sp); + args[i] = + convert_actual (args[i], TYPE_FIELD_TYPE (VALUE_TYPE (func), i), sp); } - + /* Symbol Lookup */ @@ -3139,32 +3169,32 @@ ada_convert_actuals (struct value* func, int nargs, struct value* args[], CORE_A /* ada_lookup_symbol_list. */ /* Current size of defn_symbols and defn_blocks */ -static size_t defn_vector_size = 0; +static size_t defn_vector_size = 0; /* Current number of symbols found. */ static int ndefns = 0; -static struct symbol** defn_symbols = NULL; -static struct block** defn_blocks = NULL; +static struct symbol **defn_symbols = NULL; +static struct block **defn_blocks = NULL; /* Return the result of a standard (literal, C-like) lookup of NAME in * given NAMESPACE. */ -static struct symbol* -standard_lookup (const char* name, namespace_enum namespace) +static struct symbol * +standard_lookup (const char *name, namespace_enum namespace) { - struct symbol* sym; - struct symtab* symtab; - sym = lookup_symbol (name, (struct block*) NULL, namespace, 0, &symtab); + struct symbol *sym; + struct symtab *symtab; + sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, &symtab); return sym; } - + /* Non-zero iff there is at least one non-function/non-enumeral symbol */ /* in SYMS[0..N-1]. We treat enumerals as functions, since they */ -/* contend in overloading in the same way. */ +/* contend in overloading in the same way. */ static int -is_nonfunction (struct symbol* syms[], int n) +is_nonfunction (struct symbol *syms[], int n) { int i; @@ -3180,19 +3210,19 @@ is_nonfunction (struct symbol* syms[], int n) struct types. Otherwise, they may not. */ static int -equiv_types (struct type* type0, struct type* type1) +equiv_types (struct type *type0, struct type *type1) { - if (type0 == type1) + if (type0 == type1) return 1; - if (type0 == NULL || type1 == NULL + if (type0 == NULL || type1 == NULL || TYPE_CODE (type0) != TYPE_CODE (type1)) return 0; - if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT + if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT || TYPE_CODE (type0) == TYPE_CODE_ENUM) && ada_type_name (type0) != NULL && ada_type_name (type1) != NULL && STREQ (ada_type_name (type0), ada_type_name (type1))) return 1; - + return 0; } @@ -3200,7 +3230,7 @@ equiv_types (struct type* type0, struct type* type1) no more defined than that of SYM1. */ static int -lesseq_defined_than (struct symbol* sym0, struct symbol* sym1) +lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { if (sym0 == sym1) return 1; @@ -3208,18 +3238,18 @@ lesseq_defined_than (struct symbol* sym0, struct symbol* sym1) || SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1)) return 0; - switch (SYMBOL_CLASS (sym0)) + switch (SYMBOL_CLASS (sym0)) { case LOC_UNDEF: return 1; case LOC_TYPEDEF: { - struct type* type0 = SYMBOL_TYPE (sym0); - struct type* type1 = SYMBOL_TYPE (sym1); - char* name0 = SYMBOL_NAME (sym0); - char* name1 = SYMBOL_NAME (sym1); + struct type *type0 = SYMBOL_TYPE (sym0); + struct type *type1 = SYMBOL_TYPE (sym1); + char *name0 = SYMBOL_NAME (sym0); + char *name1 = SYMBOL_NAME (sym1); int len0 = strlen (name0); - return + return TYPE_CODE (type0) == TYPE_CODE (type1) && (equiv_types (type0, type1) || (len0 < strlen (name1) && STREQN (name0, name1, len0) @@ -3228,8 +3258,8 @@ lesseq_defined_than (struct symbol* sym0, struct symbol* sym1) case LOC_CONST: return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1) && equiv_types (SYMBOL_TYPE (sym0), SYMBOL_TYPE (sym1)); - default: - return 0; + default: + return 0; } } @@ -3238,12 +3268,12 @@ lesseq_defined_than (struct symbol* sym0, struct symbol* sym1) defn_blocks as needed. Do not include SYM if it is a duplicate. */ static void -add_defn_to_vec (struct symbol* sym, struct block* block) +add_defn_to_vec (struct symbol *sym, struct block *block) { int i; size_t tmp; - if (SYMBOL_TYPE (sym) != NULL) + if (SYMBOL_TYPE (sym) != NULL) CHECK_TYPEDEF (SYMBOL_TYPE (sym)); for (i = 0; i < ndefns; i += 1) { @@ -3258,8 +3288,8 @@ add_defn_to_vec (struct symbol* sym, struct block* block) } tmp = defn_vector_size; - GROW_VECT (defn_symbols, tmp, ndefns+2); - GROW_VECT (defn_blocks, defn_vector_size, ndefns+2); + GROW_VECT (defn_symbols, tmp, ndefns + 2); + GROW_VECT (defn_blocks, defn_vector_size, ndefns + 2); defn_symbols[ndefns] = sym; defn_blocks[ndefns] = block; @@ -3271,7 +3301,8 @@ add_defn_to_vec (struct symbol* sym, struct block* block) wild-card match if WILD. */ static struct partial_symbol * -ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global, namespace_enumnamespace, int wild) +ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, + int global, namespace_enum namespace, int wild) { struct partial_symbol **start; int name_len = strlen (name); @@ -3282,16 +3313,16 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int glo { return (NULL); } - + start = (global ? pst->objfile->global_psymbols.list + pst->globals_offset : - pst->objfile->static_psymbols.list + pst->statics_offset ); + pst->objfile->static_psymbols.list + pst->statics_offset); if (wild) { for (i = 0; i < length; i += 1) { - struct partial_symbol* psym = start[i]; + struct partial_symbol *psym = start[i]; if (SYMBOL_NAMESPACE (psym) == namespace && wild_match (name, name_len, SYMBOL_NAME (psym))) @@ -3299,22 +3330,23 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int glo } return NULL; } - else + else { if (global) { int U; - i = 0; U = length-1; - while (U - i > 4) + i = 0; + U = length - 1; + while (U - i > 4) { - int M = (U+i) >> 1; - struct partial_symbol* psym = start[M]; + int M = (U + i) >> 1; + struct partial_symbol *psym = start[M]; if (SYMBOL_NAME (psym)[0] < name[0]) - i = M+1; + i = M + 1; else if (SYMBOL_NAME (psym)[0] > name[0]) - U = M-1; + U = M - 1; else if (strcmp (SYMBOL_NAME (psym), name) < 0) - i = M+1; + i = M + 1; else U = M; } @@ -3329,14 +3361,14 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int glo if (SYMBOL_NAMESPACE (psym) == namespace) { int cmp = strncmp (name, SYMBOL_NAME (psym), name_len); - - if (cmp < 0) + + if (cmp < 0) { if (global) break; } - else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len)) + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (psym) + name_len)) return psym; } i += 1; @@ -3345,17 +3377,18 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int glo if (global) { int U; - i = 0; U = length-1; - while (U - i > 4) + i = 0; + U = length - 1; + while (U - i > 4) { - int M = (U+i) >> 1; + int M = (U + i) >> 1; struct partial_symbol *psym = start[M]; if (SYMBOL_NAME (psym)[0] < '_') - i = M+1; + i = M + 1; else if (SYMBOL_NAME (psym)[0] > '_') - U = M-1; + U = M - 1; else if (strcmp (SYMBOL_NAME (psym), "_ada_") < 0) - i = M+1; + i = M + 1; else U = M; } @@ -3365,114 +3398,111 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int glo while (i < length) { - struct partial_symbol* psym = start[i]; + struct partial_symbol *psym = start[i]; if (SYMBOL_NAMESPACE (psym) == namespace) { int cmp; cmp = (int) '_' - (int) SYMBOL_NAME (psym)[0]; - if (cmp == 0) + if (cmp == 0) { cmp = strncmp ("_ada_", SYMBOL_NAME (psym), 5); if (cmp == 0) cmp = strncmp (name, SYMBOL_NAME (psym) + 5, name_len); } - - if (cmp < 0) + + if (cmp < 0) { if (global) break; } - else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5)) + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5)) return psym; } i += 1; } - + } return NULL; } /* Find a symbol table containing symbol SYM or NULL if none. */ -static struct symtab* -symtab_for_sym (struct symbol* sym) +static struct symtab * +symtab_for_sym (struct symbol *sym) { - struct symtab* s; + struct symtab *s; struct objfile *objfile; struct block *b; struct symbol *tmp_sym; int i, j; ALL_SYMTABS (objfile, s) - { - switch (SYMBOL_CLASS (sym)) - { - case LOC_CONST: - case LOC_STATIC: - case LOC_TYPEDEF: - case LOC_REGISTER: - case LOC_LABEL: - case LOC_BLOCK: - case LOC_CONST_BYTES: - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); - ALL_BLOCK_SYMBOLS (b, i, tmp_sym) - if (sym == tmp_sym) - return s; - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); - ALL_BLOCK_SYMBOLS (b, i, tmp_sym) - if (sym == tmp_sym) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_CONST: + case LOC_STATIC: + case LOC_TYPEDEF: + case LOC_REGISTER: + case LOC_LABEL: + case LOC_BLOCK: + case LOC_CONST_BYTES: + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) + return s; + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) + return s; + break; + default: + break; + } + switch (SYMBOL_CLASS (sym)) + { + case LOC_REGISTER: + case LOC_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_LOCAL: + case LOC_TYPEDEF: + case LOC_LOCAL_ARG: + case LOC_BASEREG: + case LOC_BASEREG_ARG: + for (j = FIRST_LOCAL_BLOCK; + j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) + { + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) return s; - break; - default: - break; - } - switch (SYMBOL_CLASS (sym)) - { - case LOC_REGISTER: - case LOC_ARG: - case LOC_REF_ARG: - case LOC_REGPARM: - case LOC_REGPARM_ADDR: - case LOC_LOCAL: - case LOC_TYPEDEF: - case LOC_LOCAL_ARG: - case LOC_BASEREG: - case LOC_BASEREG_ARG: - for (j = FIRST_LOCAL_BLOCK; - j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) - { - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j); - ALL_BLOCK_SYMBOLS (b, i, tmp_sym) - if (sym == tmp_sym) - return s; - } - break; - default: - break; - } - } + } + break; + default: + break; + } + } return NULL; } /* Return a minimal symbol matching NAME according to Ada demangling rules. Returns NULL if there is no such minimal symbol. */ -struct minimal_symbol* -ada_lookup_minimal_symbol (const char* name) +struct minimal_symbol * +ada_lookup_minimal_symbol (const char *name) { - struct objfile* objfile; - struct minimal_symbol* msymbol; + struct objfile *objfile; + struct minimal_symbol *msymbol; int wild_match = (strstr (name, "__") == NULL); ALL_MSYMBOLS (objfile, msymbol) - { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match) - && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) - return msymbol; - } + { + if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match) + && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) + return msymbol; + } return NULL; } @@ -3487,15 +3517,16 @@ ada_lookup_minimal_symbol (const char* name) * frame as a static link, and then searches up the call stack for a * frame with that same local-variable base. */ static void -add_symbols_from_enclosing_procs (const char* name, namespace_enum namespace, int wild_match) +add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, + int wild_match) { #ifdef i386 static struct symbol static_link_sym; static struct symbol *static_link; - struct cleanup* old_chain = make_cleanup (null_cleanup, NULL); - struct frame_info* frame; - struct frame_info* target_frame; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct frame_info *frame; + struct frame_info *target_frame; if (static_link == NULL) { @@ -3507,15 +3538,15 @@ add_symbols_from_enclosing_procs (const char* name, namespace_enum namespace, in SYMBOL_CLASS (static_link) = LOC_LOCAL; SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE; SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void); - SYMBOL_VALUE (static_link) = - - (long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); + SYMBOL_VALUE (static_link) = + -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); } frame = selected_frame; while (frame != NULL && ndefns == 0) { - struct block* block; - struct value* target_link_val = read_var_value (static_link, frame); + struct block *block; + struct value *target_link_val = read_var_value (static_link, frame); CORE_ADDR target_link; if (target_link_val == NULL) @@ -3523,10 +3554,12 @@ add_symbols_from_enclosing_procs (const char* name, namespace_enum namespace, in QUIT; target_link = target_link_val; - do { + do + { QUIT; frame = get_prev_frame (frame); - } while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link); + } + while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link); if (frame == NULL) break; @@ -3535,7 +3568,7 @@ add_symbols_from_enclosing_procs (const char* name, namespace_enum namespace, in while (block != NULL && block_function (block) != NULL && ndefns == 0) { ada_add_block_symbols (block, name, namespace, NULL, wild_match); - + block = BLOCK_SUPERBLOCK (block); } } @@ -3547,9 +3580,9 @@ add_symbols_from_enclosing_procs (const char* name, namespace_enum namespace, in /* True if TYPE is definitely an artificial type supplied to a symbol * for which no debugging information was given in the symbol file. */ static int -is_nondebugging_type (struct type* type) +is_nondebugging_type (struct type *type) { - char* name = ada_type_name (type); + char *name = ada_type_name (type); return (name != NULL && STREQ (name, "")); } @@ -3562,30 +3595,31 @@ is_nondebugging_type (struct type* type) * correspondence between SYMS[i] and BLOCKS[i]. Returns the number * of symbols in the modified list. */ static int -remove_extra_symbols (struct symbol** syms, struct block** blocks, int nsyms) +remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) { int i, j; i = 0; while (i < nsyms) { - if (SYMBOL_NAME (syms[i]) != NULL && SYMBOL_CLASS (syms[i]) == LOC_STATIC + if (SYMBOL_NAME (syms[i]) != NULL + && SYMBOL_CLASS (syms[i]) == LOC_STATIC && is_nondebugging_type (SYMBOL_TYPE (syms[i]))) { for (j = 0; j < nsyms; j += 1) { - if (i != j + if (i != j && SYMBOL_NAME (syms[j]) != NULL && STREQ (SYMBOL_NAME (syms[i]), SYMBOL_NAME (syms[j])) && SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j]) - && SYMBOL_VALUE_ADDRESS (syms[i]) + && SYMBOL_VALUE_ADDRESS (syms[i]) == SYMBOL_VALUE_ADDRESS (syms[j])) { int k; - for (k = i+1; k < nsyms; k += 1) + for (k = i + 1; k < nsyms; k += 1) { - syms[k-1] = syms[k]; - blocks[k-1] = blocks[k]; + syms[k - 1] = syms[k]; + blocks[k - 1] = blocks[k]; } nsyms -= 1; goto NextSymbol; @@ -3612,8 +3646,8 @@ remove_extra_symbols (struct symbol** syms, struct block** blocks, int nsyms) int ada_lookup_symbol_list (const char *name, struct block *block0, - namespace_enum namespace, struct symbol*** syms, - struct block*** blocks) + namespace_enum namespace, struct symbol ***syms, + struct block ***blocks) { struct symbol *sym; struct symtab *s; @@ -3651,117 +3685,117 @@ ada_lookup_symbol_list (const char *name, struct block *block0, if (ndefns > 0) goto done; - + cacheIfUnique = 1; /* Now add symbols from all global blocks: symbol tables, minimal symbol tables, and psymtab's */ ALL_SYMTABS (objfile, s) - { - QUIT; - if (! s->primary) - continue; - bv = BLOCKVECTOR (s); - block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); - } + { + QUIT; + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } if (namespace == VAR_NAMESPACE) { ALL_MSYMBOLS (objfile, msymbol) - { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)) - { - switch (MSYMBOL_TYPE (msymbol)) - { - case mst_solib_trampoline: - break; - default: - s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)); - if (s != NULL) - { - int old_ndefns = ndefns; - QUIT; - bv = BLOCKVECTOR (s); - block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), - namespace, objfile, wild_match); - if (ndefns == old_ndefns) - { - block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), - namespace, objfile, - wild_match); - } - } - } - } - } + { + if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)) + { + switch (MSYMBOL_TYPE (msymbol)) + { + case mst_solib_trampoline: + break; + default: + s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)); + if (s != NULL) + { + int old_ndefns = ndefns; + QUIT; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, + SYMBOL_NAME (msymbol), + namespace, objfile, wild_match); + if (ndefns == old_ndefns) + { + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, + SYMBOL_NAME (msymbol), + namespace, objfile, + wild_match); + } + } + } + } + } } - + ALL_PSYMTABS (objfile, ps) - { - QUIT; - if (!ps->readin - && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match)) - { - s = PSYMTAB_TO_SYMTAB (ps); - if (! s->primary) - continue; - bv = BLOCKVECTOR (s); - block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); - } - } - + { + QUIT; + if (!ps->readin + && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match)) + { + s = PSYMTAB_TO_SYMTAB (ps); + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } + } + /* Now add symbols from all per-file blocks if we've gotten no hits. (Not strictly correct, but perhaps better than an error). Do the symtabs first, then check the psymtabs */ - + if (ndefns == 0) { ALL_SYMTABS (objfile, s) - { - QUIT; - if (! s->primary) - continue; - bv = BLOCKVECTOR (s); - block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); - } - + { + QUIT; + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } + ALL_PSYMTABS (objfile, ps) - { - QUIT; - if (!ps->readin - && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match)) - { - s = PSYMTAB_TO_SYMTAB(ps); - bv = BLOCKVECTOR (s); - if (! s->primary) - continue; - block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - ada_add_block_symbols (block, name, namespace, - objfile, wild_match); - } - } - } + { + QUIT; + if (!ps->readin + && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match)) + { + s = PSYMTAB_TO_SYMTAB (ps); + bv = BLOCKVECTOR (s); + if (!s->primary) + continue; + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, name, namespace, + objfile, wild_match); + } + } + } /* Finally, we try to find NAME as a local symbol in some lexically enclosing block. We do this last, expecting this case to be rare. */ - if (ndefns == 0) + if (ndefns == 0) { add_symbols_from_enclosing_procs (name, namespace, wild_match); if (ndefns > 0) goto done; } - done: +done: ndefns = remove_extra_symbols (defn_symbols, defn_blocks, ndefns); @@ -3779,11 +3813,12 @@ ada_lookup_symbol_list (const char *name, struct block *block0, * Otherwise, the result is as for ada_lookup_symbol_list, but is * disambiguated by user query if needed. */ -struct symbol* -ada_lookup_symbol (const char *name, struct block *block0, namespace_enum namespace) +struct symbol * +ada_lookup_symbol (const char *name, struct block *block0, + namespace_enum namespace) { - struct symbol** candidate_syms; - struct block** candidate_blocks; + struct symbol **candidate_syms; + struct block **candidate_blocks; int n_candidates; n_candidates = ada_lookup_symbol_list (name, @@ -3807,28 +3842,28 @@ ada_lookup_symbol (const char *name, struct block *block0, namespace_enum namesp * */ static int -is_name_suffix (const char* str) +is_name_suffix (const char *str) { int k; if (str[0] == 'X') { str += 1; - while (str[0] != '_' && str[0] != '\0') + while (str[0] != '_' && str[0] != '\0') { if (str[0] != 'n' && str[0] != 'b') return 0; str += 1; - } + } } if (str[0] == '\000') return 1; - if (str[0] == '_') + if (str[0] == '_') { if (str[1] != '_' || str[2] == '\000') return 0; - if (str[2] == '_') + if (str[2] == '_') { - if (STREQ (str+3, "LJM")) + if (STREQ (str + 3, "LJM")) return 1; if (str[3] != 'X') return 0; @@ -3853,45 +3888,49 @@ is_name_suffix (const char* str) } return 0; } - + /* True if NAME represents a name of the form A1.A2....An, n>=1 and * PATN[0..PATN_LEN-1] = Ak.Ak+1.....An for some k >= 1. Ignores * informational suffixes of NAME (i.e., for which is_name_suffix is - * true). */ + * true). */ static int -wild_match (const char* patn, int patn_len, const char* name) +wild_match (const char *patn, int patn_len, const char *name) { int name_len; int s, e; name_len = strlen (name); - if (name_len >= patn_len+5 && STREQN (name, "_ada_", 5) - && STREQN (patn, name+5, patn_len) - && is_name_suffix (name+patn_len+5)) + if (name_len >= patn_len + 5 && STREQN (name, "_ada_", 5) + && STREQN (patn, name + 5, patn_len) + && is_name_suffix (name + patn_len + 5)) return 1; - while (name_len >= patn_len) + while (name_len >= patn_len) { - if (STREQN (patn, name, patn_len) - && is_name_suffix (name+patn_len)) + if (STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len)) return 1; - do { - name += 1; name_len -= 1; - } while (name_len > 0 - && name[0] != '.' && (name[0] != '_' || name[1] != '_')); + do + { + name += 1; + name_len -= 1; + } + while (name_len > 0 + && name[0] != '.' && (name[0] != '_' || name[1] != '_')); if (name_len <= 0) return 0; if (name[0] == '_') { - if (! islower (name[2])) + if (!islower (name[2])) return 0; - name += 2; name_len -= 2; + name += 2; + name_len -= 2; } else { - if (! islower (name[1])) + if (!islower (name[1])) return 0; - name += 1; name_len -= 1; + name += 1; + name_len -= 1; } } @@ -3905,9 +3944,9 @@ wild_match (const char* patn, int patn_len, const char* name) currently stored in *defn_symbols). If WILD, treat as NAME with a wildcard prefix. OBJFILE is the section containing BLOCK. */ -static void -ada_add_block_symbols (struct block* block, const char* name, - namespace_enum namespace, struct objfile* objfile, +static void +ada_add_block_symbols (struct block *block, const char *name, + namespace_enum namespace, struct objfile *objfile, int wild) { int i; @@ -3919,52 +3958,54 @@ ada_add_block_symbols (struct block* block, const char* name, int is_sorted = BLOCK_SHOULD_SORT (block); struct symbol *sym; - arg_sym = NULL; found_sym = 0; + arg_sym = NULL; + found_sym = 0; if (wild) { struct symbol *sym; ALL_BLOCK_SYMBOLS (block, i, sym) - { - if (SYMBOL_NAMESPACE (sym) == namespace && - wild_match (name, name_len, SYMBOL_NAME (sym))) - { - switch (SYMBOL_CLASS (sym)) - { - case LOC_ARG: - case LOC_LOCAL_ARG: - case LOC_REF_ARG: - case LOC_REGPARM: - case LOC_REGPARM_ADDR: - case LOC_BASEREG_ARG: - arg_sym = sym; - break; - case LOC_UNRESOLVED: - continue; - default: - found_sym = 1; - fill_in_ada_prototype (sym); - add_defn_to_vec (fixup_symbol_section (sym, objfile), block); - break; - } - } - } + { + if (SYMBOL_NAMESPACE (sym) == namespace && + wild_match (name, name_len, SYMBOL_NAME (sym))) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_ARG: + case LOC_LOCAL_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + arg_sym = sym; + break; + case LOC_UNRESOLVED: + continue; + default: + found_sym = 1; + fill_in_ada_prototype (sym); + add_defn_to_vec (fixup_symbol_section (sym, objfile), block); + break; + } + } + } } - else + else { if (is_sorted) { int U; - i = 0; U = BLOCK_NSYMS (block)-1; - while (U - i > 4) + i = 0; + U = BLOCK_NSYMS (block) - 1; + while (U - i > 4) { - int M = (U+i) >> 1; + int M = (U + i) >> 1; struct symbol *sym = BLOCK_SYM (block, M); if (SYMBOL_NAME (sym)[0] < name[0]) - i = M+1; + i = M + 1; else if (SYMBOL_NAME (sym)[0] > name[0]) - U = M-1; + U = M - 1; else if (strcmp (SYMBOL_NAME (sym), name) < 0) - i = M+1; + i = M + 1; else U = M; } @@ -3979,7 +4020,7 @@ ada_add_block_symbols (struct block* block, const char* name, { int cmp = strncmp (name, SYMBOL_NAME (sym), name_len); - if (cmp < 0) + if (cmp < 0) { if (is_sorted) { @@ -3987,8 +4028,8 @@ ada_add_block_symbols (struct block* block, const char* name, break; } } - else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len)) + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (sym) + name_len)) { switch (SYMBOL_CLASS (sym)) { @@ -4014,29 +4055,31 @@ ada_add_block_symbols (struct block* block, const char* name, } } - if (! found_sym && arg_sym != NULL) + if (!found_sym && arg_sym != NULL) { fill_in_ada_prototype (arg_sym); add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block); } - if (! wild) + if (!wild) { - arg_sym = NULL; found_sym = 0; + arg_sym = NULL; + found_sym = 0; if (is_sorted) { int U; - i = 0; U = BLOCK_NSYMS (block)-1; - while (U - i > 4) + i = 0; + U = BLOCK_NSYMS (block) - 1; + while (U - i > 4) { - int M = (U+i) >> 1; + int M = (U + i) >> 1; struct symbol *sym = BLOCK_SYM (block, M); if (SYMBOL_NAME (sym)[0] < '_') - i = M+1; + i = M + 1; else if (SYMBOL_NAME (sym)[0] > '_') - U = M-1; + U = M - 1; else if (strcmp (SYMBOL_NAME (sym), "_ada_") < 0) - i = M+1; + i = M + 1; else U = M; } @@ -4054,14 +4097,14 @@ ada_add_block_symbols (struct block* block, const char* name, int cmp; cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0]; - if (cmp == 0) + if (cmp == 0) { cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5); if (cmp == 0) cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len); } - if (cmp < 0) + if (cmp < 0) { if (is_sorted) { @@ -4069,8 +4112,8 @@ ada_add_block_symbols (struct block* block, const char* name, break; } } - else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5)) + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5)) { switch (SYMBOL_CLASS (sym)) { @@ -4094,31 +4137,31 @@ ada_add_block_symbols (struct block* block, const char* name, } } } - + /* NOTE: This really shouldn't be needed for _ada_ symbols. - They aren't parameters, right? */ - if (! found_sym && arg_sym != NULL) + They aren't parameters, right? */ + if (!found_sym && arg_sym != NULL) { fill_in_ada_prototype (arg_sym); add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block); } } } - + /* Function Types */ /* Assuming that SYM is the symbol for a function, fill in its type with prototype information, if it is not already there. */ static void -fill_in_ada_prototype (struct symbol* func) +fill_in_ada_prototype (struct symbol *func) { - struct block* b; + struct block *b; int nargs, nsyms; int i; - struct type* ftype; - struct type* rtype; + struct type *ftype; + struct type *rtype; size_t max_fields; struct symbol *sym; @@ -4139,42 +4182,42 @@ fill_in_ada_prototype (struct symbol* func) b = SYMBOL_BLOCK_VALUE (func); nargs = 0; - max_fields = 8; - TYPE_FIELDS (ftype) = - (struct field*) xmalloc (sizeof (struct field) * max_fields); + max_fields = 8; + TYPE_FIELDS (ftype) = + (struct field *) xmalloc (sizeof (struct field) * max_fields); ALL_BLOCK_SYMBOLS (b, i, sym) - { - GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs+1); - - switch (SYMBOL_CLASS (sym)) - { - case LOC_REF_ARG: - case LOC_REGPARM_ADDR: - TYPE_FIELD_BITPOS (ftype, nargs) = nargs; - TYPE_FIELD_BITSIZE (ftype, nargs) = 0; - TYPE_FIELD_TYPE (ftype, nargs) = - lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym))); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); - nargs += 1; - - break; + { + GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs + 1); - case LOC_ARG: - case LOC_REGPARM: - case LOC_LOCAL_ARG: - case LOC_BASEREG_ARG: - TYPE_FIELD_BITPOS (ftype, nargs) = nargs; - TYPE_FIELD_BITSIZE (ftype, nargs) = 0; - TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym)); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); - nargs += 1; - - break; + switch (SYMBOL_CLASS (sym)) + { + case LOC_REF_ARG: + case LOC_REGPARM_ADDR: + TYPE_FIELD_BITPOS (ftype, nargs) = nargs; + TYPE_FIELD_BITSIZE (ftype, nargs) = 0; + TYPE_FIELD_TYPE (ftype, nargs) = + lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym))); + TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + nargs += 1; - default: - break; - } - } + break; + + case LOC_ARG: + case LOC_REGPARM: + case LOC_LOCAL_ARG: + case LOC_BASEREG_ARG: + TYPE_FIELD_BITPOS (ftype, nargs) = nargs; + TYPE_FIELD_BITSIZE (ftype, nargs) = 0; + TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym)); + TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + nargs += 1; + + break; + + default: + break; + } + } /* Re-allocate fields vector; if there are no fields, make the */ /* fields pointer non-null anyway, to mark that this function type */ @@ -4183,37 +4226,37 @@ fill_in_ada_prototype (struct symbol* func) TYPE_NFIELDS (ftype) = nargs; if (nargs == 0) { - static struct field dummy_field = {0, 0, 0, 0}; + static struct field dummy_field = { 0, 0, 0, 0 }; xfree (TYPE_FIELDS (ftype)); TYPE_FIELDS (ftype) = &dummy_field; } else { - struct field* fields = - (struct field*) TYPE_ALLOC (ftype, nargs * sizeof (struct field)); - memcpy ((char*) fields, - (char*) TYPE_FIELDS (ftype), - nargs * sizeof (struct field)); + struct field *fields = + (struct field *) TYPE_ALLOC (ftype, nargs * sizeof (struct field)); + memcpy ((char *) fields, + (char *) TYPE_FIELDS (ftype), nargs * sizeof (struct field)); xfree (TYPE_FIELDS (ftype)); TYPE_FIELDS (ftype) = fields; } } - + /* Breakpoint-related */ -char no_symtab_msg[] = "No symbol table is loaded. Use the \"file\" command."; +char no_symtab_msg[] = + "No symbol table is loaded. Use the \"file\" command."; /* Assuming that LINE is pointing at the beginning of an argument to 'break', return a pointer to the delimiter for the initial segment of that name. This is the first ':', ' ', or end of LINE. */ -char* -ada_start_decode_line_1 (char* line) +char * +ada_start_decode_line_1 (char *line) { /* [NOTE: strpbrk would be more elegant, but I am reluctant to be the first to use such a library function in GDB code.] */ - char* p; + char *p; for (p = line; *p != '\000' && *p != ' ' && *p != ':'; p += 1) ; return p; @@ -4263,20 +4306,20 @@ ada_start_decode_line_1 (char* line) is the caller's responsibility to free them. */ struct symtabs_and_lines -ada_finish_decode_line_1 (char** spec, struct symtab* file_table, - int funfirstline, char*** canonical) +ada_finish_decode_line_1 (char **spec, struct symtab *file_table, + int funfirstline, char ***canonical) { - struct symbol** symbols; - struct block** blocks; - struct block* block; + struct symbol **symbols; + struct block **blocks; + struct block *block; int n_matches, i, line_num; struct symtabs_and_lines selected; - struct cleanup* old_chain = make_cleanup (null_cleanup, NULL); - char* name; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + char *name; int len; - char* lower_name; - char* unquoted_name; + char *lower_name; + char *unquoted_name; if (file_table == NULL) block = get_selected_block (NULL); @@ -4284,15 +4327,15 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_table), STATIC_BLOCK); if (canonical != NULL) - *canonical = (char**) NULL; + *canonical = (char **) NULL; name = *spec; - if (**spec == '*') + if (**spec == '*') *spec += 1; else { - while (**spec != '\000' && - ! strchr (ada_completer_word_break_characters, **spec)) + while (**spec != '\000' && + !strchr (ada_completer_word_break_characters, **spec)) *spec += 1; } len = *spec - name; @@ -4301,11 +4344,11 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, if (file_table != NULL && (*spec)[0] == ':' && isdigit ((*spec)[1])) { line_num = strtol (*spec + 1, spec, 10); - while (**spec == ' ' || **spec == '\t') + while (**spec == ' ' || **spec == '\t') *spec += 1; } - if (name[0] == '*') + if (name[0] == '*') { if (line_num == -1) error ("Wild-card function with no line number or file name."); @@ -4321,28 +4364,28 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, if (name[0] == '<') { - unquoted_name = (char*) alloca (len-1); - memcpy (unquoted_name, name+1, len-2); - unquoted_name[len-2] = '\000'; + unquoted_name = (char *) alloca (len - 1); + memcpy (unquoted_name, name + 1, len - 2); + unquoted_name[len - 2] = '\000'; lower_name = NULL; } else { - unquoted_name = (char*) alloca (len+1); + unquoted_name = (char *) alloca (len + 1); memcpy (unquoted_name, name, len); unquoted_name[len] = '\000'; - lower_name = (char*) alloca (len + 1); + lower_name = (char *) alloca (len + 1); for (i = 0; i < len; i += 1) lower_name[i] = tolower (name[i]); lower_name[len] = '\000'; } n_matches = 0; - if (lower_name != NULL) - n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block, + if (lower_name != NULL) + n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block, VAR_NAMESPACE, &symbols, &blocks); if (n_matches == 0) - n_matches = ada_lookup_symbol_list (unquoted_name, block, + n_matches = ada_lookup_symbol_list (unquoted_name, block, VAR_NAMESPACE, &symbols, &blocks); if (n_matches == 0 && line_num >= 0) error ("No line number information found for %s.", unquoted_name); @@ -4352,22 +4395,22 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, /* FIXME: See comment in symtab.c::decode_line_1 */ #undef volatile volatile struct symtab_and_line val; -#define volatile /*nothing*/ +#define volatile /*nothing */ #else struct symtab_and_line val; #endif - struct minimal_symbol* msymbol; + struct minimal_symbol *msymbol; INIT_SAL (&val); msymbol = NULL; - if (lower_name != NULL) + if (lower_name != NULL) msymbol = ada_lookup_minimal_symbol (ada_mangle (lower_name)); if (msymbol == NULL) msymbol = ada_lookup_minimal_symbol (unquoted_name); if (msymbol != NULL) { - val.pc = SYMBOL_VALUE_ADDRESS (msymbol); + val.pc = SYMBOL_VALUE_ADDRESS (msymbol); val.section = SYMBOL_BFD_SECTION (msymbol); if (funfirstline) { @@ -4379,28 +4422,29 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, selected.sals[0] = val; selected.nelts = 1; return selected; - } - + } + if (!have_full_symbols () && !have_partial_symbols () && !have_minimal_symbols ()) error (no_symtab_msg); error ("Function \"%s\" not defined.", unquoted_name); - return selected; /* for lint */ + return selected; /* for lint */ } if (line_num >= 0) { - return - find_sal_from_funcs_and_line (file_table->filename, line_num, + return + find_sal_from_funcs_and_line (file_table->filename, line_num, symbols, n_matches); } else { - selected.nelts = user_select_syms (symbols, blocks, n_matches, n_matches); + selected.nelts = + user_select_syms (symbols, blocks, n_matches, n_matches); } - selected.sals = (struct symtab_and_line*) + selected.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line) * selected.nelts); memset (selected.sals, 0, selected.nelts * sizeof (selected.sals[i])); make_cleanup (xfree, selected.sals); @@ -4408,9 +4452,9 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, i = 0; while (i < selected.nelts) { - if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK) + if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK) selected.sals[i] = find_function_start_sal (symbols[i], funfirstline); - else if (SYMBOL_LINE (symbols[i]) != 0) + else if (SYMBOL_LINE (symbols[i]) != 0) { selected.sals[i].symtab = symtab_for_sym (symbols[i]); selected.sals[i].line = SYMBOL_LINE (symbols[i]); @@ -4418,87 +4462,89 @@ ada_finish_decode_line_1 (char** spec, struct symtab* file_table, else if (line_num >= 0) { /* Ignore this choice */ - symbols[i] = symbols[selected.nelts-1]; - blocks[i] = blocks[selected.nelts-1]; + symbols[i] = symbols[selected.nelts - 1]; + blocks[i] = blocks[selected.nelts - 1]; selected.nelts -= 1; continue; } - else + else error ("Line number not known for symbol \"%s\"", unquoted_name); i += 1; } if (canonical != NULL && (line_num >= 0 || n_matches > 1)) { - *canonical = (char**) xmalloc (sizeof(char*) * selected.nelts); + *canonical = (char **) xmalloc (sizeof (char *) * selected.nelts); for (i = 0; i < selected.nelts; i += 1) - (*canonical)[i] = - extended_canonical_line_spec (selected.sals[i], + (*canonical)[i] = + extended_canonical_line_spec (selected.sals[i], SYMBOL_SOURCE_NAME (symbols[i])); } - + discard_cleanups (old_chain); return selected; -} - +} + /* The (single) sal corresponding to line LINE_NUM in a symbol table with file name FILENAME that occurs in one of the functions listed - in SYMBOLS[0 .. NSYMS-1]. */ + in SYMBOLS[0 .. NSYMS-1]. */ static struct symtabs_and_lines -find_sal_from_funcs_and_line (const char* filename, int line_num, - struct symbol** symbols, int nsyms) +find_sal_from_funcs_and_line (const char *filename, int line_num, + struct symbol **symbols, int nsyms) { struct symtabs_and_lines sals; int best_index, best; - struct linetable* best_linetable; - struct objfile* objfile; - struct symtab* s; - struct symtab* best_symtab; + struct linetable *best_linetable; + struct objfile *objfile; + struct symtab *s; + struct symtab *best_symtab; read_all_symtabs (filename); - best_index = 0; best_linetable = NULL; best_symtab = NULL; + best_index = 0; + best_linetable = NULL; + best_symtab = NULL; best = 0; ALL_SYMTABS (objfile, s) - { - struct linetable *l; - int ind, exact; + { + struct linetable *l; + int ind, exact; - QUIT; + QUIT; - if (!STREQ (filename, s->filename)) - continue; - l = LINETABLE (s); - ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact); - if (ind >= 0) - { - if (exact) - { - best_index = ind; - best_linetable = l; - best_symtab = s; - goto done; - } - if (best == 0 || l->item[ind].line < best) - { - best = l->item[ind].line; - best_index = ind; - best_linetable = l; - best_symtab = s; - } - } - } + if (!STREQ (filename, s->filename)) + continue; + l = LINETABLE (s); + ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact); + if (ind >= 0) + { + if (exact) + { + best_index = ind; + best_linetable = l; + best_symtab = s; + goto done; + } + if (best == 0 || l->item[ind].line < best) + { + best = l->item[ind].line; + best_index = ind; + best_linetable = l; + best_symtab = s; + } + } + } if (best == 0) error ("Line number not found in designated function."); - done: - +done: + sals.nelts = 1; - sals.sals = (struct symtab_and_line*) xmalloc (sizeof (sals.sals[0])); + sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0])); INIT_SAL (&sals.sals[0]); - + sals.sals[0].line = best_linetable->item[best_index].line; sals.sals[0].pc = best_linetable->item[best_index].pc; sals.sals[0].symtab = best_symtab; @@ -4510,8 +4556,8 @@ find_sal_from_funcs_and_line (const char* filename, int line_num, pc falls within one of the functions denoted by SYMBOLS[0..NSYMS-1]. Set *EXACTP to the 1 if the match is exact, and 0 otherwise. */ static int -find_line_in_linetable (struct linetable* linetable, int line_num, - struct symbol** symbols, int nsyms, int* exactp) +find_line_in_linetable (struct linetable *linetable, int line_num, + struct symbol **symbols, int nsyms, int *exactp) { int i, len, best_index, best; @@ -4522,7 +4568,7 @@ find_line_in_linetable (struct linetable* linetable, int line_num, for (i = 0, best_index = -1, best = 0; i < len; i += 1) { int k; - struct linetable_entry* item = &(linetable->item[i]); + struct linetable_entry *item = &(linetable->item[i]); for (k = 0; k < nsyms; k += 1) { @@ -4556,7 +4602,7 @@ find_line_in_linetable (struct linetable* linetable, int line_num, LINETABLE, and k falls strictly within a named function that begins at or before LINE_NUM. Return -1 if there is no such k. */ static int -nearest_line_number_in_linetable (struct linetable* linetable, int line_num) +nearest_line_number_in_linetable (struct linetable *linetable, int line_num) { int i, len, best; @@ -4564,15 +4610,16 @@ nearest_line_number_in_linetable (struct linetable* linetable, int line_num) return -1; len = linetable->nitems; - i = 0; best = INT_MAX; + i = 0; + best = INT_MAX; while (i < len) { int k; - struct linetable_entry* item = &(linetable->item[i]); + struct linetable_entry *item = &(linetable->item[i]); if (item->line >= line_num && item->line < best) { - char* func_name; + char *func_name; CORE_ADDR start, end; func_name = NULL; @@ -4582,9 +4629,9 @@ nearest_line_number_in_linetable (struct linetable* linetable, int line_num) { if (item->line == line_num) return line_num; - else + else { - struct symbol* sym = + struct symbol *sym = standard_lookup (func_name, VAR_NAMESPACE); if (is_plausible_func_for_line (sym, line_num)) best = item->line; @@ -4615,7 +4662,7 @@ nearest_line_number_in_linetable (struct linetable* linetable, int line_num) IND == -1 corresponds to no function. */ static int -find_next_line_in_linetable (struct linetable* linetable, int line_num, +find_next_line_in_linetable (struct linetable *linetable, int line_num, int starting_line, int ind) { int i, len; @@ -4624,12 +4671,12 @@ find_next_line_in_linetable (struct linetable* linetable, int line_num, return -1; len = linetable->nitems; - if (ind >= 0) + if (ind >= 0) { CORE_ADDR start, end; if (find_pc_partial_function (linetable->item[ind].pc, - (char**) NULL, &start, &end)) + (char **) NULL, &start, &end)) { while (ind < len && linetable->item[ind].pc < end) ind += 1; @@ -4644,11 +4691,11 @@ find_next_line_in_linetable (struct linetable* linetable, int line_num, while (i < len) { int k; - struct linetable_entry* item = &(linetable->item[i]); + struct linetable_entry *item = &(linetable->item[i]); if (item->line >= line_num) { - char* func_name; + char *func_name; CORE_ADDR start, end; func_name = NULL; @@ -4658,13 +4705,13 @@ find_next_line_in_linetable (struct linetable* linetable, int line_num, { if (item->line == line_num) { - struct symbol* sym = + struct symbol *sym = standard_lookup (func_name, VAR_NAMESPACE); if (is_plausible_func_for_line (sym, starting_line)) return i; else { - while ((i+1) < len && linetable->item[i+1].pc < end) + while ((i + 1) < len && linetable->item[i + 1].pc < end) i += 1; } } @@ -4679,7 +4726,7 @@ find_next_line_in_linetable (struct linetable* linetable, int line_num, /* True iff function symbol SYM starts somewhere at or before line # LINE_NUM. */ static int -is_plausible_func_for_line (struct symbol* sym, int line_num) +is_plausible_func_for_line (struct symbol *sym, int line_num) { struct symtab_and_line start_sal; @@ -4692,11 +4739,11 @@ is_plausible_func_for_line (struct symbol* sym, int line_num) } static void -debug_print_lines (struct linetable* lt) +debug_print_lines (struct linetable *lt) { int i; - if (lt == NULL) + if (lt == NULL) return; fprintf (stderr, "\t"); @@ -4706,150 +4753,152 @@ debug_print_lines (struct linetable* lt) } static void -debug_print_block (struct block* b) +debug_print_block (struct block *b) { int i; struct symbol *i; - fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]", - b, BLOCK_START(b), BLOCK_END(b)); - if (BLOCK_FUNCTION(b) != NULL) - fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION(b))); + fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]", + b, BLOCK_START (b), BLOCK_END (b)); + if (BLOCK_FUNCTION (b) != NULL) + fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION (b))); fprintf (stderr, "\n"); - fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK(b)); + fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK (b)); fprintf (stderr, "\t Symbols:"); ALL_BLOCK_SYMBOLS (b, i, sym) - { - if (i > 0 && i % 4 == 0) - fprintf (stderr, "\n\t\t "); - fprintf (stderr, " %s", SYMBOL_NAME (sym)); - } + { + if (i > 0 && i % 4 == 0) + fprintf (stderr, "\n\t\t "); + fprintf (stderr, " %s", SYMBOL_NAME (sym)); + } fprintf (stderr, "\n"); } static void -debug_print_blocks (struct blockvector* bv) +debug_print_blocks (struct blockvector *bv) { int i; if (bv == NULL) return; - for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1) { - fprintf (stderr, "%6d. ", i); - debug_print_block (BLOCKVECTOR_BLOCK (bv, i)); - } + for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1) + { + fprintf (stderr, "%6d. ", i); + debug_print_block (BLOCKVECTOR_BLOCK (bv, i)); + } } static void -debug_print_symtab (struct symtab* s) +debug_print_symtab (struct symtab *s) { fprintf (stderr, "Symtab %p\n File: %s; Dir: %s\n", s, s->filename, s->dirname); fprintf (stderr, " Blockvector: %p, Primary: %d\n", - BLOCKVECTOR(s), s->primary); - debug_print_blocks (BLOCKVECTOR(s)); + BLOCKVECTOR (s), s->primary); + debug_print_blocks (BLOCKVECTOR (s)); fprintf (stderr, " Line table: %p\n", LINETABLE (s)); - debug_print_lines (LINETABLE(s)); + debug_print_lines (LINETABLE (s)); } /* Read in all symbol tables corresponding to partial symbol tables with file name FILENAME. */ static void -read_all_symtabs (const char* filename) +read_all_symtabs (const char *filename) { - struct partial_symtab* ps; - struct objfile* objfile; + struct partial_symtab *ps; + struct objfile *objfile; ALL_PSYMTABS (objfile, ps) - { - QUIT; + { + QUIT; - if (STREQ (filename, ps->filename)) - PSYMTAB_TO_SYMTAB (ps); - } + if (STREQ (filename, ps->filename)) + PSYMTAB_TO_SYMTAB (ps); + } } /* All sals corresponding to line LINE_NUM in a symbol table from file FILENAME, as filtered by the user. If CANONICAL is not null, set it to a corresponding array of canonical line specs. */ static struct symtabs_and_lines -all_sals_for_line (const char* filename, int line_num, char*** canonical) +all_sals_for_line (const char *filename, int line_num, char ***canonical) { struct symtabs_and_lines result; - struct objfile* objfile; - struct symtab* s; - struct cleanup* old_chain = make_cleanup (null_cleanup, NULL); + struct objfile *objfile; + struct symtab *s; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); size_t len; read_all_symtabs (filename); - result.sals = (struct symtab_and_line*) xmalloc (4 * sizeof (result.sals[0])); + result.sals = + (struct symtab_and_line *) xmalloc (4 * sizeof (result.sals[0])); result.nelts = 0; len = 4; make_cleanup (free_current_contents, &result.sals); - ALL_SYMTABS (objfile, s) - { - int ind, target_line_num; + ALL_SYMTABS (objfile, s) + { + int ind, target_line_num; - QUIT; + QUIT; - if (!STREQ (s->filename, filename)) - continue; + if (!STREQ (s->filename, filename)) + continue; - target_line_num = - nearest_line_number_in_linetable (LINETABLE (s), line_num); - if (target_line_num == -1) - continue; + target_line_num = + nearest_line_number_in_linetable (LINETABLE (s), line_num); + if (target_line_num == -1) + continue; - ind = -1; - while (1) - { - ind = - find_next_line_in_linetable (LINETABLE (s), - target_line_num, line_num, ind); - - if (ind < 0) - break; + ind = -1; + while (1) + { + ind = + find_next_line_in_linetable (LINETABLE (s), + target_line_num, line_num, ind); - GROW_VECT (result.sals, len, result.nelts+1); - INIT_SAL (&result.sals[result.nelts]); - result.sals[result.nelts].line = LINETABLE(s)->item[ind].line; - result.sals[result.nelts].pc = LINETABLE(s)->item[ind].pc; - result.sals[result.nelts].symtab = s; - result.nelts += 1; - } - } + if (ind < 0) + break; + + GROW_VECT (result.sals, len, result.nelts + 1); + INIT_SAL (&result.sals[result.nelts]); + result.sals[result.nelts].line = LINETABLE (s)->item[ind].line; + result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc; + result.sals[result.nelts].symtab = s; + result.nelts += 1; + } + } if (canonical != NULL || result.nelts > 1) { int k; - char** func_names = (char**) alloca (result.nelts * sizeof (char*)); + char **func_names = (char **) alloca (result.nelts * sizeof (char *)); int first_choice = (result.nelts > 1) ? 2 : 1; int n; - int* choices = (int*) alloca (result.nelts * sizeof (int)); - - for (k = 0; k < result.nelts; k += 1) + int *choices = (int *) alloca (result.nelts * sizeof (int)); + + for (k = 0; k < result.nelts; k += 1) { - find_pc_partial_function (result.sals[k].pc, &func_names[k], - (CORE_ADDR*) NULL, (CORE_ADDR*) NULL); + find_pc_partial_function (result.sals[k].pc, &func_names[k], + (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); if (func_names[k] == NULL) error ("Could not find function for one or more breakpoints."); } - - if (result.nelts > 1) + + if (result.nelts > 1) { - printf_unfiltered("[0] cancel\n"); - if (result.nelts > 1) - printf_unfiltered("[1] all\n"); + printf_unfiltered ("[0] cancel\n"); + if (result.nelts > 1) + printf_unfiltered ("[1] all\n"); for (k = 0; k < result.nelts; k += 1) - printf_unfiltered ("[%d] %s\n", k + first_choice, + printf_unfiltered ("[%d] %s\n", k + first_choice, ada_demangle (func_names[k])); - + n = get_selections (choices, result.nelts, result.nelts, result.nelts > 1, "instance-choice"); - - for (k = 0; k < n; k += 1) + + for (k = 0; k < n; k += 1) { result.sals[k] = result.sals[choices[k]]; func_names[k] = func_names[choices[k]]; @@ -4857,13 +4906,13 @@ all_sals_for_line (const char* filename, int line_num, char*** canonical) result.nelts = n; } - if (canonical != NULL) + if (canonical != NULL) { - *canonical = (char**) xmalloc (result.nelts * sizeof (char**)); + *canonical = (char **) xmalloc (result.nelts * sizeof (char **)); make_cleanup (xfree, *canonical); - for (k = 0; k < result.nelts; k += 1) + for (k = 0; k < result.nelts; k += 1) { - (*canonical)[k] = + (*canonical)[k] = extended_canonical_line_spec (result.sals[k], func_names[k]); if ((*canonical)[k] == NULL) error ("Could not locate one or more breakpoints."); @@ -4882,17 +4931,16 @@ all_sals_for_line (const char* filename, int line_num, char*** canonical) information. The caller is responsible for releasing any space allocated. */ -static char* -extended_canonical_line_spec (struct symtab_and_line sal, const char* name) +static char * +extended_canonical_line_spec (struct symtab_and_line sal, const char *name) { - char* r; + char *r; - if (sal.symtab == NULL || sal.symtab->filename == NULL || - sal.line <= 0) + if (sal.symtab == NULL || sal.symtab->filename == NULL || sal.line <= 0) return NULL; - r = (char*) xmalloc (strlen (name) + strlen (sal.symtab->filename) - + sizeof(sal.line)*3 + 3); + r = (char *) xmalloc (strlen (name) + strlen (sal.symtab->filename) + + sizeof (sal.line) * 3 + 3); sprintf (r, "%s:'%s':%d", sal.symtab->filename, name, sal.line); return r; } @@ -4902,8 +4950,8 @@ int begin_bnum = -1; #endif int begin_annotate_level = 0; -static void -begin_cleanup (void* dummy) +static void +begin_cleanup (void *dummy) { begin_annotate_level = 0; } @@ -4914,58 +4962,58 @@ begin_command (char *args, int from_tty) struct minimal_symbol *msym; CORE_ADDR main_program_name_addr; char main_program_name[1024]; - struct cleanup* old_chain = make_cleanup (begin_cleanup, NULL); + struct cleanup *old_chain = make_cleanup (begin_cleanup, NULL); begin_annotate_level = 2; /* Check that there is a program to debug */ if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); - + /* Check that we are debugging an Ada program */ /* if (ada_update_initial_language (language_unknown, NULL) != language_ada) - error ("Cannot find the Ada initialization procedure. Is this an Ada main program?"); - */ + error ("Cannot find the Ada initialization procedure. Is this an Ada main program?"); + */ /* FIXME: language_ada should be defined in defs.h */ /* Get the address of the name of the main procedure */ msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); if (msym != NULL) - { - main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym); - if (main_program_name_addr == 0) - error ("Invalid address for Ada main program name."); + { + main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym); + if (main_program_name_addr == 0) + error ("Invalid address for Ada main program name."); - /* Read the name of the main procedure */ - extract_string (main_program_name_addr, main_program_name); + /* Read the name of the main procedure */ + extract_string (main_program_name_addr, main_program_name); - /* Put a temporary breakpoint in the Ada main program and run */ - do_command ("tbreak ", main_program_name, 0); - do_command ("run ", args, 0); - } + /* Put a temporary breakpoint in the Ada main program and run */ + do_command ("tbreak ", main_program_name, 0); + do_command ("run ", args, 0); + } else - { - /* If we could not find the symbol containing the name of the - main program, that means that the compiler that was used to build - was not recent enough. In that case, we fallback to the previous - mechanism, which is a little bit less reliable, but has proved to work - in most cases. The only cases where it will fail is when the user - has set some breakpoints which will be hit before the end of the - begin command processing (eg in the initialization code). - - The begining of the main Ada subprogram is located by breaking - on the adainit procedure. Since we know that the binder generates - the call to this procedure exactly 2 calls before the call to the - Ada main subprogram, it is then easy to put a breakpoint on this - Ada main subprogram once we hit adainit. - */ - do_command ("tbreak adainit", 0); - do_command ("run ", args, 0); - do_command ("up", 0); - do_command ("tbreak +2", 0); - do_command ("continue", 0); - do_command ("step", 0); - } + { + /* If we could not find the symbol containing the name of the + main program, that means that the compiler that was used to build + was not recent enough. In that case, we fallback to the previous + mechanism, which is a little bit less reliable, but has proved to work + in most cases. The only cases where it will fail is when the user + has set some breakpoints which will be hit before the end of the + begin command processing (eg in the initialization code). + + The begining of the main Ada subprogram is located by breaking + on the adainit procedure. Since we know that the binder generates + the call to this procedure exactly 2 calls before the call to the + Ada main subprogram, it is then easy to put a breakpoint on this + Ada main subprogram once we hit adainit. + */ + do_command ("tbreak adainit", 0); + do_command ("run ", args, 0); + do_command ("up", 0); + do_command ("tbreak +2", 0); + do_command ("continue", 0); + do_command ("step", 0); + } do_cleanups (old_chain); } @@ -4975,8 +5023,7 @@ is_ada_runtime_file (char *filename) { return (STREQN (filename, "s-", 2) || STREQN (filename, "a-", 2) || - STREQN (filename, "g-", 2) || - STREQN (filename, "i-", 2)); + STREQN (filename, "g-", 2) || STREQN (filename, "i-", 2)); } /* find the first frame that contains debugging information and that is not @@ -4986,29 +5033,29 @@ int find_printable_frame (struct frame_info *fi, int level) { struct symtab_and_line sal; - + for (; fi != NULL; level += 1, fi = get_prev_frame (fi)) { /* If fi is not the innermost frame, that normally means that fi->pc - points to *after* the call instruction, and we want to get the line - containing the call, never the next line. But if the next frame is - a signal_handler_caller or a dummy frame, then the next frame was - not entered as the result of a call, and we want to get the line - containing fi->pc. */ + points to *after* the call instruction, and we want to get the line + containing the call, never the next line. But if the next frame is + a signal_handler_caller or a dummy frame, then the next frame was + not entered as the result of a call, and we want to get the line + containing fi->pc. */ sal = - find_pc_line (fi->pc, + find_pc_line (fi->pc, fi->next != NULL && !fi->next->signal_handler_caller && !frame_in_dummy (fi->next)); if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename)) { #if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) - /* libpthread.so contains some debugging information that prevents us - from finding the right frame */ + /* libpthread.so contains some debugging information that prevents us + from finding the right frame */ if (sal.symtab->objfile && STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so")) - continue; + continue; #endif selected_frame = fi; break; @@ -5024,58 +5071,57 @@ ada_report_exception_break (struct breakpoint *b) #ifdef UI_OUT /* FIXME: break_on_exception should be defined in breakpoint.h */ /* if (b->break_on_exception == 1) - { - /* Assume that cond has 16 elements, the 15th - being the exception */ /* - if (b->cond && b->cond->nelts == 16) - { - ui_out_text (uiout, "on "); - ui_out_field_string (uiout, "exception", - SYMBOL_NAME (b->cond->elts[14].symbol)); - } - else - ui_out_text (uiout, "on all exceptions"); - } - else if (b->break_on_exception == 2) - ui_out_text (uiout, "on unhandled exception"); - else if (b->break_on_exception == 3) - ui_out_text (uiout, "on assert failure"); -#else - if (b->break_on_exception == 1) - {*/ - /* Assume that cond has 16 elements, the 15th - being the exception */ /* - if (b->cond && b->cond->nelts == 16) - { - fputs_filtered ("on ", gdb_stdout); - fputs_filtered (SYMBOL_NAME - (b->cond->elts[14].symbol), gdb_stdout); - } - else - fputs_filtered ("on all exceptions", gdb_stdout); - } - else if (b->break_on_exception == 2) - fputs_filtered ("on unhandled exception", gdb_stdout); - else if (b->break_on_exception == 3) - fputs_filtered ("on assert failure", gdb_stdout); -*/ + { + /* Assume that cond has 16 elements, the 15th + being the exception *//* + if (b->cond && b->cond->nelts == 16) + { + ui_out_text (uiout, "on "); + ui_out_field_string (uiout, "exception", + SYMBOL_NAME (b->cond->elts[14].symbol)); + } + else + ui_out_text (uiout, "on all exceptions"); + } + else if (b->break_on_exception == 2) + ui_out_text (uiout, "on unhandled exception"); + else if (b->break_on_exception == 3) + ui_out_text (uiout, "on assert failure"); + #else + if (b->break_on_exception == 1) + { */ + /* Assume that cond has 16 elements, the 15th + being the exception *//* + if (b->cond && b->cond->nelts == 16) + { + fputs_filtered ("on ", gdb_stdout); + fputs_filtered (SYMBOL_NAME + (b->cond->elts[14].symbol), gdb_stdout); + } + else + fputs_filtered ("on all exceptions", gdb_stdout); + } + else if (b->break_on_exception == 2) + fputs_filtered ("on unhandled exception", gdb_stdout); + else if (b->break_on_exception == 3) + fputs_filtered ("on assert failure", gdb_stdout); + */ #endif } int -ada_is_exception_sym (struct symbol* sym) +ada_is_exception_sym (struct symbol *sym) { char *type_name = type_name_no_tag (SYMBOL_TYPE (sym)); - + return (SYMBOL_CLASS (sym) != LOC_TYPEDEF && SYMBOL_CLASS (sym) != LOC_BLOCK && SYMBOL_CLASS (sym) != LOC_CONST - && type_name != NULL - && STREQ (type_name, "exception")); + && type_name != NULL && STREQ (type_name, "exception")); } int -ada_maybe_exception_partial_symbol (struct partial_symbol* sym) +ada_maybe_exception_partial_symbol (struct partial_symbol *sym) { return (SYMBOL_CLASS (sym) != LOC_TYPEDEF && SYMBOL_CLASS (sym) != LOC_BLOCK @@ -5086,69 +5132,70 @@ ada_maybe_exception_partial_symbol (struct partial_symbol* sym) into equivalent form. Return resulting argument string. Set *BREAK_ON_EXCEPTIONP to 1 for ordinary break on exception, 2 for break on unhandled, 3 for assert, 0 otherwise. */ -char* ada_breakpoint_rewrite (char* arg, int* break_on_exceptionp) +char * +ada_breakpoint_rewrite (char *arg, int *break_on_exceptionp) { if (arg == NULL) return arg; *break_on_exceptionp = 0; - /* FIXME: language_ada should be defined in defs.h */ + /* FIXME: language_ada should be defined in defs.h */ /* if (current_language->la_language == language_ada - && STREQN (arg, "exception", 9) && - (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0')) - { - char *tok, *end_tok; - int toklen; - - *break_on_exceptionp = 1; - - tok = arg+9; - while (*tok == ' ' || *tok == '\t') - tok += 1; - - end_tok = tok; - - while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000') - end_tok += 1; - - toklen = end_tok - tok; - - arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if " - "long_integer(e) = long_integer(&)") - + toklen + 1); - make_cleanup (xfree, arg); - if (toklen == 0) - strcpy (arg, "__gnat_raise_nodefer_with_msg"); - else if (STREQN (tok, "unhandled", toklen)) - { - *break_on_exceptionp = 2; - strcpy (arg, "__gnat_unhandled_exception"); - } - else - { - sprintf (arg, "__gnat_raise_nodefer_with_msg if " - "long_integer(e) = long_integer(&%.*s)", - toklen, tok); - } - } - else if (current_language->la_language == language_ada - && STREQN (arg, "assert", 6) && - (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0')) - { - char *tok = arg + 6; - - *break_on_exceptionp = 3; - - arg = (char*) - xmalloc (sizeof ("system__assertions__raise_assert_failure") - + strlen (tok) + 1); - make_cleanup (xfree, arg); - sprintf (arg, "system__assertions__raise_assert_failure%s", tok); - } - */ + && STREQN (arg, "exception", 9) && + (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0')) + { + char *tok, *end_tok; + int toklen; + + *break_on_exceptionp = 1; + + tok = arg+9; + while (*tok == ' ' || *tok == '\t') + tok += 1; + + end_tok = tok; + + while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000') + end_tok += 1; + + toklen = end_tok - tok; + + arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if " + "long_integer(e) = long_integer(&)") + + toklen + 1); + make_cleanup (xfree, arg); + if (toklen == 0) + strcpy (arg, "__gnat_raise_nodefer_with_msg"); + else if (STREQN (tok, "unhandled", toklen)) + { + *break_on_exceptionp = 2; + strcpy (arg, "__gnat_unhandled_exception"); + } + else + { + sprintf (arg, "__gnat_raise_nodefer_with_msg if " + "long_integer(e) = long_integer(&%.*s)", + toklen, tok); + } + } + else if (current_language->la_language == language_ada + && STREQN (arg, "assert", 6) && + (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0')) + { + char *tok = arg + 6; + + *break_on_exceptionp = 3; + + arg = (char*) + xmalloc (sizeof ("system__assertions__raise_assert_failure") + + strlen (tok) + 1); + make_cleanup (xfree, arg); + sprintf (arg, "system__assertions__raise_assert_failure%s", tok); + } + */ return arg; } - + /* Field Access */ /* True if field number FIELD_NUM in struct or union type TYPE is supposed @@ -5159,11 +5206,11 @@ ada_is_ignored_field (struct type *type, int field_num) { if (field_num < 0 || field_num > TYPE_NFIELDS (type)) return 1; - else + else { - const char* name = TYPE_FIELD_NAME (type, field_num); + const char *name = TYPE_FIELD_NAME (type, field_num); return (name == NULL - || (name[0] == '_' && ! STREQN (name, "_parent", 7))); + || (name[0] == '_' && !STREQN (name, "_parent", 7))); } } @@ -5180,23 +5227,23 @@ ada_is_tagged_type (struct type *type) /* The type of the tag on VAL. */ -struct type* -ada_tag_type (struct value* val) +struct type * +ada_tag_type (struct value *val) { return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 0, NULL); } /* The value of the tag on VAL. */ -struct value* -ada_value_tag (struct value* val) +struct value * +ada_value_tag (struct value *val) { return ada_value_struct_elt (val, "_tag", "record"); } /* The parent type of TYPE, or NULL if none. */ -struct type* +struct type * ada_parent_type (struct type *type) { int i; @@ -5220,8 +5267,8 @@ ada_parent_type (struct type *type) int ada_is_parent_field (struct type *type, int field_num) { - const char* name = TYPE_FIELD_NAME (check_typedef (type), field_num); - return (name != NULL && + const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num); + return (name != NULL && (STREQN (name, "PARENT", 6) || STREQN (name, "_parent", 7))); } @@ -5234,36 +5281,36 @@ ada_is_parent_field (struct type *type, int field_num) int ada_is_wrapper_field (struct type *type, int field_num) { - const char* name = TYPE_FIELD_NAME (type, field_num); - return (name != NULL - && (STREQN (name, "PARENT", 6) || STREQ (name, "REP") + const char *name = TYPE_FIELD_NAME (type, field_num); + return (name != NULL + && (STREQN (name, "PARENT", 6) || STREQ (name, "REP") || STREQN (name, "_parent", 7) || name[0] == 'S' || name[0] == 'R' || name[0] == 'O')); } /* True iff field number FIELD_NUM of structure or union type TYPE is a variant wrapper. Assumes TYPE is a structure type with at least - FIELD_NUM+1 fields. */ + FIELD_NUM+1 fields. */ int ada_is_variant_part (struct type *type, int field_num) { - struct type* field_type = TYPE_FIELD_TYPE (type, field_num); + struct type *field_type = TYPE_FIELD_TYPE (type, field_num); return (TYPE_CODE (field_type) == TYPE_CODE_UNION || (is_dynamic_field (type, field_num) - && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) == TYPE_CODE_UNION)); + && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) == + TYPE_CODE_UNION)); } /* Assuming that VAR_TYPE is a variant wrapper (type of the variant part) whose discriminants are contained in the record type OUTER_TYPE, returns the type of the controlling discriminant for the variant. */ -struct type* +struct type * ada_variant_discrim_type (struct type *var_type, struct type *outer_type) { - char* name = ada_variant_discrim_name (var_type); - struct type *type = - ada_lookup_struct_elt_type (outer_type, name, 1, NULL); + char *name = ada_variant_discrim_name (var_type); + struct type *type = ada_lookup_struct_elt_type (outer_type, name, 1, NULL); if (type == NULL) return builtin_type_int; else @@ -5277,7 +5324,7 @@ ada_variant_discrim_type (struct type *var_type, struct type *outer_type) int ada_is_others_clause (struct type *type, int field_num) { - const char* name = TYPE_FIELD_NAME (type, field_num); + const char *name = TYPE_FIELD_NAME (type, field_num); return (name != NULL && name[0] == 'O'); } @@ -5285,15 +5332,15 @@ ada_is_others_clause (struct type *type, int field_num) returns the name of the discriminant controlling the variant. The value is valid until the next call to ada_variant_discrim_name. */ -char * +char * ada_variant_discrim_name (struct type *type0) { - static char* result = NULL; + static char *result = NULL; static size_t result_len = 0; - struct type* type; - const char* name; - const char* discrim_end; - const char* discrim_start; + struct type *type; + const char *name; + const char *discrim_end; + const char *discrim_start; if (TYPE_CODE (type0) == TYPE_CODE_PTR) type = TYPE_TARGET_TYPE (type0); @@ -5314,19 +5361,19 @@ ada_variant_discrim_name (struct type *type0) if (discrim_end == name) return ""; - for (discrim_start = discrim_end; discrim_start != name+3; + for (discrim_start = discrim_end; discrim_start != name + 3; discrim_start -= 1) { - if (discrim_start == name+1) + if (discrim_start == name + 1) return ""; - if ((discrim_start > name+3 && STREQN (discrim_start-3, "___", 3)) + if ((discrim_start > name + 3 && STREQN (discrim_start - 3, "___", 3)) || discrim_start[-1] == '.') break; } GROW_VECT (result, result_len, discrim_end - discrim_start + 1); strncpy (result, discrim_start, discrim_end - discrim_start); - result[discrim_end-discrim_start] = '\0'; + result[discrim_end - discrim_start] = '\0'; return result; } @@ -5339,11 +5386,11 @@ ada_variant_discrim_name (struct type *type0) does not occur. */ int -ada_scan_number (const char str[], int k, LONGEST *R, int *new_k) +ada_scan_number (const char str[], int k, LONGEST * R, int *new_k) { ULONGEST RU; - if (! isdigit (str[k])) + if (!isdigit (str[k])) return 0; /* Do it the hard way so as not to make any assumption about @@ -5352,14 +5399,14 @@ ada_scan_number (const char str[], int k, LONGEST *R, int *new_k) RU = 0; while (isdigit (str[k])) { - RU = RU*10 + (str[k] - '0'); + RU = RU * 10 + (str[k] - '0'); k += 1; } - if (str[k] == 'm') + if (str[k] == 'm') { if (R != NULL) - *R = (- (LONGEST) (RU-1)) - 1; + *R = (-(LONGEST) (RU - 1)) - 1; k += 1; } else if (R != NULL) @@ -5380,23 +5427,23 @@ ada_scan_number (const char str[], int k, LONGEST *R, int *new_k) and FIELD_NUM is a valid field number within it, returns 1 iff VAL is in the range encoded by field FIELD_NUM of TYPE; otherwise 0. */ -int +int ada_in_variant (LONGEST val, struct type *type, int field_num) { - const char* name = TYPE_FIELD_NAME (type, field_num); + const char *name = TYPE_FIELD_NAME (type, field_num); int p; p = 0; while (1) { - switch (name[p]) + switch (name[p]) { case '\0': return 0; case 'S': { LONGEST W; - if (! ada_scan_number (name, p + 1, &W, &p)) + if (!ada_scan_number (name, p + 1, &W, &p)) return 0; if (val == W) return 1; @@ -5405,9 +5452,8 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) case 'R': { LONGEST L, U; - if (! ada_scan_number (name, p + 1, &L, &p) - || name[p] != 'T' - || ! ada_scan_number (name, p + 1, &U, &p)) + if (!ada_scan_number (name, p + 1, &L, &p) + || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p)) return 0; if (val >= L && val <= U) return 1; @@ -5427,11 +5473,11 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) FIELDNO says which field. Differs from value_primitive_field only in that it can handle packed values of arbitrary type. */ -struct value* -ada_value_primitive_field (struct value* arg1, int offset, int fieldno, +struct value * +ada_value_primitive_field (struct value *arg1, int offset, int fieldno, struct type *arg_type) { - struct value* v; + struct value *v; struct type *type; CHECK_TYPEDEF (arg_type); @@ -5443,10 +5489,10 @@ ada_value_primitive_field (struct value* arg1, int offset, int fieldno, { int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); - + return ada_value_primitive_packed_val (arg1, VALUE_CONTENTS (arg1), - offset + bit_pos/8, bit_pos % 8, - bit_size, type); + offset + bit_pos / 8, + bit_pos % 8, bit_size, type); } else return value_primitive_field (arg1, offset, fieldno, arg_type); @@ -5459,14 +5505,14 @@ ada_value_primitive_field (struct value* arg1, int offset, int fieldno, Searches recursively through wrapper fields (e.g., '_parent'). */ -struct value* -ada_search_struct_field (char *name, struct value* arg, int offset, +struct value * +ada_search_struct_field (char *name, struct value *arg, int offset, struct type *type) { int i; CHECK_TYPEDEF (type); - for (i = TYPE_NFIELDS (type)-1; i >= 0; i -= 1) + for (i = TYPE_NFIELDS (type) - 1; i >= 0; i -= 1) { char *t_field_name = TYPE_FIELD_NAME (type, i); @@ -5474,14 +5520,17 @@ ada_search_struct_field (char *name, struct value* arg, int offset, continue; else if (field_name_match (t_field_name, name)) - return ada_value_primitive_field (arg, offset, i, type); + return ada_value_primitive_field (arg, offset, i, type); else if (ada_is_wrapper_field (type, i)) { - struct value* v = - ada_search_struct_field (name, arg, - offset + TYPE_FIELD_BITPOS (type, i) / 8, - TYPE_FIELD_TYPE (type, i)); + struct value *v = ada_search_struct_field (name, arg, + offset + + TYPE_FIELD_BITPOS (type, + i) / + 8, + TYPE_FIELD_TYPE (type, + i)); if (v != NULL) return v; } @@ -5494,11 +5543,13 @@ ada_search_struct_field (char *name, struct value* arg, int offset, for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1) { - struct value* v = - ada_search_struct_field (name, arg, - var_offset - + TYPE_FIELD_BITPOS (field_type, j)/8, - TYPE_FIELD_TYPE (field_type, j)); + struct value *v = ada_search_struct_field (name, arg, + var_offset + + + TYPE_FIELD_BITPOS + (field_type, j) / 8, + TYPE_FIELD_TYPE + (field_type, j)); if (v != NULL) return v; } @@ -5506,7 +5557,7 @@ ada_search_struct_field (char *name, struct value* arg, int offset, } return NULL; } - + /* Given ARG, a value of type (pointer to a)* structure/union, extract the component named NAME from the ultimate target structure/union and return it as a value with its appropriate type. @@ -5518,11 +5569,11 @@ ada_search_struct_field (char *name, struct value* arg, int offset, ERR is a name (for use in error messages) that identifies the class of entity that ARG is supposed to be. */ -struct value* +struct value * ada_value_struct_elt (struct value *arg, char *name, char *err) { struct type *t; - struct value* v; + struct value *v; arg = ada_coerce_ref (arg); t = check_typedef (VALUE_TYPE (arg)); @@ -5535,9 +5586,9 @@ ada_value_struct_elt (struct value *arg, char *name, char *err) t = check_typedef (VALUE_TYPE (arg)); } - if ( TYPE_CODE (t) != TYPE_CODE_STRUCT - && TYPE_CODE (t) != TYPE_CODE_UNION) - error ("Attempt to extract a component of a value that is not a %s.", err); + if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION) + error ("Attempt to extract a component of a value that is not a %s.", + err); v = ada_search_struct_field (name, arg, 0, t); if (v == NULL) @@ -5563,7 +5614,8 @@ ada_value_struct_elt (struct value *arg, char *name, char *err) If NOERR is nonzero, return NULL if NAME is not suitably defined. */ struct type * -ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, int *dispp) +ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, + int *dispp) { int i; @@ -5596,13 +5648,13 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, int *dispp char *t_field_name = TYPE_FIELD_NAME (type, i); struct type *t; int disp; - + if (t_field_name == NULL) continue; else if (field_name_match (t_field_name, name)) { - if (dispp != NULL) + if (dispp != NULL) *dispp += TYPE_FIELD_BITPOS (type, i) / 8; return check_typedef (TYPE_FIELD_TYPE (type, i)); } @@ -5610,7 +5662,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, int *dispp else if (ada_is_wrapper_field (type, i)) { disp = 0; - t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name, + t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name, 1, &disp); if (t != NULL) { @@ -5632,7 +5684,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, int *dispp name, 1, &disp); if (t != NULL) { - if (dispp != NULL) + if (dispp != NULL) *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8; return t; } @@ -5642,7 +5694,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, int *dispp } BadName: - if (! noerr) + if (!noerr) { target_terminal_ours (); gdb_flush (gdb_stdout); @@ -5660,19 +5712,19 @@ BadName: OUTER_VALADDR, determine which variant clause (field number in VAR_TYPE, numbering from 0) is applicable. Returns -1 if none are. */ -int +int ada_which_variant_applies (struct type *var_type, struct type *outer_type, - char* outer_valaddr) + char *outer_valaddr) { int others_clause; int i; int disp; - struct type* discrim_type; - char* discrim_name = ada_variant_discrim_name (var_type); + struct type *discrim_type; + char *discrim_name = ada_variant_discrim_name (var_type); LONGEST discrim_val; disp = 0; - discrim_type = + discrim_type = ada_lookup_struct_elt_type (outer_type, discrim_name, 1, &disp); if (discrim_type == NULL) return -1; @@ -5689,9 +5741,9 @@ ada_which_variant_applies (struct type *var_type, struct type *outer_type, return others_clause; } + - /* Dynamic-Sized Records */ /* Strategy: The type ostensibly attached to a value with dynamic size @@ -5731,28 +5783,29 @@ ada_which_variant_applies (struct type *var_type, struct type *outer_type, dereferencing it. Differs from value_ind in its treatment of dynamic-sized types. */ -struct value* -ada_value_ind (struct value* val0) +struct value * +ada_value_ind (struct value *val0) { - struct value* val = unwrap_value (value_ind (val0)); + struct value *val = unwrap_value (value_ind (val0)); return ada_to_fixed_value (VALUE_TYPE (val), 0, - VALUE_ADDRESS (val) + VALUE_OFFSET (val), - val); + VALUE_ADDRESS (val) + VALUE_OFFSET (val), val); } /* The value resulting from dereferencing any "reference to" * qualifiers on VAL0. */ -static struct value* -ada_coerce_ref (struct value* val0) -{ - if (TYPE_CODE (VALUE_TYPE (val0)) == TYPE_CODE_REF) { - struct value* val = val0; - COERCE_REF (val); - val = unwrap_value (val); - return ada_to_fixed_value (VALUE_TYPE (val), 0, - VALUE_ADDRESS (val) + VALUE_OFFSET (val), - val); - } else +static struct value * +ada_coerce_ref (struct value *val0) +{ + if (TYPE_CODE (VALUE_TYPE (val0)) == TYPE_CODE_REF) + { + struct value *val = val0; + COERCE_REF (val); + val = unwrap_value (val); + return ada_to_fixed_value (VALUE_TYPE (val), 0, + VALUE_ADDRESS (val) + VALUE_OFFSET (val), + val); + } + else return val0; } @@ -5785,29 +5838,29 @@ field_offset (struct type *type, int f) static unsigned int field_alignment (struct type *type, int f) { - const char* name = TYPE_FIELD_NAME (type, f); + const char *name = TYPE_FIELD_NAME (type, f); int len = (name == NULL) ? 0 : strlen (name); int align_offset; - if (len < 8 || ! isdigit (name[len-1])) + if (len < 8 || !isdigit (name[len - 1])) return TARGET_CHAR_BIT; - if (isdigit (name[len-2])) + if (isdigit (name[len - 2])) align_offset = len - 2; else align_offset = len - 1; - if (align_offset < 7 || ! STREQN ("___XV", name+align_offset-6, 5)) + if (align_offset < 7 || !STREQN ("___XV", name + align_offset - 6, 5)) return TARGET_CHAR_BIT; - return atoi (name+align_offset) * TARGET_CHAR_BIT; + return atoi (name + align_offset) * TARGET_CHAR_BIT; } /* Find a type named NAME. Ignores ambiguity. */ -struct type* +struct type * ada_find_any_type (const char *name) { - struct symbol* sym; + struct symbol *sym; sym = standard_lookup (name, VAR_NAMESPACE); if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) @@ -5825,7 +5878,7 @@ ada_find_any_type (const char *name) that of TYPE1 for purposes of type printing, return non-zero; otherwise return 0. */ int -ada_prefer_type (struct type* type0, struct type* type1) +ada_prefer_type (struct type *type0, struct type *type1) { if (type1 == NULL) return 1; @@ -5837,9 +5890,10 @@ ada_prefer_type (struct type* type0, struct type* type1) return 0; else if (ada_is_packed_array_type (type0)) return 1; - else if (ada_is_array_descriptor (type0) && ! ada_is_array_descriptor (type1)) + else if (ada_is_array_descriptor (type0) + && !ada_is_array_descriptor (type1)) return 1; - else if (ada_renaming_type (type0) != NULL + else if (ada_renaming_type (type0) != NULL && ada_renaming_type (type1) == NULL) return 1; return 0; @@ -5847,10 +5901,10 @@ ada_prefer_type (struct type* type0, struct type* type1) /* The name of TYPE, which is either its TYPE_NAME, or, if that is null, its TYPE_TAG_NAME. Null if TYPE is null. */ -char* -ada_type_name (struct type* type) +char * +ada_type_name (struct type *type) { - if (type == NULL) + if (type == NULL) return NULL; else if (TYPE_NAME (type) != NULL) return TYPE_NAME (type); @@ -5861,23 +5915,23 @@ ada_type_name (struct type* type) /* Find a parallel type to TYPE whose name is formed by appending SUFFIX to the name of TYPE. */ -struct type* +struct type * ada_find_parallel_type (struct type *type, const char *suffix) { - static char* name; + static char *name; static size_t name_len = 0; - struct symbol** syms; - struct block** blocks; + struct symbol **syms; + struct block **blocks; int nsyms; int len; - char* typename = ada_type_name (type); - + char *typename = ada_type_name (type); + if (typename == NULL) return NULL; len = strlen (typename); - GROW_VECT (name, name_len, len+strlen (suffix)+1); + GROW_VECT (name, name_len, len + strlen (suffix) + 1); strcpy (name, typename); strcpy (name + len, suffix); @@ -5889,15 +5943,15 @@ ada_find_parallel_type (struct type *type, const char *suffix) /* If TYPE is a variable-size record type, return the corresponding template type describing its fields. Otherwise, return NULL. */ -static struct type* -dynamic_template_type (struct type* type) +static struct type * +dynamic_template_type (struct type *type) { CHECK_TYPEDEF (type); if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT - || ada_type_name (type) == NULL) + || ada_type_name (type) == NULL) return NULL; - else + else { int len = strlen (ada_type_name (type)); if (len > 6 && STREQ (ada_type_name (type) + len - 6, "___XVE")) @@ -5910,11 +5964,11 @@ dynamic_template_type (struct type* type) /* Assuming that TEMPL_TYPE is a union or struct type, returns non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size. */ -static int -is_dynamic_field (struct type* templ_type, int field_num) +static int +is_dynamic_field (struct type *templ_type, int field_num) { const char *name = TYPE_FIELD_NAME (templ_type, field_num); - return name != NULL + return name != NULL && TYPE_CODE (TYPE_FIELD_TYPE (templ_type, field_num)) == TYPE_CODE_PTR && strstr (name, "___XVL") != NULL; } @@ -5922,8 +5976,8 @@ is_dynamic_field (struct type* templ_type, int field_num) /* Assuming that TYPE is a struct type, returns non-zero iff TYPE contains a variant part. */ -static int -contains_variant_part (struct type* type) +static int +contains_variant_part (struct type *type) { int f; @@ -5934,10 +5988,10 @@ contains_variant_part (struct type* type) } /* A record type with no fields, . */ -static struct type* -empty_record (struct objfile* objfile) +static struct type * +empty_record (struct objfile *objfile) { - struct type* type = alloc_type (objfile); + struct type *type = alloc_type (objfile); TYPE_CODE (type) = TYPE_CODE_STRUCT; TYPE_NFIELDS (type) = 0; TYPE_FIELDS (type) = NULL; @@ -5960,13 +6014,13 @@ empty_record (struct objfile* objfile) * variants occupy whole numbers of bytes. However, they need not be * byte-aligned. */ -static struct type* -template_to_fixed_record_type (struct type* type, char* valaddr, - CORE_ADDR address, struct value* dval0) +static struct type * +template_to_fixed_record_type (struct type *type, char *valaddr, + CORE_ADDR address, struct value *dval0) { - struct value* mark = value_mark(); - struct value* dval; - struct type* rtype; + struct value *mark = value_mark (); + struct value *dval; + struct type *rtype; int nfields, bit_len; long off; int f; @@ -5976,44 +6030,44 @@ template_to_fixed_record_type (struct type* type, char* valaddr, TYPE_CODE (rtype) = TYPE_CODE_STRUCT; INIT_CPLUS_SPECIFIC (rtype); TYPE_NFIELDS (rtype) = nfields; - TYPE_FIELDS (rtype) = (struct field*) + TYPE_FIELDS (rtype) = (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); memset (TYPE_FIELDS (rtype), 0, sizeof (struct field) * nfields); TYPE_NAME (rtype) = ada_type_name (type); TYPE_TAG_NAME (rtype) = NULL; /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in - gdbtypes.h */ - /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE;*/ + gdbtypes.h */ + /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */ - off = 0; bit_len = 0; + off = 0; + bit_len = 0; for (f = 0; f < nfields; f += 1) { int fld_bit_len, bit_incr; - off = - align_value (off, field_alignment (type, f))+TYPE_FIELD_BITPOS (type,f); + off = + align_value (off, + field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f); /* NOTE: used to use field_offset above, but that causes * problems with really negative bit positions. So, let's * rediscover why we needed field_offset and fix it properly. */ TYPE_FIELD_BITPOS (rtype, f) = off; - TYPE_FIELD_BITSIZE (rtype, f) = 0; + TYPE_FIELD_BITSIZE (rtype, f) = 0; - if (ada_is_variant_part (type, f)) + if (ada_is_variant_part (type, f)) { struct type *branch_type; if (dval0 == NULL) - dval = - value_from_contents_and_address (rtype, valaddr, address); + dval = value_from_contents_and_address (rtype, valaddr, address); else dval = dval0; - branch_type = - to_fixed_variant_branch_type - (TYPE_FIELD_TYPE (type, f), - cond_offset_host (valaddr, off / TARGET_CHAR_BIT), - cond_offset_target (address, off / TARGET_CHAR_BIT), - dval); - if (branch_type == NULL) + branch_type = + to_fixed_variant_branch_type + (TYPE_FIELD_TYPE (type, f), + cond_offset_host (valaddr, off / TARGET_CHAR_BIT), + cond_offset_target (address, off / TARGET_CHAR_BIT), dval); + if (branch_type == NULL) TYPE_NFIELDS (rtype) -= 1; else { @@ -6027,18 +6081,16 @@ template_to_fixed_record_type (struct type* type, char* valaddr, else if (is_dynamic_field (type, f)) { if (dval0 == NULL) - dval = - value_from_contents_and_address (rtype, valaddr, address); + dval = value_from_contents_and_address (rtype, valaddr, address); else dval = dval0; - TYPE_FIELD_TYPE (rtype, f) = - ada_to_fixed_type - (ada_get_base_type - (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))), - cond_offset_host (valaddr, off / TARGET_CHAR_BIT), - cond_offset_target (address, off / TARGET_CHAR_BIT), - dval); + TYPE_FIELD_TYPE (rtype, f) = + ada_to_fixed_type + (ada_get_base_type + (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))), + cond_offset_host (valaddr, off / TARGET_CHAR_BIT), + cond_offset_target (address, off / TARGET_CHAR_BIT), dval); TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f); bit_incr = fld_bit_len = TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT; @@ -6048,7 +6100,7 @@ template_to_fixed_record_type (struct type* type, char* valaddr, TYPE_FIELD_TYPE (rtype, f) = TYPE_FIELD_TYPE (type, f); TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f); if (TYPE_FIELD_BITSIZE (type, f) > 0) - bit_incr = fld_bit_len = + bit_incr = fld_bit_len = TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f); else bit_incr = fld_bit_len = @@ -6062,7 +6114,7 @@ template_to_fixed_record_type (struct type* type, char* valaddr, TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), TYPE_LENGTH (type)); value_free_to_mark (mark); - if (TYPE_LENGTH (rtype) > varsize_limit) + if (TYPE_LENGTH (rtype) > varsize_limit) error ("record type with dynamic size is larger than varsize-limit"); return rtype; } @@ -6074,8 +6126,8 @@ template_to_fixed_record_type (struct type* type, char* valaddr, Representation note: to save space, we memoize the result of this function in the TYPE_TARGET_TYPE of the template type. */ -static struct type* -template_to_static_fixed_type (struct type* templ_type) +static struct type * +template_to_static_fixed_type (struct type *templ_type) { struct type *type; int nfields; @@ -6085,34 +6137,35 @@ template_to_static_fixed_type (struct type* templ_type) return TYPE_TARGET_TYPE (templ_type); nfields = TYPE_NFIELDS (templ_type); - TYPE_TARGET_TYPE (templ_type) = type = alloc_type (TYPE_OBJFILE (templ_type)); + TYPE_TARGET_TYPE (templ_type) = type = + alloc_type (TYPE_OBJFILE (templ_type)); TYPE_CODE (type) = TYPE_CODE (templ_type); INIT_CPLUS_SPECIFIC (type); TYPE_NFIELDS (type) = nfields; - TYPE_FIELDS (type) = (struct field*) + TYPE_FIELDS (type) = (struct field *) TYPE_ALLOC (type, nfields * sizeof (struct field)); memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nfields); TYPE_NAME (type) = ada_type_name (templ_type); TYPE_TAG_NAME (type) = NULL; - /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* TYPE_FLAGS (type) |= TYPE_FLAG_FIXED_INSTANCE; */ TYPE_LENGTH (type) = 0; for (f = 0; f < nfields; f += 1) { TYPE_FIELD_BITPOS (type, f) = 0; - TYPE_FIELD_BITSIZE (type, f) = 0; + TYPE_FIELD_BITSIZE (type, f) = 0; if (is_dynamic_field (templ_type, f)) { - TYPE_FIELD_TYPE (type, f) = - to_static_fixed_type (TYPE_TARGET_TYPE + TYPE_FIELD_TYPE (type, f) = + to_static_fixed_type (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (templ_type, f))); TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f); } else { - TYPE_FIELD_TYPE (type, f) = + TYPE_FIELD_TYPE (type, f) = check_typedef (TYPE_FIELD_TYPE (templ_type, f)); TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f); } @@ -6124,12 +6177,12 @@ template_to_static_fixed_type (struct type* templ_type) /* A revision of TYPE0 -- a non-dynamic-sized record with a variant part -- in which the variant part is replaced with the appropriate branch. */ -static struct type* -to_record_with_fixed_variant_part (struct type* type, char* valaddr, - CORE_ADDR address, struct value* dval) +static struct type * +to_record_with_fixed_variant_part (struct type *type, char *valaddr, + CORE_ADDR address, struct value *dval) { - struct value* mark = value_mark(); - struct type* rtype; + struct value *mark = value_mark (); + struct type *rtype; struct type *branch_type; int nfields = TYPE_NFIELDS (type); @@ -6140,38 +6193,41 @@ to_record_with_fixed_variant_part (struct type* type, char* valaddr, TYPE_CODE (rtype) = TYPE_CODE_STRUCT; INIT_CPLUS_SPECIFIC (type); TYPE_NFIELDS (rtype) = TYPE_NFIELDS (type); - TYPE_FIELDS (rtype) = - (struct field*) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); - memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type), + TYPE_FIELDS (rtype) = + (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); + memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type), sizeof (struct field) * nfields); TYPE_NAME (rtype) = ada_type_name (type); TYPE_TAG_NAME (rtype) = NULL; - /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */ TYPE_LENGTH (rtype) = TYPE_LENGTH (type); - branch_type = - to_fixed_variant_branch_type - (TYPE_FIELD_TYPE (type, nfields - 1), - cond_offset_host (valaddr, - TYPE_FIELD_BITPOS (type, nfields-1) / TARGET_CHAR_BIT), - cond_offset_target (address, - TYPE_FIELD_BITPOS (type, nfields-1) / TARGET_CHAR_BIT), - dval); - if (branch_type == NULL) + branch_type = + to_fixed_variant_branch_type + (TYPE_FIELD_TYPE (type, nfields - 1), + cond_offset_host (valaddr, + TYPE_FIELD_BITPOS (type, + nfields - 1) / TARGET_CHAR_BIT), + cond_offset_target (address, + TYPE_FIELD_BITPOS (type, + nfields - 1) / TARGET_CHAR_BIT), + dval); + if (branch_type == NULL) { TYPE_NFIELDS (rtype) -= 1; - TYPE_LENGTH (rtype) -= TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); + TYPE_LENGTH (rtype) -= + TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); } else { - TYPE_FIELD_TYPE (rtype, nfields-1) = branch_type; - TYPE_FIELD_NAME (rtype, nfields-1) = "S"; - TYPE_FIELD_BITSIZE (rtype, nfields-1) = 0; + TYPE_FIELD_TYPE (rtype, nfields - 1) = branch_type; + TYPE_FIELD_NAME (rtype, nfields - 1) = "S"; + TYPE_FIELD_BITSIZE (rtype, nfields - 1) = 0; TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type); - - TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); + -TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); } - + return rtype; } @@ -6181,19 +6237,19 @@ to_record_with_fixed_variant_part (struct type* type, char* valaddr, should be in DVAL, a record value; it should be NULL if the object at ADDR itself contains any necessary discriminant values. A variant field (unless unchecked) is replaced by a particular branch - of the variant. */ + of the variant. */ -static struct type* -to_fixed_record_type (struct type* type0, char* valaddr, CORE_ADDR address, - struct value* dval) +static struct type * +to_fixed_record_type (struct type *type0, char *valaddr, CORE_ADDR address, + struct value *dval) { - struct type* templ_type; + struct type *templ_type; /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE) - return type0; - */ - templ_type = dynamic_template_type (type0); + return type0; + */ + templ_type = dynamic_template_type (type0); if (templ_type != NULL) return template_to_fixed_record_type (templ_type, valaddr, address, dval); @@ -6201,7 +6257,7 @@ to_fixed_record_type (struct type* type0, char* valaddr, CORE_ADDR address, return to_record_with_fixed_variant_part (type0, valaddr, address, dval); else { - /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* TYPE_FLAGS (type0) |= TYPE_FLAG_FIXED_INSTANCE; */ return type0; } @@ -6215,17 +6271,17 @@ to_fixed_record_type (struct type* type0, char* valaddr, CORE_ADDR address, branch of the union at ADDR according to the discriminant value indicated in the union's type name. */ -static struct type* -to_fixed_variant_branch_type (struct type* var_type0, char* valaddr, - CORE_ADDR address, struct value* dval) +static struct type * +to_fixed_variant_branch_type (struct type *var_type0, char *valaddr, + CORE_ADDR address, struct value *dval) { int which; - struct type* templ_type; - struct type* var_type; + struct type *templ_type; + struct type *var_type; if (TYPE_CODE (var_type0) == TYPE_CODE_PTR) var_type = TYPE_TARGET_TYPE (var_type0); - else + else var_type = var_type0; templ_type = ada_find_parallel_type (var_type, "___XVU"); @@ -6233,21 +6289,21 @@ to_fixed_variant_branch_type (struct type* var_type0, char* valaddr, if (templ_type != NULL) var_type = templ_type; - which = - ada_which_variant_applies (var_type, + which = + ada_which_variant_applies (var_type, VALUE_TYPE (dval), VALUE_CONTENTS (dval)); if (which < 0) return empty_record (TYPE_OBJFILE (var_type)); else if (is_dynamic_field (var_type, which)) - return - to_fixed_record_type - (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)), - valaddr, address, dval); + return + to_fixed_record_type + (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)), + valaddr, address, dval); else if (contains_variant_part (TYPE_FIELD_TYPE (var_type, which))) - return - to_fixed_record_type - (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval); + return + to_fixed_record_type + (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval); else return TYPE_FIELD_TYPE (var_type, which); } @@ -6261,17 +6317,17 @@ to_fixed_variant_branch_type (struct type* var_type0, char* valaddr, varsize_limit. */ -static struct type* -to_fixed_array_type (struct type* type0, struct value* dval, +static struct type * +to_fixed_array_type (struct type *type0, struct value *dval, int ignore_too_big) { - struct type* index_type_desc; - struct type* result; + struct type *index_type_desc; + struct type *result; /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ - /* if (ada_is_packed_array_type (type0) /* revisit? */ /* - || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)) - return type0;*/ +/* if (ada_is_packed_array_type (type0) /* revisit? *//* + || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)) + return type0; */ index_type_desc = ada_find_parallel_type (type0, "___XA"); if (index_type_desc == NULL) @@ -6279,14 +6335,13 @@ to_fixed_array_type (struct type* type0, struct value* dval, struct type *elt_type0 = check_typedef (TYPE_TARGET_TYPE (type0)); /* NOTE: elt_type---the fixed version of elt_type0---should never * depend on the contents of the array in properly constructed - * debugging data. */ - struct type *elt_type = - ada_to_fixed_type (elt_type0, 0, 0, dval); + * debugging data. */ + struct type *elt_type = ada_to_fixed_type (elt_type0, 0, 0, dval); if (elt_type0 == elt_type) result = type0; else - result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), + result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), elt_type, TYPE_INDEX_TYPE (type0)); } else @@ -6300,25 +6355,24 @@ to_fixed_array_type (struct type* type0, struct value* dval, /* NOTE: result---the fixed version of elt_type0---should never * depend on the contents of the array in properly constructed - * debugging data. */ - result = - ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval); + * debugging data. */ + result = ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval); for (i = TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1) { - struct type *range_type = + struct type *range_type = to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i), dval, TYPE_OBJFILE (type0)); result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), result, range_type); } - if (! ignore_too_big && TYPE_LENGTH (result) > varsize_limit) + if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit) error ("array type with dynamic size is larger than varsize-limit"); } /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* TYPE_FLAGS (result) |= TYPE_FLAG_FIXED_INSTANCE; */ return result; -} +} /* A standard type (containing no dynamically sized components) @@ -6326,50 +6380,51 @@ to_fixed_array_type (struct type* type0, struct value* dval, DVAL describes a record containing any discriminants used in TYPE0, and may be NULL if there are none. */ -struct type* -ada_to_fixed_type (struct type* type, char* valaddr, CORE_ADDR address, - struct value* dval) +struct type * +ada_to_fixed_type (struct type *type, char *valaddr, CORE_ADDR address, + struct value *dval) { CHECK_TYPEDEF (type); - switch (TYPE_CODE (type)) { - default: - return type; - case TYPE_CODE_STRUCT: - return to_fixed_record_type (type, valaddr, address, NULL); - case TYPE_CODE_ARRAY: - return to_fixed_array_type (type, dval, 0); - case TYPE_CODE_UNION: - if (dval == NULL) + switch (TYPE_CODE (type)) + { + default: return type; - else - return to_fixed_variant_branch_type (type, valaddr, address, dval); - } + case TYPE_CODE_STRUCT: + return to_fixed_record_type (type, valaddr, address, NULL); + case TYPE_CODE_ARRAY: + return to_fixed_array_type (type, dval, 0); + case TYPE_CODE_UNION: + if (dval == NULL) + return type; + else + return to_fixed_variant_branch_type (type, valaddr, address, dval); + } } /* A standard (static-sized) type corresponding as well as possible to TYPE0, but based on no runtime data. */ -static struct type* -to_static_fixed_type (struct type* type0) +static struct type * +to_static_fixed_type (struct type *type0) { - struct type* type; + struct type *type; if (type0 == NULL) return NULL; /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ /* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE) - return type0; - */ + return type0; + */ CHECK_TYPEDEF (type0); - + switch (TYPE_CODE (type0)) { default: return type0; case TYPE_CODE_STRUCT: type = dynamic_template_type (type0); - if (type != NULL) + if (type != NULL) return template_to_static_fixed_type (type); return type0; case TYPE_CODE_UNION: @@ -6381,21 +6436,21 @@ to_static_fixed_type (struct type* type0) } /* A static approximation of TYPE with all type wrappers removed. */ -static struct type* -static_unwrap_type (struct type* type) +static struct type * +static_unwrap_type (struct type *type) { if (ada_is_aligner_type (type)) { - struct type* type1 = TYPE_FIELD_TYPE (check_typedef (type), 0); + struct type *type1 = TYPE_FIELD_TYPE (check_typedef (type), 0); if (ada_type_name (type1) == NULL) TYPE_NAME (type1) = ada_type_name (type); return static_unwrap_type (type1); } - else + else { - struct type* raw_real_type = ada_get_base_type (type); - if (raw_real_type == type) + struct type *raw_real_type = ada_get_base_type (type); + if (raw_real_type == type) return type; else return to_static_fixed_type (raw_real_type); @@ -6415,18 +6470,18 @@ static_unwrap_type (struct type* type) /* A type equivalent to TYPE that is not a non-record stub, if one exists, otherwise TYPE. */ -struct type* -ada_completed_type (struct type* type) +struct type * +ada_completed_type (struct type *type) { CHECK_TYPEDEF (type); if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM || (TYPE_FLAGS (type) & TYPE_FLAG_STUB) == 0 || TYPE_TAG_NAME (type) == NULL) return type; - else + else { - char* name = TYPE_TAG_NAME (type); - struct type* type1 = ada_find_any_type (name); + char *name = TYPE_TAG_NAME (type); + struct type *type1 = ada_find_any_type (name); return (type1 == NULL) ? type : type1; } } @@ -6435,16 +6490,17 @@ ada_completed_type (struct type* type) type TYPE0, but with a standard (static-sized) type that correctly describes it. If VAL0 is not NULL and TYPE0 already is a standard type, then return VAL0 [this feature is simply to avoid redundant - creation of struct values]. */ + creation of struct values]. */ -struct value* -ada_to_fixed_value (struct type* type0, char* valaddr, CORE_ADDR address, - struct value* val0) +struct value * +ada_to_fixed_value (struct type *type0, char *valaddr, CORE_ADDR address, + struct value *val0) { - struct type* type = ada_to_fixed_type (type0, valaddr, address, NULL); + struct type *type = ada_to_fixed_type (type0, valaddr, address, NULL); if (type == type0 && val0 != NULL) return val0; - else return value_from_contents_and_address (type, valaddr, address); + else + return value_from_contents_and_address (type, valaddr, address); } /* A value representing VAL, but with a standard (static-sized) type @@ -6452,19 +6508,19 @@ ada_to_fixed_value (struct type* type0, char* valaddr, CORE_ADDR address, without consulting any runtime values. For Ada dynamic-sized types, therefore, the type of the result is likely to be inaccurate. */ -struct value* -ada_to_static_fixed_value (struct value* val) +struct value * +ada_to_static_fixed_value (struct value *val) { - struct type *type = + struct type *type = to_static_fixed_type (static_unwrap_type (VALUE_TYPE (val))); if (type == VALUE_TYPE (val)) return val; else return coerce_unspec_val_to_type (val, 0, type); } + - /* Attributes */ @@ -6472,24 +6528,23 @@ ada_to_static_fixed_value (struct value* val) /* Table mapping attribute numbers to names */ /* NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h */ -static const char* attribute_names[] = { +static const char *attribute_names[] = { "", - "first", + "first", "last", "length", "image", "img", "max", "min", - "pos" - "tag", + "pos" "tag", "val", 0 }; -const char* +const char * ada_attribute_name (int n) { if (n > 0 && n < (int) ATR_END) @@ -6500,12 +6555,12 @@ ada_attribute_name (int n) /* Evaluate the 'POS attribute applied to ARG. */ -static struct value* -value_pos_atr (struct value* arg) +static struct value * +value_pos_atr (struct value *arg) { struct type *type = VALUE_TYPE (arg); - if (! discrete_type_p (type)) + if (!discrete_type_p (type)) error ("'POS only defined on discrete types"); if (TYPE_CODE (type) == TYPE_CODE_ENUM) @@ -6513,7 +6568,7 @@ value_pos_atr (struct value* arg) int i; LONGEST v = value_as_long (arg); - for (i = 0; i < TYPE_NFIELDS (type); i += 1) + for (i = 0; i < TYPE_NFIELDS (type); i += 1) { if (v == TYPE_FIELD_BITPOS (type, i)) return value_from_longest (builtin_type_ada_int, i); @@ -6526,12 +6581,12 @@ value_pos_atr (struct value* arg) /* Evaluate the TYPE'VAL attribute applied to ARG. */ -static struct value* -value_val_atr (struct type *type, struct value* arg) +static struct value * +value_val_atr (struct type *type, struct value *arg) { - if (! discrete_type_p (type)) + if (!discrete_type_p (type)) error ("'VAL only defined on discrete types"); - if (! integer_type_p (VALUE_TYPE (arg))) + if (!integer_type_p (VALUE_TYPE (arg))) error ("'VAL requires integral argument"); if (TYPE_CODE (type) == TYPE_CODE_ENUM) @@ -6539,27 +6594,26 @@ value_val_atr (struct type *type, struct value* arg) long pos = value_as_long (arg); if (pos < 0 || pos >= TYPE_NFIELDS (type)) error ("argument to 'VAL out of range"); - return - value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); } else return value_from_longest (type, value_as_long (arg)); } - + /* Evaluation */ /* True if TYPE appears to be an Ada character type. * [At the moment, this is true only for Character and Wide_Character; * It is a heuristic test that could stand improvement]. */ -int -ada_is_character_type (struct type* type) +int +ada_is_character_type (struct type *type) { - const char* name = ada_type_name (type); - return + const char *name = ada_type_name (type); + return name != NULL - && (TYPE_CODE (type) == TYPE_CODE_CHAR + && (TYPE_CODE (type) == TYPE_CODE_CHAR || TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_RANGE) && (STREQ (name, "character") || STREQ (name, "wide_character") @@ -6572,7 +6626,7 @@ int ada_is_string_type (struct type *type) { CHECK_TYPEDEF (type); - if (type != NULL + if (type != NULL && TYPE_CODE (type) != TYPE_CODE_PTR && (ada_is_simple_array (type) || ada_is_array_descriptor (type)) && ada_array_arity (type) == 1) @@ -6581,7 +6635,7 @@ ada_is_string_type (struct type *type) return ada_is_character_type (elttype); } - else + else return 0; } @@ -6602,33 +6656,33 @@ ada_is_aligner_type (struct type *type) /* If there is an ___XVS-convention type parallel to SUBTYPE, return the parallel type. */ -struct type* -ada_get_base_type (struct type* raw_type) +struct type * +ada_get_base_type (struct type *raw_type) { - struct type* real_type_namer; - struct type* raw_real_type; - struct type* real_type; + struct type *real_type_namer; + struct type *raw_real_type; + struct type *real_type; if (raw_type == NULL || TYPE_CODE (raw_type) != TYPE_CODE_STRUCT) return raw_type; real_type_namer = ada_find_parallel_type (raw_type, "___XVS"); - if (real_type_namer == NULL + if (real_type_namer == NULL || TYPE_CODE (real_type_namer) != TYPE_CODE_STRUCT || TYPE_NFIELDS (real_type_namer) != 1) return raw_type; raw_real_type = ada_find_any_type (TYPE_FIELD_NAME (real_type_namer, 0)); - if (raw_real_type == NULL) + if (raw_real_type == NULL) return raw_type; else return raw_real_type; -} +} /* The type of value designated by TYPE, with all aligners removed. */ -struct type* -ada_aligned_type (struct type* type) +struct type * +ada_aligned_type (struct type *type) { if (ada_is_aligner_type (type)) return ada_aligned_type (TYPE_FIELD_TYPE (type, 0)); @@ -6640,30 +6694,31 @@ ada_aligned_type (struct type* type) /* The address of the aligned value in an object at address VALADDR having type TYPE. Assumes ada_is_aligner_type (TYPE). */ -char* +char * ada_aligned_value_addr (struct type *type, char *valaddr) { - if (ada_is_aligner_type (type)) + if (ada_is_aligner_type (type)) return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0), - valaddr + - TYPE_FIELD_BITPOS (type, 0)/TARGET_CHAR_BIT); + valaddr + + TYPE_FIELD_BITPOS (type, + 0) / TARGET_CHAR_BIT); else return valaddr; } /* The printed representation of an enumeration literal with encoded name NAME. The value is good to the next call of ada_enum_name. */ -const char* -ada_enum_name (const char* name) +const char * +ada_enum_name (const char *name) { - char* tmp; + char *tmp; - while (1) + while (1) { if ((tmp = strstr (name, "__")) != NULL) - name = tmp+2; + name = tmp + 2; else if ((tmp = strchr (name, '.')) != NULL) - name = tmp+1; + name = tmp + 1; else break; } @@ -6674,7 +6729,7 @@ ada_enum_name (const char* name) int v; if (name[1] == 'U' || name[1] == 'W') { - if (sscanf (name+2, "%x", &v) != 1) + if (sscanf (name + 2, "%x", &v) != 1) return name; } else @@ -6689,11 +6744,11 @@ ada_enum_name (const char* name) return result; } - else + else return name; } -static struct value* +static struct value * evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, enum noside noside) { @@ -6704,60 +6759,60 @@ evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, evaluate_type, updating *POS to point just past the evaluated expression. */ -static struct value* -evaluate_subexp_type (struct expression* exp, int* pos) +static struct value * +evaluate_subexp_type (struct expression *exp, int *pos) { - return (*exp->language_defn->evaluate_exp) + return (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); } /* If VAL is wrapped in an aligner or subtype wrapper, return the - value it wraps. */ + value it wraps. */ -static struct value* -unwrap_value (struct value* val) +static struct value * +unwrap_value (struct value *val) { - struct type* type = check_typedef (VALUE_TYPE (val)); + struct type *type = check_typedef (VALUE_TYPE (val)); if (ada_is_aligner_type (type)) { - struct value* v = value_struct_elt (&val, NULL, "F", - NULL, "internal structure"); - struct type* val_type = check_typedef (VALUE_TYPE (v)); + struct value *v = value_struct_elt (&val, NULL, "F", + NULL, "internal structure"); + struct type *val_type = check_typedef (VALUE_TYPE (v)); if (ada_type_name (val_type) == NULL) TYPE_NAME (val_type) = ada_type_name (type); return unwrap_value (v); } - else + else { - struct type* raw_real_type = + struct type *raw_real_type = ada_completed_type (ada_get_base_type (type)); - + if (type == raw_real_type) return val; - return - coerce_unspec_val_to_type + return + coerce_unspec_val_to_type (val, 0, ada_to_fixed_type (raw_real_type, 0, VALUE_ADDRESS (val) + VALUE_OFFSET (val), NULL)); } } - -static struct value* -cast_to_fixed (struct type *type, struct value* arg) + +static struct value * +cast_to_fixed (struct type *type, struct value *arg) { LONGEST val; if (type == VALUE_TYPE (arg)) return arg; else if (ada_is_fixed_point_type (VALUE_TYPE (arg))) - val = ada_float_to_fixed (type, + val = ada_float_to_fixed (type, ada_fixed_to_float (VALUE_TYPE (arg), value_as_long (arg))); - else + else { - DOUBLEST argd = + DOUBLEST argd = value_as_double (value_cast (builtin_type_double, value_copy (arg))); val = ada_float_to_fixed (type, argd); } @@ -6765,8 +6820,8 @@ cast_to_fixed (struct type *type, struct value* arg) return value_from_longest (type, val); } -static struct value* -cast_from_fixed_to_double (struct value* arg) +static struct value * +cast_from_fixed_to_double (struct value *arg) { DOUBLEST val = ada_fixed_to_float (VALUE_TYPE (arg), value_as_long (arg)); @@ -6775,35 +6830,36 @@ cast_from_fixed_to_double (struct value* arg) /* Coerce VAL as necessary for assignment to an lval of type TYPE, and * return the converted value. */ -static struct value* -coerce_for_assign (struct type* type, struct value* val) +static struct value * +coerce_for_assign (struct type *type, struct value *val) { - struct type* type2 = VALUE_TYPE (val); + struct type *type2 = VALUE_TYPE (val); if (type == type2) return val; CHECK_TYPEDEF (type2); CHECK_TYPEDEF (type); - if (TYPE_CODE (type2) == TYPE_CODE_PTR && TYPE_CODE (type) == TYPE_CODE_ARRAY) + if (TYPE_CODE (type2) == TYPE_CODE_PTR + && TYPE_CODE (type) == TYPE_CODE_ARRAY) { val = ada_value_ind (val); type2 = VALUE_TYPE (val); } - if (TYPE_CODE (type2) == TYPE_CODE_ARRAY + if (TYPE_CODE (type2) == TYPE_CODE_ARRAY && TYPE_CODE (type) == TYPE_CODE_ARRAY) { if (TYPE_LENGTH (type2) != TYPE_LENGTH (type) || TYPE_LENGTH (TYPE_TARGET_TYPE (type2)) - != TYPE_LENGTH (TYPE_TARGET_TYPE (type2))) + != TYPE_LENGTH (TYPE_TARGET_TYPE (type2))) error ("Incompatible types in assignment"); VALUE_TYPE (val) = type; } - return val; + return val; } -struct value* +struct value * ada_evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, enum noside noside) { @@ -6814,16 +6870,19 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, struct value *arg1 = NULL, *arg2 = NULL, *arg3; struct type *type; int nargs; - struct value* *argvec; + struct value **argvec; - pc = *pos; *pos += 1; + pc = *pos; + *pos += 1; op = exp->elts[pc].opcode; - switch (op) + switch (op) { default: *pos -= 1; - return unwrap_value (evaluate_subexp_standard (expect_type, exp, pos, noside)); + return + unwrap_value (evaluate_subexp_standard + (expect_type, exp, pos, noside)); case UNOP_CAST: (*pos) += 2; @@ -6837,30 +6896,30 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, arg1 = cast_to_fixed (type, arg1); else if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) arg1 = value_cast (type, cast_from_fixed_to_double (arg1)); - else if (VALUE_LVAL (arg1) == lval_memory) + else if (VALUE_LVAL (arg1) == lval_memory) { /* This is in case of the really obscure (and undocumented, - but apparently expected) case of (Foo) Bar.all, where Bar - is an integer constant and Foo is a dynamic-sized type. - If we don't do this, ARG1 will simply be relabeled with - TYPE. */ - if (noside == EVAL_AVOID_SIDE_EFFECTS) + but apparently expected) case of (Foo) Bar.all, where Bar + is an integer constant and Foo is a dynamic-sized type. + If we don't do this, ARG1 will simply be relabeled with + TYPE. */ + if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (to_static_fixed_type (type), not_lval); - arg1 = - ada_to_fixed_value - (type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0); + arg1 = + ada_to_fixed_value + (type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0); } - else - arg1 = value_cast (type, arg1); + else + arg1 = value_cast (type, arg1); } return arg1; /* FIXME: UNOP_QUAL should be defined in expression.h */ /* case UNOP_QUAL: - (*pos) += 2; - type = exp->elts[pc + 1].type; - return ada_evaluate_subexp (type, exp, pos, noside); - */ + (*pos) += 2; + type = exp->elts[pc + 1].type; + return ada_evaluate_subexp (type, exp, pos, noside); + */ case BINOP_ASSIGN: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); @@ -6868,13 +6927,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return arg1; if (binop_user_defined_p (op, arg1, arg2)) return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL); - else + else { if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) arg2 = cast_to_fixed (VALUE_TYPE (arg1), arg2); else if (ada_is_fixed_point_type (VALUE_TYPE (arg2))) - error ("Fixed-point values must be assigned to fixed-point variables"); - else + error + ("Fixed-point values must be assigned to fixed-point variables"); + else arg2 = coerce_for_assign (VALUE_TYPE (arg1), arg2); return ada_value_assign (arg1, arg2); } @@ -6891,7 +6951,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if ((ada_is_fixed_point_type (VALUE_TYPE (arg1)) || ada_is_fixed_point_type (VALUE_TYPE (arg2))) && VALUE_TYPE (arg1) != VALUE_TYPE (arg2)) - error ("Operands of fixed-point addition must have the same type"); + error + ("Operands of fixed-point addition must have the same type"); return value_cast (VALUE_TYPE (arg1), value_add (arg1, arg2)); } @@ -6907,7 +6968,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if ((ada_is_fixed_point_type (VALUE_TYPE (arg1)) || ada_is_fixed_point_type (VALUE_TYPE (arg2))) && VALUE_TYPE (arg1) != VALUE_TYPE (arg2)) - error ("Operands of fixed-point subtraction must have the same type"); + error + ("Operands of fixed-point subtraction must have the same type"); return value_cast (VALUE_TYPE (arg1), value_sub (arg1, arg2)); } @@ -6922,7 +6984,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, else if (noside == EVAL_AVOID_SIDE_EFFECTS && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD)) - return value_zero (VALUE_TYPE (arg1), not_lval); + return value_zero (VALUE_TYPE (arg1), not_lval); else { if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) @@ -6945,38 +7007,39 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ /* case OP_UNRESOLVED_VALUE: - /* Only encountered when an unresolved symbol occurs in a + /* Only encountered when an unresolved symbol occurs in a context other than a function call, in which case, it is - illegal. *//* - (*pos) += 3; - if (noside == EVAL_SKIP) - goto nosideret; - else - error ("Unexpected unresolved symbol, %s, during evaluation", - ada_demangle (exp->elts[pc + 2].name)); - */ + illegal. *//* + (*pos) += 3; + if (noside == EVAL_SKIP) + goto nosideret; + else + error ("Unexpected unresolved symbol, %s, during evaluation", + ada_demangle (exp->elts[pc + 2].name)); + */ case OP_VAR_VALUE: *pos -= 1; if (noside == EVAL_SKIP) { *pos += 4; goto nosideret; - } + } else if (noside == EVAL_AVOID_SIDE_EFFECTS) { *pos += 4; - return value_zero - (to_static_fixed_type - (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc+2].symbol))), + return value_zero + (to_static_fixed_type + (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))), not_lval); } - else + else { - arg1 = unwrap_value (evaluate_subexp_standard (expect_type, exp, pos, - noside)); + arg1 = + unwrap_value (evaluate_subexp_standard + (expect_type, exp, pos, noside)); return ada_to_fixed_value (VALUE_TYPE (arg1), 0, - VALUE_ADDRESS (arg1) + VALUE_OFFSET(arg1), - arg1); + VALUE_ADDRESS (arg1) + + VALUE_OFFSET (arg1), arg1); } case OP_ARRAY: @@ -6986,7 +7049,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, nargs = tem3 - tem2 + 1; type = expect_type ? check_typedef (expect_type) : NULL_TYPE; - argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1)); + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 1)); for (tem = 0; tem == 0 || tem < nargs; tem += 1) /* At least one element gets inserted for the type */ { @@ -7001,17 +7065,18 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, (*pos) += 2; /* Allocate arg vector, including space for the function to be - called in argvec[0] and a terminating NULL */ + called in argvec[0] and a terminating NULL */ nargs = longest_to_int (exp->elts[pc + 1].longconst); - argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 2)); + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 2)); /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ /* FIXME: name should be defined in expresion.h */ /* if (exp->elts[*pos].opcode == OP_UNRESOLVED_VALUE) - error ("Unexpected unresolved symbol, %s, during evaluation", - ada_demangle (exp->elts[pc + 5].name)); - */ - if (0) + error ("Unexpected unresolved symbol, %s, during evaluation", + ada_demangle (exp->elts[pc + 5].name)); + */ + if (0) { error ("unexpected code path, FIXME"); } @@ -7033,7 +7098,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, type = check_typedef (VALUE_TYPE (argvec[0])); if (TYPE_CODE (type) == TYPE_CODE_PTR) - { + { switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type)))) { case TYPE_CODE_FUNC: @@ -7050,53 +7115,55 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, error ("cannot subscript or call something of type `%s'", ada_type_name (VALUE_TYPE (argvec[0]))); break; - } + } } - + switch (TYPE_CODE (type)) { case TYPE_CODE_FUNC: if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_TARGET_TYPE (type)); return call_function_by_hand (argvec[0], nargs, argvec + 1); - case TYPE_CODE_STRUCT: + case TYPE_CODE_STRUCT: { int arity = ada_array_arity (type); type = ada_array_element_type (type, nargs); - if (type == NULL) + if (type == NULL) error ("cannot subscript or call a record"); - if (arity != nargs) + if (arity != nargs) error ("wrong number of subscripts; expecting %d", arity); - if (noside == EVAL_AVOID_SIDE_EFFECTS) + if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (ada_aligned_type (type)); - return unwrap_value (ada_value_subscript (argvec[0], nargs, argvec+1)); + return + unwrap_value (ada_value_subscript + (argvec[0], nargs, argvec + 1)); } case TYPE_CODE_ARRAY: if (noside == EVAL_AVOID_SIDE_EFFECTS) - { + { type = ada_array_element_type (type, nargs); if (type == NULL) error ("element type of array unknown"); else return allocate_value (ada_aligned_type (type)); } - return + return unwrap_value (ada_value_subscript (ada_coerce_to_simple_array (argvec[0]), - nargs, argvec+1)); - case TYPE_CODE_PTR: /* Pointer to array */ + nargs, argvec + 1)); + case TYPE_CODE_PTR: /* Pointer to array */ type = to_fixed_array_type (TYPE_TARGET_TYPE (type), NULL, 1); if (noside == EVAL_AVOID_SIDE_EFFECTS) - { + { type = ada_array_element_type (type, nargs); if (type == NULL) error ("element type of array unknown"); else return allocate_value (ada_aligned_type (type)); } - return - unwrap_value (ada_value_ptr_subscript (argvec[0], type, - nargs, argvec+1)); + return + unwrap_value (ada_value_ptr_subscript (argvec[0], type, + nargs, argvec + 1)); default: error ("Internal error in evaluate_subexp"); @@ -7104,47 +7171,46 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case TERNOP_SLICE: { - struct value* array = evaluate_subexp (NULL_TYPE, exp, pos, noside); + struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside); int lowbound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); int upper = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); if (noside == EVAL_SKIP) goto nosideret; - - /* If this is a reference to an array, then dereference it */ - if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF - && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL - && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == - TYPE_CODE_ARRAY - && !ada_is_array_descriptor (check_typedef (VALUE_TYPE - (array)))) - { - array = ada_coerce_ref (array); - } + + /* If this is a reference to an array, then dereference it */ + if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF + && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL + && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == + TYPE_CODE_ARRAY + && !ada_is_array_descriptor (check_typedef (VALUE_TYPE (array)))) + { + array = ada_coerce_ref (array); + } if (noside == EVAL_AVOID_SIDE_EFFECTS && ada_is_array_descriptor (check_typedef (VALUE_TYPE (array)))) { /* Try to dereference the array, in case it is an access to array */ - struct type * arrType = ada_type_of_array (array, 0); + struct type *arrType = ada_type_of_array (array, 0); if (arrType != NULL) - array = value_at_lazy (arrType, 0, NULL); + array = value_at_lazy (arrType, 0, NULL); } if (ada_is_array_descriptor (VALUE_TYPE (array))) array = ada_coerce_to_simple_array (array); - /* If at this point we have a pointer to an array, it means that - it is a pointer to a simple (non-ada) array. We just then - dereference it */ - if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR - && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL - && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == - TYPE_CODE_ARRAY) - { - array = ada_value_ind (array); - } - + /* If at this point we have a pointer to an array, it means that + it is a pointer to a simple (non-ada) array. We just then + dereference it */ + if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR + && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL + && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == + TYPE_CODE_ARRAY) + { + array = ada_value_ind (array); + } + if (noside == EVAL_AVOID_SIDE_EFFECTS) /* The following will get the bounds wrong, but only in contexts where the value is not being requested (FIXME?). */ @@ -7155,295 +7221,295 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, /* FIXME: UNOP_MBR should be defined in expression.h */ /* case UNOP_MBR: - (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - type = exp->elts[pc + 1].type; - - if (noside == EVAL_SKIP) - goto nosideret; - - switch (TYPE_CODE (type)) - { - default: - warning ("Membership test incompletely implemented; always returns true"); - return value_from_longest (builtin_type_int, (LONGEST) 1); - - case TYPE_CODE_RANGE: - arg2 = value_from_longest (builtin_type_int, - (LONGEST) TYPE_LOW_BOUND (type)); - arg3 = value_from_longest (builtin_type_int, - (LONGEST) TYPE_HIGH_BOUND (type)); - return - value_from_longest (builtin_type_int, - (value_less (arg1,arg3) - || value_equal (arg1,arg3)) - && (value_less (arg2,arg1) - || value_equal (arg2,arg1))); - } - */ - /* FIXME: BINOP_MBR should be defined in expression.h */ + (*pos) += 2; + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type = exp->elts[pc + 1].type; + + if (noside == EVAL_SKIP) + goto nosideret; + + switch (TYPE_CODE (type)) + { + default: + warning ("Membership test incompletely implemented; always returns true"); + return value_from_longest (builtin_type_int, (LONGEST) 1); + + case TYPE_CODE_RANGE: + arg2 = value_from_longest (builtin_type_int, + (LONGEST) TYPE_LOW_BOUND (type)); + arg3 = value_from_longest (builtin_type_int, + (LONGEST) TYPE_HIGH_BOUND (type)); + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + } + */ + /* FIXME: BINOP_MBR should be defined in expression.h */ /* case BINOP_MBR: - (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + (*pos) += 2; + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) - goto nosideret; + if (noside == EVAL_SKIP) + goto nosideret; - if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (builtin_type_int, not_lval); + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_int, not_lval); - tem = longest_to_int (exp->elts[pc + 1].longconst); + tem = longest_to_int (exp->elts[pc + 1].longconst); - if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2))) - error ("invalid dimension number to '%s", "range"); + if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2))) + error ("invalid dimension number to '%s", "range"); - arg3 = ada_array_bound (arg2, tem, 1); - arg2 = ada_array_bound (arg2, tem, 0); + arg3 = ada_array_bound (arg2, tem, 1); + arg2 = ada_array_bound (arg2, tem, 0); - return - value_from_longest (builtin_type_int, - (value_less (arg1,arg3) - || value_equal (arg1,arg3)) - && (value_less (arg2,arg1) - || value_equal (arg2,arg1))); - */ + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + */ /* FIXME: TERNOP_MBR should be defined in expression.h */ /* case TERNOP_MBR: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - - if (noside == EVAL_SKIP) - goto nosideret; - - return - value_from_longest (builtin_type_int, - (value_less (arg1,arg3) - || value_equal (arg1,arg3)) - && (value_less (arg2,arg1) - || value_equal (arg2,arg1))); - */ + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + + if (noside == EVAL_SKIP) + goto nosideret; + + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + */ /* FIXME: OP_ATTRIBUTE should be defined in expression.h */ /* case OP_ATTRIBUTE: - *pos += 3; - atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst); - switch (atr) - { - default: - error ("unexpected attribute encountered"); - - case ATR_FIRST: - case ATR_LAST: - case ATR_LENGTH: - { - struct type* type_arg; - if (exp->elts[*pos].opcode == OP_TYPE) - { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = NULL; - type_arg = exp->elts[pc + 5].type; - } - else - { - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - type_arg = NULL; - } - - if (exp->elts[*pos].opcode != OP_LONG) - error ("illegal operand to '%s", ada_attribute_name (atr)); - tem = longest_to_int (exp->elts[*pos+2].longconst); - *pos += 4; - - if (noside == EVAL_SKIP) - goto nosideret; - - if (type_arg == NULL) - { - arg1 = ada_coerce_ref (arg1); - - if (ada_is_packed_array_type (VALUE_TYPE (arg1))) - arg1 = ada_coerce_to_simple_array (arg1); - - if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1))) - error ("invalid dimension number to '%s", - ada_attribute_name (atr)); - - if (noside == EVAL_AVOID_SIDE_EFFECTS) - { - type = ada_index_type (VALUE_TYPE (arg1), tem); - if (type == NULL) - error ("attempt to take bound of something that is not an array"); - return allocate_value (type); - } - - switch (atr) - { - default: - error ("unexpected attribute encountered"); - case ATR_FIRST: - return ada_array_bound (arg1, tem, 0); - case ATR_LAST: - return ada_array_bound (arg1, tem, 1); - case ATR_LENGTH: - return ada_array_length (arg1, tem); - } - } - else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE - || TYPE_CODE (type_arg) == TYPE_CODE_INT) - { - struct type* range_type; - char* name = ada_type_name (type_arg); - if (name == NULL) - { - if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE) - range_type = type_arg; - else - error ("unimplemented type attribute"); - } - else - range_type = - to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg)); - switch (atr) - { - default: - error ("unexpected attribute encountered"); - case ATR_FIRST: - return value_from_longest (TYPE_TARGET_TYPE (range_type), - TYPE_LOW_BOUND (range_type)); - case ATR_LAST: - return value_from_longest (TYPE_TARGET_TYPE (range_type), - TYPE_HIGH_BOUND (range_type)); - } - } - else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM) - { - switch (atr) - { - default: - error ("unexpected attribute encountered"); - case ATR_FIRST: - return value_from_longest - (type_arg, TYPE_FIELD_BITPOS (type_arg, 0)); - case ATR_LAST: - return value_from_longest - (type_arg, - TYPE_FIELD_BITPOS (type_arg, - TYPE_NFIELDS (type_arg) - 1)); - } - } - else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT) - error ("unimplemented type attribute"); - else - { - LONGEST low, high; - - if (ada_is_packed_array_type (type_arg)) - type_arg = decode_packed_array_type (type_arg); - - if (tem < 1 || tem > ada_array_arity (type_arg)) - error ("invalid dimension number to '%s", - ada_attribute_name (atr)); - - if (noside == EVAL_AVOID_SIDE_EFFECTS) - { - type = ada_index_type (type_arg, tem); - if (type == NULL) - error ("attempt to take bound of something that is not an array"); - return allocate_value (type); - } - - switch (atr) - { - default: - error ("unexpected attribute encountered"); - case ATR_FIRST: - low = ada_array_bound_from_type (type_arg, tem, 0, &type); - return value_from_longest (type, low); - case ATR_LAST: - high = ada_array_bound_from_type (type_arg, tem, 1, &type); - return value_from_longest (type, high); - case ATR_LENGTH: - low = ada_array_bound_from_type (type_arg, tem, 0, &type); - high = ada_array_bound_from_type (type_arg, tem, 1, NULL); - return value_from_longest (type, high-low+1); - } - } - } - - case ATR_TAG: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) - goto nosideret; - - if (noside == EVAL_AVOID_SIDE_EFFECTS) - return - value_zero (ada_tag_type (arg1), not_lval); - - return ada_value_tag (arg1); - - case ATR_MIN: - case ATR_MAX: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) - goto nosideret; - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (VALUE_TYPE (arg1), not_lval); - else - return value_binop (arg1, arg2, - atr == ATR_MIN ? BINOP_MIN : BINOP_MAX); - - case ATR_MODULUS: - { - struct type* type_arg = exp->elts[pc + 5].type; - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - *pos += 4; - - if (noside == EVAL_SKIP) - goto nosideret; - - if (! ada_is_modular_type (type_arg)) - error ("'modulus must be applied to modular type"); - - return value_from_longest (TYPE_TARGET_TYPE (type_arg), - ada_modulus (type_arg)); - } - - - case ATR_POS: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) - goto nosideret; - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (builtin_type_ada_int, not_lval); - else - return value_pos_atr (arg1); - - case ATR_SIZE: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) - goto nosideret; - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (builtin_type_ada_int, not_lval); - else - return value_from_longest (builtin_type_ada_int, - TARGET_CHAR_BIT - * TYPE_LENGTH (VALUE_TYPE (arg1))); - - case ATR_VAL: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - type = exp->elts[pc + 5].type; - if (noside == EVAL_SKIP) - goto nosideret; - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (type, not_lval); - else - return value_val_atr (type, arg1); - }*/ + *pos += 3; + atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst); + switch (atr) + { + default: + error ("unexpected attribute encountered"); + + case ATR_FIRST: + case ATR_LAST: + case ATR_LENGTH: + { + struct type* type_arg; + if (exp->elts[*pos].opcode == OP_TYPE) + { + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = NULL; + type_arg = exp->elts[pc + 5].type; + } + else + { + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type_arg = NULL; + } + + if (exp->elts[*pos].opcode != OP_LONG) + error ("illegal operand to '%s", ada_attribute_name (atr)); + tem = longest_to_int (exp->elts[*pos+2].longconst); + *pos += 4; + + if (noside == EVAL_SKIP) + goto nosideret; + + if (type_arg == NULL) + { + arg1 = ada_coerce_ref (arg1); + + if (ada_is_packed_array_type (VALUE_TYPE (arg1))) + arg1 = ada_coerce_to_simple_array (arg1); + + if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1))) + error ("invalid dimension number to '%s", + ada_attribute_name (atr)); + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_index_type (VALUE_TYPE (arg1), tem); + if (type == NULL) + error ("attempt to take bound of something that is not an array"); + return allocate_value (type); + } + + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return ada_array_bound (arg1, tem, 0); + case ATR_LAST: + return ada_array_bound (arg1, tem, 1); + case ATR_LENGTH: + return ada_array_length (arg1, tem); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE + || TYPE_CODE (type_arg) == TYPE_CODE_INT) + { + struct type* range_type; + char* name = ada_type_name (type_arg); + if (name == NULL) + { + if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE) + range_type = type_arg; + else + error ("unimplemented type attribute"); + } + else + range_type = + to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg)); + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return value_from_longest (TYPE_TARGET_TYPE (range_type), + TYPE_LOW_BOUND (range_type)); + case ATR_LAST: + return value_from_longest (TYPE_TARGET_TYPE (range_type), + TYPE_HIGH_BOUND (range_type)); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM) + { + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return value_from_longest + (type_arg, TYPE_FIELD_BITPOS (type_arg, 0)); + case ATR_LAST: + return value_from_longest + (type_arg, + TYPE_FIELD_BITPOS (type_arg, + TYPE_NFIELDS (type_arg) - 1)); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT) + error ("unimplemented type attribute"); + else + { + LONGEST low, high; + + if (ada_is_packed_array_type (type_arg)) + type_arg = decode_packed_array_type (type_arg); + + if (tem < 1 || tem > ada_array_arity (type_arg)) + error ("invalid dimension number to '%s", + ada_attribute_name (atr)); + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_index_type (type_arg, tem); + if (type == NULL) + error ("attempt to take bound of something that is not an array"); + return allocate_value (type); + } + + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + low = ada_array_bound_from_type (type_arg, tem, 0, &type); + return value_from_longest (type, low); + case ATR_LAST: + high = ada_array_bound_from_type (type_arg, tem, 1, &type); + return value_from_longest (type, high); + case ATR_LENGTH: + low = ada_array_bound_from_type (type_arg, tem, 0, &type); + high = ada_array_bound_from_type (type_arg, tem, 1, NULL); + return value_from_longest (type, high-low+1); + } + } + } + + case ATR_TAG: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return + value_zero (ada_tag_type (arg1), not_lval); + + return ada_value_tag (arg1); + + case ATR_MIN: + case ATR_MAX: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (VALUE_TYPE (arg1), not_lval); + else + return value_binop (arg1, arg2, + atr == ATR_MIN ? BINOP_MIN : BINOP_MAX); + + case ATR_MODULUS: + { + struct type* type_arg = exp->elts[pc + 5].type; + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + *pos += 4; + + if (noside == EVAL_SKIP) + goto nosideret; + + if (! ada_is_modular_type (type_arg)) + error ("'modulus must be applied to modular type"); + + return value_from_longest (TYPE_TARGET_TYPE (type_arg), + ada_modulus (type_arg)); + } + + + case ATR_POS: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_ada_int, not_lval); + else + return value_pos_atr (arg1); + + case ATR_SIZE: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_ada_int, not_lval); + else + return value_from_longest (builtin_type_ada_int, + TARGET_CHAR_BIT + * TYPE_LENGTH (VALUE_TYPE (arg1))); + + case ATR_VAL: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type = exp->elts[pc + 5].type; + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (type, not_lval); + else + return value_val_atr (type, arg1); + } */ case BINOP_EXP: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -7451,10 +7517,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, goto nosideret; if (binop_user_defined_p (op, arg1, arg2)) return unwrap_value (value_x_binop (arg1, arg2, op, OP_NULL, - EVAL_NORMAL)); - else - if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (VALUE_TYPE (arg1), not_lval); + EVAL_NORMAL)); + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (VALUE_TYPE (arg1), not_lval); else return value_binop (arg1, arg2, op); @@ -7478,7 +7543,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case UNOP_IND: if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) - expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); + expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); arg1 = evaluate_subexp (expect_type, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; @@ -7488,21 +7553,20 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (ada_is_array_descriptor (type)) /* GDB allows dereferencing GNAT array descriptors. */ { - struct type* arrType = ada_type_of_array (arg1, 0); + struct type *arrType = ada_type_of_array (arg1, 0); if (arrType == NULL) error ("Attempt to dereference null array pointer."); return value_at_lazy (arrType, 0, NULL); } else if (TYPE_CODE (type) == TYPE_CODE_PTR - || TYPE_CODE (type) == TYPE_CODE_REF - /* In C you can dereference an array to get the 1st elt. */ - || TYPE_CODE (type) == TYPE_CODE_ARRAY - ) - return - value_zero - (to_static_fixed_type - (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))), - lval_memory); + || TYPE_CODE (type) == TYPE_CODE_REF + /* In C you can dereference an array to get the 1st elt. */ + || TYPE_CODE (type) == TYPE_CODE_ARRAY) + return + value_zero + (to_static_fixed_type + (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))), + lval_memory); else if (TYPE_CODE (type) == TYPE_CODE_INT) /* GDB allows dereferencing an int. */ return value_zero (builtin_type_int, lval_memory); @@ -7511,7 +7575,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, } arg1 = ada_coerce_ref (arg1); type = check_typedef (VALUE_TYPE (arg1)); - + if (ada_is_array_descriptor (type)) /* GDB allows dereferencing GNAT array descriptors. */ return ada_coerce_to_simple_array (arg1); @@ -7525,9 +7589,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (noside == EVAL_SKIP) goto nosideret; if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (ada_aligned_type + return value_zero (ada_aligned_type (ada_lookup_struct_elt_type (VALUE_TYPE (arg1), - &exp->elts[pc + 2].string, + &exp->elts[pc + + 2].string, 0, NULL)), lval_memory); else @@ -7542,9 +7607,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, goto nosideret; else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (builtin_type_void); - else + else error ("Attempt to use a type name as an expression"); - + case STRUCTOP_PTR: tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); @@ -7552,9 +7617,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (noside == EVAL_SKIP) goto nosideret; if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (ada_aligned_type + return value_zero (ada_aligned_type (ada_lookup_struct_elt_type (VALUE_TYPE (arg1), - &exp->elts[pc + 2].string, + &exp->elts[pc + + 2].string, 0, NULL)), lval_memory); else @@ -7566,27 +7632,26 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, nosideret: return value_from_longest (builtin_type_long, (LONGEST) 1); } - + /* Fixed point */ /* If TYPE encodes an Ada fixed-point type, return the suffix of the type name that encodes the 'small and 'delta information. Otherwise, return NULL. */ -static const char* +static const char * fixed_type_info (struct type *type) { - const char* name = ada_type_name (type); + const char *name = ada_type_name (type); enum type_code code = (type == NULL) ? TYPE_CODE_UNDEF : TYPE_CODE (type); - if ((code == TYPE_CODE_INT || code == TYPE_CODE_RANGE) - && name != NULL) - { + if ((code == TYPE_CODE_INT || code == TYPE_CODE_RANGE) && name != NULL) + { const char *tail = strstr (name, "___XF_"); if (tail == NULL) return NULL; - else + else return tail + 5; } else if (code == TYPE_CODE_RANGE && TYPE_TARGET_TYPE (type) != type) @@ -7615,7 +7680,7 @@ ada_delta (struct type *type) if (sscanf (encoding, "_%ld_%ld", &num, &den) < 2) return -1.0; - else + else return (DOUBLEST) num / (DOUBLEST) den; } @@ -7628,14 +7693,14 @@ scaling_factor (struct type *type) const char *encoding = fixed_type_info (type); unsigned long num0, den0, num1, den1; int n; - + n = sscanf (encoding, "_%lu_%lu_%lu_%lu", &num0, &den0, &num1, &den1); if (n < 2) return 1.0; else if (n == 4) return (DOUBLEST) num1 / (DOUBLEST) den1; - else + else return (DOUBLEST) num0 / (DOUBLEST) den0; } @@ -7646,7 +7711,7 @@ scaling_factor (struct type *type) DOUBLEST ada_fixed_to_float (struct type *type, LONGEST x) { - return (DOUBLEST) x * scaling_factor (type); + return (DOUBLEST) x *scaling_factor (type); } /* The representation of a fixed-point value of type TYPE @@ -7664,13 +7729,13 @@ ada_float_to_fixed (struct type *type, DOUBLEST x) /* Non-zero iff TYPE represents one of the special VAX floating-point types. */ int -ada_is_vax_floating_type (struct type* type) +ada_is_vax_floating_type (struct type *type) { - int name_len = + int name_len = (ada_type_name (type) == NULL) ? 0 : strlen (ada_type_name (type)); - return + return name_len > 6 - && (TYPE_CODE (type) == TYPE_CODE_INT + && (TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_RANGE) && STREQN (ada_type_name (type) + name_len - 6, "___XF", 5); } @@ -7678,33 +7743,31 @@ ada_is_vax_floating_type (struct type* type) /* The type of special VAX floating-point type this is, assuming ada_is_vax_floating_point */ int -ada_vax_float_type_suffix (struct type* type) +ada_vax_float_type_suffix (struct type *type) { - return ada_type_name (type)[strlen (ada_type_name (type))-1]; + return ada_type_name (type)[strlen (ada_type_name (type)) - 1]; } /* A value representing the special debugging function that outputs VAX floating-point values of the type represented by TYPE. Assumes ada_is_vax_floating_type (TYPE). */ -struct value* -ada_vax_float_print_function (struct type* type) -{ - switch (ada_vax_float_type_suffix (type)) { - case 'F': - return - get_var_value ("DEBUG_STRING_F", 0); - case 'D': - return - get_var_value ("DEBUG_STRING_D", 0); - case 'G': - return - get_var_value ("DEBUG_STRING_G", 0); - default: - error ("invalid VAX floating-point type"); - } +struct value * +ada_vax_float_print_function (struct type *type) +{ + switch (ada_vax_float_type_suffix (type)) + { + case 'F': + return get_var_value ("DEBUG_STRING_F", 0); + case 'D': + return get_var_value ("DEBUG_STRING_D", 0); + case 'G': + return get_var_value ("DEBUG_STRING_G", 0); + default: + error ("invalid VAX floating-point type"); + } } - + /* Range types */ /* Scan STR beginning at position K for a discriminant name, and @@ -7714,34 +7777,34 @@ ada_vax_float_print_function (struct type* type) not alter *PX and *PNEW_K if unsuccessful. */ static int -scan_discrim_bound (char *, int k, struct value* dval, LONGEST *px, int *pnew_k) +scan_discrim_bound (char *, int k, struct value *dval, LONGEST * px, + int *pnew_k) { static char *bound_buffer = NULL; static size_t bound_buffer_len = 0; char *bound; char *pend; - struct value* bound_val; + struct value *bound_val; if (dval == NULL || str == NULL || str[k] == '\0') return 0; - pend = strstr (str+k, "__"); + pend = strstr (str + k, "__"); if (pend == NULL) { - bound = str+k; + bound = str + k; k += strlen (bound); } - else + else { - GROW_VECT (bound_buffer, bound_buffer_len, pend - (str+k) + 1); + GROW_VECT (bound_buffer, bound_buffer_len, pend - (str + k) + 1); bound = bound_buffer; - strncpy (bound_buffer, str+k, pend-(str+k)); - bound[pend-(str+k)] = '\0'; - k = pend-str; + strncpy (bound_buffer, str + k, pend - (str + k)); + bound[pend - (str + k)] = '\0'; + k = pend - str; } - - bound_val = - ada_search_struct_field (bound, dval, 0, VALUE_TYPE (dval)); + + bound_val = ada_search_struct_field (bound, dval, 0, VALUE_TYPE (dval)); if (bound_val == NULL) return 0; @@ -7754,15 +7817,16 @@ scan_discrim_bound (char *, int k, struct value* dval, LONGEST *px, int *pnew_k) /* Value of variable named NAME in the current environment. If no such variable found, then if ERR_MSG is null, returns 0, and otherwise causes an error with message ERR_MSG. */ -static struct value* -get_var_value (char* name, char* err_msg) +static struct value * +get_var_value (char *name, char *err_msg) { - struct symbol** syms; - struct block** blocks; + struct symbol **syms; + struct block **blocks; int nsyms; - nsyms = ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE, - &syms, &blocks); + nsyms = + ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE, + &syms, &blocks); if (nsyms != 1) { @@ -7774,15 +7838,15 @@ get_var_value (char* name, char* err_msg) return value_of_variable (syms[0], blocks[0]); } - + /* Value of integer variable named NAME in the current environment. If no such variable found, then if ERR_MSG is null, returns 0, and sets *FLAG to 0. If successful, sets *FLAG to 1. */ LONGEST -get_int_var_value (char* name, char* err_msg, int* flag) +get_int_var_value (char *name, char *err_msg, int *flag) { - struct value* var_val = get_var_value (name, err_msg); - + struct value *var_val = get_var_value (name, err_msg); + if (var_val == 0) { if (flag != NULL) @@ -7796,7 +7860,7 @@ get_int_var_value (char* name, char* err_msg, int* flag) return value_as_long (var_val); } } - + /* Return a range type whose base type is that of the range type named NAME in the current environment, and whose bounds are calculated @@ -7806,13 +7870,13 @@ get_int_var_value (char* name, char* err_msg, int* flag) information, in general, is encoded in NAME, the base type given in the named range type. */ -static struct type* +static struct type * to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile) { struct type *raw_type = ada_find_any_type (name); struct type *base_type; LONGEST low, high; - char* subtype_info; + char *subtype_info; if (raw_type == NULL) base_type = builtin_type_int; @@ -7842,60 +7906,60 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile) bounds_str = strchr (subtype_info, '_'); n = 1; - if (*subtype_info == 'L') + if (*subtype_info == 'L') { - if (! ada_scan_number (bounds_str, n, &L, &n) - && ! scan_discrim_bound (bounds_str, n, dval, &L, &n)) + if (!ada_scan_number (bounds_str, n, &L, &n) + && !scan_discrim_bound (bounds_str, n, dval, &L, &n)) return raw_type; if (bounds_str[n] == '_') n += 2; - else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */ + else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */ n += 1; subtype_info += 1; } - else + else { - strcpy (name_buf+prefix_len, "___L"); + strcpy (name_buf + prefix_len, "___L"); L = get_int_var_value (name_buf, "Index bound unknown.", NULL); } - if (*subtype_info == 'U') + if (*subtype_info == 'U') { - if (! ada_scan_number (bounds_str, n, &U, &n) + if (!ada_scan_number (bounds_str, n, &U, &n) && !scan_discrim_bound (bounds_str, n, dval, &U, &n)) return raw_type; } - else + else { - strcpy (name_buf+prefix_len, "___U"); + strcpy (name_buf + prefix_len, "___U"); U = get_int_var_value (name_buf, "Index bound unknown.", NULL); } - if (objfile == NULL) + if (objfile == NULL) objfile = TYPE_OBJFILE (base_type); type = create_range_type (alloc_type (objfile), base_type, L, U); - TYPE_NAME (type) = name; + TYPE_NAME (type) = name; return type; } } /* True iff NAME is the name of a range type. */ int -ada_is_range_type_name (const char* name) +ada_is_range_type_name (const char *name) { return (name != NULL && strstr (name, "___XD")); -} - +} + /* Modular types */ /* True iff TYPE is an Ada modular type. */ int -ada_is_modular_type (struct type* type) +ada_is_modular_type (struct type *type) { /* FIXME: base_type should be declared in gdbtypes.h, implemented in - valarith.c */ - struct type* subranged_type; /* = base_type (type);*/ + valarith.c */ + struct type *subranged_type; /* = base_type (type); */ return (subranged_type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE && TYPE_CODE (subranged_type) != TYPE_CODE_ENUM @@ -7904,104 +7968,99 @@ ada_is_modular_type (struct type* type) /* Assuming ada_is_modular_type (TYPE), the modulus of TYPE. */ LONGEST -ada_modulus (struct type* type) +ada_modulus (struct type * type) { - return TYPE_HIGH_BOUND (type) + 1; + return TYPE_HIGH_BOUND (type) + 1; } + - /* Operators */ /* Table mapping opcodes into strings for printing operators and precedences of the operators. */ -static const struct op_print ada_op_print_tab[] = - { - {":=", BINOP_ASSIGN, PREC_ASSIGN, 1}, - {"or else", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0}, - {"and then", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0}, - {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0}, - {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0}, - {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0}, - {"=", BINOP_EQUAL, PREC_EQUAL, 0}, - {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, - {"<=", BINOP_LEQ, PREC_ORDER, 0}, - {">=", BINOP_GEQ, PREC_ORDER, 0}, - {">", BINOP_GTR, PREC_ORDER, 0}, - {"<", BINOP_LESS, PREC_ORDER, 0}, - {">>", BINOP_RSH, PREC_SHIFT, 0}, - {"<<", BINOP_LSH, PREC_SHIFT, 0}, - {"+", BINOP_ADD, PREC_ADD, 0}, - {"-", BINOP_SUB, PREC_ADD, 0}, - {"&", BINOP_CONCAT, PREC_ADD, 0}, - {"*", BINOP_MUL, PREC_MUL, 0}, - {"/", BINOP_DIV, PREC_MUL, 0}, - {"rem", BINOP_REM, PREC_MUL, 0}, - {"mod", BINOP_MOD, PREC_MUL, 0}, - {"**", BINOP_EXP, PREC_REPEAT, 0 }, - {"@", BINOP_REPEAT, PREC_REPEAT, 0}, - {"-", UNOP_NEG, PREC_PREFIX, 0}, - {"+", UNOP_PLUS, PREC_PREFIX, 0}, - {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, - {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0}, - {"abs ", UNOP_ABS, PREC_PREFIX, 0}, - {".all", UNOP_IND, PREC_SUFFIX, 1}, /* FIXME: postfix .ALL */ - {"'access", UNOP_ADDR, PREC_SUFFIX, 1}, /* FIXME: postfix 'ACCESS */ - {NULL, 0, 0, 0} +static const struct op_print ada_op_print_tab[] = { + {":=", BINOP_ASSIGN, PREC_ASSIGN, 1}, + {"or else", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0}, + {"and then", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0}, + {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0}, + {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0}, + {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0}, + {"=", BINOP_EQUAL, PREC_EQUAL, 0}, + {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, + {"<=", BINOP_LEQ, PREC_ORDER, 0}, + {">=", BINOP_GEQ, PREC_ORDER, 0}, + {">", BINOP_GTR, PREC_ORDER, 0}, + {"<", BINOP_LESS, PREC_ORDER, 0}, + {">>", BINOP_RSH, PREC_SHIFT, 0}, + {"<<", BINOP_LSH, PREC_SHIFT, 0}, + {"+", BINOP_ADD, PREC_ADD, 0}, + {"-", BINOP_SUB, PREC_ADD, 0}, + {"&", BINOP_CONCAT, PREC_ADD, 0}, + {"*", BINOP_MUL, PREC_MUL, 0}, + {"/", BINOP_DIV, PREC_MUL, 0}, + {"rem", BINOP_REM, PREC_MUL, 0}, + {"mod", BINOP_MOD, PREC_MUL, 0}, + {"**", BINOP_EXP, PREC_REPEAT, 0}, + {"@", BINOP_REPEAT, PREC_REPEAT, 0}, + {"-", UNOP_NEG, PREC_PREFIX, 0}, + {"+", UNOP_PLUS, PREC_PREFIX, 0}, + {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, + {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0}, + {"abs ", UNOP_ABS, PREC_PREFIX, 0}, + {".all", UNOP_IND, PREC_SUFFIX, 1}, /* FIXME: postfix .ALL */ + {"'access", UNOP_ADDR, PREC_SUFFIX, 1}, /* FIXME: postfix 'ACCESS */ + {NULL, 0, 0, 0} }; /* Assorted Types and Interfaces */ -struct type* builtin_type_ada_int; -struct type* builtin_type_ada_short; -struct type* builtin_type_ada_long; -struct type* builtin_type_ada_long_long; -struct type* builtin_type_ada_char; -struct type* builtin_type_ada_float; -struct type* builtin_type_ada_double; -struct type* builtin_type_ada_long_double; -struct type* builtin_type_ada_natural; -struct type* builtin_type_ada_positive; -struct type* builtin_type_ada_system_address; - -struct type ** const (ada_builtin_types[]) = -{ - +struct type *builtin_type_ada_int; +struct type *builtin_type_ada_short; +struct type *builtin_type_ada_long; +struct type *builtin_type_ada_long_long; +struct type *builtin_type_ada_char; +struct type *builtin_type_ada_float; +struct type *builtin_type_ada_double; +struct type *builtin_type_ada_long_double; +struct type *builtin_type_ada_natural; +struct type *builtin_type_ada_positive; +struct type *builtin_type_ada_system_address; + +struct type **const (ada_builtin_types[]) = +{ + &builtin_type_ada_int, - &builtin_type_ada_long, - &builtin_type_ada_short, - &builtin_type_ada_char, - &builtin_type_ada_float, - &builtin_type_ada_double, - &builtin_type_ada_long_long, - &builtin_type_ada_long_double, - &builtin_type_ada_natural, - &builtin_type_ada_positive, - - /* The following types are carried over from C for convenience. */ - &builtin_type_int, - &builtin_type_long, - &builtin_type_short, - &builtin_type_char, - &builtin_type_float, - &builtin_type_double, - &builtin_type_long_long, - &builtin_type_void, - &builtin_type_signed_char, - &builtin_type_unsigned_char, - &builtin_type_unsigned_short, - &builtin_type_unsigned_int, - &builtin_type_unsigned_long, - &builtin_type_unsigned_long_long, - &builtin_type_long_double, - &builtin_type_complex, - &builtin_type_double_complex, - 0 -}; + &builtin_type_ada_long, + &builtin_type_ada_short, + &builtin_type_ada_char, + &builtin_type_ada_float, + &builtin_type_ada_double, + &builtin_type_ada_long_long, + &builtin_type_ada_long_double, + &builtin_type_ada_natural, &builtin_type_ada_positive, + /* The following types are carried over from C for convenience. */ +&builtin_type_int, + &builtin_type_long, + &builtin_type_short, + &builtin_type_char, + &builtin_type_float, + &builtin_type_double, + &builtin_type_long_long, + &builtin_type_void, + &builtin_type_signed_char, + &builtin_type_unsigned_char, + &builtin_type_unsigned_short, + &builtin_type_unsigned_int, + &builtin_type_unsigned_long, + &builtin_type_unsigned_long_long, + &builtin_type_long_double, + &builtin_type_complex, &builtin_type_double_complex, 0}; /* Not really used, but needed in the ada_language_defn. */ -static void emit_char (int c, struct ui_file* stream, int quoter) +static void +emit_char (int c, struct ui_file *stream, int quoter) { ada_emit_char (c, stream, quoter, 1); } @@ -8026,16 +8085,16 @@ 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 */ - {"", "", "", ""}, /* Binary format info */ + {"", "", "", ""}, /* Binary format info */ #if 0 - {"8#%lo#", "8#", "o", "#"}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"16#%lx#", "16#", "x", "#"}, /* Hex format info */ + {"8#%lo#", "8#", "o", "#"}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"16#%lx#", "16#", "x", "#"}, /* Hex format info */ #else /* Copied from c-lang.c. */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ #endif ada_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays (FIXME?) */ @@ -8049,59 +8108,48 @@ _initialize_ada_language () { builtin_type_ada_int = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, - "integer", (struct objfile *) NULL); + 0, "integer", (struct objfile *) NULL); builtin_type_ada_long = init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, - 0, - "long_integer", (struct objfile *) NULL); + 0, "long_integer", (struct objfile *) NULL); builtin_type_ada_short = init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, - 0, - "short_integer", (struct objfile *) NULL); + 0, "short_integer", (struct objfile *) NULL); builtin_type_ada_char = init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, - 0, - "character", (struct objfile *) NULL); + 0, "character", (struct objfile *) NULL); builtin_type_ada_float = init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, - 0, - "float", (struct objfile *) NULL); + 0, "float", (struct objfile *) NULL); builtin_type_ada_double = init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, - "long_float", (struct objfile *) NULL); + 0, "long_float", (struct objfile *) NULL); builtin_type_ada_long_long = init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, - 0, - "long_long_integer", (struct objfile *) NULL); + 0, "long_long_integer", (struct objfile *) NULL); builtin_type_ada_long_double = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, - "long_long_float", (struct objfile *) NULL); + 0, "long_long_float", (struct objfile *) NULL); builtin_type_ada_natural = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, - "natural", (struct objfile *) NULL); + 0, "natural", (struct objfile *) NULL); builtin_type_ada_positive = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, - "positive", (struct objfile *) NULL); + 0, "positive", (struct objfile *) NULL); - builtin_type_ada_system_address = - lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void", + builtin_type_ada_system_address = + lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void", (struct objfile *) NULL)); TYPE_NAME (builtin_type_ada_system_address) = "system__address"; add_language (&ada_language_defn); - add_show_from_set + add_show_from_set (add_set_cmd ("varsize-limit", class_support, var_uinteger, - (char*) &varsize_limit, + (char *) &varsize_limit, "Set maximum bytes in dynamic-sized object.", - &setlist), - &showlist); + &setlist), &showlist); varsize_limit = 65536; add_com ("begin", class_breakpoint, begin_command, @@ -8141,132 +8189,129 @@ ada_create_fundamental_type (struct objfile *objfile, int typeid) switch (typeid) { - default: - /* FIXME: For now, if we are asked to produce a type not in this - language, create the equivalent of a C integer type with the - name "". When all the dust settles from the type - reconstruction work, this should probably become an error. */ - type = init_type (TYPE_CODE_INT, - TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, "", objfile); - warning ("internal error: no Ada fundamental type %d", typeid); - break; - case FT_VOID: - type = init_type (TYPE_CODE_VOID, - TARGET_CHAR_BIT / TARGET_CHAR_BIT, - 0, "void", objfile); - break; - case FT_CHAR: - type = init_type (TYPE_CODE_INT, - TARGET_CHAR_BIT / TARGET_CHAR_BIT, - 0, "character", objfile); - break; - case FT_SIGNED_CHAR: - type = init_type (TYPE_CODE_INT, - TARGET_CHAR_BIT / TARGET_CHAR_BIT, - 0, "signed char", objfile); - break; - case FT_UNSIGNED_CHAR: - type = init_type (TYPE_CODE_INT, - TARGET_CHAR_BIT / TARGET_CHAR_BIT, - TYPE_FLAG_UNSIGNED, "unsigned char", objfile); - break; - case FT_SHORT: - type = init_type (TYPE_CODE_INT, - TARGET_SHORT_BIT / TARGET_CHAR_BIT, - 0, "short_integer", objfile); - break; - case FT_SIGNED_SHORT: - type = init_type (TYPE_CODE_INT, - TARGET_SHORT_BIT / TARGET_CHAR_BIT, - 0, "short_integer", objfile); - break; - case FT_UNSIGNED_SHORT: - type = init_type (TYPE_CODE_INT, - TARGET_SHORT_BIT / TARGET_CHAR_BIT, - TYPE_FLAG_UNSIGNED, "unsigned short", objfile); - break; - case FT_INTEGER: - type = init_type (TYPE_CODE_INT, - TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, "integer", objfile); - break; - case FT_SIGNED_INTEGER: - type = init_type (TYPE_CODE_INT, - TARGET_INT_BIT / TARGET_CHAR_BIT, - 0, "integer", objfile); /* FIXME -fnf */ - break; - case FT_UNSIGNED_INTEGER: - type = init_type (TYPE_CODE_INT, - TARGET_INT_BIT / TARGET_CHAR_BIT, - TYPE_FLAG_UNSIGNED, "unsigned int", objfile); - break; - case FT_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_BIT / TARGET_CHAR_BIT, - 0, "long_integer", objfile); - break; - case FT_SIGNED_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_BIT / TARGET_CHAR_BIT, - 0, "long_integer", objfile); - break; - case FT_UNSIGNED_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_BIT / TARGET_CHAR_BIT, - TYPE_FLAG_UNSIGNED, "unsigned long", objfile); - break; - case FT_LONG_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, - 0, "long_long_integer", objfile); - break; - case FT_SIGNED_LONG_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, - 0, "long_long_integer", objfile); - break; - case FT_UNSIGNED_LONG_LONG: - type = init_type (TYPE_CODE_INT, - TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, - TYPE_FLAG_UNSIGNED, "unsigned long long", objfile); - break; - case FT_FLOAT: - type = init_type (TYPE_CODE_FLT, - TARGET_FLOAT_BIT / TARGET_CHAR_BIT, - 0, "float", objfile); - break; - case FT_DBL_PREC_FLOAT: - type = init_type (TYPE_CODE_FLT, - TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, "long_float", objfile); - break; - case FT_EXT_PREC_FLOAT: - type = init_type (TYPE_CODE_FLT, - TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, - 0, "long_long_float", objfile); - break; - } + default: + /* FIXME: For now, if we are asked to produce a type not in this + language, create the equivalent of a C integer type with the + name "". When all the dust settles from the type + reconstruction work, this should probably become an error. */ + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "", objfile); + warning ("internal error: no Ada fundamental type %d", typeid); + break; + case FT_VOID: + type = init_type (TYPE_CODE_VOID, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "void", objfile); + break; + case FT_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "character", objfile); + break; + case FT_SIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "signed char", objfile); + break; + case FT_UNSIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned char", objfile); + break; + case FT_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short_integer", objfile); + break; + case FT_SIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short_integer", objfile); + break; + case FT_UNSIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned short", objfile); + break; + case FT_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "integer", objfile); + break; + case FT_SIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0, "integer", objfile); /* FIXME -fnf */ + break; + case FT_UNSIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned int", objfile); + break; + case FT_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_integer", objfile); + break; + case FT_SIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_integer", objfile); + break; + case FT_UNSIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long", objfile); + break; + case FT_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_long_integer", objfile); + break; + case FT_SIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_long_integer", objfile); + break; + case FT_UNSIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long long", objfile); + break; + case FT_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "float", objfile); + break; + case FT_DBL_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_float", objfile); + break; + case FT_EXT_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_long_float", objfile); + break; + } return (type); } -void ada_dump_symtab (struct symtab* s) +void +ada_dump_symtab (struct symtab *s) { int i; fprintf (stderr, "New symtab: [\n"); - fprintf (stderr, " Name: %s/%s;\n", - s->dirname ? s->dirname : "?", - s->filename ? s->filename : "?"); + fprintf (stderr, " Name: %s/%s;\n", + s->dirname ? s->dirname : "?", s->filename ? s->filename : "?"); fprintf (stderr, " Format: %s;\n", s->debugformat); if (s->linetable != NULL) { fprintf (stderr, " Line table (section %d):\n", s->block_line_section); for (i = 0; i < s->linetable->nitems; i += 1) { - struct linetable_entry* e = s->linetable->item + i; + struct linetable_entry *e = s->linetable->item + i; fprintf (stderr, " %4ld: %8lx\n", (long) e->line, (long) e->pc); } } fprintf (stderr, "]\n"); } - diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index e5353f8524b..d2b426c8ceb 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -32,13 +32,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Chain of cleanups for arguments of OP_UNRESOLVED_VALUE names. Created in yyparse and freed in ada_resolve. */ -extern struct cleanup* unresolved_names; +extern struct cleanup *unresolved_names; /* Corresponding mangled/demangled names and opcodes for Ada user-definable operators. */ -struct ada_opname_map { - const char* mangled; - const char* demangled; +struct ada_opname_map +{ + const char *mangled; + const char *demangled; enum exp_opcode op; }; @@ -53,7 +54,8 @@ extern const int MAX_NUMBER_OF_KNOWN_TASKS; to update the table attribute_names in ada-lang.c whenever you change this. */ -enum ada_attribute { +enum ada_attribute +{ /* Invalid attribute for error checking. */ ATR_INVALID, @@ -74,7 +76,8 @@ enum ada_attribute { ATR_END }; -enum task_states { +enum task_states +{ Unactivated, Runnable, Terminated, @@ -89,14 +92,18 @@ enum task_states { extern char *ada_task_states[]; -typedef struct { +typedef struct +{ char *P_ARRAY; int *P_BOUNDS; -} fat_string; +} +fat_string; -typedef struct entry_call { +typedef struct entry_call +{ void *self; -} *entry_call_link; +} + *entry_call_link; struct task_fields { @@ -126,7 +133,7 @@ struct task_fields #if (defined (VXWORKS_TARGET) && defined (M68K_TARGET)) __attribute__ ((packed)) #endif -; + ; struct task_entry { @@ -139,17 +146,17 @@ struct task_entry int stack_per; }; -extern struct type* builtin_type_ada_int; -extern struct type* builtin_type_ada_short; -extern struct type* builtin_type_ada_long; -extern struct type* builtin_type_ada_long_long; -extern struct type* builtin_type_ada_char; -extern struct type* builtin_type_ada_float; -extern struct type* builtin_type_ada_double; -extern struct type* builtin_type_ada_long_double; -extern struct type* builtin_type_ada_natural; -extern struct type* builtin_type_ada_positive; -extern struct type* builtin_type_ada_system_address; +extern struct type *builtin_type_ada_int; +extern struct type *builtin_type_ada_short; +extern struct type *builtin_type_ada_long; +extern struct type *builtin_type_ada_long_long; +extern struct type *builtin_type_ada_char; +extern struct type *builtin_type_ada_float; +extern struct type *builtin_type_ada_double; +extern struct type *builtin_type_ada_long_double; +extern struct type *builtin_type_ada_natural; +extern struct type *builtin_type_ada_positive; +extern struct type *builtin_type_ada_system_address; /* Assuming V points to an array of S objects, make sure that it contains at least M objects, updating V and S as necessary. */ @@ -157,209 +164,225 @@ extern struct type* builtin_type_ada_system_address; #define GROW_VECT(v, s, m) \ if ((s) < (m)) grow_vect ((void**) &(v), &(s), (m), sizeof(*(v))); -extern void grow_vect (void**, size_t*, size_t, int); +extern void grow_vect (void **, size_t *, size_t, int); extern int ada_parse (void); /* Defined in ada-exp.y */ extern void ada_error (char *); /* Defined in ada-exp.y */ - /* Defined in ada-typeprint.c */ -extern void ada_print_type (struct type*, char*, struct ui_file*, int, int); + /* Defined in ada-typeprint.c */ +extern void ada_print_type (struct type *, char *, struct ui_file *, int, + int); -extern int ada_val_print (struct type*, char*, int, CORE_ADDR, - struct ui_file*, int, int, int, enum val_prettyprint); +extern int ada_val_print (struct type *, char *, int, CORE_ADDR, + struct ui_file *, int, int, int, + enum val_prettyprint); -extern int ada_value_print (struct value*, struct ui_file*, int, +extern int ada_value_print (struct value *, struct ui_file *, int, enum val_prettyprint); /* Defined in ada-lang.c */ -extern struct value* value_from_contents_and_address (struct type*, char*, CORE_ADDR); +extern struct value *value_from_contents_and_address (struct type *, char *, + CORE_ADDR); extern void ada_emit_char (int, struct ui_file *, int, int); -extern void ada_printchar (int, struct ui_file*); +extern void ada_printchar (int, struct ui_file *); -extern void ada_printstr (struct ui_file*, char *, unsigned int, int, int); +extern void ada_printstr (struct ui_file *, char *, unsigned int, int, int); -extern void ada_convert_actuals (struct value*, int, struct value**, CORE_ADDR*); +extern void ada_convert_actuals (struct value *, int, struct value **, + CORE_ADDR *); -extern struct value* ada_value_subscript (struct value*, int, struct value**); +extern struct value *ada_value_subscript (struct value *, int, + struct value **); -extern struct type* ada_array_element_type (struct type*, int); +extern struct type *ada_array_element_type (struct type *, int); -extern int ada_array_arity (struct type*); +extern int ada_array_arity (struct type *); -struct type* ada_type_of_array (struct value*, int); +struct type *ada_type_of_array (struct value *, int); -extern struct value* ada_coerce_to_simple_array (struct value*); +extern struct value *ada_coerce_to_simple_array (struct value *); -extern struct value* ada_coerce_to_simple_array_ptr (struct value*); +extern struct value *ada_coerce_to_simple_array_ptr (struct value *); -extern int ada_is_simple_array (struct type*); +extern int ada_is_simple_array (struct type *); -extern int ada_is_array_descriptor (struct type*); +extern int ada_is_array_descriptor (struct type *); -extern int ada_is_bogus_array_descriptor (struct type*); +extern int ada_is_bogus_array_descriptor (struct type *); -extern struct type* ada_index_type (struct type*, int); +extern struct type *ada_index_type (struct type *, int); -extern struct value* ada_array_bound (struct value*, int, int); +extern struct value *ada_array_bound (struct value *, int, int); -extern int ada_lookup_symbol_list (const char*, struct block*, namespace_enum, - struct symbol***, struct block***); +extern int ada_lookup_symbol_list (const char *, struct block *, + namespace_enum, struct symbol ***, + struct block ***); -extern char* ada_fold_name (const char*); +extern char *ada_fold_name (const char *); -extern struct symbol* ada_lookup_symbol (const char*, struct block*, namespace_enum); +extern struct symbol *ada_lookup_symbol (const char *, struct block *, + namespace_enum); -extern struct minimal_symbol* ada_lookup_minimal_symbol (const char*); +extern struct minimal_symbol *ada_lookup_minimal_symbol (const char *); -extern void ada_resolve (struct expression**, struct type*); +extern void ada_resolve (struct expression **, struct type *); -extern int ada_resolve_function (struct symbol**, struct block**, int, - struct value**, int, const char*, struct type*); +extern int ada_resolve_function (struct symbol **, struct block **, int, + struct value **, int, const char *, + struct type *); -extern void ada_fill_in_ada_prototype (struct symbol*); +extern void ada_fill_in_ada_prototype (struct symbol *); -extern int user_select_syms (struct symbol**, struct block**, int, int); +extern int user_select_syms (struct symbol **, struct block **, int, int); -extern int get_selections (int*, int, int, int, char*); +extern int get_selections (int *, int, int, int, char *); -extern char* ada_start_decode_line_1 (char*); +extern char *ada_start_decode_line_1 (char *); -extern struct symtabs_and_lines ada_finish_decode_line_1 (char**, struct symtab*, int, char***); +extern struct symtabs_and_lines ada_finish_decode_line_1 (char **, + struct symtab *, + int, char ***); -extern int ada_scan_number (const char*, int, LONGEST*, int*); +extern int ada_scan_number (const char *, int, LONGEST *, int *); -extern struct type* ada_parent_type (struct type*); +extern struct type *ada_parent_type (struct type *); -extern int ada_is_ignored_field (struct type*, int); +extern int ada_is_ignored_field (struct type *, int); -extern int ada_is_packed_array_type (struct type*); +extern int ada_is_packed_array_type (struct type *); -extern struct value* ada_value_primitive_packed_val (struct value*, char*, long, int, - int, struct type*); +extern struct value *ada_value_primitive_packed_val (struct value *, char *, + long, int, int, + struct type *); -extern struct type* ada_coerce_to_simple_array_type (struct type*); +extern struct type *ada_coerce_to_simple_array_type (struct type *); -extern int ada_is_character_type (struct type*); +extern int ada_is_character_type (struct type *); -extern int ada_is_string_type (struct type*); +extern int ada_is_string_type (struct type *); -extern int ada_is_tagged_type (struct type*); +extern int ada_is_tagged_type (struct type *); -extern struct type* ada_tag_type (struct value*); +extern struct type *ada_tag_type (struct value *); -extern struct value* ada_value_tag (struct value*); +extern struct value *ada_value_tag (struct value *); -extern int ada_is_parent_field (struct type*, int); +extern int ada_is_parent_field (struct type *, int); -extern int ada_is_wrapper_field (struct type*, int); +extern int ada_is_wrapper_field (struct type *, int); -extern int ada_is_variant_part (struct type*, int); +extern int ada_is_variant_part (struct type *, int); -extern struct type* ada_variant_discrim_type (struct type*, struct type*); +extern struct type *ada_variant_discrim_type (struct type *, struct type *); -extern int ada_is_others_clause (struct type*, int); +extern int ada_is_others_clause (struct type *, int); -extern int ada_in_variant (LONGEST, struct type*, int); +extern int ada_in_variant (LONGEST, struct type *, int); -extern char* ada_variant_discrim_name (struct type*); +extern char *ada_variant_discrim_name (struct type *); -extern struct type* ada_lookup_struct_elt_type (struct type*, char*, int, int*); +extern struct type *ada_lookup_struct_elt_type (struct type *, char *, int, + int *); -extern struct value* ada_value_struct_elt (struct value*, char*, char*); +extern struct value *ada_value_struct_elt (struct value *, char *, char *); -extern struct value* ada_search_struct_field (char*, struct value*, int, struct type*); +extern struct value *ada_search_struct_field (char *, struct value *, int, + struct type *); -extern int ada_is_aligner_type (struct type*); +extern int ada_is_aligner_type (struct type *); -extern struct type* ada_aligned_type (struct type*); +extern struct type *ada_aligned_type (struct type *); -extern char* ada_aligned_value_addr (struct type*, char*); +extern char *ada_aligned_value_addr (struct type *, char *); -extern const char* ada_attribute_name (int); +extern const char *ada_attribute_name (int); -extern int ada_is_fixed_point_type (struct type*); +extern int ada_is_fixed_point_type (struct type *); -extern DOUBLEST ada_delta (struct type*); +extern DOUBLEST ada_delta (struct type *); extern DOUBLEST ada_fixed_to_float (struct type *, LONGEST); -extern LONGEST ada_float_to_fixed (struct type*, DOUBLEST); +extern LONGEST ada_float_to_fixed (struct type *, DOUBLEST); -extern int ada_is_vax_floating_type (struct type*); +extern int ada_is_vax_floating_type (struct type *); -extern int ada_vax_float_type_suffix (struct type*); +extern int ada_vax_float_type_suffix (struct type *); -extern struct value* ada_vax_float_print_function (struct type*); +extern struct value *ada_vax_float_print_function (struct type *); -extern struct type* ada_system_address_type (void); +extern struct type *ada_system_address_type (void); -extern int ada_which_variant_applies (struct type*, struct type*, char*); +extern int ada_which_variant_applies (struct type *, struct type *, char *); -extern struct value* ada_to_fixed_value (struct type*, char*, CORE_ADDR, struct value*); +extern struct value *ada_to_fixed_value (struct type *, char *, CORE_ADDR, + struct value *); -extern struct type* ada_to_fixed_type (struct type*, char*, CORE_ADDR, struct value*); +extern struct type *ada_to_fixed_type (struct type *, char *, CORE_ADDR, + struct value *); -extern int ada_name_prefix_len (const char*); +extern int ada_name_prefix_len (const char *); -extern char* ada_type_name (struct type*); +extern char *ada_type_name (struct type *); -extern struct type* ada_find_parallel_type (struct type*, const char *suffix); +extern struct type *ada_find_parallel_type (struct type *, + const char *suffix); -extern LONGEST get_int_var_value (char*, char*, int* ); +extern LONGEST get_int_var_value (char *, char *, int *); -extern struct type* ada_find_any_type (const char *name); +extern struct type *ada_find_any_type (const char *name); -extern int ada_prefer_type (struct type*, struct type*); +extern int ada_prefer_type (struct type *, struct type *); -extern struct type* ada_get_base_type (struct type*); +extern struct type *ada_get_base_type (struct type *); -extern struct type* ada_completed_type (struct type*); +extern struct type *ada_completed_type (struct type *); -extern char* ada_mangle (const char*); +extern char *ada_mangle (const char *); -extern const char* ada_enum_name (const char*); +extern const char *ada_enum_name (const char *); -extern int ada_is_modular_type (struct type*); +extern int ada_is_modular_type (struct type *); -extern LONGEST ada_modulus (struct type*); +extern LONGEST ada_modulus (struct type *); -extern struct value* ada_value_ind (struct value*); +extern struct value *ada_value_ind (struct value *); -extern void ada_print_scalar (struct type*, LONGEST, struct ui_file*); +extern void ada_print_scalar (struct type *, LONGEST, struct ui_file *); -extern int ada_is_range_type_name (const char*); +extern int ada_is_range_type_name (const char *); -extern const char* ada_renaming_type (struct type*); +extern const char *ada_renaming_type (struct type *); -extern int ada_is_object_renaming (struct symbol*); +extern int ada_is_object_renaming (struct symbol *); -extern const char* ada_simple_renamed_entity (struct symbol*); +extern const char *ada_simple_renamed_entity (struct symbol *); -extern char* ada_breakpoint_rewrite (char*, int*); +extern char *ada_breakpoint_rewrite (char *, int *); /* Tasking-related: ada-tasks.c */ extern int valid_task_id (int); -extern int get_current_task (void); +extern int get_current_task (void); extern void init_task_list (void); -extern void* get_self_id (void); +extern void *get_self_id (void); extern int get_current_task (void); -extern int get_entry_number (void*); +extern int get_entry_number (void *); extern void ada_report_exception_break (struct breakpoint *); -extern int ada_maybe_exception_partial_symbol (struct partial_symbol* sym); +extern int ada_maybe_exception_partial_symbol (struct partial_symbol *sym); -extern int ada_is_exception_sym (struct symbol* sym); +extern int ada_is_exception_sym (struct symbol *sym); #endif diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index f64b6cc3605..eccd5a1c214 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -14,9 +14,9 @@ */ -#include -#include "defs.h" -#include "command.h" +#include +#include "defs.h" +#include "command.h" #include "value.h" #include "language.h" #include "inferior.h" @@ -30,7 +30,7 @@ #if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)) #include "gregset.h" -#endif +#endif #include "ada-lang.h" @@ -71,10 +71,10 @@ extern int dec_thread_get_registers (gdb_gregset_t *, gdb_fpregset_t *); #elif defined (sun) && defined (__SVR4) #define GET_CURRENT_THREAD solaris_thread_get_current_thread #define THREAD_FETCH_REGISTERS() (-1) -extern void *GET_CURRENT_THREAD(); +extern void *GET_CURRENT_THREAD (); #elif defined (_AIX) || (defined(__alpha__) && defined(__osf__)) -extern void *GET_CURRENT_THREAD(); +extern void *GET_CURRENT_THREAD (); #elif defined (__WIN32__) || defined (hpux) #define GET_CURRENT_THREAD() (inferior_pid) @@ -90,7 +90,7 @@ extern void *GET_CURRENT_THREAD(); #define READ_MEMORY(addr, var) read_memory (addr, (char*) &var, sizeof (var)) /* external declarations */ -extern struct value* find_function_in_inferior (char *); +extern struct value *find_function_in_inferior (char *); /* Global visible variables */ @@ -110,8 +110,7 @@ const int MAX_NUMBER_OF_KNOWN_TASKS = 1000; int current_task = -1, current_task_id = -1, current_task_index; void *current_thread, *current_lwp; -char *ada_task_states[] = -{ +char *ada_task_states[] = { "Unactivated", "Runnable", "Terminated", @@ -131,8 +130,7 @@ char *ada_task_states[] = /* Global internal types */ -static char *ada_long_task_states[] = -{ +static char *ada_long_task_states[] = { "Unactivated", "Runnable", "Terminated", @@ -153,10 +151,10 @@ static char *ada_long_task_states[] = /* Global internal variables */ static int highest_task_num = 0; -int thread_support = 0; /* 1 if the thread library in use is supported */ +int thread_support = 0; /* 1 if the thread library in use is supported */ static int gdbtk_task_initialization = 0; -static int +static int add_task_entry (void *p_task_id, int index) { struct task_entry *new_task_entry = NULL; @@ -176,11 +174,12 @@ add_task_entry (void *p_task_id, int index) pt->next_task = new_task_entry; pt->stack_per = 0; } - else task_list = new_task_entry; + else + task_list = new_task_entry; return new_task_entry->task_num; } -int +int get_entry_number (void *p_task_id) { struct task_entry *pt; @@ -204,7 +203,7 @@ get_thread_entry_vptr (void *thread) while (pt != NULL) { if (pt->thread == thread) - return pt; + return pt; pt = pt->next_task; } return 0; @@ -250,7 +249,7 @@ valid_task_id (int task) void * get_self_id (void) { - struct value* val; + struct value *val; void *self_id; int result; struct task_entry *ent; @@ -270,10 +269,11 @@ get_self_id (void) return NULL; } -int get_current_task () +int +get_current_task () { int result; - + /* FIXME: language_ada should be defined in defs.h */ /* if (current_language->la_language != language_ada) return -1; */ @@ -293,22 +293,22 @@ info_task (char *arg, int from_tty) void *self_id, *caller; struct task_fields atcb, atcb2; struct entry_call call; - int bounds [2]; - char image [256]; + int bounds[2]; + char image[256]; int num; /* FIXME: language_ada should be defined in defs.h */ /* if (current_language->la_language != language_ada) - { - printf_filtered ("The current language does not support tasks.\n"); - return; - } - */ + { + printf_filtered ("The current language does not support tasks.\n"); + return; + } + */ pt = get_entry_vptr (atoi (arg)); if (pt == NULL) { - printf_filtered ("Task %s not found.\n", arg); - return; + printf_filtered ("Task %s not found.\n", arg); + return; } temp_task = pt->task_id; @@ -320,14 +320,16 @@ info_task (char *arg, int from_tty) printf_filtered ("Ada Task: %p\n", temp_task); /* print the name of the task */ - if (atcb.image.P_ARRAY != NULL) { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds); - bounds [1] = EXTRACT_INT (bounds [1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), - (char*) &image, bounds [1]); - printf_filtered ("Name: %.*s\n", bounds [1], image); - } - else printf_filtered ("\n"); + if (atcb.image.P_ARRAY != NULL) + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds); + bounds[1] = EXTRACT_INT (bounds[1]); + read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), + (char *) &image, bounds[1]); + printf_filtered ("Name: %.*s\n", bounds[1], image); + } + else + printf_filtered ("\n"); /* print the thread id */ @@ -339,9 +341,9 @@ info_task (char *arg, int from_tty) if ((long) pt->lwp != 0) { if ((long) pt->lwp < 65536) - printf_filtered ("LWP: %ld\n", (long int) pt->lwp); + printf_filtered ("LWP: %ld\n", (long int) pt->lwp); else - printf_filtered ("LWP: %p\n", pt->lwp); + printf_filtered ("LWP: %p\n", pt->lwp); } /* print the parent gdb task id */ @@ -353,16 +355,17 @@ info_task (char *arg, int from_tty) READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2); /* print the name of the task */ - if (atcb2.image.P_ARRAY != NULL) { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), - bounds); - bounds [1] = EXTRACT_INT (bounds [1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), - (char*) &image, bounds [1]); - printf_filtered (" (%.*s)\n", bounds [1], image); - } + if (atcb2.image.P_ARRAY != NULL) + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), + bounds); + bounds[1] = EXTRACT_INT (bounds[1]); + read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), + (char *) &image, bounds[1]); + printf_filtered (" (%.*s)\n", bounds[1], image); + } else - printf_filtered ("\n"); + printf_filtered ("\n"); } else printf_filtered ("No parent\n"); @@ -375,11 +378,12 @@ info_task (char *arg, int from_tty) /* check if this task is accepting a rendezvous */ if (atcb.call == NULL) caller = NULL; - else { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); - caller = EXTRACT_ADDRESS (call.self); - } - + else + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); + caller = EXTRACT_ADDRESS (call.self); + } + if (caller != NULL) { num = get_entry_number (caller); @@ -391,14 +395,15 @@ info_task (char *arg, int from_tty) READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2); /* print the name of the task */ - if (atcb2.image.P_ARRAY != NULL) { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), - bounds); - bounds [1] = EXTRACT_INT (bounds [1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), - (char*) &image, bounds [1]); - printf_filtered (" (%.*s)\n", bounds [1], image); - } + if (atcb2.image.P_ARRAY != NULL) + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), + bounds); + bounds[1] = EXTRACT_INT (bounds[1]); + read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), + (char *) &image, bounds[1]); + printf_filtered (" (%.*s)\n", bounds[1], image); + } else printf_filtered ("\n"); } @@ -406,7 +411,7 @@ info_task (char *arg, int from_tty) printf_filtered ("\n"); } else - printf_filtered ("State: %s\n", ada_long_task_states [atcb.state]); + printf_filtered ("State: %s\n", ada_long_task_states[atcb.state]); } #if 0 @@ -418,28 +423,37 @@ info_task (char *arg, int from_tty) print_align (void) { struct task_fields tf; - void *tf_base = &(tf); - void *tf_state = &(tf.state); - void *tf_entry_num = &(tf.entry_num); - void *tf_parent = &(tf.parent); - void *tf_priority = &(tf.priority); + void *tf_base = &(tf); + void *tf_state = &(tf.state); + void *tf_entry_num = &(tf.entry_num); + void *tf_parent = &(tf.parent); + void *tf_priority = &(tf.priority); void *tf_current_priority = &(tf.current_priority); - void *tf_image = &(tf.image); - void *tf_call = &(tf.call); - void *tf_thread = &(tf.thread); - void *tf_lwp = &(tf.lwp); + void *tf_image = &(tf.image); + void *tf_call = &(tf.call); + void *tf_thread = &(tf.thread); + void *tf_lwp = &(tf.lwp); printf_filtered ("\n"); printf_filtered ("(tf_base = 0x%x)\n", tf_base); - printf_filtered ("task_fields.entry_num at %3d (0x%x)\n", tf_entry_num - tf_base, tf_entry_num); - printf_filtered ("task_fields.state at %3d (0x%x)\n", tf_state - tf_base, tf_state); - printf_filtered ("task_fields.parent at %3d (0x%x)\n", tf_parent - tf_base, tf_parent); - printf_filtered ("task_fields.priority at %3d (0x%x)\n", tf_priority - tf_base, tf_priority); - printf_filtered ("task_fields.current_priority at %3d (0x%x)\n", tf_current_priority - tf_base, tf_current_priority); - printf_filtered ("task_fields.image at %3d (0x%x)\n", tf_image - tf_base, tf_image); - printf_filtered ("task_fields.call at %3d (0x%x)\n", tf_call - tf_base, tf_call); - printf_filtered ("task_fields.thread at %3d (0x%x)\n", tf_thread - tf_base, tf_thread); - printf_filtered ("task_fields.lwp at %3d (0x%x)\n", tf_lwp - tf_base, tf_lwp); - printf_filtered ("\n"); + printf_filtered ("task_fields.entry_num at %3d (0x%x)\n", + tf_entry_num - tf_base, tf_entry_num); + printf_filtered ("task_fields.state at %3d (0x%x)\n", + tf_state - tf_base, tf_state); + printf_filtered ("task_fields.parent at %3d (0x%x)\n", + tf_parent - tf_base, tf_parent); + printf_filtered ("task_fields.priority at %3d (0x%x)\n", + tf_priority - tf_base, tf_priority); + printf_filtered ("task_fields.current_priority at %3d (0x%x)\n", + tf_current_priority - tf_base, tf_current_priority); + printf_filtered ("task_fields.image at %3d (0x%x)\n", + tf_image - tf_base, tf_image); + printf_filtered ("task_fields.call at %3d (0x%x)\n", + tf_call - tf_base, tf_call); + printf_filtered ("task_fields.thread at %3d (0x%x)\n", + tf_thread - tf_base, tf_thread); + printf_filtered ("task_fields.lwp at %3d (0x%x)\n", + tf_lwp - tf_base, tf_lwp); + printf_filtered ("\n"); } #endif @@ -448,15 +462,15 @@ print_align (void) static void info_tasks (char *arg, int from_tty) { - struct value* val; + struct value *val; int i, task_number, state; - void *temp_task, *temp_tasks [MAX_NUMBER_OF_KNOWN_TASKS]; + void *temp_task, *temp_tasks[MAX_NUMBER_OF_KNOWN_TASKS]; struct task_entry *pt; - void *self_id, *caller, *thread_id=NULL; + void *self_id, *caller, *thread_id = NULL; struct task_fields atcb; struct entry_call call; - int bounds [2]; - char image [256]; + int bounds[2]; + char image[256]; int size; char car; @@ -474,7 +488,7 @@ info_tasks (char *arg, int from_tty) task_number = 0; - if (PIDGET(inferior_ptid) == 0) + if (PIDGET (inferior_ptid) == 0) { printf_filtered ("The program is not being run under gdb. "); printf_filtered ("Use 'run' or 'attach' first.\n"); @@ -494,7 +508,7 @@ info_tasks (char *arg, int from_tty) known_tasks_addr = (void *) SYMBOL_VALUE_ADDRESS (msym); else #ifndef VXWORKS_TARGET - return; + return; #else { if (target_lookup_symbol (KNOWN_TASKS_NAME, &known_tasks_addr) != 0) @@ -519,28 +533,29 @@ info_tasks (char *arg, int from_tty) READ_MEMORY ((CORE_ADDR) known_tasks_addr, temp_tasks); - for (i=0; ithread & 0x3ffffffffff); + printf_filtered (" %#9lx", (unsigned long) pt->thread & 0x3ffffffffff); #else - printf_filtered (" %#9lx", (long)pt->thread); + printf_filtered (" %#9lx", (long) pt->thread); #endif #endif /* print the parent gdb task id */ printf_filtered - (" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent))); + (" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent))); /* print the base priority of the task */ printf_filtered (" %3d", EXTRACT_INT (atcb.priority)); @@ -595,39 +610,41 @@ info_tasks (char *arg, int from_tty) #if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) if (pt->task_num == 1 || atcb.state == Terminated) { - printf_filtered (" Unknown"); + printf_filtered (" Unknown"); goto next; } - read_memory ((CORE_ADDR)atcb.thread, &thr, sizeof (thr)); + read_memory ((CORE_ADDR) atcb.thread, &thr, sizeof (thr)); current_thread = atcb.thread; - regs.regs [SP_REGNUM] = 0; - if (dec_thread_get_registers (®s, NULL) == 0) { - pt->stack_per = (100 * ((long)thr.__stack_base - - regs.regs [SP_REGNUM])) / thr.__stack_size; - /* if the thread is terminated but still there, the - stack_base/size values are erroneous. Try to patch it */ - if (pt->stack_per < 0 || pt->stack_per > 100) pt->stack_per = 0; - } + regs.regs[SP_REGNUM] = 0; + if (dec_thread_get_registers (®s, NULL) == 0) + { + pt->stack_per = (100 * ((long) thr.__stack_base - + regs.regs[SP_REGNUM])) / thr.__stack_size; + /* if the thread is terminated but still there, the + stack_base/size values are erroneous. Try to patch it */ + if (pt->stack_per < 0 || pt->stack_per > 100) + pt->stack_per = 0; + } /* print information about stack space used in the thread */ - if (thr.__stack_size < 1024*1024) + if (thr.__stack_size < 1024 * 1024) { size = thr.__stack_size / 1024; car = 'K'; } - else if (thr.__stack_size < 1024*1024*1024) + else if (thr.__stack_size < 1024 * 1024 * 1024) { size = thr.__stack_size / 1024 / 1024; car = 'M'; } - else /* Who knows... */ + else /* Who knows... */ { size = thr.__stack_size / 1024 / 1024 / 1024; car = 'G'; } printf_filtered (" %4d%c %2d", size, car, pt->stack_per); -next: + next: #endif /* print the current state of the task */ @@ -635,13 +652,15 @@ next: /* check if this task is accepting a rendezvous */ if (atcb.call == NULL) caller = NULL; - else { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); - caller = EXTRACT_ADDRESS (call.self); - } - + else + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); + caller = EXTRACT_ADDRESS (call.self); + } + if (caller != NULL) - printf_filtered (" Accepting RV with %-4d", get_entry_number (caller)); + printf_filtered (" Accepting RV with %-4d", + get_entry_number (caller)); else { state = atcb.state; @@ -653,18 +672,21 @@ next: /* Replace "Runnable" by "Running" if this is the current task */ printf_filtered (" %-22s", "Running"); else - printf_filtered (" %-22s", ada_task_states [state]); + printf_filtered (" %-22s", ada_task_states[state]); } /* finally, print the name of the task */ - if (atcb.image.P_ARRAY != NULL) { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds); - bounds [1] = EXTRACT_INT (bounds [1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), - (char*)&image, bounds [1]); - printf_filtered (" %.*s\n", bounds [1], image); - } - else printf_filtered (" \n"); + if (atcb.image.P_ARRAY != NULL) + { + READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), + bounds); + bounds[1] = EXTRACT_INT (bounds[1]); + read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), + (char *) &image, bounds[1]); + printf_filtered (" %.*s\n", bounds[1], image); + } + else + printf_filtered (" \n"); pt = pt->next_task; } @@ -686,10 +708,10 @@ gdbtk_tcl_tasks_initialize (void) static void info_tasks_command (char *arg, int from_tty) { - if (arg == NULL || *arg == '\000') - info_tasks (arg, from_tty); - else - info_task (arg, from_tty); + if (arg == NULL || *arg == '\000') + info_tasks (arg, from_tty); + else + info_task (arg, from_tty); } /* Switch from one thread to another. */ @@ -730,7 +752,8 @@ task_switch (void *tid, void *lwpid) #endif } - if (res == 0) stop_pc = read_pc(); + if (res == 0) + stop_pc = read_pc (); select_frame (get_current_frame ()); return res; } @@ -746,14 +769,14 @@ task_command (char *tidstr, int from_tty) if (!tidstr) error ("Please specify a task ID. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks."); + "see the IDs of currently known tasks."); num = atoi (tidstr); e = get_entry_vptr (num); if (e == NULL) error ("Task ID %d not known. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks.", num); + "see the IDs of currently known tasks.", num); if (current_task_id == -1) { @@ -771,10 +794,11 @@ task_command (char *tidstr, int from_tty) if (task_switch (e->thread, e->lwp) == 0) { /* FIXME: find_printable_frame should be defined in frame.h, and - implemented in ada-lang.c */ - /* find_printable_frame (selected_frame, frame_relative_level (selected_frame));*/ + implemented in ada-lang.c */ + /* find_printable_frame (selected_frame, frame_relative_level (selected_frame)); */ printf_filtered ("[Switching to task %d]\n", num); - print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1); + print_stack_frame (selected_frame, + frame_relative_level (selected_frame), 1); } else printf_filtered ("Unable to switch to task %d\n", num); @@ -786,13 +810,11 @@ _initialize_tasks (void) static struct cmd_list_element *task_cmd_list = NULL; extern struct cmd_list_element *cmdlist; - add_info ( - "tasks", info_tasks_command, - "Without argument: list all known Ada tasks, with status information.\n" - "info tasks n: print detailed information of task n.\n"); + add_info ("tasks", info_tasks_command, + "Without argument: list all known Ada tasks, with status information.\n" + "info tasks n: print detailed information of task n.\n"); add_prefix_cmd ("task", class_run, task_command, - "Use this command to switch between tasks.\n\ - The new task ID must be currently known.", &task_cmd_list, "task ", 1, - &cmdlist); + "Use this command to switch between tasks.\n\ + The new task ID must be currently known.", &task_cmd_list, "task ", 1, &cmdlist); } diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index d53d2900fef..c18aa85b397 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -35,43 +35,45 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ada-lang.h" #include -#include +#include "gdb_string.h" #include -static int print_record_field_types (struct type *, struct type *, +static int print_record_field_types (struct type *, struct type *, struct ui_file *, int, int); -static void print_array_type (struct type*, struct ui_file*, int, int); +static void print_array_type (struct type *, struct ui_file *, int, int); -static void print_choices (struct type*, int, struct ui_file*, struct type*); +static void print_choices (struct type *, int, struct ui_file *, + struct type *); -static void print_range (struct type*, struct ui_file*); +static void print_range (struct type *, struct ui_file *); -static void print_range_bound (struct type*, char*, int*, struct ui_file*); +static void print_range_bound (struct type *, char *, int *, + struct ui_file *); -static void -print_dynamic_range_bound (struct type*, const char*, int, - const char*, struct ui_file*); - -static void print_range_type_named (char*, struct ui_file*); +static void +print_dynamic_range_bound (struct type *, const char *, int, + const char *, struct ui_file *); +static void print_range_type_named (char *, struct ui_file *); -static char* name_buffer; + +static char *name_buffer; static int name_buffer_len; /* The (demangled) Ada name of TYPE. This value persists until the next call. */ -static char* +static char * demangled_type_name (struct type *type) { if (ada_type_name (type) == NULL) return NULL; - else + else { - char* raw_name = ada_type_name (type); - char *s, *q; + char *raw_name = ada_type_name (type); + char *s, *q; if (name_buffer == NULL || name_buffer_len <= strlen (raw_name)) { @@ -80,7 +82,7 @@ demangled_type_name (struct type *type) } strcpy (name_buffer, raw_name); - s = (char*) strstr (name_buffer, "___"); + s = (char *) strstr (name_buffer, "___"); if (s != NULL) *s = '\0'; @@ -91,18 +93,20 @@ demangled_type_name (struct type *type) if (s == name_buffer) return name_buffer; - if (! islower (s[1])) + if (!islower (s[1])) return NULL; for (s = q = name_buffer; *s != '\0'; q += 1) { if (s[0] == '_' && s[1] == '_') { - *q = '.'; s += 2; + *q = '.'; + s += 2; } else { - *q = *s; s += 1; + *q = *s; + s += 1; } } *q = '\0'; @@ -116,25 +120,26 @@ demangled_type_name (struct type *type) NEW is the new name for a type TYPE. */ void -ada_typedef_print (struct type *type, struct symbol *new, struct ui_file *stream) +ada_typedef_print (struct type *type, struct symbol *new, + struct ui_file *stream) { - fprintf_filtered (stream, "type %.*s is ", - ada_name_prefix_len (SYMBOL_SOURCE_NAME(new)), - SYMBOL_SOURCE_NAME(new)); + fprintf_filtered (stream, "type %.*s is ", + ada_name_prefix_len (SYMBOL_SOURCE_NAME (new)), + SYMBOL_SOURCE_NAME (new)); type_print (type, "", stream, 1); } /* Print range type TYPE on STREAM. */ static void -print_range (struct type* type, struct ui_file* stream) +print_range (struct type *type, struct ui_file *stream) { - struct type* target_type; + struct type *target_type; target_type = TYPE_TARGET_TYPE (type); if (target_type == NULL) target_type = type; - switch (TYPE_CODE (target_type)) + switch (TYPE_CODE (target_type)) { case TYPE_CODE_RANGE: case TYPE_CODE_INT: @@ -156,8 +161,8 @@ print_range (struct type* type, struct ui_file* stream) Note that if the name is not defined, then we don't print anything. */ fprintf_filtered (stream, "%.*s", - ada_name_prefix_len (TYPE_NAME (type)), - TYPE_NAME (type)); + ada_name_prefix_len (TYPE_NAME (type)), + TYPE_NAME (type)); } else { @@ -165,7 +170,7 @@ print_range (struct type* type, struct ui_file* stream) and the last element of the type->fields array */ const LONGEST lower_bound = (LONGEST) TYPE_LOW_BOUND (type); const LONGEST upper_bound = - (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) -1); + (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); ada_print_scalar (target_type, lower_bound, stream); fprintf_filtered (stream, " .. "); @@ -177,7 +182,8 @@ print_range (struct type* type, struct ui_file* stream) set *N past the bound and its delimiter, if any. */ static void -print_range_bound (struct type* type, char* bounds, int* n, struct ui_file* stream) +print_range_bound (struct type *type, char *bounds, int *n, + struct ui_file *stream) { LONGEST B; if (ada_scan_number (bounds, *n, &B, n)) @@ -189,13 +195,13 @@ print_range_bound (struct type* type, char* bounds, int* n, struct ui_file* stre else { int bound_len; - char* bound = bounds + *n; - char* pend; + char *bound = bounds + *n; + char *pend; pend = strstr (bound, "__"); if (pend == NULL) *n += bound_len = strlen (bound); - else + else { bound_len = pend - bound; *n += bound_len + 2; @@ -209,7 +215,8 @@ print_range_bound (struct type* type, char* bounds, int* n, struct ui_file* stre "___U") according to the ___XD conventions. */ static void -print_dynamic_range_bound (struct type* type, const char* name, int name_len, const char* suffix, struct ui_file* stream) +print_dynamic_range_bound (struct type *type, const char *name, int name_len, + const char *suffix, struct ui_file *stream) { static char *name_buf = NULL; static size_t name_buf_len = 0; @@ -230,12 +237,12 @@ print_dynamic_range_bound (struct type* type, const char* name, int name_len, co /* Print the range type named NAME. */ static void -print_range_type_named (char* name, struct ui_file* stream) +print_range_type_named (char *name, struct ui_file *stream) { struct type *raw_type = ada_find_any_type (name); struct type *base_type; LONGEST low, high; - char* subtype_info; + char *subtype_info; if (raw_type == NULL) base_type = builtin_type_int; @@ -259,22 +266,24 @@ print_range_type_named (char* name, struct ui_file* stream) bounds_str = strchr (subtype_info, '_'); n = 1; - if (*subtype_info == 'L') + if (*subtype_info == 'L') { print_range_bound (raw_type, bounds_str, &n, stream); subtype_info += 1; } else - print_dynamic_range_bound (raw_type, name, prefix_len, "___L", stream); + print_dynamic_range_bound (raw_type, name, prefix_len, "___L", + stream); fprintf_filtered (stream, " .. "); - if (*subtype_info == 'U') + if (*subtype_info == 'U') print_range_bound (raw_type, bounds_str, &n, stream); else - print_dynamic_range_bound (raw_type, name, prefix_len, "___U", stream); + print_dynamic_range_bound (raw_type, name, prefix_len, "___U", + stream); } -} +} /* Print enumerated type TYPE on STREAM. */ @@ -291,7 +300,8 @@ print_enum_type (struct type *type, struct ui_file *stream) for (i = 0; i < len; i++) { QUIT; - if (i) fprintf_filtered (stream, ", "); + if (i) + fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); if (lastval != TYPE_FIELD_BITPOS (type, i)) @@ -317,7 +327,7 @@ print_fixed_point_type (struct type *type, struct ui_file *stream) else { fprintf_filtered (stream, "delta %g", (double) delta); - if (delta != small) + if (delta != small) fprintf_filtered (stream, " <'small = %g>", (double) small); } } @@ -337,7 +347,8 @@ print_vax_floating_point_type (struct type *type, struct ui_file *stream) structure to show (see ada_print_type). */ static void -print_array_type (struct type *type, struct ui_file *stream, int show, int level) +print_array_type (struct type *type, struct ui_file *stream, int show, + int level) { int bitsize; int n_indices; @@ -346,17 +357,17 @@ print_array_type (struct type *type, struct ui_file *stream, int show, int level fprintf_filtered (stream, "array ("); n_indices = -1; - if (show < 0) + if (show < 0) fprintf_filtered (stream, "..."); else { if (ada_is_packed_array_type (type)) type = ada_coerce_to_simple_array_type (type); - if (ada_is_simple_array (type)) + if (ada_is_simple_array (type)) { - struct type* range_desc_type = + struct type *range_desc_type = ada_find_parallel_type (type, "___XA"); - struct type* arr_type; + struct type *arr_type; bitsize = 0; if (range_desc_type == NULL) @@ -371,24 +382,24 @@ print_array_type (struct type *type, struct ui_file *stream, int show, int level bitsize = TYPE_FIELD_BITSIZE (arr_type, 0); } } - else + else { int k; - n_indices = TYPE_NFIELDS (range_desc_type); - for (k = 0, arr_type = type; + n_indices = TYPE_NFIELDS (range_desc_type); + for (k = 0, arr_type = type; k < n_indices; k += 1, arr_type = TYPE_TARGET_TYPE (arr_type)) { if (k > 0) fprintf_filtered (stream, ", "); - print_range_type_named (TYPE_FIELD_NAME (range_desc_type, k), - stream); + print_range_type_named (TYPE_FIELD_NAME + (range_desc_type, k), stream); if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0) bitsize = TYPE_FIELD_BITSIZE (arr_type, 0); - } + } } } - else + else { int i, i0; for (i = i0 = ada_array_arity (type); i > 0; i -= 1) @@ -398,8 +409,8 @@ print_array_type (struct type *type, struct ui_file *stream, int show, int level fprintf_filtered (stream, ") of "); wrap_here (""); - ada_print_type (ada_array_element_type (type, n_indices), "", stream, - show == 0 ? 0 : show-1, level+1); + ada_print_type (ada_array_element_type (type, n_indices), "", stream, + show == 0 ? 0 : show - 1, level + 1); if (bitsize > 0) fprintf_filtered (stream, " ", bitsize); } @@ -408,18 +419,19 @@ print_array_type (struct type *type, struct ui_file *stream, int show, int level STREAM, assuming the VAL_TYPE is the type of the values. */ static void -print_choices (struct type *type, int field_num, struct ui_file *stream, struct type *val_type) +print_choices (struct type *type, int field_num, struct ui_file *stream, + struct type *val_type) { int have_output; int p; - const char* name = TYPE_FIELD_NAME (type, field_num); + const char *name = TYPE_FIELD_NAME (type, field_num); have_output = 0; /* Skip over leading 'V': NOTE soon to be obsolete. */ if (name[0] == 'V') { - if (! ada_scan_number (name, 1, NULL, &p)) + if (!ada_scan_number (name, 1, NULL, &p)) goto Huh; } else @@ -427,25 +439,25 @@ print_choices (struct type *type, int field_num, struct ui_file *stream, struct while (1) { - switch (name[p]) + switch (name[p]) { default: return; case 'S': case 'R': case 'O': - if (have_output) + if (have_output) fprintf_filtered (stream, " | "); have_output = 1; break; } - switch (name[p]) + switch (name[p]) { case 'S': { LONGEST W; - if (! ada_scan_number (name, p + 1, &W, &p)) + if (!ada_scan_number (name, p + 1, &W, &p)) goto Huh; ada_print_scalar (val_type, W, stream); break; @@ -453,9 +465,8 @@ print_choices (struct type *type, int field_num, struct ui_file *stream, struct case 'R': { LONGEST L, U; - if (! ada_scan_number (name, p + 1, &L, &p) - || name[p] != 'T' - || ! ada_scan_number (name, p + 1, &U, &p)) + if (!ada_scan_number (name, p + 1, &L, &p) + || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p)) goto Huh; ada_print_scalar (val_type, L, stream); fprintf_filtered (stream, " .. "); @@ -498,7 +509,7 @@ print_variant_clauses (struct type *type, int field_num, if (TYPE_CODE (var_type) == TYPE_CODE_PTR) { var_type = TYPE_TARGET_TYPE (var_type); - if (TYPE_FLAGS (var_type) & TYPE_FLAG_STUB) + if (TYPE_FLAGS (var_type) & TYPE_FLAG_STUB) { var_type = ada_find_parallel_type (var_type, "___XVU"); if (var_type == NULL) @@ -506,13 +517,13 @@ print_variant_clauses (struct type *type, int field_num, } } - for (i = 0; i < TYPE_NFIELDS (var_type); i += 1) + for (i = 0; i < TYPE_NFIELDS (var_type); i += 1) { fprintf_filtered (stream, "\n%*swhen ", level + 4, ""); print_choices (var_type, i, stream, discr_type); fprintf_filtered (stream, " =>"); - if (print_record_field_types (TYPE_FIELD_TYPE (var_type, i), - outer_type, stream, show, level+4) <= 0) + if (print_record_field_types (TYPE_FIELD_TYPE (var_type, i), + outer_type, stream, show, level + 4) <= 0) fprintf_filtered (stream, " null;"); } } @@ -530,9 +541,10 @@ print_variant_part (struct type *type, int field_num, struct type *outer_type, struct ui_file *stream, int show, int level) { fprintf_filtered (stream, "\n%*scase %s is", level + 4, "", - ada_variant_discrim_name - (TYPE_FIELD_TYPE (type, field_num))); - print_variant_clauses (type, field_num, outer_type, stream, show, level + 4); + ada_variant_discrim_name + (TYPE_FIELD_TYPE (type, field_num))); + print_variant_clauses (type, field_num, outer_type, stream, show, + level + 4); fprintf_filtered (stream, "\n%*send case;", level + 4, ""); } @@ -561,13 +573,12 @@ print_record_field_types (struct type *type, struct type *outer_type, { QUIT; - if (ada_is_parent_field (type, i) - || ada_is_ignored_field (type, i)) + if (ada_is_parent_field (type, i) || ada_is_ignored_field (type, i)) ; else if (ada_is_wrapper_field (type, i)) flds += print_record_field_types (TYPE_FIELD_TYPE (type, i), type, stream, show, level); - else if (ada_is_variant_part (type, i)) + else if (ada_is_variant_part (type, i)) { print_variant_part (type, i, outer_type, stream, show, level); flds = 1; @@ -591,22 +602,23 @@ print_record_field_types (struct type *type, struct type *outer_type, the number of levels of internal structure to show (see ada_print_type). */ static void -print_record_type (struct type* type0, struct ui_file* stream, int show, int level) +print_record_type (struct type *type0, struct ui_file *stream, int show, + int level) { - struct type* parent_type; - struct type* type; - + struct type *parent_type; + struct type *type; + type = type0; if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) { - struct type* type1 = ada_find_parallel_type (type, "___XVE"); + struct type *type1 = ada_find_parallel_type (type, "___XVE"); if (type1 != NULL) type = type1; } parent_type = ada_parent_type (type); - if (ada_type_name (parent_type) != NULL) - fprintf_filtered (stream, "new %s with ", + if (ada_type_name (parent_type) != NULL) + fprintf_filtered (stream, "new %s with ", demangled_type_name (parent_type)); else if (parent_type == NULL && ada_is_tagged_type (type)) fprintf_filtered (stream, "tagged "); @@ -621,15 +633,15 @@ print_record_type (struct type* type0, struct ui_file* stream, int show, int lev flds = 0; if (parent_type != NULL && ada_type_name (parent_type) == NULL) - flds += print_record_field_types (parent_type, parent_type, + flds += print_record_field_types (parent_type, parent_type, stream, show, level); flds += print_record_field_types (type, type, stream, show, level); - + if (flds > 0) fprintf_filtered (stream, "\n%*send record", level, ""); - else if (flds < 0) + else if (flds < 0) fprintf_filtered (stream, " end record"); - else + else fprintf_filtered (stream, " null; end record"); } } @@ -639,44 +651,43 @@ print_record_type (struct type* type0, struct ui_file* stream, int show, int lev in case the element type itself has nested structure, and SHOW is the number of levels of internal structure to show (see ada_print_type). */ static void -print_unchecked_union_type (struct type* type, struct ui_file* stream, +print_unchecked_union_type (struct type *type, struct ui_file *stream, int show, int level) { fprintf_filtered (stream, "record (?) is"); if (show < 0) fprintf_filtered (stream, " ... end record"); - else if (TYPE_NFIELDS (type) == 0) + else if (TYPE_NFIELDS (type) == 0) fprintf_filtered (stream, " null; end record"); else { int i; - fprintf_filtered (stream, "\n%*scase ? is", - level+4, ""); + fprintf_filtered (stream, "\n%*scase ? is", level + 4, ""); - for (i = 0; i < TYPE_NFIELDS (type); i += 1) + for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level+8, "", - level+12, ""); + fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level + 8, "", + level + 12, ""); ada_print_type (TYPE_FIELD_TYPE (type, i), TYPE_FIELD_NAME (type, i), stream, show - 1, level + 12); fprintf_filtered (stream, ";"); } - fprintf_filtered (stream, "\n%*send case;\n%*send record", - level+4, "", level, ""); + fprintf_filtered (stream, "\n%*send case;\n%*send record", + level + 4, "", level, ""); } } - + /* Print function or procedure type TYPE on STREAM. Make it a header for function or procedure NAME if NAME is not null. */ static void -print_func_type (struct type *type, struct ui_file *stream, char* name) +print_func_type (struct type *type, struct ui_file *stream, char *name) { int i, len = TYPE_NFIELDS (type); @@ -685,10 +696,10 @@ print_func_type (struct type *type, struct ui_file *stream, char* name) else fprintf_filtered (stream, "function"); - if (name != NULL && name[0] != '\0') + if (name != NULL && name[0] != '\0') fprintf_filtered (stream, " %s", name); - if (len > 0) + if (len > 0) { fprintf_filtered (stream, " ("); for (i = 0; i < len; i += 1) @@ -698,11 +709,11 @@ print_func_type (struct type *type, struct ui_file *stream, char* name) fputs_filtered ("; ", stream); wrap_here (" "); } - fprintf_filtered (stream, "a%d: ", i+1); + fprintf_filtered (stream, "a%d: ", i + 1); ada_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0); } fprintf_filtered (stream, ")"); - } + } if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID) { @@ -726,35 +737,34 @@ print_func_type (struct type *type, struct ui_file *stream, char* name) LEVEL indicates level of recursion (for nested definitions). */ void -ada_print_type (struct type* type0, char* varstring, struct ui_file* stream, +ada_print_type (struct type *type0, char *varstring, struct ui_file *stream, int show, int level) { enum type_code code; int demangled_args; - struct type* type = ada_completed_type (ada_get_base_type (type0)); - char* type_name = demangled_type_name (type); + struct type *type = ada_completed_type (ada_get_base_type (type0)); + char *type_name = demangled_type_name (type); int is_var_decl = (varstring != NULL && varstring[0] != '\0'); if (type == NULL) { if (is_var_decl) fprintf_filtered (stream, "%.*s: ", - ada_name_prefix_len(varstring), - varstring); + ada_name_prefix_len (varstring), varstring); fprintf_filtered (stream, ""); return; } if (show > 0) - CHECK_TYPEDEF (type); + CHECK_TYPEDEF (type); if (is_var_decl && TYPE_CODE (type) != TYPE_CODE_FUNC) - fprintf_filtered (stream, "%.*s: ", - ada_name_prefix_len (varstring), varstring); + fprintf_filtered (stream, "%.*s: ", + ada_name_prefix_len (varstring), varstring); if (type_name != NULL && show <= 0) { - fprintf_filtered (stream, "%.*s", + fprintf_filtered (stream, "%.*s", ada_name_prefix_len (type_name), type_name); return; } @@ -764,78 +774,78 @@ ada_print_type (struct type* type0, char* varstring, struct ui_file* stream, else if (ada_is_packed_array_type (type)) print_array_type (type, stream, show, level); else - switch (TYPE_CODE (type)) - { - default: - fprintf_filtered (stream, "<"); - c_print_type (type, "", stream, show, level); - fprintf_filtered (stream, ">"); - break; - case TYPE_CODE_PTR: - fprintf_filtered (stream, "access "); - ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, - level); - break; - case TYPE_CODE_REF: - fprintf_filtered (stream, " "); - ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, - level); - break; - case TYPE_CODE_ARRAY: - print_array_type (type, stream, show, level); - break; - case TYPE_CODE_INT: - if (ada_is_fixed_point_type (type)) - print_fixed_point_type (type, stream); - else if (ada_is_vax_floating_type (type)) - print_vax_floating_point_type (type, stream); - else - { - char* name = ada_type_name (type); - if (! ada_is_range_type_name (name)) - fprintf_filtered (stream, "<%d-byte integer>", TYPE_LENGTH (type)); - else - { - fprintf_filtered (stream, "range "); - print_range_type_named (name, stream); - } - } - break; - case TYPE_CODE_RANGE: - if (ada_is_fixed_point_type (type)) - print_fixed_point_type (type, stream); - else if (ada_is_vax_floating_type (type)) - print_vax_floating_point_type (type, stream); - else if (ada_is_modular_type (type)) - fprintf_filtered (stream, "mod %ld", (long) ada_modulus (type)); - else - { - fprintf_filtered (stream, "range "); - print_range (type, stream); - } - break; - case TYPE_CODE_FLT: - fprintf_filtered (stream, "<%d-byte float>", TYPE_LENGTH (type)); - break; - case TYPE_CODE_ENUM: - if (show < 0) - fprintf_filtered (stream, "(...)"); - else - print_enum_type (type, stream); - break; - case TYPE_CODE_STRUCT: - if (ada_is_array_descriptor (type)) + switch (TYPE_CODE (type)) + { + default: + fprintf_filtered (stream, "<"); + c_print_type (type, "", stream, show, level); + fprintf_filtered (stream, ">"); + break; + case TYPE_CODE_PTR: + fprintf_filtered (stream, "access "); + ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); + break; + case TYPE_CODE_REF: + fprintf_filtered (stream, " "); + ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); + break; + case TYPE_CODE_ARRAY: print_array_type (type, stream, show, level); - else if (ada_is_bogus_array_descriptor (type)) - fprintf_filtered (stream, "array (?) of ? ()"); - else - print_record_type (type, stream, show, level); - break; - case TYPE_CODE_UNION: - print_unchecked_union_type (type, stream, show, level); - break; - case TYPE_CODE_FUNC: - print_func_type (type, stream, varstring); - break; - } + break; + case TYPE_CODE_INT: + if (ada_is_fixed_point_type (type)) + print_fixed_point_type (type, stream); + else if (ada_is_vax_floating_type (type)) + print_vax_floating_point_type (type, stream); + else + { + char *name = ada_type_name (type); + if (!ada_is_range_type_name (name)) + fprintf_filtered (stream, "<%d-byte integer>", + TYPE_LENGTH (type)); + else + { + fprintf_filtered (stream, "range "); + print_range_type_named (name, stream); + } + } + break; + case TYPE_CODE_RANGE: + if (ada_is_fixed_point_type (type)) + print_fixed_point_type (type, stream); + else if (ada_is_vax_floating_type (type)) + print_vax_floating_point_type (type, stream); + else if (ada_is_modular_type (type)) + fprintf_filtered (stream, "mod %ld", (long) ada_modulus (type)); + else + { + fprintf_filtered (stream, "range "); + print_range (type, stream); + } + break; + case TYPE_CODE_FLT: + fprintf_filtered (stream, "<%d-byte float>", TYPE_LENGTH (type)); + break; + case TYPE_CODE_ENUM: + if (show < 0) + fprintf_filtered (stream, "(...)"); + else + print_enum_type (type, stream); + break; + case TYPE_CODE_STRUCT: + if (ada_is_array_descriptor (type)) + print_array_type (type, stream, show, level); + else if (ada_is_bogus_array_descriptor (type)) + fprintf_filtered (stream, + "array (?) of ? ()"); + else + print_record_type (type, stream, show, level); + break; + case TYPE_CODE_UNION: + print_unchecked_union_type (type, stream, show, level); + break; + case TYPE_CODE_FUNC: + print_func_type (type, stream, varstring); + break; + } } diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index aaf2aff29ac..fc2db703035 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -32,9 +32,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "c-lang.h" /* Encapsulates arguments to ada_val_print. */ -struct ada_val_print_args { - struct type* type; - char* valaddr0; +struct ada_val_print_args +{ + struct type *type; + char *valaddr0; int embedded_offset; CORE_ADDR address; struct ui_file *stream; @@ -47,47 +48,47 @@ struct ada_val_print_args { extern int inspect_it; extern unsigned int repeat_count_threshold; -static void print_record (struct type*, char*, struct ui_file*, int, +static void print_record (struct type *, char *, struct ui_file *, int, int, enum val_prettyprint); -static int print_field_values (struct type*, char*, struct ui_file*, +static int print_field_values (struct type *, char *, struct ui_file *, int, int, enum val_prettyprint, - int, struct type*, char*); + int, struct type *, char *); -static int print_variant_part (struct type*, int, char*, - struct ui_file*, int, int, enum val_prettyprint, - int, struct type*, char*); +static int print_variant_part (struct type *, int, char *, + struct ui_file *, int, int, + enum val_prettyprint, int, struct type *, + char *); -static void -val_print_packed_array_elements (struct type*, char *valaddr, int, - struct ui_file*, int, int, - enum val_prettyprint); +static void val_print_packed_array_elements (struct type *, char *valaddr, + int, struct ui_file *, int, int, + enum val_prettyprint); -static void adjust_type_signedness (struct type*); +static void adjust_type_signedness (struct type *); static int ada_val_print_stub (PTR args0); -static int -ada_val_print_1 (struct type*, char*, int, CORE_ADDR, struct ui_file*, - int, int, int, enum val_prettyprint); +static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR, + struct ui_file *, int, int, int, + enum val_prettyprint); /* Make TYPE unsigned if its range of values includes no negatives. */ -static void +static void adjust_type_signedness (type) - struct type* type; + struct type *type; { - if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE + if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE && TYPE_LOW_BOUND (type) >= 0) TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED; -} +} /* Assuming TYPE is a simple array type, prints its lower bound on STREAM, if non-standard (i.e., other than 1 for numbers, other than lower bound of index type for enumerated type). Returns 1 if something printed, otherwise 0. */ -static int +static int print_optional_low_bound (struct ui_file *stream, struct type *type) { struct type *index_type; @@ -98,27 +99,28 @@ print_optional_low_bound (struct ui_file *stream, struct type *type) if (index_type == NULL) return 0; - if (TYPE_CODE (index_type) == TYPE_CODE_RANGE) + if (TYPE_CODE (index_type) == TYPE_CODE_RANGE) { low_bound = TYPE_LOW_BOUND (index_type); index_type = TYPE_TARGET_TYPE (index_type); } else return 0; - - switch (TYPE_CODE (index_type)) { - case TYPE_CODE_ENUM: - if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) - return 0; - break; - case TYPE_CODE_UNDEF: - index_type = builtin_type_long; - /* FALL THROUGH */ - default: - if (low_bound == 1) - return 0; - break; - } + + switch (TYPE_CODE (index_type)) + { + case TYPE_CODE_ENUM: + if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) + return 0; + break; + case TYPE_CODE_UNDEF: + index_type = builtin_type_long; + /* FALL THROUGH */ + default: + if (low_bound == 1) + return 0; + break; + } ada_print_scalar (index_type, (LONGEST) low_bound, stream); fprintf_filtered (stream, " => "); @@ -130,7 +132,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type) BITOFFSET from VALADDR on STREAM. Formats according to FORMAT and separates with commas. RECURSE is the recursion (nesting) level. If PRETTY, uses "prettier" format. TYPE must have been decoded (as - by ada_coerce_to_simple_array). */ + by ada_coerce_to_simple_array). */ static void val_print_packed_array_elements (struct type *type, char *valaddr, @@ -149,8 +151,8 @@ val_print_packed_array_elements (struct type *type, char *valaddr, /* Number of repetitions we have detected so far. */ unsigned int reps; unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); - struct value* mark = value_mark (); - + struct value *mark = value_mark (); + elttype = TYPE_TARGET_TYPE (type); eltlen = TYPE_LENGTH (check_typedef (elttype)); @@ -185,7 +187,7 @@ val_print_packed_array_elements (struct type *type, char *valaddr, wrap_here (n_spaces (2 + 2 * recurse)); i0 = i; - v0 = ada_value_primitive_packed_val (NULL, valaddr, + v0 = ada_value_primitive_packed_val (NULL, valaddr, (i0 * bitsize) / HOST_CHAR_BIT, (i0 * bitsize) % HOST_CHAR_BIT, bitsize, elttype); @@ -194,12 +196,11 @@ val_print_packed_array_elements (struct type *type, char *valaddr, i += 1; if (i >= len) break; - v1 = ada_value_primitive_packed_val (NULL, valaddr, + v1 = ada_value_primitive_packed_val (NULL, valaddr, (i * bitsize) / HOST_CHAR_BIT, (i * bitsize) % HOST_CHAR_BIT, bitsize, elttype); - if (memcmp (VALUE_CONTENTS (v0), VALUE_CONTENTS (v1), eltlen) - != 0) + if (memcmp (VALUE_CONTENTS (v0), VALUE_CONTENTS (v1), eltlen) != 0) break; } @@ -217,7 +218,7 @@ val_print_packed_array_elements (struct type *type, char *valaddr, int j; for (j = i0; j < i; j += 1) { - if (j > i0) + if (j > i0) { if (prettyprint_arrays) { @@ -246,8 +247,8 @@ val_print_packed_array_elements (struct type *type, char *valaddr, value_free_to_mark (mark); } -static struct type* -printable_val_type (struct type* type, char* valaddr) +static struct type * +printable_val_type (struct type *type, char *valaddr) { return ada_to_fixed_type (ada_aligned_type (type), valaddr, 0, NULL); } @@ -272,19 +273,19 @@ ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len) fprintf_filtered (stream, "%c", c); } else - fprintf_filtered (stream, "[\"%0*x\"]", type_len*2, c); + fprintf_filtered (stream, "[\"%0*x\"]", type_len * 2, c); } /* Character #I of STRING, given that TYPE_LEN is the size in bytes (1 or 2) of a character. */ static int -char_at (char* string, int i, int type_len) +char_at (char *string, int i, int type_len) { if (type_len == 1) return string[i]; - else - return (int) extract_unsigned_integer (string + 2*i, 2); + else + return (int) extract_unsigned_integer (string + 2 * i, 2); } void @@ -392,7 +393,7 @@ printstr (struct ui_file *stream, char *string, unsigned int length, for (i = 0; i < length && things_printed < print_max; i += 1) { /* Position of the character we are examining - to see whether it is repeated. */ + to see whether it is repeated. */ unsigned int rep1; /* Number of repetitions we have detected so far. */ unsigned int reps; @@ -407,8 +408,9 @@ printstr (struct ui_file *stream, char *string, unsigned int length, rep1 = i + 1; reps = 1; - while (rep1 < length && - char_at(string, rep1, type_len) == char_at (string, i, type_len)) + while (rep1 < length && + char_at (string, rep1, type_len) == char_at (string, i, + type_len)) { rep1 += 1; reps += 1; @@ -425,7 +427,8 @@ printstr (struct ui_file *stream, char *string, unsigned int length, in_quotes = 0; } fputs_filtered ("'", stream); - ada_emit_char (char_at (string, i, type_len), stream, '\'', type_len); + ada_emit_char (char_at (string, i, type_len), stream, '\'', + type_len); fputs_filtered ("'", stream); fprintf_filtered (stream, " ", reps); i = rep1 - 1; @@ -489,12 +492,13 @@ ada_printstr (struct ui_file *stream, char *string, unsigned int length, arrays.) */ int -ada_val_print (struct type* type, char* valaddr0, int embedded_offset, +ada_val_print (struct type *type, char *valaddr0, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int format, int deref_ref, int recurse, enum val_prettyprint pretty) { struct ada_val_print_args args; - args.type = type; args.valaddr0 = valaddr0; + args.type = type; + args.valaddr0 = valaddr0; args.embedded_offset = embedded_offset; args.address = address; args.stream = stream; @@ -511,18 +515,18 @@ ada_val_print (struct type* type, char* valaddr0, int embedded_offset, static int ada_val_print_stub (PTR args0) { - struct ada_val_print_args* argsp = (struct ada_val_print_args*) args0; - return ada_val_print_1 (argsp->type, argsp->valaddr0, argsp->embedded_offset, - argsp->address, argsp->stream, argsp->format, - argsp->deref_ref, argsp->recurse, - argsp->pretty); + struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0; + return ada_val_print_1 (argsp->type, argsp->valaddr0, + argsp->embedded_offset, argsp->address, + argsp->stream, argsp->format, argsp->deref_ref, + argsp->recurse, argsp->pretty); } /* See the comment on ada_val_print. This function differs in that it * does not catch evaluation errors (leaving that to ada_val_print). */ static int -ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, +ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int format, int deref_ref, int recurse, enum val_prettyprint pretty) { @@ -532,15 +536,15 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, unsigned int eltlen; LONGEST val; CORE_ADDR addr; - char* valaddr = valaddr0 + embedded_offset; + char *valaddr = valaddr0 + embedded_offset; CHECK_TYPEDEF (type); if (ada_is_array_descriptor (type) || ada_is_packed_array_type (type)) { int retn; - struct value* mark = value_mark (); - struct value* val; + struct value *mark = value_mark (); + struct value *val; val = value_from_contents_and_address (type, valaddr, address); val = ada_coerce_to_simple_array_ptr (val); if (val == NULL) @@ -550,7 +554,7 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, } else retn = ada_val_print_1 (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), stream, format, + VALUE_ADDRESS (val), stream, format, deref_ref, recurse, pretty); value_free_to_mark (mark); return retn; @@ -563,7 +567,7 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, switch (TYPE_CODE (type)) { default: - return c_val_print (type, valaddr0, embedded_offset, address, stream, + return c_val_print (type, valaddr0, embedded_offset, address, stream, format, deref_ref, recurse, pretty); case TYPE_CODE_INT: @@ -579,26 +583,26 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, } else if (ada_is_vax_floating_type (type)) { - struct value* val = + struct value *val = value_from_contents_and_address (type, valaddr, address); - struct value* func = ada_vax_float_print_function (type); + struct value *func = ada_vax_float_print_function (type); if (func != 0) { - static struct type* parray_of_char = NULL; - struct value* printable_val; - - if (parray_of_char == NULL) - parray_of_char = - make_pointer_type - (create_array_type - (NULL, builtin_type_char, - create_range_type (NULL, builtin_type_int, 0, 32)), - NULL); - - printable_val = + static struct type *parray_of_char = NULL; + struct value *printable_val; + + if (parray_of_char == NULL) + parray_of_char = + make_pointer_type + (create_array_type + (NULL, builtin_type_char, + create_range_type (NULL, builtin_type_int, 0, 32)), NULL); + + printable_val = value_ind (value_cast (parray_of_char, - call_function_by_hand (func, 1, &val))); - + call_function_by_hand (func, 1, + &val))); + fprintf_filtered (stream, "%s", VALUE_CONTENTS (printable_val)); return 0; } @@ -606,26 +610,26 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) { - struct type* target_type = TYPE_TARGET_TYPE (type); + struct type *target_type = TYPE_TARGET_TYPE (type); if (TYPE_LENGTH (type) != TYPE_LENGTH (target_type)) { /* Obscure case of range type that has different length from - its base type. Perform a conversion, or we will get a - nonsense value. Actually, we could use the same - code regardless of lengths; I'm just avoiding a cast. */ - struct value* v = - value_cast (target_type, - value_from_contents_and_address (type, valaddr, 0)); + its base type. Perform a conversion, or we will get a + nonsense value. Actually, we could use the same + code regardless of lengths; I'm just avoiding a cast. */ + struct value *v = value_cast (target_type, + value_from_contents_and_address + (type, valaddr, 0)); return ada_val_print_1 (target_type, VALUE_CONTENTS (v), 0, 0, stream, format, 0, recurse + 1, pretty); } else - return ada_val_print_1 (TYPE_TARGET_TYPE (type), + return ada_val_print_1 (TYPE_TARGET_TYPE (type), valaddr0, embedded_offset, - address, stream, format, deref_ref, + address, stream, format, deref_ref, recurse, pretty); } - else + else { format = format ? format : output_format; if (format) @@ -663,8 +667,8 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, } if (i < len) { - const char* name = ada_enum_name (TYPE_FIELD_NAME (type, i)); - if (name[0] == '\'') + const char *name = ada_enum_name (TYPE_FIELD_NAME (type, i)); + if (name[0] == '\'') fprintf_filtered (stream, "%ld %s", (long) val, name); else fputs_filtered (name, stream); @@ -674,18 +678,17 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, print_longest (stream, 'd', 0, val); } break; - + case TYPE_CODE_UNION: case TYPE_CODE_STRUCT: if (ada_is_bogus_array_descriptor (type)) { fprintf_filtered (stream, "(...?)"); return 0; - } + } else { - print_record (type, valaddr, stream, format, - recurse, pretty); + print_record (type, valaddr, stream, format, recurse, pretty); return 0; } @@ -695,21 +698,20 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, elttype = TYPE_TARGET_TYPE (type); eltlen = TYPE_LENGTH (elttype); len = TYPE_LENGTH (type) / eltlen; - + /* For an array of chars, print with string syntax. */ - if (ada_is_string_type (type) - && (format == 0 || format == 's')) + if (ada_is_string_type (type) && (format == 0 || format == 's')) { if (prettyprint_arrays) { print_spaces_filtered (2 + 2 * recurse, stream); } /* If requested, look for the first null char and only print - elements up to it. */ + elements up to it. */ if (stop_print_at_null) { int temp_len; - + /* Look for a NULL char. */ for (temp_len = 0; temp_len < len && temp_len < print_max @@ -717,7 +719,7 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, temp_len += 1); len = temp_len; } - + printstr (stream, valaddr, len, 0, eltlen); } else @@ -725,10 +727,9 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, len = 0; fprintf_filtered (stream, "("); print_optional_low_bound (stream, type); - if (TYPE_FIELD_BITSIZE (type, 0) > 0) + if (TYPE_FIELD_BITSIZE (type, 0) > 0) val_print_packed_array_elements (type, valaddr, 0, stream, - format, recurse, - pretty); + format, recurse, pretty); else val_print_array_elements (type, valaddr, address, stream, format, deref_ref, recurse, @@ -742,27 +743,27 @@ ada_val_print_1 (struct type* type, char* valaddr0, int embedded_offset, case TYPE_CODE_REF: elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (addressprint) - { + { fprintf_filtered (stream, "@"); print_address_numeric (extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream); if (deref_ref) fputs_filtered (": ", stream); - } + } /* De-reference the reference */ if (deref_ref) { if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF) { - LONGEST deref_val_int = (LONGEST) - unpack_pointer (lookup_pointer_type (builtin_type_void), + LONGEST deref_val_int = (LONGEST) + unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr); - if (deref_val_int != 0) + if (deref_val_int != 0) { - struct value* deref_val = - ada_value_ind (value_from_longest - (lookup_pointer_type (elttype), + struct value *deref_val = + ada_value_ind (value_from_longest + (lookup_pointer_type (elttype), deref_val_int)); val_print (VALUE_TYPE (deref_val), VALUE_CONTENTS (deref_val), 0, @@ -787,13 +788,12 @@ print_variant_part (struct type *type, int field_num, char *valaddr, struct type *outer_type, char *outer_valaddr) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); - int which = - ada_which_variant_applies (var_type, outer_type, outer_valaddr); + int which = ada_which_variant_applies (var_type, outer_type, outer_valaddr); if (which < 0) return 0; else - return print_field_values + return print_field_values (TYPE_FIELD_TYPE (var_type, which), valaddr + TYPE_FIELD_BITPOS (type, field_num) / HOST_CHAR_BIT + TYPE_FIELD_BITPOS (var_type, which) / HOST_CHAR_BIT, @@ -802,23 +802,23 @@ print_variant_part (struct type *type, int field_num, char *valaddr, } int -ada_value_print (struct value* val0, struct ui_file *stream, int format, +ada_value_print (struct value *val0, struct ui_file *stream, int format, enum val_prettyprint pretty) { - char* valaddr = VALUE_CONTENTS (val0); + char *valaddr = VALUE_CONTENTS (val0); CORE_ADDR address = VALUE_ADDRESS (val0) + VALUE_OFFSET (val0); - struct type* type = + struct type *type = ada_to_fixed_type (VALUE_TYPE (val0), valaddr, address, NULL); - struct value* val = value_from_contents_and_address (type, valaddr, address); + struct value *val = + value_from_contents_and_address (type, valaddr, address); /* If it is a pointer, indicate what it points to. */ - if (TYPE_CODE (type) == TYPE_CODE_PTR || - TYPE_CODE (type) == TYPE_CODE_REF) + if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF) { /* Hack: remove (char *) for char strings. Their - type is indicated by the quoted string anyway. */ + type is indicated by the quoted string anyway. */ if (TYPE_CODE (type) == TYPE_CODE_PTR && - TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof(char) && + TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof (char) && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT && !TYPE_UNSIGNED (TYPE_TARGET_TYPE (type))) { @@ -831,7 +831,7 @@ ada_value_print (struct value* val0, struct ui_file *stream, int format, fprintf_filtered (stream, ") "); } } - else if (ada_is_array_descriptor (type)) + else if (ada_is_array_descriptor (type)) { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); @@ -844,10 +844,10 @@ ada_value_print (struct value* val0, struct ui_file *stream, int format, fprintf_filtered (stream, ") (...?)"); return 0; } - return (val_print (type, VALUE_CONTENTS (val), 0, address, + return (val_print (type, VALUE_CONTENTS (val), 0, address, stream, format, 1, 0, pretty)); } - + static void print_record (struct type *type, char *valaddr, struct ui_file *stream, int format, int recurse, enum val_prettyprint pretty) @@ -857,8 +857,7 @@ print_record (struct type *type, char *valaddr, struct ui_file *stream, fprintf_filtered (stream, "("); if (print_field_values (type, valaddr, stream, format, recurse, pretty, - 0, type, valaddr) != 0 - && pretty) + 0, type, valaddr) != 0 && pretty) { fprintf_filtered (stream, "\n"); print_spaces_filtered (2 * recurse, stream); @@ -894,13 +893,13 @@ print_field_values (struct type *type, char *valaddr, struct ui_file *stream, for (i = 0; i < len; i += 1) { if (ada_is_ignored_field (type, i)) - continue; + continue; if (ada_is_wrapper_field (type, i)) { - comma_needed = + comma_needed = print_field_values (TYPE_FIELD_TYPE (type, i), - valaddr + valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT, stream, format, recurse, pretty, comma_needed, type, valaddr); @@ -924,7 +923,7 @@ print_field_values (struct type *type, char *valaddr, struct ui_file *stream, fprintf_filtered (stream, "\n"); print_spaces_filtered (2 + 2 * recurse, stream); } - else + else { wrap_here (n_spaces (2 + 2 * recurse)); } @@ -944,7 +943,7 @@ print_field_values (struct type *type, char *valaddr, struct ui_file *stream, else { annotate_field_begin (TYPE_FIELD_TYPE (type, i)); - fprintf_filtered (stream, "%.*s", + fprintf_filtered (stream, "%.*s", ada_name_prefix_len (TYPE_FIELD_NAME (type, i)), TYPE_FIELD_NAME (type, i)); annotate_field_name_end (); @@ -954,7 +953,7 @@ print_field_values (struct type *type, char *valaddr, struct ui_file *stream, if (TYPE_FIELD_PACKED (type, i)) { - struct value* v; + struct value *v; /* Bitfields require special handling, especially due to byte order problems. */ @@ -967,21 +966,21 @@ print_field_values (struct type *type, char *valaddr, struct ui_file *stream, { int bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i); - + adjust_type_signedness (TYPE_FIELD_TYPE (type, i)); v = ada_value_primitive_packed_val (NULL, valaddr, bit_pos / HOST_CHAR_BIT, bit_pos % HOST_CHAR_BIT, - bit_size, + bit_size, TYPE_FIELD_TYPE (type, i)); - val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0, 0, + val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0, stream, format, 0, recurse + 1, pretty); } } else - ada_val_print (TYPE_FIELD_TYPE (type, i), - valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT, - 0, 0, stream, format, 0, recurse + 1, pretty); + ada_val_print (TYPE_FIELD_TYPE (type, i), + valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT, + 0, 0, stream, format, 0, recurse + 1, pretty); annotate_field_end (); } diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 6d62eea3215..da75f21dbd1 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -926,7 +926,7 @@ aix_thread_attach (char *args, int from_tty) static void aix_thread_detach (char *args, int from_tty) { - pd_deactivate (); + pd_disable (); base_target.to_detach (args, from_tty); } diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index 12320519ae8..ece5e2694f2 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -58,6 +58,10 @@ alpha_osf1_init_abi (struct gdbarch_info info, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp); + /* The next/step support via procfs on OSF1 is broken when running + on multi-processor machines. We need to use software single stepping + instead. */ + set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame; tdep->sigcontext_addr = alpha_osf1_sigcontext_addr; diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 564896fdc94..7018d39773e 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -54,7 +54,6 @@ static gdbarch_register_convert_to_virtual_ftype 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_store_return_value_ftype alpha_store_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype alpha_extract_struct_value_address; static gdbarch_use_struct_convention_ftype alpha_use_struct_convention; @@ -65,7 +64,6 @@ static gdbarch_frame_args_address_ftype alpha_frame_args_address; static gdbarch_frame_locals_address_ftype alpha_frame_locals_address; static gdbarch_skip_prologue_ftype alpha_skip_prologue; -static gdbarch_get_saved_register_ftype alpha_get_saved_register; static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call; static gdbarch_frame_chain_ftype alpha_frame_chain; static gdbarch_frame_saved_pc_ftype alpha_frame_saved_pc; @@ -501,54 +499,6 @@ alpha_frame_saved_pc (struct frame_info *frame) return read_next_frame_reg (frame, pcreg); } -static void -alpha_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, - enum lval_type *lval) -{ - CORE_ADDR addr; - - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - addr = find_saved_register (frame, regnum); - if (addr != 0) - { - if (lval != NULL) - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer != NULL) - { - /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - (LONGEST) addr); - } - if (addrp != NULL) - *addrp = 0; - return; - } - if (raw_buffer != NULL) - target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); - } - else - { - if (lval != NULL) - *lval = lval_register; - addr = REGISTER_BYTE (regnum); - if (raw_buffer != NULL) - read_register_gen (regnum, raw_buffer); - } - if (addrp != NULL) - *addrp = addr; -} - static CORE_ADDR alpha_saved_pc_after_call (struct frame_info *frame) { @@ -1904,13 +1854,12 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc); set_gdbarch_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs); - set_gdbarch_get_saved_register (gdbarch, alpha_get_saved_register); 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_store_return_value (gdbarch, alpha_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, alpha_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address); diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index a407f9e28be..ecdecaf9a1a 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -95,12 +95,26 @@ legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) register cache. */ void legacy_extract_return_value (struct type *type, struct regcache *regcache, - char *valbuf) + void *valbuf) { char *registers = deprecated_grub_regcache_for_registers (regcache); - DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, valbuf); + bfd_byte *buf = valbuf; + DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf); } +/* Implementation of store return value that grubs the register cache. + Takes a local copy of the buffer to avoid const problems. */ +void +legacy_store_return_value (struct type *type, struct regcache *regcache, + const void *buf) +{ + bfd_byte *b = alloca (TYPE_LENGTH (type)); + gdb_assert (regcache == current_regcache); + memcpy (b, buf, TYPE_LENGTH (type)); + DEPRECATED_STORE_RETURN_VALUE (type, b); +} + + int legacy_register_sim_regno (int regnum) { @@ -141,6 +155,12 @@ generic_in_solib_call_trampoline (CORE_ADDR pc, char *name) return 0; } +int +generic_in_solib_return_trampoline (CORE_ADDR pc, char *name) +{ + return 0; +} + int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) { @@ -250,21 +270,6 @@ default_double_format (struct gdbarch *gdbarch) } } -void -default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, - struct frame_info *frame) -{ -#ifdef FLOAT_INFO -#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL -#error "FLOAT_INFO defined in multi-arch" -#endif - FLOAT_INFO; -#else - fprintf_filtered (file, "\ -No floating point info available for this processor.\n"); -#endif -} - /* Misc helper functions for targets. */ int @@ -444,6 +449,23 @@ generic_register_size (int regnum) (name && STREQ ("_sigtramp", name)) #endif #endif + +/* Assume all registers are adjacent. */ + +int +generic_register_byte (int regnum) +{ + int byte; + int i; + gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS); + byte = 0; + for (i = 0; i < regnum; i++) + { + byte += TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i)); + } + return byte; +} + int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name) diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 7ceb8b70b84..91aa2f89f5c 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -43,6 +43,9 @@ extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc; register cache. */ extern gdbarch_extract_return_value_ftype legacy_extract_return_value; +/* Implementation of store return value that grubs the register cache. */ +extern gdbarch_store_return_value_ftype legacy_store_return_value; + /* Frameless functions not identifable. */ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not; @@ -144,17 +147,18 @@ extern CORE_ADDR generic_skip_trampoline_code (CORE_ADDR pc); extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name); -extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc); +extern int generic_in_solib_return_trampoline (CORE_ADDR pc, char *name); -extern void default_print_float_info (struct gdbarch *gdbarch, - struct ui_file *file, - struct frame_info *frame); +extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc); /* Assume that the world is sane, a registers raw and virtual size both match its type. */ extern int generic_register_size (int regnum); +/* Assume that the world is sane, the registers are all adjacent. */ +extern int generic_register_byte (int regnum); + /* Prop up old targets that use various IN_SIGTRAMP() macros. */ extern int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index ba213ae6da4..b896b688650 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1585,7 +1585,7 @@ print_fpu_flags (int flags) (if present) or emulator. */ static void arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, - struct frame_info *frame) + struct frame_info *frame, const char *args) { register unsigned long status = read_register (ARM_FPS_REGNUM); int type; @@ -2926,7 +2926,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Returning results. */ set_gdbarch_deprecated_extract_return_value (gdbarch, arm_extract_return_value); - set_gdbarch_store_return_value (gdbarch, arm_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, arm_store_return_value); set_gdbarch_store_struct_return (gdbarch, arm_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 79d0af19df3..b24533223c6 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1244,7 +1244,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* set_gdbarch_push_return_address (gdbarch, avr_push_return_address); */ set_gdbarch_pop_frame (gdbarch, avr_pop_frame); - set_gdbarch_store_return_value (gdbarch, avr_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, avr_store_return_value); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 368b9df12a1..8f23905a90d 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -30,6 +30,7 @@ #include "target.h" #include "ax.h" #include "ax-gdb.h" +#include "gdb_string.h" /* To make sense of this file, you should read doc/agentexpr.texi. Then look at the types and enums in ax-gdb.h. For the code itself, diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 93a4765e7d5..b2c5d0eabe9 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -809,9 +809,9 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, mapped_pc = overlay_mapped_address (pc, section); - if (mapped_pc >= cache_pc_function_low && - mapped_pc < cache_pc_function_high && - section == cache_pc_function_section) + if (mapped_pc >= cache_pc_function_low + && mapped_pc < cache_pc_function_high + && section == cache_pc_function_section) goto return_cached_value; /* If sigtramp is in the u area, it counts as a function (especially @@ -917,7 +917,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, for (i = 1; SYMBOL_NAME (msymbol + i) != NULL; i++) { if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol) - && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol)) + && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol)) break; } @@ -929,7 +929,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, So the end address is the end of the section. */ cache_pc_function_high = osect->endaddr; -return_cached_value: + return_cached_value: if (address) { @@ -948,8 +948,8 @@ return_cached_value: { /* Because the high address is actually beyond the end of the function (and therefore possibly beyond the end of - the overlay), we must actually convert (high - 1) - and then add one to that. */ + the overlay), we must actually convert (high - 1) and + then add one to that. */ *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1, section); @@ -961,7 +961,7 @@ return_cached_value: return 1; } -/* Backward compatibility, no section argument */ +/* Backward compatibility, no section argument. */ int find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, @@ -1215,7 +1215,20 @@ generic_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno) struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp); if (dummy_regs) - return regcache_raw_read_as_address (dummy_regs, regno); + { + /* NOTE: cagney/2002-08-12: Replaced a call to + regcache_raw_read_as_address() with a call to + regcache_cooked_read_unsigned(). The old, ...as_address + function was eventually calling extract_unsigned_integer (via + extract_address) to unpack the registers value. The below is + doing an unsigned extract so that it is functionally + equivalent. The read needs to be cooked as, otherwise, it + will never correctly return the value of a register in the + [NUM_REGS .. NUM_REGS+NUM_PSEUDO_REGS) range. */ + ULONGEST val; + regcache_cooked_read_unsigned (dummy_regs, regno, &val); + return val; + } else return 0; } @@ -1389,11 +1402,10 @@ generic_call_dummy_register_unwind (struct frame_info *frame, void **cache, #endif gdb_assert (registers != NULL); /* Return the actual value. */ - /* FIXME: cagney/2002-06-26: This should be via the - gdbarch_register_read() method so that it, on the fly, + /* Use the regcache_cooked_read() method so that it, on the fly, constructs either a raw or pseudo register from the raw register cache. */ - regcache_raw_read (registers, regnum, bufferp); + regcache_cooked_read (registers, regnum, bufferp); } } @@ -1410,7 +1422,11 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, /* There is always a frame at this point. And THIS is the frame we're interested in. */ gdb_assert (frame != NULL); - gdb_assert (!PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)); + /* If we're using generic dummy frames, we'd better not be in a call + dummy. (generic_call_dummy_register_unwind ought to have been called + instead.) */ + gdb_assert (!(USE_GENERIC_DUMMY_FRAMES + && PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))); /* Load the saved_regs register cache. */ if (frame->saved_regs == NULL) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 0bd1de96863..0fa899ce37c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -45,6 +45,7 @@ #include "completer.h" #include "gdb.h" #include "ui-out.h" +#include "cli/cli-script.h" #include "gdb-events.h" @@ -715,10 +716,22 @@ insert_breakpoints (void) int return_val = 0; /* return success code. */ int val = 0; int disabled_breaks = 0; + int hw_breakpoint_error = 0; + int process_warning = 0; static char message1[] = "Error inserting catchpoint %d:\n"; static char message[sizeof (message1) + 30]; +#ifdef ONE_PROCESS_WRITETEXT + process_warning = 1; +#endif + + struct ui_file *tmp_error_stream = mem_fileopen (); + make_cleanup_ui_file_delete (tmp_error_stream); + + /* Explicitly mark the warning -- this will only be printed if + there was an error. */ + fprintf_unfiltered (tmp_error_stream, "Warning:\n"); ALL_BREAKPOINTS_SAFE (b, temp) { @@ -776,8 +789,9 @@ insert_breakpoints (void) /* Set a software (trap) breakpoint at the LMA. */ val = target_insert_breakpoint (addr, b->shadow_contents); if (val != 0) - warning ("overlay breakpoint %d failed: in ROM?", - b->number); + fprintf_unfiltered (tmp_error_stream, + "Overlay breakpoint %d failed: in ROM?", + b->number); } } /* Shall we set a breakpoint at the VMA? */ @@ -810,22 +824,34 @@ insert_breakpoints (void) b->enable_state = bp_shlib_disabled; if (!disabled_breaks) { - target_terminal_ours_for_output (); - warning ("Cannot insert breakpoint %d:", b->number); - warning ("Temporarily disabling shared library breakpoints:"); + fprintf_unfiltered (tmp_error_stream, + "Cannot insert breakpoint %d.\n", b->number); + fprintf_unfiltered (tmp_error_stream, + "Temporarily disabling shared library breakpoints:\n"); } disabled_breaks = 1; - warning ("breakpoint #%d ", b->number); + fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number); } else #endif { - target_terminal_ours_for_output (); - warning ("Cannot insert breakpoint %d:", b->number); -#ifdef ONE_PROCESS_WRITETEXT - warning ("The same program may be running in another process."); -#endif - memory_error (val, b->address); /* which bombs us out */ + process_warning = 1; + if (b->type == bp_hardware_breakpoint) + { + hw_breakpoint_error = 1; + fprintf_unfiltered (tmp_error_stream, + "Cannot insert hardware breakpoint %d.\n", + b->number); + } + else + { + fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number); + fprintf_filtered (tmp_error_stream, "Error accessing memory address "); + print_address_numeric (b->address, 1, tmp_error_stream); + fprintf_filtered (tmp_error_stream, ": %s.\n", + safe_strerror (val)); + } + } } else @@ -852,9 +878,13 @@ insert_breakpoints (void) if (val) { /* Couldn't set breakpoint for some reason */ - target_terminal_ours_for_output (); - warning ("Cannot insert catchpoint %d; disabling it.", - b->number); + fprintf_unfiltered (tmp_error_stream, + "Cannot insert catchpoint %d; disabling it.\n", + b->number); + fprintf_filtered (tmp_error_stream, "Error accessing memory address "); + print_address_numeric (b->address, 1, tmp_error_stream); + fprintf_filtered (tmp_error_stream, ": %s.\n", + safe_strerror (val)); b->enable_state = bp_disabled; } else @@ -876,9 +906,9 @@ insert_breakpoints (void) if (val == -1) { /* something went wrong */ - target_terminal_ours_for_output (); - warning ("Cannot insert catchpoint %d; disabling it.", - b->number); + fprintf_unfiltered (tmp_error_stream, + "Cannot insert catchpoint %d; disabling it.\n", + b->number); b->enable_state = bp_disabled; } } @@ -955,7 +985,7 @@ insert_breakpoints (void) addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v); len = TYPE_LENGTH (VALUE_TYPE (v)); - type = hw_write; + type = hw_write; if (b->type == bp_read_watchpoint) type = hw_read; else if (b->type == bp_access_watchpoint) @@ -980,9 +1010,11 @@ insert_breakpoints (void) value chain brings us here. */ if (!b->inserted) { + process_warning = 1; remove_breakpoint (b, mark_uninserted); - warning ("Could not insert hardware watchpoint %d.", - b->number); + hw_breakpoint_error = 1; + fprintf_unfiltered (tmp_error_stream, + "Cannot insert hardware watchpoint %d.\n", b->number); val = -1; } } @@ -1029,8 +1061,7 @@ insert_breakpoints (void) } if (val < 0) { - target_terminal_ours_for_output (); - warning ("Cannot insert catchpoint %d.", b->number); + fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number); } else b->inserted = 1; @@ -1039,11 +1070,26 @@ insert_breakpoints (void) return_val = val; /* remember failure */ } } + + if (return_val) + { + /* If a hardware breakpoint or watchpoint was inserted, add a + message about possibly exhausted resources. */ + if (hw_breakpoint_error) + { + fprintf_unfiltered (tmp_error_stream, "Could not insert hardware breakpoints:\n" + "You may have requested too many hardware breakpoints/watchpoints.\n"); + } + if (process_warning) + fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process."); + + target_terminal_ours_for_output (); + error_stream (tmp_error_stream); + } return return_val; } - int remove_breakpoints (void) { @@ -1718,6 +1764,7 @@ bpstat_clear (bpstat *bsp) q = p->next; if (p->old_val != NULL) value_free (p->old_val); + free_command_lines (&p->commands); xfree (p); p = q; } @@ -1830,7 +1877,7 @@ bpstat_clear_actions (bpstat bs) { for (; bs != NULL; bs = bs->next) { - bs->commands = NULL; + free_command_lines (&bs->commands); if (bs->old_val != NULL) { value_free (bs->old_val); @@ -1899,11 +1946,9 @@ top: to look at, so start over. */ goto top; else - bs->commands = NULL; + free_command_lines (&bs->commands); } - - executing_breakpoint_commands = 0; - discard_cleanups (old_chain); + do_cleanups (old_chain); } /* This is the normal print function for a bpstat. In the future, @@ -2390,7 +2435,7 @@ which its expression is valid.\n"); /* Get a bpstat associated with having just stopped at address *PC and frame address CORE_ADDRESS. Update *PC to point at the - breakpoint (if we hit a breakpoint). NOT_A_BREAKPOINT is nonzero + breakpoint (if we hit a breakpoint). NOT_A_SW_BREAKPOINT is nonzero if this is known to not be a real breakpoint (it could still be a watchpoint, though). */ @@ -2409,7 +2454,7 @@ which its expression is valid.\n"); commands, FIXME??? fields. */ bpstat -bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint) +bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint) { register struct breakpoint *b, *temp; CORE_ADDR bp_addr; @@ -2423,14 +2468,13 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint) "Error evaluating expression for watchpoint %d\n"; char message[sizeof (message1) + 30 /* slop */ ]; - /* Get the address where the breakpoint would have been. - The "not_a_breakpoint" argument is meant to distinguish - between a breakpoint trap event and a trace/singlestep - trap event. For a trace/singlestep trap event, we would - not want to subtract DECR_PC_AFTER_BREAK from the PC. */ + /* Get the address where the breakpoint would have been. The + "not_a_sw_breakpoint" argument is meant to distinguish between a + breakpoint trap event and a trace/singlestep trap event. For a + trace/singlestep trap event, we would not want to subtract + DECR_PC_AFTER_BREAK from the PC. */ - bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? - 0 : DECR_PC_AFTER_BREAK); + bp_addr = *pc - (not_a_sw_breakpoint ? 0 : DECR_PC_AFTER_BREAK); ALL_BREAKPOINTS_SAFE (b, temp) { @@ -2686,7 +2730,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint) /* We will stop here */ if (b->disposition == disp_disable) b->enable_state = bp_disabled; - bs->commands = b->commands; + bs->commands = copy_command_lines (b->commands); if (b->silent) bs->print = 0; if (bs->commands && @@ -6685,11 +6729,32 @@ delete_breakpoint (struct breakpoint *bpt) else val = target_insert_breakpoint (b->address, b->shadow_contents); + /* If there was an error in the insert, print a message, then stop execution. */ if (val != 0) { + struct ui_file *tmp_error_stream = mem_fileopen (); + make_cleanup_ui_file_delete (tmp_error_stream); + + + if (b->type == bp_hardware_breakpoint) + { + fprintf_unfiltered (tmp_error_stream, + "Cannot insert hardware breakpoint %d.\n" + "You may have requested too many hardware breakpoints.\n", + b->number); + } + else + { + fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number); + fprintf_filtered (tmp_error_stream, "Error accessing memory address "); + print_address_numeric (b->address, 1, tmp_error_stream); + fprintf_filtered (tmp_error_stream, ": %s.\n", + safe_strerror (val)); + } + + fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process."); target_terminal_ours_for_output (); - warning ("Cannot insert breakpoint %d:", b->number); - memory_error (val, b->address); /* which bombs us out */ + error_stream(tmp_error_stream); } else b->inserted = 1; @@ -6725,14 +6790,8 @@ delete_breakpoint (struct breakpoint *bpt) if (bs->breakpoint_at == bpt) { bs->breakpoint_at = NULL; - - /* we'd call bpstat_clear_actions, but that free's stuff and due - to the multiple pointers pointing to one item with no - reference counts found anywhere through out the bpstat's (how - do you spell fragile?), we don't want to free things twice -- - better a memory leak than a corrupt malloc pool! */ - bs->commands = NULL; bs->old_val = NULL; + /* bs->commands will be freed later. */ } /* On the chance that someone will soon try again to delete this same bp, we mark it as deleted before freeing its storage. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 7ab300ffb65..226703b5938 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -322,7 +322,7 @@ extern void bpstat_clear (bpstat *); is part of the bpstat is copied as well. */ extern bpstat bpstat_copy (bpstat); -extern bpstat bpstat_stop_status (CORE_ADDR *, int); +extern bpstat bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint); /* This bpstat_what stuff tells wait_for_inferior what to do with a breakpoint (a challenging task). */ diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 2316e966f67..b1962dffeae 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -486,11 +486,11 @@ record_pending_block (struct objfile *objfile, struct block *block, } } -/* Note that this is only used in this file and in dstread.c, which - should be fixed to not need direct access to this function. When - that is done, it can be made static again. */ +/* OBSOLETE Note that this is only used in this file and in dstread.c, which */ +/* OBSOLETE should be fixed to not need direct access to this function. When */ +/* OBSOLETE that is done, it can be made static again. */ -struct blockvector * +static struct blockvector * make_blockvector (struct objfile *objfile) { register struct pending_block *next; diff --git a/gdb/buildsym.h b/gdb/buildsym.h index d023aa3e855..8a252cb2b4c 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -277,11 +277,11 @@ extern int hashname (char *name); extern void free_pending_blocks (void); -/* FIXME: Note that this is used only in buildsym.c and dstread.c, - which should be fixed to not need direct access to - make_blockvector. */ +/* OBSOLETE FIXME: Note that this is used only in buildsym.c and dstread.c, */ +/* OBSOLETE which should be fixed to not need direct access to */ +/* OBSOLETE make_blockvector. */ -extern struct blockvector *make_blockvector (struct objfile *objfile); +/* OBSOLETE extern struct blockvector *make_blockvector (struct objfile *objfile); */ /* FIXME: Note that this is used only in buildsym.c and dstread.c, which should be fixed to not need direct access to diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 9361067ceaa..925d9c5469c 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_string.h" #include "symtab.h" #include "gdbtypes.h" #include "expression.h" diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 9aac6e6aaae..2b23301c6b3 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1012,6 +1012,36 @@ make_cleanup_free_command_lines (struct command_line **arg) { return make_cleanup (do_free_command_lines_cleanup, arg); } + +struct command_line * +copy_command_lines (struct command_line *cmds) +{ + struct command_line *result = NULL; + + if (cmds) + { + result = (struct command_line *) xmalloc (sizeof (struct command_line)); + + result->next = copy_command_lines (cmds->next); + result->line = xstrdup (cmds->line); + result->control_type = cmds->control_type; + result->body_count = cmds->body_count; + if (cmds->body_count > 0) + { + int i; + + result->body_list = (struct command_line **) + xmalloc (sizeof (struct command_line *) * cmds->body_count); + + for (i = 0; i < cmds->body_count; i++) + result->body_list[i] = copy_command_lines (cmds->body_list[i]); + } + else + result->body_list = NULL; + } + + return result; +} static void validate_comname (char *comname) diff --git a/gdb/cli/cli-script.h b/gdb/cli/cli-script.h index f8604c6cb71..898e3cc04f8 100644 --- a/gdb/cli/cli-script.h +++ b/gdb/cli/cli-script.h @@ -41,6 +41,8 @@ extern enum command_control_type extern void print_command_lines (struct ui_out *, struct command_line *, unsigned int); +extern struct command_line * copy_command_lines (struct command_line *cmds); + /* Exported to gdb/infrun.c */ extern void execute_user_command (struct cmd_list_element *c, char *args); diff --git a/gdb/coffread.c b/gdb/coffread.c index 52b36c88c34..d794a7d382a 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -593,16 +593,34 @@ coff_symfile_read (struct objfile *objfile, int mainline) /* End of warning */ - /* Read the line number table, all at once. */ info->min_lineno_offset = 0; info->max_lineno_offset = 0; - bfd_map_over_sections (abfd, find_linenos, (void *) info); - make_cleanup (free_linetab_cleanup, 0 /*ignore*/); - val = init_lineno (abfd, info->min_lineno_offset, - info->max_lineno_offset - info->min_lineno_offset); - if (val < 0) - error ("\"%s\": error reading line numbers\n", name); + /* Only read line number information if we have symbols. + + On Windows NT, some of the system's DLL's have sections with + PointerToLinenumbers fields that are non-zero, but point at + random places within the image file. (In the case I found, + KERNEL32.DLL's .text section has a line number info pointer that + points into the middle of the string `lib\\i386\kernel32.dll'.) + + However, these DLL's also have no symbols. The line number + tables are meaningless without symbols. And in fact, GDB never + uses the line number information unless there are symbols. So we + can avoid spurious error messages (and maybe run a little + faster!) by not even reading the line number table unless we have + symbols. */ + if (num_symbols > 0) + { + /* Read the line number table, all at once. */ + bfd_map_over_sections (abfd, find_linenos, (void *) info); + + make_cleanup (free_linetab_cleanup, 0 /*ignore*/); + val = init_lineno (abfd, info->min_lineno_offset, + info->max_lineno_offset - info->min_lineno_offset); + if (val < 0) + error ("\"%s\": error reading line numbers\n", name); + } /* Now read the string table, all at once. */ diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index ce09fa46b7c..47e5483d643 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -18,6 +18,10 @@ @V@/bfd/elf32-m68hc11.c @V@/bfd/em68hc11.c @V@/bfd/elf32-m68hc12.c @V@/bfd/em68hc12.c @V@/bfd/elf32-m68k.c @V@/bfd/em68k.c +@V@/bfd/elf32-ppc.c @V@/bfd/e32ppc.c +@V@/bfd/elf32-ppcqnx.c @V@/bfd/e32ppcq.c +@V@/bfd/elf32-sh.c @V@/bfd/e32sh.c +@V@/bfd/elf32-shqnx.c @V@/bfd/e32shq.c @V@/bfd/elf32-sh-lin.c @V@/bfd/e32shlin.c @V@/bfd/elf32-sh-nbsd.c @V@/bfd/e32shn.c @V@/bfd/elf32-sh64.c @V@/bfd/e32sh64.c diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index 1ac08db3e62..3020e4d27c8 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -175,7 +175,7 @@ extern void h8300_extract_return_value (struct type *, char *, char *); /* FIXME: Won't work with both h8/300's. */ extern void h8300_store_return_value (struct type *, char *); -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ h8300_store_return_value(TYPE, (char *) (VALBUF)) /* struct passing and returning stuff */ diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index 96a93b5e75d..30acdbe05bf 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -168,7 +168,7 @@ extern struct type *h8500_register_virtual_type (int regno); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) /* Extract from an array REGBUF containing the (raw) register state diff --git a/gdb/config/i386/i386aix.mh b/gdb/config/i386/i386aix.mh index af88729a45c..df571bf09b2 100644 --- a/gdb/config/i386/i386aix.mh +++ b/gdb/config/i386/i386aix.mh @@ -1,9 +1,9 @@ -# Host: IBM PS/2 (i386) running AIX PS/2 - -XM_FILE= xm-i386aix.h - -NAT_FILE= nm-i386aix.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o - -# Use gcc. Only coff output can be debugged -CC=gcc +# OBSOLETE # Host: IBM PS/2 (i386) running AIX PS/2 +# OBSOLETE +# OBSOLETE XM_FILE= xm-i386aix.h +# OBSOLETE +# OBSOLETE NAT_FILE= nm-i386aix.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o +# OBSOLETE +# OBSOLETE # Use gcc. Only coff output can be debugged +# OBSOLETE CC=gcc diff --git a/gdb/config/i386/i386aix.mt b/gdb/config/i386/i386aix.mt index 12e0e1fc79a..57d124d5234 100644 --- a/gdb/config/i386/i386aix.mt +++ b/gdb/config/i386/i386aix.mt @@ -1,7 +1,7 @@ -# This port, for aix ps/2 (i386), will allow you to debug the coff -# output generated gcc-2.3.3 + gas. It will not understand IBM's -# proprietary debug info. -# -# Target: IBM PS/2 (i386) running AIX PS/2 -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386aix.h +# OBSOLETE # This port, for aix ps/2 (i386), will allow you to debug the coff +# OBSOLETE # output generated gcc-2.3.3 + gas. It will not understand IBM's +# OBSOLETE # proprietary debug info. +# OBSOLETE # +# OBSOLETE # Target: IBM PS/2 (i386) running AIX PS/2 +# OBSOLETE TDEPFILES= i386-tdep.o i387-tdep.o +# OBSOLETE TM_FILE= tm-i386aix.h diff --git a/gdb/config/i386/i386aout.mt b/gdb/config/i386/i386aout.mt index 1c94ba5216c..2a33369b462 100644 --- a/gdb/config/i386/i386aout.mt +++ b/gdb/config/i386/i386aout.mt @@ -1,3 +1,3 @@ # Target: Intel 386 with a.out -TDEPFILES= i386-tdep.o -TM_FILE= tm-i386v.h +TDEPFILES= i386-tdep.o i387-tdep.o +TM_FILE= tm-i386.h diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu.mh index da444a587b6..c2eb7af96ea 100644 --- a/gdb/config/i386/i386gnu.mh +++ b/gdb/config/i386/i386gnu.mh @@ -4,8 +4,8 @@ NATDEPFILES= i386gnu-nat.o gnu-nat.o corelow.o core-regset.o \ notify_S.o process_reply_S.o msg_reply_S.o \ msg_U.o exc_request_U.o exc_request_S.o -XM_FILE= xm-i386gnu.h -NAT_FILE= nm-gnu.h +XM_FILE= xm-i386.h +NAT_FILE= nm-i386gnu.h MH_CFLAGS = -D_GNU_SOURCE XM_CLIBS = -lshouldbeinlibc diff --git a/gdb/config/i386/i386gnu.mt b/gdb/config/i386/i386gnu.mt index e08e2a25f91..dc3edd2dbb2 100644 --- a/gdb/config/i386/i386gnu.mt +++ b/gdb/config/i386/i386gnu.mt @@ -1,3 +1,3 @@ -# Target: Intel 386/elf/GNU Hurd -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386gnu.h +# Target: Intel 386 running the GNU Hurd +TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o +TM_FILE= tm-i386v4.h diff --git a/gdb/config/i386/i386m3.mh b/gdb/config/i386/i386m3.mh index 41ea30c44b3..7b840e2bce0 100644 --- a/gdb/config/i386/i386m3.mh +++ b/gdb/config/i386/i386m3.mh @@ -1,6 +1,6 @@ -# Host: Intel 386 running Mach3 - -NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o -NAT_CLIBS= -lmachid -lnetname -lmach -XM_FILE= xm-i386m3.h -NAT_FILE= nm-m3.h +# OBSOLETE # Host: Intel 386 running Mach3 +# OBSOLETE +# OBSOLETE NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o +# OBSOLETE NAT_CLIBS= -lmachid -lnetname -lmach +# OBSOLETE XM_FILE= xm-i386m3.h +# OBSOLETE NAT_FILE= nm-m3.h diff --git a/gdb/config/i386/i386m3.mt b/gdb/config/i386/i386m3.mt index e985ae345d9..550e92e2607 100644 --- a/gdb/config/i386/i386m3.mt +++ b/gdb/config/i386/i386m3.mt @@ -1,3 +1,3 @@ -# Target: Intel 386 with a.out under Mach 3 -TDEPFILES= i386-tdep.o -TM_FILE= tm-i386m3.h +# OBSOLETE # Target: Intel 386 with a.out under Mach 3 +# OBSOLETE TDEPFILES= i386-tdep.o +# OBSOLETE TM_FILE= tm-i386m3.h diff --git a/gdb/config/i386/i386mach.mh b/gdb/config/i386/i386mach.mh index 90dbdf4096a..4e4e097b802 100644 --- a/gdb/config/i386/i386mach.mh +++ b/gdb/config/i386/i386mach.mh @@ -1,9 +1,9 @@ -# Host: Intel 386 running Mach - -# This is for mach2, maybe, or is obsolete (and seems to have only -# host and native, not target). Once we get the mach3 stuff working, -# I think it can go away. - -XM_FILE= xm-i386mach.h -NAT_FILE= nm-i386mach.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o +# OBSOLETE # Host: Intel 386 running Mach +# OBSOLETE +# OBSOLETE # This is for mach2, maybe, or is obsolete (and seems to have only +# OBSOLETE # host and native, not target). Once we get the mach3 stuff working, +# OBSOLETE # I think it can go away. +# OBSOLETE +# OBSOLETE XM_FILE= xm-i386mach.h +# OBSOLETE NAT_FILE= nm-i386mach.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o diff --git a/gdb/config/i386/i386sco5.mt b/gdb/config/i386/i386sco5.mt index 54dc68d16ca..ace2258a91f 100644 --- a/gdb/config/i386/i386sco5.mt +++ b/gdb/config/i386/i386sco5.mt @@ -1,3 +1,3 @@ # Target: Intel 386 running SCO Open Server 5 TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386sco5.h +TM_FILE= tm-i386v4.h diff --git a/gdb/config/i386/i386v.mt b/gdb/config/i386/i386v.mt index 7242d3e8f38..1ee53057979 100644 --- a/gdb/config/i386/i386v.mt +++ b/gdb/config/i386/i386v.mt @@ -1,3 +1,3 @@ # Target: Intel 386 running System V TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386v.h +TM_FILE= tm-i386.h diff --git a/gdb/config/i386/nm-gnu.h b/gdb/config/i386/nm-gnu.h deleted file mode 100644 index e721ce6478d..00000000000 --- a/gdb/config/i386/nm-gnu.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Native-dependent definitions for Intel 386 running the GNU Hurd - Copyright 1994, 1995, 1996 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 the generic hurd definitions. */ - -#include "config/nm-gnu.h" diff --git a/gdb/config/i386/nm-i386aix.h b/gdb/config/i386/nm-i386aix.h index 4a6ffc1acfa..08f0779c36d 100644 --- a/gdb/config/i386/nm-i386aix.h +++ b/gdb/config/i386/nm-i386aix.h @@ -1,43 +1,43 @@ -/* Native support for i386 aix ps/2. - Copyright 1986, 1987, 1989, 1992, 1993 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. */ - -/* - * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com) - * Revision: 5-May-93 00:11:35 - */ - -#ifndef NM_I386AIX_H -#define NM_I386AIX_H 1 - -/* code to execute to print interesting information about the - * floating point processor (if any) - * No need to define if there is nothing to do. - */ -#define FLOAT_INFO { i386_float_info (); } - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#undef KERNEL_U_ADDR -#define KERNEL_U_ADDR 0xf03fd000 - -/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -#define FETCH_INFERIOR_REGISTERS - -#endif /* NM_I386AIX_H */ +// OBSOLETE /* Native support for i386 aix ps/2. +// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com) +// OBSOLETE * Revision: 5-May-93 00:11:35 +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #ifndef NM_I386AIX_H +// OBSOLETE #define NM_I386AIX_H 1 +// OBSOLETE +// OBSOLETE /* code to execute to print interesting information about the +// OBSOLETE * floating point processor (if any) +// OBSOLETE * No need to define if there is nothing to do. +// OBSOLETE */ +// OBSOLETE #define FLOAT_INFO { i386_float_info (); } +// OBSOLETE +// OBSOLETE /* This is the amount to subtract from u.u_ar0 +// OBSOLETE to get the offset in the core file of the register values. */ +// OBSOLETE #undef KERNEL_U_ADDR +// OBSOLETE #define KERNEL_U_ADDR 0xf03fd000 +// OBSOLETE +// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +// OBSOLETE #define FETCH_INFERIOR_REGISTERS +// OBSOLETE +// OBSOLETE #endif /* NM_I386AIX_H */ diff --git a/gdb/config/i386/nm-i386bsd.h b/gdb/config/i386/nm-i386bsd.h index 0015af2ffb0..628c648bf77 100644 --- a/gdb/config/i386/nm-i386bsd.h +++ b/gdb/config/i386/nm-i386bsd.h @@ -28,8 +28,6 @@ #include #define KERNEL_U_ADDR USRSTACK -#undef FLOAT_INFO /* No float info yet */ - #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); diff --git a/gdb/config/i386/nm-i386mach.h b/gdb/config/i386/nm-i386mach.h index ef10a28cf8f..21f3c61a1d3 100644 --- a/gdb/config/i386/nm-i386mach.h +++ b/gdb/config/i386/nm-i386mach.h @@ -1,30 +1,30 @@ -/* Native definitions for Mach on an Intel 386 - Copyright 1986, 1987, 1989, 1991, 1992, 1996 - 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 "regcache.h" - -/* Do implement the attach and detach commands. */ -/* #define ATTACH_DETACH 1 */ - -/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -#define FETCH_INFERIOR_REGISTERS - -#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES) +// OBSOLETE /* Native definitions for Mach on an Intel 386 +// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1996 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE /* Do implement the attach and detach commands. */ +// OBSOLETE /* #define ATTACH_DETACH 1 */ +// OBSOLETE +// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +// OBSOLETE #define FETCH_INFERIOR_REGISTERS +// OBSOLETE +// OBSOLETE #define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES) diff --git a/gdb/config/i386/nm-i386sco.h b/gdb/config/i386/nm-i386sco.h index b46776151b3..e3bdc2df97c 100644 --- a/gdb/config/i386/nm-i386sco.h +++ b/gdb/config/i386/nm-i386sco.h @@ -20,17 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if 0 -/* code to execute to print interesting information about the - floating point processor (if any) - No need to define if there is nothing to do. - On the 386, unfortunately this code is host-dependent (and lives - in the i386-xdep.c file), so we can't - do this unless we *know* we aren't cross-debugging. FIXME. - */ -#define FLOAT_INFO { i386_float_info (); } -#endif /*0 */ - #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); diff --git a/gdb/config/i386/nm-i386sco5.h b/gdb/config/i386/nm-i386sco5.h index db2880c01ba..37a4b16d44b 100644 --- a/gdb/config/i386/nm-i386sco5.h +++ b/gdb/config/i386/nm-i386sco5.h @@ -1,5 +1,5 @@ -/* Native support for SCO OpenServer 5 - Copyright 1996, 1998 Free Software Foundation, Inc. +/* Native support for SCO OpenServer 5. + Copyright 1996, 1998, 2002 Free Software Foundation, Inc. Re-written by J. Kean Johnston . Originally written by Robert Lipe , based on work by Ian Lance Taylor and @@ -22,17 +22,57 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef NM_I386SCO5_H +#define NM_I386SCO5_H + /* Basically, its a lot like the older versions ... */ #include "i386/nm-i386sco.h" -/* ... but it can do a lot of SVR4 type stuff too. */ +/* ... but it can do a lot of SVR4 type stuff too. */ #define SVR4_SHARED_LIBS -#include "solib.h" /* Pick up shared library support */ +#include "solib.h" /* Pick up shared library support. */ -#define ATTACH_DETACH +/* SCO is unlike other SVR4 systems in that it has SVR4 style shared + libs, with a slight twist. We expect 3 traps (2 for the exec and + one for the dynamic loader). After the third trap we insert the + shared library breakpoints, then wait for the 4th trap. */ -/* SCO does not provide . infptrace.c does not +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 3 + +/* SCO does not provide . However, infptrace.c does not have defaults for these values. */ #define PTRACE_ATTACH 10 #define PTRACE_DETACH 11 + +/* Return the size of the user struct. */ + +#define KERNEL_U_SIZE kernel_u_size () +extern int kernel_u_size (void); + +/* We can attach and detach. */ +#define ATTACH_DETACH + +/* Hardware-assisted breakpoints and watchpoints. */ + +/* We can also do hardware watchpoints. */ +#define TARGET_HAS_HARDWARE_WATCHPOINTS +#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 + +/* After a watchpoint trap, the PC points to the instruction which + caused the trap. But we can continue over it without disabling the + trap. */ +#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_STEPPABLE_WATCHPOINT + +#define STOPPED_BY_WATCHPOINT(W) \ + i386_stopped_by_watchpoint (PIDGET (inferior_ptid)) + +#define target_insert_watchpoint(addr, len, type) \ + i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type) + +#define target_remove_watchpoint(addr, len, type) \ + i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len) + +#endif /* nm-i386sco5.h */ diff --git a/gdb/config/i386/nm-i386v.h b/gdb/config/i386/nm-i386v.h index e7bfca4ea57..f94c5bb8b35 100644 --- a/gdb/config/i386/nm-i386v.h +++ b/gdb/config/i386/nm-i386v.h @@ -1,5 +1,6 @@ -/* Native support for i386. - Copyright 1986, 1987, 1989, 1992, 1993, 1998, 2000 +/* Native support for i386 running System V (pre-SVR4). + + Copyright 1986, 1987, 1989, 1992, 1993, 1998, 2000, 2002 Free Software Foundation, Inc. Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988. @@ -20,18 +21,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if 0 -/* code to execute to print interesting information about the - floating point processor (if any) - No need to define if there is nothing to do. - On the 386, unfortunately this code is host-dependent (and lives - in the i386-xdep.c file), so we can't - do this unless we *know* we aren't cross-debugging. FIXME. - */ -#define FLOAT_INFO { i386_float_info (); } -#endif /*0 */ - -#define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = i386_register_u_addr ((blockend),(regno)); - -extern int i386_register_u_addr (int, int); +#ifndef NM_I386V_H +#define NM_I386V_H + +/* Support for the user struct. */ + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define REGISTER_U_ADDR(addr, blockend, regnum) \ + (addr) = register_u_addr ((blockend), (regnum)) +extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum); + + +/* Number of traps that happen between exec'ing the shell to run an + inferior, and when we finally get to the inferior code. This is 2 + on most implementations. Override here to 4. */ + +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 4 + +#endif /* nm-i386v.h */ diff --git a/gdb/config/i386/nm-m3.h b/gdb/config/i386/nm-m3.h index 5ff74024942..87d587b06c0 100644 --- a/gdb/config/i386/nm-m3.h +++ b/gdb/config/i386/nm-m3.h @@ -1,23 +1,23 @@ -/* Native-dependent definitions for Intel 386 running Mach 3. - Copyright 1994 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 the generic Mach 3 definitions. */ - -#include "config/nm-m3.h" +// OBSOLETE /* Native-dependent definitions for Intel 386 running Mach 3. +// OBSOLETE Copyright 1994 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Include the generic Mach 3 definitions. */ +// OBSOLETE +// OBSOLETE #include "config/nm-m3.h" diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h index 2710ef70ca3..59f60f0fe3a 100644 --- a/gdb/config/i386/tm-cygwin.h +++ b/gdb/config/i386/tm-cygwin.h @@ -28,12 +28,6 @@ #include "i386/tm-i386.h" -#if 0 -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name) -#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0) -extern CORE_ADDR skip_trampoline_code (CORE_ADDR pc, char *name); -#endif - #define ATTACH_NO_WAIT #define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms) #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid) diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index d6bc5741eba..e80b258e7d8 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -24,19 +24,8 @@ #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL -#include "regcache.h" - -/* Print out the i387 floating point state. */ -extern void i387_float_info (void); -#define FLOAT_INFO { i387_float_info (); } - - /* FIXME: kettenis/2000-06-12: These do not belong here. */ extern void print_387_control_word (unsigned int); extern void print_387_status_word (unsigned int); -/* Offset from SP to first arg on stack at first instruction of a function */ - -#define SP_ARG0 (1 * 4) - #endif /* ifndef TM_I386_H */ diff --git a/gdb/config/i386/tm-i386aix.h b/gdb/config/i386/tm-i386aix.h index a8f24eda035..fe114206c7c 100644 --- a/gdb/config/i386/tm-i386aix.h +++ b/gdb/config/i386/tm-i386aix.h @@ -1,48 +1,48 @@ -/* Macro defintions for IBM AIX PS/2 (i386). - Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000 - 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. */ - -/* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com). */ - -#ifndef TM_I386AIX_H -#define TM_I386AIX_H 1 - -#include "i386/tm-i386.h" -#include - -#ifndef I386 -#define I386 1 -#endif - -/* AIX/i386 has FPU support. However, the native configuration (which - is the only supported configuration) doesn't make the FPU control - registers available. Override the appropriate symbols such that - only the normal FPU registers are included in GDB's register array. */ - -#undef NUM_FPREGS -#define NUM_FPREGS (8) - -#undef NUM_REGS -#define NUM_REGS (NUM_GREGS + NUM_FPREGS) - -#undef REGISTER_BYTES -#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS) - -#endif /* TM_I386AIX_H */ +// OBSOLETE /* Macro defintions for IBM AIX PS/2 (i386). +// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com). */ +// OBSOLETE +// OBSOLETE #ifndef TM_I386AIX_H +// OBSOLETE #define TM_I386AIX_H 1 +// OBSOLETE +// OBSOLETE #include "i386/tm-i386.h" +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #ifndef I386 +// OBSOLETE #define I386 1 +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE /* AIX/i386 has FPU support. However, the native configuration (which +// OBSOLETE is the only supported configuration) doesn't make the FPU control +// OBSOLETE registers available. Override the appropriate symbols such that +// OBSOLETE only the normal FPU registers are included in GDB's register array. */ +// OBSOLETE +// OBSOLETE #undef NUM_FPREGS +// OBSOLETE #define NUM_FPREGS (8) +// OBSOLETE +// OBSOLETE #undef NUM_REGS +// OBSOLETE #define NUM_REGS (NUM_GREGS + NUM_FPREGS) +// OBSOLETE +// OBSOLETE #undef REGISTER_BYTES +// OBSOLETE #define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS) +// OBSOLETE +// OBSOLETE #endif /* TM_I386AIX_H */ diff --git a/gdb/config/i386/tm-i386gnu.h b/gdb/config/i386/tm-i386gnu.h deleted file mode 100644 index 638cb03f2a0..00000000000 --- a/gdb/config/i386/tm-i386gnu.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Macro definitions for i386 running the GNU Hurd. - Copyright 1992, 1999, 2000 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. */ - -#ifndef TM_I386GNU_H -#define TM_I386GNU_H 1 - -/* Include common definitions for GNU systems. - FIXME: This does not belong here since this is supposed to contain - only native-dependent information. */ -#include "config/nm-gnu.h" - -/* Thread flavors used in re-setting the T bit. - FIXME: This is native-dependent. */ -#define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE -#define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT -#define THREAD_STATE_SET_TRACED(state) \ - ((struct i386_thread_state *)state)->efl |= 0x100 -#define THREAD_STATE_CLEAR_TRACED(state) \ - ((((struct i386_thread_state *)state)->efl &= ~0x100), 1) - -/* We can attach and detach. - FIXME: This is probably native-dependent too. */ -#define ATTACH_DETACH 1 - -#include "i386/tm-i386.h" - -/* We use stabs-in-ELF with the DWARF register numbering scheme. */ - -#undef STAB_REG_TO_REGNUM -#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg)) - -/* Offset to saved PC in sigcontext. */ -#define SIGCONTEXT_PC_OFFSET 68 - -/* We need this file for the SOLIB_TRAMPOLINE stuff. */ -#include "config/tm-sysv4.h" - -#endif /* TM_I386GNU_H */ diff --git a/gdb/config/i386/tm-i386m3.h b/gdb/config/i386/tm-i386m3.h index 40f09016fbe..cadd5cd8b6d 100644 --- a/gdb/config/i386/tm-i386m3.h +++ b/gdb/config/i386/tm-i386m3.h @@ -1,56 +1,56 @@ -/* Macro definitions for i386, Mach 3.0 - Copyright 1992, 1993, 1995, 1999 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 common definitions for Mach3 systems */ -#include "config/nm-m3.h" - -/* Define offsets to access CPROC stack when it does not have - * a kernel thread. - */ -#define MACHINE_CPROC_SP_OFFSET 20 -#define MACHINE_CPROC_PC_OFFSET 16 -#define MACHINE_CPROC_FP_OFFSET 12 - -/* Thread flavors used in re-setting the T bit. - * @@ this is also bad for cross debugging. - */ -#define TRACE_FLAVOR i386_THREAD_STATE -#define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT -#define TRACE_SET(x,state) \ - ((struct i386_thread_state *)state)->efl |= 0x100 -#define TRACE_CLEAR(x,state) \ - ((((struct i386_thread_state *)state)->efl &= ~0x100), 1) - -/* we can do it */ -#define ATTACH_DETACH 1 - -/* Sigh. There should be a file for i386 but no sysv stuff in it */ -#include "i386/tm-i386.h" - -/* I want to test this float info code. See comment in tm-i386v.h */ -#undef FLOAT_INFO -#define FLOAT_INFO { i386_mach3_float_info (); } - -/* Address of end of stack space. - * for MACH, see - * @@@ I don't know what is in the 5 ints... - */ -#undef STACK_END_ADDR -#define STACK_END_ADDR (0xc0000000-sizeof(int [5])) +// OBSOLETE /* Macro definitions for i386, Mach 3.0 +// OBSOLETE Copyright 1992, 1993, 1995, 1999 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Include common definitions for Mach3 systems */ +// OBSOLETE #include "config/nm-m3.h" +// OBSOLETE +// OBSOLETE /* Define offsets to access CPROC stack when it does not have +// OBSOLETE * a kernel thread. +// OBSOLETE */ +// OBSOLETE #define MACHINE_CPROC_SP_OFFSET 20 +// OBSOLETE #define MACHINE_CPROC_PC_OFFSET 16 +// OBSOLETE #define MACHINE_CPROC_FP_OFFSET 12 +// OBSOLETE +// OBSOLETE /* Thread flavors used in re-setting the T bit. +// OBSOLETE * @@ this is also bad for cross debugging. +// OBSOLETE */ +// OBSOLETE #define TRACE_FLAVOR i386_THREAD_STATE +// OBSOLETE #define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT +// OBSOLETE #define TRACE_SET(x,state) \ +// OBSOLETE ((struct i386_thread_state *)state)->efl |= 0x100 +// OBSOLETE #define TRACE_CLEAR(x,state) \ +// OBSOLETE ((((struct i386_thread_state *)state)->efl &= ~0x100), 1) +// OBSOLETE +// OBSOLETE /* we can do it */ +// OBSOLETE #define ATTACH_DETACH 1 +// OBSOLETE +// OBSOLETE /* Sigh. There should be a file for i386 but no sysv stuff in it */ +// OBSOLETE #include "i386/tm-i386.h" +// OBSOLETE +// OBSOLETE /* I want to test this float info code. See comment in tm-i386v.h */ +// OBSOLETE #undef FLOAT_INFO +// OBSOLETE #define FLOAT_INFO { i386_mach3_float_info (); } +// OBSOLETE +// OBSOLETE /* Address of end of stack space. +// OBSOLETE * for MACH, see +// OBSOLETE * @@@ I don't know what is in the 5 ints... +// OBSOLETE */ +// OBSOLETE #undef STACK_END_ADDR +// OBSOLETE #define STACK_END_ADDR (0xc0000000-sizeof(int [5])) diff --git a/gdb/config/i386/tm-i386mk.h b/gdb/config/i386/tm-i386mk.h index e46ca55395b..74355a82ceb 100644 --- a/gdb/config/i386/tm-i386mk.h +++ b/gdb/config/i386/tm-i386mk.h @@ -1,38 +1,38 @@ -/* Macro definitions for i386, Mach 3.0, OSF 1/MK - Copyright 1992, 1993, 2000 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. */ - -/* Until OSF switches to a newer Mach kernel that has - * a different get_emul_vector() interface. - */ -#define MK67 1 - -#include "i386/tm-i386m3.h" - -/* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent - to `double'. However, I'm not sure what is the consequence of: - - #define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT - #define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT - - So I'll go with the current status quo instead. It looks like this - target won't compile anyway. Perhaps it should be obsoleted? */ - -#undef TARGET_LONG_DOUBLE_FORMAT -#undef TARGET_LONG_DOUBLE_BIT +// OBSOLETE /* Macro definitions for i386, Mach 3.0, OSF 1/MK +// OBSOLETE Copyright 1992, 1993, 2000 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Until OSF switches to a newer Mach kernel that has +// OBSOLETE * a different get_emul_vector() interface. +// OBSOLETE */ +// OBSOLETE #define MK67 1 +// OBSOLETE +// OBSOLETE #include "i386/tm-i386m3.h" +// OBSOLETE +// OBSOLETE /* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent +// OBSOLETE to `double'. However, I'm not sure what is the consequence of: +// OBSOLETE +// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT +// OBSOLETE #define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT +// OBSOLETE +// OBSOLETE So I'll go with the current status quo instead. It looks like this +// OBSOLETE target won't compile anyway. Perhaps it should be obsoleted? */ +// OBSOLETE +// OBSOLETE #undef TARGET_LONG_DOUBLE_FORMAT +// OBSOLETE #undef TARGET_LONG_DOUBLE_BIT diff --git a/gdb/config/i386/tm-i386sco5.h b/gdb/config/i386/tm-i386sco5.h deleted file mode 100644 index dc1bb26ffa8..00000000000 --- a/gdb/config/i386/tm-i386sco5.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Macro definitions for GDB on an Intel i386 running SCO Open Server 5. - Copyright 1998 Free Software Foundation, Inc. - Written by J. Kean Johnston (jkj@sco.com). - - 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. */ - -#ifndef TM_I386SCO5_H -#define TM_I386SCO5_H 1 - -/* Pick up most of what we need from the generic i386 target include file. */ - -#include "i386/tm-i386.h" - -/* Pick up more stuff from the generic SYSV and SVR4 host include files. */ -#include "i386/tm-i386v.h" -#include "config/tm-sysv4.h" - -#define KERNEL_U_SIZE kernel_u_size() - -/* - * SCO is unlike other SVR3 targets in that it has SVR4 style shared - * libs, with a slight twist. We expect 3 traps (2 for the exec and - * one for the dynamic loader). After the third trap we insert the - * SOLIB breakpoints, then wait for the 4th trap. - */ -#undef START_INFERIOR_TRAPS_EXPECTED -#define START_INFERIOR_TRAPS_EXPECTED 3 - -/* We can also do hardware watchpoints */ -#define TARGET_HAS_HARDWARE_WATCHPOINTS -#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 - -/* After a watchpoint trap, the PC points to the instruction which - caused the trap. But we can continue over it without disabling the - trap. */ -#define HAVE_CONTINUABLE_WATCHPOINT -#define HAVE_STEPPABLE_WATCHPOINT - -#define STOPPED_BY_WATCHPOINT(W) \ - i386_stopped_by_watchpoint (PIDGET (inferior_ptid)) - -#define target_insert_watchpoint(addr, len, type) \ - i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type) - -#define target_remove_watchpoint(addr, len, type) \ - i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len) - -#endif /* ifndef TM_I386SCO5_H */ diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h deleted file mode 100644 index d524652e247..00000000000 --- a/gdb/config/i386/tm-i386v.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Macro definitions for i386, Unix System V. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999, - 2000, 2001 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. */ - -#ifndef TM_I386V_H -#define TM_I386V_H 1 - -/* First pick up the generic *86 target file. */ - -#include "i386/tm-i386.h" - -/* Number of traps that happen between exec'ing the shell to run an - inferior, and when we finally get to the inferior code. This is - 2 on most implementations. Override here to 4. */ - -#undef START_INFERIOR_TRAPS_EXPECTED -#define START_INFERIOR_TRAPS_EXPECTED 4 - -#endif /* ifndef TM_I386V_H */ diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h index 7ebd27d7660..9363327fdb7 100644 --- a/gdb/config/i386/tm-i386v4.h +++ b/gdb/config/i386/tm-i386v4.h @@ -1,5 +1,5 @@ /* Macro definitions for GDB on an Intel i386 running SVR4. - Copyright 1991, 1994, 1995, 1998, 1999, 2000 + Copyright 1991, 1994, 1995, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Written by Fred Fish at Cygnus Support (fnf@cygnus.com) @@ -23,12 +23,17 @@ #ifndef TM_I386V4_H #define TM_I386V4_H 1 -/* Pick up most of what we need from the generic i386 target include file. */ -#define HAVE_I387_REGS +/* Pick up most of what we need from the generic i386 target include file. */ #include "i386/tm-i386.h" -/* Pick up more stuff from the generic SVR4 host include file. */ +/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs + in identifiers. The default in G++ is to use dots instead, for all SVR4 + systems, so we make that our default also. FIXME: There should be some + way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by + stashing it in the debugging information as part of the name of an + invented symbol ("gcc_cplus_marker$" for example). */ -#include "config/tm-sysv4.h" +#undef CPLUS_MARKER +#define CPLUS_MARKER '.' #endif /* ifndef TM_I386V4_H */ diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h index ff0d56e6174..8d773c8c292 100644 --- a/gdb/config/i386/tm-ptx.h +++ b/gdb/config/i386/tm-ptx.h @@ -32,17 +32,9 @@ #ifdef SEQUENT_PTX4 #include "i386/tm-i386v4.h" #else /* !SEQUENT_PTX4 */ -#include "i386/tm-i386v.h" +#include "i386/tm-i386.h" #endif -/* Number of traps that happen between exec'ing the shell to run an - inferior, and when we finally get to the inferior code. This is 2 - on most implementations. Here we have to undo what tm-i386v.h gave - us and restore the default. */ - -#undef START_INFERIOR_TRAPS_EXPECTED -#define START_INFERIOR_TRAPS_EXPECTED 2 - /* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always (such as now). */ @@ -149,24 +141,6 @@ extern int ptx_register_u_addr (int, int); #undef REGISTER_BYTES #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) -/* Index within `registers' of the first byte of the space for register N. */ - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ -(((N) < ST0_REGNUM) ? ((N) * 4) : \ - ((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \ - (40 + 80 + (((N) - FP1_REGNUM) * 4))) - -/* Number of bytes of storage in the actual machine representation for - register N. All registers are 4 bytes, except 387 st(0) - st(7), - which are 80 bits each. */ - -#undef REGISTER_RAW_SIZE -#define REGISTER_RAW_SIZE(N) \ -(((N) < ST0_REGNUM) ? 4 : \ - ((N) < FP1_REGNUM) ? 10 : \ - 4) - /* Largest value REGISTER_RAW_SIZE can have. */ #undef MAX_REGISTER_RAW_SIZE diff --git a/gdb/config/i386/tm-symmetry.h b/gdb/config/i386/tm-symmetry.h index e7a989b19c2..dc7c81f2fb2 100644 --- a/gdb/config/i386/tm-symmetry.h +++ b/gdb/config/i386/tm-symmetry.h @@ -31,10 +31,7 @@ a copy of the right include file. */ #include -#include "i386/tm-i386v.h" - -#undef START_INFERIOR_TRAPS_EXPECTED -#define START_INFERIOR_TRAPS_EXPECTED 2 +#include "i386/tm-i386.h" /* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always (such as now). */ @@ -225,30 +222,6 @@ switch (regno) { \ #undef REGISTER_BYTES #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) -/* Index within `registers' of the first byte of the space for - register N. */ - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ -(((N) < 3) ? ((N) * 4) : \ -((N) < 5) ? ((((N) - 2) * 10) + 2) : \ -((N) < 8) ? ((((N) - 5) * 4) + 32) : \ -((N) < 14) ? ((((N) - 8) * 10) + 44) : \ - ((((N) - 14) * 4) + 104)) - -/* Number of bytes of storage in the actual machine representation - * for register N. All registers are 4 bytes, except 387 st(0) - st(7), - * which are 80 bits each. - */ - -#undef REGISTER_RAW_SIZE -#define REGISTER_RAW_SIZE(N) \ -(((N) < 3) ? 4 : \ -((N) < 5) ? 10 : \ -((N) < 8) ? 4 : \ -((N) < 14) ? 10 : \ - 4) - /* Nonzero if register N requires conversion from raw format to virtual format. */ diff --git a/gdb/config/i386/tm-vxworks.h b/gdb/config/i386/tm-vxworks.h index ffaea49306f..f9b6be453cb 100644 --- a/gdb/config/i386/tm-vxworks.h +++ b/gdb/config/i386/tm-vxworks.h @@ -22,7 +22,7 @@ #ifndef TM_VXWORKS_H #define TM_VXWORKS_H -#include "i386/tm-i386v.h" +#include "i386/tm-i386.h" #include "config/tm-vxworks.h" #endif /* ifndef TM_VXWORKS_H */ diff --git a/gdb/config/i386/xm-i386aix.h b/gdb/config/i386/xm-i386aix.h index 842eadf0632..03cb86cb1cc 100644 --- a/gdb/config/i386/xm-i386aix.h +++ b/gdb/config/i386/xm-i386aix.h @@ -1,29 +1,29 @@ -/* Macro defintions for AIX PS/2 (i386) - Copyright 1986, 1987, 1989, 1992, 1993 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. */ - -/* - * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com) - * Revision: 23-Oct-92 17:42:49 - */ - -#include "i386/xm-i386v.h" - -#undef HAVE_TERMIO -#define HAVE_SGTTY +// OBSOLETE /* Macro defintions for AIX PS/2 (i386) +// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com) +// OBSOLETE * Revision: 23-Oct-92 17:42:49 +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #include "i386/xm-i386v.h" +// OBSOLETE +// OBSOLETE #undef HAVE_TERMIO +// OBSOLETE #define HAVE_SGTTY diff --git a/gdb/config/i386/xm-i386gnu.h b/gdb/config/i386/xm-i386gnu.h deleted file mode 100644 index 711aeebccfb..00000000000 --- a/gdb/config/i386/xm-i386gnu.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Definitions to make GDB run on the GNU Hurd on an Intel 386 - Copyright 1986, 1987, 1989, 1991, 1996, 2000 - 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. */ - -#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext - -/* Do implement the attach and detach commands. */ -#define ATTACH_DETACH 1 diff --git a/gdb/config/i386/xm-i386m3.h b/gdb/config/i386/xm-i386m3.h index f25b3891210..da4421551b5 100644 --- a/gdb/config/i386/xm-i386m3.h +++ b/gdb/config/i386/xm-i386m3.h @@ -1,33 +1,33 @@ -/* Definitions to make GDB run on Mach 3 on an Intel 386 - Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996 - 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. */ - -/* Do implement the attach and detach commands. */ -#define ATTACH_DETACH 1 - -/* Not needeed */ -#define KERNEL_U_ADDR 0 - -#ifndef EMULATOR_BASE -/* For EMULATOR_BASE and EMULATOR_END. - * OSF 1/MK has different values in some other place. - */ -#include -#endif /* EMULATOR_BASE */ +// OBSOLETE /* Definitions to make GDB run on Mach 3 on an Intel 386 +// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Do implement the attach and detach commands. */ +// OBSOLETE #define ATTACH_DETACH 1 +// OBSOLETE +// OBSOLETE /* Not needeed */ +// OBSOLETE #define KERNEL_U_ADDR 0 +// OBSOLETE +// OBSOLETE #ifndef EMULATOR_BASE +// OBSOLETE /* For EMULATOR_BASE and EMULATOR_END. +// OBSOLETE * OSF 1/MK has different values in some other place. +// OBSOLETE */ +// OBSOLETE #include +// OBSOLETE #endif /* EMULATOR_BASE */ diff --git a/gdb/config/i386/xm-i386mach.h b/gdb/config/i386/xm-i386mach.h index e0a5d651376..b36c79c7162 100644 --- a/gdb/config/i386/xm-i386mach.h +++ b/gdb/config/i386/xm-i386mach.h @@ -1,28 +1,28 @@ -/* Definitions to make GDB run on Mach on an Intel 386 - Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1996, 2001 - 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. */ - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) - -/* only defines this if __STDC__!!! */ -extern int errno; +// OBSOLETE /* Definitions to make GDB run on Mach on an Intel 386 +// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1996, 2001 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* This is the amount to subtract from u.u_ar0 +// OBSOLETE to get the offset in the core file of the register values. */ +// OBSOLETE +// OBSOLETE #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) +// OBSOLETE +// OBSOLETE /* only defines this if __STDC__!!! */ +// OBSOLETE extern int errno; diff --git a/gdb/config/i386/xm-i386mk.h b/gdb/config/i386/xm-i386mk.h index cbf62710db5..4609604cf99 100644 --- a/gdb/config/i386/xm-i386mk.h +++ b/gdb/config/i386/xm-i386mk.h @@ -1,26 +1,26 @@ -/* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386 - Copyright 1992, 1993, 1998 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. */ - -#define HAVE_TERMIO 1 - -#define EMULATOR_BASE 0xa0000000 -#define EMULATOR_END 0xa0040000 - -#include "i386/xm-i386m3.h" +// OBSOLETE /* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386 +// OBSOLETE Copyright 1992, 1993, 1998 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #define HAVE_TERMIO 1 +// OBSOLETE +// OBSOLETE #define EMULATOR_BASE 0xa0000000 +// OBSOLETE #define EMULATOR_END 0xa0040000 +// OBSOLETE +// OBSOLETE #include "i386/xm-i386m3.h" diff --git a/gdb/config/i960/mon960.mt b/gdb/config/i960/mon960.mt index 6cd73459f7e..c735d9474b8 100644 --- a/gdb/config/i960/mon960.mt +++ b/gdb/config/i960/mon960.mt @@ -1,6 +1,5 @@ -# Target: Intel 960 rom monitor -TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o -TM_FILE= tm-mon960.h -SIM_OBS = remote-sim.o -SIM = ../sim/i960/libsim.a - +# OBSOLETE # Target: Intel 960 rom monitor +# OBSOLETE TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o +# OBSOLETE TM_FILE= tm-mon960.h +# OBSOLETE SIM_OBS = remote-sim.o +# OBSOLETE SIM = ../sim/i960/libsim.a diff --git a/gdb/config/i960/nindy960.mt b/gdb/config/i960/nindy960.mt index f37c1da4b7c..5ed15a8d835 100644 --- a/gdb/config/i960/nindy960.mt +++ b/gdb/config/i960/nindy960.mt @@ -1,3 +1,3 @@ -# Target: Intel 80960, in an embedded system under the NINDY monitor -TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o -TM_FILE= tm-nindy960.h +# OBSOLETE # Target: Intel 80960, in an embedded system under the NINDY monitor +# OBSOLETE TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o +# OBSOLETE TM_FILE= tm-nindy960.h diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index a0ae164a658..91bdf91f14e 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -1,345 +1,345 @@ -/* Parameters for target machine Intel 960, for GDB, the GNU debugger. - - Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free - Software Foundation, Inc. - - Contributed by Intel Corporation. - 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. */ - -/* Definitions to target GDB to any i960. */ - -#ifndef I80960 -#define I80960 -#endif - -#include "doublest.h" - -/* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol - information. In the i960, parameters can be stored as locals or as - args, depending on the type of the debug record. - - From empirical observation, gcc960 uses N_LSYM to indicate - arguments passed in registers and then copied immediately - to the frame, and N_PSYM to indicate arguments passed in a - g14-relative argument block. */ - -#define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG) - -/* Offset from address of function to start of its code. - Zero on most machines. */ - -#define FUNCTION_START_OFFSET 0 - -/* Advance ip across any function entry prologue instructions - to reach some "real" code. */ - -#define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip)) -extern CORE_ADDR i960_skip_prologue (); - -/* Immediately after a function call, return the saved ip. - Can't always go through the frames for this because on some machines - the new frame is not set up until the new function - executes some instructions. */ - -#define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame)) -extern CORE_ADDR saved_pc_after_call (); - -/* Stack grows upward */ - -#define INNER_THAN(lhs,rhs) ((lhs) > (rhs)) - -/* Say how long (ordinary) registers are. This is a piece of bogosity - used in push_word and a few other places; REGISTER_RAW_SIZE is the - real way to know how big a register is. */ - -#define REGISTER_SIZE 4 - -/* Number of machine registers */ -#define NUM_REGS 40 - -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ - -#define REGISTER_NAMES { \ - /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ - /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ - /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ - /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ - /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ -} - -/* Register numbers of various important registers (used to index - into arrays of register names and register values). */ - -#define R0_REGNUM 0 /* First local register */ -#define SP_REGNUM 1 /* Contains address of top of stack */ -#define RIP_REGNUM 2 /* Return instruction pointer (local r2) */ -#define R15_REGNUM 15 /* Last local register */ -#define G0_REGNUM 16 /* First global register */ -#define G13_REGNUM 29 /* g13 - holds struct return address */ -#define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */ -#define FP_REGNUM 31 /* Contains address of executing stack frame */ -#define PCW_REGNUM 32 /* process control word */ -#define ACW_REGNUM 33 /* arithmetic control word */ -#define TCW_REGNUM 34 /* trace control word */ -#define IP_REGNUM 35 /* instruction pointer */ -#define FP0_REGNUM 36 /* First floating point register */ - -/* Some registers have more than one name */ - -#define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */ -#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */ - -/* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. */ -#define REGISTER_BYTES ((36*4) + (4*10)) - -/* Index within `registers' of the first byte of the space for register N. */ - -#define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \ - (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) ) - -/* The i960 has register windows, sort of. */ - -extern void i960_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, - enum lval_type *lval); - -#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ - i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval) - - -/* Number of bytes of storage in the actual machine representation - for register N. On the i960, all regs are 4 bytes except for floating - point, which are 10. NINDY only sends us 8 byte values for these, - which is a pain, but VxWorks handles this correctly, so we must. */ - -#define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 ) - -/* Number of bytes of storage in the program's representation for register N. */ - -#define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 ) - -/* Largest value REGISTER_RAW_SIZE can have. */ - -#define MAX_REGISTER_RAW_SIZE 10 - -/* Largest value REGISTER_VIRTUAL_SIZE can have. */ - -#define MAX_REGISTER_VIRTUAL_SIZE 8 - -#include "floatformat.h" - -#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext - -/* Return the GDB type object for the "standard" data type - of data in register N. */ - -struct type *i960_register_type (int regnum); -#define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N) - -/* Macros for understanding function return values... */ - -/* Does the specified function use the "struct returning" convention - or the "value returning" convention? The "value returning" convention - almost invariably returns the entire value in registers. The - "struct returning" convention often returns the entire value in - memory, and passes a pointer (out of or into the function) saying - where the value (is or should go). - - Since this sometimes depends on whether it was compiled with GCC, - this is also an argument. This is used in call_function to build a - stack, and in value_being_returned to print return values. - - On i960, a structure is returned in registers g0-g3, if it will fit. - If it's more than 16 bytes long, g13 pointed to it on entry. */ - -extern use_struct_convention_fn i960_use_struct_convention; -#define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type) - -/* Extract from an array REGBUF containing the (raw) register state - a function return value of type TYPE, and copy that, in virtual format, - into VALBUF. This is only called if USE_STRUCT_CONVENTION for this - type is 0. - - On the i960 we just take as many bytes as we need from G0 through G3. */ - -#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE)) - -/* If USE_STRUCT_CONVENTION produces a 1, - extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). - - Address of where to put structure was passed in in global - register g13 on entry. God knows what's in g13 now. The - (..., 0) below is to make it appear to return a value, though - actually all it does is call error(). */ - -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (error("Don't know where large structure is returned on i960"), 0) - -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format, for "value returning" functions. - - For 'return' command: not (yet) implemented for i960. */ - -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ - error ("Returning values from functions is not implemented in i960 gdb") - -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. */ - -#define STORE_STRUCT_RETURN(ADDR, SP) \ - error ("Returning values from functions is not implemented in i960 gdb") - -/* 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. - - However, if FRAME_CHAIN_VALID returns zero, - it means the given frame is the outermost one and has no caller. */ - -/* We cache information about saved registers in the frame structure, - to save us from having to re-scan function prologues every time - a register in a non-current frame is accessed. */ - -#define EXTRA_FRAME_INFO \ - struct frame_saved_regs *fsr; \ - CORE_ADDR arg_pointer; - -/* Zero the frame_saved_regs pointer when the frame is initialized, - so that FRAME_FIND_SAVED_REGS () will know to allocate and - initialize a frame_saved_regs struct the first time it is called. - Set the arg_pointer to -1, which is not valid; 0 and other values - indicate real, cached values. */ - -#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ - ((fi)->fsr = 0, (fi)->arg_pointer = -1) - -/* On the i960, we get the chain pointer by reading the PFP saved - on the stack and clearing the status bits. */ - -#define FRAME_CHAIN(thisframe) \ - (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf) - -/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one - and has no caller. - - On the i960, each various target system type must define FRAME_CHAIN_VALID, - since it differs between NINDY and VxWorks, the two currently supported - targets types. We leave it undefined here. */ - - -/* A macro that tells us whether the function invocation represented - by FI does not have a frame on the stack associated with it. If it - does not, FRAMELESS is set to 1, else 0. */ - -CORE_ADDR leafproc_return (CORE_ADDR ip); -#define FRAMELESS_FUNCTION_INVOCATION(FI) \ - (leafproc_return ((FI)->pc) != 0) - -/* Note that in the i960 architecture the return pointer is saved in the - *caller's* stack frame. - - Make sure to zero low-order bits because of bug in 960CA A-step part - (instruction addresses should always be word-aligned anyway). */ - -#define FRAME_SAVED_PC(frame) \ - ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3) - -/* On the i960, FRAME_ARGS_ADDRESS should return the value of - g14 as passed into the frame, if known. We need a function for this. - We cache this value in the frame info if we've already looked it up. */ - -#define FRAME_ARGS_ADDRESS(fi) \ - (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0)) -extern CORE_ADDR frame_args_address (); /* i960-tdep.c */ - -/* This is the same except it should return 0 when - it does not really know where the args are, rather than guessing. - This value is not cached since it is only used infrequently. */ - -#define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1)) - -#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame - -/* Set NUMARGS to the number of args passed to a frame. - Can return -1, meaning no way to tell. */ - -#define FRAME_NUM_ARGS(fi) (-1) - -/* Return number of bytes at start of arglist that are not really args. */ - -#define FRAME_ARGS_SKIP 0 - -/* Produce the positions of the saved registers in a stack frame. */ - -#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \ - frame_find_saved_regs (frame_info_addr, &sr) -extern void frame_find_saved_regs (); /* See i960-tdep.c */ - -/* Things needed for making calls to functions in the inferior process */ - -/* Push an empty stack frame, to record the current ip, etc. - - Not (yet?) implemented for i960. */ - -#define PUSH_DUMMY_FRAME \ -error("Function calls into the inferior process are not supported on the i960") - -/* Discard from the stack the innermost frame, restoring all registers. */ - - -void i960_pop_frame (void); -#define POP_FRAME \ - i960_pop_frame () - - -/* This sequence of words is the instructions - - callx 0x00000000 - fmark - */ - -/* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */ - - /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */ - -/* Indicate that we don't support calling inferior child functions. */ - -#undef CALL_DUMMY - -/* Insert the specified number of args and function address - into a call sequence of the above form stored at 'dummyname'. - - Ignore arg count on i960. */ - -/* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */ - -#undef FIX_CALL_DUMMY - - -/* Interface definitions for kernel debugger KDB */ -/* (Not relevant to i960.) */ +// OBSOLETE /* Parameters for target machine Intel 960, for GDB, the GNU debugger. +// OBSOLETE +// OBSOLETE Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free +// OBSOLETE Software Foundation, Inc. +// OBSOLETE +// OBSOLETE Contributed by Intel Corporation. +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /* Definitions to target GDB to any i960. */ +// OBSOLETE +// OBSOLETE #ifndef I80960 +// OBSOLETE #define I80960 +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE #include "doublest.h" +// OBSOLETE +// OBSOLETE /* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol +// OBSOLETE information. In the i960, parameters can be stored as locals or as +// OBSOLETE args, depending on the type of the debug record. +// OBSOLETE +// OBSOLETE From empirical observation, gcc960 uses N_LSYM to indicate +// OBSOLETE arguments passed in registers and then copied immediately +// OBSOLETE to the frame, and N_PSYM to indicate arguments passed in a +// OBSOLETE g14-relative argument block. */ +// OBSOLETE +// OBSOLETE #define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG) +// OBSOLETE +// OBSOLETE /* Offset from address of function to start of its code. +// OBSOLETE Zero on most machines. */ +// OBSOLETE +// OBSOLETE #define FUNCTION_START_OFFSET 0 +// OBSOLETE +// OBSOLETE /* Advance ip across any function entry prologue instructions +// OBSOLETE to reach some "real" code. */ +// OBSOLETE +// OBSOLETE #define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip)) +// OBSOLETE extern CORE_ADDR i960_skip_prologue (); +// OBSOLETE +// OBSOLETE /* Immediately after a function call, return the saved ip. +// OBSOLETE Can't always go through the frames for this because on some machines +// OBSOLETE the new frame is not set up until the new function +// OBSOLETE executes some instructions. */ +// OBSOLETE +// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame)) +// OBSOLETE extern CORE_ADDR saved_pc_after_call (); +// OBSOLETE +// OBSOLETE /* Stack grows upward */ +// OBSOLETE +// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) > (rhs)) +// OBSOLETE +// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity +// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the +// OBSOLETE real way to know how big a register is. */ +// OBSOLETE +// OBSOLETE #define REGISTER_SIZE 4 +// OBSOLETE +// OBSOLETE /* Number of machine registers */ +// OBSOLETE #define NUM_REGS 40 +// OBSOLETE +// OBSOLETE /* Initializer for an array of names of registers. +// OBSOLETE There should be NUM_REGS strings in this initializer. */ +// OBSOLETE +// OBSOLETE #define REGISTER_NAMES { \ +// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ +// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ +// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ +// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ +// OBSOLETE /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Register numbers of various important registers (used to index +// OBSOLETE into arrays of register names and register values). */ +// OBSOLETE +// OBSOLETE #define R0_REGNUM 0 /* First local register */ +// OBSOLETE #define SP_REGNUM 1 /* Contains address of top of stack */ +// OBSOLETE #define RIP_REGNUM 2 /* Return instruction pointer (local r2) */ +// OBSOLETE #define R15_REGNUM 15 /* Last local register */ +// OBSOLETE #define G0_REGNUM 16 /* First global register */ +// OBSOLETE #define G13_REGNUM 29 /* g13 - holds struct return address */ +// OBSOLETE #define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */ +// OBSOLETE #define FP_REGNUM 31 /* Contains address of executing stack frame */ +// OBSOLETE #define PCW_REGNUM 32 /* process control word */ +// OBSOLETE #define ACW_REGNUM 33 /* arithmetic control word */ +// OBSOLETE #define TCW_REGNUM 34 /* trace control word */ +// OBSOLETE #define IP_REGNUM 35 /* instruction pointer */ +// OBSOLETE #define FP0_REGNUM 36 /* First floating point register */ +// OBSOLETE +// OBSOLETE /* Some registers have more than one name */ +// OBSOLETE +// OBSOLETE #define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */ +// OBSOLETE #define PFP_REGNUM R0_REGNUM /* Previous frame pointer */ +// OBSOLETE +// OBSOLETE /* Total amount of space needed to store our copies of the machine's +// OBSOLETE register state, the array `registers'. */ +// OBSOLETE #define REGISTER_BYTES ((36*4) + (4*10)) +// OBSOLETE +// OBSOLETE /* Index within `registers' of the first byte of the space for register N. */ +// OBSOLETE +// OBSOLETE #define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \ +// OBSOLETE (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) ) +// OBSOLETE +// OBSOLETE /* The i960 has register windows, sort of. */ +// OBSOLETE +// OBSOLETE extern void i960_get_saved_register (char *raw_buffer, +// OBSOLETE int *optimized, +// OBSOLETE CORE_ADDR *addrp, +// OBSOLETE struct frame_info *frame, +// OBSOLETE int regnum, +// OBSOLETE enum lval_type *lval); +// OBSOLETE +// OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ +// OBSOLETE i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval) +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Number of bytes of storage in the actual machine representation +// OBSOLETE for register N. On the i960, all regs are 4 bytes except for floating +// OBSOLETE point, which are 10. NINDY only sends us 8 byte values for these, +// OBSOLETE which is a pain, but VxWorks handles this correctly, so we must. */ +// OBSOLETE +// OBSOLETE #define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 ) +// OBSOLETE +// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */ +// OBSOLETE +// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 ) +// OBSOLETE +// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ +// OBSOLETE +// OBSOLETE #define MAX_REGISTER_RAW_SIZE 10 +// OBSOLETE +// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ +// OBSOLETE +// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 +// OBSOLETE +// OBSOLETE #include "floatformat.h" +// OBSOLETE +// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext +// OBSOLETE +// OBSOLETE /* Return the GDB type object for the "standard" data type +// OBSOLETE of data in register N. */ +// OBSOLETE +// OBSOLETE struct type *i960_register_type (int regnum); +// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N) +// OBSOLETE +// OBSOLETE /* Macros for understanding function return values... */ +// OBSOLETE +// OBSOLETE /* Does the specified function use the "struct returning" convention +// OBSOLETE or the "value returning" convention? The "value returning" convention +// OBSOLETE almost invariably returns the entire value in registers. The +// OBSOLETE "struct returning" convention often returns the entire value in +// OBSOLETE memory, and passes a pointer (out of or into the function) saying +// OBSOLETE where the value (is or should go). +// OBSOLETE +// OBSOLETE Since this sometimes depends on whether it was compiled with GCC, +// OBSOLETE this is also an argument. This is used in call_function to build a +// OBSOLETE stack, and in value_being_returned to print return values. +// OBSOLETE +// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit. +// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */ +// OBSOLETE +// OBSOLETE extern use_struct_convention_fn i960_use_struct_convention; +// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type) +// OBSOLETE +// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state +// OBSOLETE a function return value of type TYPE, and copy that, in virtual format, +// OBSOLETE into VALBUF. This is only called if USE_STRUCT_CONVENTION for this +// OBSOLETE type is 0. +// OBSOLETE +// OBSOLETE On the i960 we just take as many bytes as we need from G0 through G3. */ +// OBSOLETE +// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ +// OBSOLETE memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE)) +// OBSOLETE +// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, +// OBSOLETE extract from an array REGBUF containing the (raw) register state +// OBSOLETE the address in which a function should return its structure value, +// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). +// OBSOLETE +// OBSOLETE Address of where to put structure was passed in in global +// OBSOLETE register g13 on entry. God knows what's in g13 now. The +// OBSOLETE (..., 0) below is to make it appear to return a value, though +// OBSOLETE actually all it does is call error(). */ +// OBSOLETE +// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ +// OBSOLETE (error("Don't know where large structure is returned on i960"), 0) +// OBSOLETE +// OBSOLETE /* Write into appropriate registers a function return value +// OBSOLETE of type TYPE, given in virtual format, for "value returning" functions. +// OBSOLETE +// OBSOLETE For 'return' command: not (yet) implemented for i960. */ +// OBSOLETE +// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ +// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb") +// OBSOLETE +// OBSOLETE /* Store the address of the place in which to copy the structure the +// OBSOLETE subroutine will return. This is called from call_function. */ +// OBSOLETE +// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ +// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb") +// OBSOLETE +// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame +// OBSOLETE (its caller). */ +// OBSOLETE +// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address +// OBSOLETE and produces the frame's chain-pointer. +// OBSOLETE +// OBSOLETE However, if FRAME_CHAIN_VALID returns zero, +// OBSOLETE it means the given frame is the outermost one and has no caller. */ +// OBSOLETE +// OBSOLETE /* We cache information about saved registers in the frame structure, +// OBSOLETE to save us from having to re-scan function prologues every time +// OBSOLETE a register in a non-current frame is accessed. */ +// OBSOLETE +// OBSOLETE #define EXTRA_FRAME_INFO \ +// OBSOLETE struct frame_saved_regs *fsr; \ +// OBSOLETE CORE_ADDR arg_pointer; +// OBSOLETE +// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized, +// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and +// OBSOLETE initialize a frame_saved_regs struct the first time it is called. +// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values +// OBSOLETE indicate real, cached values. */ +// OBSOLETE +// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ +// OBSOLETE ((fi)->fsr = 0, (fi)->arg_pointer = -1) +// OBSOLETE +// OBSOLETE /* On the i960, we get the chain pointer by reading the PFP saved +// OBSOLETE on the stack and clearing the status bits. */ +// OBSOLETE +// OBSOLETE #define FRAME_CHAIN(thisframe) \ +// OBSOLETE (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf) +// OBSOLETE +// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one +// OBSOLETE and has no caller. +// OBSOLETE +// OBSOLETE On the i960, each various target system type must define FRAME_CHAIN_VALID, +// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported +// OBSOLETE targets types. We leave it undefined here. */ +// OBSOLETE +// OBSOLETE +// OBSOLETE /* A macro that tells us whether the function invocation represented +// OBSOLETE by FI does not have a frame on the stack associated with it. If it +// OBSOLETE does not, FRAMELESS is set to 1, else 0. */ +// OBSOLETE +// OBSOLETE CORE_ADDR leafproc_return (CORE_ADDR ip); +// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ +// OBSOLETE (leafproc_return ((FI)->pc) != 0) +// OBSOLETE +// OBSOLETE /* Note that in the i960 architecture the return pointer is saved in the +// OBSOLETE *caller's* stack frame. +// OBSOLETE +// OBSOLETE Make sure to zero low-order bits because of bug in 960CA A-step part +// OBSOLETE (instruction addresses should always be word-aligned anyway). */ +// OBSOLETE +// OBSOLETE #define FRAME_SAVED_PC(frame) \ +// OBSOLETE ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3) +// OBSOLETE +// OBSOLETE /* On the i960, FRAME_ARGS_ADDRESS should return the value of +// OBSOLETE g14 as passed into the frame, if known. We need a function for this. +// OBSOLETE We cache this value in the frame info if we've already looked it up. */ +// OBSOLETE +// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ +// OBSOLETE (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0)) +// OBSOLETE extern CORE_ADDR frame_args_address (); /* i960-tdep.c */ +// OBSOLETE +// OBSOLETE /* This is the same except it should return 0 when +// OBSOLETE it does not really know where the args are, rather than guessing. +// OBSOLETE This value is not cached since it is only used infrequently. */ +// OBSOLETE +// OBSOLETE #define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1)) +// OBSOLETE +// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame +// OBSOLETE +// OBSOLETE /* Set NUMARGS to the number of args passed to a frame. +// OBSOLETE Can return -1, meaning no way to tell. */ +// OBSOLETE +// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) +// OBSOLETE +// OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ +// OBSOLETE +// OBSOLETE #define FRAME_ARGS_SKIP 0 +// OBSOLETE +// OBSOLETE /* Produce the positions of the saved registers in a stack frame. */ +// OBSOLETE +// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \ +// OBSOLETE frame_find_saved_regs (frame_info_addr, &sr) +// OBSOLETE extern void frame_find_saved_regs (); /* See i960-tdep.c */ +// OBSOLETE +// OBSOLETE /* Things needed for making calls to functions in the inferior process */ +// OBSOLETE +// OBSOLETE /* Push an empty stack frame, to record the current ip, etc. +// OBSOLETE +// OBSOLETE Not (yet?) implemented for i960. */ +// OBSOLETE +// OBSOLETE #define PUSH_DUMMY_FRAME \ +// OBSOLETE error("Function calls into the inferior process are not supported on the i960") +// OBSOLETE +// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. */ +// OBSOLETE +// OBSOLETE +// OBSOLETE void i960_pop_frame (void); +// OBSOLETE #define POP_FRAME \ +// OBSOLETE i960_pop_frame () +// OBSOLETE +// OBSOLETE +// OBSOLETE /* This sequence of words is the instructions +// OBSOLETE +// OBSOLETE callx 0x00000000 +// OBSOLETE fmark +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */ +// OBSOLETE +// OBSOLETE /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */ +// OBSOLETE +// OBSOLETE /* Indicate that we don't support calling inferior child functions. */ +// OBSOLETE +// OBSOLETE #undef CALL_DUMMY +// OBSOLETE +// OBSOLETE /* Insert the specified number of args and function address +// OBSOLETE into a call sequence of the above form stored at 'dummyname'. +// OBSOLETE +// OBSOLETE Ignore arg count on i960. */ +// OBSOLETE +// OBSOLETE /* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */ +// OBSOLETE +// OBSOLETE #undef FIX_CALL_DUMMY +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Interface definitions for kernel debugger KDB */ +// OBSOLETE /* (Not relevant to i960.) */ diff --git a/gdb/config/i960/tm-mon960.h b/gdb/config/i960/tm-mon960.h index 98c03b137eb..dedce0e383a 100644 --- a/gdb/config/i960/tm-mon960.h +++ b/gdb/config/i960/tm-mon960.h @@ -1,69 +1,69 @@ -/* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger. - Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. - Contributed by Intel Corporation and Cygnus Support. - - 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. */ - -/***************************************************************************** - * Definitions to target GDB to an i960 debugged over a serial line. - ******************************************************************************/ - -#include "i960/tm-i960.h" - -/* forward declarations */ -struct frame_info; - -/* redefined from tm-i960.h */ -/* Number of machine registers */ -#undef NUM_REGS -#define NUM_REGS 40 - -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ -#undef REGISTER_NAMES -#define REGISTER_NAMES { \ - /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ - /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ - /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ - /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ - /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ -} - -/* Override the standard gdb prompt when compiled for this target. */ - -#define DEFAULT_PROMPT "(gdb960) " - -/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one - and has no caller. - - On the i960, each various target system type defines FRAME_CHAIN_VALID, - since it differs between Nindy, Mon960 and VxWorks, the currently supported - target types. */ - -extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *); -#define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe) - -/* Sequence of bytes for breakpoint instruction */ - -#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} - -/* Amount ip must be decremented by after a breakpoint. - * This is often the number of bytes in BREAKPOINT but not always. - */ - -#define DECR_PC_AFTER_BREAK 4 +// OBSOLETE /* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger. +// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. +// OBSOLETE Contributed by Intel Corporation and Cygnus Support. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /***************************************************************************** +// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line. +// OBSOLETE ******************************************************************************/ +// OBSOLETE +// OBSOLETE #include "i960/tm-i960.h" +// OBSOLETE +// OBSOLETE /* forward declarations */ +// OBSOLETE struct frame_info; +// OBSOLETE +// OBSOLETE /* redefined from tm-i960.h */ +// OBSOLETE /* Number of machine registers */ +// OBSOLETE #undef NUM_REGS +// OBSOLETE #define NUM_REGS 40 +// OBSOLETE +// OBSOLETE /* Initializer for an array of names of registers. +// OBSOLETE There should be NUM_REGS strings in this initializer. */ +// OBSOLETE #undef REGISTER_NAMES +// OBSOLETE #define REGISTER_NAMES { \ +// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ +// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ +// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ +// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ +// OBSOLETE /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */ +// OBSOLETE +// OBSOLETE #define DEFAULT_PROMPT "(gdb960) " +// OBSOLETE +// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one +// OBSOLETE and has no caller. +// OBSOLETE +// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID, +// OBSOLETE since it differs between Nindy, Mon960 and VxWorks, the currently supported +// OBSOLETE target types. */ +// OBSOLETE +// OBSOLETE extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *); +// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe) +// OBSOLETE +// OBSOLETE /* Sequence of bytes for breakpoint instruction */ +// OBSOLETE +// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} +// OBSOLETE +// OBSOLETE /* Amount ip must be decremented by after a breakpoint. +// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #define DECR_PC_AFTER_BREAK 4 diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h index e9cb99c9f4b..6a6dca26dc2 100644 --- a/gdb/config/i960/tm-nindy960.h +++ b/gdb/config/i960/tm-nindy960.h @@ -1,106 +1,106 @@ -/* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger. - Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. - Contributed by Intel Corporation and Cygnus Support. - - 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. */ - -/***************************************************************************** - * Definitions to target GDB to an i960 debugged over a serial line. - ******************************************************************************/ - -#include "i960/tm-i960.h" - -/* forward declarations */ -struct frame_info; - -/* Override the standard gdb prompt when compiled for this target. */ - -#define DEFAULT_PROMPT "(gdb960) " - -/* Additional command line options accepted by nindy gdb's, for handling - the remote-nindy.c interface. These should really be target-specific - rather than architecture-specific. */ - -extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */ -extern int nindy_initial_brk; /* Send a BREAK to reset board first */ -extern char *nindy_ttyname; /* Name of serial port to talk to nindy */ - -#define ADDITIONAL_OPTIONS \ - {"O", no_argument, &nindy_old_protocol, 1}, \ - {"brk", no_argument, &nindy_initial_brk, 1}, \ - {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */ - -#define ADDITIONAL_OPTION_CASES \ - case 1004: /* -ser option: remote nindy auto-start */ \ - nindy_ttyname = optarg; \ - break; - -#define ADDITIONAL_OPTION_HELP \ - "\ - -O Use old protocol to talk to a Nindy target\n\ - -brk Send a break to a Nindy target to reset it.\n\ - -ser SERIAL Open remote Nindy session to SERIAL port.\n\ -" - -/* If specified on the command line, open tty for talking to nindy, - and download the executable file if one was specified. */ - -extern void nindy_open (char *name, int from_tty); -#define ADDITIONAL_OPTION_HANDLER \ - if (nindy_ttyname != NULL) \ - { \ - if (catch_command_errors (nindy_open, nindy_ttyname, \ - !batch, RETURN_MASK_ALL)) \ - { \ - if (execarg != NULL) \ - catch_command_errors (target_load, execarg, !batch, \ - RETURN_MASK_ALL); \ - } \ - } - -/* If configured for i960 target, we take control before main loop - and demand that we configure for a nindy target. */ - -#define BEFORE_MAIN_LOOP_HOOK \ - nindy_before_main_loop(); - -extern void - nindy_before_main_loop (); /* In remote-nindy.c */ - -/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one - and has no caller. - - On the i960, each various target system type defines FRAME_CHAIN_VALID, - since it differs between NINDY and VxWorks, the two currently supported - targets types. */ - -extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *); -#define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe) - -extern int - nindy_frame_chain_valid (); /* See nindy-tdep.c */ - -/* Sequence of bytes for breakpoint instruction */ - -#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} - -/* Amount ip must be decremented by after a breakpoint. - * This is often the number of bytes in BREAKPOINT but not always. - */ - -#define DECR_PC_AFTER_BREAK 0 +// OBSOLETE /* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger. +// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. +// OBSOLETE Contributed by Intel Corporation and Cygnus Support. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE /***************************************************************************** +// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line. +// OBSOLETE ******************************************************************************/ +// OBSOLETE +// OBSOLETE #include "i960/tm-i960.h" +// OBSOLETE +// OBSOLETE /* forward declarations */ +// OBSOLETE struct frame_info; +// OBSOLETE +// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */ +// OBSOLETE +// OBSOLETE #define DEFAULT_PROMPT "(gdb960) " +// OBSOLETE +// OBSOLETE /* Additional command line options accepted by nindy gdb's, for handling +// OBSOLETE the remote-nindy.c interface. These should really be target-specific +// OBSOLETE rather than architecture-specific. */ +// OBSOLETE +// OBSOLETE extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */ +// OBSOLETE extern int nindy_initial_brk; /* Send a BREAK to reset board first */ +// OBSOLETE extern char *nindy_ttyname; /* Name of serial port to talk to nindy */ +// OBSOLETE +// OBSOLETE #define ADDITIONAL_OPTIONS \ +// OBSOLETE {"O", no_argument, &nindy_old_protocol, 1}, \ +// OBSOLETE {"brk", no_argument, &nindy_initial_brk, 1}, \ +// OBSOLETE {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */ +// OBSOLETE +// OBSOLETE #define ADDITIONAL_OPTION_CASES \ +// OBSOLETE case 1004: /* -ser option: remote nindy auto-start */ \ +// OBSOLETE nindy_ttyname = optarg; \ +// OBSOLETE break; +// OBSOLETE +// OBSOLETE #define ADDITIONAL_OPTION_HELP \ +// OBSOLETE "\ +// OBSOLETE -O Use old protocol to talk to a Nindy target\n\ +// OBSOLETE -brk Send a break to a Nindy target to reset it.\n\ +// OBSOLETE -ser SERIAL Open remote Nindy session to SERIAL port.\n\ +// OBSOLETE " +// OBSOLETE +// OBSOLETE /* If specified on the command line, open tty for talking to nindy, +// OBSOLETE and download the executable file if one was specified. */ +// OBSOLETE +// OBSOLETE extern void nindy_open (char *name, int from_tty); +// OBSOLETE #define ADDITIONAL_OPTION_HANDLER \ +// OBSOLETE if (nindy_ttyname != NULL) \ +// OBSOLETE { \ +// OBSOLETE if (catch_command_errors (nindy_open, nindy_ttyname, \ +// OBSOLETE !batch, RETURN_MASK_ALL)) \ +// OBSOLETE { \ +// OBSOLETE if (execarg != NULL) \ +// OBSOLETE catch_command_errors (target_load, execarg, !batch, \ +// OBSOLETE RETURN_MASK_ALL); \ +// OBSOLETE } \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* If configured for i960 target, we take control before main loop +// OBSOLETE and demand that we configure for a nindy target. */ +// OBSOLETE +// OBSOLETE #define BEFORE_MAIN_LOOP_HOOK \ +// OBSOLETE nindy_before_main_loop(); +// OBSOLETE +// OBSOLETE extern void +// OBSOLETE nindy_before_main_loop (); /* In remote-nindy.c */ +// OBSOLETE +// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one +// OBSOLETE and has no caller. +// OBSOLETE +// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID, +// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported +// OBSOLETE targets types. */ +// OBSOLETE +// OBSOLETE extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *); +// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe) +// OBSOLETE +// OBSOLETE extern int +// OBSOLETE nindy_frame_chain_valid (); /* See nindy-tdep.c */ +// OBSOLETE +// OBSOLETE /* Sequence of bytes for breakpoint instruction */ +// OBSOLETE +// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} +// OBSOLETE +// OBSOLETE /* Amount ip must be decremented by after a breakpoint. +// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #define DECR_PC_AFTER_BREAK 0 diff --git a/gdb/config/i960/tm-vx960.h b/gdb/config/i960/tm-vx960.h index a2e07cc7b0d..44ff627325e 100644 --- a/gdb/config/i960/tm-vx960.h +++ b/gdb/config/i960/tm-vx960.h @@ -1,52 +1,52 @@ -/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger. - Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999 - Free Software Foundation, Inc. - Contributed by Cygnus Support. - - 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 "i960/tm-i960.h" -#include "config/tm-vxworks.h" - -/* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has - the real value. */ -#undef PC_REGNUM -#define PC_REGNUM RIP_REGNUM - -/* We have more complex, useful breakpoints on the target. - Amount ip must be decremented by after a breakpoint. */ - -#define DECR_PC_AFTER_BREAK 0 - -/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ - -#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) - -/* Breakpoint patching is handled at the target end in VxWorks. */ -/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */ - -/* Number of registers in a ptrace_getregs call. */ - -#define VX_NUM_REGS (16 + 16 + 3) - -/* Number of registers in a ptrace_getfpregs call. */ - - /* @@ Can't use this -- the rdb library for the 960 target - doesn't support setting or retrieving FP regs. KR */ - -/* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */ +// OBSOLETE /* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger. +// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE Contributed by Cygnus Support. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "i960/tm-i960.h" +// OBSOLETE #include "config/tm-vxworks.h" +// OBSOLETE +// OBSOLETE /* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has +// OBSOLETE the real value. */ +// OBSOLETE #undef PC_REGNUM +// OBSOLETE #define PC_REGNUM RIP_REGNUM +// OBSOLETE +// OBSOLETE /* We have more complex, useful breakpoints on the target. +// OBSOLETE Amount ip must be decremented by after a breakpoint. */ +// OBSOLETE +// OBSOLETE #define DECR_PC_AFTER_BREAK 0 +// OBSOLETE +// OBSOLETE /* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ +// OBSOLETE +// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) +// OBSOLETE +// OBSOLETE /* Breakpoint patching is handled at the target end in VxWorks. */ +// OBSOLETE /* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */ +// OBSOLETE +// OBSOLETE /* Number of registers in a ptrace_getregs call. */ +// OBSOLETE +// OBSOLETE #define VX_NUM_REGS (16 + 16 + 3) +// OBSOLETE +// OBSOLETE /* Number of registers in a ptrace_getfpregs call. */ +// OBSOLETE +// OBSOLETE /* @@ Can't use this -- the rdb library for the 960 target +// OBSOLETE doesn't support setting or retrieving FP regs. KR */ +// OBSOLETE +// OBSOLETE /* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */ diff --git a/gdb/config/i960/vxworks960.mt b/gdb/config/i960/vxworks960.mt index ad3293421f7..e7f04c4aeb3 100644 --- a/gdb/config/i960/vxworks960.mt +++ b/gdb/config/i960/vxworks960.mt @@ -1,6 +1,6 @@ -# Target: VxWorks running on an Intel 960 -TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o -TM_FILE= tm-vx960.h - -# Define this for the vx-share routines, which don't see param.h. -MT_CFLAGS= -DI80960 +# OBSOLETE # Target: VxWorks running on an Intel 960 +# OBSOLETE TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o +# OBSOLETE TM_FILE= tm-vx960.h +# OBSOLETE +# OBSOLETE # Define this for the vx-share routines, which don't see param.h. +# OBSOLETE MT_CFLAGS= -DI80960 diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index 9477478c26c..648ff01c1c8 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -144,8 +144,8 @@ extern CORE_ADDR m32r_frame_saved_pc (struct frame_info *); ((TYPE_LENGTH (TYPE) > 4 ? 8 : 4) - TYPE_LENGTH (TYPE)), \ TYPE_LENGTH (TYPE)) -/* mvs_check STORE_RETURN_VALUE */ -#define STORE_RETURN_VALUE(TYPE, VALBUF) \ +/* mvs_check DEPRECATED_STORE_RETURN_VALUE */ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \ write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \ ((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\ (VALBUF), TYPE_LENGTH (TYPE)); diff --git a/gdb/config/m68k/apollo68b.mh b/gdb/config/m68k/apollo68b.mh index cf2770b35ad..99d034b03ec 100644 --- a/gdb/config/m68k/apollo68b.mh +++ b/gdb/config/m68k/apollo68b.mh @@ -1,5 +1,5 @@ -# Host: Apollo m68k, BSD mode. - -XM_FILE= xm-apollo68b.h -NAT_FILE= nm-apollo68b.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o +# OBSOLETE # Host: Apollo m68k, BSD mode. +# OBSOLETE +# OBSOLETE XM_FILE= xm-apollo68b.h +# OBSOLETE NAT_FILE= nm-apollo68b.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o diff --git a/gdb/config/m68k/apollo68b.mt b/gdb/config/m68k/apollo68b.mt index 2383d3b6156..11c0c02d178 100644 --- a/gdb/config/m68k/apollo68b.mt +++ b/gdb/config/m68k/apollo68b.mt @@ -1,3 +1,3 @@ -# Target: Apollo m68k in BSD mode -TDEPFILES= m68k-tdep.o dstread.o -TM_FILE= tm-apollo68b.h +# OBSOLETE # Target: Apollo m68k in BSD mode +# OBSOLETE TDEPFILES= m68k-tdep.o dstread.o +# OBSOLETE TM_FILE= tm-apollo68b.h diff --git a/gdb/config/m68k/apollo68v.mh b/gdb/config/m68k/apollo68v.mh index 6610e665f48..4ab84f074b9 100644 --- a/gdb/config/m68k/apollo68v.mh +++ b/gdb/config/m68k/apollo68v.mh @@ -1,10 +1,10 @@ -# Host: Apollo, System V mode (?) - -XM_FILE= xm-apollo68v.h -XM_CLIBS= -lPW - -NAT_FILE= nm-apollo68v.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o - -RANLIB=echo >/dev/null -CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE +# OBSOLETE # Host: Apollo, System V mode (?) +# OBSOLETE +# OBSOLETE XM_FILE= xm-apollo68v.h +# OBSOLETE XM_CLIBS= -lPW +# OBSOLETE +# OBSOLETE NAT_FILE= nm-apollo68v.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o +# OBSOLETE +# OBSOLETE RANLIB=echo >/dev/null +# OBSOLETE CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE diff --git a/gdb/config/m68k/hp300bsd.mh b/gdb/config/m68k/hp300bsd.mh index b0b186d671e..76aa9a562a7 100644 --- a/gdb/config/m68k/hp300bsd.mh +++ b/gdb/config/m68k/hp300bsd.mh @@ -1,6 +1,6 @@ -# Host: Hewlett-Packard 9000 series 300, running BSD - -XM_FILE= xm-hp300bsd.h - -NAT_FILE= nm-hp300bsd.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o +# OBSOLETE # Host: Hewlett-Packard 9000 series 300, running BSD +# OBSOLETE +# OBSOLETE XM_FILE= xm-hp300bsd.h +# OBSOLETE +# OBSOLETE NAT_FILE= nm-hp300bsd.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o diff --git a/gdb/config/m68k/hp300bsd.mt b/gdb/config/m68k/hp300bsd.mt index cbcc5edb7db..c3225e9a9ae 100644 --- a/gdb/config/m68k/hp300bsd.mt +++ b/gdb/config/m68k/hp300bsd.mt @@ -1,3 +1,3 @@ -# Target: Hewlett-Packard 9000 series 300, running BSD -TDEPFILES= m68k-tdep.o -TM_FILE= tm-hp300bsd.h +# OBSOLETE # Target: Hewlett-Packard 9000 series 300, running BSD +# OBSOLETE TDEPFILES= m68k-tdep.o +# OBSOLETE TM_FILE= tm-hp300bsd.h diff --git a/gdb/config/m68k/hp300hpux.mh b/gdb/config/m68k/hp300hpux.mh index 8ceb1872ca5..410c03cd753 100644 --- a/gdb/config/m68k/hp300hpux.mh +++ b/gdb/config/m68k/hp300hpux.mh @@ -1,8 +1,8 @@ -# Host: Hewlett-Packard 9000 series 300, running HPUX -# The following is true because gcc uses a different .o file format -# than the native HPUX compiler - -XM_FILE= xm-hp300hpux.h - -NAT_FILE= nm-hp300hpux.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o corelow.o core-aout.o +# OBSOLETE # Host: Hewlett-Packard 9000 series 300, running HPUX +# OBSOLETE # The following is true because gcc uses a different .o file format +# OBSOLETE # than the native HPUX compiler +# OBSOLETE +# OBSOLETE XM_FILE= xm-hp300hpux.h +# OBSOLETE +# OBSOLETE NAT_FILE= nm-hp300hpux.h +# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o corelow.o core-aout.o diff --git a/gdb/config/m68k/hp300hpux.mt b/gdb/config/m68k/hp300hpux.mt index 0fa801dee25..a1848af2d3d 100644 --- a/gdb/config/m68k/hp300hpux.mt +++ b/gdb/config/m68k/hp300hpux.mt @@ -1,8 +1,8 @@ -# Target: Hewlett-Packard 9000 series 300, running HPUX - -#msg Note that GDB can only read symbols from programs that were -#msg compiled with GCC using GAS. -#msg - -TDEPFILES= m68k-tdep.o -TM_FILE= tm-hp300hpux.h +# OBSOLETE # Target: Hewlett-Packard 9000 series 300, running HPUX +# OBSOLETE +# OBSOLETE #msg Note that GDB can only read symbols from programs that were +# OBSOLETE #msg compiled with GCC using GAS. +# OBSOLETE #msg +# OBSOLETE +# OBSOLETE TDEPFILES= m68k-tdep.o +# OBSOLETE TM_FILE= tm-hp300hpux.h diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h index 7697bc41321..269d1346e8e 100644 --- a/gdb/config/m68k/tm-delta68.h +++ b/gdb/config/m68k/tm-delta68.h @@ -63,7 +63,7 @@ /* When it returns a float/double value, use fp0 in sysV68. */ /* When it returns a pointer value, use a0 in sysV68. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ { \ char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h index 8a7d3a5b46c..e2889ecff7b 100644 --- a/gdb/config/m68k/tm-linux.h +++ b/gdb/config/m68k/tm-linux.h @@ -58,7 +58,7 @@ /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ { \ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ { \ diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h index 8e31b592811..59749f66335 100644 --- a/gdb/config/mips/nm-irix5.h +++ b/gdb/config/mips/nm-irix5.h @@ -24,7 +24,9 @@ #define TARGET_HAS_HARDWARE_WATCHPOINTS -#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 +/* TARGET_CAN_USE_HARDWARE_WATCHPOINT is now defined to go through + the target vector. For Irix5, procfs_can_use_hw_watchpoint() + should be invoked. */ /* When a hardware watchpoint fires off the PC will be left at the instruction which caused the watchpoint. It will be necessary for diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h index 300e549aea1..7482a779482 100644 --- a/gdb/config/mips/tm-embed.h +++ b/gdb/config/mips/tm-embed.h @@ -19,9 +19,6 @@ #include "mips/tm-bigmips.h" -#undef DEFAULT_MIPS_TYPE -#define DEFAULT_MIPS_TYPE "r3051" - /* Watchpoint support */ #define TARGET_HAS_HARDWARE_WATCHPOINTS diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h index 1a88de04b8d..2a1af87aa15 100644 --- a/gdb/config/mips/tm-irix5.h +++ b/gdb/config/mips/tm-irix5.h @@ -48,9 +48,6 @@ : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \ : builtin_type_int) -/* Force N32 ABI as the default. */ -#define MIPS_DEFAULT_ABI MIPS_ABI_N32 - #endif /* N32 */ diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index 1230a9bd96a..ac710a465a6 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -88,10 +88,6 @@ ((N) - FP0_REGNUM) * sizeof(double) : \ 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE) -/* Force N32 ABI as the default. */ -#define MIPS_DEFAULT_ABI MIPS_ABI_N32 - - /* The signal handler trampoline is called _sigtramp. */ #undef IN_SIGTRAMP #define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name)) diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h index 4236ea8bec4..60e9bee8782 100644 --- a/gdb/config/mips/tm-linux.h +++ b/gdb/config/mips/tm-linux.h @@ -33,16 +33,13 @@ /* GNU/Linux MIPS has __SIGRTMAX == 127. */ +#ifndef REALTIME_LO #define REALTIME_LO 32 #define REALTIME_HI 128 +#endif #include "config/tm-linux.h" -/* There's an E_MIPS_ABI_O32 flag in e_flags, but we don't use it - in - fact, using it may violate the o32 ABI. */ - -#define MIPS_DEFAULT_ABI MIPS_ABI_O32 - /* Use target_specific function to define link map offsets. */ extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void); @@ -51,8 +48,8 @@ extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void); /* Details about jmp_buf. */ -#define JB_ELEMENT_SIZE 4 -#define JB_PC 0 +#define MIPS_LINUX_JB_ELEMENT_SIZE 4 +#define MIPS_LINUX_JB_PC 0 /* Figure out where the longjmp will land. Slurp the arguments out of the stack. We expect the first arg to be a pointer to the jmp_buf structure diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 11aba8403b6..d87c4a74981 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -46,31 +46,12 @@ struct value; #define GDB_TARGET_UNMASK_DISAS_PC(addr) MAKE_MIPS16_ADDR(addr) #endif -/* The name of the usual type of MIPS processor that is in the target - system. */ - -#define DEFAULT_MIPS_TYPE "generic" - -/* Remove useless bits from the stack pointer. */ - -#define TARGET_READ_SP() ADDR_BITS_REMOVE (read_register (SP_REGNUM)) - -/* Offset from address of function to start of its code. - Zero on most machines. */ - -#define FUNCTION_START_OFFSET 0 - /* Return non-zero if PC points to an instruction which will cause a step to execute both the instruction at PC and an instruction at PC+4. */ extern int mips_step_skips_delay (CORE_ADDR); #define STEP_SKIPS_DELAY_P (1) #define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc)) -/* Are we currently handling a signal */ - -extern int in_sigtramp (CORE_ADDR, char *); -#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name) - /* Say how long (ordinary) registers are. This is a piece of bogosity used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ @@ -91,11 +72,6 @@ extern int in_sigtramp (CORE_ADDR, char *); #define NUM_REGS 90 #endif -/* Given the register index, return the name of the corresponding - register. */ -extern const char *mips_register_name (int regnr); -#define REGISTER_NAME(i) mips_register_name (i) - /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ @@ -145,12 +121,6 @@ extern const char *mips_register_name (int regnr); #define PRID_REGNUM 89 /* Processor ID */ #define LAST_EMBED_REGNUM 89 /* Last one */ -/* Define DO_REGISTERS_INFO() to do machine-specific formatting - of register dumps. */ - -#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp) -extern void mips_do_registers_info (int, int); - /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ @@ -161,39 +131,6 @@ extern void mips_do_registers_info (int, int); #define REGISTER_BYTE(N) ((N) * MIPS_REGSIZE) -/* Covert between the RAW and VIRTUAL registers. - - Some MIPS (SR, FSR, FIR) have a `raw' size of MIPS_REGSIZE but are - really 32 bit registers. This is a legacy of the 64 bit MIPS GDB - protocol which transfers 64 bits for 32 bit registers. */ - -extern int mips_register_convertible (int reg_nr); -#define REGISTER_CONVERTIBLE(N) (mips_register_convertible ((N))) - - -void mips_register_convert_to_virtual (int reg_nr, struct type *virtual_type, - char *raw_buf, char *virt_buf); -#define REGISTER_CONVERT_TO_VIRTUAL(N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF) \ - mips_register_convert_to_virtual (N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF) - -void mips_register_convert_to_raw (struct type *virtual_type, int reg_nr, - char *virt_buf, char *raw_buf); -#define REGISTER_CONVERT_TO_RAW(VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF) \ - mips_register_convert_to_raw (VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF) - -/* Number of bytes of storage in the program's representation - for register N. */ - -#define REGISTER_VIRTUAL_SIZE(N) TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (N)) - -/* Largest value REGISTER_RAW_SIZE can have. */ - -#define MAX_REGISTER_RAW_SIZE 8 - -/* Largest value REGISTER_VIRTUAL_SIZE can have. */ - -#define MAX_REGISTER_VIRTUAL_SIZE 8 - /* Return the GDB type object for the "standard" data type of data in register N. */ @@ -210,140 +147,20 @@ void mips_register_convert_to_raw (struct type *virtual_type, int reg_nr, If the target is big endian, double register values need conversion between memory and register formats. */ -#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \ - do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \ - && REGISTER_RAW_SIZE (n) == 4 \ - && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \ - && TYPE_CODE(type) == TYPE_CODE_FLT \ - && TYPE_LENGTH(type) == 8) { \ - char __temp[4]; \ - memcpy (__temp, ((char *)(buffer))+4, 4); \ - memcpy (((char *)(buffer))+4, (buffer), 4); \ - memcpy (((char *)(buffer)), __temp, 4); }} while (0) - -#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \ - do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \ - && REGISTER_RAW_SIZE (n) == 4 \ - && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \ - && TYPE_CODE(type) == TYPE_CODE_FLT \ - && TYPE_LENGTH(type) == 8) { \ - char __temp[4]; \ - memcpy (__temp, ((char *)(buffer))+4, 4); \ - memcpy (((char *)(buffer))+4, (buffer), 4); \ - memcpy (((char *)(buffer)), __temp, 4); }} while (0) - -/* Store the address of the place in which to copy the structure the - subroutine will return. Handled by mips_push_arguments. */ - -#define STORE_STRUCT_RETURN(addr, sp) -/**/ - -/* Extract from an array REGBUF containing the (raw) register state - a function return value of type TYPE, and copy that, in virtual format, - into VALBUF. XXX floats */ - -#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - mips_extract_return_value(TYPE, REGBUF, VALBUF) -extern void mips_extract_return_value (struct type *, char[], char *); - -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format. */ - -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ - mips_store_return_value(TYPE, VALBUF) -extern void mips_store_return_value (struct type *, char *); - -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ -/* The address is passed in a0 upon entry to the function, but when - the function exits, the compiler has copied the value to v0. This - convention is specified by the System V ABI, so I think we can rely - on it. */ - -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ - REGISTER_RAW_SIZE (V0_REGNUM))) - - -/* 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. */ - -#define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe) -extern CORE_ADDR mips_frame_chain (struct frame_info *); - -/* Define other aspects of the stack frame. */ +extern void mips_register_convert_to_type (int regnum, + struct type *type, + char *buffer); +extern void mips_register_convert_from_type (int regnum, + struct type *type, + char *buffer); +#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \ + mips_register_convert_to_type ((n), (type), (buffer)) -/* A macro that tells us whether the function invocation represented - by FI does not have a frame on the stack associated with it. If it - does not, FRAMELESS is set to 1, else 0. */ -/* We handle this differently for mips, and maybe we should not */ - -#define FRAMELESS_FUNCTION_INVOCATION(FI) (0) - -/* Saved Pc. */ - -#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME)) -extern CORE_ADDR mips_frame_saved_pc (struct frame_info *); - -#define FRAME_ARGS_ADDRESS(fi) (fi)->frame - -#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame - -/* Return number of args passed to a frame. - Can return -1, meaning no way to tell. */ - -#define FRAME_NUM_ARGS(fi) (mips_frame_num_args(fi)) -extern int mips_frame_num_args (struct frame_info *); - -/* Return number of bytes at start of arglist that are not really args. */ - -#define FRAME_ARGS_SKIP 0 +#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \ + mips_register_convert_from_type ((n), (type), (buffer)) - -/* Things needed for making the inferior call functions. */ - -/* Stack must be aligned on 32-bit boundaries when synthesizing - function calls. We don't need STACK_ALIGN, PUSH_ARGUMENTS will - handle it. */ - -extern CORE_ADDR mips_push_arguments (int, struct value **, CORE_ADDR, int, - CORE_ADDR); -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ - (mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) - -extern CORE_ADDR mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp); -#define PUSH_RETURN_ADDRESS(PC, SP) (mips_push_return_address ((PC), (SP))) - -/* Push an empty stack frame, to record the current PC, etc. */ - -#define PUSH_DUMMY_FRAME mips_push_dummy_frame() -extern void mips_push_dummy_frame (void); - -/* Discard from the stack the innermost frame, restoring all registers. */ - -#define POP_FRAME mips_pop_frame() -extern void mips_pop_frame (void); - -#define CALL_DUMMY_START_OFFSET (0) - -#define CALL_DUMMY_BREAKPOINT_OFFSET (0) - -/* When calling functions on Irix 5 (or any MIPS SVR4 ABI compliant - platform), $t9 ($25) (Dest_Reg) contains the address of the callee - (used for PIC). It doesn't hurt to do this on other systems; $t9 - will be ignored. */ -#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p) \ - write_register(T9_REGNUM, fun) - -#define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ()) -extern CORE_ADDR mips_call_dummy_address (void); - /* Special symbol found in blocks associated with routines. We can hang mips_extra_func_info_t's off of this. */ @@ -363,10 +180,6 @@ typedef struct mips_extra_func_info } *mips_extra_func_info_t; -extern void mips_init_extra_frame_info (int fromleaf, struct frame_info *); -#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ - mips_init_extra_frame_info(fromleaf, fci) - extern void mips_print_extra_frame_info (struct frame_info *frame); #define PRINT_EXTRA_FRAME_INFO(fi) \ mips_print_extra_frame_info (fi) @@ -391,7 +204,6 @@ extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); #define TM_PRINT_INSN_MACH 0 - /* These are defined in mdebugread.c and are used in mips-tdep.c */ extern CORE_ADDR sigtramp_address, sigtramp_end; extern void fixup_sigtramp (void); @@ -400,13 +212,7 @@ extern void fixup_sigtramp (void); extern char *mips_read_processor_type (void); /* Functions for dealing with MIPS16 call and return stubs. */ -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) mips_in_call_stub (pc, name) -#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) mips_in_return_stub (pc, name) -#define SKIP_TRAMPOLINE_CODE(pc) mips_skip_stub (pc) #define IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc) -extern int mips_in_call_stub (CORE_ADDR pc, char *name); -extern int mips_in_return_stub (CORE_ADDR pc, char *name); -extern CORE_ADDR mips_skip_stub (CORE_ADDR pc); extern int mips_ignore_helper (CORE_ADDR pc); #ifndef TARGET_MIPS @@ -427,38 +233,8 @@ typedef unsigned long t_inst; /* Integer big enough to hold an instruction */ #endif /* TM_MIPS_H */ -/* Macros for setting and testing a bit in a minimal symbol that - marks it as 16-bit function. The MSB of the minimal symbol's - "info" field is used for this purpose. This field is already - being used to store the symbol size, so the assumption is - that the symbol size cannot exceed 2^31. - - ELF_MAKE_MSYMBOL_SPECIAL - tests whether an ELF symbol is "special", i.e. refers - to a 16-bit function, and sets a "special" bit in a - minimal symbol to mark it as a 16-bit function - MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol - MSYMBOL_SIZE returns the size of the minimal symbol, i.e. - the "info" field with the "special" bit masked out - */ - -#define ELF_MAKE_MSYMBOL_SPECIAL(sym,msym) \ - { \ - if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16) { \ - MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000); \ - SYMBOL_VALUE_ADDRESS (msym) |= 1; \ - } \ - } - -#define MSYMBOL_IS_SPECIAL(msym) \ - (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0) -#define MSYMBOL_SIZE(msym) \ - ((long) MSYMBOL_INFO (msym) & 0x7fffffff) - - /* Command to set the processor type. */ extern void mips_set_processor_type_command (char *, int); - /* Single step based on where the current instruction will take us. */ extern void mips_software_single_step (enum target_signal, int); diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h index 3a362f05a3a..ebf671bd54a 100644 --- a/gdb/config/mips/tm-mipsv4.h +++ b/gdb/config/mips/tm-mipsv4.h @@ -33,8 +33,5 @@ #define SIGFRAME_PC_OFF (SIGFRAME_BASE + 40 + 35 * 4) #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 40 + 36 * 4) -/* Use the alternate method of determining valid frame chains. */ -#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi) - /* Convert a DWARF register number to a gdb REGNUM. */ #define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) diff --git a/gdb/config/mips/tm-nbsd.h b/gdb/config/mips/tm-nbsd.h index fc7448665e1..143f3a43114 100644 --- a/gdb/config/mips/tm-nbsd.h +++ b/gdb/config/mips/tm-nbsd.h @@ -28,11 +28,6 @@ #include "mips/tm-mips.h" #include "solib.h" -/* There's an E_MIPS_ABI_O32 flag in e_flags, but we don't use it - in - fact, using it may violate the o32 ABI. */ - -#define MIPS_DEFAULT_ABI MIPS_ABI_O32 - /* We don't want to inherit tm-mips.h's shared library trampoline code. */ #undef IN_SOLIB_CALL_TRAMPOLINE #undef IN_SOLIB_RETURN_TRAMPOLINE diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index 81768134e7c..bd2e66c411b 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -148,7 +148,7 @@ extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *); extract_address (REGBUF + REGISTER_BYTE (4), \ REGISTER_RAW_SIZE (4)) -#define STORE_RETURN_VALUE(TYPE, VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \ { \ if (TYPE_LENGTH (TYPE) > 8) \ internal_error (__FILE__, __LINE__, "failed internal consistency check"); \ diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 0570e6fdf84..6fd8c033652 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -310,6 +310,7 @@ extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precis a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ +void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf); #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ hppa_extract_return_value (TYPE, REGBUF, VALBUF); @@ -330,7 +331,9 @@ extern use_struct_convention_fn hppa_use_struct_convention; /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + +extern void hppa_store_return_value (struct type *type, char *valbuf); +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ hppa_store_return_value (TYPE, VALBUF); /* Extract from an array REGBUF containing the (raw) register state @@ -350,6 +353,8 @@ extern use_struct_convention_fn hppa_use_struct_convention; specified in the calling convention doc. As far as I know, the only way to get the return value is to have the caller tell us where it told the callee to put it, rather than have the callee tell us. */ +struct value *hppa_value_returned_from_stack (register struct type *valtype, + CORE_ADDR addr); #define VALUE_RETURNED_FROM_STACK(valtype,addr) \ hppa_value_returned_from_stack (valtype, addr) diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 10790e6bb01..7e6e45a2bfb 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -260,8 +260,8 @@ call_dummy (TYPE_LENGTH (value_type) > 16) /* RM: for return command */ -#undef STORE_RETURN_VALUE -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#undef DEPRECATED_STORE_RETURN_VALUE +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ { \ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \ write_register_bytes \ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 07c9e44d2ad..8cac2586571 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -267,7 +267,7 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE, VALBUF) \ +#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \ sparc_store_return_value (TYPE, VALBUF) extern void sparc_store_return_value (struct type *, char *); diff --git a/gdb/config/sparc/tm-sparclet.h b/gdb/config/sparc/tm-sparclet.h index 7771b2779b8..fd25f5ba1fd 100644 --- a/gdb/config/sparc/tm-sparclet.h +++ b/gdb/config/sparc/tm-sparclet.h @@ -117,8 +117,8 @@ enum { ? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \ TYPE_LENGTH(TYPE)); \ } -#undef STORE_RETURN_VALUE -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ +#undef DEPRECATED_STORE_RETURN_VALUE +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ { \ /* Other values are returned in register %o0. */ \ write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \ diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index 194a257c44f..eb96eda68a0 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -148,7 +148,7 @@ extern int z8k_saved_pc_after_call (struct frame_info *frame); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) internal_error (__FILE__, __LINE__, "failed internal consistency check"); +#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, diff --git a/gdb/configure b/gdb/configure index 881c1886b76..9befcab3d80 100755 --- a/gdb/configure +++ b/gdb/configure @@ -2830,6 +2830,7 @@ CONFIG_CLEAN= CONFIG_INSTALL= CONFIG_UNINSTALL= +SUBDIRS="doc testsuite nlm" configdirs="doc testsuite" # Check whether --enable-multi-ice or --disable-multi-ice was given. @@ -2879,7 +2880,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2883: checking for $ac_word" >&5 +echo "configure:2884: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2920,7 +2921,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2924: checking for a BSD compatible install" >&5 +echo "configure:2925: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2981,7 +2982,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2985: checking for $ac_word" >&5 +echo "configure:2986: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3013,7 +3014,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3017: checking for $ac_word" >&5 +echo "configure:3018: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3045,7 +3046,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3049: checking for $ac_word" >&5 +echo "configure:3050: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3080,7 +3081,7 @@ fi # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3084: checking for $ac_word" >&5 +echo "configure:3085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3112,7 +3113,7 @@ fi # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3116: checking for $ac_word" >&5 +echo "configure:3117: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3146,7 +3147,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3150: checking for $ac_word" >&5 +echo "configure:3151: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3180,7 +3181,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3184: checking for $ac_word" >&5 +echo "configure:3185: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3231,12 +3232,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3235: checking return type of signal handlers" >&5 +echo "configure:3236: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3253,7 +3254,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3273,12 +3274,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3277: checking for ANSI C header files" >&5 +echo "configure:3278: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3286,7 +3287,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3303,7 +3304,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3321,7 +3322,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3342,7 +3343,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3353,7 +3354,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3397,17 +3398,17 @@ for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3401: checking for $ac_hdr" >&5 +echo "configure:3402: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3434,12 +3435,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3438: checking whether stat file-mode macros are broken" >&5 +echo "configure:3439: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3491,12 +3492,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3495: checking for working const" >&5 +echo "configure:3496: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3566,21 +3567,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3570: checking for inline" >&5 +echo "configure:3571: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3610,12 +3611,12 @@ for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3614: checking for $ac_func" >&5 +echo "configure:3615: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3665,19 +3666,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3669: checking for working alloca.h" >&5 +echo "configure:3670: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3698,12 +3699,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3702: checking for alloca" >&5 +echo "configure:3703: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3763,12 +3764,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3767: checking whether alloca needs Cray hooks" >&5 +echo "configure:3768: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3797: checking for $ac_func" >&5 +echo "configure:3798: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3848,7 +3849,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3852: checking stack direction for C alloca" >&5 +echo "configure:3853: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3856,7 +3857,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3897,12 +3898,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3901: checking for pid_t" >&5 +echo "configure:3902: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3931,17 +3932,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3935: checking for vfork.h" >&5 +echo "configure:3936: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3966,18 +3967,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3970: checking for working vfork" >&5 +echo "configure:3971: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3976: checking for vfork" >&5 +echo "configure:3977: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -4022,7 +4023,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -4117,7 +4118,7 @@ main() { } } EOF -if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -4141,7 +4142,7 @@ fi if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4145: checking whether setpgrp takes no argument" >&5 +echo "configure:4146: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4149,7 +4150,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -4194,12 +4195,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4198: checking whether setpgrp takes no argument" >&5 +echo "configure:4199: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4213,7 +4214,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -4237,12 +4238,12 @@ fi # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:4241: checking for sigsetjmp" >&5 +echo "configure:4242: checking for sigsetjmp" >&5 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4251,7 +4252,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:4255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -4274,19 +4275,19 @@ fi # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:4278: checking for r_fs in struct reg" >&5 +echo "configure:4279: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:4290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -4306,19 +4307,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:4310: checking for r_gs in struct reg" >&5 +echo "configure:4311: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:4322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -4340,19 +4341,19 @@ fi # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:4344: checking for PTRACE_GETREGS" >&5 +echo "configure:4345: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:4356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -4374,19 +4375,19 @@ fi # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:4378: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:4379: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:4390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -4408,12 +4409,12 @@ fi # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:4412: checking for PT_GETDBREGS" >&5 +echo "configure:4413: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4421,7 +4422,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:4425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -4443,12 +4444,12 @@ fi # See if provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:4447: checking for PT_GETXMMREGS" >&5 +echo "configure:4448: checking for PT_GETXMMREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4456,7 +4457,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:4460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -4478,7 +4479,7 @@ fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:4482: checking for socketpair in -lsocket" >&5 +echo "configure:4483: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4486,7 +4487,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4527,12 +4528,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4531: checking for $ac_func" >&5 +echo "configure:4532: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4582,12 +4583,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4586: checking whether malloc must be declared" >&5 +echo "configure:4587: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4608,7 +4609,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4629,12 +4630,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4633: checking whether realloc must be declared" >&5 +echo "configure:4634: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4655,7 +4656,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4676,12 +4677,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4680: checking whether free must be declared" >&5 +echo "configure:4681: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4702,7 +4703,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4723,12 +4724,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4727: checking whether strerror must be declared" >&5 +echo "configure:4728: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4749,7 +4750,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4770,12 +4771,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4774: checking whether strdup must be declared" >&5 +echo "configure:4775: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4796,7 +4797,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4817,12 +4818,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4821: checking whether strstr must be declared" >&5 +echo "configure:4822: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4843,7 +4844,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4864,12 +4865,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:4868: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:4869: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4890,7 +4891,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:4894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -4916,9 +4917,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4920: checking for HPUX save_state structure" >&5 +echo "configure:4921: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4933,7 +4934,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -5003,12 +5004,12 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5007: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5008: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5039,12 +5040,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5043: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:5044: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -5075,12 +5076,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5079: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:5080: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -5111,12 +5112,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5115: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:5116: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -5147,12 +5148,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5151: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:5152: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -5183,12 +5184,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5187: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:5188: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -5219,12 +5220,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5223: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:5224: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -5255,12 +5256,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5259: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:5260: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -5291,12 +5292,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5295: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:5296: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -5327,12 +5328,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5331: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:5332: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -5363,12 +5364,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5367: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:5368: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -5399,12 +5400,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5403: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:5404: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -5435,12 +5436,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5439: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:5440: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -5471,12 +5472,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5475: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:5476: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -5512,7 +5513,7 @@ EOF if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:5516: checking whether prfpregset_t type is broken" >&5 +echo "configure:5517: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5520,7 +5521,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -5530,7 +5531,7 @@ else return 0; } EOF -if { (eval echo configure:5534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -5555,12 +5556,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5559: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:5560: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5573,7 +5574,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -5597,19 +5598,19 @@ fi if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5601: checking for member l_addr in struct link_map" >&5 +echo "configure:5602: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:5613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -5631,12 +5632,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5635: checking for member lm_addr in struct link_map" >&5 +echo "configure:5636: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5644,7 +5645,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:5648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -5666,12 +5667,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:5670: checking for member som_addr in struct so_map" >&5 +echo "configure:5671: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_NLIST_H @@ -5682,7 +5683,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:5686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -5704,12 +5705,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:5708: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:5709: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5717,7 +5718,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:5721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -5743,7 +5744,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5747: checking for main in -lm" >&5 +echo "configure:5748: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5751,14 +5752,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5787,7 +5788,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:5791: checking for wctype in -lc" >&5 +echo "configure:5792: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5795,7 +5796,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5825,7 +5826,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:5829: checking for wctype in -lw" >&5 +echo "configure:5830: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5833,7 +5834,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5876,12 +5877,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:5880: checking for long long support in compiler" >&5 +echo "configure:5881: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -5913,7 +5914,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:5917: checking for long long support in printf" >&5 +echo "configure:5918: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5921,7 +5922,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -5959,19 +5960,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:5963: checking for long double support in compiler" >&5 +echo "configure:5964: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -5993,7 +5994,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:5997: checking for long double support in printf" >&5 +echo "configure:5998: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6001,7 +6002,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -6035,7 +6036,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:6039: checking for long double support in scanf" >&5 +echo "configure:6040: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6043,7 +6044,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -6079,17 +6080,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6083: checking for $ac_hdr" >&5 +echo "configure:6084: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6118,12 +6119,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6122: checking for $ac_func" >&5 +echo "configure:6123: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6171,7 +6172,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6175: checking for working mmap" >&5 +echo "configure:6176: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6179,7 +6180,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6345,7 +6346,7 @@ fi case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:6349: checking for -bbigtoc option" >&5 +echo "configure:6350: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6359,14 +6360,14 @@ else LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6389,7 +6390,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:6393: checking for HPUX/OSF thread support" >&5 +echo "configure:6394: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -6408,7 +6409,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:6412: checking for Solaris thread debugging library" >&5 +echo "configure:6413: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -6418,7 +6419,7 @@ EOF CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6422: checking for dlopen in -ldl" >&5 +echo "configure:6423: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6426,7 +6427,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6469,17 +6470,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:6473: checking for the ld -export-dynamic flag" >&5 +echo "configure:6474: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -6498,13 +6499,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:6502: checking if is old" >&5 +echo "configure:6503: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6515,7 +6516,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -6734,7 +6735,7 @@ WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:6738: checking compiler warning flags" >&5 +echo "configure:6739: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -6744,14 +6745,14 @@ echo "configure:6738: checking compiler warning flags" >&5 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -6811,12 +6812,12 @@ fi if test $want_included_regex = false; then echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6815: checking for GNU regex" >&5 +echo "configure:6816: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6828,7 +6829,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6857,12 +6858,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:6861: checking for cygwin" >&5 +echo "configure:6862: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6904: checking for tgetent in -lncurses" >&5 +echo "configure:6905: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6908,7 +6909,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6938,7 +6939,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:6942: checking for tgetent in -lHcurses" >&5 +echo "configure:6943: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6946,7 +6947,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6976,7 +6977,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:6980: checking for tgetent in -ltermlib" >&5 +echo "configure:6981: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6984,7 +6985,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7014,7 +7015,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:7018: checking for tgetent in -ltermcap" >&5 +echo "configure:7019: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7022,7 +7023,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7052,7 +7053,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:7056: checking for tgetent in -lcurses" >&5 +echo "configure:7057: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7060,7 +7061,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7090,7 +7091,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:7094: checking for tgetent in -lterminfo" >&5 +echo "configure:7095: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7098,7 +7099,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7274,7 +7275,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:7278: checking for Tcl configuration" >&5 +echo "configure:7279: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7382,7 +7383,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:7386: checking for Tk configuration" >&5 +echo "configure:7387: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7491,7 +7492,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:7495: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:7496: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -7557,17 +7558,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:7561: checking for tclInt.h" >&5 +echo "configure:7562: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7627,7 +7628,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:7631: checking for Tk private headers" >&5 +echo "configure:7632: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -7693,17 +7694,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:7697: checking for tk.h" >&5 +echo "configure:7698: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7749,7 +7750,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7753: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:7754: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -7772,7 +7773,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7776: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:7777: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -7795,7 +7796,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7799: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:7800: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -7847,7 +7848,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:7851: checking for Itcl configuration" >&5 +echo "configure:7852: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7950,7 +7951,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:7954: checking for Itk configuration" >&5 +echo "configure:7955: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8053,7 +8054,7 @@ if test "${with_tixconfig+set}" = set; then fi echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:8057: checking for Tix configuration" >&5 +echo "configure:8058: checking for Tix configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8174,6 +8175,9 @@ fi fi fi fi + + SUBDIRS="${SUBDIRS} gdbtk" + configdirs="${configdirs} gdbtk" fi @@ -8196,7 +8200,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:8200: checking for X" >&5 +echo "configure:8204: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -8258,12 +8262,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8332,14 +8336,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -8624,7 +8628,6 @@ case "${GDB_MULTI_ARCH}" in *) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };; esac -SUBDIRS="doc testsuite nlm" if test "${enable_multi_ice}" = "yes"; then SUBDIRS="${SUBDIRS} multi-ice" fi @@ -8632,7 +8635,7 @@ fi # ``gdbserver'' can only be built in a native configuration. if test x"${target}" = x"${host}"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:8636: checking whether gdbserver is supported on this host" >&5 +echo "configure:8639: checking whether gdbserver is supported on this host" >&5 if test x"${build_gdbserver}" = xyes ; then configdirs="${configdirs} gdbserver" SUBDIRS="${SUBDIRS} gdbserver" @@ -8694,7 +8697,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:8698: checking whether ln -s works" >&5 +echo "configure:8701: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8718,12 +8721,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:8722: checking for Cygwin environment" >&5 +echo "configure:8725: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -8751,19 +8754,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:8755: checking for mingw32 environment" >&5 +echo "configure:8758: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -8782,7 +8785,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:8786: checking for executable suffix" >&5 +echo "configure:8789: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8792,7 +8795,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:8796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:8799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -9103,7 +9106,7 @@ cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff --git a/gdb/configure.host b/gdb/configure.host index a61194f7314..883538db3b2 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -54,7 +54,7 @@ i[3456]86-ncr-*) gdb_host=ncr3000 ;; i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;; i[3456]86-sequent-sysv*) gdb_host=ptx ;; -i[3456]86-*-aix*) gdb_host=i386aix ;; +# OBSOLETE i[3456]86-*-aix*) gdb_host=i386aix ;; i[3456]86-*-bsd*) gdb_host=i386bsd ;; i[3456]86-*-dgux*) gdb_host=i386dgux ;; i[3456]86-*-freebsd*) gdb_host=fbsd ;; @@ -65,11 +65,11 @@ i[3456]86-*-go32*) gdb_host=go32 ;; i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;; i[3456]86-*-linux*) gdb_host=linux ;; i[3456]86-*-lynxos*) gdb_host=i386lynx ;; -i[3456]86-*-mach3*) gdb_host=i386m3 ;; -i[3456]86-*-mach*) gdb_host=i386mach ;; +# OBSOLETE i[3456]86-*-mach3*) gdb_host=i386m3 ;; +# OBSOLETE i[3456]86-*-mach*) gdb_host=i386mach ;; i[3456]86-*-gnu*) gdb_host=i386gnu ;; i[3456]86-*-openbsd*) gdb_host=obsd ;; -i[3456]86-*-osf1mk*) gdb_host=i386mk ;; +# OBSOLETE i[3456]86-*-osf1mk*) gdb_host=i386mk ;; i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;; i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;; i[3456]86-*-sco*) gdb_host=i386sco ;; @@ -91,12 +91,12 @@ ia64-*-linux*) gdb_host=linux ;; m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;; m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;; -m68*-apollo*-sysv*) gdb_host=apollo68v ;; -m68*-apollo*-bsd*) gdb_host=apollo68b ;; +# OBSOLETE m68*-apollo*-sysv*) gdb_host=apollo68v ;; +# OBSOLETE m68*-apollo*-bsd*) gdb_host=apollo68b ;; m68*-att-*) gdb_host=3b1 ;; m68*-bull*-sysv*) gdb_host=dpx2 ;; -m68*-hp-bsd*) gdb_host=hp300bsd ;; -m68*-hp-hpux*) gdb_host=hp300hpux ;; +# OBSOLETE m68*-hp-bsd*) gdb_host=hp300bsd ;; +# OBSOLETE m68*-hp-hpux*) gdb_host=hp300hpux ;; m68*-*-linux*) gdb_host=linux ;; m68*-*-lynxos*) gdb_host=m68klynx ;; m68*-*-netbsd*) gdb_host=nbsdaout ;; diff --git a/gdb/configure.in b/gdb/configure.in index 07871bef9fb..edc72c3aa94 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -52,6 +52,7 @@ CONFIG_CLEAN= CONFIG_INSTALL= CONFIG_UNINSTALL= +SUBDIRS="doc testsuite nlm" configdirs="doc testsuite" AC_ARG_ENABLE(multi-ice, @@ -1087,6 +1088,9 @@ if test "${enable_gdbtk}" = "yes"; then fi fi fi + + SUBDIRS="${SUBDIRS} gdbtk" + configdirs="${configdirs} gdbtk" fi AC_SUBST(X_CFLAGS) @@ -1293,7 +1297,6 @@ case "${GDB_MULTI_ARCH}" in *) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");; esac -SUBDIRS="doc testsuite nlm" if test "${enable_multi_ice}" = "yes"; then SUBDIRS="${SUBDIRS} multi-ice" fi diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 9e7206c4b87..385dbd02b3d 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -42,6 +42,7 @@ alpha*-*-osf*) gdb_target=alpha-osf1 ;; alpha*-*-linux*) gdb_target=alpha-linux ;; alpha*-*-freebsd*) gdb_target=fbsd ;; alpha*-*-netbsd*) gdb_target=nbsd ;; +alpha*-*-*) gdb_target=alpha ;; # OBSOLETE arc-*-*) gdb_target=arc ;; @@ -82,15 +83,13 @@ hppa*64*-*-hpux11*) gdb_target=hppa64 ;; hppa*-*-hpux*) gdb_target=hppahpux ;; hppa*-*-hiux*) gdb_target=hppahpux ;; hppa*-*-osf*) gdb_target=hppaosf ;; +hppa*-*-*) gdb_target=hppa ;; i[3456]86-sequent-bsd*) gdb_target=symmetry ;; i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;; i[3456]86-sequent-sysv*) gdb_target=ptx ;; i[3456]86-ncr-*) gdb_target=ncr3000 ;; -i[3456]86-*-aout*) gdb_target=embed ;; -i[3456]86-*-coff*) gdb_target=embed ;; -i[3456]86-*-elf*) gdb_target=embed ;; -i[3456]86-*-aix*) gdb_target=i386aix ;; +# OBSOLETE i[3456]86-*-aix*) gdb_target=i386aix ;; i[3456]86-*-bsd*) gdb_target=i386bsd ;; i[3456]86-*-freebsd*) gdb_target=fbsd ;; i[3456]86-*-netbsdelf*) gdb_target=nbsdelf ;; @@ -112,27 +111,28 @@ i[3456]86-*-linux*) gdb_target=linux build_gdbserver=yes ;; i[3456]86-*-isc*) gdb_target=i386v ;; -i[3456]86-*-mach3*) gdb_target=i386m3 ;; +# OBSOLETE i[3456]86-*-mach3*) gdb_target=i386m3 ;; i[3456]86-*-gnu*) gdb_target=i386gnu ;; i[3456]86-*-netware*) gdb_target=i386nw configdirs="${configdirs} nlm" ;; -i[3456]86-*-osf1mk*) gdb_target=i386mk ;; +# OBSOLETE i[3456]86-*-osf1mk*) gdb_target=i386mk ;; i[3456]86-*-cygwin*) gdb_target=cygwin ;; -i[3456]86-*-pe*) gdb_target=embed ;; i[3456]86-*-vxworks*) gdb_target=vxworks ;; +i[3456]86-*-*) gdb_target=embed ;; -i960-*-bout*) gdb_target=vxworks960 ;; -i960-nindy-coff*) gdb_target=nindy960 ;; -i960-*-coff*) gdb_target=mon960 ;; -i960-nindy-elf*) gdb_target=nindy960 ;; -i960-*-elf*) gdb_target=mon960 ;; -i960-*-nindy*) gdb_target=nindy960 ;; -i960-*-vxworks*) gdb_target=vxworks960 ;; +# OBSOLETE i960-*-bout*) gdb_target=vxworks960 ;; +# OBSOLETE i960-nindy-coff*) gdb_target=nindy960 ;; +# OBSOLETE i960-*-coff*) gdb_target=mon960 ;; +# OBSOLETE i960-nindy-elf*) gdb_target=nindy960 ;; +# OBSOLETE i960-*-elf*) gdb_target=mon960 ;; +# OBSOLETE i960-*-nindy*) gdb_target=nindy960 ;; +# OBSOLETE i960-*-vxworks*) gdb_target=vxworks960 ;; ia64-*-aix*) gdb_target=aix ;; ia64-*-linux*) gdb_target=linux build_gdbserver=yes ;; +ia64*-*-*) gdb_target=ia64 ;; m32r-*-elf*) gdb_target=m32r ;; @@ -141,10 +141,10 @@ m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;; m68000-*-sunos3*) gdb_target=sun2os3 ;; m68000-*-sunos4*) gdb_target=sun2os4 ;; -m68*-apollo*-bsd*) gdb_target=apollo68b ;; +# OBSOLETE m68*-apollo*-bsd*) gdb_target=apollo68b ;; m68*-bull-sysv*) gdb_target=dpx2 ;; -m68*-hp-bsd*) gdb_target=hp300bsd ;; -m68*-hp-hpux*) gdb_target=hp300hpux ;; +# OBSOLETE m68*-hp-bsd*) gdb_target=hp300bsd ;; +# OBSOLETE m68*-hp-hpux*) gdb_target=hp300hpux ;; m68*-att-*) gdb_target=3b1 ;; m68*-cisco*-*) gdb_target=cisco ;; m68*-ericsson-*) gdb_target=es1800 ;; @@ -208,6 +208,7 @@ mips*-*-sysv4*) gdb_target=mipsv4 ;; mips*-*-sysv*) gdb_target=bigmips ;; mips*-*-riscos*) gdb_target=bigmips ;; mips*-*-vxworks*) gdb_target=vxmips ;; +mips*-*-*) gdb_target=embed ;; mn10200-*-*) gdb_target=mn10200 ;; mn10300-*-*) gdb_target=mn10300 ;; diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index d4eb0a00d08..36d299217bd 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -21,6 +21,7 @@ #include "defs.h" #include "value.h" #include "cp-abi.h" +#include "gdb_string.h" struct cp_abi_ops current_cp_abi; diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 02605f0a4f1..c53c7ea87ac 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -4161,7 +4161,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { set_gdbarch_double_bit (gdbarch, 32); set_gdbarch_push_arguments (gdbarch, cris_abi_original_push_arguments); - set_gdbarch_store_return_value (gdbarch, + set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_original_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, cris_abi_original_extract_return_value); @@ -4172,7 +4172,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { set_gdbarch_double_bit (gdbarch, 64); set_gdbarch_push_arguments (gdbarch, cris_abi_v2_push_arguments); - set_gdbarch_store_return_value (gdbarch, cris_abi_v2_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, cris_abi_v2_extract_return_value); set_gdbarch_reg_struct_has_addr (gdbarch, diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index afed387a567..4e021069609 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -1612,7 +1612,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_deprecated_store_return_value (gdbarch, d10v_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 05825684d3e..fbd6b4ddfc1 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -8,13 +8,84 @@ * gdb.texinfo: Add chapter on interpreters. Refer the command-line option "-i"/"--interpreter" to this chapter. +2002-08-25 Andrew Cagney + + * gdb.texinfo (Examples): Use ``->'' for a packet send and ``<-'' + for a packet receive. + +2002-08-25 Andrew Cagney + + * Makefile.in (clean): Move to end of file. + (distclean, maintainer-clean, realclean): Ditto. + (mostlyclean): Move rule to end of file. Use GDB_TEX_TMPS, + GDBINT_TEX_TMPS, STABS_TEX_TMPS. + (gdb.dvi, gdb.pdf): Do not cleanup TeX temp files after texi2dvi. + (gdbint.dvi, gdbint.pdf, stabs.dvi, stabs.pdf): Ditto. + +2002-08-24 Andrew Cagney + + * Makefile.in (GDBINT_TEX_TMPS): Define. + (gdbint.dvi, gdbint.pdf): Use + (GDB_TEX_TMPS): Define. + (gdb.dvi, gdb.pdf): Use. + (STABS_TEX_TMPS): Define. + (stabs.dvi, stabs.pdf): Use. + (GDB_DOC_SOURCE_INCLUDES): New macros. + (GDB_DOC_BUILD_INCLUDES, GDB_DOC_FILES): New macros. + (GDBINT_DOC_FILES_INCLUDES): New macros. + (GDBINT_DOC_BUILD_INCLUDES): New macros. + (GDBINT_DOC_FILES, STABS_DOC_SOURCE_INCLUDES): New macros. + (STABS_DOC_BUILD_INCLUDES, STABS_DOC_FILES): New macros. + (SFILES_DOC, SFILES_INCLUDED, SFILES_LOCAL): Delete macros. + (links2roff): Replace SFILES_INCLUDED with + GDB_DOC_SOURCE_INCLUDES. + (gdb.dvi, gdb_toc.html, gdb.pdf, gdb.info): Update dependencies. + (gdb.me, gdb.mm, gdb.ms): Update dependencies. + (gdbint.dvi, gdbint_toc.html, gdbint.pdf, gdbint.info): Update + dependencies. + (stabs.info, stabs_toc.html, stabs.pdf, stabs.dvi): Update + dependencies. + (gdbmi.texinfo): Delete rule. + (inc-hist.texinfo): Delete rule. + (rluser.texinfo): Delete rule. + +2002-08-23 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Update + STORE_RETURN_VALUE, mention regcache. + +2002-08-21 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Document + print_registers_info. Note that DO_REGISTERS_INFO is deprecated. + +2002-08-19 Andrew Cagney + + * gdb.texinfo (Remote Protocol): Reformat. Use cross references. + Fix minor typos. Add index entries. + +2002-08-18 Andrew Cagney + + * gdb.texinfo (Data): Add ``Vector Unit'' to menu. + +2002-08-15 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Document + PRINT_VECTOR_INFO. + * gdb.texinfo (Vector Unit): Document "info vectors" command. + +2002-08-13 Andrew Cagney + + * gdb.texinfo (Maintenance Commands): Document "maint print + registers", "maint print raw-registers" and "maint print + cooked-registers". + 2002-08-08 Grace Sainsbury From Mark Salter: * gdb.texinfo (Protocol): Document T packet extension to allow watchpoint address reporting. - 2002-08-03 Andrew Cagney * gdb.texinfo (Dump/Restore Files): Move `[]' to outside of @var. diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 3b549b84763..ba0031a50bc 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -96,16 +96,40 @@ TEX = tex # Program to generate Postscript files from DVI files. DVIPS = dvips -# Main GDB manual's source files -SFILES_INCLUDED = gdb-cfg.texi \ +# Main GDB manual +GDB_DOC_SOURCE_INCLUDES = \ $(srcdir)/annotate.texi \ $(srcdir)/fdl.texi \ - $(srcdir)/gpl.texi - -SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) - -SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \ - $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo + $(srcdir)/gpl.texi \ + $(GDBMI_DIR)/gdbmi.texinfo \ + $(READLINE_DIR)/rluser.texinfo \ + $(READLINE_DIR)/inc-hist.texinfo +GDB_DOC_BUILD_INCLUDES = \ + gdb-cfg.texi \ + GDBvn.texi +GDB_DOC_FILES = \ + $(srcdir)/gdb.texinfo \ + $(GDB_DOC_SOURCE_INCLUDES) \ + $(GDB_DOC_BUILD_INCLUDES) + +# Internals Manual +GDBINT_DOC_SOURCE_INCLUDES = \ + $(srcdir)/fdl.texi +GDBINT_DOC_BUILD_INCLUDES = \ + gdb-cfg.texi \ + GDBvn.texi +GDBINT_DOC_FILES = \ + $(srcdir)/gdbint.texinfo \ + $(GDBINT_DOC_SOURCE_INCLUDES) \ + $(GDBINT_DOC_BUILD_INCLUDES) + +# Stabs manual: All files +STABS_DOC_SOURCE_INCLUDES = +STABS_DOC_BUILD_INCLUDES = +STABS_DOC_FILES = \ + $(srcdir)/stabs.texinfo \ + $(STABS_DOC_SOURCE_INCLUDES) \ + $(STABS_DOC_BUILD_INCLUDES) #### Host, target, and site specific Makefile fragments come in here. ### @@ -177,27 +201,6 @@ de-stage3: force -(cd stage3 ; mv -f * ..) -rmdir stage3 -# The "least clean" level of cleaning. Get rid of files which are -# automatically generated files that are just intermediate files, -# -mostlyclean: - rm -f gdb.mm gdb.ms gdb.me links2roff - rm -f *.aux *.cp* *.fn* *.ky* *.log *.pg* *.toc *.tp* *.vr* - rm -f sedref.dvi sedref.tex tmp.sed - -clean: mostlyclean - rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi - -distclean: clean - rm -f Makefile config.status - -# GDBvn.texi, the dvi files, the info files, and the postscript files, -# are all part of the distribution, so it should not be removed by -# "clean" or "distclean". Use maintainer-clean to remove them. - -maintainer-clean realclean: distclean - rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf - # GDB QUICK REFERENCE (dvi output) refcard.dvi : refcard.tex $(REFEDITS) echo > tmp.sed @@ -240,30 +243,34 @@ gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi # VPATH will often tell make not to bother building it, because the one # in the srcdir is up to date. (if not, then make should build one here). +# Clean these up before each run. Avoids a catch 22 with not being +# able to re-generate these files (to fix a corruption) because these +# files contain a corruption. +GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \ + gdb.tp* gdb.vr* + # GDB MANUAL: TeX dvi file -gdb.dvi: ${SFILES_DOC} +gdb.dvi: ${GDB_DOC_FILES} if [ ! -f ./GDBvn.texi ]; then \ (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ ln $(srcdir)/GDBvn.texi . || \ cp $(srcdir)/GDBvn.texi . ; else true; fi + rm -f $(GDB_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdb.texinfo - rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \ - gdb.tp* gdb.vr* gdb.ps: gdb.dvi $(DVIPS) -o $@ $? -gdb.pdf: ${SFILES_DOC} +gdb.pdf: ${GDB_DOC_FILES} if [ ! -f ./GDBvn.texi ]; then \ (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ ln $(srcdir)/GDBvn.texi . || \ cp $(srcdir)/GDBvn.texi . ; else true; fi + rm -f $(GDB_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdb.texinfo - rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \ - gdb.tp* gdb.vr* # GDB MANUAL: info file -gdb.info: ${SFILES_DOC} +gdb.info: ${GDB_DOC_FILES} $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) \ -o gdb.info $(srcdir)/gdb.texinfo @@ -281,37 +288,16 @@ gdb.info: ${SFILES_DOC} # texi2roff doesn't have a notion of include dirs, so we have to fake # it out for gdb manual's include files---but only if not configured # in main sourcedir. -links2roff: $(SFILES_INCLUDED) +links2roff: $(GDB_DOC_SOURCE_INCLUDES) if [ ! -f gdb.texinfo ]; then \ - (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \ - ln $(SFILES_INCLUDED) . || \ - cp $(SFILES_INCLUDED) . ; \ + (test "$$LN_S" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \ + ln $(GDB_DOC_SOURCE_INCLUDES) . || \ + cp $(GDB_DOC_SOURCE_INCLUDES) . ; \ fi touch links2roff -# "Readline" appendices. Get them also due to lack of includes, -# regardless of whether or not configuring in main sourcedir. -# @ftable removed due to bug in texi2roff-2; if your texi2roff -# is newer, try just ln or cp -rluser.texinfo: ${READLINE_DIR}/rluser.texinfo - sed -e 's/^@ftable/@table/g' \ - -e 's/^@end ftable/@end table/g' \ - ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo - -inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo - (test "$$LN_S" = "ln -s" && \ - ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \ - ln ${READLINE_DIR}/inc-hist.texinfo . || \ - cp ${READLINE_DIR}/inc-hist.texinfo . - -gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo - (test "$$LN_S" = "ln -s" && \ - ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \ - ln ${GDBMI_DIR}/gdbmi.texinfo . || \ - cp ${GDBMI_DIR}/gdbmi.texinfo . - # gdb manual suitable for [gtn]roff -me -gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo +gdb.me: $(GDB_DOC_FILES) links2roff sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -326,7 +312,7 @@ gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo >gdb.me # gdb manual suitable for [gtn]roff -ms -gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo +gdb.ms: $(GDB_DOC_FILES) links2roff sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -343,7 +329,7 @@ gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo # gdb manual suitable for [tn]roff -mm # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, # try leaving them in -gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo +gdb.mm: $(GDB_DOC_FILES) links2roff sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -360,56 +346,89 @@ gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo # GDB MANUAL: HTML file -gdb_toc.html: ${SFILES_DOC} +gdb_toc.html: ${GDB_DOC_FILES} $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo +# Clean these up before each run. Avoids a catch 22 with not being +# able to re-generate these files (to fix a corruption) because these +# files contain a corruption. +GDBINT_TEX_TMPS = gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \ + gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr* + # GDB INTERNALS MANUAL: TeX dvi file -gdbint.dvi: gdbint.texinfo gdb-cfg.texi fdl.texi +gdbint.dvi: $(GDBINT_DOC_FILES) + rm -f $(GDBINT_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdbint.texinfo - rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \ - gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr* gdbint.ps : gdbint.dvi $(DVIPS) -o $@ $? -gdbint.pdf: gdbint.texinfo gdb-cfg.texi fdl.texi +gdbint.pdf: $(GDBINT_DOC_FILES) + rm -f $(GDBINT_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdbint.texinfo - rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \ - gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr* # GDB INTERNALS MANUAL: info file -gdbint.info: gdbint.texinfo fdl.texi +gdbint.info: $(GDBINT_DOC_FILES) $(MAKEINFO) -I $(srcdir) -o gdbint.info $(srcdir)/gdbint.texinfo # GDB INTERNALS MANUAL: HTML file -gdbint_toc.html: gdbint.texinfo gdb-cfg.texi fdl.texi +gdbint_toc.html: $(GDBINT_DOC_FILES) $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo -stabs.info: stabs.texinfo +stabs.info: $(STABS_DOC_FILES) $(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo # STABS DOCUMENTATION: HTML file -stabs_toc.html: stabs.texinfo +stabs_toc.html: $(STABS_DOC_FILES) $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo +# Clean these up before each run. Avoids a catch 22 with not being +# able to re-generate these files (to fix a corruption) because these +# files contain a corruption. +STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \ + stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr* + # STABS DOCUMENTATION: TeX dvi file -stabs.dvi : stabs.texinfo +stabs.dvi : $(STABS_DOC_FILES) + rm -f $(STABS_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/stabs.texinfo - rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \ - stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr* stabs.ps: stabs.dvi $(DVIPS) -o $@ $? -stabs.pdf: stabs.dvi +stabs.pdf: $(STABS_DOC_FILES) + rm -f $(STABS_TEX_TMPS) $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/stabs.texinfo - rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \ - stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr* force: Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status $(SHELL) ./config.status + + +# The "least clean" level of cleaning. Get rid of files which are +# automatically generated files that are just intermediate files, + +mostlyclean: + rm -f gdb.mm gdb.ms gdb.me links2roff + rm -f $(GDB_TEX_TMPS) + rm -f $(GDBINT_TEX_TMPS) + rm -f $(STABS_TEX_TMPS) + rm -f sedref.dvi sedref.tex tmp.sed + +clean: mostlyclean + rm -f gdb-cfg.texi + +distclean: clean + rm -f Makefile config.status + +# GDBvn.texi, the dvi files, the info files, and the postscript files, +# are all part of the distribution, so it should not be removed by +# "clean" or "distclean". Use maintainer-clean to remove them. + +maintainer-clean realclean: distclean + rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf + diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 1072ed480fe..5a8ef7f1bf6 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -4414,6 +4414,7 @@ Table}. * Convenience Vars:: Convenience variables * Registers:: Registers * Floating Point Hardware:: Floating point hardware +* Vector Unit:: Vector Unit * Memory Region Attributes:: Memory region attributes * Dump/Restore Files:: Copy between memory and a file @end menu @@ -5579,6 +5580,20 @@ floating point chip. Currently, @samp{info float} is supported on the ARM and x86 machines. @end table +@node Vector Unit +@section Vector Unit +@cindex vector unit + +Depending on the configuration, @value{GDBN} may be able to give you +more information about the status of the vector unit. + +@table @code +@kindex info vector +@item info vector +Display information about the vector unit. The exact contents and +layout vary depending on the hardware. +@end table + @node Memory Region Attributes @section Memory region attributes @cindex memory region attributes @@ -14255,18 +14270,45 @@ Shared library events. @end table +@kindex maint print registers +@kindex maint print raw-registers +@kindex maint print cooked-registers +@item maint print registers +@itemx maint print raw-registers +@itemx maint print cooked-registers +Print @value{GDBN}'s internal register data structures. + +The command @samp{maint print raw-registers} includes the contents of +the raw register cache; and the command @samp{maint print +cooked-registers} includes the (cooked) value of all registers. +@xref{Registers,, Registers, gdbint, @value{GDBN} Internals}. + +Takes an optional file parameter. + @end table @node Remote Protocol @appendix @value{GDBN} Remote Serial Protocol +@menu +* Overview:: +* Packets:: +* Stop Reply Packets:: +* General Query Packets:: +* Register Packet Format:: +* Examples:: +@end menu + +@node Overview +@section Overview + There may be occasions when you need to know something about the protocol---for example, if there is only one serial port to your target machine, you might want your program to do something special if it recognizes a packet meant for @value{GDBN}. -In the examples below, @samp{<-} and @samp{->} are used to indicate +In the examples below, @samp{->} and @samp{<-} are used to indicate transmitted and received data respectfully. @cindex protocol, @value{GDBN} remote serial @@ -14308,8 +14350,8 @@ the package was received correctly) or @samp{-} (to request retransmission): @smallexample -<- @code{$}@var{packet-data}@code{#}@var{checksum} --> @code{+} +-> @code{$}@var{packet-data}@code{#}@var{checksum} +<- @code{+} @end smallexample @noindent @@ -14323,8 +14365,9 @@ exception of @samp{#} and @samp{$} (see @samp{X} packet for additional exceptions). Fields within the packet should be separated using @samp{,} @samp{;} or +@cindex remote protocol, field separator @samp{:}. Except where otherwise noted all numbers are represented in -HEX with leading zeros suppressed. +@sc{hex} with leading zeros suppressed. Implementors should note that prior to @value{GDBN} 5.0, the character @samp{:} could not appear as the third character in a packet (as it @@ -14361,166 +14404,179 @@ A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M}, @samp{c}, and @samp{s} @var{command}s. All other @var{command}s are optional. -Below is a complete list of all currently defined @var{command}s and -their corresponding response @var{data}: -@page -@multitable @columnfractions .30 .30 .40 -@item Packet -@tab Request -@tab Description - -@item extended mode -@tab @code{!} -@tab +@node Packets +@section Packets + +The following table provides a complete list of all currently defined +@var{command}s and their corresponding response @var{data}. + +@table @r + +@item @code{!} --- extended mode +@cindex @code{!} packet + Enable extended mode. In extended mode, the remote server is made persistent. The @samp{R} packet is used to restart the program being debugged. -@item -@tab reply @samp{OK} -@tab + +Reply: +@table @samp +@item OK The remote target both supports and has enabled extended mode. +@end table -@item last signal -@tab @code{?} -@tab -Indicate the reason the target halted. The reply is the same as for step -and continue. -@item -@tab reply -@tab see below +@item @code{?} --- last signal +@cindex @code{?} packet +Indicate the reason the target halted. The reply is the same as for +step and continue. -@item reserved -@tab @code{a} -@tab Reserved for future use +Reply: +@xref{Stop Reply Packets}, for the reply specifications. + +@item @code{a} --- reserved + +Reserved for future use. + +@item @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,@dots{}} --- set program arguments @strong{(reserved)} +@cindex @code{A} packet -@item set program arguments @strong{(reserved)} -@tab @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,...} -@tab -@item -@tab -@tab Initialized @samp{argv[]} array passed into program. @var{arglen} specifies the number of bytes in the hex encoded byte stream @var{arg}. -See @file{gdbserver} for more details. -@item -@tab reply @code{OK} -@item -@tab reply @code{E}@var{NN} - -@item set baud @strong{(deprecated)} -@tab @code{b}@var{baud} -@tab -Change the serial line speed to @var{baud}. JTC: @emph{When does the -transport layer state change? When it's received, or after the ACK is -transmitted. In either case, there are problems if the command or the -acknowledgment packet is dropped.} Stan: @emph{If people really wanted -to add something like this, and get it working for the first time, they -ought to modify ser-unix.c to send some kind of out-of-band message to a -specially-setup stub and have the switch happen "in between" packets, so -that from remote protocol's point of view, nothing actually -happened.} - -@item set breakpoint @strong{(deprecated)} -@tab @code{B}@var{addr},@var{mode} -@tab +See @code{gdbserver} for more details. + +Reply: +@table @samp +@item OK +@item E@var{NN} +@end table + +@item @code{b}@var{baud} --- set baud @strong{(deprecated)} +@cindex @code{b} packet + +Change the serial line speed to @var{baud}. + +JTC: @emph{When does the transport layer state change? When it's +received, or after the ACK is transmitted. In either case, there are +problems if the command or the acknowledgment packet is dropped.} + +Stan: @emph{If people really wanted to add something like this, and get +it working for the first time, they ought to modify ser-unix.c to send +some kind of out-of-band message to a specially-setup stub and have the +switch happen "in between" packets, so that from remote protocol's point +of view, nothing actually happened.} + +@item @code{B}@var{addr},@var{mode} --- set breakpoint @strong{(deprecated)} +@cindex @code{B} packet + Set (@var{mode} is @samp{S}) or clear (@var{mode} is @samp{C}) a -breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z} and -@samp{z} packets.} +breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z} +and @samp{z} packets.} + +@item @code{c}@var{addr} --- continue +@cindex @code{c} packet -@item continue -@tab @code{c}@var{addr} -@tab -@var{addr} is address to resume. If @var{addr} is omitted, resume at +@var{addr} is address to resume. If @var{addr} is omitted, resume at current address. -@item -@tab reply -@tab see below -@item continue with signal -@tab @code{C}@var{sig}@code{;}@var{addr} -@tab +Reply: +@xref{Stop Reply Packets}, for the reply specifications. + +@item @code{C}@var{sig}@code{;}@var{addr} --- continue with signal +@cindex @code{C} packet + Continue with signal @var{sig} (hex signal number). If @code{;}@var{addr} is omitted, resume at same address. -@item -@tab reply -@tab see below -@item toggle debug @strong{(deprecated)} -@tab @code{d} -@tab -toggle debug flag. +Reply: +@xref{Stop Reply Packets}, for the reply specifications. -@item detach -@tab @code{D} -@tab -Detach @value{GDBN} from the remote system. Sent to the remote target before -@value{GDBN} disconnects. -@item -@tab reply @emph{no response} -@tab +@item @code{d} --- toggle debug @strong{(deprecated)} +@cindex @code{d} packet + +Toggle debug flag. + +@item @code{D} --- detach +@cindex @code{D} packet + +Detach @value{GDBN} from the remote system. Sent to the remote target +before @value{GDBN} disconnects. + +Reply: +@table @samp +@item @emph{no response} @value{GDBN} does not check for any response after sending this packet. +@end table -@item reserved -@tab @code{e} -@tab Reserved for future use +@item @code{e} --- reserved -@item reserved -@tab @code{E} -@tab Reserved for future use +Reserved for future use. -@item reserved -@tab @code{f} -@tab Reserved for future use +@item @code{E} --- reserved -@item reserved -@tab @code{F} -@tab Reserved for future use +Reserved for future use. -@item read registers -@tab @code{g} -@tab Read general registers. -@item -@tab reply @var{XX...} -@tab +@item @code{f} --- reserved + +Reserved for future use. + +@item @code{F} --- reserved + +Reserved for future use. + +@item @code{g} --- read registers +@anchor{read registers packet} +@cindex @code{g} packet + +Read general registers. + +Reply: +@table @samp +@item @var{XX@dots{}} Each byte of register data is described by two hex digits. The bytes with the register are transmitted in target byte order. The size of each register and their position within the @samp{g} @var{packet} are -determined by the @value{GDBN} internal macros @var{REGISTER_RAW_SIZE} and -@var{REGISTER_NAME} macros. The specification of several standard +determined by the @value{GDBN} internal macros @var{REGISTER_RAW_SIZE} +and @var{REGISTER_NAME} macros. The specification of several standard @code{g} packets is specified below. -@item -@tab @code{E}@var{NN} -@tab for an error. +@item E@var{NN} +for an error. +@end table -@item write regs -@tab @code{G}@var{XX...} -@tab -See @samp{g} for a description of the @var{XX...} data. -@item -@tab reply @code{OK} -@tab for success -@item -@tab reply @code{E}@var{NN} -@tab for an error +@item @code{G}@var{XX@dots{}} --- write regs +@cindex @code{G} packet + +@xref{read registers packet}, for a description of the @var{XX@dots{}} +data. -@item reserved -@tab @code{h} -@tab Reserved for future use +Reply: +@table @samp +@item OK +for success +@item E@var{NN} +for an error +@end table + +@item @code{h} --- reserved + +Reserved for future use. + +@item @code{H}@var{c}@var{t@dots{}} --- set thread +@cindex @code{H} packet -@item set thread -@tab @code{H}@var{c}@var{t...} -@tab Set thread for subsequent operations (@samp{m}, @samp{M}, @samp{g}, -@samp{G}, et.al.). @var{c} = @samp{c} for thread used in step and -continue; @var{t...} can be -1 for all threads. @var{c} = @samp{g} for -thread used in other operations. If zero, pick a thread, any thread. -@item -@tab reply @code{OK} -@tab for success -@item -@tab reply @code{E}@var{NN} -@tab for an error +@samp{G}, et.al.). @var{c} depends on the operation to be performed: it +should be @samp{c} for step and continue operations, @samp{g} for other +operations. The thread designator @var{t@dots{}} may be -1, meaning all +the threads, a thread number, or zero which means pick any thread. + +Reply: +@table @samp +@item OK +for success +@item E@var{NN} +for an error +@end table @c FIXME: JTC: @c 'H': How restrictive (or permissive) is the thread model. If a @@ -14537,262 +14593,289 @@ thread used in other operations. If zero, pick a thread, any thread. @c selected, sets the registers of the register block of @c that thread; otherwise sets current registers. -@item cycle step @strong{(draft)} -@tab @code{i}@var{addr}@code{,}@var{nnn} -@tab +@item @code{i}@var{addr}@code{,}@var{nnn} --- cycle step @strong{(draft)} +@anchor{cycle step packet} +@cindex @code{i} packet + Step the remote target by a single clock cycle. If @code{,}@var{nnn} is present, cycle step @var{nnn} cycles. If @var{addr} is present, cycle step starting at that address. -@item signal then cycle step @strong{(reserved)} -@tab @code{I} -@tab -See @samp{i} and @samp{S} for likely syntax and semantics. +@item @code{I} --- signal then cycle step @strong{(reserved)} +@cindex @code{I} packet + +@xref{step with signal packet}. @xref{cycle step packet}. + +@item @code{j} --- reserved + +Reserved for future use. -@item reserved -@tab @code{j} -@tab Reserved for future use +@item @code{J} --- reserved -@item reserved -@tab @code{J} -@tab Reserved for future use +Reserved for future use. + +@item @code{k} --- kill request +@cindex @code{k} packet -@item kill request -@tab @code{k} -@tab FIXME: @emph{There is no description of how to operate when a specific -thread context has been selected (i.e.@: does 'k' kill only that thread?)}. +thread context has been selected (i.e.@: does 'k' kill only that +thread?)}. + +@item @code{K} --- reserved + +Reserved for future use. + +@item @code{l} --- reserved -@item reserved -@tab @code{l} -@tab Reserved for future use +Reserved for future use. -@item reserved -@tab @code{L} -@tab Reserved for future use +@item @code{L} --- reserved + +Reserved for future use. + +@item @code{m}@var{addr}@code{,}@var{length} --- read memory +@cindex @code{m} packet -@item read memory -@tab @code{m}@var{addr}@code{,}@var{length} -@tab Read @var{length} bytes of memory starting at address @var{addr}. -Neither @value{GDBN} nor the stub assume that sized memory transfers are assumed -using word alligned accesses. FIXME: @emph{A word aligned memory +Neither @value{GDBN} nor the stub assume that sized memory transfers are +assumed using word alligned accesses. FIXME: @emph{A word aligned memory transfer mechanism is needed.} -@item -@tab reply @var{XX...} -@tab -@var{XX...} is mem contents. Can be fewer bytes than requested if able -to read only part of the data. Neither @value{GDBN} nor the stub assume that -sized memory transfers are assumed using word alligned accesses. FIXME: -@emph{A word aligned memory transfer mechanism is needed.} -@item -@tab reply @code{E}@var{NN} -@tab @var{NN} is errno -@item write mem -@tab @code{M}@var{addr},@var{length}@code{:}@var{XX...} -@tab +Reply: +@table @samp +@item @var{XX@dots{}} +@var{XX@dots{}} is mem contents. Can be fewer bytes than requested if able +to read only part of the data. Neither @value{GDBN} nor the stub assume +that sized memory transfers are assumed using word alligned +accesses. FIXME: @emph{A word aligned memory transfer mechanism is +needed.} +@item E@var{NN} +@var{NN} is errno +@end table + +@item @code{M}@var{addr},@var{length}@code{:}@var{XX@dots{}} --- write mem +@cindex @code{M} packet + Write @var{length} bytes of memory starting at address @var{addr}. -@var{XX...} is the data. -@item -@tab reply @code{OK} -@tab for success -@item -@tab reply @code{E}@var{NN} -@tab +@var{XX@dots{}} is the data. + +Reply: +@table @samp +@item OK +for success +@item E@var{NN} for an error (this includes the case where only part of the data was written). +@end table -@item reserved -@tab @code{n} -@tab Reserved for future use +@item @code{n} --- reserved -@item reserved -@tab @code{N} -@tab Reserved for future use +Reserved for future use. -@item reserved -@tab @code{o} -@tab Reserved for future use +@item @code{N} --- reserved -@item reserved -@tab @code{O} -@tab Reserved for future use +Reserved for future use. -@item read reg @strong{(reserved)} -@tab @code{p}@var{n...} -@tab -See write register. -@item -@tab return @var{r....} -@tab The hex encoded value of the register in target byte order. +@item @code{o} --- reserved + +Reserved for future use. + +@item @code{O} --- reserved + +Reserved for future use. -@item write reg -@tab @code{P}@var{n...}@code{=}@var{r...} -@tab -Write register @var{n...} with value @var{r...}, which contains two hex +@item @code{p}@var{n@dots{}} --- read reg @strong{(reserved)} +@cindex @code{p} packet + +@xref{write register packet}. + +Reply: +@table @samp +@item @var{r@dots{}.} +The hex encoded value of the register in target byte order. +@end table + +@item @code{P}@var{n@dots{}}@code{=}@var{r@dots{}} --- write register +@anchor{write register packet} +@cindex @code{P} packet + +Write register @var{n@dots{}} with value @var{r@dots{}}, which contains two hex digits for each byte in the register (target byte order). -@item -@tab reply @code{OK} -@tab for success -@item -@tab reply @code{E}@var{NN} -@tab for an error -@item general query -@tab @code{q}@var{query} -@tab -Request info about @var{query}. In general @value{GDBN} queries -have a leading upper case letter. Custom vendor queries should use a -company prefix (in lower case) ex: @samp{qfsf.var}. @var{query} may -optionally be followed by a @samp{,} or @samp{;} separated list. Stubs -must ensure that they match the full @var{query} name. -@item -@tab reply @code{XX...} -@tab Hex encoded data from query. The reply can not be empty. -@item -@tab reply @code{E}@var{NN} -@tab error reply +Reply: +@table @samp +@item OK +for success +@item E@var{NN} +for an error +@end table + +@item @code{q}@var{query} --- general query +@anchor{general query packet} +@cindex @code{q} packet + +Request info about @var{query}. In general @value{GDBN} queries have a +leading upper case letter. Custom vendor queries should use a company +prefix (in lower case) ex: @samp{qfsf.var}. @var{query} may optionally +be followed by a @samp{,} or @samp{;} separated list. Stubs must ensure +that they match the full @var{query} name. + +Reply: +@table @samp +@item @var{XX@dots{}} +Hex encoded data from query. The reply can not be empty. +@item E@var{NN} +error reply @item -@tab reply @samp{} -@tab Indicating an unrecognized @var{query}. +Indicating an unrecognized @var{query}. +@end table + +@item @code{Q}@var{var}@code{=}@var{val} --- general set +@cindex @code{Q} packet + +Set value of @var{var} to @var{val}. -@item general set -@tab @code{Q}@var{var}@code{=}@var{val} -@tab -Set value of @var{var} to @var{val}. See @samp{q} for a discussing of -naming conventions. +@xref{general query packet}, for a discussion of naming conventions. + +@item @code{r} --- reset @strong{(deprecated)} +@cindex @code{r} packet -@item reset @strong{(deprecated)} -@tab @code{r} -@tab Reset the entire system. -@item remote restart -@tab @code{R}@var{XX} -@tab +@item @code{R}@var{XX} --- remote restart +@cindex @code{R} packet + Restart the program being debugged. @var{XX}, while needed, is ignored. This packet is only available in extended mode. -@item -@tab -no reply -@tab + +Reply: +@table @samp +@item @emph{no reply} The @samp{R} packet has no reply. +@end table + +@item @code{s}@var{addr} --- step +@cindex @code{s} packet -@item step -@tab @code{s}@var{addr} -@tab @var{addr} is address to resume. If @var{addr} is omitted, resume at same address. -@item -@tab reply -@tab see below -@item step with signal -@tab @code{S}@var{sig}@code{;}@var{addr} -@tab +Reply: +@xref{Stop Reply Packets}, for the reply specifications. + +@item @code{S}@var{sig}@code{;}@var{addr} --- step with signal +@anchor{step with signal packet} +@cindex @code{S} packet + Like @samp{C} but step not continue. -@item -@tab reply -@tab see below -@item search -@tab @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} -@tab +Reply: +@xref{Stop Reply Packets}, for the reply specifications. + +@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search +@cindex @code{t} packet + Search backwards starting at address @var{addr} for a match with pattern -@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4 -bytes. @var{addr} must be at least 3 digits. +@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4 bytes. +@var{addr} must be at least 3 digits. -@item thread alive -@tab @code{T}@var{XX} -@tab Find out if the thread XX is alive. -@item -@tab reply @code{OK} -@tab thread is still alive -@item -@tab reply @code{E}@var{NN} -@tab thread is dead +@item @code{T}@var{XX} --- thread alive +@cindex @code{T} packet -@item reserved -@tab @code{u} -@tab Reserved for future use +Find out if the thread XX is alive. -@item reserved -@tab @code{U} -@tab Reserved for future use +Reply: +@table @samp +@item OK +thread is still alive +@item E@var{NN} +thread is dead +@end table + +@item @code{u} --- reserved + +Reserved for future use. + +@item @code{U} --- reserved + +Reserved for future use. + +@item @code{v} --- reserved + +Reserved for future use. + +@item @code{V} --- reserved -@item reserved -@tab @code{v} -@tab Reserved for future use +Reserved for future use. -@item reserved -@tab @code{V} -@tab Reserved for future use +@item @code{w} --- reserved -@item reserved -@tab @code{w} -@tab Reserved for future use +Reserved for future use. -@item reserved -@tab @code{W} -@tab Reserved for future use +@item @code{W} --- reserved -@item reserved -@tab @code{x} -@tab Reserved for future use +Reserved for future use. -@item write mem (binary) -@tab @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX...} -@tab -@var{addr} is address, @var{length} is number of bytes, @var{XX...} is -binary data. The characters @code{$}, @code{#}, and @code{0x7d} are +@item @code{x} --- reserved + +Reserved for future use. + +@item @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX@dots{}} --- write mem (binary) +@cindex @code{X} packet + +@var{addr} is address, @var{length} is number of bytes, @var{XX@dots{}} +is binary data. The characters @code{$}, @code{#}, and @code{0x7d} are escaped using @code{0x7d}. -@item -@tab reply @code{OK} -@tab for success -@item -@tab reply @code{E}@var{NN} -@tab for an error -@item reserved -@tab @code{y} -@tab Reserved for future use +Reply: +@table @samp +@item OK +for success +@item E@var{NN} +for an error +@end table + +@item @code{y} --- reserved + +Reserved for future use. -@item reserved -@tab @code{Y} -@tab Reserved for future use +@item @code{Y} reserved -@item remove break or watchpoint @strong{(draft)} -@tab @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length} -@tab -See @samp{Z}. +Reserved for future use. + +@item @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length} --- remove break or watchpoint @strong{(draft)} +@cindex @code{z} packet + +@xref{insert breakpoint or watchpoint packet}. + +@item @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length} --- insert break or watchpoint @strong{(draft)} +@anchor{insert breakpoint or watchpoint packet} +@cindex @code{Z} packet -@item insert break or watchpoint @strong{(draft)} -@tab @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length} -@tab @var{t} is type: @samp{0} - software breakpoint, @samp{1} - hardware -breakpoint, @samp{2} - write watchpoint, @samp{3} - read watchpoint, +breakpoint, @samp{2} --- write watchpoint, @samp{3} - read watchpoint, @samp{4} - access watchpoint; @var{addr} is address; @var{length} is in bytes. For a software breakpoint, @var{length} specifies the size of the instruction to be patched. For hardware breakpoints and watchpoints @var{length} specifies the memory region to be monitored. To avoid potential problems with duplicate packets, the operations should be implemented in an idempotent way. -@item -@tab reply @code{E}@var{NN} -@tab for an error -@item -@tab reply @code{OK} -@tab for success -@item -@tab @samp{} -@tab If not supported. -@item reserved -@tab -@tab Reserved for future use +Reply: +@table @samp +@item E@var{NN} +for an error +@item OK +for success +@item @samp{} +If not supported. +@end table -@end multitable +@end table + +@node Stop Reply Packets +@section Stop Reply Packets +@cindex stop reply packets The @samp{C}, @samp{c}, @samp{S}, @samp{s} and @samp{?} packets can receive any of the below as a reply. In the case of the @samp{C}, @@ -14801,13 +14884,14 @@ when the target halts. In the below the exact meaning of @samp{signal number} is poorly defined. In general one of the UNIX signal numbering conventions is used. -@multitable @columnfractions .4 .6 +@table @samp -@item @code{S}@var{AA} -@tab @var{AA} is the signal number +@item S@var{AA} +@var{AA} is the signal number @item @code{T}@var{AA}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;} -@tab +@cindex @code{T} packet reply + @var{AA} = two hex digit signal number; @var{n...} = register number (hex), @var{r...} = target byte ordered register contents, size defined by @code{REGISTER_RAW_SIZE}; @var{n...} = @samp{thread}, @var{r...} = @@ -14817,295 +14901,270 @@ integer; @var{n...} = other string not starting with valid hex digit. @value{GDBN} should ignore this @var{n...}, @var{r...} pair and go on to the next. This way we can extend the protocol. -@item @code{W}@var{AA} -@tab +@item W@var{AA} + The process exited, and @var{AA} is the exit status. This is only -applicable for certains sorts of targets. +applicable to certain targets. + +@item X@var{AA} -@item @code{X}@var{AA} -@tab The process terminated with signal @var{AA}. -@item @code{N}@var{AA}@code{;}@var{t...}@code{;}@var{d...}@code{;}@var{b...} @strong{(obsolete)} -@tab -@var{AA} = signal number; @var{t...} = address of symbol "_start"; -@var{d...} = base of data section; @var{b...} = base of bss section. -@emph{Note: only used by Cisco Systems targets. The difference between -this reply and the "qOffsets" query is that the 'N' packet may arrive -spontaneously whereas the 'qOffsets' is a query initiated by the host -debugger.} +@item N@var{AA};@var{t@dots{}};@var{d@dots{}};@var{b@dots{}} @strong{(obsolete)} + +@var{AA} = signal number; @var{t@dots{}} = address of symbol +@code{_start}; @var{d@dots{}} = base of data section; @var{b@dots{}} = +base of bss section. @emph{Note: only used by Cisco Systems targets. +The difference between this reply and the @samp{qOffsets} query is that +the @samp{N} packet may arrive spontaneously whereas the @samp{qOffsets} +is a query initiated by the host debugger.} + +@item O@var{XX@dots{}} + +@var{XX@dots{}} is hex encoding of @sc{ascii} data. This can happen at +any time while the program is running and the debugger should continue +to wait for @samp{W}, @samp{T}, etc. -@item @code{O}@var{XX...} -@tab -@var{XX...} is hex encoding of @sc{ascii} data. This can happen at any time -while the program is running and the debugger should continue to wait -for 'W', 'T', etc. +@end table -@end multitable +@node General Query Packets +@section General Query Packets The following set and query packets have already been defined. -@multitable @columnfractions .2 .2 .6 +@table @r + +@item @code{q}@code{C} --- current thread -@item current thread -@tab @code{q}@code{C} -@tab Return the current thread id. -@item -@tab reply @code{QC}@var{pid} -@tab +Return the current thread id. + +Reply: +@table @samp +@item @code{QC}@var{pid} Where @var{pid} is a HEX encoded 16 bit process id. -@item -@tab reply * -@tab Any other reply implies the old pid. +@item * +Any other reply implies the old pid. +@end table + +@item @code{q}@code{fThreadInfo} -- all thread ids + +@code{q}@code{sThreadInfo} -@item all thread ids -@tab @code{q}@code{fThreadInfo} -@item -@tab @code{q}@code{sThreadInfo} -@tab Obtain a list of active thread ids from the target (OS). Since there may be too many active threads to fit into one reply packet, this query works iteratively: it may require more than one query/reply sequence to obtain the entire list of threads. The first query of the sequence will be the @code{qf}@code{ThreadInfo} query; subsequent queries in the sequence will be the @code{qs}@code{ThreadInfo} query. -@item -@tab -@tab NOTE: replaces the @code{qL} query (see below). -@item -@tab reply @code{m}@var{} -@tab A single thread id -@item -@tab reply @code{m}@var{},@var{...} -@tab a comma-separated list of thread ids -@item -@tab reply @code{l} -@tab (lower case 'el') denotes end of list. -@item -@tab -@tab -In response to each query, the target will reply with a list of one -or more thread ids, in big-endian hex, separated by commas. GDB will -respond to each reply with a request for more thread ids (using the + +NOTE: replaces the @code{qL} query (see below). + +Reply: +@table @samp +@item @code{m}@var{id} +A single thread id +@item @code{m}@var{id},@var{id}@dots{} +a comma-separated list of thread ids +@item @code{l} +(lower case 'el') denotes end of list. +@end table + +In response to each query, the target will reply with a list of one or +more thread ids, in big-endian hex, separated by commas. @value{GDBN} +will respond to each reply with a request for more thread ids (using the @code{qs} form of the query), until the target responds with @code{l} (lower-case el, for @code{'last'}). -@item extra thread info -@tab @code{q}@code{ThreadExtraInfo}@code{,}@var{id} -@tab -@item -@tab -@tab -Where @var{} is a thread-id in big-endian hex. -Obtain a printable string description of a thread's attributes from -the target OS. This string may contain anything that the target OS -thinks is interesting for @value{GDBN} to tell the user about the thread. -The string is displayed in @value{GDBN}'s @samp{info threads} display. -Some examples of possible thread extra info strings are "Runnable", or -"Blocked on Mutex". -@item -@tab reply @var{XX...} -@tab -Where @var{XX...} is a hex encoding of @sc{ascii} data, comprising the -printable string containing the extra information about the thread's +@item @code{q}@code{ThreadExtraInfo}@code{,}@var{id} --- extra thread info + +Where @var{id} is a thread-id in big-endian hex. Obtain a printable +string description of a thread's attributes from the target OS. This +string may contain anything that the target OS thinks is interesting for +@value{GDBN} to tell the user about the thread. The string is displayed +in @value{GDBN}'s @samp{info threads} display. Some examples of +possible thread extra info strings are ``Runnable'', or ``Blocked on +Mutex''. + +Reply: +@table @samp +@item @var{XX@dots{}} +Where @var{XX@dots{}} is a hex encoding of @sc{ascii} data, comprising +the printable string containing the extra information about the thread's attributes. +@end table + +@item @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread} --- query @var{LIST} or @var{threadLIST} @strong{(deprecated)} -@item query @var{LIST} or @var{threadLIST} @strong{(deprecated)} -@tab @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread} -@tab -@item -@tab -@tab Obtain thread information from RTOS. Where: @var{startflag} (one hex digit) is one to indicate the first query and zero to indicate a subsequent query; @var{threadcount} (two hex digits) is the maximum number of threads the response packet can contain; and @var{nextthread} (eight hex digits), for subsequent queries (@var{startflag} is zero), is returned in the response as @var{argthread}. -@item -@tab -@tab NOTE: this query is replaced by the @code{q}@code{fThreadInfo} -query (see above). -@item -@tab reply @code{q}@code{M}@var{count}@var{done}@var{argthread}@var{thread...} -@tab -@item -@tab -@tab + +NOTE: this query is replaced by the @code{q}@code{fThreadInfo} query +(see above). + +Reply: +@table @samp +@item @code{q}@code{M}@var{count}@var{done}@var{argthread}@var{thread@dots{}} Where: @var{count} (two hex digits) is the number of threads being returned; @var{done} (one hex digit) is zero to indicate more threads and one indicates no further threads; @var{argthreadid} (eight hex -digits) is @var{nextthread} from the request packet; @var{thread...} is -a sequence of thread IDs from the target. @var{threadid} (eight hex +digits) is @var{nextthread} from the request packet; @var{thread@dots{}} +is a sequence of thread IDs from the target. @var{threadid} (eight hex digits). See @code{remote.c:parse_threadlist_response()}. +@end table -@item compute CRC of memory block -@tab @code{q}@code{CRC:}@var{addr}@code{,}@var{length} -@tab -@item -@tab reply @code{E}@var{NN} -@tab An error (such as memory fault) -@item -@tab reply @code{C}@var{CRC32} -@tab A 32 bit cyclic redundancy check of the specified memory region. +@item @code{q}@code{CRC:}@var{addr}@code{,}@var{length} --- compute CRC of memory block + +Reply: +@table @samp +@item @code{E}@var{NN} +An error (such as memory fault) +@item @code{C}@var{CRC32} +A 32 bit cyclic redundancy check of the specified memory region. +@end table + +@item @code{q}@code{Offsets} --- query sect offs -@item query sect offs -@tab @code{q}@code{Offsets} -@tab Get section offsets that the target used when re-locating the downloaded image. @emph{Note: while a @code{Bss} offset is included in the response, @value{GDBN} ignores this and instead applies the @code{Data} offset to the @code{Bss} section.} -@item -@tab reply @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz} -@item thread info request -@tab @code{q}@code{P}@var{mode}@var{threadid} -@tab -@item -@tab -@tab +Reply: +@table @samp +@item @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz} +@end table + +@item @code{q}@code{P}@var{mode}@var{threadid} --- thread info request + Returns information on @var{threadid}. Where: @var{mode} is a hex encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID. -@item -@tab reply * -@tab + +Reply: +@table @samp +@item * +@end table + See @code{remote.c:remote_unpack_thread_info_response()}. -@item remote command -@tab @code{q}@code{Rcmd,}@var{COMMAND} -@tab -@item -@tab -@tab -@var{COMMAND} (hex encoded) is passed to the local interpreter for +@item @code{q}@code{Rcmd,}@var{command} --- remote command + +@var{command} (hex encoded) is passed to the local interpreter for execution. Invalid commands should be reported using the output string. Before the final result packet, the target may also respond with a -number of intermediate @code{O}@var{OUTPUT} console output -packets. @emph{Implementors should note that providing access to a -stubs's interpreter may have security implications}. -@item -@tab reply @code{OK} -@tab +number of intermediate @code{O}@var{output} console output packets. +@emph{Implementors should note that providing access to a stubs's +interpreter may have security implications}. + +Reply: +@table @samp +@item OK A command response with no output. -@item -@tab reply @var{OUTPUT} -@tab +@item @var{OUTPUT} A command response with the hex encoded output string @var{OUTPUT}. -@item -@tab reply @code{E}@var{NN} -@tab +@item @code{E}@var{NN} Indicate a badly formed request. - -@item -@tab reply @samp{} -@tab +@item @samp{} When @samp{q}@samp{Rcmd} is not recognized. +@end table + +@item @code{qSymbol::} --- symbol lookup -@item symbol lookup -@tab @code{qSymbol::} -@tab Notify the target that @value{GDBN} is prepared to serve symbol lookup requests. Accept requests from the target for the values of symbols. -@item -@tab -@tab -@item -@tab reply @code{OK} -@tab + +Reply: +@table @samp +@item @code{OK} The target does not need to look up any (more) symbols. -@item -@tab reply @code{qSymbol:}@var{sym_name} -@tab -@sp 2 -@noindent -The target requests the value of symbol @var{sym_name} (hex encoded). -@value{GDBN} may provide the value by using the -@code{qSymbol:}@var{sym_value}:@var{sym_name} -message, described below. - -@item symbol value -@tab @code{qSymbol:}@var{sym_value}:@var{sym_name} -@tab -@sp 1 -@noindent -Set the value of SYM_NAME to SYM_VALUE. -@item -@tab -@tab -@var{sym_name} (hex encoded) is the name of a symbol whose value -the target has previously requested. -@item -@tab -@tab -@var{sym_value} (hex) is the value for symbol @var{sym_name}. -If @value{GDBN} cannot supply a value for @var{sym_name}, then this -field will be empty. -@item -@tab reply @code{OK} -@tab +@item @code{qSymbol:}@var{sym_name} +The target requests the value of symbol @var{sym_name} (hex encoded). +@value{GDBN} may provide the value by using the +@code{qSymbol:}@var{sym_value}:@var{sym_name} message, described below. +@end table + +@item @code{qSymbol:}@var{sym_value}:@var{sym_name} --- symbol value + +Set the value of @var{sym_name} to @var{sym_value}. + +@var{sym_name} (hex encoded) is the name of a symbol whose value the +target has previously requested. + +@var{sym_value} (hex) is the value for symbol @var{sym_name}. If +@value{GDBN} cannot supply a value for @var{sym_name}, then this field +will be empty. + +Reply: +@table @samp +@item @code{OK} The target does not need to look up any (more) symbols. -@item -@tab reply @code{qSymbol:}@var{sym_name} -@tab -@sp 2 -@noindent -The target requests the value of a new symbol @var{sym_name} (hex encoded). -@value{GDBN} will continue to supply the values of symbols (if available), -until the target ceases to request them. +@item @code{qSymbol:}@var{sym_name} +The target requests the value of a new symbol @var{sym_name} (hex +encoded). @value{GDBN} will continue to supply the values of symbols +(if available), until the target ceases to request them. +@end table + +@end table -@end multitable +@node Register Packet Format +@section Register Packet Format The following @samp{g}/@samp{G} packets have previously been defined. -In the below, some thirty-two bit registers are transferred as sixty-four -bits. Those registers should be zero/sign extended (which?) to fill the -space allocated. Register bytes are transfered in target byte order. -The two nibbles within a register byte are transfered most-significant - -least-significant. +In the below, some thirty-two bit registers are transferred as +sixty-four bits. Those registers should be zero/sign extended (which?) +to fill the space allocated. Register bytes are transfered in target +byte order. The two nibbles within a register byte are transfered +most-significant - least-significant. -@multitable @columnfractions .5 .5 +@table @r @item MIPS32 -@tab + All registers are transfered as thirty-two bit quantities in the order: 32 general-purpose; sr; lo; hi; bad; cause; pc; 32 floating-point registers; fsr; fir; fp. @item MIPS64 -@tab + All registers are transfered as sixty-four bit quantities (including thirty-two bit registers such as @code{sr}). The ordering is the same as @code{MIPS32}. -@end multitable +@end table + +@node Examples +@section Examples Example sequence of a target being re-started. Notice how the restart does not get any direct output: @smallexample -<- @code{R00} --> @code{+} +-> @code{R00} +<- @code{+} @emph{target restarts} -<- @code{?} --> @code{+} --> @code{T001:1234123412341234} +-> @code{?} <- @code{+} +<- @code{T001:1234123412341234} +-> @code{+} @end smallexample Example sequence of a target being stepped by a single instruction: @smallexample -<- @code{G1445...} --> @code{+} -<- @code{s} --> @code{+} -@emph{time passes} --> @code{T001:1234123412341234} +-> @code{G1445@dots{}} <- @code{+} -<- @code{g} +-> @code{s} +<- @code{+} +@emph{time passes} +<- @code{T001:1234123412341234} -> @code{+} --> @code{1455...} +-> @code{g} <- @code{+} +<- @code{1455@dots{}} +-> @code{+} @end smallexample @include gpl.texi diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 433844aa004..a5f4de503ca 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3094,11 +3094,31 @@ library in which breakpoints cannot be set and so should be disabled. @findex DO_REGISTERS_INFO If defined, use this to print the value of a register or all registers. +This method is deprecated. + @item PRINT_FLOAT_INFO() -#findex PRINT_FLOAT_INFO +@findex PRINT_FLOAT_INFO If defined, then the @samp{info float} command will print information about the processor's floating point unit. +@item print_registers_info (@var{gdbarch}, @var{frame}, @var{regnum}, @var{all}) +@findex print_registers_info +If defined, pretty print the value of the register @var{regnum} for the +specified @var{frame}. If the value of @var{regnum} is -1, pretty print +either all registers (@var{all} is non zero) or a select subset of +registers (@var{all} is zero). + +The default method prints one register per line, and if @var{all} is +zero omits floating-point registers. + +@item PRINT_VECTOR_INFO() +@findex PRINT_VECTOR_INFO +If defined, then the @samp{info vector} command will call this function +to print information about the processor's vector unit. + +By default, the @samp{info vector} command will print all vector +registers (the register's type having the vector attribute). + @item DWARF_REG_TO_REGNUM @findex DWARF_REG_TO_REGNUM Convert DWARF register number into @value{GDBN} regnum. If not defined, @@ -3681,10 +3701,11 @@ delay slot. If a breakpoint has been placed in the instruction's delay slot, @value{GDBN} will single-step over that instruction before resuming normally. Currently only defined for the Mips. -@item STORE_RETURN_VALUE (@var{type}, @var{valbuf}) +@item STORE_RETURN_VALUE (@var{type}, @var{regcache}, @var{valbuf}) @findex STORE_RETURN_VALUE -A C expression that stores a function return value of type @var{type}, -where @var{valbuf} is the address of the value to be stored. +A C expression that writes the function return value, found in +@var{valbuf}, into the @var{regcache}. @var{type} is the type of the +value that is to be returned. @item SUN_FIXED_LBRAC_BUG @findex SUN_FIXED_LBRAC_BUG diff --git a/gdb/dst.h b/gdb/dst.h index b72c58c9653..89ad9eca09f 100644 --- a/gdb/dst.h +++ b/gdb/dst.h @@ -1,1671 +1,1671 @@ -/* */ -/* Apollo object module DST (debug symbol table) description */ - -#ifndef apollo_dst_h -#define apollo_dst_h - -#if defined(apollo) && !defined(__GNUC__) -#define ALIGNED1 __attribute( (aligned(1)) ) -#else -/* Remove attribute directives from non-Apollo code: */ -#define ALIGNED1 /* nil */ -#endif - - - -/* Identification of this version of the debug symbol table. Producers of the - debug symbol table must write these values into the version number field of - the compilation unit record in .blocks . - */ -#define dst_version_major 1 -#define dst_version_minor 3 - - -/* - ** Enumeration of debug record types appearing in .blocks and .symbols ... - */ -typedef enum - { - dst_typ_pad, /* 0 */ - dst_typ_comp_unit, /* 1 */ - dst_typ_section_tab, /* 2 */ - dst_typ_file_tab, /* 3 */ - dst_typ_block, /* 4 */ - dst_typ_5, - dst_typ_var, - dst_typ_pointer, /* 7 */ - dst_typ_array, /* 8 */ - dst_typ_subrange, /* 9 */ - dst_typ_set, /* 10 */ - dst_typ_implicit_enum, /* 11 */ - dst_typ_explicit_enum, /* 12 */ - dst_typ_short_rec, /* 13 */ - dst_typ_old_record, - dst_typ_short_union, /* 15 */ - dst_typ_old_union, - dst_typ_file, /* 17 */ - dst_typ_offset, /* 18 */ - dst_typ_alias, /* 19 */ - dst_typ_signature, /* 20 */ - dst_typ_21, - dst_typ_old_label, /* 22 */ - dst_typ_scope, /* 23 */ - dst_typ_end_scope, /* 24 */ - dst_typ_25, - dst_typ_26, - dst_typ_string_tab, /* 27 */ - dst_typ_global_name_tab, /* 28 */ - dst_typ_forward, /* 29 */ - dst_typ_aux_size, /* 30 */ - dst_typ_aux_align, /* 31 */ - dst_typ_aux_field_size, /* 32 */ - dst_typ_aux_field_off, /* 33 */ - dst_typ_aux_field_align, /* 34 */ - dst_typ_aux_qual, /* 35 */ - dst_typ_aux_var_bound, /* 36 */ - dst_typ_extension, /* 37 */ - dst_typ_string, /* 38 */ - dst_typ_old_entry, - dst_typ_const, /* 40 */ - dst_typ_reference, /* 41 */ - dst_typ_record, /* 42 */ - dst_typ_union, /* 43 */ - dst_typ_aux_type_deriv, /* 44 */ - dst_typ_locpool, /* 45 */ - dst_typ_variable, /* 46 */ - dst_typ_label, /* 47 */ - dst_typ_entry, /* 48 */ - dst_typ_aux_lifetime, /* 49 */ - dst_typ_aux_ptr_base, /* 50 */ - dst_typ_aux_src_range, /* 51 */ - dst_typ_aux_reg_val, /* 52 */ - dst_typ_aux_unit_names, /* 53 */ - dst_typ_aux_sect_info, /* 54 */ - dst_typ_END_OF_ENUM - } -dst_rec_type_t; - - -/* - ** Dummy bounds for variably dimensioned arrays: - */ -#define dst_dummy_array_size 100 - - -/* - ** Reference to another item in the symbol table. - ** - ** The value of a dst_rel_offset_t is the relative offset from the start of the - ** referencing record to the start of the referenced record, string, etc. - ** - ** The value of a NIL dst_rel_offset_t is zero. - */ - -typedef long dst_rel_offset_t ALIGNED1; - - -/* FIXME: Here and many places we make assumptions about sizes of host - data types, structure layout, etc. Only needs to be fixed if we care - about cross-debugging, though. */ - -/* - ** Section-relative reference. - ** - ** The section index field is an index into the local compilation unit's - ** section table (see dst_rec_section_tab_t)--NOT into the object module - ** section table! - ** - ** The sect_offset field is the offset in bytes into the section. - ** - ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate - ** at one. - */ - -typedef struct - { - unsigned short sect_index; - unsigned long sect_offset ALIGNED1; - } -dst_sect_ref_t; - -#define dst_sect_index_nil 0 -#define dst_sect_index_origin 1 - - -/* - ** Source location descriptor. - ** - ** The file_index field is an index into the local compilation unit's - ** file table (see dst_rec_file_tab_t). - ** - ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate - ** at one. - */ - -typedef struct - { - boolean reserved:1; /* reserved for future use */ - int file_index:11; /* index into .blocks source file list */ - int line_number:20; /* source line number */ - } -dst_src_loc_t; - -#define dst_file_index_nil 0 -#define dst_file_index_origin 1 - - -/* - ** Standard (primitive) type codes. - */ - -typedef enum - { - dst_non_std_type, - dst_int8_type, /* 8 bit integer */ - dst_int16_type, /* 16 bit integer */ - dst_int32_type, /* 32 bit integer */ - dst_uint8_type, /* 8 bit unsigned integer */ - dst_uint16_type, /* 16 bit unsigned integer */ - dst_uint32_type, /* 32 bit unsigned integer */ - dst_real32_type, /* single precision ieee floatining point */ - dst_real64_type, /* double precision ieee floatining point */ - dst_complex_type, /* single precision complex */ - dst_dcomplex_type, /* double precision complex */ - dst_bool8_type, /* boolean =logical*1 */ - dst_bool16_type, /* boolean =logical*2 */ - dst_bool32_type, /* boolean =logical*4 */ - dst_char_type, /* 8 bit ascii character */ - dst_string_type, /* string of 8 bit ascii characters */ - dst_ptr_type, /* univ_pointer */ - dst_set_type, /* generic 256 bit set */ - dst_proc_type, /* generic procedure (signature not specified) */ - dst_func_type, /* generic function (signature not specified) */ - dst_void_type, /* c void type */ - dst_uchar_type, /* c unsigned char */ - dst_std_type_END_OF_ENUM - } -dst_std_type_t; - - -/* - ** General data type descriptor - ** - ** If the user_defined_type bit is clear, then the type is a standard type, and - ** the remaining bits contain the dst_std_type_t of the type. If the bit is - ** set, then the type is defined in a separate dst record, which is referenced - ** by the remaining bits as a dst_rel_offset_t. - */ - -typedef union - { - struct - { - boolean user_defined_type:1; /* tag field */ - int must_be_zero:23; /* 23 bits of pad */ - dst_std_type_t dtc:8; /* 8 bit primitive data */ - } - std_type; - - struct - { - boolean user_defined_type:1; /* tag field */ - int doffset:31; /* offset to type record */ - } - user_type; - } -dst_type_t ALIGNED1; - -/* The user_type.doffset field is a 31-bit signed value. Some versions of C - do not support signed bit fields. The following macro will extract that - field as a signed value: - */ -#define dst_user_type_offset(type_rec) \ - ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 ) - - -/*================================================*/ -/*========== RECORDS IN .blocks SECTION ==========*/ -/*================================================*/ - -/*----------------------- - COMPILATION UNIT record - ----------------------- - This must be the first record in each .blocks section. - Provides a set of information describing the output of a single compilation - and pointers to additional information for the compilation unit. -*/ - -typedef enum - { - dst_pc_code_locs, /* ranges in loc strings are pc ranges */ - dst_comp_unit_END_OF_ENUM - } -dst_comp_unit_flag_t; - -typedef enum - { - dst_lang_unk, /* unknown language */ - dst_lang_pas, /* Pascal */ - dst_lang_ftn, /* FORTRAN */ - dst_lang_c, /* C */ - dst_lang_mod2, /* Modula-2 */ - dst_lang_asm_m68k, /* 68K assembly language */ - dst_lang_asm_a88k, /* AT assembly language */ - dst_lang_ada, /* Ada */ - dst_lang_cxx, /* C++ */ - dst_lang_END_OF_ENUM - } -dst_lang_type_t; - -typedef struct - { - struct - { - unsigned char major_part; /* = dst_version_major */ - unsigned char minor_part; /* = dst_version_minor */ - } - version; /* version of dst */ - unsigned short flags; /* mask of dst_comp_unit_flag_t */ - unsigned short lang_type; /* source language */ - unsigned short number_of_blocks; /* number of blocks records */ - dst_rel_offset_t root_block_offset; /* offset to root block (module?) */ - dst_rel_offset_t section_table /* offset to section table record */ ; - dst_rel_offset_t file_table; /* offset to file table record */ - unsigned long data_size; /* total size of .blocks data */ - } -dst_rec_comp_unit_t ALIGNED1; - - -/*-------------------- - SECTION TABLE record - -------------------- - There must be one section table associated with each compilation unit. - Other debug records refer to sections via their index in this table. The - section base addresses in the table are virtual addresses of the sections, - relocated by the linker. -*/ - -typedef struct - { - unsigned short number_of_sections; /* size of array: */ - unsigned long section_base[dst_dummy_array_size] ALIGNED1; - } -dst_rec_section_tab_t ALIGNED1; - - -/*----------------- - FILE TABLE record - ----------------- - There must be one file table associated with each compilation unit describing - the source (and include) files used by each compilation unit. Other debug - records refer to files via their index in this table. The first entry is the - primary source file. -*/ - -typedef struct - { - long dtm; /* time last modified (time_$clock_t) */ - dst_rel_offset_t noffset; /* offset to name string for source file */ - } -dst_file_desc_t; - -typedef struct - { - unsigned short number_of_files; /* size of array: */ - dst_file_desc_t files[dst_dummy_array_size] ALIGNED1; - } -dst_rec_file_tab_t ALIGNED1; - - -/*----------------- - NAME TABLE record - ----------------- - A name table record may appear as an auxiliary record to the file table, - providing additional qualification of the file indexes for languages that - need it (i.e. Ada). Name table entries parallel file table entries of the - same file index. -*/ - -typedef struct - { - unsigned short number_of_names; /* size of array: */ - dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1; - } -dst_rec_name_tab_t ALIGNED1; - - -/*-------------- - BLOCK record - -------------- - Describes a lexical program block--a procedure, function, module, etc. -*/ - -/* Block types. These may be used in any way desired by the compiler writers. - The debugger uses them only to give a description to the user of the type of - a block. The debugger makes no other assumptions about the meaning of any - of these. For example, the fact that a block is executable (e.g., program) - or not (e.g., module) is expressed in block attributes (see below), not - guessed at from the block type. - */ -typedef enum - { - dst_block_module, /* some pascal = modula = ada types */ - dst_block_program, - dst_block_procedure, - dst_block_function, /* C function */ - dst_block_subroutine, /* some fortran block types */ - dst_block_block_data, - dst_block_stmt_function, - dst_block_package, /* a few particular to Ada */ - dst_block_package_body, - dst_block_subunit, - dst_block_task, - dst_block_file, /* a C outer scope? */ - dst_block_class, /* C++ or Simula */ - dst_block_END_OF_ENUM - } -dst_block_type_t; - -/* Block attributes. This is the information used by the debugger to represent - the semantics of blocks. - */ -typedef enum - { - dst_block_main_entry, /* the block's entry point is a main entry into - the compilation unit */ - dst_block_executable, /* the block has an entry point */ - dst_block_attr_END_OF_ENUM - } -dst_block_attr_t; - -/* Code range. Each block has associated with it one or more code ranges. An - individual code range is identified by a range of source (possibly nil) and - a range of executable code. For example, a block which has its executable - code spread over multiple sections will have one code range per section. - */ -typedef struct - { - unsigned long code_size; /* size of executable code (in bytes ) */ - dst_sect_ref_t code_start; /* starting address of executable code */ - dst_sect_ref_t lines_start; /* start of line number tables */ - } -dst_code_range_t; - -typedef struct - { - dst_block_type_t block_type:8; - unsigned short flags:8; /* mask of dst_block_attr_t flags */ - dst_rel_offset_t sibling_block_off; /* offset to next sibling block */ - dst_rel_offset_t child_block_off; /* offset to first contained block */ - dst_rel_offset_t noffset; /* offset to block name string */ - dst_sect_ref_t symbols_start; /* start of debug symbols */ - unsigned short n_of_code_ranges; /* size of array... */ - dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1; - } -dst_rec_block_t ALIGNED1; - - -/*-------------------------- - AUX SECT INFO TABLE record - -------------------------- - Appears as an auxiliary to a block record. Expands code range information - by providing references into additional, language-dependent sections for - information related to specific code ranges of the block. Sect info table - entries parallel code range array entries of the same index. -*/ - -typedef struct - { - unsigned char tag; /* currently can only be zero */ - unsigned char number_of_refs; /* size of array: */ - dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1; - } -dst_rec_sect_info_tab_t ALIGNED1; - -/*=================================================*/ -/*========== RECORDS IN .symbols SECTION ==========*/ -/*=================================================*/ - -/*----------------- - CONSTANT record - ----------------- - Describes a symbolic constant. -*/ - -typedef struct - { - float r; /* real part */ - float i; /* imaginary part */ - } -dst_complex_t; - -typedef struct - { - double dr; /* real part */ - double di; /* imaginary part */ - } -dst_double_complex_t; - -/* The following record provides a way of describing constant values with - non-standard type and no limit on size. - */ -typedef union - { - char char_data[dst_dummy_array_size]; - short int_data[dst_dummy_array_size]; - long long_data[dst_dummy_array_size]; - } -dst_big_kon_t; - -/* Representation of the value of a general constant. - */ -typedef struct - { - unsigned short length; /* size of constant value (bytes) */ - - union - { - unsigned short kon_int8; - short kon_int16; - long kon_int32 ALIGNED1; - float kon_real ALIGNED1; - double kon_dbl ALIGNED1; - dst_complex_t kon_cplx ALIGNED1; - dst_double_complex_t kon_dcplx ALIGNED1; - char kon_char; - dst_big_kon_t kon ALIGNED1; - } - val; /* value data of constant */ - } -dst_const_t ALIGNED1; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of const definition */ - dst_type_t type_desc; /* type of this (manifest) constant */ - dst_const_t value; - } -dst_rec_const_t ALIGNED1; - -/*---------------- - VARIABLE record - ---------------- - Describes a program variable. -*/ - -/* Variable attributes. These define certain variable semantics to the - debugger. - */ -typedef enum - { - dst_var_attr_read_only, /* is read-only (a program literal) */ - dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */ - dst_var_attr_global, /* is a global definition or reference */ - dst_var_attr_compiler_gen, /* is compiler-generated */ - dst_var_attr_static, /* has static location */ - dst_var_attr_END_OF_ENUM - } -dst_var_attr_t; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_rel_offset_t loffset; /* offset to loc string */ - dst_src_loc_t src_loc; /* file/line of variable definition */ - dst_type_t type_desc; /* type descriptor */ - unsigned short attributes; /* mask of dst_var_attr_t flags */ - } -dst_rec_variable_t ALIGNED1; - - -/*---------------- - old VAR record - ----------------- - Used by older compilers to describe a variable -*/ - -typedef enum - { - dst_var_loc_unknown, /* Actually defined as "unknown" */ - dst_var_loc_abs, /* Absolute address */ - dst_var_loc_sect_off, /* Absolute address as a section offset */ - dst_var_loc_ind_sect_off, /* An indexed section offset ???? */ - dst_var_loc_reg, /* register */ - dst_var_loc_reg_rel, /* register relative - usually fp */ - dst_var_loc_ind_reg_rel, /* Indexed register relative */ - dst_var_loc_ftn_ptr_based, /* Fortran pointer based */ - dst_var_loc_pc_rel, /* PC relative. Really. */ - dst_var_loc_external, /* External */ - dst_var_loc_END_OF_ENUM - } -dst_var_loc_t; - -/* Locations come in two versions. The short, and the long. The difference - * between the short and the long is the addition of a statement number - * field to the start andend of the range of the long, and and unkown - * purpose field in the middle. Also, loc_type and loc_index aren't - * bitfields in the long version. - */ - -typedef struct - { - unsigned short loc_type:4; - unsigned short loc_index:12; - long location; - short start_line; /* start_line and end_line? */ - short end_line; /* I'm guessing here. */ - } -dst_var_loc_short_t; - -typedef struct - { - unsigned short loc_type; - unsigned short loc_index; - long location; - short unknown; /* Always 0003 or 3b3c. Why? */ - short start_statement; - short start_line; - short end_statement; - short end_line; - } -dst_var_loc_long_t; - - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of description */ - dst_type_t type_desc; /* Type description */ - unsigned short attributes; /* mask of dst_var_attr_t flags */ - unsigned short no_of_locs:15; /* Number of locations */ - unsigned short short_locs:1; /* True if short locations. */ - union - { - dst_var_loc_short_t shorts[dst_dummy_array_size]; - dst_var_loc_long_t longs[dst_dummy_array_size]; - } - locs; - } -dst_rec_var_t; - -/*---------------- - old LABEL record - ----------------- - Used by older compilers to describe a label -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of description */ - char location[12]; /* location string */ - } -dst_rec_old_label_t ALIGNED1; - -/*---------------- - POINTER record - ---------------- - Describes a pointer type. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to the name string for this type */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_type_t type_desc; /* base type of this pointer */ - } -dst_rec_pointer_t ALIGNED1; - - -/*------------- - ARRAY record - ------------- - Describes an array type. - - Multidimensional arrays are described with a number of dst_rec_array_t - records, one per array dimension, each linked to the next through the - elem_type_desc.doffset field. Each record must have its multi_dim flag - set. - - If column_major is true (as with FORTRAN arrays) then the last array bound in - the declaration is the first array index in memory, which is the opposite of - the usual case (as with Pascal and C arrays). - - Variable array bounds are described by auxiliary records; if aux_var_bound - records are present, the lo_bound and hi_bound fields of this record are - ignored by the debugger. - - span_comp identifies one of the language-dependent ways in which the distance - between successive array elements (span) is calculated. - dst_use_span_field -- the span is the value of span field. - dst_compute_from_prev -- the span is the size of the previous dimension. - dst_compute_from_next -- the span is the size of the next dimension. - In the latter two cases, the span field contains an amount of padding to add - to the size of the appropriate dimension to calculate the span. -*/ - -typedef enum - { - dst_use_span_field, - dst_compute_from_prev, - dst_compute_from_next, - dst_span_comp_END_OF_ENUM - } -dst_span_comp_t; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_type_t elem_type_desc; /* array element type */ - dst_type_t indx_type_desc; /* array index type */ - long lo_bound; /* lower bound of index */ - long hi_bound; /* upper bound of index */ - unsigned long span; /* see above */ - unsigned long size; /* total array size (bytes) */ - boolean multi_dim:1; - boolean is_packed:1; /* true if packed array */ - boolean is_signed:1; /* true if packed elements are signed */ - dst_span_comp_t span_comp:2; /* how to compute span */ - boolean column_major:1; - unsigned short reserved:2; /* must be zero */ - unsigned short elem_size:8; /* element size if packed (bits) */ - } -dst_rec_array_t ALIGNED1; - - -/*----------------- - SUBRANGE record - ----------------- - Describes a subrange type. -*/ - -/* Variable subrange bounds are described by auxiliary records; if aux_var_bound - records are present, the lo_bound and hi_bound fields of this record are - ignored by the debugger. - */ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of subrange definition */ - dst_type_t type_desc; /* parent type */ - long lo_bound; /* lower bound of subrange */ - long hi_bound; /* upper bound of subrange */ - unsigned short size; /* storage size (bytes) */ - } -dst_rec_subrange_t ALIGNED1; - - -/*--------------- - STRING record - --------------- - Describes a string type. -*/ - -/* Variable subrange bounds are described by auxiliary records; if aux_var_bound - records are present, the lo_bound and hi_bound fields of this record are - ignored by the debugger. - */ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of string definition */ - dst_type_t elem_type_desc; /* element type */ - dst_type_t indx_type_desc; /* index type */ - long lo_bound; /* lower bound */ - long hi_bound; /* upper bound */ - unsigned long size; /* total string size (bytes) if fixed */ - } -dst_rec_string_t ALIGNED1; - - -/*--------------- - SET record - --------------- - Describes a set type. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_type_t type_desc; /* element type */ - unsigned short nbits; /* number of bits in set */ - unsigned short size; /* storage size (bytes) */ - } -dst_rec_set_t ALIGNED1; - - -/*----------------------------- - IMPLICIT ENUMERATION record - ----------------------------- - Describes an enumeration type with implicit element values = 0, 1, 2, ... - (Pascal-style). -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - unsigned short nelems; /* number of elements in enumeration */ - unsigned short size; /* storage size (bytes) */ - /* offsets to name strings of elements 0, 1, 2, ... */ - dst_rel_offset_t elem_noffsets[dst_dummy_array_size]; - } -dst_rec_implicit_enum_t ALIGNED1; - - -/*----------------------------- - EXPLICIT ENUMERATION record - ----------------------------- - Describes an enumeration type with explicitly assigned element values - (C-style). -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to element name string */ - long value; /* element value */ - } -dst_enum_elem_t; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - unsigned short nelems; /* number of elements in enumeration */ - unsigned short size; /* storage size (bytes) */ - /* name/value pairs, one describing each enumeration value: */ - dst_enum_elem_t elems[dst_dummy_array_size]; - } -dst_rec_explicit_enum_t ALIGNED1; - - -/*----------------------- - RECORD / UNION record - ----------------------- - Describes a record (struct) or union. - - If the record is larger than 2**16 bytes then an attached aux record - specifies its size. Also, if the record is stored in short form then - attached records specify field offsets larger than 2**16 bytes. - - Whether the fields[] array or sfields[] array is used is selected by - the dst_rec_type_t of the overall dst record. -*/ - -/* - Record field descriptor, short form. This form handles only fields which - are an even number of bytes long, located some number of bytes from the - start of the record. - */ -typedef struct - { - dst_rel_offset_t noffset; /* offset to field name string */ - dst_type_t type_desc; /* field type */ - unsigned short foffset; /* field offset from start of record (bytes) */ - } -dst_short_field_t ALIGNED1; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_type_t type_desc; /* field type */ - unsigned short foffset; /* byte offset */ - unsigned short is_packed:1; /* True if field is packed */ - unsigned short bit_offset:6; /* Bit offset */ - unsigned short size:6; /* Size in bits */ - unsigned short sign:1; /* True if signed */ - unsigned short pad:2; /* Padding. Must be 0 */ - } -dst_old_field_t ALIGNED1; - -/* Tag enumeration for long record field descriptor: - */ -typedef enum - { - dst_field_byte, - dst_field_bit, - dst_field_loc, - dst_field_END_OF_ENUM - } -dst_field_format_t; - -/* - Record field descriptor, long form. The format of the field information - is identified by the format_tag, which contains one of the above values. - The field_byte variant is equivalent to the short form of field descriptor. - The field_bit variant handles fields which are any number of bits long, - located some number of bits from the start of the record. The field_loc - variant allows the location of the field to be described by a general loc - string. - */ -typedef struct - { - dst_rel_offset_t noffset; /* offset to name of field */ - dst_type_t type_desc; /* type of field */ - union - { - struct - { - dst_field_format_t format_tag:2; /* dst_field_byte */ - unsigned long offset:30; /* offset of field in bytes */ - } - field_byte ALIGNED1; - struct - { - dst_field_format_t format_tag:2; /* dst_field_bit */ - unsigned long nbits:6; /* bit size of field */ - unsigned long is_signed:1; /* signed/unsigned attribute */ - unsigned long bit_offset:3; /* bit offset from byte boundary */ - int pad:4; /* must be zero */ - unsigned short byte_offset; /* offset of byte boundary */ - } - field_bit ALIGNED1; - struct - { - dst_field_format_t format_tag:2; /* dst_field_loc */ - int loffset:30; /* dst_rel_offset_t to loc string */ - } - field_loc ALIGNED1; - } - f ALIGNED1; - } -dst_field_t; - -/* The field_loc.loffset field is a 30-bit signed value. Some versions of C do - not support signed bit fields. The following macro will extract that field - as a signed value: - */ -#define dst_field_loffset(field_rec) \ - ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 ) - - -typedef struct - { - dst_rel_offset_t noffset; /* offset to record name string */ - dst_src_loc_t src_loc; /* file/line where this record is defined */ - unsigned short size; /* storage size (bytes) */ - unsigned short nfields; /* number of fields in this record */ - union - { - dst_field_t fields[dst_dummy_array_size]; - dst_short_field_t sfields[dst_dummy_array_size]; - dst_old_field_t ofields[dst_dummy_array_size]; - } - f; /* array of fields */ - } -dst_rec_record_t ALIGNED1; - - -/*------------- - FILE record - ------------- - Describes a file type. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line where type was defined */ - dst_type_t type_desc; /* file element type */ - } -dst_rec_file_t ALIGNED1; - - -/*--------------- - OFFSET record - --------------- - Describes a Pascal offset type. - (This type, an undocumented Domain Pascal extension, is currently not - supported by the debugger) -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to the name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_type_t area_type_desc; /* area type */ - dst_type_t base_type_desc; /* base type */ - long lo_bound; /* low bound of the offset range */ - long hi_bound; /* high bound of the offset range */ - long bias; /* bias */ - unsigned short scale; /* scale factor */ - unsigned short size; /* storage size (bytes) */ - } -dst_rec_offset_t ALIGNED1; - - -/*-------------- - ALIAS record - -------------- - Describes a type alias (e.g., typedef). -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_type_t type_desc; /* parent type */ - } -dst_rec_alias_t ALIGNED1; - - -/*------------------ - SIGNATURE record - ------------------ - Describes a procedure/function type. -*/ - -/* Enumeration of argument semantics. Note that most are mutually - exclusive. - */ -typedef enum - { - dst_arg_attr_val, /* passed by value */ - dst_arg_attr_ref, /* passed by reference */ - dst_arg_attr_name, /* passed by name */ - dst_arg_attr_in, /* readable in the callee */ - dst_arg_attr_out, /* writable in the callee */ - dst_arg_attr_hidden, /* not visible in the caller */ - dst_arg_attr_END_OF_ENUM - } -dst_arg_attr_t; - -/* Argument descriptor. Actually points to a variable record for most of the - information. - */ -typedef struct - { - dst_rel_offset_t var_offset; /* offset to variable record */ - unsigned short attributes; /* a mask of dst_arg_attr_t flags */ - } -dst_arg_t ALIGNED1; - -typedef struct - { - dst_rel_offset_t noffset; /* offset to name string */ - dst_src_loc_t src_loc; /* file/line of function definition */ - dst_rel_offset_t result; /* offset to function result variable record */ - unsigned short nargs; /* number of arguments */ - dst_arg_t args[dst_dummy_array_size]; - } -dst_rec_signature_t ALIGNED1; - -/*-------------- - SCOPE record - -------------- - Obsolete. Use the new ENTRY type instead. - Old compilers may put this in as the first entry in a function, - terminated by an end of scope entry. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* Name offset */ - dst_src_loc_t start_line; /* Starting line */ - dst_src_loc_t end_line; /* Ending line */ - } -dst_rec_scope_t ALIGNED1; - -/*-------------- - ENTRY record - -------------- - Describes a procedure/function entry point. An entry record is to a - signature record roughly as a variable record is to a type descriptor record. - - The entry_number field is keyed to the entry numbers in .lines -- the - debugger locates the code location of an entry by searching the line - number table for an entry numbered with the value of entry_number. The - main entry is numbered zero. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to entry name string */ - dst_rel_offset_t loffset; /* where to jump to call this entry */ - dst_src_loc_t src_loc; /* file/line of definition */ - dst_rel_offset_t sig_desc; /* offset to signature descriptor */ - unsigned int entry_number:8; - int pad:8; /* must be zero */ - } -dst_rec_entry_t ALIGNED1; - -/*----------------------- - Old format ENTRY record - ----------------------- - Supposedly obsolete but still used by some compilers. - */ - -typedef struct - { - dst_rel_offset_t noffset; /* Offset to entry name string */ - dst_src_loc_t src_loc; /* Location in source */ - dst_rel_offset_t sig_desc; /* Signature description */ - char unknown[36]; - } -dst_rec_old_entry_t ALIGNED1; - -/*-------------- - LABEL record - -------------- - Describes a program label. -*/ - -typedef struct - { - dst_rel_offset_t noffset; /* offset to label string */ - dst_rel_offset_t loffset; /* offset to loc string */ - dst_src_loc_t src_loc; /* file/line of definition */ - } -dst_rec_label_t ALIGNED1; - - -/*----------------------- - AUXILIARY SIZE record - ----------------------- - May appear in the auxiliary record list of any type or variable record to - modify the default size of the type or variable. -*/ - -typedef struct - { - unsigned long size; /* size (bytes) */ - } -dst_rec_aux_size_t ALIGNED1; - - -/*----------------------- - AUXILIARY ALIGN record - ----------------------- - May appear in the auxiliary record list of any type or variable record to - modify the default alignment of the type or variable. -*/ - -typedef struct - { - unsigned short alignment; /* # of low order zero bits */ - } -dst_rec_aux_align_t ALIGNED1; - - -/*----------------------------- - AUXILIARY FIELD SIZE record - ----------------------------- - May appear in the auxiliary record list of any RECORD/UNION record to - modify the default size of a field. -*/ - -typedef struct - { - unsigned short field_no; /* field number */ - unsigned long size; /* size (bits) */ - } -dst_rec_aux_field_size_t ALIGNED1; - - - -/*----------------------------- - AUXILIARY FIELD OFFSET record - ----------------------------- - May appear in the auxiliary record list of any RECORD/UNION record to - specify a field offset larger than 2**16. -*/ - -typedef struct - { - unsigned short field_no; /* field number */ - unsigned long foffset; /* offset */ - } -dst_rec_aux_field_off_t ALIGNED1; - - -/*----------------------------- - AUXILIARY FIELD ALIGN record - ----------------------------- - May appear in the auxiliary record list of any RECORD/UNION record to - modify the default alignment of a field. -*/ - -typedef struct - { - unsigned short field_no; /* field number */ - unsigned short alignment; /* number of low order zero bits */ - } -dst_rec_aux_field_align_t ALIGNED1; - - -/*---------------------------- - AUXILIARY VAR BOUND record - ---------------------------- - May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING - record to describe a variable bound for the range of the type. -*/ - -typedef enum - { - dst_low_bound, /* the low bound is variable */ - dst_high_bound, /* the high bound is variable */ - dst_var_bound_END_OF_ENUM - } -dst_var_bound_t; - -typedef struct - { - unsigned short which; /* which bound */ - dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */ - } -dst_rec_aux_var_bound_t ALIGNED1; - - -/*---------------------------------- - AUXILIARY TYPE DERIVATION record - ---------------------------------- - May appear in the auxiliary record list of any RECORD/UNION record to denote - class inheritance of that type from a parent type. - - Inheritance implies that it is possible to convert the inheritor type to the - inherited type, retaining those fields which were inherited. To allow this, - orig_field_no, a field number into the record type, is provided. If - orig_is_pointer is false, then the start of the inherited record is located - at the location of the field indexed by orig_field_no. If orig_is_pointer - is true, then it is located at the address contained in the field indexed - by orig_field_no (assumed to be a pointer). -*/ - -typedef struct - { - dst_type_t parent_type; /* reference to inherited type */ - unsigned short orig_field_no; - boolean orig_is_pointer:1; - int unused:15; /* must be zero */ - } -dst_rec_aux_type_deriv_t ALIGNED1; - - -/*------------------------------------ - AUXILIARY VARIABLE LIFETIME record - ------------------------------------ - May appear in the auxiliary record list of a VARIABLE record to add location - information for an additional variable lifetime. -*/ - -typedef struct - { - dst_rel_offset_t loffset; - } -dst_rec_aux_lifetime_t ALIGNED1; - - -/*------------------------------- - AUXILIARY POINTER BASE record - ------------------------------- - May appear in the auxiliary record list of a VARIABLE record to provide a - pointer base to substitute for references to any such bases in the location - string of the variable. A pointer base is another VARIABLE record. When - the variable is evaluated by the debugger, it uses the current value of the - pointer base variable in computing its location. - - This is useful for representing FORTRAN pointer-based variables. -*/ - -typedef struct - { - dst_rel_offset_t voffset; - } -dst_rec_aux_ptr_base_t ALIGNED1; - - -/*--------------------------------- - AUXILIARY REGISTER VALUE record - --------------------------------- - May appear in the auxiliary record list of an ENTRY record to specify - a register that must be set to a specific value before jumping to the entry - point in a debugger "call". The debugger must set the debuggee register, - specified by the register code, to the value of the *address* to which the - location string resolves. If the address is register-relative, then the - call cannot be made unless the current stack frame is the lexical parent - of the entry. An example of this is when a (Pascal) nested procedure - contains references to its parent's variables, which it accesses through - a static link register. The static link register must be set to some - address relative to the parent's stack base register. -*/ - -typedef struct - { - unsigned short reg; /* identifies register to set (isp enum) */ - dst_rel_offset_t loffset; /* references a location string */ - } -dst_rec_aux_reg_val_t ALIGNED1; - - -/*==========================================================*/ -/*========== RECORDS USED IN .blocks AND .symbols ==========*/ -/*==========================================================*/ - -/*--------------------- - STRING TABLE record - --------------------- - A string table record contains any number of null-terminated, variable length - strings. The length field gives the size in bytes of the text field, which - can be any size. - - The global name table shares this format. This record appears in the - .blocks section. Each string in the table identifies a global defined in - the current compilation unit. - - The loc pool record shares this format as well. Loc strings are described - elsewhere. -*/ - -typedef struct - { - unsigned long length; - char text[dst_dummy_array_size]; - } -dst_rec_string_tab_t ALIGNED1; - - -/*----------------------- - AUXILIARY QUAL record - ----------------------- - May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record - to provide it with a fully-qualified, language-dependent name. -*/ - -typedef struct - { - dst_rel_offset_t lang_qual_name; - } -dst_rec_aux_qual_t ALIGNED1; - - -/*---------------- - FORWARD record - ---------------- - Reference to a record somewhere else. This allows identical definitions in - different scopes to share data. -*/ - -typedef struct - { - dst_rel_offset_t rec_off; - } -dst_rec_forward_t ALIGNED1; - - -/*------------------------------- - AUXILIARY SOURCE RANGE record - ------------------------------- - May appear in the auxiliary record list of any BLOCK record to specify a - range of source lines over which the block is active. -*/ - -typedef struct - { - dst_src_loc_t first_line; /* first source line */ - dst_src_loc_t last_line; /* last source line */ - } -dst_rec_aux_src_range_t ALIGNED1; - - -/*------------------ - EXTENSION record - ------------------ - Provision for "foreign" records, such as might be generated by a non-Apollo - compiler. Apollo software will ignore these. -*/ - -typedef struct - { - unsigned short rec_size; /* record size (bytes) */ - unsigned short ext_type; /* defined by whoever generates it */ - unsigned short ext_data; /* place-holder for arbitrary amount of data */ - } -dst_rec_extension_t ALIGNED1; - - -/* - ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records. - ** - ** This record ties together all previous .blocks and .symbols records - ** together in a union with a common header. The rec_type field of the - ** header identifies the record type. The rec_flags field currently only - ** defines auxiliary record lists. - ** - ** If a record carries with it a non-null auxiliary record list, its - ** dst_flag_has_aux_recs flag is set, and each of the records that follow - ** it are treated as its auxiliary records, until the end of the compilation - ** unit or scope is reached, or until an auxiliary record with its - ** dst_flag_last_aux_rec flag set is reached. - */ - -typedef enum - { - dst_flag_has_aux_recs, - dst_flag_last_aux_rec, - dst_rec_flag_END_OF_ENUM - } -dst_rec_flags_t; - -typedef struct - { - dst_rec_type_t rec_type:8; /* record type */ - int rec_flags:8; /* mask of dst_rec_flags_t */ - union /* switched on rec_type field above */ - { - /* dst_typ_pad requires no additional fields */ - dst_rec_comp_unit_t comp_unit_; - dst_rec_section_tab_t section_tab_; - dst_rec_file_tab_t file_tab_; - dst_rec_block_t block_; - dst_rec_var_t var_; - dst_rec_pointer_t pointer_; - dst_rec_array_t array_; - dst_rec_subrange_t subrange_; - dst_rec_set_t set_; - dst_rec_implicit_enum_t implicit_enum_; - dst_rec_explicit_enum_t explicit_enum_; - /* dst_typ_short_{rec,union} are represented by 'rec' (below) */ - dst_rec_file_t file_; - dst_rec_offset_t offset_; - dst_rec_alias_t alias_; - dst_rec_signature_t signature_; - dst_rec_old_label_t old_label_; - dst_rec_scope_t scope_; - /* dst_typ_end_scope requires no additional fields */ - dst_rec_string_tab_t string_tab_; - /* dst_typ_global_name_tab is represented by 'string_tab' (above) */ - dst_rec_forward_t forward_; - dst_rec_aux_size_t aux_size_; - dst_rec_aux_align_t aux_align_; - dst_rec_aux_field_size_t aux_field_size_; - dst_rec_aux_field_off_t aux_field_off_; - dst_rec_aux_field_align_t aux_field_align_; - dst_rec_aux_qual_t aux_qual_; - dst_rec_aux_var_bound_t aux_var_bound_; - dst_rec_extension_t extension_; - dst_rec_string_t string_; - dst_rec_const_t const_; - /* dst_typ_reference is represented by 'pointer' (above) */ - dst_rec_record_t record_; - /* dst_typ_union is represented by 'record' (above) */ - dst_rec_aux_type_deriv_t aux_type_deriv_; - /* dst_typ_locpool is represented by 'string_tab' (above) */ - dst_rec_variable_t variable_; - dst_rec_label_t label_; - dst_rec_entry_t entry_; - dst_rec_aux_lifetime_t aux_lifetime_; - dst_rec_aux_ptr_base_t aux_ptr_base_; - dst_rec_aux_src_range_t aux_src_range_; - dst_rec_aux_reg_val_t aux_reg_val_; - dst_rec_name_tab_t aux_unit_names_; - dst_rec_sect_info_tab_t aux_sect_info_; - } - rec_data ALIGNED1; - } -dst_rec_t, *dst_rec_ptr_t; - - -/*===============================================*/ -/*========== .lines SECTION DEFINITIONS =========*/ -/*===============================================*/ -/* - The .lines section contains a sequence of line number tables. There is no - record structure within the section. The start of the table for a routine - is pointed to by the block record, and the end of the table is signaled by - an escape code. - - A line number table is a sequence of bytes. The default entry contains a line - number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4 - bits. Special cases, including when one or both of the values is too large - to fit in 4 bits and other special cases are handled through escape entries. - Escape entries are identified by the value 0x8 in the high 4 bits. The low 4 - bits are occupied by a function code. Some escape entries are followed by - additional arguments, which may be bytes, words, or longwords. This data is - not aligned. - - The initial PC offset, file number and line number are zero. Normally, the - table begins with a dst_ln_file escape which establishes the initial file - and line number. All PC deltas are unsigned (thus the table is ordered by - increasing PC); line number deltas are signed. The table ends with a - dst_ln_end escape, which is followed by a final table entry whose PC delta - gives the code size of the last statement. - - Escape Semantic - --------- ------------------------------------------------------------ - file Changes file state. The current source file remains constant - until another file escape. Though the line number state is - also updated by a file escape, a file escape does NOT - constitute a line table entry. - - statement Alters the statement number of the next table entry. By - default, all table entries refer to the first statement on a - line. Statement number one is the second statement, and so on. - - entry Identifies the next table entry as the position of an entry - point for the current block. The PC position should follow - any procedure prologue code. An argument specifies the entry - number, which is keyed to the entry number of the corresponding - .symbols ENTRY record. - - exit Identifies the next table entry as the last position within - the current block before a procedure epiloge and subsequent - procedure exit. - - gap By default, the executable code corresponding to a table entry - is assumed to extend to the beginning of the next table entry. - If this is not the case--there is a "hole" in the table--then - a gap escape should follow the first table entry to specify - where the code for that entry ends. - */ - -#define dst_ln_escape_flag -8 - -/* - Escape function codes: - */ -typedef enum - { - dst_ln_pad, /* pad byte */ - dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */ - dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */ - dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */ - dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ - dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */ - dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ - dst_ln_ln_off, /* statement escape, stmt # = next byte */ - dst_ln_entry, /* entry escape, next byte is entry number */ - dst_ln_exit, /* exit escape */ - dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ - dst_ln_escape_11, /* reserved */ - dst_ln_escape_12, /* reserved */ - dst_ln_escape_13, /* reserved */ - dst_ln_nxt_byte, /* next byte contains the real escape code */ - dst_ln_end, /* end escape, final entry follows */ - dst_ln_escape_END_OF_ENUM - } -dst_ln_escape_t; - -/* - Line number table entry - */ -typedef union - { - struct - { - unsigned int ln_delta:4; /* 4 bit line number delta */ - unsigned int pc_delta:4; /* 4 bit pc delta */ - } - delta; - - struct - { - unsigned int esc_flag:4; /* alias for ln_delta */ - dst_ln_escape_t esc_code:4; /* escape function code */ - } - esc; - - char sdata; /* signed data byte */ - unsigned char udata; /* unsigned data byte */ - } -dst_ln_entry_t, - *dst_ln_entry_ptr_t, - dst_ln_table_t[dst_dummy_array_size]; - -/* The following macro will extract the ln_delta field as a signed value: - */ -#define dst_ln_ln_delta(ln_rec) \ - ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 ) - - - - -typedef struct dst_sec_struct - { - char *buffer; - long position; - long size; - long base; - } -dst_sec; - - -/* Macros for access to the data */ - -#define DST_comp_unit(x) ((x)->rec_data.comp_unit_) -#define DST_section_tab(x) ((x)->rec_data.section_tab_) -#define DST_file_tab(x) ((x)->rec_data.file_tab_) -#define DST_block(x) ((x)->rec_data.block_) -#define DST_var(x) ((x)->rec_data.var_) -#define DST_pointer(x) ((x)->rec_data.pointer_) -#define DST_array(x) ((x)->rec_data.array_) -#define DST_subrange(x) ((x)->rec_data.subrange_) -#define DST_set(x) ((x)->rec_data.set_) -#define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_) -#define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_) -#define DST_short_rec(x) ((x)->rec_data.record_) -#define DST_short_union(x) ((x)->rec_data.record_) -#define DST_file(x) ((x)->rec_data.file_) -#define DST_offset(x) ((x)->rec_data.offset_) -#define DST_alias(x) ((x)->rec_data.alias_) -#define DST_signature(x) ((x)->rec_data.signature_) -#define DST_old_label(x) ((x)->rec_data.old_label_) -#define DST_scope(x) ((x)->rec_data.scope_) -#define DST_string_tab(x) ((x)->rec_data.string_tab_) -#define DST_global_name_tab(x) ((x)->rec_data.string_tab_) -#define DST_forward(x) ((x)->rec_data.forward_) -#define DST_aux_size(x) ((x)->rec_data.aux_size_) -#define DST_aux_align(x) ((x)->rec_data.aux_align_) -#define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_) -#define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_) -#define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_) -#define DST_aux_qual(x) ((x)->rec_data.aux_qual_) -#define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_) -#define DST_extension(x) ((x)->rec_data.extension_) -#define DST_string(x) ((x)->rec_data.string_) -#define DST_const(x) ((x)->rec_data.const_) -#define DST_reference(x) ((x)->rec_data.pointer_) -#define DST_record(x) ((x)->rec_data.record_) -#define DST_union(x) ((x)->rec_data.record_) -#define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_) -#define DST_locpool(x) ((x)->rec_data.string_tab_) -#define DST_variable(x) ((x)->rec_data.variable_) -#define DST_label(x) ((x)->rec_data.label_) -#define DST_entry(x) ((x)->rec_data.entry_) -#define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_) -#define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_) -#define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_) -#define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_) -#define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_) -#define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_) - - -/* - * Type codes for loc strings. I'm not entirely certain about all of - * these, but they seem to work. - * troy@cbme.unsw.EDU.AU - * If you find a variable whose location can't be decoded, you should - * find out it's code using "dstdump -s filename". It will record an - * entry for the variable, and give a text representation of what - * the locstring means. Before that explaination there will be a - * number. In the LOCSTRING table, that number will appear before - * the start of the location string. Location string codes are - * five bit codes with a 3 bit argument. Check the high 5 bits of - * the one byte code, and figure out where it goes in here. - * Then figure out exactly what the meaning is and code it in - * dstread.c - * - * Note that ranged locs mean that the variable is in different locations - * depending on the current PC. We ignore these because (a) gcc can't handle - * them, and (b), If you don't use high levels of optimisation they won't - * occur. - */ -typedef enum - { - dst_lsc_end, /* End of string */ - dst_lsc_indirect, /* Indirect through previous. Arg == 6 */ - /* Or register ax (x=arg) */ - dst_lsc_dreg, /* register dx (x=arg) */ - dst_lsc_03, - dst_lsc_section, /* Section (arg+1) */ - dst_lsc_05, - dst_lsc_06, - dst_lsc_add, /* Add (arg+1)*2 */ - dst_lsc_sub, /* Subtract (arg+1)*2 */ - dst_lsc_09, - dst_lsc_0a, - dst_lsc_sec_byte, /* Section of next byte+1 */ - dst_lsc_add_byte, /* Add next byte (arg == 5) or next word - * (arg == 6) - */ - dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next - * word (arg == 6 ?) - */ - dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0 */ - dst_lsc_0f, - dst_lsc_ranged, /* location is pc dependent */ - dst_lsc_11, - dst_lsc_12, - dst_lsc_13, - dst_lsc_14, - dst_lsc_15, - dst_lsc_16, - dst_lsc_17, - dst_lsc_18, - dst_lsc_19, - dst_lsc_1a, - dst_lsc_1b, - dst_lsc_1c, - dst_lsc_1d, - dst_lsc_1e, - dst_lsc_1f - } -dst_loc_string_code_t; - -/* If the following occurs after an addition/subtraction, that addition - * or subtraction should be multiplied by 256. It's a complete byte, not - * a code. - */ - -#define dst_multiply_256 ((char) 0x73) - -typedef struct - { - char code:5; - char arg:3; - } -dst_loc_header_t ALIGNED1; - -typedef union - { - dst_loc_header_t header; - char data; - } -dst_loc_entry_t ALIGNED1; - -#undef ALIGNED1 -#endif /* apollo_dst_h */ +// OBSOLETE /* */ +// OBSOLETE /* Apollo object module DST (debug symbol table) description */ +// OBSOLETE +// OBSOLETE #ifndef apollo_dst_h +// OBSOLETE #define apollo_dst_h +// OBSOLETE +// OBSOLETE #if defined(apollo) && !defined(__GNUC__) +// OBSOLETE #define ALIGNED1 __attribute( (aligned(1)) ) +// OBSOLETE #else +// OBSOLETE /* Remove attribute directives from non-Apollo code: */ +// OBSOLETE #define ALIGNED1 /* nil */ +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Identification of this version of the debug symbol table. Producers of the +// OBSOLETE debug symbol table must write these values into the version number field of +// OBSOLETE the compilation unit record in .blocks . +// OBSOLETE */ +// OBSOLETE #define dst_version_major 1 +// OBSOLETE #define dst_version_minor 3 +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Enumeration of debug record types appearing in .blocks and .symbols ... +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_typ_pad, /* 0 */ +// OBSOLETE dst_typ_comp_unit, /* 1 */ +// OBSOLETE dst_typ_section_tab, /* 2 */ +// OBSOLETE dst_typ_file_tab, /* 3 */ +// OBSOLETE dst_typ_block, /* 4 */ +// OBSOLETE dst_typ_5, +// OBSOLETE dst_typ_var, +// OBSOLETE dst_typ_pointer, /* 7 */ +// OBSOLETE dst_typ_array, /* 8 */ +// OBSOLETE dst_typ_subrange, /* 9 */ +// OBSOLETE dst_typ_set, /* 10 */ +// OBSOLETE dst_typ_implicit_enum, /* 11 */ +// OBSOLETE dst_typ_explicit_enum, /* 12 */ +// OBSOLETE dst_typ_short_rec, /* 13 */ +// OBSOLETE dst_typ_old_record, +// OBSOLETE dst_typ_short_union, /* 15 */ +// OBSOLETE dst_typ_old_union, +// OBSOLETE dst_typ_file, /* 17 */ +// OBSOLETE dst_typ_offset, /* 18 */ +// OBSOLETE dst_typ_alias, /* 19 */ +// OBSOLETE dst_typ_signature, /* 20 */ +// OBSOLETE dst_typ_21, +// OBSOLETE dst_typ_old_label, /* 22 */ +// OBSOLETE dst_typ_scope, /* 23 */ +// OBSOLETE dst_typ_end_scope, /* 24 */ +// OBSOLETE dst_typ_25, +// OBSOLETE dst_typ_26, +// OBSOLETE dst_typ_string_tab, /* 27 */ +// OBSOLETE dst_typ_global_name_tab, /* 28 */ +// OBSOLETE dst_typ_forward, /* 29 */ +// OBSOLETE dst_typ_aux_size, /* 30 */ +// OBSOLETE dst_typ_aux_align, /* 31 */ +// OBSOLETE dst_typ_aux_field_size, /* 32 */ +// OBSOLETE dst_typ_aux_field_off, /* 33 */ +// OBSOLETE dst_typ_aux_field_align, /* 34 */ +// OBSOLETE dst_typ_aux_qual, /* 35 */ +// OBSOLETE dst_typ_aux_var_bound, /* 36 */ +// OBSOLETE dst_typ_extension, /* 37 */ +// OBSOLETE dst_typ_string, /* 38 */ +// OBSOLETE dst_typ_old_entry, +// OBSOLETE dst_typ_const, /* 40 */ +// OBSOLETE dst_typ_reference, /* 41 */ +// OBSOLETE dst_typ_record, /* 42 */ +// OBSOLETE dst_typ_union, /* 43 */ +// OBSOLETE dst_typ_aux_type_deriv, /* 44 */ +// OBSOLETE dst_typ_locpool, /* 45 */ +// OBSOLETE dst_typ_variable, /* 46 */ +// OBSOLETE dst_typ_label, /* 47 */ +// OBSOLETE dst_typ_entry, /* 48 */ +// OBSOLETE dst_typ_aux_lifetime, /* 49 */ +// OBSOLETE dst_typ_aux_ptr_base, /* 50 */ +// OBSOLETE dst_typ_aux_src_range, /* 51 */ +// OBSOLETE dst_typ_aux_reg_val, /* 52 */ +// OBSOLETE dst_typ_aux_unit_names, /* 53 */ +// OBSOLETE dst_typ_aux_sect_info, /* 54 */ +// OBSOLETE dst_typ_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_rec_type_t; +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Dummy bounds for variably dimensioned arrays: +// OBSOLETE */ +// OBSOLETE #define dst_dummy_array_size 100 +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Reference to another item in the symbol table. +// OBSOLETE ** +// OBSOLETE ** The value of a dst_rel_offset_t is the relative offset from the start of the +// OBSOLETE ** referencing record to the start of the referenced record, string, etc. +// OBSOLETE ** +// OBSOLETE ** The value of a NIL dst_rel_offset_t is zero. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef long dst_rel_offset_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /* FIXME: Here and many places we make assumptions about sizes of host +// OBSOLETE data types, structure layout, etc. Only needs to be fixed if we care +// OBSOLETE about cross-debugging, though. */ +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Section-relative reference. +// OBSOLETE ** +// OBSOLETE ** The section index field is an index into the local compilation unit's +// OBSOLETE ** section table (see dst_rec_section_tab_t)--NOT into the object module +// OBSOLETE ** section table! +// OBSOLETE ** +// OBSOLETE ** The sect_offset field is the offset in bytes into the section. +// OBSOLETE ** +// OBSOLETE ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate +// OBSOLETE ** at one. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short sect_index; +// OBSOLETE unsigned long sect_offset ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_sect_ref_t; +// OBSOLETE +// OBSOLETE #define dst_sect_index_nil 0 +// OBSOLETE #define dst_sect_index_origin 1 +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Source location descriptor. +// OBSOLETE ** +// OBSOLETE ** The file_index field is an index into the local compilation unit's +// OBSOLETE ** file table (see dst_rec_file_tab_t). +// OBSOLETE ** +// OBSOLETE ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate +// OBSOLETE ** at one. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE boolean reserved:1; /* reserved for future use */ +// OBSOLETE int file_index:11; /* index into .blocks source file list */ +// OBSOLETE int line_number:20; /* source line number */ +// OBSOLETE } +// OBSOLETE dst_src_loc_t; +// OBSOLETE +// OBSOLETE #define dst_file_index_nil 0 +// OBSOLETE #define dst_file_index_origin 1 +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** Standard (primitive) type codes. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_non_std_type, +// OBSOLETE dst_int8_type, /* 8 bit integer */ +// OBSOLETE dst_int16_type, /* 16 bit integer */ +// OBSOLETE dst_int32_type, /* 32 bit integer */ +// OBSOLETE dst_uint8_type, /* 8 bit unsigned integer */ +// OBSOLETE dst_uint16_type, /* 16 bit unsigned integer */ +// OBSOLETE dst_uint32_type, /* 32 bit unsigned integer */ +// OBSOLETE dst_real32_type, /* single precision ieee floatining point */ +// OBSOLETE dst_real64_type, /* double precision ieee floatining point */ +// OBSOLETE dst_complex_type, /* single precision complex */ +// OBSOLETE dst_dcomplex_type, /* double precision complex */ +// OBSOLETE dst_bool8_type, /* boolean =logical*1 */ +// OBSOLETE dst_bool16_type, /* boolean =logical*2 */ +// OBSOLETE dst_bool32_type, /* boolean =logical*4 */ +// OBSOLETE dst_char_type, /* 8 bit ascii character */ +// OBSOLETE dst_string_type, /* string of 8 bit ascii characters */ +// OBSOLETE dst_ptr_type, /* univ_pointer */ +// OBSOLETE dst_set_type, /* generic 256 bit set */ +// OBSOLETE dst_proc_type, /* generic procedure (signature not specified) */ +// OBSOLETE dst_func_type, /* generic function (signature not specified) */ +// OBSOLETE dst_void_type, /* c void type */ +// OBSOLETE dst_uchar_type, /* c unsigned char */ +// OBSOLETE dst_std_type_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_std_type_t; +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** General data type descriptor +// OBSOLETE ** +// OBSOLETE ** If the user_defined_type bit is clear, then the type is a standard type, and +// OBSOLETE ** the remaining bits contain the dst_std_type_t of the type. If the bit is +// OBSOLETE ** set, then the type is defined in a separate dst record, which is referenced +// OBSOLETE ** by the remaining bits as a dst_rel_offset_t. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef union +// OBSOLETE { +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE boolean user_defined_type:1; /* tag field */ +// OBSOLETE int must_be_zero:23; /* 23 bits of pad */ +// OBSOLETE dst_std_type_t dtc:8; /* 8 bit primitive data */ +// OBSOLETE } +// OBSOLETE std_type; +// OBSOLETE +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE boolean user_defined_type:1; /* tag field */ +// OBSOLETE int doffset:31; /* offset to type record */ +// OBSOLETE } +// OBSOLETE user_type; +// OBSOLETE } +// OBSOLETE dst_type_t ALIGNED1; +// OBSOLETE +// OBSOLETE /* The user_type.doffset field is a 31-bit signed value. Some versions of C +// OBSOLETE do not support signed bit fields. The following macro will extract that +// OBSOLETE field as a signed value: +// OBSOLETE */ +// OBSOLETE #define dst_user_type_offset(type_rec) \ +// OBSOLETE ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 ) +// OBSOLETE +// OBSOLETE +// OBSOLETE /*================================================*/ +// OBSOLETE /*========== RECORDS IN .blocks SECTION ==========*/ +// OBSOLETE /*================================================*/ +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE COMPILATION UNIT record +// OBSOLETE ----------------------- +// OBSOLETE This must be the first record in each .blocks section. +// OBSOLETE Provides a set of information describing the output of a single compilation +// OBSOLETE and pointers to additional information for the compilation unit. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_pc_code_locs, /* ranges in loc strings are pc ranges */ +// OBSOLETE dst_comp_unit_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_comp_unit_flag_t; +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_lang_unk, /* unknown language */ +// OBSOLETE dst_lang_pas, /* Pascal */ +// OBSOLETE dst_lang_ftn, /* FORTRAN */ +// OBSOLETE dst_lang_c, /* C */ +// OBSOLETE dst_lang_mod2, /* Modula-2 */ +// OBSOLETE dst_lang_asm_m68k, /* 68K assembly language */ +// OBSOLETE dst_lang_asm_a88k, /* AT assembly language */ +// OBSOLETE dst_lang_ada, /* Ada */ +// OBSOLETE dst_lang_cxx, /* C++ */ +// OBSOLETE dst_lang_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_lang_type_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE unsigned char major_part; /* = dst_version_major */ +// OBSOLETE unsigned char minor_part; /* = dst_version_minor */ +// OBSOLETE } +// OBSOLETE version; /* version of dst */ +// OBSOLETE unsigned short flags; /* mask of dst_comp_unit_flag_t */ +// OBSOLETE unsigned short lang_type; /* source language */ +// OBSOLETE unsigned short number_of_blocks; /* number of blocks records */ +// OBSOLETE dst_rel_offset_t root_block_offset; /* offset to root block (module?) */ +// OBSOLETE dst_rel_offset_t section_table /* offset to section table record */ ; +// OBSOLETE dst_rel_offset_t file_table; /* offset to file table record */ +// OBSOLETE unsigned long data_size; /* total size of .blocks data */ +// OBSOLETE } +// OBSOLETE dst_rec_comp_unit_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*-------------------- +// OBSOLETE SECTION TABLE record +// OBSOLETE -------------------- +// OBSOLETE There must be one section table associated with each compilation unit. +// OBSOLETE Other debug records refer to sections via their index in this table. The +// OBSOLETE section base addresses in the table are virtual addresses of the sections, +// OBSOLETE relocated by the linker. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short number_of_sections; /* size of array: */ +// OBSOLETE unsigned long section_base[dst_dummy_array_size] ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_section_tab_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------- +// OBSOLETE FILE TABLE record +// OBSOLETE ----------------- +// OBSOLETE There must be one file table associated with each compilation unit describing +// OBSOLETE the source (and include) files used by each compilation unit. Other debug +// OBSOLETE records refer to files via their index in this table. The first entry is the +// OBSOLETE primary source file. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE long dtm; /* time last modified (time_$clock_t) */ +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string for source file */ +// OBSOLETE } +// OBSOLETE dst_file_desc_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short number_of_files; /* size of array: */ +// OBSOLETE dst_file_desc_t files[dst_dummy_array_size] ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_file_tab_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------- +// OBSOLETE NAME TABLE record +// OBSOLETE ----------------- +// OBSOLETE A name table record may appear as an auxiliary record to the file table, +// OBSOLETE providing additional qualification of the file indexes for languages that +// OBSOLETE need it (i.e. Ada). Name table entries parallel file table entries of the +// OBSOLETE same file index. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short number_of_names; /* size of array: */ +// OBSOLETE dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_name_tab_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*-------------- +// OBSOLETE BLOCK record +// OBSOLETE -------------- +// OBSOLETE Describes a lexical program block--a procedure, function, module, etc. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Block types. These may be used in any way desired by the compiler writers. +// OBSOLETE The debugger uses them only to give a description to the user of the type of +// OBSOLETE a block. The debugger makes no other assumptions about the meaning of any +// OBSOLETE of these. For example, the fact that a block is executable (e.g., program) +// OBSOLETE or not (e.g., module) is expressed in block attributes (see below), not +// OBSOLETE guessed at from the block type. +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_block_module, /* some pascal = modula = ada types */ +// OBSOLETE dst_block_program, +// OBSOLETE dst_block_procedure, +// OBSOLETE dst_block_function, /* C function */ +// OBSOLETE dst_block_subroutine, /* some fortran block types */ +// OBSOLETE dst_block_block_data, +// OBSOLETE dst_block_stmt_function, +// OBSOLETE dst_block_package, /* a few particular to Ada */ +// OBSOLETE dst_block_package_body, +// OBSOLETE dst_block_subunit, +// OBSOLETE dst_block_task, +// OBSOLETE dst_block_file, /* a C outer scope? */ +// OBSOLETE dst_block_class, /* C++ or Simula */ +// OBSOLETE dst_block_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_block_type_t; +// OBSOLETE +// OBSOLETE /* Block attributes. This is the information used by the debugger to represent +// OBSOLETE the semantics of blocks. +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_block_main_entry, /* the block's entry point is a main entry into +// OBSOLETE the compilation unit */ +// OBSOLETE dst_block_executable, /* the block has an entry point */ +// OBSOLETE dst_block_attr_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_block_attr_t; +// OBSOLETE +// OBSOLETE /* Code range. Each block has associated with it one or more code ranges. An +// OBSOLETE individual code range is identified by a range of source (possibly nil) and +// OBSOLETE a range of executable code. For example, a block which has its executable +// OBSOLETE code spread over multiple sections will have one code range per section. +// OBSOLETE */ +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned long code_size; /* size of executable code (in bytes ) */ +// OBSOLETE dst_sect_ref_t code_start; /* starting address of executable code */ +// OBSOLETE dst_sect_ref_t lines_start; /* start of line number tables */ +// OBSOLETE } +// OBSOLETE dst_code_range_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_block_type_t block_type:8; +// OBSOLETE unsigned short flags:8; /* mask of dst_block_attr_t flags */ +// OBSOLETE dst_rel_offset_t sibling_block_off; /* offset to next sibling block */ +// OBSOLETE dst_rel_offset_t child_block_off; /* offset to first contained block */ +// OBSOLETE dst_rel_offset_t noffset; /* offset to block name string */ +// OBSOLETE dst_sect_ref_t symbols_start; /* start of debug symbols */ +// OBSOLETE unsigned short n_of_code_ranges; /* size of array... */ +// OBSOLETE dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_block_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*-------------------------- +// OBSOLETE AUX SECT INFO TABLE record +// OBSOLETE -------------------------- +// OBSOLETE Appears as an auxiliary to a block record. Expands code range information +// OBSOLETE by providing references into additional, language-dependent sections for +// OBSOLETE information related to specific code ranges of the block. Sect info table +// OBSOLETE entries parallel code range array entries of the same index. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned char tag; /* currently can only be zero */ +// OBSOLETE unsigned char number_of_refs; /* size of array: */ +// OBSOLETE dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_sect_info_tab_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*=================================================*/ +// OBSOLETE /*========== RECORDS IN .symbols SECTION ==========*/ +// OBSOLETE /*=================================================*/ +// OBSOLETE +// OBSOLETE /*----------------- +// OBSOLETE CONSTANT record +// OBSOLETE ----------------- +// OBSOLETE Describes a symbolic constant. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE float r; /* real part */ +// OBSOLETE float i; /* imaginary part */ +// OBSOLETE } +// OBSOLETE dst_complex_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE double dr; /* real part */ +// OBSOLETE double di; /* imaginary part */ +// OBSOLETE } +// OBSOLETE dst_double_complex_t; +// OBSOLETE +// OBSOLETE /* The following record provides a way of describing constant values with +// OBSOLETE non-standard type and no limit on size. +// OBSOLETE */ +// OBSOLETE typedef union +// OBSOLETE { +// OBSOLETE char char_data[dst_dummy_array_size]; +// OBSOLETE short int_data[dst_dummy_array_size]; +// OBSOLETE long long_data[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE dst_big_kon_t; +// OBSOLETE +// OBSOLETE /* Representation of the value of a general constant. +// OBSOLETE */ +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short length; /* size of constant value (bytes) */ +// OBSOLETE +// OBSOLETE union +// OBSOLETE { +// OBSOLETE unsigned short kon_int8; +// OBSOLETE short kon_int16; +// OBSOLETE long kon_int32 ALIGNED1; +// OBSOLETE float kon_real ALIGNED1; +// OBSOLETE double kon_dbl ALIGNED1; +// OBSOLETE dst_complex_t kon_cplx ALIGNED1; +// OBSOLETE dst_double_complex_t kon_dcplx ALIGNED1; +// OBSOLETE char kon_char; +// OBSOLETE dst_big_kon_t kon ALIGNED1; +// OBSOLETE } +// OBSOLETE val; /* value data of constant */ +// OBSOLETE } +// OBSOLETE dst_const_t ALIGNED1; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of const definition */ +// OBSOLETE dst_type_t type_desc; /* type of this (manifest) constant */ +// OBSOLETE dst_const_t value; +// OBSOLETE } +// OBSOLETE dst_rec_const_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*---------------- +// OBSOLETE VARIABLE record +// OBSOLETE ---------------- +// OBSOLETE Describes a program variable. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Variable attributes. These define certain variable semantics to the +// OBSOLETE debugger. +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_var_attr_read_only, /* is read-only (a program literal) */ +// OBSOLETE dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */ +// OBSOLETE dst_var_attr_global, /* is a global definition or reference */ +// OBSOLETE dst_var_attr_compiler_gen, /* is compiler-generated */ +// OBSOLETE dst_var_attr_static, /* has static location */ +// OBSOLETE dst_var_attr_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_var_attr_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_rel_offset_t loffset; /* offset to loc string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of variable definition */ +// OBSOLETE dst_type_t type_desc; /* type descriptor */ +// OBSOLETE unsigned short attributes; /* mask of dst_var_attr_t flags */ +// OBSOLETE } +// OBSOLETE dst_rec_variable_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*---------------- +// OBSOLETE old VAR record +// OBSOLETE ----------------- +// OBSOLETE Used by older compilers to describe a variable +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_var_loc_unknown, /* Actually defined as "unknown" */ +// OBSOLETE dst_var_loc_abs, /* Absolute address */ +// OBSOLETE dst_var_loc_sect_off, /* Absolute address as a section offset */ +// OBSOLETE dst_var_loc_ind_sect_off, /* An indexed section offset ???? */ +// OBSOLETE dst_var_loc_reg, /* register */ +// OBSOLETE dst_var_loc_reg_rel, /* register relative - usually fp */ +// OBSOLETE dst_var_loc_ind_reg_rel, /* Indexed register relative */ +// OBSOLETE dst_var_loc_ftn_ptr_based, /* Fortran pointer based */ +// OBSOLETE dst_var_loc_pc_rel, /* PC relative. Really. */ +// OBSOLETE dst_var_loc_external, /* External */ +// OBSOLETE dst_var_loc_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_var_loc_t; +// OBSOLETE +// OBSOLETE /* Locations come in two versions. The short, and the long. The difference +// OBSOLETE * between the short and the long is the addition of a statement number +// OBSOLETE * field to the start andend of the range of the long, and and unkown +// OBSOLETE * purpose field in the middle. Also, loc_type and loc_index aren't +// OBSOLETE * bitfields in the long version. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short loc_type:4; +// OBSOLETE unsigned short loc_index:12; +// OBSOLETE long location; +// OBSOLETE short start_line; /* start_line and end_line? */ +// OBSOLETE short end_line; /* I'm guessing here. */ +// OBSOLETE } +// OBSOLETE dst_var_loc_short_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short loc_type; +// OBSOLETE unsigned short loc_index; +// OBSOLETE long location; +// OBSOLETE short unknown; /* Always 0003 or 3b3c. Why? */ +// OBSOLETE short start_statement; +// OBSOLETE short start_line; +// OBSOLETE short end_statement; +// OBSOLETE short end_line; +// OBSOLETE } +// OBSOLETE dst_var_loc_long_t; +// OBSOLETE +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of description */ +// OBSOLETE dst_type_t type_desc; /* Type description */ +// OBSOLETE unsigned short attributes; /* mask of dst_var_attr_t flags */ +// OBSOLETE unsigned short no_of_locs:15; /* Number of locations */ +// OBSOLETE unsigned short short_locs:1; /* True if short locations. */ +// OBSOLETE union +// OBSOLETE { +// OBSOLETE dst_var_loc_short_t shorts[dst_dummy_array_size]; +// OBSOLETE dst_var_loc_long_t longs[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE locs; +// OBSOLETE } +// OBSOLETE dst_rec_var_t; +// OBSOLETE +// OBSOLETE /*---------------- +// OBSOLETE old LABEL record +// OBSOLETE ----------------- +// OBSOLETE Used by older compilers to describe a label +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of description */ +// OBSOLETE char location[12]; /* location string */ +// OBSOLETE } +// OBSOLETE dst_rec_old_label_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*---------------- +// OBSOLETE POINTER record +// OBSOLETE ---------------- +// OBSOLETE Describes a pointer type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to the name string for this type */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_type_t type_desc; /* base type of this pointer */ +// OBSOLETE } +// OBSOLETE dst_rec_pointer_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------- +// OBSOLETE ARRAY record +// OBSOLETE ------------- +// OBSOLETE Describes an array type. +// OBSOLETE +// OBSOLETE Multidimensional arrays are described with a number of dst_rec_array_t +// OBSOLETE records, one per array dimension, each linked to the next through the +// OBSOLETE elem_type_desc.doffset field. Each record must have its multi_dim flag +// OBSOLETE set. +// OBSOLETE +// OBSOLETE If column_major is true (as with FORTRAN arrays) then the last array bound in +// OBSOLETE the declaration is the first array index in memory, which is the opposite of +// OBSOLETE the usual case (as with Pascal and C arrays). +// OBSOLETE +// OBSOLETE Variable array bounds are described by auxiliary records; if aux_var_bound +// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are +// OBSOLETE ignored by the debugger. +// OBSOLETE +// OBSOLETE span_comp identifies one of the language-dependent ways in which the distance +// OBSOLETE between successive array elements (span) is calculated. +// OBSOLETE dst_use_span_field -- the span is the value of span field. +// OBSOLETE dst_compute_from_prev -- the span is the size of the previous dimension. +// OBSOLETE dst_compute_from_next -- the span is the size of the next dimension. +// OBSOLETE In the latter two cases, the span field contains an amount of padding to add +// OBSOLETE to the size of the appropriate dimension to calculate the span. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_use_span_field, +// OBSOLETE dst_compute_from_prev, +// OBSOLETE dst_compute_from_next, +// OBSOLETE dst_span_comp_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_span_comp_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_type_t elem_type_desc; /* array element type */ +// OBSOLETE dst_type_t indx_type_desc; /* array index type */ +// OBSOLETE long lo_bound; /* lower bound of index */ +// OBSOLETE long hi_bound; /* upper bound of index */ +// OBSOLETE unsigned long span; /* see above */ +// OBSOLETE unsigned long size; /* total array size (bytes) */ +// OBSOLETE boolean multi_dim:1; +// OBSOLETE boolean is_packed:1; /* true if packed array */ +// OBSOLETE boolean is_signed:1; /* true if packed elements are signed */ +// OBSOLETE dst_span_comp_t span_comp:2; /* how to compute span */ +// OBSOLETE boolean column_major:1; +// OBSOLETE unsigned short reserved:2; /* must be zero */ +// OBSOLETE unsigned short elem_size:8; /* element size if packed (bits) */ +// OBSOLETE } +// OBSOLETE dst_rec_array_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------- +// OBSOLETE SUBRANGE record +// OBSOLETE ----------------- +// OBSOLETE Describes a subrange type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Variable subrange bounds are described by auxiliary records; if aux_var_bound +// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are +// OBSOLETE ignored by the debugger. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of subrange definition */ +// OBSOLETE dst_type_t type_desc; /* parent type */ +// OBSOLETE long lo_bound; /* lower bound of subrange */ +// OBSOLETE long hi_bound; /* upper bound of subrange */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE } +// OBSOLETE dst_rec_subrange_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*--------------- +// OBSOLETE STRING record +// OBSOLETE --------------- +// OBSOLETE Describes a string type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Variable subrange bounds are described by auxiliary records; if aux_var_bound +// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are +// OBSOLETE ignored by the debugger. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of string definition */ +// OBSOLETE dst_type_t elem_type_desc; /* element type */ +// OBSOLETE dst_type_t indx_type_desc; /* index type */ +// OBSOLETE long lo_bound; /* lower bound */ +// OBSOLETE long hi_bound; /* upper bound */ +// OBSOLETE unsigned long size; /* total string size (bytes) if fixed */ +// OBSOLETE } +// OBSOLETE dst_rec_string_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*--------------- +// OBSOLETE SET record +// OBSOLETE --------------- +// OBSOLETE Describes a set type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_type_t type_desc; /* element type */ +// OBSOLETE unsigned short nbits; /* number of bits in set */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE } +// OBSOLETE dst_rec_set_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------------- +// OBSOLETE IMPLICIT ENUMERATION record +// OBSOLETE ----------------------------- +// OBSOLETE Describes an enumeration type with implicit element values = 0, 1, 2, ... +// OBSOLETE (Pascal-style). +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE unsigned short nelems; /* number of elements in enumeration */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE /* offsets to name strings of elements 0, 1, 2, ... */ +// OBSOLETE dst_rel_offset_t elem_noffsets[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE dst_rec_implicit_enum_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------------- +// OBSOLETE EXPLICIT ENUMERATION record +// OBSOLETE ----------------------------- +// OBSOLETE Describes an enumeration type with explicitly assigned element values +// OBSOLETE (C-style). +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to element name string */ +// OBSOLETE long value; /* element value */ +// OBSOLETE } +// OBSOLETE dst_enum_elem_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE unsigned short nelems; /* number of elements in enumeration */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE /* name/value pairs, one describing each enumeration value: */ +// OBSOLETE dst_enum_elem_t elems[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE dst_rec_explicit_enum_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE RECORD / UNION record +// OBSOLETE ----------------------- +// OBSOLETE Describes a record (struct) or union. +// OBSOLETE +// OBSOLETE If the record is larger than 2**16 bytes then an attached aux record +// OBSOLETE specifies its size. Also, if the record is stored in short form then +// OBSOLETE attached records specify field offsets larger than 2**16 bytes. +// OBSOLETE +// OBSOLETE Whether the fields[] array or sfields[] array is used is selected by +// OBSOLETE the dst_rec_type_t of the overall dst record. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* +// OBSOLETE Record field descriptor, short form. This form handles only fields which +// OBSOLETE are an even number of bytes long, located some number of bytes from the +// OBSOLETE start of the record. +// OBSOLETE */ +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to field name string */ +// OBSOLETE dst_type_t type_desc; /* field type */ +// OBSOLETE unsigned short foffset; /* field offset from start of record (bytes) */ +// OBSOLETE } +// OBSOLETE dst_short_field_t ALIGNED1; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_type_t type_desc; /* field type */ +// OBSOLETE unsigned short foffset; /* byte offset */ +// OBSOLETE unsigned short is_packed:1; /* True if field is packed */ +// OBSOLETE unsigned short bit_offset:6; /* Bit offset */ +// OBSOLETE unsigned short size:6; /* Size in bits */ +// OBSOLETE unsigned short sign:1; /* True if signed */ +// OBSOLETE unsigned short pad:2; /* Padding. Must be 0 */ +// OBSOLETE } +// OBSOLETE dst_old_field_t ALIGNED1; +// OBSOLETE +// OBSOLETE /* Tag enumeration for long record field descriptor: +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_field_byte, +// OBSOLETE dst_field_bit, +// OBSOLETE dst_field_loc, +// OBSOLETE dst_field_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_field_format_t; +// OBSOLETE +// OBSOLETE /* +// OBSOLETE Record field descriptor, long form. The format of the field information +// OBSOLETE is identified by the format_tag, which contains one of the above values. +// OBSOLETE The field_byte variant is equivalent to the short form of field descriptor. +// OBSOLETE The field_bit variant handles fields which are any number of bits long, +// OBSOLETE located some number of bits from the start of the record. The field_loc +// OBSOLETE variant allows the location of the field to be described by a general loc +// OBSOLETE string. +// OBSOLETE */ +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name of field */ +// OBSOLETE dst_type_t type_desc; /* type of field */ +// OBSOLETE union +// OBSOLETE { +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_byte */ +// OBSOLETE unsigned long offset:30; /* offset of field in bytes */ +// OBSOLETE } +// OBSOLETE field_byte ALIGNED1; +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_bit */ +// OBSOLETE unsigned long nbits:6; /* bit size of field */ +// OBSOLETE unsigned long is_signed:1; /* signed/unsigned attribute */ +// OBSOLETE unsigned long bit_offset:3; /* bit offset from byte boundary */ +// OBSOLETE int pad:4; /* must be zero */ +// OBSOLETE unsigned short byte_offset; /* offset of byte boundary */ +// OBSOLETE } +// OBSOLETE field_bit ALIGNED1; +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_loc */ +// OBSOLETE int loffset:30; /* dst_rel_offset_t to loc string */ +// OBSOLETE } +// OBSOLETE field_loc ALIGNED1; +// OBSOLETE } +// OBSOLETE f ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_field_t; +// OBSOLETE +// OBSOLETE /* The field_loc.loffset field is a 30-bit signed value. Some versions of C do +// OBSOLETE not support signed bit fields. The following macro will extract that field +// OBSOLETE as a signed value: +// OBSOLETE */ +// OBSOLETE #define dst_field_loffset(field_rec) \ +// OBSOLETE ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 ) +// OBSOLETE +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to record name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line where this record is defined */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE unsigned short nfields; /* number of fields in this record */ +// OBSOLETE union +// OBSOLETE { +// OBSOLETE dst_field_t fields[dst_dummy_array_size]; +// OBSOLETE dst_short_field_t sfields[dst_dummy_array_size]; +// OBSOLETE dst_old_field_t ofields[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE f; /* array of fields */ +// OBSOLETE } +// OBSOLETE dst_rec_record_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------- +// OBSOLETE FILE record +// OBSOLETE ------------- +// OBSOLETE Describes a file type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line where type was defined */ +// OBSOLETE dst_type_t type_desc; /* file element type */ +// OBSOLETE } +// OBSOLETE dst_rec_file_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*--------------- +// OBSOLETE OFFSET record +// OBSOLETE --------------- +// OBSOLETE Describes a Pascal offset type. +// OBSOLETE (This type, an undocumented Domain Pascal extension, is currently not +// OBSOLETE supported by the debugger) +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to the name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_type_t area_type_desc; /* area type */ +// OBSOLETE dst_type_t base_type_desc; /* base type */ +// OBSOLETE long lo_bound; /* low bound of the offset range */ +// OBSOLETE long hi_bound; /* high bound of the offset range */ +// OBSOLETE long bias; /* bias */ +// OBSOLETE unsigned short scale; /* scale factor */ +// OBSOLETE unsigned short size; /* storage size (bytes) */ +// OBSOLETE } +// OBSOLETE dst_rec_offset_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*-------------- +// OBSOLETE ALIAS record +// OBSOLETE -------------- +// OBSOLETE Describes a type alias (e.g., typedef). +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_type_t type_desc; /* parent type */ +// OBSOLETE } +// OBSOLETE dst_rec_alias_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------------ +// OBSOLETE SIGNATURE record +// OBSOLETE ------------------ +// OBSOLETE Describes a procedure/function type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Enumeration of argument semantics. Note that most are mutually +// OBSOLETE exclusive. +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_arg_attr_val, /* passed by value */ +// OBSOLETE dst_arg_attr_ref, /* passed by reference */ +// OBSOLETE dst_arg_attr_name, /* passed by name */ +// OBSOLETE dst_arg_attr_in, /* readable in the callee */ +// OBSOLETE dst_arg_attr_out, /* writable in the callee */ +// OBSOLETE dst_arg_attr_hidden, /* not visible in the caller */ +// OBSOLETE dst_arg_attr_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_arg_attr_t; +// OBSOLETE +// OBSOLETE /* Argument descriptor. Actually points to a variable record for most of the +// OBSOLETE information. +// OBSOLETE */ +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t var_offset; /* offset to variable record */ +// OBSOLETE unsigned short attributes; /* a mask of dst_arg_attr_t flags */ +// OBSOLETE } +// OBSOLETE dst_arg_t ALIGNED1; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of function definition */ +// OBSOLETE dst_rel_offset_t result; /* offset to function result variable record */ +// OBSOLETE unsigned short nargs; /* number of arguments */ +// OBSOLETE dst_arg_t args[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE dst_rec_signature_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*-------------- +// OBSOLETE SCOPE record +// OBSOLETE -------------- +// OBSOLETE Obsolete. Use the new ENTRY type instead. +// OBSOLETE Old compilers may put this in as the first entry in a function, +// OBSOLETE terminated by an end of scope entry. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* Name offset */ +// OBSOLETE dst_src_loc_t start_line; /* Starting line */ +// OBSOLETE dst_src_loc_t end_line; /* Ending line */ +// OBSOLETE } +// OBSOLETE dst_rec_scope_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*-------------- +// OBSOLETE ENTRY record +// OBSOLETE -------------- +// OBSOLETE Describes a procedure/function entry point. An entry record is to a +// OBSOLETE signature record roughly as a variable record is to a type descriptor record. +// OBSOLETE +// OBSOLETE The entry_number field is keyed to the entry numbers in .lines -- the +// OBSOLETE debugger locates the code location of an entry by searching the line +// OBSOLETE number table for an entry numbered with the value of entry_number. The +// OBSOLETE main entry is numbered zero. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to entry name string */ +// OBSOLETE dst_rel_offset_t loffset; /* where to jump to call this entry */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE dst_rel_offset_t sig_desc; /* offset to signature descriptor */ +// OBSOLETE unsigned int entry_number:8; +// OBSOLETE int pad:8; /* must be zero */ +// OBSOLETE } +// OBSOLETE dst_rec_entry_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE Old format ENTRY record +// OBSOLETE ----------------------- +// OBSOLETE Supposedly obsolete but still used by some compilers. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* Offset to entry name string */ +// OBSOLETE dst_src_loc_t src_loc; /* Location in source */ +// OBSOLETE dst_rel_offset_t sig_desc; /* Signature description */ +// OBSOLETE char unknown[36]; +// OBSOLETE } +// OBSOLETE dst_rec_old_entry_t ALIGNED1; +// OBSOLETE +// OBSOLETE /*-------------- +// OBSOLETE LABEL record +// OBSOLETE -------------- +// OBSOLETE Describes a program label. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t noffset; /* offset to label string */ +// OBSOLETE dst_rel_offset_t loffset; /* offset to loc string */ +// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ +// OBSOLETE } +// OBSOLETE dst_rec_label_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE AUXILIARY SIZE record +// OBSOLETE ----------------------- +// OBSOLETE May appear in the auxiliary record list of any type or variable record to +// OBSOLETE modify the default size of the type or variable. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned long size; /* size (bytes) */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_size_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE AUXILIARY ALIGN record +// OBSOLETE ----------------------- +// OBSOLETE May appear in the auxiliary record list of any type or variable record to +// OBSOLETE modify the default alignment of the type or variable. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short alignment; /* # of low order zero bits */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_align_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------------- +// OBSOLETE AUXILIARY FIELD SIZE record +// OBSOLETE ----------------------------- +// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to +// OBSOLETE modify the default size of a field. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short field_no; /* field number */ +// OBSOLETE unsigned long size; /* size (bits) */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_field_size_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------------- +// OBSOLETE AUXILIARY FIELD OFFSET record +// OBSOLETE ----------------------------- +// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to +// OBSOLETE specify a field offset larger than 2**16. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short field_no; /* field number */ +// OBSOLETE unsigned long foffset; /* offset */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_field_off_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------------- +// OBSOLETE AUXILIARY FIELD ALIGN record +// OBSOLETE ----------------------------- +// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to +// OBSOLETE modify the default alignment of a field. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short field_no; /* field number */ +// OBSOLETE unsigned short alignment; /* number of low order zero bits */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_field_align_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*---------------------------- +// OBSOLETE AUXILIARY VAR BOUND record +// OBSOLETE ---------------------------- +// OBSOLETE May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING +// OBSOLETE record to describe a variable bound for the range of the type. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_low_bound, /* the low bound is variable */ +// OBSOLETE dst_high_bound, /* the high bound is variable */ +// OBSOLETE dst_var_bound_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_var_bound_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short which; /* which bound */ +// OBSOLETE dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_var_bound_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*---------------------------------- +// OBSOLETE AUXILIARY TYPE DERIVATION record +// OBSOLETE ---------------------------------- +// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to denote +// OBSOLETE class inheritance of that type from a parent type. +// OBSOLETE +// OBSOLETE Inheritance implies that it is possible to convert the inheritor type to the +// OBSOLETE inherited type, retaining those fields which were inherited. To allow this, +// OBSOLETE orig_field_no, a field number into the record type, is provided. If +// OBSOLETE orig_is_pointer is false, then the start of the inherited record is located +// OBSOLETE at the location of the field indexed by orig_field_no. If orig_is_pointer +// OBSOLETE is true, then it is located at the address contained in the field indexed +// OBSOLETE by orig_field_no (assumed to be a pointer). +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_type_t parent_type; /* reference to inherited type */ +// OBSOLETE unsigned short orig_field_no; +// OBSOLETE boolean orig_is_pointer:1; +// OBSOLETE int unused:15; /* must be zero */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_type_deriv_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------------------------------ +// OBSOLETE AUXILIARY VARIABLE LIFETIME record +// OBSOLETE ------------------------------------ +// OBSOLETE May appear in the auxiliary record list of a VARIABLE record to add location +// OBSOLETE information for an additional variable lifetime. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t loffset; +// OBSOLETE } +// OBSOLETE dst_rec_aux_lifetime_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------------------------- +// OBSOLETE AUXILIARY POINTER BASE record +// OBSOLETE ------------------------------- +// OBSOLETE May appear in the auxiliary record list of a VARIABLE record to provide a +// OBSOLETE pointer base to substitute for references to any such bases in the location +// OBSOLETE string of the variable. A pointer base is another VARIABLE record. When +// OBSOLETE the variable is evaluated by the debugger, it uses the current value of the +// OBSOLETE pointer base variable in computing its location. +// OBSOLETE +// OBSOLETE This is useful for representing FORTRAN pointer-based variables. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t voffset; +// OBSOLETE } +// OBSOLETE dst_rec_aux_ptr_base_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*--------------------------------- +// OBSOLETE AUXILIARY REGISTER VALUE record +// OBSOLETE --------------------------------- +// OBSOLETE May appear in the auxiliary record list of an ENTRY record to specify +// OBSOLETE a register that must be set to a specific value before jumping to the entry +// OBSOLETE point in a debugger "call". The debugger must set the debuggee register, +// OBSOLETE specified by the register code, to the value of the *address* to which the +// OBSOLETE location string resolves. If the address is register-relative, then the +// OBSOLETE call cannot be made unless the current stack frame is the lexical parent +// OBSOLETE of the entry. An example of this is when a (Pascal) nested procedure +// OBSOLETE contains references to its parent's variables, which it accesses through +// OBSOLETE a static link register. The static link register must be set to some +// OBSOLETE address relative to the parent's stack base register. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short reg; /* identifies register to set (isp enum) */ +// OBSOLETE dst_rel_offset_t loffset; /* references a location string */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_reg_val_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*==========================================================*/ +// OBSOLETE /*========== RECORDS USED IN .blocks AND .symbols ==========*/ +// OBSOLETE /*==========================================================*/ +// OBSOLETE +// OBSOLETE /*--------------------- +// OBSOLETE STRING TABLE record +// OBSOLETE --------------------- +// OBSOLETE A string table record contains any number of null-terminated, variable length +// OBSOLETE strings. The length field gives the size in bytes of the text field, which +// OBSOLETE can be any size. +// OBSOLETE +// OBSOLETE The global name table shares this format. This record appears in the +// OBSOLETE .blocks section. Each string in the table identifies a global defined in +// OBSOLETE the current compilation unit. +// OBSOLETE +// OBSOLETE The loc pool record shares this format as well. Loc strings are described +// OBSOLETE elsewhere. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned long length; +// OBSOLETE char text[dst_dummy_array_size]; +// OBSOLETE } +// OBSOLETE dst_rec_string_tab_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*----------------------- +// OBSOLETE AUXILIARY QUAL record +// OBSOLETE ----------------------- +// OBSOLETE May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record +// OBSOLETE to provide it with a fully-qualified, language-dependent name. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t lang_qual_name; +// OBSOLETE } +// OBSOLETE dst_rec_aux_qual_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*---------------- +// OBSOLETE FORWARD record +// OBSOLETE ---------------- +// OBSOLETE Reference to a record somewhere else. This allows identical definitions in +// OBSOLETE different scopes to share data. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rel_offset_t rec_off; +// OBSOLETE } +// OBSOLETE dst_rec_forward_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------------------------- +// OBSOLETE AUXILIARY SOURCE RANGE record +// OBSOLETE ------------------------------- +// OBSOLETE May appear in the auxiliary record list of any BLOCK record to specify a +// OBSOLETE range of source lines over which the block is active. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_src_loc_t first_line; /* first source line */ +// OBSOLETE dst_src_loc_t last_line; /* last source line */ +// OBSOLETE } +// OBSOLETE dst_rec_aux_src_range_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*------------------ +// OBSOLETE EXTENSION record +// OBSOLETE ------------------ +// OBSOLETE Provision for "foreign" records, such as might be generated by a non-Apollo +// OBSOLETE compiler. Apollo software will ignore these. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE unsigned short rec_size; /* record size (bytes) */ +// OBSOLETE unsigned short ext_type; /* defined by whoever generates it */ +// OBSOLETE unsigned short ext_data; /* place-holder for arbitrary amount of data */ +// OBSOLETE } +// OBSOLETE dst_rec_extension_t ALIGNED1; +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records. +// OBSOLETE ** +// OBSOLETE ** This record ties together all previous .blocks and .symbols records +// OBSOLETE ** together in a union with a common header. The rec_type field of the +// OBSOLETE ** header identifies the record type. The rec_flags field currently only +// OBSOLETE ** defines auxiliary record lists. +// OBSOLETE ** +// OBSOLETE ** If a record carries with it a non-null auxiliary record list, its +// OBSOLETE ** dst_flag_has_aux_recs flag is set, and each of the records that follow +// OBSOLETE ** it are treated as its auxiliary records, until the end of the compilation +// OBSOLETE ** unit or scope is reached, or until an auxiliary record with its +// OBSOLETE ** dst_flag_last_aux_rec flag set is reached. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_flag_has_aux_recs, +// OBSOLETE dst_flag_last_aux_rec, +// OBSOLETE dst_rec_flag_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_rec_flags_t; +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE dst_rec_type_t rec_type:8; /* record type */ +// OBSOLETE int rec_flags:8; /* mask of dst_rec_flags_t */ +// OBSOLETE union /* switched on rec_type field above */ +// OBSOLETE { +// OBSOLETE /* dst_typ_pad requires no additional fields */ +// OBSOLETE dst_rec_comp_unit_t comp_unit_; +// OBSOLETE dst_rec_section_tab_t section_tab_; +// OBSOLETE dst_rec_file_tab_t file_tab_; +// OBSOLETE dst_rec_block_t block_; +// OBSOLETE dst_rec_var_t var_; +// OBSOLETE dst_rec_pointer_t pointer_; +// OBSOLETE dst_rec_array_t array_; +// OBSOLETE dst_rec_subrange_t subrange_; +// OBSOLETE dst_rec_set_t set_; +// OBSOLETE dst_rec_implicit_enum_t implicit_enum_; +// OBSOLETE dst_rec_explicit_enum_t explicit_enum_; +// OBSOLETE /* dst_typ_short_{rec,union} are represented by 'rec' (below) */ +// OBSOLETE dst_rec_file_t file_; +// OBSOLETE dst_rec_offset_t offset_; +// OBSOLETE dst_rec_alias_t alias_; +// OBSOLETE dst_rec_signature_t signature_; +// OBSOLETE dst_rec_old_label_t old_label_; +// OBSOLETE dst_rec_scope_t scope_; +// OBSOLETE /* dst_typ_end_scope requires no additional fields */ +// OBSOLETE dst_rec_string_tab_t string_tab_; +// OBSOLETE /* dst_typ_global_name_tab is represented by 'string_tab' (above) */ +// OBSOLETE dst_rec_forward_t forward_; +// OBSOLETE dst_rec_aux_size_t aux_size_; +// OBSOLETE dst_rec_aux_align_t aux_align_; +// OBSOLETE dst_rec_aux_field_size_t aux_field_size_; +// OBSOLETE dst_rec_aux_field_off_t aux_field_off_; +// OBSOLETE dst_rec_aux_field_align_t aux_field_align_; +// OBSOLETE dst_rec_aux_qual_t aux_qual_; +// OBSOLETE dst_rec_aux_var_bound_t aux_var_bound_; +// OBSOLETE dst_rec_extension_t extension_; +// OBSOLETE dst_rec_string_t string_; +// OBSOLETE dst_rec_const_t const_; +// OBSOLETE /* dst_typ_reference is represented by 'pointer' (above) */ +// OBSOLETE dst_rec_record_t record_; +// OBSOLETE /* dst_typ_union is represented by 'record' (above) */ +// OBSOLETE dst_rec_aux_type_deriv_t aux_type_deriv_; +// OBSOLETE /* dst_typ_locpool is represented by 'string_tab' (above) */ +// OBSOLETE dst_rec_variable_t variable_; +// OBSOLETE dst_rec_label_t label_; +// OBSOLETE dst_rec_entry_t entry_; +// OBSOLETE dst_rec_aux_lifetime_t aux_lifetime_; +// OBSOLETE dst_rec_aux_ptr_base_t aux_ptr_base_; +// OBSOLETE dst_rec_aux_src_range_t aux_src_range_; +// OBSOLETE dst_rec_aux_reg_val_t aux_reg_val_; +// OBSOLETE dst_rec_name_tab_t aux_unit_names_; +// OBSOLETE dst_rec_sect_info_tab_t aux_sect_info_; +// OBSOLETE } +// OBSOLETE rec_data ALIGNED1; +// OBSOLETE } +// OBSOLETE dst_rec_t, *dst_rec_ptr_t; +// OBSOLETE +// OBSOLETE +// OBSOLETE /*===============================================*/ +// OBSOLETE /*========== .lines SECTION DEFINITIONS =========*/ +// OBSOLETE /*===============================================*/ +// OBSOLETE /* +// OBSOLETE The .lines section contains a sequence of line number tables. There is no +// OBSOLETE record structure within the section. The start of the table for a routine +// OBSOLETE is pointed to by the block record, and the end of the table is signaled by +// OBSOLETE an escape code. +// OBSOLETE +// OBSOLETE A line number table is a sequence of bytes. The default entry contains a line +// OBSOLETE number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4 +// OBSOLETE bits. Special cases, including when one or both of the values is too large +// OBSOLETE to fit in 4 bits and other special cases are handled through escape entries. +// OBSOLETE Escape entries are identified by the value 0x8 in the high 4 bits. The low 4 +// OBSOLETE bits are occupied by a function code. Some escape entries are followed by +// OBSOLETE additional arguments, which may be bytes, words, or longwords. This data is +// OBSOLETE not aligned. +// OBSOLETE +// OBSOLETE The initial PC offset, file number and line number are zero. Normally, the +// OBSOLETE table begins with a dst_ln_file escape which establishes the initial file +// OBSOLETE and line number. All PC deltas are unsigned (thus the table is ordered by +// OBSOLETE increasing PC); line number deltas are signed. The table ends with a +// OBSOLETE dst_ln_end escape, which is followed by a final table entry whose PC delta +// OBSOLETE gives the code size of the last statement. +// OBSOLETE +// OBSOLETE Escape Semantic +// OBSOLETE --------- ------------------------------------------------------------ +// OBSOLETE file Changes file state. The current source file remains constant +// OBSOLETE until another file escape. Though the line number state is +// OBSOLETE also updated by a file escape, a file escape does NOT +// OBSOLETE constitute a line table entry. +// OBSOLETE +// OBSOLETE statement Alters the statement number of the next table entry. By +// OBSOLETE default, all table entries refer to the first statement on a +// OBSOLETE line. Statement number one is the second statement, and so on. +// OBSOLETE +// OBSOLETE entry Identifies the next table entry as the position of an entry +// OBSOLETE point for the current block. The PC position should follow +// OBSOLETE any procedure prologue code. An argument specifies the entry +// OBSOLETE number, which is keyed to the entry number of the corresponding +// OBSOLETE .symbols ENTRY record. +// OBSOLETE +// OBSOLETE exit Identifies the next table entry as the last position within +// OBSOLETE the current block before a procedure epiloge and subsequent +// OBSOLETE procedure exit. +// OBSOLETE +// OBSOLETE gap By default, the executable code corresponding to a table entry +// OBSOLETE is assumed to extend to the beginning of the next table entry. +// OBSOLETE If this is not the case--there is a "hole" in the table--then +// OBSOLETE a gap escape should follow the first table entry to specify +// OBSOLETE where the code for that entry ends. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #define dst_ln_escape_flag -8 +// OBSOLETE +// OBSOLETE /* +// OBSOLETE Escape function codes: +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_ln_pad, /* pad byte */ +// OBSOLETE dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */ +// OBSOLETE dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */ +// OBSOLETE dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */ +// OBSOLETE dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ +// OBSOLETE dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */ +// OBSOLETE dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ +// OBSOLETE dst_ln_ln_off, /* statement escape, stmt # = next byte */ +// OBSOLETE dst_ln_entry, /* entry escape, next byte is entry number */ +// OBSOLETE dst_ln_exit, /* exit escape */ +// OBSOLETE dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ +// OBSOLETE dst_ln_escape_11, /* reserved */ +// OBSOLETE dst_ln_escape_12, /* reserved */ +// OBSOLETE dst_ln_escape_13, /* reserved */ +// OBSOLETE dst_ln_nxt_byte, /* next byte contains the real escape code */ +// OBSOLETE dst_ln_end, /* end escape, final entry follows */ +// OBSOLETE dst_ln_escape_END_OF_ENUM +// OBSOLETE } +// OBSOLETE dst_ln_escape_t; +// OBSOLETE +// OBSOLETE /* +// OBSOLETE Line number table entry +// OBSOLETE */ +// OBSOLETE typedef union +// OBSOLETE { +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE unsigned int ln_delta:4; /* 4 bit line number delta */ +// OBSOLETE unsigned int pc_delta:4; /* 4 bit pc delta */ +// OBSOLETE } +// OBSOLETE delta; +// OBSOLETE +// OBSOLETE struct +// OBSOLETE { +// OBSOLETE unsigned int esc_flag:4; /* alias for ln_delta */ +// OBSOLETE dst_ln_escape_t esc_code:4; /* escape function code */ +// OBSOLETE } +// OBSOLETE esc; +// OBSOLETE +// OBSOLETE char sdata; /* signed data byte */ +// OBSOLETE unsigned char udata; /* unsigned data byte */ +// OBSOLETE } +// OBSOLETE dst_ln_entry_t, +// OBSOLETE *dst_ln_entry_ptr_t, +// OBSOLETE dst_ln_table_t[dst_dummy_array_size]; +// OBSOLETE +// OBSOLETE /* The following macro will extract the ln_delta field as a signed value: +// OBSOLETE */ +// OBSOLETE #define dst_ln_ln_delta(ln_rec) \ +// OBSOLETE ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 ) +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE typedef struct dst_sec_struct +// OBSOLETE { +// OBSOLETE char *buffer; +// OBSOLETE long position; +// OBSOLETE long size; +// OBSOLETE long base; +// OBSOLETE } +// OBSOLETE dst_sec; +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Macros for access to the data */ +// OBSOLETE +// OBSOLETE #define DST_comp_unit(x) ((x)->rec_data.comp_unit_) +// OBSOLETE #define DST_section_tab(x) ((x)->rec_data.section_tab_) +// OBSOLETE #define DST_file_tab(x) ((x)->rec_data.file_tab_) +// OBSOLETE #define DST_block(x) ((x)->rec_data.block_) +// OBSOLETE #define DST_var(x) ((x)->rec_data.var_) +// OBSOLETE #define DST_pointer(x) ((x)->rec_data.pointer_) +// OBSOLETE #define DST_array(x) ((x)->rec_data.array_) +// OBSOLETE #define DST_subrange(x) ((x)->rec_data.subrange_) +// OBSOLETE #define DST_set(x) ((x)->rec_data.set_) +// OBSOLETE #define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_) +// OBSOLETE #define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_) +// OBSOLETE #define DST_short_rec(x) ((x)->rec_data.record_) +// OBSOLETE #define DST_short_union(x) ((x)->rec_data.record_) +// OBSOLETE #define DST_file(x) ((x)->rec_data.file_) +// OBSOLETE #define DST_offset(x) ((x)->rec_data.offset_) +// OBSOLETE #define DST_alias(x) ((x)->rec_data.alias_) +// OBSOLETE #define DST_signature(x) ((x)->rec_data.signature_) +// OBSOLETE #define DST_old_label(x) ((x)->rec_data.old_label_) +// OBSOLETE #define DST_scope(x) ((x)->rec_data.scope_) +// OBSOLETE #define DST_string_tab(x) ((x)->rec_data.string_tab_) +// OBSOLETE #define DST_global_name_tab(x) ((x)->rec_data.string_tab_) +// OBSOLETE #define DST_forward(x) ((x)->rec_data.forward_) +// OBSOLETE #define DST_aux_size(x) ((x)->rec_data.aux_size_) +// OBSOLETE #define DST_aux_align(x) ((x)->rec_data.aux_align_) +// OBSOLETE #define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_) +// OBSOLETE #define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_) +// OBSOLETE #define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_) +// OBSOLETE #define DST_aux_qual(x) ((x)->rec_data.aux_qual_) +// OBSOLETE #define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_) +// OBSOLETE #define DST_extension(x) ((x)->rec_data.extension_) +// OBSOLETE #define DST_string(x) ((x)->rec_data.string_) +// OBSOLETE #define DST_const(x) ((x)->rec_data.const_) +// OBSOLETE #define DST_reference(x) ((x)->rec_data.pointer_) +// OBSOLETE #define DST_record(x) ((x)->rec_data.record_) +// OBSOLETE #define DST_union(x) ((x)->rec_data.record_) +// OBSOLETE #define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_) +// OBSOLETE #define DST_locpool(x) ((x)->rec_data.string_tab_) +// OBSOLETE #define DST_variable(x) ((x)->rec_data.variable_) +// OBSOLETE #define DST_label(x) ((x)->rec_data.label_) +// OBSOLETE #define DST_entry(x) ((x)->rec_data.entry_) +// OBSOLETE #define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_) +// OBSOLETE #define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_) +// OBSOLETE #define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_) +// OBSOLETE #define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_) +// OBSOLETE #define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_) +// OBSOLETE #define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_) +// OBSOLETE +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * Type codes for loc strings. I'm not entirely certain about all of +// OBSOLETE * these, but they seem to work. +// OBSOLETE * troy@cbme.unsw.EDU.AU +// OBSOLETE * If you find a variable whose location can't be decoded, you should +// OBSOLETE * find out it's code using "dstdump -s filename". It will record an +// OBSOLETE * entry for the variable, and give a text representation of what +// OBSOLETE * the locstring means. Before that explaination there will be a +// OBSOLETE * number. In the LOCSTRING table, that number will appear before +// OBSOLETE * the start of the location string. Location string codes are +// OBSOLETE * five bit codes with a 3 bit argument. Check the high 5 bits of +// OBSOLETE * the one byte code, and figure out where it goes in here. +// OBSOLETE * Then figure out exactly what the meaning is and code it in +// OBSOLETE * dstread.c +// OBSOLETE * +// OBSOLETE * Note that ranged locs mean that the variable is in different locations +// OBSOLETE * depending on the current PC. We ignore these because (a) gcc can't handle +// OBSOLETE * them, and (b), If you don't use high levels of optimisation they won't +// OBSOLETE * occur. +// OBSOLETE */ +// OBSOLETE typedef enum +// OBSOLETE { +// OBSOLETE dst_lsc_end, /* End of string */ +// OBSOLETE dst_lsc_indirect, /* Indirect through previous. Arg == 6 */ +// OBSOLETE /* Or register ax (x=arg) */ +// OBSOLETE dst_lsc_dreg, /* register dx (x=arg) */ +// OBSOLETE dst_lsc_03, +// OBSOLETE dst_lsc_section, /* Section (arg+1) */ +// OBSOLETE dst_lsc_05, +// OBSOLETE dst_lsc_06, +// OBSOLETE dst_lsc_add, /* Add (arg+1)*2 */ +// OBSOLETE dst_lsc_sub, /* Subtract (arg+1)*2 */ +// OBSOLETE dst_lsc_09, +// OBSOLETE dst_lsc_0a, +// OBSOLETE dst_lsc_sec_byte, /* Section of next byte+1 */ +// OBSOLETE dst_lsc_add_byte, /* Add next byte (arg == 5) or next word +// OBSOLETE * (arg == 6) +// OBSOLETE */ +// OBSOLETE dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next +// OBSOLETE * word (arg == 6 ?) +// OBSOLETE */ +// OBSOLETE dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0 */ +// OBSOLETE dst_lsc_0f, +// OBSOLETE dst_lsc_ranged, /* location is pc dependent */ +// OBSOLETE dst_lsc_11, +// OBSOLETE dst_lsc_12, +// OBSOLETE dst_lsc_13, +// OBSOLETE dst_lsc_14, +// OBSOLETE dst_lsc_15, +// OBSOLETE dst_lsc_16, +// OBSOLETE dst_lsc_17, +// OBSOLETE dst_lsc_18, +// OBSOLETE dst_lsc_19, +// OBSOLETE dst_lsc_1a, +// OBSOLETE dst_lsc_1b, +// OBSOLETE dst_lsc_1c, +// OBSOLETE dst_lsc_1d, +// OBSOLETE dst_lsc_1e, +// OBSOLETE dst_lsc_1f +// OBSOLETE } +// OBSOLETE dst_loc_string_code_t; +// OBSOLETE +// OBSOLETE /* If the following occurs after an addition/subtraction, that addition +// OBSOLETE * or subtraction should be multiplied by 256. It's a complete byte, not +// OBSOLETE * a code. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #define dst_multiply_256 ((char) 0x73) +// OBSOLETE +// OBSOLETE typedef struct +// OBSOLETE { +// OBSOLETE char code:5; +// OBSOLETE char arg:3; +// OBSOLETE } +// OBSOLETE dst_loc_header_t ALIGNED1; +// OBSOLETE +// OBSOLETE typedef union +// OBSOLETE { +// OBSOLETE dst_loc_header_t header; +// OBSOLETE char data; +// OBSOLETE } +// OBSOLETE dst_loc_entry_t ALIGNED1; +// OBSOLETE +// OBSOLETE #undef ALIGNED1 +// OBSOLETE #endif /* apollo_dst_h */ diff --git a/gdb/dstread.c b/gdb/dstread.c index 544d7ddf625..8692c986467 100644 --- a/gdb/dstread.c +++ b/gdb/dstread.c @@ -1,1598 +1,1598 @@ -/* Read apollo DST symbol tables and convert to internal format, for GDB. - Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au). - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - 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 "symtab.h" -#include "gdbtypes.h" -#include "breakpoint.h" -#include "bfd.h" -#include "symfile.h" -#include "objfiles.h" -#include "buildsym.h" -#include "gdb_obstack.h" - -#include "gdb_string.h" - -#include "dst.h" - -CORE_ADDR cur_src_start_addr, cur_src_end_addr; -dst_sec blocks_info, lines_info, symbols_info; - -/* Vector of line number information. */ - -static struct linetable *line_vector; - -/* Index of next entry to go in line_vector_index. */ - -static int line_vector_index; - -/* Last line number recorded in the line vector. */ - -static int prev_line_number; - -/* Number of elements allocated for line_vector currently. */ - -static int line_vector_length; - -static int init_dst_sections (int); - -static void read_dst_symtab (struct objfile *); - -static void find_dst_sections (bfd *, sec_ptr, PTR); - -static void dst_symfile_init (struct objfile *); - -static void dst_new_init (struct objfile *); - -static void dst_symfile_read (struct objfile *, int); - -static void dst_symfile_finish (struct objfile *); - -static void dst_end_symtab (struct objfile *); - -static void complete_symtab (char *, CORE_ADDR, unsigned int); - -static void dst_start_symtab (void); - -static void dst_record_line (int, CORE_ADDR); - -/* Manage the vector of line numbers. */ -/* FIXME: Use record_line instead. */ - -static void -dst_record_line (int line, CORE_ADDR pc) -{ - struct linetable_entry *e; - /* Make sure line vector is big enough. */ - - if (line_vector_index + 2 >= line_vector_length) - { - line_vector_length *= 2; - line_vector = (struct linetable *) - xrealloc ((char *) line_vector, sizeof (struct linetable) - + (line_vector_length - * sizeof (struct linetable_entry))); - } - - e = line_vector->item + line_vector_index++; - e->line = line; - e->pc = pc; -} - -/* Start a new symtab for a new source file. - It indicates the start of data for one original source file. */ -/* FIXME: use start_symtab, like coffread.c now does. */ - -static void -dst_start_symtab (void) -{ - /* Initialize the source file line number information for this file. */ - - if (line_vector) /* Unlikely, but maybe possible? */ - xfree (line_vector); - line_vector_index = 0; - line_vector_length = 1000; - prev_line_number = -2; /* Force first line number to be explicit */ - line_vector = (struct linetable *) - xmalloc (sizeof (struct linetable) - + line_vector_length * sizeof (struct linetable_entry)); -} - -/* Save the vital information from when starting to read a file, - for use when closing off the current file. - NAME is the file name the symbols came from, START_ADDR is the first - text address for the file, and SIZE is the number of bytes of text. */ - -static void -complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size) -{ - last_source_file = savestring (name, strlen (name)); - cur_src_start_addr = start_addr; - cur_src_end_addr = start_addr + size; - - if (current_objfile->ei.entry_point >= cur_src_start_addr && - current_objfile->ei.entry_point < cur_src_end_addr) - { - current_objfile->ei.entry_file_lowpc = cur_src_start_addr; - current_objfile->ei.entry_file_highpc = cur_src_end_addr; - } -} - -/* Finish the symbol definitions for one main source file, - close off all the lexical contexts for that file - (creating struct block's for them), then make the - struct symtab for that file and put it in the list of all such. */ -/* FIXME: Use end_symtab, like coffread.c now does. */ - -static void -dst_end_symtab (struct objfile *objfile) -{ - register struct symtab *symtab; - register struct blockvector *blockvector; - register struct linetable *lv; - - /* Create the blockvector that points to all the file's blocks. */ - - blockvector = make_blockvector (objfile); - - /* Now create the symtab object for this source file. */ - symtab = allocate_symtab (last_source_file, objfile); - - /* Fill in its components. */ - symtab->blockvector = blockvector; - symtab->free_code = free_linetable; - symtab->free_ptr = 0; - symtab->filename = last_source_file; - symtab->dirname = NULL; - symtab->debugformat = obsavestring ("Apollo DST", 10, - &objfile->symbol_obstack); - lv = line_vector; - lv->nitems = line_vector_index; - symtab->linetable = (struct linetable *) - xrealloc ((char *) lv, (sizeof (struct linetable) - + lv->nitems * sizeof (struct linetable_entry))); - - free_named_symtabs (symtab->filename); - - /* Reinitialize for beginning of new file. */ - line_vector = 0; - line_vector_length = -1; - last_source_file = NULL; -} - -/* dst_symfile_init () - is the dst-specific initialization routine for reading symbols. - - We will only be called if this is a DST or DST-like file. - BFD handles figuring out the format of the file, and code in symtab.c - uses BFD's determination to vector to us. - - The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */ - -static void -dst_symfile_init (struct objfile *objfile) -{ - asection *section; - bfd *abfd = objfile->obfd; - - init_entry_point_info (objfile); - -} - -/* This function is called for every section; it finds the outer limits - of the line table (minimum and maximum file offset) so that the - mainline code can read the whole thing for efficiency. */ - -/* ARGSUSED */ -static void -find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo) -{ - int size, count; - long base; - file_ptr offset, maxoff; - dst_sec *section; - -/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ - size = asect->_raw_size; - offset = asect->filepos; - base = asect->vma; -/* End of warning */ - - section = NULL; - if (!strcmp (asect->name, ".blocks")) - section = &blocks_info; - else if (!strcmp (asect->name, ".lines")) - section = &lines_info; - else if (!strcmp (asect->name, ".symbols")) - section = &symbols_info; - if (!section) - return; - section->size = size; - section->position = offset; - section->base = base; -} - - -/* The BFD for this file -- only good while we're actively reading - symbols into a psymtab or a symtab. */ - -static bfd *symfile_bfd; - -/* Read a symbol file, after initialization by dst_symfile_init. */ -/* FIXME! Addr and Mainline are not used yet -- this will not work for - shared libraries or add_file! */ - -/* ARGSUSED */ -static void -dst_symfile_read (struct objfile *objfile, int mainline) -{ - bfd *abfd = objfile->obfd; - char *name = bfd_get_filename (abfd); - int desc; - register int val; - int num_symbols; - int symtab_offset; - int stringtab_offset; - - symfile_bfd = abfd; /* Kludge for swap routines */ - -/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ - desc = fileno ((FILE *) (abfd->iostream)); /* File descriptor */ - - /* Read the line number table, all at once. */ - bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL); - - val = init_dst_sections (desc); - if (val < 0) - error ("\"%s\": error reading debugging symbol tables\n", name); - - init_minimal_symbol_collection (); - make_cleanup_discard_minimal_symbols (); - - /* Now that the executable file is positioned at symbol table, - process it and define symbols accordingly. */ - - read_dst_symtab (objfile); - - /* Sort symbols alphabetically within each block. */ - - { - struct symtab *s; - for (s = objfile->symtabs; s != NULL; s = s->next) - { - sort_symtab_syms (s); - } - } - - /* Install any minimal symbols that have been collected as the current - minimal symbols for this objfile. */ - - install_minimal_symbols (objfile); -} - -static void -dst_new_init (struct objfile *ignore) -{ - /* Nothin' to do */ -} - -/* Perform any local cleanups required when we are done with a particular - objfile. I.E, we are in the process of discarding all symbol information - for an objfile, freeing up all memory held for it, and unlinking the - objfile struct from the global list of known objfiles. */ - -static void -dst_symfile_finish (struct objfile *objfile) -{ - /* Nothing to do */ -} - - -/* Get the next line number from the DST. Returns 0 when we hit an - * end directive or cannot continue for any other reason. - * - * Note that ordinary pc deltas are multiplied by two. Apparently - * this is what was really intended. - */ -static int -get_dst_line (signed char **buffer, long *pc) -{ - static last_pc = 0; - static long last_line = 0; - static int last_file = 0; - dst_ln_entry_ptr_t entry; - int size; - dst_src_loc_t *src_loc; - - if (*pc != -1) - { - last_pc = *pc; - *pc = -1; - } - entry = (dst_ln_entry_ptr_t) * buffer; - - while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag) - { - switch (entry->esc.esc_code) - { - case dst_ln_pad: - size = 1; /* pad byte */ - break; - case dst_ln_file: - /* file escape. Next 4 bytes are a dst_src_loc_t */ - size = 5; - src_loc = (dst_src_loc_t *) (*buffer + 1); - last_line = src_loc->line_number; - last_file = src_loc->file_index; - break; - case dst_ln_dln1_dpc1: - /* 1 byte line delta, 1 byte pc delta */ - last_line += (*buffer)[1]; - last_pc += 2 * (unsigned char) (*buffer)[2]; - dst_record_line (last_line, last_pc); - size = 3; - break; - case dst_ln_dln2_dpc2: - /* 2 bytes line delta, 2 bytes pc delta */ - last_line += *(short *) (*buffer + 1); - last_pc += 2 * (*(short *) (*buffer + 3)); - size = 5; - dst_record_line (last_line, last_pc); - break; - case dst_ln_ln4_pc4: - /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ - last_line = *(unsigned long *) (*buffer + 1); - last_pc = *(unsigned long *) (*buffer + 5); - size = 9; - dst_record_line (last_line, last_pc); - break; - case dst_ln_dln1_dpc0: - /* 1 byte line delta, pc delta = 0 */ - size = 2; - last_line += (*buffer)[1]; - break; - case dst_ln_ln_off_1: - /* statement escape, stmt # = 1 (2nd stmt on line) */ - size = 1; - break; - case dst_ln_ln_off: - /* statement escape, stmt # = next byte */ - size = 2; - break; - case dst_ln_entry: - /* entry escape, next byte is entry number */ - size = 2; - break; - case dst_ln_exit: - /* exit escape */ - size = 1; - break; - case dst_ln_stmt_end: - /* gap escape, 4 bytes pc delta */ - size = 5; - /* last_pc += 2 * (*(long *) (*buffer + 1)); */ - /* Apparently this isn't supposed to actually modify - * the pc value. Totally weird. - */ - break; - case dst_ln_escape_11: - case dst_ln_escape_12: - case dst_ln_escape_13: - size = 1; - break; - case dst_ln_nxt_byte: - /* This shouldn't happen. If it does, we're SOL */ - return 0; - break; - case dst_ln_end: - /* end escape, final entry follows */ - return 0; - } - *buffer += (size < 0) ? -size : size; - entry = (dst_ln_entry_ptr_t) * buffer; - } - last_line += dst_ln_ln_delta (*entry); - last_pc += entry->delta.pc_delta * 2; - (*buffer)++; - dst_record_line (last_line, last_pc); - return 1; -} - -static void -enter_all_lines (char *buffer, long address) -{ - if (buffer) - while (get_dst_line (&buffer, &address)); -} - -static int -get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry) -{ - int size; - dst_rec_ptr_t entry; - static int last_type; - int ar_size; - static unsigned lu3; - - entry = (dst_rec_ptr_t) buffer; - switch (entry->rec_type) - { - case dst_typ_pad: - size = 0; - break; - case dst_typ_comp_unit: - size = sizeof (DST_comp_unit (entry)); - break; - case dst_typ_section_tab: - size = sizeof (DST_section_tab (entry)) - + ((int) DST_section_tab (entry).number_of_sections - - dst_dummy_array_size) * sizeof (long); - break; - case dst_typ_file_tab: - size = sizeof (DST_file_tab (entry)) - + ((int) DST_file_tab (entry).number_of_files - - dst_dummy_array_size) * sizeof (dst_file_desc_t); - break; - case dst_typ_block: - size = sizeof (DST_block (entry)) - + ((int) DST_block (entry).n_of_code_ranges - - dst_dummy_array_size) * sizeof (dst_code_range_t); - break; - case dst_typ_5: - size = -1; - break; - case dst_typ_var: - size = sizeof (DST_var (entry)) - - sizeof (dst_var_loc_long_t) * dst_dummy_array_size + - DST_var (entry).no_of_locs * - (DST_var (entry).short_locs ? - sizeof (dst_var_loc_short_t) : - sizeof (dst_var_loc_long_t)); - break; - case dst_typ_pointer: - size = sizeof (DST_pointer (entry)); - break; - case dst_typ_array: - size = sizeof (DST_array (entry)); - break; - case dst_typ_subrange: - size = sizeof (DST_subrange (entry)); - break; - case dst_typ_set: - size = sizeof (DST_set (entry)); - break; - case dst_typ_implicit_enum: - size = sizeof (DST_implicit_enum (entry)) - + ((int) DST_implicit_enum (entry).nelems - - dst_dummy_array_size) * sizeof (dst_rel_offset_t); - break; - case dst_typ_explicit_enum: - size = sizeof (DST_explicit_enum (entry)) - + ((int) DST_explicit_enum (entry).nelems - - dst_dummy_array_size) * sizeof (dst_enum_elem_t); - break; - case dst_typ_short_rec: - size = sizeof (DST_short_rec (entry)) - + DST_short_rec (entry).nfields * sizeof (dst_short_field_t) - - dst_dummy_array_size * sizeof (dst_field_t); - break; - case dst_typ_short_union: - size = sizeof (DST_short_union (entry)) - + DST_short_union (entry).nfields * sizeof (dst_short_field_t) - - dst_dummy_array_size * sizeof (dst_field_t); - break; - case dst_typ_file: - size = sizeof (DST_file (entry)); - break; - case dst_typ_offset: - size = sizeof (DST_offset (entry)); - break; - case dst_typ_alias: - size = sizeof (DST_alias (entry)); - break; - case dst_typ_signature: - size = sizeof (DST_signature (entry)) + - ((int) DST_signature (entry).nargs - - dst_dummy_array_size) * sizeof (dst_arg_t); - break; - case dst_typ_21: - size = -1; - break; - case dst_typ_old_label: - size = sizeof (DST_old_label (entry)); - break; - case dst_typ_scope: - size = sizeof (DST_scope (entry)); - break; - case dst_typ_end_scope: - size = 0; - break; - case dst_typ_25: - case dst_typ_26: - size = -1; - break; - case dst_typ_string_tab: - case dst_typ_global_name_tab: - size = sizeof (DST_string_tab (entry)) - + DST_string_tab (entry).length - - dst_dummy_array_size; - break; - case dst_typ_forward: - size = sizeof (DST_forward (entry)); - get_dst_entry ((char *) entry + DST_forward (entry).rec_off, &entry); - break; - case dst_typ_aux_size: - size = sizeof (DST_aux_size (entry)); - break; - case dst_typ_aux_align: - size = sizeof (DST_aux_align (entry)); - break; - case dst_typ_aux_field_size: - size = sizeof (DST_aux_field_size (entry)); - break; - case dst_typ_aux_field_off: - size = sizeof (DST_aux_field_off (entry)); - break; - case dst_typ_aux_field_align: - size = sizeof (DST_aux_field_align (entry)); - break; - case dst_typ_aux_qual: - size = sizeof (DST_aux_qual (entry)); - break; - case dst_typ_aux_var_bound: - size = sizeof (DST_aux_var_bound (entry)); - break; - case dst_typ_extension: - size = DST_extension (entry).rec_size; - break; - case dst_typ_string: - size = sizeof (DST_string (entry)); - break; - case dst_typ_old_entry: - size = 48; /* Obsolete entry type */ - break; - case dst_typ_const: - size = sizeof (DST_const (entry)) - + DST_const (entry).value.length - - sizeof (DST_const (entry).value.val); - break; - case dst_typ_reference: - size = sizeof (DST_reference (entry)); - break; - case dst_typ_old_record: - case dst_typ_old_union: - case dst_typ_record: - case dst_typ_union: - size = sizeof (DST_record (entry)) - + ((int) DST_record (entry).nfields - - dst_dummy_array_size) * sizeof (dst_field_t); - break; - case dst_typ_aux_type_deriv: - size = sizeof (DST_aux_type_deriv (entry)); - break; - case dst_typ_locpool: - size = sizeof (DST_locpool (entry)) - + ((int) DST_locpool (entry).length - - dst_dummy_array_size); - break; - case dst_typ_variable: - size = sizeof (DST_variable (entry)); - break; - case dst_typ_label: - size = sizeof (DST_label (entry)); - break; - case dst_typ_entry: - size = sizeof (DST_entry (entry)); - break; - case dst_typ_aux_lifetime: - size = sizeof (DST_aux_lifetime (entry)); - break; - case dst_typ_aux_ptr_base: - size = sizeof (DST_aux_ptr_base (entry)); - break; - case dst_typ_aux_src_range: - size = sizeof (DST_aux_src_range (entry)); - break; - case dst_typ_aux_reg_val: - size = sizeof (DST_aux_reg_val (entry)); - break; - case dst_typ_aux_unit_names: - size = sizeof (DST_aux_unit_names (entry)) - + ((int) DST_aux_unit_names (entry).number_of_names - - dst_dummy_array_size) * sizeof (dst_rel_offset_t); - break; - case dst_typ_aux_sect_info: - size = sizeof (DST_aux_sect_info (entry)) - + ((int) DST_aux_sect_info (entry).number_of_refs - - dst_dummy_array_size) * sizeof (dst_sect_ref_t); - break; - default: - size = -1; - break; - } - if (size == -1) - { - fprintf_unfiltered (gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n", - (int) entry->rec_type, - last_type); - fprintf_unfiltered (gdb_stderr, "Last unknown_3 value: %d\n", lu3); - size = 0; - } - else - last_type = entry->rec_type; - if (size & 1) /* Align on a word boundary */ - size++; - size += 2; - *ret_entry = entry; - return size; -} - -static int -next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table) -{ - if (*buffer - table->buffer >= table->size) - { - *entry = NULL; - return 0; - } - *buffer += get_dst_entry (*buffer, entry); - return 1; -} - -#define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info) -#define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info) -#define DST_OFFSET(a, b) ((char *) (a) + (b)) - -static dst_rec_ptr_t section_table = NULL; - -char * -get_sec_ref (dst_sect_ref_t *ref) -{ - dst_sec *section = NULL; - long offset; - - if (!section_table || !ref->sect_index) - return NULL; - offset = DST_section_tab (section_table).section_base[ref->sect_index - 1] - + ref->sect_offset; - if (offset >= blocks_info.base && - offset < blocks_info.base + blocks_info.size) - section = &blocks_info; - else if (offset >= symbols_info.base && - offset < symbols_info.base + symbols_info.size) - section = &symbols_info; - else if (offset >= lines_info.base && - offset < lines_info.base + lines_info.size) - section = &lines_info; - if (!section) - return NULL; - return section->buffer + (offset - section->base); -} - -CORE_ADDR -dst_get_addr (int section, long offset) -{ - if (!section_table || !section) - return 0; - return DST_section_tab (section_table).section_base[section - 1] + offset; -} - -CORE_ADDR -dst_sym_addr (dst_sect_ref_t *ref) -{ - if (!section_table || !ref->sect_index) - return 0; - return DST_section_tab (section_table).section_base[ref->sect_index - 1] - + ref->sect_offset; -} - -static struct symbol * -create_new_symbol (struct objfile *objfile, char *name) -{ - struct symbol *sym = (struct symbol *) - obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); - memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = obsavestring (name, strlen (name), - &objfile->symbol_obstack); - SYMBOL_VALUE (sym) = 0; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; - - SYMBOL_CLASS (sym) = LOC_BLOCK; - return sym; -}; - -static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t); - -static struct type * -decode_type_desc (struct objfile *objfile, dst_type_t *type_desc, - dst_rec_ptr_t base) -{ - struct type *type; - dst_rec_ptr_t entry; - if (type_desc->std_type.user_defined_type) - { - entry = (dst_rec_ptr_t) DST_OFFSET (base, - dst_user_type_offset (*type_desc)); - type = decode_dst_type (objfile, entry); - } - else - { - switch (type_desc->std_type.dtc) - { - case dst_int8_type: - type = builtin_type_signed_char; - break; - case dst_int16_type: - type = builtin_type_short; - break; - case dst_int32_type: - type = builtin_type_long; - break; - case dst_uint8_type: - type = builtin_type_unsigned_char; - break; - case dst_uint16_type: - type = builtin_type_unsigned_short; - break; - case dst_uint32_type: - type = builtin_type_unsigned_long; - break; - case dst_real32_type: - type = builtin_type_float; - break; - case dst_real64_type: - type = builtin_type_double; - break; - case dst_complex_type: - type = builtin_type_complex; - break; - case dst_dcomplex_type: - type = builtin_type_double_complex; - break; - case dst_bool8_type: - type = builtin_type_char; - break; - case dst_bool16_type: - type = builtin_type_short; - break; - case dst_bool32_type: - type = builtin_type_long; - break; - case dst_char_type: - type = builtin_type_char; - break; - /* The next few are more complex. I will take care - * of them properly at a later point. - */ - case dst_string_type: - type = builtin_type_void; - break; - case dst_ptr_type: - type = builtin_type_void; - break; - case dst_set_type: - type = builtin_type_void; - break; - case dst_proc_type: - type = builtin_type_void; - break; - case dst_func_type: - type = builtin_type_void; - break; - /* Back tto some ordinary ones */ - case dst_void_type: - type = builtin_type_void; - break; - case dst_uchar_type: - type = builtin_type_unsigned_char; - break; - default: - type = builtin_type_void; - break; - } - } - return type; -} - -struct structure_list -{ - struct structure_list *next; - struct type *type; -}; - -static struct structure_list *struct_list = NULL; - -static struct type * -find_dst_structure (char *name) -{ - struct structure_list *element; - - for (element = struct_list; element; element = element->next) - if (!strcmp (name, TYPE_NAME (element->type))) - return element->type; - return NULL; -} - - -static struct type * -decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code, - int version) -{ - struct type *type, *child_type; - char *struct_name; - char *name, *field_name; - int i; - int fieldoffset, fieldsize; - dst_type_t type_desc; - struct structure_list *element; - - struct_name = DST_OFFSET (entry, DST_record (entry).noffset); - name = concat ((code == TYPE_CODE_UNION) ? "union " : "struct ", - struct_name, NULL); - type = find_dst_structure (name); - if (type) - { - xfree (name); - return type; - } - type = alloc_type (objfile); - TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack, - name, strlen (name)); - xfree (name); - TYPE_CODE (type) = code; - TYPE_LENGTH (type) = DST_record (entry).size; - TYPE_NFIELDS (type) = DST_record (entry).nfields; - TYPE_FIELDS (type) = (struct field *) - obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * - DST_record (entry).nfields); - fieldoffset = fieldsize = 0; - INIT_CPLUS_SPECIFIC (type); - element = (struct structure_list *) - xmalloc (sizeof (struct structure_list)); - element->type = type; - element->next = struct_list; - struct_list = element; - for (i = 0; i < DST_record (entry).nfields; i++) - { - switch (version) - { - case 2: - field_name = DST_OFFSET (entry, - DST_record (entry).f.ofields[i].noffset); - fieldoffset = DST_record (entry).f.ofields[i].foffset * 8 + - DST_record (entry).f.ofields[i].bit_offset; - fieldsize = DST_record (entry).f.ofields[i].size; - type_desc = DST_record (entry).f.ofields[i].type_desc; - break; - case 1: - field_name = DST_OFFSET (entry, - DST_record (entry).f.fields[i].noffset); - type_desc = DST_record (entry).f.fields[i].type_desc; - switch (DST_record (entry).f.fields[i].f.field_loc.format_tag) - { - case dst_field_byte: - fieldoffset = DST_record (entry).f. - fields[i].f.field_byte.offset * 8; - fieldsize = -1; - break; - case dst_field_bit: - fieldoffset = DST_record (entry).f. - fields[i].f.field_bit.byte_offset * 8 + - DST_record (entry).f. - fields[i].f.field_bit.bit_offset; - fieldsize = DST_record (entry).f. - fields[i].f.field_bit.nbits; - break; - case dst_field_loc: - fieldoffset += fieldsize; - fieldsize = -1; - break; - } - break; - case 0: - field_name = DST_OFFSET (entry, - DST_record (entry).f.sfields[i].noffset); - fieldoffset = DST_record (entry).f.sfields[i].foffset; - type_desc = DST_record (entry).f.sfields[i].type_desc; - if (i < DST_record (entry).nfields - 1) - fieldsize = DST_record (entry).f.sfields[i + 1].foffset; - else - fieldsize = DST_record (entry).size; - fieldsize -= fieldoffset; - fieldoffset *= 8; - fieldsize *= 8; - } - TYPE_FIELDS (type)[i].name = - obstack_copy0 (&objfile->symbol_obstack, - field_name, strlen (field_name)); - TYPE_FIELDS (type)[i].type = decode_type_desc (objfile, - &type_desc, - entry); - if (fieldsize == -1) - fieldsize = TYPE_LENGTH (TYPE_FIELDS (type)[i].type) * - 8; - TYPE_FIELDS (type)[i].bitsize = fieldsize; - TYPE_FIELDS (type)[i].bitpos = fieldoffset; - } - return type; -} - -static struct type * -decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry) -{ - struct type *child_type, *type, *range_type, *index_type; - - switch (entry->rec_type) - { - case dst_typ_var: - return decode_type_desc (objfile, - &DST_var (entry).type_desc, - entry); - break; - case dst_typ_variable: - return decode_type_desc (objfile, - &DST_variable (entry).type_desc, - entry); - break; - case dst_typ_short_rec: - return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 0); - case dst_typ_short_union: - return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 0); - case dst_typ_union: - return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 1); - case dst_typ_record: - return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 1); - case dst_typ_old_union: - return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 2); - case dst_typ_old_record: - return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 2); - case dst_typ_pointer: - return make_pointer_type ( - decode_type_desc (objfile, - &DST_pointer (entry).type_desc, - entry), - NULL); - case dst_typ_array: - child_type = decode_type_desc (objfile, - &DST_pointer (entry).type_desc, - entry); - index_type = lookup_fundamental_type (objfile, - FT_INTEGER); - range_type = create_range_type ((struct type *) NULL, - index_type, DST_array (entry).lo_bound, - DST_array (entry).hi_bound); - return create_array_type ((struct type *) NULL, child_type, - range_type); - case dst_typ_alias: - return decode_type_desc (objfile, - &DST_alias (entry).type_desc, - entry); - default: - return builtin_type_int; - } -} - -struct symbol_list -{ - struct symbol_list *next; - struct symbol *symbol; -}; - -static struct symbol_list *dst_global_symbols = NULL; -static int total_globals = 0; - -static void -decode_dst_locstring (char *locstr, struct symbol *sym) -{ - dst_loc_entry_t *entry, *next_entry; - CORE_ADDR temp; - int count = 0; - - while (1) - { - if (count++ == 100) - { - fprintf_unfiltered (gdb_stderr, "Error reading locstring\n"); - break; - } - entry = (dst_loc_entry_t *) locstr; - next_entry = (dst_loc_entry_t *) (locstr + 1); - switch (entry->header.code) - { - case dst_lsc_end: /* End of string */ - return; - case dst_lsc_indirect: /* Indirect through previous. Arg == 6 */ - /* Or register ax x == arg */ - if (entry->header.arg < 6) - { - SYMBOL_CLASS (sym) = LOC_REGISTER; - SYMBOL_VALUE (sym) = entry->header.arg + 8; - } - /* We predict indirects */ - locstr++; - break; - case dst_lsc_dreg: - SYMBOL_CLASS (sym) = LOC_REGISTER; - SYMBOL_VALUE (sym) = entry->header.arg; - locstr++; - break; - case dst_lsc_section: /* Section (arg+1) */ - SYMBOL_VALUE (sym) = dst_get_addr (entry->header.arg + 1, 0); - locstr++; - break; - case dst_lsc_sec_byte: /* Section (next_byte+1) */ - SYMBOL_VALUE (sym) = dst_get_addr (locstr[1] + 1, 0); - locstr += 2; - break; - case dst_lsc_add: /* Add (arg+1)*2 */ - case dst_lsc_sub: /* Subtract (arg+1)*2 */ - temp = (entry->header.arg + 1) * 2; - locstr++; - if (*locstr == dst_multiply_256) - { - temp <<= 8; - locstr++; - } - switch (entry->header.code) - { - case dst_lsc_add: - if (SYMBOL_CLASS (sym) == LOC_LOCAL) - SYMBOL_CLASS (sym) = LOC_ARG; - SYMBOL_VALUE (sym) += temp; - break; - case dst_lsc_sub: - SYMBOL_VALUE (sym) -= temp; - break; - } - break; - case dst_lsc_add_byte: - case dst_lsc_sub_byte: - switch (entry->header.arg & 0x03) - { - case 1: - temp = (unsigned char) locstr[1]; - locstr += 2; - break; - case 2: - temp = *(unsigned short *) (locstr + 1); - locstr += 3; - break; - case 3: - temp = *(unsigned long *) (locstr + 1); - locstr += 5; - break; - } - if (*locstr == dst_multiply_256) - { - temp <<= 8; - locstr++; - } - switch (entry->header.code) - { - case dst_lsc_add_byte: - if (SYMBOL_CLASS (sym) == LOC_LOCAL) - SYMBOL_CLASS (sym) = LOC_ARG; - SYMBOL_VALUE (sym) += temp; - break; - case dst_lsc_sub_byte: - SYMBOL_VALUE (sym) -= temp; - break; - } - break; - case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0 */ - if (next_entry->header.code != dst_lsc_indirect) - { - SYMBOL_VALUE (sym) = 0; - SYMBOL_CLASS (sym) = LOC_STATIC; - return; - } - SYMBOL_VALUE (sym) = 0; - SYMBOL_CLASS (sym) = LOC_LOCAL; - locstr++; - break; - default: - SYMBOL_VALUE (sym) = 0; - SYMBOL_CLASS (sym) = LOC_STATIC; - return; - } - } -} - -static struct symbol_list * -process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name, - int *nsyms_ret) -{ - struct symbol_list *list = NULL, *element; - struct symbol *sym; - char *symname; - int nsyms = 0; - char *location; - long line; - dst_type_t symtype; - struct type *type; - dst_var_attr_t attr; - dst_var_loc_t loc_type; - unsigned loc_index; - long loc_value; - - if (!entry) - { - *nsyms_ret = 0; - return NULL; - } - location = (char *) entry; - while (NEXT_SYM (&location, &entry) && - entry->rec_type != dst_typ_end_scope) - { - if (entry->rec_type == dst_typ_var) - { - if (DST_var (entry).short_locs) - { - loc_type = DST_var (entry).locs.shorts[0].loc_type; - loc_index = DST_var (entry).locs.shorts[0].loc_index; - loc_value = DST_var (entry).locs.shorts[0].location; - } - else - { - loc_type = DST_var (entry).locs.longs[0].loc_type; - loc_index = DST_var (entry).locs.longs[0].loc_index; - loc_value = DST_var (entry).locs.longs[0].location; - } - if (loc_type == dst_var_loc_external) - continue; - symname = DST_OFFSET (entry, DST_var (entry).noffset); - line = DST_var (entry).src_loc.line_number; - symtype = DST_var (entry).type_desc; - attr = DST_var (entry).attributes; - } - else if (entry->rec_type == dst_typ_variable) - { - symname = DST_OFFSET (entry, - DST_variable (entry).noffset); - line = DST_variable (entry).src_loc.line_number; - symtype = DST_variable (entry).type_desc; - attr = DST_variable (entry).attributes; - } - else - { - continue; - } - if (symname && name && !strcmp (symname, name)) - /* It's the function return value */ - continue; - sym = create_new_symbol (objfile, symname); - - if ((attr & (1 << dst_var_attr_global)) || - (attr & (1 << dst_var_attr_static))) - SYMBOL_CLASS (sym) = LOC_STATIC; - else - SYMBOL_CLASS (sym) = LOC_LOCAL; - SYMBOL_LINE (sym) = line; - SYMBOL_TYPE (sym) = decode_type_desc (objfile, &symtype, - entry); - SYMBOL_VALUE (sym) = 0; - switch (entry->rec_type) - { - case dst_typ_var: - switch (loc_type) - { - case dst_var_loc_abs: - SYMBOL_VALUE_ADDRESS (sym) = loc_value; - break; - case dst_var_loc_sect_off: - case dst_var_loc_ind_sect_off: /* What is this? */ - SYMBOL_VALUE_ADDRESS (sym) = dst_get_addr ( - loc_index, - loc_value); - break; - case dst_var_loc_ind_reg_rel: /* What is this? */ - case dst_var_loc_reg_rel: - /* If it isn't fp relative, specify the - * register it's relative to. - */ - if (loc_index) - { - sym->aux_value.basereg = loc_index; - } - SYMBOL_VALUE (sym) = loc_value; - if (loc_value > 0 && - SYMBOL_CLASS (sym) == LOC_BASEREG) - SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; - break; - case dst_var_loc_reg: - SYMBOL_VALUE (sym) = loc_index; - SYMBOL_CLASS (sym) = LOC_REGISTER; - break; - } - break; - case dst_typ_variable: - /* External variable..... don't try to interpret - * its nonexistant locstring. - */ - if (DST_variable (entry).loffset == -1) - continue; - decode_dst_locstring (DST_OFFSET (entry, - DST_variable (entry).loffset), - sym); - } - element = (struct symbol_list *) - xmalloc (sizeof (struct symbol_list)); - - if (attr & (1 << dst_var_attr_global)) - { - element->next = dst_global_symbols; - dst_global_symbols = element; - total_globals++; - } - else - { - element->next = list; - list = element; - nsyms++; - } - element->symbol = sym; - } - *nsyms_ret = nsyms; - return list; -} - - -static struct symbol * -process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name, - CORE_ADDR address) -{ - struct symbol *sym; - struct type *type, *ftype; - dst_rec_ptr_t sym_entry, typ_entry; - char *location; - struct symbol_list *element; - - type = builtin_type_int; - sym = create_new_symbol (objfile, name); - SYMBOL_CLASS (sym) = LOC_BLOCK; - - if (entry) - { - location = (char *) entry; - do - { - NEXT_SYM (&location, &sym_entry); - } - while (sym_entry && sym_entry->rec_type != dst_typ_signature); - - if (sym_entry) - { - SYMBOL_LINE (sym) = - DST_signature (sym_entry).src_loc.line_number; - if (DST_signature (sym_entry).result) - { - typ_entry = (dst_rec_ptr_t) - DST_OFFSET (sym_entry, - DST_signature (sym_entry).result); - type = decode_dst_type (objfile, typ_entry); - } - } - } - - if (!type->function_type) - { - ftype = alloc_type (objfile); - type->function_type = ftype; - TYPE_TARGET_TYPE (ftype) = type; - TYPE_CODE (ftype) = TYPE_CODE_FUNC; - } - SYMBOL_TYPE (sym) = type->function_type; - - /* Now add ourselves to the global symbols list */ - element = (struct symbol_list *) - xmalloc (sizeof (struct symbol_list)); - - element->next = dst_global_symbols; - dst_global_symbols = element; - total_globals++; - element->symbol = sym; - - return sym; -} - -static struct block * -process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry) -{ - struct block *block; - struct symbol *function = NULL; - CORE_ADDR address; - long size; - char *name; - dst_rec_ptr_t child_entry, symbol_entry; - struct block *child_block; - int total_symbols = 0; - char fake_name[20]; - static long fake_seq = 0; - struct symbol_list *symlist, *nextsym; - int symnum; - - if (DST_block (entry).noffset) - name = DST_OFFSET (entry, DST_block (entry).noffset); - else - name = NULL; - if (DST_block (entry).n_of_code_ranges) - { - address = dst_sym_addr ( - &DST_block (entry).code_ranges[0].code_start); - size = DST_block (entry).code_ranges[0].code_size; - } - else - { - address = -1; - size = 0; - } - symbol_entry = (dst_rec_ptr_t) get_sec_ref (&DST_block (entry).symbols_start); - switch (DST_block (entry).block_type) - { - /* These are all really functions. Even the "program" type. - * This is because the Apollo OS was written in Pascal, and - * in Pascal, the main procedure is described as the Program. - * Cute, huh? - */ - case dst_block_procedure: - case dst_block_function: - case dst_block_subroutine: - case dst_block_program: - prim_record_minimal_symbol (name, address, mst_text, objfile); - function = process_dst_function ( - objfile, - symbol_entry, - name, - address); - enter_all_lines (get_sec_ref (&DST_block (entry).code_ranges[0].lines_start), address); - break; - case dst_block_block_data: - break; - - default: - /* GDB has to call it something, and the module name - * won't cut it - */ - sprintf (fake_name, "block_%08lx", fake_seq++); - function = process_dst_function ( - objfile, NULL, fake_name, address); - break; - } - symlist = process_dst_symbols (objfile, symbol_entry, - name, &total_symbols); - block = (struct block *) - obstack_alloc (&objfile->symbol_obstack, - sizeof (struct block) + - (total_symbols - 1) * sizeof (struct symbol *)); - - symnum = 0; - while (symlist) - { - nextsym = symlist->next; - - block->sym[symnum] = symlist->symbol; - - xfree (symlist); - symlist = nextsym; - symnum++; - } - BLOCK_NSYMS (block) = total_symbols; - BLOCK_HASHTABLE (block) = 0; - BLOCK_START (block) = address; - BLOCK_END (block) = address + size; - BLOCK_SUPERBLOCK (block) = 0; - if (function) - { - SYMBOL_BLOCK_VALUE (function) = block; - BLOCK_FUNCTION (block) = function; - } - else - BLOCK_FUNCTION (block) = 0; - - if (DST_block (entry).child_block_off) - { - child_entry = (dst_rec_ptr_t) DST_OFFSET (entry, - DST_block (entry).child_block_off); - while (child_entry) - { - child_block = process_dst_block (objfile, child_entry); - if (child_block) - { - if (BLOCK_START (child_block) < - BLOCK_START (block) || - BLOCK_START (block) == -1) - BLOCK_START (block) = - BLOCK_START (child_block); - if (BLOCK_END (child_block) > - BLOCK_END (block) || - BLOCK_END (block) == -1) - BLOCK_END (block) = - BLOCK_END (child_block); - BLOCK_SUPERBLOCK (child_block) = block; - } - if (DST_block (child_entry).sibling_block_off) - child_entry = (dst_rec_ptr_t) DST_OFFSET ( - child_entry, - DST_block (child_entry).sibling_block_off); - else - child_entry = NULL; - } - } - record_pending_block (objfile, block, NULL); - return block; -} - - -static void -read_dst_symtab (struct objfile *objfile) -{ - char *buffer; - dst_rec_ptr_t entry, file_table, root_block; - char *source_file; - struct block *block, *global_block; - int symnum; - struct symbol_list *nextsym; - int module_num = 0; - struct structure_list *element; - - current_objfile = objfile; - buffer = blocks_info.buffer; - while (NEXT_BLK (&buffer, &entry)) - { - if (entry->rec_type == dst_typ_comp_unit) - { - file_table = (dst_rec_ptr_t) DST_OFFSET (entry, - DST_comp_unit (entry).file_table); - section_table = (dst_rec_ptr_t) DST_OFFSET (entry, - DST_comp_unit (entry).section_table); - root_block = (dst_rec_ptr_t) DST_OFFSET (entry, - DST_comp_unit (entry).root_block_offset); - source_file = DST_OFFSET (file_table, - DST_file_tab (file_table).files[0].noffset); - /* Point buffer to the start of the next comp_unit */ - buffer = DST_OFFSET (entry, - DST_comp_unit (entry).data_size); - dst_start_symtab (); - - block = process_dst_block (objfile, root_block); - - global_block = (struct block *) - obstack_alloc (&objfile->symbol_obstack, - sizeof (struct block) + - (total_globals - 1) * - sizeof (struct symbol *)); - BLOCK_NSYMS (global_block) = total_globals; - BLOCK_HASHTABLE (global_block) = 0; - for (symnum = 0; symnum < total_globals; symnum++) - { - nextsym = dst_global_symbols->next; - - global_block->sym[symnum] = - dst_global_symbols->symbol; - - xfree (dst_global_symbols); - dst_global_symbols = nextsym; - } - dst_global_symbols = NULL; - total_globals = 0; - BLOCK_FUNCTION (global_block) = 0; - BLOCK_START (global_block) = BLOCK_START (block); - BLOCK_END (global_block) = BLOCK_END (block); - BLOCK_SUPERBLOCK (global_block) = 0; - BLOCK_SUPERBLOCK (block) = global_block; - record_pending_block (objfile, global_block, NULL); - - complete_symtab (source_file, - BLOCK_START (block), - BLOCK_END (block) - BLOCK_START (block)); - module_num++; - dst_end_symtab (objfile); - } - } - if (module_num) - prim_record_minimal_symbol ("", - BLOCK_END (block), mst_text, objfile); - /* One more faked symbol to make sure nothing can ever run off the - * end of the symbol table. This one represents the end of the - * text space. It used to be (CORE_ADDR) -1 (effectively the highest - * int possible), but some parts of gdb treated it as a signed - * number and failed comparisons. We could equally use 7fffffff, - * but no functions are ever mapped to an address higher than - * 40000000 - */ - prim_record_minimal_symbol ("", - (CORE_ADDR) 0x40000000, - mst_text, objfile); - while (struct_list) - { - element = struct_list; - struct_list = element->next; - xfree (element); - } -} - - -/* Support for line number handling */ -static char *linetab = NULL; -static long linetab_offset; -static unsigned long linetab_size; - -/* Read in all the line numbers for fast lookups later. Leave them in - external (unswapped) format in memory; we'll swap them as we enter - them into GDB's data structures. */ -static int -init_one_section (int chan, dst_sec *secinfo) -{ - if (secinfo->size == 0 - || lseek (chan, secinfo->position, 0) == -1 - || (secinfo->buffer = xmalloc (secinfo->size)) == NULL - || myread (chan, secinfo->buffer, secinfo->size) == -1) - return 0; - else - return 1; -} - -static int -init_dst_sections (int chan) -{ - - if (!init_one_section (chan, &blocks_info) || - !init_one_section (chan, &lines_info) || - !init_one_section (chan, &symbols_info)) - return -1; - else - return 0; -} - -/* Fake up support for relocating symbol addresses. FIXME. */ - -struct section_offsets dst_symfile_faker = -{0}; - -void -dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) -{ - objfile->num_sections = 1; - objfile->section_offsets = &dst_symfile_faker; -} - -/* Register our ability to parse symbols for DST BFD files */ - -static struct sym_fns dst_sym_fns = -{ - /* FIXME: Can this be integrated with coffread.c? If not, should it be - a separate flavour like ecoff? */ - (enum bfd_flavour) -2, - - dst_new_init, /* sym_new_init: init anything gbl to entire symtab */ - dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */ - dst_symfile_read, /* sym_read: read a symbol file into symtab */ - dst_symfile_finish, /* sym_finish: finished with file, cleanup */ - dst_symfile_offsets, /* sym_offsets: xlate external to internal form */ - NULL /* next: pointer to next struct sym_fns */ -}; - -void -_initialize_dstread (void) -{ - add_symtab_fns (&dst_sym_fns); -} +// OBSOLETE /* Read apollo DST symbol tables and convert to internal format, for GDB. +// OBSOLETE Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au). +// OBSOLETE Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "symtab.h" +// OBSOLETE #include "gdbtypes.h" +// OBSOLETE #include "breakpoint.h" +// OBSOLETE #include "bfd.h" +// OBSOLETE #include "symfile.h" +// OBSOLETE #include "objfiles.h" +// OBSOLETE #include "buildsym.h" +// OBSOLETE #include "gdb_obstack.h" +// OBSOLETE +// OBSOLETE #include "gdb_string.h" +// OBSOLETE +// OBSOLETE #include "dst.h" +// OBSOLETE +// OBSOLETE CORE_ADDR cur_src_start_addr, cur_src_end_addr; +// OBSOLETE dst_sec blocks_info, lines_info, symbols_info; +// OBSOLETE +// OBSOLETE /* Vector of line number information. */ +// OBSOLETE +// OBSOLETE static struct linetable *line_vector; +// OBSOLETE +// OBSOLETE /* Index of next entry to go in line_vector_index. */ +// OBSOLETE +// OBSOLETE static int line_vector_index; +// OBSOLETE +// OBSOLETE /* Last line number recorded in the line vector. */ +// OBSOLETE +// OBSOLETE static int prev_line_number; +// OBSOLETE +// OBSOLETE /* Number of elements allocated for line_vector currently. */ +// OBSOLETE +// OBSOLETE static int line_vector_length; +// OBSOLETE +// OBSOLETE static int init_dst_sections (int); +// OBSOLETE +// OBSOLETE static void read_dst_symtab (struct objfile *); +// OBSOLETE +// OBSOLETE static void find_dst_sections (bfd *, sec_ptr, PTR); +// OBSOLETE +// OBSOLETE static void dst_symfile_init (struct objfile *); +// OBSOLETE +// OBSOLETE static void dst_new_init (struct objfile *); +// OBSOLETE +// OBSOLETE static void dst_symfile_read (struct objfile *, int); +// OBSOLETE +// OBSOLETE static void dst_symfile_finish (struct objfile *); +// OBSOLETE +// OBSOLETE static void dst_end_symtab (struct objfile *); +// OBSOLETE +// OBSOLETE static void complete_symtab (char *, CORE_ADDR, unsigned int); +// OBSOLETE +// OBSOLETE static void dst_start_symtab (void); +// OBSOLETE +// OBSOLETE static void dst_record_line (int, CORE_ADDR); +// OBSOLETE +// OBSOLETE /* Manage the vector of line numbers. */ +// OBSOLETE /* FIXME: Use record_line instead. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_record_line (int line, CORE_ADDR pc) +// OBSOLETE { +// OBSOLETE struct linetable_entry *e; +// OBSOLETE /* Make sure line vector is big enough. */ +// OBSOLETE +// OBSOLETE if (line_vector_index + 2 >= line_vector_length) +// OBSOLETE { +// OBSOLETE line_vector_length *= 2; +// OBSOLETE line_vector = (struct linetable *) +// OBSOLETE xrealloc ((char *) line_vector, sizeof (struct linetable) +// OBSOLETE + (line_vector_length +// OBSOLETE * sizeof (struct linetable_entry))); +// OBSOLETE } +// OBSOLETE +// OBSOLETE e = line_vector->item + line_vector_index++; +// OBSOLETE e->line = line; +// OBSOLETE e->pc = pc; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Start a new symtab for a new source file. +// OBSOLETE It indicates the start of data for one original source file. */ +// OBSOLETE /* FIXME: use start_symtab, like coffread.c now does. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_start_symtab (void) +// OBSOLETE { +// OBSOLETE /* Initialize the source file line number information for this file. */ +// OBSOLETE +// OBSOLETE if (line_vector) /* Unlikely, but maybe possible? */ +// OBSOLETE xfree (line_vector); +// OBSOLETE line_vector_index = 0; +// OBSOLETE line_vector_length = 1000; +// OBSOLETE prev_line_number = -2; /* Force first line number to be explicit */ +// OBSOLETE line_vector = (struct linetable *) +// OBSOLETE xmalloc (sizeof (struct linetable) +// OBSOLETE + line_vector_length * sizeof (struct linetable_entry)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Save the vital information from when starting to read a file, +// OBSOLETE for use when closing off the current file. +// OBSOLETE NAME is the file name the symbols came from, START_ADDR is the first +// OBSOLETE text address for the file, and SIZE is the number of bytes of text. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size) +// OBSOLETE { +// OBSOLETE last_source_file = savestring (name, strlen (name)); +// OBSOLETE cur_src_start_addr = start_addr; +// OBSOLETE cur_src_end_addr = start_addr + size; +// OBSOLETE +// OBSOLETE if (current_objfile->ei.entry_point >= cur_src_start_addr && +// OBSOLETE current_objfile->ei.entry_point < cur_src_end_addr) +// OBSOLETE { +// OBSOLETE current_objfile->ei.entry_file_lowpc = cur_src_start_addr; +// OBSOLETE current_objfile->ei.entry_file_highpc = cur_src_end_addr; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Finish the symbol definitions for one main source file, +// OBSOLETE close off all the lexical contexts for that file +// OBSOLETE (creating struct block's for them), then make the +// OBSOLETE struct symtab for that file and put it in the list of all such. */ +// OBSOLETE /* FIXME: Use end_symtab, like coffread.c now does. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_end_symtab (struct objfile *objfile) +// OBSOLETE { +// OBSOLETE register struct symtab *symtab; +// OBSOLETE register struct blockvector *blockvector; +// OBSOLETE register struct linetable *lv; +// OBSOLETE +// OBSOLETE /* Create the blockvector that points to all the file's blocks. */ +// OBSOLETE +// OBSOLETE blockvector = make_blockvector (objfile); +// OBSOLETE +// OBSOLETE /* Now create the symtab object for this source file. */ +// OBSOLETE symtab = allocate_symtab (last_source_file, objfile); +// OBSOLETE +// OBSOLETE /* Fill in its components. */ +// OBSOLETE symtab->blockvector = blockvector; +// OBSOLETE symtab->free_code = free_linetable; +// OBSOLETE symtab->free_ptr = 0; +// OBSOLETE symtab->filename = last_source_file; +// OBSOLETE symtab->dirname = NULL; +// OBSOLETE symtab->debugformat = obsavestring ("Apollo DST", 10, +// OBSOLETE &objfile->symbol_obstack); +// OBSOLETE lv = line_vector; +// OBSOLETE lv->nitems = line_vector_index; +// OBSOLETE symtab->linetable = (struct linetable *) +// OBSOLETE xrealloc ((char *) lv, (sizeof (struct linetable) +// OBSOLETE + lv->nitems * sizeof (struct linetable_entry))); +// OBSOLETE +// OBSOLETE free_named_symtabs (symtab->filename); +// OBSOLETE +// OBSOLETE /* Reinitialize for beginning of new file. */ +// OBSOLETE line_vector = 0; +// OBSOLETE line_vector_length = -1; +// OBSOLETE last_source_file = NULL; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* dst_symfile_init () +// OBSOLETE is the dst-specific initialization routine for reading symbols. +// OBSOLETE +// OBSOLETE We will only be called if this is a DST or DST-like file. +// OBSOLETE BFD handles figuring out the format of the file, and code in symtab.c +// OBSOLETE uses BFD's determination to vector to us. +// OBSOLETE +// OBSOLETE The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_symfile_init (struct objfile *objfile) +// OBSOLETE { +// OBSOLETE asection *section; +// OBSOLETE bfd *abfd = objfile->obfd; +// OBSOLETE +// OBSOLETE init_entry_point_info (objfile); +// OBSOLETE +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* This function is called for every section; it finds the outer limits +// OBSOLETE of the line table (minimum and maximum file offset) so that the +// OBSOLETE mainline code can read the whole thing for efficiency. */ +// OBSOLETE +// OBSOLETE /* ARGSUSED */ +// OBSOLETE static void +// OBSOLETE find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo) +// OBSOLETE { +// OBSOLETE int size, count; +// OBSOLETE long base; +// OBSOLETE file_ptr offset, maxoff; +// OBSOLETE dst_sec *section; +// OBSOLETE +// OBSOLETE /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ +// OBSOLETE size = asect->_raw_size; +// OBSOLETE offset = asect->filepos; +// OBSOLETE base = asect->vma; +// OBSOLETE /* End of warning */ +// OBSOLETE +// OBSOLETE section = NULL; +// OBSOLETE if (!strcmp (asect->name, ".blocks")) +// OBSOLETE section = &blocks_info; +// OBSOLETE else if (!strcmp (asect->name, ".lines")) +// OBSOLETE section = &lines_info; +// OBSOLETE else if (!strcmp (asect->name, ".symbols")) +// OBSOLETE section = &symbols_info; +// OBSOLETE if (!section) +// OBSOLETE return; +// OBSOLETE section->size = size; +// OBSOLETE section->position = offset; +// OBSOLETE section->base = base; +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* The BFD for this file -- only good while we're actively reading +// OBSOLETE symbols into a psymtab or a symtab. */ +// OBSOLETE +// OBSOLETE static bfd *symfile_bfd; +// OBSOLETE +// OBSOLETE /* Read a symbol file, after initialization by dst_symfile_init. */ +// OBSOLETE /* FIXME! Addr and Mainline are not used yet -- this will not work for +// OBSOLETE shared libraries or add_file! */ +// OBSOLETE +// OBSOLETE /* ARGSUSED */ +// OBSOLETE static void +// OBSOLETE dst_symfile_read (struct objfile *objfile, int mainline) +// OBSOLETE { +// OBSOLETE bfd *abfd = objfile->obfd; +// OBSOLETE char *name = bfd_get_filename (abfd); +// OBSOLETE int desc; +// OBSOLETE register int val; +// OBSOLETE int num_symbols; +// OBSOLETE int symtab_offset; +// OBSOLETE int stringtab_offset; +// OBSOLETE +// OBSOLETE symfile_bfd = abfd; /* Kludge for swap routines */ +// OBSOLETE +// OBSOLETE /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ +// OBSOLETE desc = fileno ((FILE *) (abfd->iostream)); /* File descriptor */ +// OBSOLETE +// OBSOLETE /* Read the line number table, all at once. */ +// OBSOLETE bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL); +// OBSOLETE +// OBSOLETE val = init_dst_sections (desc); +// OBSOLETE if (val < 0) +// OBSOLETE error ("\"%s\": error reading debugging symbol tables\n", name); +// OBSOLETE +// OBSOLETE init_minimal_symbol_collection (); +// OBSOLETE make_cleanup_discard_minimal_symbols (); +// OBSOLETE +// OBSOLETE /* Now that the executable file is positioned at symbol table, +// OBSOLETE process it and define symbols accordingly. */ +// OBSOLETE +// OBSOLETE read_dst_symtab (objfile); +// OBSOLETE +// OBSOLETE /* Sort symbols alphabetically within each block. */ +// OBSOLETE +// OBSOLETE { +// OBSOLETE struct symtab *s; +// OBSOLETE for (s = objfile->symtabs; s != NULL; s = s->next) +// OBSOLETE { +// OBSOLETE sort_symtab_syms (s); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Install any minimal symbols that have been collected as the current +// OBSOLETE minimal symbols for this objfile. */ +// OBSOLETE +// OBSOLETE install_minimal_symbols (objfile); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_new_init (struct objfile *ignore) +// OBSOLETE { +// OBSOLETE /* Nothin' to do */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Perform any local cleanups required when we are done with a particular +// OBSOLETE objfile. I.E, we are in the process of discarding all symbol information +// OBSOLETE for an objfile, freeing up all memory held for it, and unlinking the +// OBSOLETE objfile struct from the global list of known objfiles. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE dst_symfile_finish (struct objfile *objfile) +// OBSOLETE { +// OBSOLETE /* Nothing to do */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Get the next line number from the DST. Returns 0 when we hit an +// OBSOLETE * end directive or cannot continue for any other reason. +// OBSOLETE * +// OBSOLETE * Note that ordinary pc deltas are multiplied by two. Apparently +// OBSOLETE * this is what was really intended. +// OBSOLETE */ +// OBSOLETE static int +// OBSOLETE get_dst_line (signed char **buffer, long *pc) +// OBSOLETE { +// OBSOLETE static last_pc = 0; +// OBSOLETE static long last_line = 0; +// OBSOLETE static int last_file = 0; +// OBSOLETE dst_ln_entry_ptr_t entry; +// OBSOLETE int size; +// OBSOLETE dst_src_loc_t *src_loc; +// OBSOLETE +// OBSOLETE if (*pc != -1) +// OBSOLETE { +// OBSOLETE last_pc = *pc; +// OBSOLETE *pc = -1; +// OBSOLETE } +// OBSOLETE entry = (dst_ln_entry_ptr_t) * buffer; +// OBSOLETE +// OBSOLETE while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag) +// OBSOLETE { +// OBSOLETE switch (entry->esc.esc_code) +// OBSOLETE { +// OBSOLETE case dst_ln_pad: +// OBSOLETE size = 1; /* pad byte */ +// OBSOLETE break; +// OBSOLETE case dst_ln_file: +// OBSOLETE /* file escape. Next 4 bytes are a dst_src_loc_t */ +// OBSOLETE size = 5; +// OBSOLETE src_loc = (dst_src_loc_t *) (*buffer + 1); +// OBSOLETE last_line = src_loc->line_number; +// OBSOLETE last_file = src_loc->file_index; +// OBSOLETE break; +// OBSOLETE case dst_ln_dln1_dpc1: +// OBSOLETE /* 1 byte line delta, 1 byte pc delta */ +// OBSOLETE last_line += (*buffer)[1]; +// OBSOLETE last_pc += 2 * (unsigned char) (*buffer)[2]; +// OBSOLETE dst_record_line (last_line, last_pc); +// OBSOLETE size = 3; +// OBSOLETE break; +// OBSOLETE case dst_ln_dln2_dpc2: +// OBSOLETE /* 2 bytes line delta, 2 bytes pc delta */ +// OBSOLETE last_line += *(short *) (*buffer + 1); +// OBSOLETE last_pc += 2 * (*(short *) (*buffer + 3)); +// OBSOLETE size = 5; +// OBSOLETE dst_record_line (last_line, last_pc); +// OBSOLETE break; +// OBSOLETE case dst_ln_ln4_pc4: +// OBSOLETE /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ +// OBSOLETE last_line = *(unsigned long *) (*buffer + 1); +// OBSOLETE last_pc = *(unsigned long *) (*buffer + 5); +// OBSOLETE size = 9; +// OBSOLETE dst_record_line (last_line, last_pc); +// OBSOLETE break; +// OBSOLETE case dst_ln_dln1_dpc0: +// OBSOLETE /* 1 byte line delta, pc delta = 0 */ +// OBSOLETE size = 2; +// OBSOLETE last_line += (*buffer)[1]; +// OBSOLETE break; +// OBSOLETE case dst_ln_ln_off_1: +// OBSOLETE /* statement escape, stmt # = 1 (2nd stmt on line) */ +// OBSOLETE size = 1; +// OBSOLETE break; +// OBSOLETE case dst_ln_ln_off: +// OBSOLETE /* statement escape, stmt # = next byte */ +// OBSOLETE size = 2; +// OBSOLETE break; +// OBSOLETE case dst_ln_entry: +// OBSOLETE /* entry escape, next byte is entry number */ +// OBSOLETE size = 2; +// OBSOLETE break; +// OBSOLETE case dst_ln_exit: +// OBSOLETE /* exit escape */ +// OBSOLETE size = 1; +// OBSOLETE break; +// OBSOLETE case dst_ln_stmt_end: +// OBSOLETE /* gap escape, 4 bytes pc delta */ +// OBSOLETE size = 5; +// OBSOLETE /* last_pc += 2 * (*(long *) (*buffer + 1)); */ +// OBSOLETE /* Apparently this isn't supposed to actually modify +// OBSOLETE * the pc value. Totally weird. +// OBSOLETE */ +// OBSOLETE break; +// OBSOLETE case dst_ln_escape_11: +// OBSOLETE case dst_ln_escape_12: +// OBSOLETE case dst_ln_escape_13: +// OBSOLETE size = 1; +// OBSOLETE break; +// OBSOLETE case dst_ln_nxt_byte: +// OBSOLETE /* This shouldn't happen. If it does, we're SOL */ +// OBSOLETE return 0; +// OBSOLETE break; +// OBSOLETE case dst_ln_end: +// OBSOLETE /* end escape, final entry follows */ +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE *buffer += (size < 0) ? -size : size; +// OBSOLETE entry = (dst_ln_entry_ptr_t) * buffer; +// OBSOLETE } +// OBSOLETE last_line += dst_ln_ln_delta (*entry); +// OBSOLETE last_pc += entry->delta.pc_delta * 2; +// OBSOLETE (*buffer)++; +// OBSOLETE dst_record_line (last_line, last_pc); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE enter_all_lines (char *buffer, long address) +// OBSOLETE { +// OBSOLETE if (buffer) +// OBSOLETE while (get_dst_line (&buffer, &address)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static int +// OBSOLETE get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry) +// OBSOLETE { +// OBSOLETE int size; +// OBSOLETE dst_rec_ptr_t entry; +// OBSOLETE static int last_type; +// OBSOLETE int ar_size; +// OBSOLETE static unsigned lu3; +// OBSOLETE +// OBSOLETE entry = (dst_rec_ptr_t) buffer; +// OBSOLETE switch (entry->rec_type) +// OBSOLETE { +// OBSOLETE case dst_typ_pad: +// OBSOLETE size = 0; +// OBSOLETE break; +// OBSOLETE case dst_typ_comp_unit: +// OBSOLETE size = sizeof (DST_comp_unit (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_section_tab: +// OBSOLETE size = sizeof (DST_section_tab (entry)) +// OBSOLETE + ((int) DST_section_tab (entry).number_of_sections +// OBSOLETE - dst_dummy_array_size) * sizeof (long); +// OBSOLETE break; +// OBSOLETE case dst_typ_file_tab: +// OBSOLETE size = sizeof (DST_file_tab (entry)) +// OBSOLETE + ((int) DST_file_tab (entry).number_of_files +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_file_desc_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_block: +// OBSOLETE size = sizeof (DST_block (entry)) +// OBSOLETE + ((int) DST_block (entry).n_of_code_ranges +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_code_range_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_5: +// OBSOLETE size = -1; +// OBSOLETE break; +// OBSOLETE case dst_typ_var: +// OBSOLETE size = sizeof (DST_var (entry)) - +// OBSOLETE sizeof (dst_var_loc_long_t) * dst_dummy_array_size + +// OBSOLETE DST_var (entry).no_of_locs * +// OBSOLETE (DST_var (entry).short_locs ? +// OBSOLETE sizeof (dst_var_loc_short_t) : +// OBSOLETE sizeof (dst_var_loc_long_t)); +// OBSOLETE break; +// OBSOLETE case dst_typ_pointer: +// OBSOLETE size = sizeof (DST_pointer (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_array: +// OBSOLETE size = sizeof (DST_array (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_subrange: +// OBSOLETE size = sizeof (DST_subrange (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_set: +// OBSOLETE size = sizeof (DST_set (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_implicit_enum: +// OBSOLETE size = sizeof (DST_implicit_enum (entry)) +// OBSOLETE + ((int) DST_implicit_enum (entry).nelems +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_rel_offset_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_explicit_enum: +// OBSOLETE size = sizeof (DST_explicit_enum (entry)) +// OBSOLETE + ((int) DST_explicit_enum (entry).nelems +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_enum_elem_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_short_rec: +// OBSOLETE size = sizeof (DST_short_rec (entry)) +// OBSOLETE + DST_short_rec (entry).nfields * sizeof (dst_short_field_t) +// OBSOLETE - dst_dummy_array_size * sizeof (dst_field_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_short_union: +// OBSOLETE size = sizeof (DST_short_union (entry)) +// OBSOLETE + DST_short_union (entry).nfields * sizeof (dst_short_field_t) +// OBSOLETE - dst_dummy_array_size * sizeof (dst_field_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_file: +// OBSOLETE size = sizeof (DST_file (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_offset: +// OBSOLETE size = sizeof (DST_offset (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_alias: +// OBSOLETE size = sizeof (DST_alias (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_signature: +// OBSOLETE size = sizeof (DST_signature (entry)) + +// OBSOLETE ((int) DST_signature (entry).nargs - +// OBSOLETE dst_dummy_array_size) * sizeof (dst_arg_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_21: +// OBSOLETE size = -1; +// OBSOLETE break; +// OBSOLETE case dst_typ_old_label: +// OBSOLETE size = sizeof (DST_old_label (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_scope: +// OBSOLETE size = sizeof (DST_scope (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_end_scope: +// OBSOLETE size = 0; +// OBSOLETE break; +// OBSOLETE case dst_typ_25: +// OBSOLETE case dst_typ_26: +// OBSOLETE size = -1; +// OBSOLETE break; +// OBSOLETE case dst_typ_string_tab: +// OBSOLETE case dst_typ_global_name_tab: +// OBSOLETE size = sizeof (DST_string_tab (entry)) +// OBSOLETE + DST_string_tab (entry).length +// OBSOLETE - dst_dummy_array_size; +// OBSOLETE break; +// OBSOLETE case dst_typ_forward: +// OBSOLETE size = sizeof (DST_forward (entry)); +// OBSOLETE get_dst_entry ((char *) entry + DST_forward (entry).rec_off, &entry); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_size: +// OBSOLETE size = sizeof (DST_aux_size (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_align: +// OBSOLETE size = sizeof (DST_aux_align (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_field_size: +// OBSOLETE size = sizeof (DST_aux_field_size (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_field_off: +// OBSOLETE size = sizeof (DST_aux_field_off (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_field_align: +// OBSOLETE size = sizeof (DST_aux_field_align (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_qual: +// OBSOLETE size = sizeof (DST_aux_qual (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_var_bound: +// OBSOLETE size = sizeof (DST_aux_var_bound (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_extension: +// OBSOLETE size = DST_extension (entry).rec_size; +// OBSOLETE break; +// OBSOLETE case dst_typ_string: +// OBSOLETE size = sizeof (DST_string (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_old_entry: +// OBSOLETE size = 48; /* Obsolete entry type */ +// OBSOLETE break; +// OBSOLETE case dst_typ_const: +// OBSOLETE size = sizeof (DST_const (entry)) +// OBSOLETE + DST_const (entry).value.length +// OBSOLETE - sizeof (DST_const (entry).value.val); +// OBSOLETE break; +// OBSOLETE case dst_typ_reference: +// OBSOLETE size = sizeof (DST_reference (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_old_record: +// OBSOLETE case dst_typ_old_union: +// OBSOLETE case dst_typ_record: +// OBSOLETE case dst_typ_union: +// OBSOLETE size = sizeof (DST_record (entry)) +// OBSOLETE + ((int) DST_record (entry).nfields +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_field_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_type_deriv: +// OBSOLETE size = sizeof (DST_aux_type_deriv (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_locpool: +// OBSOLETE size = sizeof (DST_locpool (entry)) +// OBSOLETE + ((int) DST_locpool (entry).length - +// OBSOLETE dst_dummy_array_size); +// OBSOLETE break; +// OBSOLETE case dst_typ_variable: +// OBSOLETE size = sizeof (DST_variable (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_label: +// OBSOLETE size = sizeof (DST_label (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_entry: +// OBSOLETE size = sizeof (DST_entry (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_lifetime: +// OBSOLETE size = sizeof (DST_aux_lifetime (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_ptr_base: +// OBSOLETE size = sizeof (DST_aux_ptr_base (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_src_range: +// OBSOLETE size = sizeof (DST_aux_src_range (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_reg_val: +// OBSOLETE size = sizeof (DST_aux_reg_val (entry)); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_unit_names: +// OBSOLETE size = sizeof (DST_aux_unit_names (entry)) +// OBSOLETE + ((int) DST_aux_unit_names (entry).number_of_names +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_rel_offset_t); +// OBSOLETE break; +// OBSOLETE case dst_typ_aux_sect_info: +// OBSOLETE size = sizeof (DST_aux_sect_info (entry)) +// OBSOLETE + ((int) DST_aux_sect_info (entry).number_of_refs +// OBSOLETE - dst_dummy_array_size) * sizeof (dst_sect_ref_t); +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE size = -1; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE if (size == -1) +// OBSOLETE { +// OBSOLETE fprintf_unfiltered (gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n", +// OBSOLETE (int) entry->rec_type, +// OBSOLETE last_type); +// OBSOLETE fprintf_unfiltered (gdb_stderr, "Last unknown_3 value: %d\n", lu3); +// OBSOLETE size = 0; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE last_type = entry->rec_type; +// OBSOLETE if (size & 1) /* Align on a word boundary */ +// OBSOLETE size++; +// OBSOLETE size += 2; +// OBSOLETE *ret_entry = entry; +// OBSOLETE return size; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static int +// OBSOLETE next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table) +// OBSOLETE { +// OBSOLETE if (*buffer - table->buffer >= table->size) +// OBSOLETE { +// OBSOLETE *entry = NULL; +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE *buffer += get_dst_entry (*buffer, entry); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE +// OBSOLETE #define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info) +// OBSOLETE #define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info) +// OBSOLETE #define DST_OFFSET(a, b) ((char *) (a) + (b)) +// OBSOLETE +// OBSOLETE static dst_rec_ptr_t section_table = NULL; +// OBSOLETE +// OBSOLETE char * +// OBSOLETE get_sec_ref (dst_sect_ref_t *ref) +// OBSOLETE { +// OBSOLETE dst_sec *section = NULL; +// OBSOLETE long offset; +// OBSOLETE +// OBSOLETE if (!section_table || !ref->sect_index) +// OBSOLETE return NULL; +// OBSOLETE offset = DST_section_tab (section_table).section_base[ref->sect_index - 1] +// OBSOLETE + ref->sect_offset; +// OBSOLETE if (offset >= blocks_info.base && +// OBSOLETE offset < blocks_info.base + blocks_info.size) +// OBSOLETE section = &blocks_info; +// OBSOLETE else if (offset >= symbols_info.base && +// OBSOLETE offset < symbols_info.base + symbols_info.size) +// OBSOLETE section = &symbols_info; +// OBSOLETE else if (offset >= lines_info.base && +// OBSOLETE offset < lines_info.base + lines_info.size) +// OBSOLETE section = &lines_info; +// OBSOLETE if (!section) +// OBSOLETE return NULL; +// OBSOLETE return section->buffer + (offset - section->base); +// OBSOLETE } +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE dst_get_addr (int section, long offset) +// OBSOLETE { +// OBSOLETE if (!section_table || !section) +// OBSOLETE return 0; +// OBSOLETE return DST_section_tab (section_table).section_base[section - 1] + offset; +// OBSOLETE } +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE dst_sym_addr (dst_sect_ref_t *ref) +// OBSOLETE { +// OBSOLETE if (!section_table || !ref->sect_index) +// OBSOLETE return 0; +// OBSOLETE return DST_section_tab (section_table).section_base[ref->sect_index - 1] +// OBSOLETE + ref->sect_offset; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct symbol * +// OBSOLETE create_new_symbol (struct objfile *objfile, char *name) +// OBSOLETE { +// OBSOLETE struct symbol *sym = (struct symbol *) +// OBSOLETE obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); +// OBSOLETE memset (sym, 0, sizeof (struct symbol)); +// OBSOLETE SYMBOL_NAME (sym) = obsavestring (name, strlen (name), +// OBSOLETE &objfile->symbol_obstack); +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; +// OBSOLETE +// OBSOLETE SYMBOL_CLASS (sym) = LOC_BLOCK; +// OBSOLETE return sym; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t); +// OBSOLETE +// OBSOLETE static struct type * +// OBSOLETE decode_type_desc (struct objfile *objfile, dst_type_t *type_desc, +// OBSOLETE dst_rec_ptr_t base) +// OBSOLETE { +// OBSOLETE struct type *type; +// OBSOLETE dst_rec_ptr_t entry; +// OBSOLETE if (type_desc->std_type.user_defined_type) +// OBSOLETE { +// OBSOLETE entry = (dst_rec_ptr_t) DST_OFFSET (base, +// OBSOLETE dst_user_type_offset (*type_desc)); +// OBSOLETE type = decode_dst_type (objfile, entry); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE switch (type_desc->std_type.dtc) +// OBSOLETE { +// OBSOLETE case dst_int8_type: +// OBSOLETE type = builtin_type_signed_char; +// OBSOLETE break; +// OBSOLETE case dst_int16_type: +// OBSOLETE type = builtin_type_short; +// OBSOLETE break; +// OBSOLETE case dst_int32_type: +// OBSOLETE type = builtin_type_long; +// OBSOLETE break; +// OBSOLETE case dst_uint8_type: +// OBSOLETE type = builtin_type_unsigned_char; +// OBSOLETE break; +// OBSOLETE case dst_uint16_type: +// OBSOLETE type = builtin_type_unsigned_short; +// OBSOLETE break; +// OBSOLETE case dst_uint32_type: +// OBSOLETE type = builtin_type_unsigned_long; +// OBSOLETE break; +// OBSOLETE case dst_real32_type: +// OBSOLETE type = builtin_type_float; +// OBSOLETE break; +// OBSOLETE case dst_real64_type: +// OBSOLETE type = builtin_type_double; +// OBSOLETE break; +// OBSOLETE case dst_complex_type: +// OBSOLETE type = builtin_type_complex; +// OBSOLETE break; +// OBSOLETE case dst_dcomplex_type: +// OBSOLETE type = builtin_type_double_complex; +// OBSOLETE break; +// OBSOLETE case dst_bool8_type: +// OBSOLETE type = builtin_type_char; +// OBSOLETE break; +// OBSOLETE case dst_bool16_type: +// OBSOLETE type = builtin_type_short; +// OBSOLETE break; +// OBSOLETE case dst_bool32_type: +// OBSOLETE type = builtin_type_long; +// OBSOLETE break; +// OBSOLETE case dst_char_type: +// OBSOLETE type = builtin_type_char; +// OBSOLETE break; +// OBSOLETE /* The next few are more complex. I will take care +// OBSOLETE * of them properly at a later point. +// OBSOLETE */ +// OBSOLETE case dst_string_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE case dst_ptr_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE case dst_set_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE case dst_proc_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE case dst_func_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE /* Back tto some ordinary ones */ +// OBSOLETE case dst_void_type: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE case dst_uchar_type: +// OBSOLETE type = builtin_type_unsigned_char; +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE type = builtin_type_void; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE return type; +// OBSOLETE } +// OBSOLETE +// OBSOLETE struct structure_list +// OBSOLETE { +// OBSOLETE struct structure_list *next; +// OBSOLETE struct type *type; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE static struct structure_list *struct_list = NULL; +// OBSOLETE +// OBSOLETE static struct type * +// OBSOLETE find_dst_structure (char *name) +// OBSOLETE { +// OBSOLETE struct structure_list *element; +// OBSOLETE +// OBSOLETE for (element = struct_list; element; element = element->next) +// OBSOLETE if (!strcmp (name, TYPE_NAME (element->type))) +// OBSOLETE return element->type; +// OBSOLETE return NULL; +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE static struct type * +// OBSOLETE decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code, +// OBSOLETE int version) +// OBSOLETE { +// OBSOLETE struct type *type, *child_type; +// OBSOLETE char *struct_name; +// OBSOLETE char *name, *field_name; +// OBSOLETE int i; +// OBSOLETE int fieldoffset, fieldsize; +// OBSOLETE dst_type_t type_desc; +// OBSOLETE struct structure_list *element; +// OBSOLETE +// OBSOLETE struct_name = DST_OFFSET (entry, DST_record (entry).noffset); +// OBSOLETE name = concat ((code == TYPE_CODE_UNION) ? "union " : "struct ", +// OBSOLETE struct_name, NULL); +// OBSOLETE type = find_dst_structure (name); +// OBSOLETE if (type) +// OBSOLETE { +// OBSOLETE xfree (name); +// OBSOLETE return type; +// OBSOLETE } +// OBSOLETE type = alloc_type (objfile); +// OBSOLETE TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack, +// OBSOLETE name, strlen (name)); +// OBSOLETE xfree (name); +// OBSOLETE TYPE_CODE (type) = code; +// OBSOLETE TYPE_LENGTH (type) = DST_record (entry).size; +// OBSOLETE TYPE_NFIELDS (type) = DST_record (entry).nfields; +// OBSOLETE TYPE_FIELDS (type) = (struct field *) +// OBSOLETE obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * +// OBSOLETE DST_record (entry).nfields); +// OBSOLETE fieldoffset = fieldsize = 0; +// OBSOLETE INIT_CPLUS_SPECIFIC (type); +// OBSOLETE element = (struct structure_list *) +// OBSOLETE xmalloc (sizeof (struct structure_list)); +// OBSOLETE element->type = type; +// OBSOLETE element->next = struct_list; +// OBSOLETE struct_list = element; +// OBSOLETE for (i = 0; i < DST_record (entry).nfields; i++) +// OBSOLETE { +// OBSOLETE switch (version) +// OBSOLETE { +// OBSOLETE case 2: +// OBSOLETE field_name = DST_OFFSET (entry, +// OBSOLETE DST_record (entry).f.ofields[i].noffset); +// OBSOLETE fieldoffset = DST_record (entry).f.ofields[i].foffset * 8 + +// OBSOLETE DST_record (entry).f.ofields[i].bit_offset; +// OBSOLETE fieldsize = DST_record (entry).f.ofields[i].size; +// OBSOLETE type_desc = DST_record (entry).f.ofields[i].type_desc; +// OBSOLETE break; +// OBSOLETE case 1: +// OBSOLETE field_name = DST_OFFSET (entry, +// OBSOLETE DST_record (entry).f.fields[i].noffset); +// OBSOLETE type_desc = DST_record (entry).f.fields[i].type_desc; +// OBSOLETE switch (DST_record (entry).f.fields[i].f.field_loc.format_tag) +// OBSOLETE { +// OBSOLETE case dst_field_byte: +// OBSOLETE fieldoffset = DST_record (entry).f. +// OBSOLETE fields[i].f.field_byte.offset * 8; +// OBSOLETE fieldsize = -1; +// OBSOLETE break; +// OBSOLETE case dst_field_bit: +// OBSOLETE fieldoffset = DST_record (entry).f. +// OBSOLETE fields[i].f.field_bit.byte_offset * 8 + +// OBSOLETE DST_record (entry).f. +// OBSOLETE fields[i].f.field_bit.bit_offset; +// OBSOLETE fieldsize = DST_record (entry).f. +// OBSOLETE fields[i].f.field_bit.nbits; +// OBSOLETE break; +// OBSOLETE case dst_field_loc: +// OBSOLETE fieldoffset += fieldsize; +// OBSOLETE fieldsize = -1; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case 0: +// OBSOLETE field_name = DST_OFFSET (entry, +// OBSOLETE DST_record (entry).f.sfields[i].noffset); +// OBSOLETE fieldoffset = DST_record (entry).f.sfields[i].foffset; +// OBSOLETE type_desc = DST_record (entry).f.sfields[i].type_desc; +// OBSOLETE if (i < DST_record (entry).nfields - 1) +// OBSOLETE fieldsize = DST_record (entry).f.sfields[i + 1].foffset; +// OBSOLETE else +// OBSOLETE fieldsize = DST_record (entry).size; +// OBSOLETE fieldsize -= fieldoffset; +// OBSOLETE fieldoffset *= 8; +// OBSOLETE fieldsize *= 8; +// OBSOLETE } +// OBSOLETE TYPE_FIELDS (type)[i].name = +// OBSOLETE obstack_copy0 (&objfile->symbol_obstack, +// OBSOLETE field_name, strlen (field_name)); +// OBSOLETE TYPE_FIELDS (type)[i].type = decode_type_desc (objfile, +// OBSOLETE &type_desc, +// OBSOLETE entry); +// OBSOLETE if (fieldsize == -1) +// OBSOLETE fieldsize = TYPE_LENGTH (TYPE_FIELDS (type)[i].type) * +// OBSOLETE 8; +// OBSOLETE TYPE_FIELDS (type)[i].bitsize = fieldsize; +// OBSOLETE TYPE_FIELDS (type)[i].bitpos = fieldoffset; +// OBSOLETE } +// OBSOLETE return type; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct type * +// OBSOLETE decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry) +// OBSOLETE { +// OBSOLETE struct type *child_type, *type, *range_type, *index_type; +// OBSOLETE +// OBSOLETE switch (entry->rec_type) +// OBSOLETE { +// OBSOLETE case dst_typ_var: +// OBSOLETE return decode_type_desc (objfile, +// OBSOLETE &DST_var (entry).type_desc, +// OBSOLETE entry); +// OBSOLETE break; +// OBSOLETE case dst_typ_variable: +// OBSOLETE return decode_type_desc (objfile, +// OBSOLETE &DST_variable (entry).type_desc, +// OBSOLETE entry); +// OBSOLETE break; +// OBSOLETE case dst_typ_short_rec: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 0); +// OBSOLETE case dst_typ_short_union: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 0); +// OBSOLETE case dst_typ_union: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 1); +// OBSOLETE case dst_typ_record: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 1); +// OBSOLETE case dst_typ_old_union: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 2); +// OBSOLETE case dst_typ_old_record: +// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 2); +// OBSOLETE case dst_typ_pointer: +// OBSOLETE return make_pointer_type ( +// OBSOLETE decode_type_desc (objfile, +// OBSOLETE &DST_pointer (entry).type_desc, +// OBSOLETE entry), +// OBSOLETE NULL); +// OBSOLETE case dst_typ_array: +// OBSOLETE child_type = decode_type_desc (objfile, +// OBSOLETE &DST_pointer (entry).type_desc, +// OBSOLETE entry); +// OBSOLETE index_type = lookup_fundamental_type (objfile, +// OBSOLETE FT_INTEGER); +// OBSOLETE range_type = create_range_type ((struct type *) NULL, +// OBSOLETE index_type, DST_array (entry).lo_bound, +// OBSOLETE DST_array (entry).hi_bound); +// OBSOLETE return create_array_type ((struct type *) NULL, child_type, +// OBSOLETE range_type); +// OBSOLETE case dst_typ_alias: +// OBSOLETE return decode_type_desc (objfile, +// OBSOLETE &DST_alias (entry).type_desc, +// OBSOLETE entry); +// OBSOLETE default: +// OBSOLETE return builtin_type_int; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE struct symbol_list +// OBSOLETE { +// OBSOLETE struct symbol_list *next; +// OBSOLETE struct symbol *symbol; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE static struct symbol_list *dst_global_symbols = NULL; +// OBSOLETE static int total_globals = 0; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE decode_dst_locstring (char *locstr, struct symbol *sym) +// OBSOLETE { +// OBSOLETE dst_loc_entry_t *entry, *next_entry; +// OBSOLETE CORE_ADDR temp; +// OBSOLETE int count = 0; +// OBSOLETE +// OBSOLETE while (1) +// OBSOLETE { +// OBSOLETE if (count++ == 100) +// OBSOLETE { +// OBSOLETE fprintf_unfiltered (gdb_stderr, "Error reading locstring\n"); +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE entry = (dst_loc_entry_t *) locstr; +// OBSOLETE next_entry = (dst_loc_entry_t *) (locstr + 1); +// OBSOLETE switch (entry->header.code) +// OBSOLETE { +// OBSOLETE case dst_lsc_end: /* End of string */ +// OBSOLETE return; +// OBSOLETE case dst_lsc_indirect: /* Indirect through previous. Arg == 6 */ +// OBSOLETE /* Or register ax x == arg */ +// OBSOLETE if (entry->header.arg < 6) +// OBSOLETE { +// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; +// OBSOLETE SYMBOL_VALUE (sym) = entry->header.arg + 8; +// OBSOLETE } +// OBSOLETE /* We predict indirects */ +// OBSOLETE locstr++; +// OBSOLETE break; +// OBSOLETE case dst_lsc_dreg: +// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; +// OBSOLETE SYMBOL_VALUE (sym) = entry->header.arg; +// OBSOLETE locstr++; +// OBSOLETE break; +// OBSOLETE case dst_lsc_section: /* Section (arg+1) */ +// OBSOLETE SYMBOL_VALUE (sym) = dst_get_addr (entry->header.arg + 1, 0); +// OBSOLETE locstr++; +// OBSOLETE break; +// OBSOLETE case dst_lsc_sec_byte: /* Section (next_byte+1) */ +// OBSOLETE SYMBOL_VALUE (sym) = dst_get_addr (locstr[1] + 1, 0); +// OBSOLETE locstr += 2; +// OBSOLETE break; +// OBSOLETE case dst_lsc_add: /* Add (arg+1)*2 */ +// OBSOLETE case dst_lsc_sub: /* Subtract (arg+1)*2 */ +// OBSOLETE temp = (entry->header.arg + 1) * 2; +// OBSOLETE locstr++; +// OBSOLETE if (*locstr == dst_multiply_256) +// OBSOLETE { +// OBSOLETE temp <<= 8; +// OBSOLETE locstr++; +// OBSOLETE } +// OBSOLETE switch (entry->header.code) +// OBSOLETE { +// OBSOLETE case dst_lsc_add: +// OBSOLETE if (SYMBOL_CLASS (sym) == LOC_LOCAL) +// OBSOLETE SYMBOL_CLASS (sym) = LOC_ARG; +// OBSOLETE SYMBOL_VALUE (sym) += temp; +// OBSOLETE break; +// OBSOLETE case dst_lsc_sub: +// OBSOLETE SYMBOL_VALUE (sym) -= temp; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case dst_lsc_add_byte: +// OBSOLETE case dst_lsc_sub_byte: +// OBSOLETE switch (entry->header.arg & 0x03) +// OBSOLETE { +// OBSOLETE case 1: +// OBSOLETE temp = (unsigned char) locstr[1]; +// OBSOLETE locstr += 2; +// OBSOLETE break; +// OBSOLETE case 2: +// OBSOLETE temp = *(unsigned short *) (locstr + 1); +// OBSOLETE locstr += 3; +// OBSOLETE break; +// OBSOLETE case 3: +// OBSOLETE temp = *(unsigned long *) (locstr + 1); +// OBSOLETE locstr += 5; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE if (*locstr == dst_multiply_256) +// OBSOLETE { +// OBSOLETE temp <<= 8; +// OBSOLETE locstr++; +// OBSOLETE } +// OBSOLETE switch (entry->header.code) +// OBSOLETE { +// OBSOLETE case dst_lsc_add_byte: +// OBSOLETE if (SYMBOL_CLASS (sym) == LOC_LOCAL) +// OBSOLETE SYMBOL_CLASS (sym) = LOC_ARG; +// OBSOLETE SYMBOL_VALUE (sym) += temp; +// OBSOLETE break; +// OBSOLETE case dst_lsc_sub_byte: +// OBSOLETE SYMBOL_VALUE (sym) -= temp; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0 */ +// OBSOLETE if (next_entry->header.code != dst_lsc_indirect) +// OBSOLETE { +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE SYMBOL_CLASS (sym) = LOC_LOCAL; +// OBSOLETE locstr++; +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct symbol_list * +// OBSOLETE process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name, +// OBSOLETE int *nsyms_ret) +// OBSOLETE { +// OBSOLETE struct symbol_list *list = NULL, *element; +// OBSOLETE struct symbol *sym; +// OBSOLETE char *symname; +// OBSOLETE int nsyms = 0; +// OBSOLETE char *location; +// OBSOLETE long line; +// OBSOLETE dst_type_t symtype; +// OBSOLETE struct type *type; +// OBSOLETE dst_var_attr_t attr; +// OBSOLETE dst_var_loc_t loc_type; +// OBSOLETE unsigned loc_index; +// OBSOLETE long loc_value; +// OBSOLETE +// OBSOLETE if (!entry) +// OBSOLETE { +// OBSOLETE *nsyms_ret = 0; +// OBSOLETE return NULL; +// OBSOLETE } +// OBSOLETE location = (char *) entry; +// OBSOLETE while (NEXT_SYM (&location, &entry) && +// OBSOLETE entry->rec_type != dst_typ_end_scope) +// OBSOLETE { +// OBSOLETE if (entry->rec_type == dst_typ_var) +// OBSOLETE { +// OBSOLETE if (DST_var (entry).short_locs) +// OBSOLETE { +// OBSOLETE loc_type = DST_var (entry).locs.shorts[0].loc_type; +// OBSOLETE loc_index = DST_var (entry).locs.shorts[0].loc_index; +// OBSOLETE loc_value = DST_var (entry).locs.shorts[0].location; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE loc_type = DST_var (entry).locs.longs[0].loc_type; +// OBSOLETE loc_index = DST_var (entry).locs.longs[0].loc_index; +// OBSOLETE loc_value = DST_var (entry).locs.longs[0].location; +// OBSOLETE } +// OBSOLETE if (loc_type == dst_var_loc_external) +// OBSOLETE continue; +// OBSOLETE symname = DST_OFFSET (entry, DST_var (entry).noffset); +// OBSOLETE line = DST_var (entry).src_loc.line_number; +// OBSOLETE symtype = DST_var (entry).type_desc; +// OBSOLETE attr = DST_var (entry).attributes; +// OBSOLETE } +// OBSOLETE else if (entry->rec_type == dst_typ_variable) +// OBSOLETE { +// OBSOLETE symname = DST_OFFSET (entry, +// OBSOLETE DST_variable (entry).noffset); +// OBSOLETE line = DST_variable (entry).src_loc.line_number; +// OBSOLETE symtype = DST_variable (entry).type_desc; +// OBSOLETE attr = DST_variable (entry).attributes; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE continue; +// OBSOLETE } +// OBSOLETE if (symname && name && !strcmp (symname, name)) +// OBSOLETE /* It's the function return value */ +// OBSOLETE continue; +// OBSOLETE sym = create_new_symbol (objfile, symname); +// OBSOLETE +// OBSOLETE if ((attr & (1 << dst_var_attr_global)) || +// OBSOLETE (attr & (1 << dst_var_attr_static))) +// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; +// OBSOLETE else +// OBSOLETE SYMBOL_CLASS (sym) = LOC_LOCAL; +// OBSOLETE SYMBOL_LINE (sym) = line; +// OBSOLETE SYMBOL_TYPE (sym) = decode_type_desc (objfile, &symtype, +// OBSOLETE entry); +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE switch (entry->rec_type) +// OBSOLETE { +// OBSOLETE case dst_typ_var: +// OBSOLETE switch (loc_type) +// OBSOLETE { +// OBSOLETE case dst_var_loc_abs: +// OBSOLETE SYMBOL_VALUE_ADDRESS (sym) = loc_value; +// OBSOLETE break; +// OBSOLETE case dst_var_loc_sect_off: +// OBSOLETE case dst_var_loc_ind_sect_off: /* What is this? */ +// OBSOLETE SYMBOL_VALUE_ADDRESS (sym) = dst_get_addr ( +// OBSOLETE loc_index, +// OBSOLETE loc_value); +// OBSOLETE break; +// OBSOLETE case dst_var_loc_ind_reg_rel: /* What is this? */ +// OBSOLETE case dst_var_loc_reg_rel: +// OBSOLETE /* If it isn't fp relative, specify the +// OBSOLETE * register it's relative to. +// OBSOLETE */ +// OBSOLETE if (loc_index) +// OBSOLETE { +// OBSOLETE sym->aux_value.basereg = loc_index; +// OBSOLETE } +// OBSOLETE SYMBOL_VALUE (sym) = loc_value; +// OBSOLETE if (loc_value > 0 && +// OBSOLETE SYMBOL_CLASS (sym) == LOC_BASEREG) +// OBSOLETE SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; +// OBSOLETE break; +// OBSOLETE case dst_var_loc_reg: +// OBSOLETE SYMBOL_VALUE (sym) = loc_index; +// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case dst_typ_variable: +// OBSOLETE /* External variable..... don't try to interpret +// OBSOLETE * its nonexistant locstring. +// OBSOLETE */ +// OBSOLETE if (DST_variable (entry).loffset == -1) +// OBSOLETE continue; +// OBSOLETE decode_dst_locstring (DST_OFFSET (entry, +// OBSOLETE DST_variable (entry).loffset), +// OBSOLETE sym); +// OBSOLETE } +// OBSOLETE element = (struct symbol_list *) +// OBSOLETE xmalloc (sizeof (struct symbol_list)); +// OBSOLETE +// OBSOLETE if (attr & (1 << dst_var_attr_global)) +// OBSOLETE { +// OBSOLETE element->next = dst_global_symbols; +// OBSOLETE dst_global_symbols = element; +// OBSOLETE total_globals++; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE element->next = list; +// OBSOLETE list = element; +// OBSOLETE nsyms++; +// OBSOLETE } +// OBSOLETE element->symbol = sym; +// OBSOLETE } +// OBSOLETE *nsyms_ret = nsyms; +// OBSOLETE return list; +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE static struct symbol * +// OBSOLETE process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name, +// OBSOLETE CORE_ADDR address) +// OBSOLETE { +// OBSOLETE struct symbol *sym; +// OBSOLETE struct type *type, *ftype; +// OBSOLETE dst_rec_ptr_t sym_entry, typ_entry; +// OBSOLETE char *location; +// OBSOLETE struct symbol_list *element; +// OBSOLETE +// OBSOLETE type = builtin_type_int; +// OBSOLETE sym = create_new_symbol (objfile, name); +// OBSOLETE SYMBOL_CLASS (sym) = LOC_BLOCK; +// OBSOLETE +// OBSOLETE if (entry) +// OBSOLETE { +// OBSOLETE location = (char *) entry; +// OBSOLETE do +// OBSOLETE { +// OBSOLETE NEXT_SYM (&location, &sym_entry); +// OBSOLETE } +// OBSOLETE while (sym_entry && sym_entry->rec_type != dst_typ_signature); +// OBSOLETE +// OBSOLETE if (sym_entry) +// OBSOLETE { +// OBSOLETE SYMBOL_LINE (sym) = +// OBSOLETE DST_signature (sym_entry).src_loc.line_number; +// OBSOLETE if (DST_signature (sym_entry).result) +// OBSOLETE { +// OBSOLETE typ_entry = (dst_rec_ptr_t) +// OBSOLETE DST_OFFSET (sym_entry, +// OBSOLETE DST_signature (sym_entry).result); +// OBSOLETE type = decode_dst_type (objfile, typ_entry); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (!type->function_type) +// OBSOLETE { +// OBSOLETE ftype = alloc_type (objfile); +// OBSOLETE type->function_type = ftype; +// OBSOLETE TYPE_TARGET_TYPE (ftype) = type; +// OBSOLETE TYPE_CODE (ftype) = TYPE_CODE_FUNC; +// OBSOLETE } +// OBSOLETE SYMBOL_TYPE (sym) = type->function_type; +// OBSOLETE +// OBSOLETE /* Now add ourselves to the global symbols list */ +// OBSOLETE element = (struct symbol_list *) +// OBSOLETE xmalloc (sizeof (struct symbol_list)); +// OBSOLETE +// OBSOLETE element->next = dst_global_symbols; +// OBSOLETE dst_global_symbols = element; +// OBSOLETE total_globals++; +// OBSOLETE element->symbol = sym; +// OBSOLETE +// OBSOLETE return sym; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct block * +// OBSOLETE process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry) +// OBSOLETE { +// OBSOLETE struct block *block; +// OBSOLETE struct symbol *function = NULL; +// OBSOLETE CORE_ADDR address; +// OBSOLETE long size; +// OBSOLETE char *name; +// OBSOLETE dst_rec_ptr_t child_entry, symbol_entry; +// OBSOLETE struct block *child_block; +// OBSOLETE int total_symbols = 0; +// OBSOLETE char fake_name[20]; +// OBSOLETE static long fake_seq = 0; +// OBSOLETE struct symbol_list *symlist, *nextsym; +// OBSOLETE int symnum; +// OBSOLETE +// OBSOLETE if (DST_block (entry).noffset) +// OBSOLETE name = DST_OFFSET (entry, DST_block (entry).noffset); +// OBSOLETE else +// OBSOLETE name = NULL; +// OBSOLETE if (DST_block (entry).n_of_code_ranges) +// OBSOLETE { +// OBSOLETE address = dst_sym_addr ( +// OBSOLETE &DST_block (entry).code_ranges[0].code_start); +// OBSOLETE size = DST_block (entry).code_ranges[0].code_size; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE address = -1; +// OBSOLETE size = 0; +// OBSOLETE } +// OBSOLETE symbol_entry = (dst_rec_ptr_t) get_sec_ref (&DST_block (entry).symbols_start); +// OBSOLETE switch (DST_block (entry).block_type) +// OBSOLETE { +// OBSOLETE /* These are all really functions. Even the "program" type. +// OBSOLETE * This is because the Apollo OS was written in Pascal, and +// OBSOLETE * in Pascal, the main procedure is described as the Program. +// OBSOLETE * Cute, huh? +// OBSOLETE */ +// OBSOLETE case dst_block_procedure: +// OBSOLETE case dst_block_function: +// OBSOLETE case dst_block_subroutine: +// OBSOLETE case dst_block_program: +// OBSOLETE prim_record_minimal_symbol (name, address, mst_text, objfile); +// OBSOLETE function = process_dst_function ( +// OBSOLETE objfile, +// OBSOLETE symbol_entry, +// OBSOLETE name, +// OBSOLETE address); +// OBSOLETE enter_all_lines (get_sec_ref (&DST_block (entry).code_ranges[0].lines_start), address); +// OBSOLETE break; +// OBSOLETE case dst_block_block_data: +// OBSOLETE break; +// OBSOLETE +// OBSOLETE default: +// OBSOLETE /* GDB has to call it something, and the module name +// OBSOLETE * won't cut it +// OBSOLETE */ +// OBSOLETE sprintf (fake_name, "block_%08lx", fake_seq++); +// OBSOLETE function = process_dst_function ( +// OBSOLETE objfile, NULL, fake_name, address); +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE symlist = process_dst_symbols (objfile, symbol_entry, +// OBSOLETE name, &total_symbols); +// OBSOLETE block = (struct block *) +// OBSOLETE obstack_alloc (&objfile->symbol_obstack, +// OBSOLETE sizeof (struct block) + +// OBSOLETE (total_symbols - 1) * sizeof (struct symbol *)); +// OBSOLETE +// OBSOLETE symnum = 0; +// OBSOLETE while (symlist) +// OBSOLETE { +// OBSOLETE nextsym = symlist->next; +// OBSOLETE +// OBSOLETE block->sym[symnum] = symlist->symbol; +// OBSOLETE +// OBSOLETE xfree (symlist); +// OBSOLETE symlist = nextsym; +// OBSOLETE symnum++; +// OBSOLETE } +// OBSOLETE BLOCK_NSYMS (block) = total_symbols; +// OBSOLETE BLOCK_HASHTABLE (block) = 0; +// OBSOLETE BLOCK_START (block) = address; +// OBSOLETE BLOCK_END (block) = address + size; +// OBSOLETE BLOCK_SUPERBLOCK (block) = 0; +// OBSOLETE if (function) +// OBSOLETE { +// OBSOLETE SYMBOL_BLOCK_VALUE (function) = block; +// OBSOLETE BLOCK_FUNCTION (block) = function; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE BLOCK_FUNCTION (block) = 0; +// OBSOLETE +// OBSOLETE if (DST_block (entry).child_block_off) +// OBSOLETE { +// OBSOLETE child_entry = (dst_rec_ptr_t) DST_OFFSET (entry, +// OBSOLETE DST_block (entry).child_block_off); +// OBSOLETE while (child_entry) +// OBSOLETE { +// OBSOLETE child_block = process_dst_block (objfile, child_entry); +// OBSOLETE if (child_block) +// OBSOLETE { +// OBSOLETE if (BLOCK_START (child_block) < +// OBSOLETE BLOCK_START (block) || +// OBSOLETE BLOCK_START (block) == -1) +// OBSOLETE BLOCK_START (block) = +// OBSOLETE BLOCK_START (child_block); +// OBSOLETE if (BLOCK_END (child_block) > +// OBSOLETE BLOCK_END (block) || +// OBSOLETE BLOCK_END (block) == -1) +// OBSOLETE BLOCK_END (block) = +// OBSOLETE BLOCK_END (child_block); +// OBSOLETE BLOCK_SUPERBLOCK (child_block) = block; +// OBSOLETE } +// OBSOLETE if (DST_block (child_entry).sibling_block_off) +// OBSOLETE child_entry = (dst_rec_ptr_t) DST_OFFSET ( +// OBSOLETE child_entry, +// OBSOLETE DST_block (child_entry).sibling_block_off); +// OBSOLETE else +// OBSOLETE child_entry = NULL; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE record_pending_block (objfile, block, NULL); +// OBSOLETE return block; +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE static void +// OBSOLETE read_dst_symtab (struct objfile *objfile) +// OBSOLETE { +// OBSOLETE char *buffer; +// OBSOLETE dst_rec_ptr_t entry, file_table, root_block; +// OBSOLETE char *source_file; +// OBSOLETE struct block *block, *global_block; +// OBSOLETE int symnum; +// OBSOLETE struct symbol_list *nextsym; +// OBSOLETE int module_num = 0; +// OBSOLETE struct structure_list *element; +// OBSOLETE +// OBSOLETE current_objfile = objfile; +// OBSOLETE buffer = blocks_info.buffer; +// OBSOLETE while (NEXT_BLK (&buffer, &entry)) +// OBSOLETE { +// OBSOLETE if (entry->rec_type == dst_typ_comp_unit) +// OBSOLETE { +// OBSOLETE file_table = (dst_rec_ptr_t) DST_OFFSET (entry, +// OBSOLETE DST_comp_unit (entry).file_table); +// OBSOLETE section_table = (dst_rec_ptr_t) DST_OFFSET (entry, +// OBSOLETE DST_comp_unit (entry).section_table); +// OBSOLETE root_block = (dst_rec_ptr_t) DST_OFFSET (entry, +// OBSOLETE DST_comp_unit (entry).root_block_offset); +// OBSOLETE source_file = DST_OFFSET (file_table, +// OBSOLETE DST_file_tab (file_table).files[0].noffset); +// OBSOLETE /* Point buffer to the start of the next comp_unit */ +// OBSOLETE buffer = DST_OFFSET (entry, +// OBSOLETE DST_comp_unit (entry).data_size); +// OBSOLETE dst_start_symtab (); +// OBSOLETE +// OBSOLETE block = process_dst_block (objfile, root_block); +// OBSOLETE +// OBSOLETE global_block = (struct block *) +// OBSOLETE obstack_alloc (&objfile->symbol_obstack, +// OBSOLETE sizeof (struct block) + +// OBSOLETE (total_globals - 1) * +// OBSOLETE sizeof (struct symbol *)); +// OBSOLETE BLOCK_NSYMS (global_block) = total_globals; +// OBSOLETE BLOCK_HASHTABLE (global_block) = 0; +// OBSOLETE for (symnum = 0; symnum < total_globals; symnum++) +// OBSOLETE { +// OBSOLETE nextsym = dst_global_symbols->next; +// OBSOLETE +// OBSOLETE global_block->sym[symnum] = +// OBSOLETE dst_global_symbols->symbol; +// OBSOLETE +// OBSOLETE xfree (dst_global_symbols); +// OBSOLETE dst_global_symbols = nextsym; +// OBSOLETE } +// OBSOLETE dst_global_symbols = NULL; +// OBSOLETE total_globals = 0; +// OBSOLETE BLOCK_FUNCTION (global_block) = 0; +// OBSOLETE BLOCK_START (global_block) = BLOCK_START (block); +// OBSOLETE BLOCK_END (global_block) = BLOCK_END (block); +// OBSOLETE BLOCK_SUPERBLOCK (global_block) = 0; +// OBSOLETE BLOCK_SUPERBLOCK (block) = global_block; +// OBSOLETE record_pending_block (objfile, global_block, NULL); +// OBSOLETE +// OBSOLETE complete_symtab (source_file, +// OBSOLETE BLOCK_START (block), +// OBSOLETE BLOCK_END (block) - BLOCK_START (block)); +// OBSOLETE module_num++; +// OBSOLETE dst_end_symtab (objfile); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE if (module_num) +// OBSOLETE prim_record_minimal_symbol ("", +// OBSOLETE BLOCK_END (block), mst_text, objfile); +// OBSOLETE /* One more faked symbol to make sure nothing can ever run off the +// OBSOLETE * end of the symbol table. This one represents the end of the +// OBSOLETE * text space. It used to be (CORE_ADDR) -1 (effectively the highest +// OBSOLETE * int possible), but some parts of gdb treated it as a signed +// OBSOLETE * number and failed comparisons. We could equally use 7fffffff, +// OBSOLETE * but no functions are ever mapped to an address higher than +// OBSOLETE * 40000000 +// OBSOLETE */ +// OBSOLETE prim_record_minimal_symbol ("", +// OBSOLETE (CORE_ADDR) 0x40000000, +// OBSOLETE mst_text, objfile); +// OBSOLETE while (struct_list) +// OBSOLETE { +// OBSOLETE element = struct_list; +// OBSOLETE struct_list = element->next; +// OBSOLETE xfree (element); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Support for line number handling */ +// OBSOLETE static char *linetab = NULL; +// OBSOLETE static long linetab_offset; +// OBSOLETE static unsigned long linetab_size; +// OBSOLETE +// OBSOLETE /* Read in all the line numbers for fast lookups later. Leave them in +// OBSOLETE external (unswapped) format in memory; we'll swap them as we enter +// OBSOLETE them into GDB's data structures. */ +// OBSOLETE static int +// OBSOLETE init_one_section (int chan, dst_sec *secinfo) +// OBSOLETE { +// OBSOLETE if (secinfo->size == 0 +// OBSOLETE || lseek (chan, secinfo->position, 0) == -1 +// OBSOLETE || (secinfo->buffer = xmalloc (secinfo->size)) == NULL +// OBSOLETE || myread (chan, secinfo->buffer, secinfo->size) == -1) +// OBSOLETE return 0; +// OBSOLETE else +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static int +// OBSOLETE init_dst_sections (int chan) +// OBSOLETE { +// OBSOLETE +// OBSOLETE if (!init_one_section (chan, &blocks_info) || +// OBSOLETE !init_one_section (chan, &lines_info) || +// OBSOLETE !init_one_section (chan, &symbols_info)) +// OBSOLETE return -1; +// OBSOLETE else +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Fake up support for relocating symbol addresses. FIXME. */ +// OBSOLETE +// OBSOLETE struct section_offsets dst_symfile_faker = +// OBSOLETE {0}; +// OBSOLETE +// OBSOLETE void +// OBSOLETE dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) +// OBSOLETE { +// OBSOLETE objfile->num_sections = 1; +// OBSOLETE objfile->section_offsets = &dst_symfile_faker; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Register our ability to parse symbols for DST BFD files */ +// OBSOLETE +// OBSOLETE static struct sym_fns dst_sym_fns = +// OBSOLETE { +// OBSOLETE /* FIXME: Can this be integrated with coffread.c? If not, should it be +// OBSOLETE a separate flavour like ecoff? */ +// OBSOLETE (enum bfd_flavour) -2, +// OBSOLETE +// OBSOLETE dst_new_init, /* sym_new_init: init anything gbl to entire symtab */ +// OBSOLETE dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */ +// OBSOLETE dst_symfile_read, /* sym_read: read a symbol file into symtab */ +// OBSOLETE dst_symfile_finish, /* sym_finish: finished with file, cleanup */ +// OBSOLETE dst_symfile_offsets, /* sym_offsets: xlate external to internal form */ +// OBSOLETE NULL /* next: pointer to next struct sym_fns */ +// OBSOLETE }; +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_dstread (void) +// OBSOLETE { +// OBSOLETE add_symtab_fns (&dst_sym_fns); +// OBSOLETE } diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 75ee279bf94..0d96e1ff74d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1009,9 +1009,13 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline) dwarf_abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_offset, dwarf_abbrev_size); - dwarf_line_buffer = dwarf2_read_section (objfile, - dwarf_line_offset, - dwarf_line_size); + + if (dwarf_line_offset) + dwarf_line_buffer = dwarf2_read_section (objfile, + dwarf_line_offset, + dwarf_line_size); + else + dwarf_line_buffer = NULL; if (dwarf_str_offset) dwarf_str_buffer = dwarf2_read_section (objfile, @@ -1808,7 +1812,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile, header, so we can only read it if we've read the header successfully. */ attr = dwarf_attr (die, DW_AT_macro_info); - if (attr) + if (attr && line_header) { unsigned int macro_offset = DW_UNSND (attr); dwarf_decode_macros (line_header, macro_offset, diff --git a/gdb/frame.c b/gdb/frame.c index 10d609dd2f9..3b17bf5abf0 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -142,7 +142,9 @@ frame_register_unwind (struct frame_info *frame, int regnum, register cache. */ *optimizedp = 0; *lvalp = lval_register; - *addrp = 0; + /* ULGH! Code uses the offset into the raw register byte array + as a way of identifying a register. */ + *addrp = REGISTER_BYTE (regnum); /* Should this code test ``register_cached (regnum) < 0'' and do something like set realnum to -1 when the register isn't available? */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 682d9259abe..933faa13612 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -44,7 +44,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_ 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_return_value_ftype frv_store_return_value; 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; @@ -1090,7 +1089,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value); set_gdbarch_store_struct_return (gdbarch, frv_store_struct_return); - set_gdbarch_store_return_value (gdbarch, frv_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, frv_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address); /* Settings for calling functions in the inferior. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 93a5c0e5aff..e930642f15f 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -172,7 +172,9 @@ struct gdbarch int max_register_virtual_size; gdbarch_register_virtual_type_ftype *register_virtual_type; gdbarch_do_registers_info_ftype *do_registers_info; + gdbarch_print_registers_info_ftype *print_registers_info; gdbarch_print_float_info_ftype *print_float_info; + gdbarch_print_vector_info_ftype *print_vector_info; gdbarch_register_sim_regno_ftype *register_sim_regno; gdbarch_register_bytes_ok_ftype *register_bytes_ok; gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; @@ -208,14 +210,15 @@ struct gdbarch gdbarch_address_to_pointer_ftype *address_to_pointer; gdbarch_integer_to_address_ftype *integer_to_address; gdbarch_return_value_on_stack_ftype *return_value_on_stack; - gdbarch_extract_return_value_ftype *extract_return_value; - gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value; gdbarch_push_arguments_ftype *push_arguments; gdbarch_push_dummy_frame_ftype *push_dummy_frame; gdbarch_push_return_address_ftype *push_return_address; gdbarch_pop_frame_ftype *pop_frame; gdbarch_store_struct_return_ftype *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; + gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value; gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; gdbarch_use_struct_convention_ftype *use_struct_convention; @@ -255,6 +258,7 @@ struct gdbarch gdbarch_print_insn_ftype *print_insn; gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline; + gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp; gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; @@ -315,14 +319,18 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, + generic_register_byte, generic_register_size, 0, generic_register_size, 0, 0, 0, - default_print_float_info, + default_print_registers_info, + 0, + 0, + 0, + 0, 0, 0, 0, @@ -484,12 +492,12 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->register_name = legacy_register_name; current_gdbarch->register_size = -1; current_gdbarch->register_bytes = -1; + current_gdbarch->register_byte = generic_register_byte; current_gdbarch->register_raw_size = generic_register_size; current_gdbarch->max_register_raw_size = -1; current_gdbarch->register_virtual_size = generic_register_size; current_gdbarch->max_register_virtual_size = -1; - current_gdbarch->do_registers_info = do_registers_info; - current_gdbarch->print_float_info = default_print_float_info; + current_gdbarch->print_registers_info = default_print_registers_info; current_gdbarch->register_sim_regno = legacy_register_sim_regno; current_gdbarch->cannot_fetch_register = cannot_register_not; current_gdbarch->cannot_store_register = cannot_register_not; @@ -513,8 +521,9 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->pointer_to_address = unsigned_pointer_to_address; current_gdbarch->address_to_pointer = unsigned_address_to_pointer; current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not; - current_gdbarch->extract_return_value = legacy_extract_return_value; current_gdbarch->push_arguments = default_push_arguments; + current_gdbarch->extract_return_value = legacy_extract_return_value; + current_gdbarch->store_return_value = legacy_store_return_value; current_gdbarch->use_struct_convention = generic_use_struct_convention; current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; @@ -534,6 +543,7 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->print_insn = legacy_print_insn; current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code; current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline; + current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp; current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; current_gdbarch->construct_inferior_arguments = construct_inferior_arguments; @@ -623,9 +633,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->register_bytes == -1)) fprintf_unfiltered (log, "\n\tregister_bytes"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->register_byte == 0)) - fprintf_unfiltered (log, "\n\tregister_byte"); + /* Skip verify of register_byte, invalid_p == 0 */ /* Skip verify of register_raw_size, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->max_register_raw_size == -1)) @@ -637,8 +645,10 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->register_virtual_type == 0)) fprintf_unfiltered (log, "\n\tregister_virtual_type"); - /* Skip verify of do_registers_info, invalid_p == 0 */ - /* Skip verify of print_float_info, invalid_p == 0 */ + /* Skip verify of do_registers_info, has predicate */ + /* Skip verify of print_registers_info, invalid_p == 0 */ + /* Skip verify of print_float_info, has predicate */ + /* Skip verify of print_vector_info, has predicate */ /* Skip verify of register_sim_regno, invalid_p == 0 */ /* Skip verify of register_bytes_ok, has predicate */ /* Skip verify of cannot_fetch_register, invalid_p == 0 */ @@ -696,10 +706,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of address_to_pointer, invalid_p == 0 */ /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value_on_stack, invalid_p == 0 */ - /* Skip verify of extract_return_value, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->deprecated_extract_return_value == 0)) - fprintf_unfiltered (log, "\n\tdeprecated_extract_return_value"); /* Skip verify of push_arguments, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->push_dummy_frame == 0)) @@ -711,9 +717,8 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->store_struct_return == 0)) fprintf_unfiltered (log, "\n\tstore_struct_return"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->store_return_value == 0)) - fprintf_unfiltered (log, "\n\tstore_return_value"); + /* 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 */ /* Skip verify of deprecated_extract_struct_value_address, has predicate */ /* Skip verify of use_struct_convention, invalid_p == 0 */ @@ -779,6 +784,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of print_insn, invalid_p == 0 */ /* Skip verify of skip_trampoline_code, invalid_p == 0 */ /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ + /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ /* Skip verify of pc_in_sigtramp, invalid_p == 0 */ /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ @@ -1065,6 +1071,20 @@ 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_STORE_RETURN_VALUE +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)", + XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = 0x%08lx\n", + (long) current_gdbarch->deprecated_store_return_value + /*DEPRECATED_STORE_RETURN_VALUE ()*/); +#endif #ifdef DO_REGISTERS_INFO #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1410,6 +1430,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->in_solib_call_trampoline /*IN_SOLIB_CALL_TRAMPOLINE ()*/); #endif +#ifdef IN_SOLIB_RETURN_TRAMPOLINE + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)", + XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = 0x%08lx\n", + (long) current_gdbarch->in_solib_return_trampoline + /*IN_SOLIB_RETURN_TRAMPOLINE ()*/); +#endif #ifdef MAX_REGISTER_RAW_SIZE fprintf_unfiltered (file, "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n", @@ -1550,6 +1581,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: print_float_info = 0x%08lx\n", (long) current_gdbarch->print_float_info); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: print_registers_info = 0x%08lx\n", + (long) current_gdbarch->print_registers_info); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: print_vector_info = 0x%08lx\n", + (long) current_gdbarch->print_vector_info); #ifdef PROLOGUE_FRAMELESS_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1913,8 +1952,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) /* Macro might contain `[{}]' when not multi-arch */ fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", - "STORE_RETURN_VALUE(type, valbuf)", - XSTRING (STORE_RETURN_VALUE (type, valbuf))); + "STORE_RETURN_VALUE(type, regcache, valbuf)", + XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf))); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, @@ -2976,6 +3015,13 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch->register_virtual_type = register_virtual_type; } +int +gdbarch_do_registers_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->do_registers_info != 0; +} + void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) { @@ -2996,7 +3042,33 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch, } void -gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame) +gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->print_registers_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_print_registers_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); + gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); +} + +void +set_gdbarch_print_registers_info (struct gdbarch *gdbarch, + gdbarch_print_registers_info_ftype print_registers_info) +{ + gdbarch->print_registers_info = print_registers_info; +} + +int +gdbarch_print_float_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->print_float_info != 0; +} + +void +gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) { gdb_assert (gdbarch != NULL); if (gdbarch->print_float_info == 0) @@ -3004,7 +3076,7 @@ gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct "gdbarch: gdbarch_print_float_info invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); - gdbarch->print_float_info (gdbarch, file, frame); + gdbarch->print_float_info (gdbarch, file, frame, args); } void @@ -3014,6 +3086,32 @@ set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch->print_float_info = print_float_info; } +int +gdbarch_print_vector_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->print_vector_info != 0; +} + +void +gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->print_vector_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_print_vector_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); + gdbarch->print_vector_info (gdbarch, file, frame, args); +} + +void +set_gdbarch_print_vector_info (struct gdbarch *gdbarch, + gdbarch_print_vector_info_ftype print_vector_info) +{ + gdbarch->print_vector_info = print_vector_info; +} + int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) { @@ -3690,44 +3788,6 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch->return_value_on_stack = return_value_on_stack; } -void -gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->extract_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_extract_return_value invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); - gdbarch->extract_return_value (type, regcache, valbuf); -} - -void -set_gdbarch_extract_return_value (struct gdbarch *gdbarch, - gdbarch_extract_return_value_ftype extract_return_value) -{ - gdbarch->extract_return_value = extract_return_value; -} - -void -gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_extract_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_extract_return_value invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n"); - gdbarch->deprecated_extract_return_value (type, regbuf, valbuf); -} - -void -set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, - gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value) -{ - gdbarch->deprecated_extract_return_value = deprecated_extract_return_value; -} - CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -3831,7 +3891,26 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch, } void -gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) +gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->extract_return_value == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_extract_return_value invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); + gdbarch->extract_return_value (type, regcache, valbuf); +} + +void +set_gdbarch_extract_return_value (struct gdbarch *gdbarch, + gdbarch_extract_return_value_ftype extract_return_value) +{ + gdbarch->extract_return_value = extract_return_value; +} + +void +gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf) { gdb_assert (gdbarch != NULL); if (gdbarch->store_return_value == 0) @@ -3839,7 +3918,7 @@ gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *va "gdbarch: gdbarch_store_return_value invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); - gdbarch->store_return_value (type, valbuf); + gdbarch->store_return_value (type, regcache, valbuf); } void @@ -3849,6 +3928,44 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch->store_return_value = store_return_value; } +void +gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_extract_return_value == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_extract_return_value invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n"); + gdbarch->deprecated_extract_return_value (type, regbuf, valbuf); +} + +void +set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, + gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value) +{ + gdbarch->deprecated_extract_return_value = deprecated_extract_return_value; +} + +void +gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_store_return_value == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_store_return_value invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n"); + gdbarch->deprecated_store_return_value (type, valbuf); +} + +void +set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, + gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value) +{ + gdbarch->deprecated_store_return_value = deprecated_store_return_value; +} + int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) { @@ -4625,6 +4742,25 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch->in_solib_call_trampoline = in_solib_call_trampoline; } +int +gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->in_solib_return_trampoline == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_in_solib_return_trampoline invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); + return gdbarch->in_solib_return_trampoline (pc, name); +} + +void +set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, + gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline) +{ + gdbarch->in_solib_return_trampoline = in_solib_return_trampoline; +} + int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 57fb0cf71f5..b76bf4abfa0 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -693,6 +693,11 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE) +#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr)) +#endif + typedef int (gdbarch_register_byte_ftype) (int reg_nr); extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); @@ -773,9 +778,29 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_ #endif #endif +#if defined (DO_REGISTERS_INFO) +/* Legacy for systems yet to multi-arch DO_REGISTERS_INFO */ +#if !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (0) +#endif + +extern int gdbarch_do_registers_info_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO_P) +#error "Non multi-arch definition of DO_REGISTERS_INFO" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (gdbarch_do_registers_info_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO) -#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs)) +#define DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DO_REGISTERS_INFO"), 0) #endif typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs); @@ -790,10 +815,22 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r #endif #endif -typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame); -extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame); +typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info); + +extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); +extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info); + /* MAP a GDB RAW register number onto a simulator register number. See also include/...-sim.h. */ @@ -1379,35 +1416,6 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_ #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE) -#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf)) -#endif - -typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, char *valbuf); -extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf); -extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) -#error "Non multi-arch definition of EXTRACT_RETURN_VALUE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) -#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf)) -#endif -#endif - -typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); -extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); -extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE) -#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE) -#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf)) -#endif -#endif - /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS) #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr)) @@ -1498,15 +1506,61 @@ extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_st #endif #endif -typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); -extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE) +#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf)) +#endif + +typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf); +extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf); +extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) +#error "Non multi-arch definition of EXTRACT_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) +#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE) +#define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf)) +#endif + +typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf); +extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf); extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) #error "Non multi-arch definition of STORE_RETURN_VALUE" #endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) -#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) +#define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf)) +#endif +#endif + +typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); +extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); +extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE) +#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE) +#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf)) +#endif +#endif + +typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf); +extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); +extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE) +#error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE) +#define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf)) #endif #endif @@ -2255,7 +2309,7 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s /* For SVR4 shared libraries, each call goes through a small piece of trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates - to nonzero if we are current stopped in one of these. */ + to nonzero if we are currently stopped in one of these. */ /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE) @@ -2274,6 +2328,25 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar #endif #endif +/* Some systems also have trampoline code for returning from shared libs. */ + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE) +#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name)) +#endif + +typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name); +extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); +extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE) +#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE) +#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name)) +#endif +#endif + /* Sigtramp is a routine that the kernel calls (which then calls the signal handler). On most machines it is a library routine that is linked into the executable. diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 141eba31b91..1ce71afa7c1 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -461,14 +461,17 @@ f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr: f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0 v:2:REGISTER_SIZE:int:register_size::::0:-1 v:2:REGISTER_BYTES:int:register_bytes::::0:-1 -f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0 +f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0 f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1 f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1 f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0 -f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0 -m:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame:file, frame:::default_print_float_info::0 +# +F:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs +m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0 +M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args +M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args # MAP a GDB RAW register number onto a simulator register number. See # also include/...-sim.h. f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0 @@ -520,15 +523,18 @@ f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, COR F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf # f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0 -f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0 -f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0 f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0 f:2:PUSH_DUMMY_FRAME:void: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:POP_FRAME:void:pop_frame:void:-:::0 # f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 -f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0 +# +f::EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0 +f::STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0 +f::DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf +f::DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf +# F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct regcache *regcache:regcache:::0 F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:char *regbuf:regbuf:::0 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0 @@ -599,10 +605,16 @@ f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_a F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0 f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0 f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0 + + # For SVR4 shared libraries, each call goes through a small piece of # trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates -# to nonzero if we are current stopped in one of these. +# to nonzero if we are currently stopped in one of these. f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0 + +# Some systems also have trampoline code for returning from shared libs. +f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0 + # Sigtramp is a routine that the kernel calls (which then calls the # signal handler). On most machines it is a library routine that is # linked into the executable. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index ae77ec90031..46168d61624 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -102,6 +102,7 @@ INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \ # LDFLAGS is specifically reserved for setting from the command line # when running make. +LDFLAGS = @LDFLAGS@ # Perhaps should come from parent Makefile VERSION = gdbserver-4.12.3 diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7048daf221e..7644f9e990f 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -149,6 +149,8 @@ linux_create_inferior (char *program, char **allargs) signal (SIGRTMIN + 1, SIG_DFL); + setpgid (0, 0); + execv (program, allargs); fprintf (stderr, "Cannot exec %s: %s.\n", program, @@ -160,7 +162,7 @@ linux_create_inferior (char *program, char **allargs) new_process = add_process (pid); add_thread (pid, new_process); - return 0; + return pid; } /* Attach to an inferior process. */ @@ -1228,34 +1230,6 @@ linux_look_up_symbols (void) #endif } -/* Return 1 if this process is not stopped. */ -static int -unstopped_p (struct inferior_list_entry *entry, void *dummy) -{ - struct process_info *process = (struct process_info *) entry; - - if (process->stopped) - return 0; - - return 1; -} - -static int -linux_signal_pid () -{ - struct inferior_list_entry *process; - - process = find_inferior (&all_processes, unstopped_p, NULL); - - if (process == NULL) - { - warning ("no unstopped process"); - return inferior_pid; - } - - return pid_of ((struct process_info *) process); -} - static struct target_ops linux_target_ops = { linux_create_inferior, @@ -1269,7 +1243,6 @@ static struct target_ops linux_target_ops = { linux_read_memory, linux_write_memory, linux_look_up_symbols, - linux_signal_pid, }; static void diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index c610c4c0e7c..d5699379bd5 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -46,6 +46,8 @@ static int remote_desc; extern int using_threads; extern int debug_threads; +extern int signal_pid; + /* Open a connection to a remote debugger. NAME is the filename used for communication. */ @@ -324,7 +326,7 @@ putpkt (char *buf) /* Check for an input interrupt while we're here. */ if (buf3[0] == '\003') - kill ((*the_target->signal_pid) (), SIGINT); + kill (signal_pid, SIGINT); } while (buf3[0] != '+'); @@ -361,7 +363,7 @@ input_interrupt (int unused) return; } - kill ((*the_target->signal_pid) (), SIGINT); + kill (signal_pid, SIGINT); } } diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index b674ed0070f..d0963ba9de9 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -21,6 +21,10 @@ #include "server.h" +#include +#include +#include + int cont_thread; int general_thread; int step_thread; @@ -31,14 +35,27 @@ int server_waiting; jmp_buf toplevel; +/* The PID of the originally created or attached inferior. Used to + send signals to the process when GDB sends us an asynchronous interrupt + (user hitting Control-C in the client), and to wait for the child to exit + when no longer debugging it. */ + +int signal_pid; + static unsigned char start_inferior (char *argv[], char *statusptr) { - /* FIXME Check error? Or turn to void. */ - create_inferior (argv[0], argv); + signal (SIGTTOU, SIG_DFL); + signal (SIGTTIN, SIG_DFL); + + signal_pid = create_inferior (argv[0], argv); fprintf (stderr, "Process %s created; pid = %d\n", argv[0], - all_threads.head->id); + signal_pid); + + signal (SIGTTOU, SIG_IGN); + signal (SIGTTIN, SIG_IGN); + tcsetpgrp (fileno (stderr), signal_pid); /* Wait till we are at 1st instruction in program, return signal number. */ return mywait (statusptr, 0); @@ -49,9 +66,15 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr) { /* myattach should return -1 if attaching is unsupported, 0 if it succeeded, and call error() otherwise. */ + if (myattach (pid) != 0) return -1; + /* FIXME - It may be that we should get the SIGNAL_PID from the + attach function, so that it can be the main thread instead of + whichever we were told to attach to. */ + signal_pid = pid; + *sigptr = mywait (statusptr, 0); return 0; diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index c6aeee6f562..e554c0ac7e1 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -32,7 +32,7 @@ struct target_ops ARGS is a standard NULL-terminated array of arguments, to be passed to the inferior as ``argv''. - Returns 0 on success, -1 on failure. Registers the new + Returns the new PID on success, -1 on failure. Registers the new process with the process list. */ int (*create_inferior) (char *program, char **args); @@ -104,11 +104,6 @@ struct target_ops symbols. */ void (*look_up_symbols) (void); - - /* Return the PID we should send a signal to. Used for asynchronous - interrupts (user hitting Control-C). */ - - int (*signal_pid) (void); }; extern struct target_ops *the_target; diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 7db3f9aad39..6ebbf2db1b6 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -92,6 +92,8 @@ struct type *builtin_type_v8qi; struct type *builtin_type_v8hi; struct type *builtin_type_v4hi; struct type *builtin_type_v2si; +struct type *builtin_type_vec64; +struct type *builtin_type_vec64i; struct type *builtin_type_vec128; struct type *builtin_type_vec128i; struct type *builtin_type_ieee_single_big; @@ -818,6 +820,64 @@ init_vector_type (struct type *elt_type, int n) return array_type; } +static struct type * +build_builtin_type_vec64 (void) +{ + /* Construct a type for the 64 bit registers. The type we're + building is this: */ +#if 0 + union __gdb_builtin_type_vec64 + { + int64_t uint64; + float v2_float[2]; + int32_t v2_int32[2]; + int16_t v4_int16[4]; + int8_t v8_int8[8]; + }; +#endif + + struct type *t; + + t = init_composite_type ("__gdb_builtin_type_vec64", TYPE_CODE_UNION); + append_composite_type_field (t, "uint64", builtin_type_int64); + append_composite_type_field (t, "v2_float", builtin_type_v2_float); + append_composite_type_field (t, "v2_int32", builtin_type_v2_int32); + append_composite_type_field (t, "v4_int16", builtin_type_v4_int16); + append_composite_type_field (t, "v8_int8", builtin_type_v8_int8); + + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + TYPE_NAME (t) = "builtin_type_vec64"; + return t; +} + +static struct type * +build_builtin_type_vec64i (void) +{ + /* Construct a type for the 64 bit registers. The type we're + building is this: */ +#if 0 + union __gdb_builtin_type_vec64i + { + int64_t uint64; + int32_t v2_int32[2]; + int16_t v4_int16[4]; + int8_t v8_int8[8]; + }; +#endif + + struct type *t; + + t = init_composite_type ("__gdb_builtin_type_vec64i", TYPE_CODE_UNION); + append_composite_type_field (t, "uint64", builtin_type_int64); + append_composite_type_field (t, "v2_int32", builtin_type_v2_int32); + append_composite_type_field (t, "v4_int16", builtin_type_v4_int16); + append_composite_type_field (t, "v8_int8", builtin_type_v8_int8); + + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + TYPE_NAME (t) = "builtin_type_vec64i"; + return t; +} + static struct type * build_builtin_type_vec128 (void) { @@ -843,6 +903,8 @@ build_builtin_type_vec128 (void) append_composite_type_field (t, "v8_int16", builtin_type_v8_int16); append_composite_type_field (t, "v16_int8", builtin_type_v16_int8); + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + TYPE_NAME (t) = "builtin_type_vec128"; return t; } @@ -861,6 +923,8 @@ build_builtin_type_vec128i (void) append_composite_type_field (t, "v2_int64", builtin_type_v2_int64); append_composite_type_field (t, "uint128", builtin_type_int128); + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + TYPE_NAME (t) = "builtin_type_vec128i"; return t; } @@ -3324,7 +3388,9 @@ build_gdbtypes (void) builtin_type_v4_int16 = init_vector_type (builtin_type_int16, 4); builtin_type_v8_int8 = init_vector_type (builtin_type_int8, 8); - /* Vector types. */ + /* Vector types. */ + builtin_type_vec64 = build_builtin_type_vec64 (); + builtin_type_vec64i = build_builtin_type_vec64i (); builtin_type_vec128 = build_builtin_type_vec128 (); builtin_type_vec128i = build_builtin_type_vec128i (); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index b67c54fe31c..5c41398aabb 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -952,6 +952,10 @@ extern struct type *builtin_type_v8hi; extern struct type *builtin_type_v4hi; extern struct type *builtin_type_v2si; +/* Type for 64 bit vectors. */ +extern struct type *builtin_type_vec64; +extern struct type *builtin_type_vec64i; + /* Type for 128 bit vectors. */ extern struct type *builtin_type_vec128; extern struct type *builtin_type_vec128i; diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index a4b8020a04c..59aad5dd7f3 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2612,6 +2612,7 @@ init_gnu_ops (void) gnu_ops.to_terminal_init = gnu_terminal_init_inferior; gnu_ops.to_terminal_inferior = terminal_inferior; gnu_ops.to_terminal_ours_for_output = terminal_ours_for_output; + gnu_ops.to_terminal_save_ours = terminal_save_ours; gnu_ops.to_terminal_ours = terminal_ours; gnu_ops.to_terminal_info = child_terminal_info; gnu_ops.to_kill = gnu_kill_inferior; /* to_kill */ diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 2b086c57f5e..fb31c44529f 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -189,7 +189,6 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) struct type *rtti_type; CORE_ADDR coreptr; struct value *vp; - int using_enclosing = 0; long top_offset = 0; char rtti_type_name[256]; CORE_ADDR vtbl; @@ -244,25 +243,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) if (VALUE_ADDRESS (value_field (v, TYPE_VPTR_FIELDNO (known_type))) == 0) return NULL; - /* - If we are enclosed by something that isn't us, adjust the - address properly and set using_enclosing. - */ - if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v)) - { - struct value *tempval; - int bitpos = TYPE_BASECLASS_BITPOS (known_type, - TYPE_VPTR_FIELDNO (known_type)); - tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type)); - VALUE_ADDRESS(tempval) += bitpos / 8; - vtbl=value_as_address (tempval); - using_enclosing=1; - } - else - { - vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type))); - using_enclosing=0; - } + vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type))); /* Try to find a symbol that is the vtable */ minsym=lookup_minimal_symbol_by_pc(vtbl); @@ -304,8 +285,6 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) if (full) *full=1; } - if (using_enc) - *using_enc=using_enclosing; return rtti_type; } diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 9b7b4d6640a..f992d4bd6b9 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -141,7 +141,7 @@ h8300_skip_prologue (CORE_ADDR start_pc) } int -gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info *info) +gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info * info) { if (h8300smode) return print_insn_h8300s (memaddr, info); @@ -226,7 +226,7 @@ h8300_frame_find_saved_regs (struct frame_info *fi, of the instruction. */ CORE_ADDR -NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD *pword1) +NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD * pword1) { char buf[2]; if (addr < lim + 8) @@ -389,14 +389,16 @@ examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, /* Locals are always reffed based from the fp */ fi->locals_pointer = after_prolog_fp; /* The PC is at a known place */ - fi->from_pc = read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD); + fi->from_pc = + read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD); /* Rememeber any others too */ in_frame[PC_REGNUM] = 0; if (have_fp) /* We keep the old FP in the SP spot */ - fsr->regs[SP_REGNUM] = read_memory_unsigned_integer (fsr->regs[6], BINWORD); + fsr->regs[SP_REGNUM] = + read_memory_unsigned_integer (fsr->regs[6], BINWORD); else fsr->regs[SP_REGNUM] = after_prolog_fp + auto_depth; @@ -530,8 +532,7 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, sp = sp & ~stack_align; /* Now make sure there's space on the stack */ - for (argnum = 0, stack_alloc = 0; - argnum < nargs; argnum++) + for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++) stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + stack_align) & ~stack_align); sp -= stack_alloc; /* make room on stack for args */ @@ -562,8 +563,9 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, else val = (char *) VALUE_CONTENTS (args[argnum]); - if (len > (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM) || - (len > wordsize && (len & stack_align) != 0)) + if (len > + (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM) + || (len > wordsize && (len & stack_align) != 0)) { /* passed on the stack */ write_memory (sp + stack_offset, val, len < wordsize ? wordsize : len); @@ -572,7 +574,8 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* NOTE WELL!!!!! This is not an "else if" clause!!! That's because some *&^%$ things get passed on the stack AND in the registers! */ - if (len <= (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM)) + if (len <= + (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM)) while (len > 0) { /* there's room in registers */ regval = extract_address (val, wordsize); @@ -804,8 +807,7 @@ _initialize_h8300m (void) { add_prefix_cmd ("machine", no_class, set_machine, "set the machine type", - &setmemorylist, "set machine ", 0, - &setlist); + &setmemorylist, "set machine ", 0, &setlist); add_cmd ("h8300", class_support, h8300_command, "Set machine to be H8/300.", &setmemorylist); diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index eec18ffffa5..981bb9d5feb 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -554,6 +554,7 @@ init_hpux_thread_ops (void) hpux_thread_ops.to_terminal_init = terminal_init_inferior; hpux_thread_ops.to_terminal_inferior = terminal_inferior; hpux_thread_ops.to_terminal_ours_for_output = terminal_ours_for_output; + hpux_thread_ops.to_terminal_save_ours = terminal_save_ours; hpux_thread_ops.to_terminal_ours = terminal_ours; hpux_thread_ops.to_terminal_info = child_terminal_info; hpux_thread_ops.to_kill = hpux_thread_kill_inferior; diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index fe610211f8e..74c70dbbff1 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -25,6 +25,7 @@ #include "regcache.h" #include "gdb_assert.h" +#include "gdb_string.h" #include #include #include diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 394699f1168..a833fb59838 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -47,27 +47,6 @@ i386_linux_register_name (int reg) return i386_register_name (reg); } - -static int -i386_linux_register_byte (int reg) -{ - /* Deal with the extra "orig_eax" pseudo register. */ - if (reg == I386_LINUX_ORIG_EAX_REGNUM) - return (i386_register_byte (I386_LINUX_ORIG_EAX_REGNUM - 1) - + i386_register_raw_size (I386_LINUX_ORIG_EAX_REGNUM - 1)); - - return i386_register_byte (reg); -} - -static int -i386_linux_register_raw_size (int reg) -{ - /* Deal with the extra "orig_eax" pseudo register. */ - if (reg == I386_LINUX_ORIG_EAX_REGNUM) - return 4; - - return i386_register_raw_size (reg); -} /* Recognizing signal handler frames. */ @@ -458,8 +437,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1); set_gdbarch_register_name (gdbarch, i386_linux_register_name); set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4); - set_gdbarch_register_byte (gdbarch, i386_linux_register_byte); - set_gdbarch_register_raw_size (gdbarch, i386_linux_register_raw_size); tdep->jb_pc_offset = 20; /* From . */ diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c index ba01111a5d3..c72a7ed1df8 100644 --- a/gdb/i386-sol2-tdep.c +++ b/gdb/i386-sol2-tdep.c @@ -71,7 +71,7 @@ void _initialize_i386_sol2_tdep (void); void _initialize_i386_sol2_tdep (void) { - /* Register and ELF OS ABI sniffer for Solaris 2 binaries. */ + /* Register an ELF OS ABI sniffer for Solaris 2 binaries. */ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, i386_sol2_osabi_sniffer); diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index efdea9e3369..4a2eab6ae1a 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -25,6 +25,7 @@ #include "frame.h" #include "inferior.h" #include "gdbcore.h" +#include "objfiles.h" #include "target.h" #include "floatformat.h" #include "symfile.h" @@ -38,6 +39,7 @@ #include "gdb_assert.h" #include "i386-tdep.h" +#include "i387-tdep.h" /* Names of the registers. The first 10 registers match the register numbering scheme used by GCC for stabs and DWARF. */ @@ -56,26 +58,22 @@ static char *i386_register_names[] = "mxcsr" }; -/* i386_register_offset[i] is the offset into the register file of the - start of register number i. We initialize this from - i386_register_size. */ -static int i386_register_offset[I386_SSE_NUM_REGS]; - -/* i386_register_size[i] is the number of bytes of storage in GDB's - register array occupied by register i. */ -static int i386_register_size[I386_SSE_NUM_REGS] = { - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 10, 10, 10, 10, - 10, 10, 10, 10, - 4, 4, 4, 4, - 4, 4, 4, 4, - 16, 16, 16, 16, - 16, 16, 16, 16, - 4 +/* MMX registers. */ + +static char *i386_mmx_names[] = +{ + "mm0", "mm1", "mm2", "mm3", + "mm4", "mm5", "mm6", "mm7" }; +static const int mmx_num_regs = (sizeof (i386_mmx_names) + / sizeof (i386_mmx_names[0])); +#define MM0_REGNUM (NUM_REGS) + +static int +mmx_regnum_p (int reg) +{ + return (reg >= MM0_REGNUM && reg < MM0_REGNUM + mmx_num_regs); +} /* Return the name of register REG. */ @@ -84,29 +82,14 @@ i386_register_name (int reg) { if (reg < 0) return NULL; + if (mmx_regnum_p (reg)) + return i386_mmx_names[reg - MM0_REGNUM]; if (reg >= sizeof (i386_register_names) / sizeof (*i386_register_names)) return NULL; return i386_register_names[reg]; } -/* Return the offset into the register array of the start of register - number REG. */ -int -i386_register_byte (int reg) -{ - return i386_register_offset[reg]; -} - -/* Return the number of bytes of storage in GDB's register array - occupied by register REG. */ - -int -i386_register_raw_size (int reg) -{ - return i386_register_size[reg]; -} - /* Convert stabs register number REG to the appropriate register number used by GDB. */ @@ -132,9 +115,7 @@ i386_stab_reg_to_regnum (int reg) else if (reg >= 29 && reg <= 36) { /* MMX registers. */ - /* FIXME: kettenis/2001-07-28: Should we have the MMX registers - as pseudo-registers? */ - return reg - 29 + FP0_REGNUM; + return reg - 29 + MM0_REGNUM; } /* This will hopefully provoke a warning. */ @@ -853,8 +834,7 @@ i386_do_pop_frame (struct frame_info *frame) if (addr) { read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum)); - write_register_bytes (REGISTER_BYTE (regnum), regbuf, - REGISTER_RAW_SIZE (regnum)); + write_register_gen (regnum, regbuf); } } write_register (FP_REGNUM, read_memory_integer (fp, 4)); @@ -937,8 +917,9 @@ i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) static void i386_extract_return_value (struct type *type, struct regcache *regcache, - char *valbuf) + void *dst) { + bfd_byte *valbuf = dst; int len = TYPE_LENGTH (type); char buf[I386_MAX_REGISTER_SIZE]; @@ -992,20 +973,21 @@ i386_extract_return_value (struct type *type, struct regcache *regcache, in VALBUF of type TYPE, given in virtual format. */ static void -i386_store_return_value (struct type *type, char *valbuf) +i386_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) { int len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1) { - i386_store_return_value (TYPE_FIELD_TYPE (type, 0), valbuf); + i386_store_return_value (TYPE_FIELD_TYPE (type, 0), regcache, valbuf); return; } if (TYPE_CODE (type) == TYPE_CODE_FLT) { - unsigned int fstat; + ULONGEST fstat; char buf[FPU_REG_RAW_SIZE]; if (FP0_REGNUM == 0) @@ -1023,21 +1005,20 @@ i386_store_return_value (struct type *type, char *valbuf) not exactly how it would happen on the target itself, but it is the best we can do. */ convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext); - write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf, - FPU_REG_RAW_SIZE); + regcache_raw_write (regcache, FP0_REGNUM, buf); /* Set the top of the floating-point register stack to 7. The actual value doesn't really matter, but 7 is what a normal function return would end up with if the program started out with a freshly initialized FPU. */ - fstat = read_register (FSTAT_REGNUM); + regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat); fstat |= (7 << 11); - write_register (FSTAT_REGNUM, fstat); + regcache_raw_write_unsigned (regcache, FSTAT_REGNUM, fstat); /* Mark %st(1) through %st(7) as empty. Since we set the top of the floating-point register stack to 7, the appropriate value for the tag word is 0x3fff. */ - write_register (FTAG_REGNUM, 0x3fff); + regcache_raw_write_unsigned (regcache, FTAG_REGNUM, 0x3fff); } else { @@ -1045,13 +1026,12 @@ i386_store_return_value (struct type *type, char *valbuf) int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM); if (len <= low_size) - write_register_bytes (REGISTER_BYTE (LOW_RETURN_REGNUM), valbuf, len); + regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf); else if (len <= (low_size + high_size)) { - write_register_bytes (REGISTER_BYTE (LOW_RETURN_REGNUM), - valbuf, low_size); - write_register_bytes (REGISTER_BYTE (HIGH_RETURN_REGNUM), - valbuf + low_size, len - low_size); + regcache_raw_write (regcache, LOW_RETURN_REGNUM, valbuf); + regcache_raw_write_part (regcache, HIGH_RETURN_REGNUM, 0, + len - low_size, (char *) valbuf + low_size); } else internal_error (__FILE__, __LINE__, @@ -1066,7 +1046,18 @@ i386_store_return_value (struct type *type, char *valbuf) static CORE_ADDR i386_extract_struct_value_address (struct regcache *regcache) { - return regcache_raw_read_as_address (regcache, LOW_RETURN_REGNUM); + /* NOTE: cagney/2002-08-12: Replaced a call to + regcache_raw_read_as_address() with a call to + regcache_cooked_read_unsigned(). The old, ...as_address function + was eventually calling extract_unsigned_integer (via + extract_address) to unpack the registers value. The below is + doing an unsigned extract so that it is functionally equivalent. + The read needs to be cooked as, otherwise, it will never + correctly return the value of a register in the [NUM_REGS + .. NUM_REGS+NUM_PSEUDO_REGS) range. */ + ULONGEST val; + regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val); + return val; } @@ -1117,9 +1108,64 @@ i386_register_virtual_type (int regnum) if (IS_SSE_REGNUM (regnum)) return builtin_type_vec128i; + if (mmx_regnum_p (regnum)) + return builtin_type_vec64i; + return builtin_type_int; } +/* Map a cooked register onto a raw register or memory. For the i386, + the MMX registers need to be mapped onto floating point registers. */ + +static int +mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum) +{ + int mmxi; + ULONGEST fstat; + int tos; + int fpi; + mmxi = regnum - MM0_REGNUM; + regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat); + tos = (fstat >> 11) & 0x7; + fpi = (mmxi + tos) % 8; + return (FP0_REGNUM + fpi); +} + +static void +i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int regnum, void *buf) +{ + if (mmx_regnum_p (regnum)) + { + char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); + int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum); + regcache_raw_read (regcache, fpnum, mmx_buf); + /* Extract (always little endian). */ + memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum)); + } + else + regcache_raw_read (regcache, regnum, buf); +} + +static void +i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, + int regnum, const void *buf) +{ + if (mmx_regnum_p (regnum)) + { + char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); + int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum); + /* Read ... */ + regcache_raw_read (regcache, fpnum, mmx_buf); + /* ... Modify ... (always little endian). */ + memcpy (mmx_buf, buf, REGISTER_RAW_SIZE (regnum)); + /* ... Write. */ + regcache_raw_write (regcache, fpnum, mmx_buf); + } + else + regcache_raw_write (regcache, regnum, buf); +} + /* Return true iff register REGNUM's virtual format is different from its raw format. Note that this definition assumes that the host supports IEEE 32-bit floats, since it doesn't say that SSE @@ -1208,7 +1254,7 @@ sunpro_static_transform_name (char *name) /* Stuff for WIN32 PE style DLL's but is pretty generic really. */ CORE_ADDR -skip_trampoline_code (CORE_ADDR pc, char *name) +i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name) { if (pc && read_memory_unsigned_integer (pc, 2) == 0x25ff) /* jmp *(dest) */ { @@ -1326,8 +1372,12 @@ i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* System V Release 4 uses ELF. */ i386_elf_init_abi (info, gdbarch); + /* System V Release 4 has shared libraries. */ + set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); + set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); + /* FIXME: kettenis/20020511: Why do we override this function here? */ - set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); + set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid); set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp); tdep->sigcontext_addr = i386_svr4_sigcontext_addr; @@ -1357,7 +1407,7 @@ i386_nw_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* FIXME: kettenis/20020511: Why do we override this function here? */ - set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); + set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid); tdep->jb_pc_offset = 24; } @@ -1439,12 +1489,12 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, i386_register_name); set_gdbarch_register_size (gdbarch, 4); set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS); - set_gdbarch_register_byte (gdbarch, i386_register_byte); - set_gdbarch_register_raw_size (gdbarch, i386_register_raw_size); set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE); set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE); set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type); + set_gdbarch_print_float_info (gdbarch, i387_print_float_info); + set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target); set_gdbarch_use_generic_dummy_frames (gdbarch, 1); @@ -1467,7 +1517,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_register_convert_to_virtual); set_gdbarch_register_convert_to_raw (gdbarch, i386_register_convert_to_raw); - set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register); + set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_push_arguments (gdbarch, i386_push_arguments); set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); @@ -1515,6 +1565,11 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_num_args (gdbarch, i386_frame_num_args); set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp); + /* Wire in the MMX registers. */ + set_gdbarch_num_pseudo_regs (gdbarch, mmx_num_regs); + set_gdbarch_pseudo_register_read (gdbarch, i386_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, i386_pseudo_register_write); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch, osabi); @@ -1546,19 +1601,6 @@ _initialize_i386_tdep (void) { register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init); - /* Initialize the table saying where each register starts in the - register file. */ - { - int i, offset; - - offset = 0; - for (i = 0; i < I386_SSE_NUM_REGS; i++) - { - i386_register_offset[i] = offset; - offset += i386_register_size[i]; - } - } - tm_print_insn = gdb_print_insn_i386; tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach; diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index bd5213fee37..30128d9341a 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -114,7 +114,7 @@ struct gdbarch_tdep #define FOP_REGNUM (FPC_REGNUM + 7) /* Return non-zero if N corresponds to a FPU data registers. */ -#define FP_REGNUM_P(n) (FP0_REGNUM <= (n) && (n) < FPC_REGNUM) +#define FP_REGNUM_P(n) (FP0_REGNUM && FP0_REGNUM <= (n) && (n) < FPC_REGNUM) /* Return non-zero if N corresponds to a FPU control register. */ #define FPC_REGNUM_P(n) (FPC_REGNUM <= (n) && (n) < XMM0_REGNUM) @@ -160,17 +160,12 @@ struct gdbarch_tdep /* Size of the largest register. */ #define I386_MAX_REGISTER_SIZE 16 +/* Functions exported from i386-tdep.c. */ +extern CORE_ADDR i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name); + /* Return the name of register REG. */ extern char const *i386_register_name (int reg); -/* Return the offset into the register array of the start of register - number REG. */ -extern int i386_register_byte (int reg); - -/* Return the number of bytes of storage in GDB's register array - occupied by register REG. */ -extern int i386_register_raw_size (int reg); - /* Initialize a basic ELF architecture variant. */ extern void i386_elf_init_abi (struct gdbarch_info, struct gdbarch *); diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c index 2d8d7b9c710..3cca5e43fe1 100644 --- a/gdb/i386aix-nat.c +++ b/gdb/i386aix-nat.c @@ -1,377 +1,377 @@ -/* Intel 386 native support. - Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001 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 "frame.h" -#include "inferior.h" -#include "language.h" -#include "gdbcore.h" -#include "regcache.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include "gdb_stat.h" - -#include -#include - -/* Does AIX define this in ? */ -extern int errno; - -#ifdef HAVE_SYS_REG_H -#include -#endif - -#include "floatformat.h" - -#include "target.h" - -static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); - - -/* this table must line up with REGISTER_NAMES in tm-i386v.h */ -/* symbols like 'EAX' come from */ -static int regmap[] = -{ - EAX, ECX, EDX, EBX, - USP, EBP, ESI, EDI, - EIP, EFL, CS, SS, - DS, ES, FS, GS, -}; - -/* blockend is the value of u.u_ar0, and points to the - * place where GS is stored - */ - -int -i386_register_u_addr (int blockend, int regnum) -{ -#if 0 - /* this will be needed if fp registers are reinstated */ - /* for now, you can look at them with 'info float' - * sys5 wont let you change them with ptrace anyway - */ - if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM) - { - int ubase, fpstate; - struct user u; - ubase = blockend + 4 * (SS + 1) - KSTKSZ; - fpstate = ubase + ((char *) &u.u_fpstate - (char *) &u); - return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM)); - } - else -#endif - return (blockend + 4 * regmap[regnum]); - -} - -/* The code below only work on the aix ps/2 (i386-ibm-aix) - - * mtranle@paris - Sat Apr 11 10:34:12 1992 - */ - -struct env387 -{ - unsigned short control; - unsigned short r0; - unsigned short status; - unsigned short r1; - unsigned short tag; - unsigned short r2; - unsigned long eip; - unsigned short code_seg; - unsigned short opcode; - unsigned long operand; - unsigned short operand_seg; - unsigned short r3; - unsigned char regs[8][10]; -}; - -static -print_387_status (unsigned short status, struct env387 *ep) -{ - int i; - int bothstatus; - int top; - int fpreg; - unsigned char *p; - - bothstatus = ((status != 0) && (ep->status != 0)); - if (status != 0) - { - if (bothstatus) - printf_unfiltered ("u: "); - print_387_status_word (status); - } - - if (ep->status != 0) - { - if (bothstatus) - printf_unfiltered ("e: "); - print_387_status_word (ep->status); - } - - print_387_control_word (ep->control); - printf_unfiltered ("last exception: "); - printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); - printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); - printf_unfiltered ("%s; ", local_hex_string (ep->eip)); - printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); - printf_unfiltered (":%s\n", local_hex_string (ep->operand)); - - top = ((ep->status >> 11) & 7); - - printf_unfiltered ("regno tag msb lsb value\n"); - for (fpreg = 7; fpreg >= 0; fpreg--) - { - double val; - - printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); - - switch ((ep->tag >> ((7 - fpreg) * 2)) & 3) - { - case 0: - printf_unfiltered ("valid "); - break; - case 1: - printf_unfiltered ("zero "); - break; - case 2: - printf_unfiltered ("trap "); - break; - case 3: - printf_unfiltered ("empty "); - break; - } - for (i = 9; i >= 0; i--) - printf_unfiltered ("%02x", ep->regs[fpreg][i]); - - i387_to_double ((char *) ep->regs[fpreg], (char *) &val); - printf_unfiltered (" %#g\n", val); - } -} - -static struct env387 core_env387; - -void -i386_float_info (void) -{ - struct env387 fps; - int fpsaved = 0; - /* We need to reverse the order of the registers. Apparently AIX stores - the highest-numbered ones first. */ - struct env387 fps_fixed; - int i; - - if (! ptid_equal (inferior_ptid, null_ptid)) - { - char buf[10]; - unsigned short status; - - ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, - offsetof (struct env387, status)); - memcpy (&status, buf, sizeof (status)); - fpsaved = status; - } - else - { - if ((fpsaved = core_env387.status) != 0) - memcpy (&fps, &core_env387, sizeof (fps)); - } - - if (fpsaved == 0) - { - printf_unfiltered ("no floating point status saved\n"); - return; - } - - if (! ptid_equal (inferior_ptid, null_ptid)) - { - int offset; - for (offset = 0; offset < sizeof (fps); offset += 10) - { - char buf[10]; - ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, offset); - memcpy ((char *) &fps.control + offset, buf, - MIN (10, sizeof (fps) - offset)); - } - } - fps_fixed = fps; - for (i = 0; i < 8; ++i) - memcpy (fps_fixed.regs[i], fps.regs[7 - i], 10); - print_387_status (0, &fps_fixed); -} - -/* Fetch one register. */ -static void -fetch_register (int regno) -{ - char buf[MAX_REGISTER_RAW_SIZE]; - if (regno < FP0_REGNUM) - *(int *) buf = ptrace (PT_READ_GPR, PIDGET (inferior_ptid), - PT_REG (regmap[regno]), 0, 0); - else - ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, - (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); - supply_register (regno, buf); -} - -void -fetch_inferior_registers (int regno) -{ - if (regno < 0) - for (regno = 0; regno < NUM_REGS; regno++) - fetch_register (regno); - else - fetch_register (regno); -} - -/* store one register */ -static void -store_register (int regno) -{ - char buf[80]; - errno = 0; - if (regno < FP0_REGNUM) - ptrace (PT_WRITE_GPR, PIDGET (inferior_ptid), PT_REG (regmap[regno]), - *(int *) ®isters[REGISTER_BYTE (regno)], 0); - else - ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid), - ®isters[REGISTER_BYTE (regno)], - (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); - - if (errno != 0) - { - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); - } -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ -void -store_inferior_registers (int regno) -{ - if (regno < 0) - for (regno = 0; regno < NUM_REGS; regno++) - store_register (regno); - else - store_register (regno); -} - -#ifndef CD_AX /* defined in sys/i386/coredump.h */ -#define CD_AX 0 -#define CD_BX 1 -#define CD_CX 2 -#define CD_DX 3 -#define CD_SI 4 -#define CD_DI 5 -#define CD_BP 6 -#define CD_SP 7 -#define CD_FL 8 -#define CD_IP 9 -#define CD_CS 10 -#define CD_DS 11 -#define CD_ES 12 -#define CD_FS 13 -#define CD_GS 14 -#define CD_SS 15 -#endif - -/* - * The order here in core_regmap[] has to be the same as in - * regmap[] above. - */ -static int core_regmap[] = -{ - CD_AX, CD_CX, CD_DX, CD_BX, - CD_SP, CD_BP, CD_SI, CD_DI, - CD_IP, CD_FL, CD_CS, CD_SS, - CD_DS, CD_ES, CD_FS, CD_GS, -}; - -/* Provide registers to GDB from a core file. - - CORE_REG_SECT points to an array of bytes, which were obtained from - a core file which BFD thinks might contain register contents. - CORE_REG_SIZE is its size. - - WHICH says which register set corelow suspects this is: - 0 --- the general-purpose register set - 2 --- the floating-point register set - - REG_ADDR isn't used. */ - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, - int which, CORE_ADDR reg_addr) -{ - - if (which == 0) - { - /* Integer registers */ - -#define cd_regs(n) ((int *)core_reg_sect)[n] -#define regs(n) *((int *) ®isters[REGISTER_BYTE (n)]) - - int i; - for (i = 0; i < FP0_REGNUM; i++) - regs (i) = cd_regs (core_regmap[i]); - } - else if (which == 2) - { - /* Floating point registers */ - - if (core_reg_size >= sizeof (core_env387)) - memcpy (&core_env387, core_reg_sect, core_reg_size); - else - fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n"); - } -} - - -/* Register that we are able to handle i386aix core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns i386aix_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_core_i386aix (void) -{ - add_core_fns (&i386aix_core_fns); -} +// OBSOLETE /* Intel 386 native support. +// OBSOLETE Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, +// OBSOLETE 2000, 2001 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "frame.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "language.h" +// OBSOLETE #include "gdbcore.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #ifdef USG +// OBSOLETE #include +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include "gdb_stat.h" +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE /* Does AIX define this in ? */ +// OBSOLETE extern int errno; +// OBSOLETE +// OBSOLETE #ifdef HAVE_SYS_REG_H +// OBSOLETE #include +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE #include "floatformat.h" +// OBSOLETE +// OBSOLETE #include "target.h" +// OBSOLETE +// OBSOLETE static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); +// OBSOLETE +// OBSOLETE +// OBSOLETE /* this table must line up with REGISTER_NAMES in tm-i386v.h */ +// OBSOLETE /* symbols like 'EAX' come from */ +// OBSOLETE static int regmap[] = +// OBSOLETE { +// OBSOLETE EAX, ECX, EDX, EBX, +// OBSOLETE USP, EBP, ESI, EDI, +// OBSOLETE EIP, EFL, CS, SS, +// OBSOLETE DS, ES, FS, GS, +// OBSOLETE }; +// OBSOLETE +// OBSOLETE /* blockend is the value of u.u_ar0, and points to the +// OBSOLETE * place where GS is stored +// OBSOLETE */ +// OBSOLETE +// OBSOLETE int +// OBSOLETE i386_register_u_addr (int blockend, int regnum) +// OBSOLETE { +// OBSOLETE #if 0 +// OBSOLETE /* this will be needed if fp registers are reinstated */ +// OBSOLETE /* for now, you can look at them with 'info float' +// OBSOLETE * sys5 wont let you change them with ptrace anyway +// OBSOLETE */ +// OBSOLETE if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM) +// OBSOLETE { +// OBSOLETE int ubase, fpstate; +// OBSOLETE struct user u; +// OBSOLETE ubase = blockend + 4 * (SS + 1) - KSTKSZ; +// OBSOLETE fpstate = ubase + ((char *) &u.u_fpstate - (char *) &u); +// OBSOLETE return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM)); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE #endif +// OBSOLETE return (blockend + 4 * regmap[regnum]); +// OBSOLETE +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* The code below only work on the aix ps/2 (i386-ibm-aix) - +// OBSOLETE * mtranle@paris - Sat Apr 11 10:34:12 1992 +// OBSOLETE */ +// OBSOLETE +// OBSOLETE struct env387 +// OBSOLETE { +// OBSOLETE unsigned short control; +// OBSOLETE unsigned short r0; +// OBSOLETE unsigned short status; +// OBSOLETE unsigned short r1; +// OBSOLETE unsigned short tag; +// OBSOLETE unsigned short r2; +// OBSOLETE unsigned long eip; +// OBSOLETE unsigned short code_seg; +// OBSOLETE unsigned short opcode; +// OBSOLETE unsigned long operand; +// OBSOLETE unsigned short operand_seg; +// OBSOLETE unsigned short r3; +// OBSOLETE unsigned char regs[8][10]; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE static +// OBSOLETE print_387_status (unsigned short status, struct env387 *ep) +// OBSOLETE { +// OBSOLETE int i; +// OBSOLETE int bothstatus; +// OBSOLETE int top; +// OBSOLETE int fpreg; +// OBSOLETE unsigned char *p; +// OBSOLETE +// OBSOLETE bothstatus = ((status != 0) && (ep->status != 0)); +// OBSOLETE if (status != 0) +// OBSOLETE { +// OBSOLETE if (bothstatus) +// OBSOLETE printf_unfiltered ("u: "); +// OBSOLETE print_387_status_word (status); +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (ep->status != 0) +// OBSOLETE { +// OBSOLETE if (bothstatus) +// OBSOLETE printf_unfiltered ("e: "); +// OBSOLETE print_387_status_word (ep->status); +// OBSOLETE } +// OBSOLETE +// OBSOLETE print_387_control_word (ep->control); +// OBSOLETE printf_unfiltered ("last exception: "); +// OBSOLETE printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); +// OBSOLETE printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); +// OBSOLETE printf_unfiltered ("%s; ", local_hex_string (ep->eip)); +// OBSOLETE printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); +// OBSOLETE printf_unfiltered (":%s\n", local_hex_string (ep->operand)); +// OBSOLETE +// OBSOLETE top = ((ep->status >> 11) & 7); +// OBSOLETE +// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n"); +// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--) +// OBSOLETE { +// OBSOLETE double val; +// OBSOLETE +// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); +// OBSOLETE +// OBSOLETE switch ((ep->tag >> ((7 - fpreg) * 2)) & 3) +// OBSOLETE { +// OBSOLETE case 0: +// OBSOLETE printf_unfiltered ("valid "); +// OBSOLETE break; +// OBSOLETE case 1: +// OBSOLETE printf_unfiltered ("zero "); +// OBSOLETE break; +// OBSOLETE case 2: +// OBSOLETE printf_unfiltered ("trap "); +// OBSOLETE break; +// OBSOLETE case 3: +// OBSOLETE printf_unfiltered ("empty "); +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE for (i = 9; i >= 0; i--) +// OBSOLETE printf_unfiltered ("%02x", ep->regs[fpreg][i]); +// OBSOLETE +// OBSOLETE i387_to_double ((char *) ep->regs[fpreg], (char *) &val); +// OBSOLETE printf_unfiltered (" %#g\n", val); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct env387 core_env387; +// OBSOLETE +// OBSOLETE void +// OBSOLETE i386_float_info (void) +// OBSOLETE { +// OBSOLETE struct env387 fps; +// OBSOLETE int fpsaved = 0; +// OBSOLETE /* We need to reverse the order of the registers. Apparently AIX stores +// OBSOLETE the highest-numbered ones first. */ +// OBSOLETE struct env387 fps_fixed; +// OBSOLETE int i; +// OBSOLETE +// OBSOLETE if (! ptid_equal (inferior_ptid, null_ptid)) +// OBSOLETE { +// OBSOLETE char buf[10]; +// OBSOLETE unsigned short status; +// OBSOLETE +// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, +// OBSOLETE offsetof (struct env387, status)); +// OBSOLETE memcpy (&status, buf, sizeof (status)); +// OBSOLETE fpsaved = status; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE if ((fpsaved = core_env387.status) != 0) +// OBSOLETE memcpy (&fps, &core_env387, sizeof (fps)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (fpsaved == 0) +// OBSOLETE { +// OBSOLETE printf_unfiltered ("no floating point status saved\n"); +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (! ptid_equal (inferior_ptid, null_ptid)) +// OBSOLETE { +// OBSOLETE int offset; +// OBSOLETE for (offset = 0; offset < sizeof (fps); offset += 10) +// OBSOLETE { +// OBSOLETE char buf[10]; +// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, offset); +// OBSOLETE memcpy ((char *) &fps.control + offset, buf, +// OBSOLETE MIN (10, sizeof (fps) - offset)); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE fps_fixed = fps; +// OBSOLETE for (i = 0; i < 8; ++i) +// OBSOLETE memcpy (fps_fixed.regs[i], fps.regs[7 - i], 10); +// OBSOLETE print_387_status (0, &fps_fixed); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Fetch one register. */ +// OBSOLETE static void +// OBSOLETE fetch_register (int regno) +// OBSOLETE { +// OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; +// OBSOLETE if (regno < FP0_REGNUM) +// OBSOLETE *(int *) buf = ptrace (PT_READ_GPR, PIDGET (inferior_ptid), +// OBSOLETE PT_REG (regmap[regno]), 0, 0); +// OBSOLETE else +// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, +// OBSOLETE (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); +// OBSOLETE supply_register (regno, buf); +// OBSOLETE } +// OBSOLETE +// OBSOLETE void +// OBSOLETE fetch_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE if (regno < 0) +// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) +// OBSOLETE fetch_register (regno); +// OBSOLETE else +// OBSOLETE fetch_register (regno); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* store one register */ +// OBSOLETE static void +// OBSOLETE store_register (int regno) +// OBSOLETE { +// OBSOLETE char buf[80]; +// OBSOLETE errno = 0; +// OBSOLETE if (regno < FP0_REGNUM) +// OBSOLETE ptrace (PT_WRITE_GPR, PIDGET (inferior_ptid), PT_REG (regmap[regno]), +// OBSOLETE *(int *) ®isters[REGISTER_BYTE (regno)], 0); +// OBSOLETE else +// OBSOLETE ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid), +// OBSOLETE ®isters[REGISTER_BYTE (regno)], +// OBSOLETE (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); +// OBSOLETE +// OBSOLETE if (errno != 0) +// OBSOLETE { +// OBSOLETE sprintf (buf, "writing register number %d", regno); +// OBSOLETE perror_with_name (buf); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Store our register values back into the inferior. +// OBSOLETE If REGNO is -1, do this for all registers. +// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ +// OBSOLETE void +// OBSOLETE store_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE if (regno < 0) +// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) +// OBSOLETE store_register (regno); +// OBSOLETE else +// OBSOLETE store_register (regno); +// OBSOLETE } +// OBSOLETE +// OBSOLETE #ifndef CD_AX /* defined in sys/i386/coredump.h */ +// OBSOLETE #define CD_AX 0 +// OBSOLETE #define CD_BX 1 +// OBSOLETE #define CD_CX 2 +// OBSOLETE #define CD_DX 3 +// OBSOLETE #define CD_SI 4 +// OBSOLETE #define CD_DI 5 +// OBSOLETE #define CD_BP 6 +// OBSOLETE #define CD_SP 7 +// OBSOLETE #define CD_FL 8 +// OBSOLETE #define CD_IP 9 +// OBSOLETE #define CD_CS 10 +// OBSOLETE #define CD_DS 11 +// OBSOLETE #define CD_ES 12 +// OBSOLETE #define CD_FS 13 +// OBSOLETE #define CD_GS 14 +// OBSOLETE #define CD_SS 15 +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * The order here in core_regmap[] has to be the same as in +// OBSOLETE * regmap[] above. +// OBSOLETE */ +// OBSOLETE static int core_regmap[] = +// OBSOLETE { +// OBSOLETE CD_AX, CD_CX, CD_DX, CD_BX, +// OBSOLETE CD_SP, CD_BP, CD_SI, CD_DI, +// OBSOLETE CD_IP, CD_FL, CD_CS, CD_SS, +// OBSOLETE CD_DS, CD_ES, CD_FS, CD_GS, +// OBSOLETE }; +// OBSOLETE +// OBSOLETE /* Provide registers to GDB from a core file. +// OBSOLETE +// OBSOLETE CORE_REG_SECT points to an array of bytes, which were obtained from +// OBSOLETE a core file which BFD thinks might contain register contents. +// OBSOLETE CORE_REG_SIZE is its size. +// OBSOLETE +// OBSOLETE WHICH says which register set corelow suspects this is: +// OBSOLETE 0 --- the general-purpose register set +// OBSOLETE 2 --- the floating-point register set +// OBSOLETE +// OBSOLETE REG_ADDR isn't used. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, +// OBSOLETE int which, CORE_ADDR reg_addr) +// OBSOLETE { +// OBSOLETE +// OBSOLETE if (which == 0) +// OBSOLETE { +// OBSOLETE /* Integer registers */ +// OBSOLETE +// OBSOLETE #define cd_regs(n) ((int *)core_reg_sect)[n] +// OBSOLETE #define regs(n) *((int *) ®isters[REGISTER_BYTE (n)]) +// OBSOLETE +// OBSOLETE int i; +// OBSOLETE for (i = 0; i < FP0_REGNUM; i++) +// OBSOLETE regs (i) = cd_regs (core_regmap[i]); +// OBSOLETE } +// OBSOLETE else if (which == 2) +// OBSOLETE { +// OBSOLETE /* Floating point registers */ +// OBSOLETE +// OBSOLETE if (core_reg_size >= sizeof (core_env387)) +// OBSOLETE memcpy (&core_env387, core_reg_sect, core_reg_size); +// OBSOLETE else +// OBSOLETE fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n"); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Register that we are able to handle i386aix core file formats. +// OBSOLETE FIXME: is this really bfd_target_unknown_flavour? */ +// OBSOLETE +// OBSOLETE static struct core_fns i386aix_core_fns = +// OBSOLETE { +// OBSOLETE bfd_target_unknown_flavour, /* core_flavour */ +// OBSOLETE default_check_format, /* check_format */ +// OBSOLETE default_core_sniffer, /* core_sniffer */ +// OBSOLETE fetch_core_registers, /* core_read_registers */ +// OBSOLETE NULL /* next */ +// OBSOLETE }; +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_core_i386aix (void) +// OBSOLETE { +// OBSOLETE add_core_fns (&i386aix_core_fns); +// OBSOLETE } diff --git a/gdb/i386b-nat.c b/gdb/i386b-nat.c index be8fd4508d4..3c8a17c2719 100644 --- a/gdb/i386b-nat.c +++ b/gdb/i386b-nat.c @@ -21,57 +21,6 @@ #include "defs.h" -#ifdef FETCH_INFERIOR_REGISTERS -#include -#include -#include -#include -#include "inferior.h" -#include "gdbcore.h" /* for registers_fetched() */ -#include "regcache.h" - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; - - ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, 4 * NUM_REGS); - registers_fetched (); -} - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; - - memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], 4 * NUM_REGS); - ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); -} - -struct md_core -{ - struct reg intreg; - struct fpreg freg; -}; - -void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR ignore) -{ - struct md_core *core_reg = (struct md_core *) core_reg_sect; - - /* integer registers */ - memcpy (®isters[REGISTER_BYTE (0)], &core_reg->intreg, - sizeof (struct reg)); - /* floating point registers */ - /* XXX */ -} - -#else - #include /* this table must line up with REGISTER_NAMES in tm-i386.h */ @@ -121,171 +70,3 @@ i386_register_u_addr (int blockend, int regnum) else return (blockend + 4 * sregmap[regnum]); } - -#endif /* !FETCH_INFERIOR_REGISTERS */ - -#ifdef FLOAT_INFO -#include "expression.h" -#include "language.h" /* for local_hex_string */ -#include "floatformat.h" - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#define curpcb Xcurpcb /* XXX avoid leaking declaration from pcb.h */ -#include -#undef curpcb -#include -#include "gdb_stat.h" -#include - -extern void print_387_control_word (); /* i387-tdep.h */ -extern void print_387_status_word (); - -#define fpstate save87 -#define U_FPSTATE(u) u.u_pcb.pcb_savefpu - -struct env387 - { - unsigned short control; - unsigned short r0; - unsigned short status; - unsigned short r1; - unsigned short tag; - unsigned short r2; - unsigned long eip; - unsigned short code_seg; - unsigned short opcode; - unsigned long operand; - unsigned short operand_seg; - unsigned short r3; - unsigned char regs[8][10]; - }; - -static void -print_387_status (unsigned short status, struct env387 *ep) -{ - int i; - int bothstatus; - int top; - int fpreg; - - bothstatus = ((status != 0) && (ep->status != 0)); - if (status != 0) - { - if (bothstatus) - printf_unfiltered ("u: "); - print_387_status_word ((unsigned int) status); - } - - if (ep->status != 0) - { - if (bothstatus) - printf_unfiltered ("e: "); - print_387_status_word ((unsigned int) ep->status); - } - - print_387_control_word ((unsigned int) ep->control); - printf_unfiltered ("last exception: "); - printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); - printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); - printf_unfiltered ("%s; ", local_hex_string (ep->eip)); - printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); - printf_unfiltered (":%s\n", local_hex_string (ep->operand)); - - top = (ep->status >> 11) & 7; - - printf_unfiltered ("regno tag msb lsb value\n"); - for (fpreg = 7; fpreg >= 0; fpreg--) - { - double val; - - printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); - - switch ((ep->tag >> (fpreg * 2)) & 3) - { - case 0: - printf_unfiltered ("valid "); - break; - case 1: - printf_unfiltered ("zero "); - break; - case 2: - printf_unfiltered ("trap "); - break; - case 3: - printf_unfiltered ("empty "); - break; - } - for (i = 9; i >= 0; i--) - printf_unfiltered ("%02x", ep->regs[fpreg][i]); - - floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg], - &val); - printf_unfiltered (" %g\n", val); - } -} - -i386_float_info (void) -{ - struct user u; /* just for address computations */ - int i; - /* fpstate defined in */ - struct fpstate *fpstatep; - char buf[sizeof (struct fpstate) + 2 * sizeof (int)]; - unsigned int uaddr; - char fpvalid; - unsigned int rounded_addr; - unsigned int rounded_size; - /*extern int corechan; */ - int skip; - - uaddr = (char *) &U_FPSTATE (u) - (char *) &u; - if (! ptid_equal (inferior_ptid, null_ptid)) - { - int *ip; - - rounded_addr = uaddr & -sizeof (int); - rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) + - sizeof (int) - 1) / sizeof (int); - skip = uaddr - rounded_addr; - - ip = (int *) buf; - for (i = 0; i < rounded_size; i++) - { - *ip++ = ptrace (PT_READ_U, PIDGET (inferior_ptid), - (caddr_t) rounded_addr, 0); - rounded_addr += sizeof (int); - } - } - else - { - printf ("float info: can't do a core file (yet)\n"); - return; -#if 0 - if (lseek (corechan, uaddr, 0) < 0) - perror_with_name ("seek on core file"); - if (myread (corechan, buf, sizeof (struct fpstate)) < 0) - perror_with_name ("read from core file"); - skip = 0; -#endif - } - - print_387_status (0, (struct env387 *) buf); -} - -int -kernel_u_size (void) -{ - return (sizeof (struct user)); -} - -#endif diff --git a/gdb/i386m3-nat.c b/gdb/i386m3-nat.c index 8fbd1e8e81c..8cb51d51930 100644 --- a/gdb/i386m3-nat.c +++ b/gdb/i386m3-nat.c @@ -1,426 +1,426 @@ -/* Low level interface to I386 running mach 3.0. - Copyright 1992, 1993, 1994, 1996, 2000, 2001 - 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 "inferior.h" -#include "floatformat.h" -#include "regcache.h" - -#include - -#include -#include -#include -#include - -/* Hmmm... Should this not be here? - * Now for i386_float_info() target_has_execution - */ -#include - -/* This mess is duplicated in bfd/i386mach3.h - - * This is an ugly way to hack around the incorrect - * definition of UPAGES in i386/machparam.h. - * - * The definition should specify the size reserved - * for "struct user" in core files in PAGES, - * but instead it gives it in 512-byte core-clicks - * for i386 and i860. - */ -#include -#if UPAGES == 16 -#define UAREA_SIZE ctob(UPAGES) -#elif UPAGES == 2 -#define UAREA_SIZE (NBPG*UPAGES) -#else -FIXME ! !UPAGES is neither 2 nor 16 -#endif - -/* @@@ Should move print_387_status() to i387-tdep.c */ -extern void print_387_control_word (); /* i387-tdep.h */ -extern void print_387_status_word (); - -#define private static - - -/* Find offsets to thread states at compile time. - * If your compiler does not grok this, calculate offsets - * offsets yourself and use them (or get a compatible compiler :-) - */ - -#define REG_OFFSET(reg) (int)(&((struct i386_thread_state *)0)->reg) - -/* at reg_offset[i] is the offset to the i386_thread_state - * location where the gdb registers[i] is stored. - */ - -static int reg_offset[] = -{ - REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx), - REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi), - REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss), - REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs) -}; - -#define REG_ADDRESS(state,regnum) ((char *)(state)+reg_offset[regnum]) - -/* Fetch COUNT contiguous registers from thread STATE starting from REGNUM - * Caller knows that the regs handled in one transaction are of same size. - */ -#define FETCH_REGS(state, regnum, count) \ - memcpy (®isters[REGISTER_BYTE (regnum)], \ - REG_ADDRESS (state, regnum), \ - count*REGISTER_SIZE) - -/* Store COUNT contiguous registers to thread STATE starting from REGNUM */ -#define STORE_REGS(state, regnum, count) \ - memcpy (REG_ADDRESS (state, regnum), \ - ®isters[REGISTER_BYTE (regnum)], \ - count*REGISTER_SIZE) - -/* - * Fetch inferiors registers for gdb. - * REGNO specifies which (as gdb views it) register, -1 for all. - */ - -void -fetch_inferior_registers (int regno) -{ - kern_return_t ret; - thread_state_data_t state; - unsigned int stateCnt = i386_THREAD_STATE_COUNT; - int index; - - if (!MACH_PORT_VALID (current_thread)) - error ("fetch inferior registers: Invalid thread"); - - if (must_suspend_thread) - setup_thread (current_thread, 1); - - ret = thread_get_state (current_thread, - i386_THREAD_STATE, - state, - &stateCnt); - - if (ret != KERN_SUCCESS) - warning ("fetch_inferior_registers: %s ", - mach_error_string (ret)); -#if 0 - /* It may be more effective to store validate all of them, - * since we fetched them all anyway - */ - else if (regno != -1) - supply_register (regno, (char *) state + reg_offset[regno]); -#endif - else - { - for (index = 0; index < NUM_REGS; index++) - supply_register (index, (char *) state + reg_offset[index]); - } - - if (must_suspend_thread) - setup_thread (current_thread, 0); -} - -/* Store our register values back into the inferior. - * If REGNO is -1, do this for all registers. - * Otherwise, REGNO specifies which register - * - * On mach3 all registers are always saved in one call. - */ -void -store_inferior_registers (int regno) -{ - kern_return_t ret; - thread_state_data_t state; - unsigned int stateCnt = i386_THREAD_STATE_COUNT; - register int index; - - if (!MACH_PORT_VALID (current_thread)) - error ("store inferior registers: Invalid thread"); - - if (must_suspend_thread) - setup_thread (current_thread, 1); - - /* Fetch the state of the current thread */ - ret = thread_get_state (current_thread, - i386_THREAD_STATE, - state, - &stateCnt); - - if (ret != KERN_SUCCESS) - { - warning ("store_inferior_registers (get): %s", - mach_error_string (ret)); - if (must_suspend_thread) - setup_thread (current_thread, 0); - return; - } - - /* move gdb's registers to thread's state - - * Since we save all registers anyway, save the ones - * that gdb thinks are valid (e.g. ignore the regno - * parameter) - */ -#if 0 - if (regno != -1) - STORE_REGS (state, regno, 1); - else -#endif - { - for (index = 0; index < NUM_REGS; index++) - STORE_REGS (state, index, 1); - } - - /* Write gdb's current view of register to the thread - */ - ret = thread_set_state (current_thread, - i386_THREAD_STATE, - state, - i386_THREAD_STATE_COUNT); - - if (ret != KERN_SUCCESS) - warning ("store_inferior_registers (set): %s", - mach_error_string (ret)); - - if (must_suspend_thread) - setup_thread (current_thread, 0); -} - - - -/* Return the address in the core dump or inferior of register REGNO. - * BLOCKEND should be the address of the end of the UPAGES area read - * in memory, but it's not? - * - * Currently our UX server dumps the whole thread state to the - * core file. If your UX does something else, adapt the routine - * below to return the offset to the given register. - * - * Called by core-aout.c(fetch_core_registers) - */ - -CORE_ADDR -register_addr (int regno, CORE_ADDR blockend) -{ - CORE_ADDR addr; - - if (regno < 0 || regno >= NUM_REGS) - error ("Invalid register number %d.", regno); - - /* UAREA_SIZE == 8 kB in i386 */ - addr = (unsigned int) REG_ADDRESS (UAREA_SIZE - sizeof (struct i386_thread_state), regno); - - return addr; -} - -/* jtv@hut.fi: I copied and modified this 387 code from - * gdb/i386-xdep.c. Modifications for Mach 3.0. - * - * i387 status dumper. See also i387-tdep.c - */ -struct env387 -{ - unsigned short control; - unsigned short r0; - unsigned short status; - unsigned short r1; - unsigned short tag; - unsigned short r2; - unsigned long eip; - unsigned short code_seg; - unsigned short opcode; - unsigned long operand; - unsigned short operand_seg; - unsigned short r3; - unsigned char regs[8][10]; -}; -/* This routine is machine independent? - * Should move it to i387-tdep.c but you need to export struct env387 - */ -private -print_387_status (unsigned short status, struct env387 *ep) -{ - int i; - int bothstatus; - int top; - int fpreg; - unsigned char *p; - - bothstatus = ((status != 0) && (ep->status != 0)); - if (status != 0) - { - if (bothstatus) - printf_unfiltered ("u: "); - print_387_status_word (status); - } - - if (ep->status != 0) - { - if (bothstatus) - printf_unfiltered ("e: "); - print_387_status_word (ep->status); - } - - print_387_control_word (ep->control); - printf_unfiltered ("last exception: "); - printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); - printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); - printf_unfiltered ("%s; ", local_hex_string (ep->eip)); - printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); - printf_unfiltered (":%s\n", local_hex_string (ep->operand)); - - top = (ep->status >> 11) & 7; - - printf_unfiltered ("regno tag msb lsb value\n"); - for (fpreg = 7; fpreg >= 0; fpreg--) - { - double val; - - printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); - - switch ((ep->tag >> (fpreg * 2)) & 3) - { - case 0: - printf_unfiltered ("valid "); - break; - case 1: - printf_unfiltered ("zero "); - break; - case 2: - printf_unfiltered ("trap "); - break; - case 3: - printf_unfiltered ("empty "); - break; - } - for (i = 9; i >= 0; i--) - printf_unfiltered ("%02x", ep->regs[fpreg][i]); - - floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg], - &val); - printf_unfiltered (" %g\n", val); - } - if (ep->r0) - printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string (ep->r0)); - if (ep->r1) - printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string (ep->r1)); - if (ep->r2) - printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string (ep->r2)); - if (ep->r3) - printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string (ep->r3)); -} - -/* - * values that go into fp_kind (from ) - */ -#define FP_NO 0 /* no fp chip, no emulator (no fp support) */ -#define FP_SW 1 /* no fp chip, using software emulator */ -#define FP_HW 2 /* chip present bit */ -#define FP_287 2 /* 80287 chip present */ -#define FP_387 3 /* 80387 chip present */ - -typedef struct fpstate -{ -#if 1 - unsigned char state[FP_STATE_BYTES]; /* "hardware" state */ -#else - struct env387 state; /* Actually this */ -#endif - int status; /* Duplicate status */ -} - *fpstate_t; - -/* Mach 3 specific routines. - */ -private boolean_t -get_i387_state (struct fpstate *fstate) -{ - kern_return_t ret; - thread_state_data_t state; - unsigned int fsCnt = i386_FLOAT_STATE_COUNT; - struct i386_float_state *fsp; - - ret = thread_get_state (current_thread, - i386_FLOAT_STATE, - state, - &fsCnt); - - if (ret != KERN_SUCCESS) - { - warning ("Can not get live floating point state: %s", - mach_error_string (ret)); - return FALSE; - } - - fsp = (struct i386_float_state *) state; - /* The 387 chip (also 486 counts) or a software emulator? */ - if (!fsp->initialized || (fsp->fpkind != FP_387 && fsp->fpkind != FP_SW)) - return FALSE; - - /* Clear the target then copy thread's float state there. - Make a copy of the status word, for some reason? - */ - memset (fstate, 0, sizeof (struct fpstate)); - - fstate->status = fsp->exc_status; - - memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES); - - return TRUE; -} - -private boolean_t -get_i387_core_state (struct fpstate *fstate) -{ - /* Not implemented yet. Core files do not contain float state. */ - return FALSE; -} - -/* - * This is called by "info float" command - */ -void -i386_mach3_float_info (void) -{ - char buf[sizeof (struct fpstate) + 2 * sizeof (int)]; - boolean_t valid = FALSE; - fpstate_t fps; - - if (target_has_execution) - valid = get_i387_state (buf); -#if 0 - else if (WE HAVE CORE FILE) /* @@@@ Core files not supported */ - valid = get_i387_core_state (buf); -#endif - - if (!valid) - { - warning ("no floating point status saved"); - return; - } - - fps = (fpstate_t) buf; - - print_387_status (fps->status, (struct env387 *) fps->state); -} +// OBSOLETE /* Low level interface to I386 running mach 3.0. +// OBSOLETE Copyright 1992, 1993, 1994, 1996, 2000, 2001 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "floatformat.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE /* Hmmm... Should this not be here? +// OBSOLETE * Now for i386_float_info() target_has_execution +// OBSOLETE */ +// OBSOLETE #include +// OBSOLETE +// OBSOLETE /* This mess is duplicated in bfd/i386mach3.h +// OBSOLETE +// OBSOLETE * This is an ugly way to hack around the incorrect +// OBSOLETE * definition of UPAGES in i386/machparam.h. +// OBSOLETE * +// OBSOLETE * The definition should specify the size reserved +// OBSOLETE * for "struct user" in core files in PAGES, +// OBSOLETE * but instead it gives it in 512-byte core-clicks +// OBSOLETE * for i386 and i860. +// OBSOLETE */ +// OBSOLETE #include +// OBSOLETE #if UPAGES == 16 +// OBSOLETE #define UAREA_SIZE ctob(UPAGES) +// OBSOLETE #elif UPAGES == 2 +// OBSOLETE #define UAREA_SIZE (NBPG*UPAGES) +// OBSOLETE #else +// OBSOLETE FIXME ! !UPAGES is neither 2 nor 16 +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE /* @@@ Should move print_387_status() to i387-tdep.c */ +// OBSOLETE extern void print_387_control_word (); /* i387-tdep.h */ +// OBSOLETE extern void print_387_status_word (); +// OBSOLETE +// OBSOLETE #define private static +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Find offsets to thread states at compile time. +// OBSOLETE * If your compiler does not grok this, calculate offsets +// OBSOLETE * offsets yourself and use them (or get a compatible compiler :-) +// OBSOLETE */ +// OBSOLETE +// OBSOLETE #define REG_OFFSET(reg) (int)(&((struct i386_thread_state *)0)->reg) +// OBSOLETE +// OBSOLETE /* at reg_offset[i] is the offset to the i386_thread_state +// OBSOLETE * location where the gdb registers[i] is stored. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE static int reg_offset[] = +// OBSOLETE { +// OBSOLETE REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx), +// OBSOLETE REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi), +// OBSOLETE REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss), +// OBSOLETE REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs) +// OBSOLETE }; +// OBSOLETE +// OBSOLETE #define REG_ADDRESS(state,regnum) ((char *)(state)+reg_offset[regnum]) +// OBSOLETE +// OBSOLETE /* Fetch COUNT contiguous registers from thread STATE starting from REGNUM +// OBSOLETE * Caller knows that the regs handled in one transaction are of same size. +// OBSOLETE */ +// OBSOLETE #define FETCH_REGS(state, regnum, count) \ +// OBSOLETE memcpy (®isters[REGISTER_BYTE (regnum)], \ +// OBSOLETE REG_ADDRESS (state, regnum), \ +// OBSOLETE count*REGISTER_SIZE) +// OBSOLETE +// OBSOLETE /* Store COUNT contiguous registers to thread STATE starting from REGNUM */ +// OBSOLETE #define STORE_REGS(state, regnum, count) \ +// OBSOLETE memcpy (REG_ADDRESS (state, regnum), \ +// OBSOLETE ®isters[REGISTER_BYTE (regnum)], \ +// OBSOLETE count*REGISTER_SIZE) +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * Fetch inferiors registers for gdb. +// OBSOLETE * REGNO specifies which (as gdb views it) register, -1 for all. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE fetch_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE kern_return_t ret; +// OBSOLETE thread_state_data_t state; +// OBSOLETE unsigned int stateCnt = i386_THREAD_STATE_COUNT; +// OBSOLETE int index; +// OBSOLETE +// OBSOLETE if (!MACH_PORT_VALID (current_thread)) +// OBSOLETE error ("fetch inferior registers: Invalid thread"); +// OBSOLETE +// OBSOLETE if (must_suspend_thread) +// OBSOLETE setup_thread (current_thread, 1); +// OBSOLETE +// OBSOLETE ret = thread_get_state (current_thread, +// OBSOLETE i386_THREAD_STATE, +// OBSOLETE state, +// OBSOLETE &stateCnt); +// OBSOLETE +// OBSOLETE if (ret != KERN_SUCCESS) +// OBSOLETE warning ("fetch_inferior_registers: %s ", +// OBSOLETE mach_error_string (ret)); +// OBSOLETE #if 0 +// OBSOLETE /* It may be more effective to store validate all of them, +// OBSOLETE * since we fetched them all anyway +// OBSOLETE */ +// OBSOLETE else if (regno != -1) +// OBSOLETE supply_register (regno, (char *) state + reg_offset[regno]); +// OBSOLETE #endif +// OBSOLETE else +// OBSOLETE { +// OBSOLETE for (index = 0; index < NUM_REGS; index++) +// OBSOLETE supply_register (index, (char *) state + reg_offset[index]); +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (must_suspend_thread) +// OBSOLETE setup_thread (current_thread, 0); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Store our register values back into the inferior. +// OBSOLETE * If REGNO is -1, do this for all registers. +// OBSOLETE * Otherwise, REGNO specifies which register +// OBSOLETE * +// OBSOLETE * On mach3 all registers are always saved in one call. +// OBSOLETE */ +// OBSOLETE void +// OBSOLETE store_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE kern_return_t ret; +// OBSOLETE thread_state_data_t state; +// OBSOLETE unsigned int stateCnt = i386_THREAD_STATE_COUNT; +// OBSOLETE register int index; +// OBSOLETE +// OBSOLETE if (!MACH_PORT_VALID (current_thread)) +// OBSOLETE error ("store inferior registers: Invalid thread"); +// OBSOLETE +// OBSOLETE if (must_suspend_thread) +// OBSOLETE setup_thread (current_thread, 1); +// OBSOLETE +// OBSOLETE /* Fetch the state of the current thread */ +// OBSOLETE ret = thread_get_state (current_thread, +// OBSOLETE i386_THREAD_STATE, +// OBSOLETE state, +// OBSOLETE &stateCnt); +// OBSOLETE +// OBSOLETE if (ret != KERN_SUCCESS) +// OBSOLETE { +// OBSOLETE warning ("store_inferior_registers (get): %s", +// OBSOLETE mach_error_string (ret)); +// OBSOLETE if (must_suspend_thread) +// OBSOLETE setup_thread (current_thread, 0); +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* move gdb's registers to thread's state +// OBSOLETE +// OBSOLETE * Since we save all registers anyway, save the ones +// OBSOLETE * that gdb thinks are valid (e.g. ignore the regno +// OBSOLETE * parameter) +// OBSOLETE */ +// OBSOLETE #if 0 +// OBSOLETE if (regno != -1) +// OBSOLETE STORE_REGS (state, regno, 1); +// OBSOLETE else +// OBSOLETE #endif +// OBSOLETE { +// OBSOLETE for (index = 0; index < NUM_REGS; index++) +// OBSOLETE STORE_REGS (state, index, 1); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Write gdb's current view of register to the thread +// OBSOLETE */ +// OBSOLETE ret = thread_set_state (current_thread, +// OBSOLETE i386_THREAD_STATE, +// OBSOLETE state, +// OBSOLETE i386_THREAD_STATE_COUNT); +// OBSOLETE +// OBSOLETE if (ret != KERN_SUCCESS) +// OBSOLETE warning ("store_inferior_registers (set): %s", +// OBSOLETE mach_error_string (ret)); +// OBSOLETE +// OBSOLETE if (must_suspend_thread) +// OBSOLETE setup_thread (current_thread, 0); +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Return the address in the core dump or inferior of register REGNO. +// OBSOLETE * BLOCKEND should be the address of the end of the UPAGES area read +// OBSOLETE * in memory, but it's not? +// OBSOLETE * +// OBSOLETE * Currently our UX server dumps the whole thread state to the +// OBSOLETE * core file. If your UX does something else, adapt the routine +// OBSOLETE * below to return the offset to the given register. +// OBSOLETE * +// OBSOLETE * Called by core-aout.c(fetch_core_registers) +// OBSOLETE */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE register_addr (int regno, CORE_ADDR blockend) +// OBSOLETE { +// OBSOLETE CORE_ADDR addr; +// OBSOLETE +// OBSOLETE if (regno < 0 || regno >= NUM_REGS) +// OBSOLETE error ("Invalid register number %d.", regno); +// OBSOLETE +// OBSOLETE /* UAREA_SIZE == 8 kB in i386 */ +// OBSOLETE addr = (unsigned int) REG_ADDRESS (UAREA_SIZE - sizeof (struct i386_thread_state), regno); +// OBSOLETE +// OBSOLETE return addr; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* jtv@hut.fi: I copied and modified this 387 code from +// OBSOLETE * gdb/i386-xdep.c. Modifications for Mach 3.0. +// OBSOLETE * +// OBSOLETE * i387 status dumper. See also i387-tdep.c +// OBSOLETE */ +// OBSOLETE struct env387 +// OBSOLETE { +// OBSOLETE unsigned short control; +// OBSOLETE unsigned short r0; +// OBSOLETE unsigned short status; +// OBSOLETE unsigned short r1; +// OBSOLETE unsigned short tag; +// OBSOLETE unsigned short r2; +// OBSOLETE unsigned long eip; +// OBSOLETE unsigned short code_seg; +// OBSOLETE unsigned short opcode; +// OBSOLETE unsigned long operand; +// OBSOLETE unsigned short operand_seg; +// OBSOLETE unsigned short r3; +// OBSOLETE unsigned char regs[8][10]; +// OBSOLETE }; +// OBSOLETE /* This routine is machine independent? +// OBSOLETE * Should move it to i387-tdep.c but you need to export struct env387 +// OBSOLETE */ +// OBSOLETE private +// OBSOLETE print_387_status (unsigned short status, struct env387 *ep) +// OBSOLETE { +// OBSOLETE int i; +// OBSOLETE int bothstatus; +// OBSOLETE int top; +// OBSOLETE int fpreg; +// OBSOLETE unsigned char *p; +// OBSOLETE +// OBSOLETE bothstatus = ((status != 0) && (ep->status != 0)); +// OBSOLETE if (status != 0) +// OBSOLETE { +// OBSOLETE if (bothstatus) +// OBSOLETE printf_unfiltered ("u: "); +// OBSOLETE print_387_status_word (status); +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (ep->status != 0) +// OBSOLETE { +// OBSOLETE if (bothstatus) +// OBSOLETE printf_unfiltered ("e: "); +// OBSOLETE print_387_status_word (ep->status); +// OBSOLETE } +// OBSOLETE +// OBSOLETE print_387_control_word (ep->control); +// OBSOLETE printf_unfiltered ("last exception: "); +// OBSOLETE printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); +// OBSOLETE printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); +// OBSOLETE printf_unfiltered ("%s; ", local_hex_string (ep->eip)); +// OBSOLETE printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); +// OBSOLETE printf_unfiltered (":%s\n", local_hex_string (ep->operand)); +// OBSOLETE +// OBSOLETE top = (ep->status >> 11) & 7; +// OBSOLETE +// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n"); +// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--) +// OBSOLETE { +// OBSOLETE double val; +// OBSOLETE +// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); +// OBSOLETE +// OBSOLETE switch ((ep->tag >> (fpreg * 2)) & 3) +// OBSOLETE { +// OBSOLETE case 0: +// OBSOLETE printf_unfiltered ("valid "); +// OBSOLETE break; +// OBSOLETE case 1: +// OBSOLETE printf_unfiltered ("zero "); +// OBSOLETE break; +// OBSOLETE case 2: +// OBSOLETE printf_unfiltered ("trap "); +// OBSOLETE break; +// OBSOLETE case 3: +// OBSOLETE printf_unfiltered ("empty "); +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE for (i = 9; i >= 0; i--) +// OBSOLETE printf_unfiltered ("%02x", ep->regs[fpreg][i]); +// OBSOLETE +// OBSOLETE floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg], +// OBSOLETE &val); +// OBSOLETE printf_unfiltered (" %g\n", val); +// OBSOLETE } +// OBSOLETE if (ep->r0) +// OBSOLETE printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string (ep->r0)); +// OBSOLETE if (ep->r1) +// OBSOLETE printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string (ep->r1)); +// OBSOLETE if (ep->r2) +// OBSOLETE printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string (ep->r2)); +// OBSOLETE if (ep->r3) +// OBSOLETE printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string (ep->r3)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * values that go into fp_kind (from ) +// OBSOLETE */ +// OBSOLETE #define FP_NO 0 /* no fp chip, no emulator (no fp support) */ +// OBSOLETE #define FP_SW 1 /* no fp chip, using software emulator */ +// OBSOLETE #define FP_HW 2 /* chip present bit */ +// OBSOLETE #define FP_287 2 /* 80287 chip present */ +// OBSOLETE #define FP_387 3 /* 80387 chip present */ +// OBSOLETE +// OBSOLETE typedef struct fpstate +// OBSOLETE { +// OBSOLETE #if 1 +// OBSOLETE unsigned char state[FP_STATE_BYTES]; /* "hardware" state */ +// OBSOLETE #else +// OBSOLETE struct env387 state; /* Actually this */ +// OBSOLETE #endif +// OBSOLETE int status; /* Duplicate status */ +// OBSOLETE } +// OBSOLETE *fpstate_t; +// OBSOLETE +// OBSOLETE /* Mach 3 specific routines. +// OBSOLETE */ +// OBSOLETE private boolean_t +// OBSOLETE get_i387_state (struct fpstate *fstate) +// OBSOLETE { +// OBSOLETE kern_return_t ret; +// OBSOLETE thread_state_data_t state; +// OBSOLETE unsigned int fsCnt = i386_FLOAT_STATE_COUNT; +// OBSOLETE struct i386_float_state *fsp; +// OBSOLETE +// OBSOLETE ret = thread_get_state (current_thread, +// OBSOLETE i386_FLOAT_STATE, +// OBSOLETE state, +// OBSOLETE &fsCnt); +// OBSOLETE +// OBSOLETE if (ret != KERN_SUCCESS) +// OBSOLETE { +// OBSOLETE warning ("Can not get live floating point state: %s", +// OBSOLETE mach_error_string (ret)); +// OBSOLETE return FALSE; +// OBSOLETE } +// OBSOLETE +// OBSOLETE fsp = (struct i386_float_state *) state; +// OBSOLETE /* The 387 chip (also 486 counts) or a software emulator? */ +// OBSOLETE if (!fsp->initialized || (fsp->fpkind != FP_387 && fsp->fpkind != FP_SW)) +// OBSOLETE return FALSE; +// OBSOLETE +// OBSOLETE /* Clear the target then copy thread's float state there. +// OBSOLETE Make a copy of the status word, for some reason? +// OBSOLETE */ +// OBSOLETE memset (fstate, 0, sizeof (struct fpstate)); +// OBSOLETE +// OBSOLETE fstate->status = fsp->exc_status; +// OBSOLETE +// OBSOLETE memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES); +// OBSOLETE +// OBSOLETE return TRUE; +// OBSOLETE } +// OBSOLETE +// OBSOLETE private boolean_t +// OBSOLETE get_i387_core_state (struct fpstate *fstate) +// OBSOLETE { +// OBSOLETE /* Not implemented yet. Core files do not contain float state. */ +// OBSOLETE return FALSE; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * This is called by "info float" command +// OBSOLETE */ +// OBSOLETE void +// OBSOLETE i386_mach3_float_info (void) +// OBSOLETE { +// OBSOLETE char buf[sizeof (struct fpstate) + 2 * sizeof (int)]; +// OBSOLETE boolean_t valid = FALSE; +// OBSOLETE fpstate_t fps; +// OBSOLETE +// OBSOLETE if (target_has_execution) +// OBSOLETE valid = get_i387_state (buf); +// OBSOLETE #if 0 +// OBSOLETE else if (WE HAVE CORE FILE) /* @@@@ Core files not supported */ +// OBSOLETE valid = get_i387_core_state (buf); +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE if (!valid) +// OBSOLETE { +// OBSOLETE warning ("no floating point status saved"); +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE +// OBSOLETE fps = (fpstate_t) buf; +// OBSOLETE +// OBSOLETE print_387_status (fps->status, (struct env387 *) fps->state); +// OBSOLETE } diff --git a/gdb/i386mach-nat.c b/gdb/i386mach-nat.c index 6d4980be4c6..ee696c4e695 100644 --- a/gdb/i386mach-nat.c +++ b/gdb/i386mach-nat.c @@ -1,172 +1,172 @@ -/* Native dependent code for Mach 386's for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 1999, 2000, - 2001 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 "frame.h" -#include "inferior.h" -#include "gdbcore.h" -#include "regcache.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include "gdb_stat.h" -#include - -static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); - -void -fetch_inferior_registers (int regno) -{ - struct regs inferior_registers; - struct fp_state inferior_fp_registers; - - registers_fetched (); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers); - ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers); - - memcpy (registers, &inferior_registers, sizeof inferior_registers); - - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], - inferior_fp_registers.f_st, - sizeof inferior_fp_registers.f_st); - memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], - &inferior_fp_registers.f_ctrl, - sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - struct regs inferior_registers; - struct fp_state inferior_fp_registers; - - memcpy (&inferior_registers, registers, 20 * 4); - - memcpy (inferior_fp_registers.f_st, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.f_st); - memcpy (&inferior_fp_registers.f_ctrl, - ®isters[REGISTER_BYTE (FPC_REGNUM)], - sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); - -#ifdef PTRACE_FP_BUG - if (regno == FP_REGNUM || regno == -1) - /* Storing the frame pointer requires a gross hack, in which an - instruction that moves eax into ebp gets single-stepped. */ - { - int stack = inferior_registers.r_reg[SP_REGNUM]; - int stuff = ptrace (PTRACE_PEEKDATA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) stack); - int reg = inferior_registers.r_reg[EAX]; - inferior_registers.r_reg[EAX] = - inferior_registers.r_reg[FP_REGNUM]; - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers); - ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) stack, 0xc589); - ptrace (PTRACE_SINGLESTEP, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) stack, 0); - wait (0); - ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) stack, stuff); - inferior_registers.r_reg[EAX] = reg; - } -#endif - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers); - ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers); -} - - - -/* Provide registers to GDB from a core file. - - CORE_REG_SECT points to an array of bytes, which were obtained from - a core file which BFD thinks might contain register contents. - CORE_REG_SIZE is its size. - - WHICH says which register set corelow suspects this is: - 0 --- the general-purpose register set - 2 --- the floating-point register set - - REG_ADDR isn't used. */ - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, - int which, CORE_ADDR reg_addr) -{ - int val; - - switch (which) - { - case 0: - case 1: - memcpy (registers, core_reg_sect, core_reg_size); - break; - - case 2: - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], - core_reg_sect, - core_reg_size); /* FIXME, probably bogus */ -#ifdef FPC_REGNUM - memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], - &corestr.c_fpu.f_fpstatus.f_ctrl, - sizeof corestr.c_fpu.f_fpstatus - - sizeof corestr.c_fpu.f_fpstatus.f_st); -#endif - break; - } -} - - -/* Register that we are able to handle i386mach core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns i386mach_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_core_i386mach (void) -{ - add_core_fns (&i386mach_core_fns); -} +// OBSOLETE /* Native dependent code for Mach 386's for GDB, the GNU debugger. +// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 1999, 2000, +// OBSOLETE 2001 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "frame.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "gdbcore.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include "gdb_stat.h" +// OBSOLETE #include +// OBSOLETE +// OBSOLETE static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); +// OBSOLETE +// OBSOLETE void +// OBSOLETE fetch_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE struct regs inferior_registers; +// OBSOLETE struct fp_state inferior_fp_registers; +// OBSOLETE +// OBSOLETE registers_fetched (); +// OBSOLETE +// OBSOLETE ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); +// OBSOLETE ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_fp_registers); +// OBSOLETE +// OBSOLETE memcpy (registers, &inferior_registers, sizeof inferior_registers); +// OBSOLETE +// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE inferior_fp_registers.f_st, +// OBSOLETE sizeof inferior_fp_registers.f_st); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], +// OBSOLETE &inferior_fp_registers.f_ctrl, +// OBSOLETE sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Store our register values back into the inferior. +// OBSOLETE If REGNO is -1, do this for all registers. +// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE store_inferior_registers (int regno) +// OBSOLETE { +// OBSOLETE struct regs inferior_registers; +// OBSOLETE struct fp_state inferior_fp_registers; +// OBSOLETE +// OBSOLETE memcpy (&inferior_registers, registers, 20 * 4); +// OBSOLETE +// OBSOLETE memcpy (inferior_fp_registers.f_st, ®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE sizeof inferior_fp_registers.f_st); +// OBSOLETE memcpy (&inferior_fp_registers.f_ctrl, +// OBSOLETE ®isters[REGISTER_BYTE (FPC_REGNUM)], +// OBSOLETE sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); +// OBSOLETE +// OBSOLETE #ifdef PTRACE_FP_BUG +// OBSOLETE if (regno == FP_REGNUM || regno == -1) +// OBSOLETE /* Storing the frame pointer requires a gross hack, in which an +// OBSOLETE instruction that moves eax into ebp gets single-stepped. */ +// OBSOLETE { +// OBSOLETE int stack = inferior_registers.r_reg[SP_REGNUM]; +// OBSOLETE int stuff = ptrace (PTRACE_PEEKDATA, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) stack); +// OBSOLETE int reg = inferior_registers.r_reg[EAX]; +// OBSOLETE inferior_registers.r_reg[EAX] = +// OBSOLETE inferior_registers.r_reg[FP_REGNUM]; +// OBSOLETE ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); +// OBSOLETE ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) stack, 0xc589); +// OBSOLETE ptrace (PTRACE_SINGLESTEP, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) stack, 0); +// OBSOLETE wait (0); +// OBSOLETE ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) stack, stuff); +// OBSOLETE inferior_registers.r_reg[EAX] = reg; +// OBSOLETE } +// OBSOLETE #endif +// OBSOLETE ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); +// OBSOLETE ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid), +// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_fp_registers); +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Provide registers to GDB from a core file. +// OBSOLETE +// OBSOLETE CORE_REG_SECT points to an array of bytes, which were obtained from +// OBSOLETE a core file which BFD thinks might contain register contents. +// OBSOLETE CORE_REG_SIZE is its size. +// OBSOLETE +// OBSOLETE WHICH says which register set corelow suspects this is: +// OBSOLETE 0 --- the general-purpose register set +// OBSOLETE 2 --- the floating-point register set +// OBSOLETE +// OBSOLETE REG_ADDR isn't used. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, +// OBSOLETE int which, CORE_ADDR reg_addr) +// OBSOLETE { +// OBSOLETE int val; +// OBSOLETE +// OBSOLETE switch (which) +// OBSOLETE { +// OBSOLETE case 0: +// OBSOLETE case 1: +// OBSOLETE memcpy (registers, core_reg_sect, core_reg_size); +// OBSOLETE break; +// OBSOLETE +// OBSOLETE case 2: +// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE core_reg_sect, +// OBSOLETE core_reg_size); /* FIXME, probably bogus */ +// OBSOLETE #ifdef FPC_REGNUM +// OBSOLETE memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], +// OBSOLETE &corestr.c_fpu.f_fpstatus.f_ctrl, +// OBSOLETE sizeof corestr.c_fpu.f_fpstatus - +// OBSOLETE sizeof corestr.c_fpu.f_fpstatus.f_st); +// OBSOLETE #endif +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Register that we are able to handle i386mach core file formats. +// OBSOLETE FIXME: is this really bfd_target_unknown_flavour? */ +// OBSOLETE +// OBSOLETE static struct core_fns i386mach_core_fns = +// OBSOLETE { +// OBSOLETE bfd_target_unknown_flavour, /* core_flavour */ +// OBSOLETE default_check_format, /* check_format */ +// OBSOLETE default_core_sniffer, /* core_sniffer */ +// OBSOLETE fetch_core_registers, /* core_read_registers */ +// OBSOLETE NULL /* next */ +// OBSOLETE }; +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_core_i386mach (void) +// OBSOLETE { +// OBSOLETE add_core_fns (&i386mach_core_fns); +// OBSOLETE } diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c index c603b281966..8180093c2ae 100644 --- a/gdb/i386v-nat.c +++ b/gdb/i386v-nat.c @@ -1,4 +1,4 @@ -/* Intel 386 native support for SYSV systems (pre-SVR4). +/* Intel 386 native support for System V systems (pre-SVR4). Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. @@ -62,8 +62,8 @@ #include "target.h" -/* this table must line up with REGISTER_NAMES in tm-i386v.h */ -/* symbols like 'EAX' come from */ +/* Mapping between the general-purpose registers in `struct user' + format and GDB's register array layout. */ static int regmap[] = { EAX, ECX, EDX, EBX, @@ -72,37 +72,34 @@ static int regmap[] = DS, ES, FS, GS, }; -/* blockend is the value of u.u_ar0, and points to the - * place where GS is stored - */ +/* Support for the user struct. */ -int -i386_register_u_addr (int blockend, int regnum) +/* Return the address of register REGNUM. BLOCKEND is the value of + u.u_ar0, and points to the place where GS is stored. */ + +CORE_ADDR +register_u_addr (CORE_ADDR blockend, int regnum) { struct user u; - int fpstate; - int ubase; + CORE_ADDR fpstate; - ubase = blockend; - /* FIXME: Should have better way to test floating point range */ - if (regnum >= FP0_REGNUM && regnum <= (FP0_REGNUM + 7)) + if (FP_REGNUM_P (regnum)) { -#ifdef KSTKSZ /* SCO, and others? */ - ubase += 4 * (SS + 1) - KSTKSZ; - fpstate = ubase + ((char *) &u.u_fps.u_fpstate - (char *) &u); +#ifdef KSTKSZ /* SCO, and others? */ + blockend += 4 * (SS + 1) - KSTKSZ; + fpstate = blockend + ((char *) &u.u_fps.u_fpstate - (char *) &u); return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM)); #else - fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u); + fpstate = blockend + ((char *) &u.i387.st_space - (char *) &u); return (fpstate + 10 * (regnum - FP0_REGNUM)); #endif } - else - { - return (ubase + 4 * regmap[regnum]); - } + return (blockend + 4 * regmap[regnum]); } - + +/* Return the size of the user struct. */ + int kernel_u_size (void) { diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 59b60d77a9d..3d4b39775fb 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -28,6 +28,7 @@ #include "floatformat.h" #include "regcache.h" #include "gdb_assert.h" +#include "gdb_string.h" #include "doublest.h" #include "i386-tdep.h" @@ -160,7 +161,7 @@ print_387_status_word (unsigned int status) /* Print the floating point number specified by RAW. */ static void -print_i387_value (char *raw) +print_i387_value (char *raw, struct ui_file *file) { DOUBLEST value; @@ -175,15 +176,15 @@ print_i387_value (char *raw) to print the value, 1 position for the sign, 1 for the decimal point, 19 for the digits and 6 for the exponent adds up to 27. */ #ifdef PRINTF_HAS_LONG_DOUBLE - printf_filtered (" %-+27.19Lg", (long double) value); + fprintf_filtered (file, " %-+27.19Lg", (long double) value); #else - printf_filtered (" %-+27.19g", (double) value); + fprintf_filtered (file, " %-+27.19g", (double) value); #endif } /* Print the classification for the register contents RAW. */ static void -print_i387_ext (unsigned char *raw) +print_i387_ext (unsigned char *raw, struct ui_file *file) { int sign; int integer; @@ -201,119 +202,124 @@ print_i387_ext (unsigned char *raw) { if (fraction[0] == 0x00000000 && fraction[1] == 0x00000000) /* Infinity. */ - printf_filtered (" %cInf", (sign ? '-' : '+')); + fprintf_filtered (file, " %cInf", (sign ? '-' : '+')); else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000) /* Real Indefinite (QNaN). */ - puts_unfiltered (" Real Indefinite (QNaN)"); + fputs_unfiltered (" Real Indefinite (QNaN)", file); else if (fraction[1] & 0x40000000) /* QNaN. */ - puts_filtered (" QNaN"); + fputs_filtered (" QNaN", file); else /* SNaN. */ - puts_filtered (" SNaN"); + fputs_filtered (" SNaN", file); } else if (exponent < 0x7fff && exponent > 0x0000 && integer) /* Normal. */ - print_i387_value (raw); + print_i387_value (raw, file); else if (exponent == 0x0000) { /* Denormal or zero. */ - print_i387_value (raw); + print_i387_value (raw, file); if (integer) /* Pseudo-denormal. */ - puts_filtered (" Pseudo-denormal"); + fputs_filtered (" Pseudo-denormal", file); else if (fraction[0] || fraction[1]) /* Denormal. */ - puts_filtered (" Denormal"); + fputs_filtered (" Denormal", file); } else /* Unsupported. */ - puts_filtered (" Unsupported"); + fputs_filtered (" Unsupported", file); } /* Print the status word STATUS. */ static void -print_i387_status_word (unsigned int status) +print_i387_status_word (unsigned int status, struct ui_file *file) { - printf_filtered ("Status Word: %s", + fprintf_filtered (file, "Status Word: %s", local_hex_string_custom (status, "04")); - puts_filtered (" "); - printf_filtered (" %s", (status & 0x0001) ? "IE" : " "); - printf_filtered (" %s", (status & 0x0002) ? "DE" : " "); - printf_filtered (" %s", (status & 0x0004) ? "ZE" : " "); - printf_filtered (" %s", (status & 0x0008) ? "OE" : " "); - printf_filtered (" %s", (status & 0x0010) ? "UE" : " "); - printf_filtered (" %s", (status & 0x0020) ? "PE" : " "); - puts_filtered (" "); - printf_filtered (" %s", (status & 0x0080) ? "ES" : " "); - puts_filtered (" "); - printf_filtered (" %s", (status & 0x0040) ? "SF" : " "); - puts_filtered (" "); - printf_filtered (" %s", (status & 0x0100) ? "C0" : " "); - printf_filtered (" %s", (status & 0x0200) ? "C1" : " "); - printf_filtered (" %s", (status & 0x0400) ? "C2" : " "); - printf_filtered (" %s", (status & 0x4000) ? "C3" : " "); - - puts_filtered ("\n"); - - printf_filtered (" TOP: %d\n", ((status >> 11) & 7)); + fputs_filtered (" ", file); + fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " "); + fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); + fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " "); + fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " "); + fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " "); + fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " "); + fputs_filtered (" ", file); + fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " "); + fputs_filtered (" ", file); + fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " "); + fputs_filtered (" ", file); + fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " "); + fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " "); + fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " "); + fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " "); + + fputs_filtered ("\n", file); + + fprintf_filtered (file, + " TOP: %d\n", ((status >> 11) & 7)); } /* Print the control word CONTROL. */ static void -print_i387_control_word (unsigned int control) +print_i387_control_word (unsigned int control, struct ui_file *file) { - printf_filtered ("Control Word: %s", + fprintf_filtered (file, "Control Word: %s", local_hex_string_custom (control, "04")); - puts_filtered (" "); - printf_filtered (" %s", (control & 0x0001) ? "IM" : " "); - printf_filtered (" %s", (control & 0x0002) ? "DM" : " "); - printf_filtered (" %s", (control & 0x0004) ? "ZM" : " "); - printf_filtered (" %s", (control & 0x0008) ? "OM" : " "); - printf_filtered (" %s", (control & 0x0010) ? "UM" : " "); - printf_filtered (" %s", (control & 0x0020) ? "PM" : " "); + fputs_filtered (" ", file); + fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " "); + fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); + fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " "); + fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " "); + fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " "); + fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " "); - puts_filtered ("\n"); + fputs_filtered ("\n", file); - puts_filtered (" PC: "); + fputs_filtered (" PC: ", file); switch ((control >> 8) & 3) { case 0: - puts_filtered ("Single Precision (24-bits)\n"); + fputs_filtered ("Single Precision (24-bits)\n", file); break; case 1: - puts_filtered ("Reserved\n"); + fputs_filtered ("Reserved\n", file); break; case 2: - puts_filtered ("Double Precision (53-bits)\n"); + fputs_filtered ("Double Precision (53-bits)\n", file); break; case 3: - puts_filtered ("Extended Precision (64-bits)\n"); + fputs_filtered ("Extended Precision (64-bits)\n", file); break; } - puts_filtered (" RC: "); + fputs_filtered (" RC: ", file); switch ((control >> 10) & 3) { case 0: - puts_filtered ("Round to nearest\n"); + fputs_filtered ("Round to nearest\n", file); break; case 1: - puts_filtered ("Round down\n"); + fputs_filtered ("Round down\n", file); break; case 2: - puts_filtered ("Round up\n"); + fputs_filtered ("Round up\n", file); break; case 3: - puts_filtered ("Round toward zero\n"); + fputs_filtered ("Round toward zero\n", file); break; } } -/* Print out the i387 floating poin state. */ +/* Print out the i387 floating point state. Note that we ignore FRAME + in the code below. That's OK since floating-point registers are + never saved on the stack. */ + void -i387_float_info (void) +i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame, const char *args) { unsigned int fctrl; unsigned int fstat; @@ -343,50 +349,50 @@ i387_float_info (void) int tag = (ftag >> (fpreg * 2)) & 3; int i; - printf_filtered ("%sR%d: ", fpreg == top ? "=>" : " ", fpreg); + fprintf_filtered (file, "%sR%d: ", fpreg == top ? "=>" : " ", fpreg); switch (tag) { case 0: - puts_filtered ("Valid "); + fputs_filtered ("Valid ", file); break; case 1: - puts_filtered ("Zero "); + fputs_filtered ("Zero ", file); break; case 2: - puts_filtered ("Special "); + fputs_filtered ("Special ", file); break; case 3: - puts_filtered ("Empty "); + fputs_filtered ("Empty ", file); break; } read_register_gen ((fpreg + 8 - top) % 8 + FP0_REGNUM, raw); - puts_filtered ("0x"); + fputs_filtered ("0x", file); for (i = 9; i >= 0; i--) - printf_filtered ("%02x", raw[i]); + fprintf_filtered (file, "%02x", raw[i]); if (tag != 3) - print_i387_ext (raw); + print_i387_ext (raw, file); - puts_filtered ("\n"); + fputs_filtered ("\n", file); } puts_filtered ("\n"); - print_i387_status_word (fstat); - print_i387_control_word (fctrl); - printf_filtered ("Tag Word: %s\n", - local_hex_string_custom (ftag, "04")); - printf_filtered ("Instruction Pointer: %s:", - local_hex_string_custom (fiseg, "02")); - printf_filtered ("%s\n", local_hex_string_custom (fioff, "08")); - printf_filtered ("Operand Pointer: %s:", - local_hex_string_custom (foseg, "02")); - printf_filtered ("%s\n", local_hex_string_custom (fooff, "08")); - printf_filtered ("Opcode: %s\n", - local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); + print_i387_status_word (fstat, file); + print_i387_control_word (fctrl, file); + fprintf_filtered (file, "Tag Word: %s\n", + local_hex_string_custom (ftag, "04")); + fprintf_filtered (file, "Instruction Pointer: %s:", + local_hex_string_custom (fiseg, "02")); + fprintf_filtered (file, "%s\n", local_hex_string_custom (fioff, "08")); + fprintf_filtered (file, "Operand Pointer: %s:", + local_hex_string_custom (foseg, "02")); + fprintf_filtered (file, "%s\n", local_hex_string_custom (fooff, "08")); + fprintf_filtered (file, "Opcode: %s\n", + local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); } /* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h index 5bfd06eb710..e29b19834d5 100644 --- a/gdb/i387-tdep.h +++ b/gdb/i387-tdep.h @@ -21,6 +21,13 @@ #ifndef I387_TDEP_H #define I387_TDEP_H +/* Print out the i387 floating point state. */ + +extern void i387_print_float_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame, + const char *args); + /* Fill register REGNUM in GDB's register array with the appropriate value from *FSAVE. This function masks off any of the reserved bits in *FSAVE. */ diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c index 2b16adfc40f..d059a7b68b9 100644 --- a/gdb/i960-tdep.c +++ b/gdb/i960-tdep.c @@ -1,1056 +1,1056 @@ -/* Target-machine dependent code for the Intel 960 - - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. - - Contributed by Intel Corporation. - examine_prologue and other parts contributed by Wind River Systems. - - 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 "symtab.h" -#include "value.h" -#include "frame.h" -#include "floatformat.h" -#include "target.h" -#include "gdbcore.h" -#include "inferior.h" -#include "regcache.h" -#include "gdb_string.h" - -static CORE_ADDR next_insn (CORE_ADDR memaddr, - unsigned int *pword1, unsigned int *pword2); - -struct type * -i960_register_type (int regnum) -{ - if (regnum < FP0_REGNUM) - return builtin_type_int32; - else - return builtin_type_i960_ext; -} - - -/* Does the specified function use the "struct returning" convention - or the "value returning" convention? The "value returning" convention - almost invariably returns the entire value in registers. The - "struct returning" convention often returns the entire value in - memory, and passes a pointer (out of or into the function) saying - where the value (is or should go). - - Since this sometimes depends on whether it was compiled with GCC, - this is also an argument. This is used in call_function to build a - stack, and in value_being_returned to print return values. - - On i960, a structure is returned in registers g0-g3, if it will fit. - If it's more than 16 bytes long, g13 pointed to it on entry. */ - -int -i960_use_struct_convention (int gcc_p, struct type *type) -{ - return (TYPE_LENGTH (type) > 16); -} - -/* gdb960 is always running on a non-960 host. Check its characteristics. - This routine must be called as part of gdb initialization. */ - -static void -check_host (void) -{ - int i; - - static struct typestruct - { - int hostsize; /* Size of type on host */ - int i960size; /* Size of type on i960 */ - char *typename; /* Name of type, for error msg */ - } - types[] = - { - { - sizeof (short), 2, "short" - } - , - { - sizeof (int), 4, "int" - } - , - { - sizeof (long), 4, "long" - } - , - { - sizeof (float), 4, "float" - } - , - { - sizeof (double), 8, "double" - } - , - { - sizeof (char *), 4, "pointer" - } - , - }; -#define TYPELEN (sizeof(types) / sizeof(struct typestruct)) - - /* Make sure that host type sizes are same as i960 - */ - for (i = 0; i < TYPELEN; i++) - { - if (types[i].hostsize != types[i].i960size) - { - printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n", - types[i].typename, types[i].i960size); - } - - } -} - -/* Is this register part of the register window system? A yes answer - implies that 1) The name of this register will not be the same in - other frames, and 2) This register is automatically "saved" upon - subroutine calls and thus there is no need to search more than one - stack frame for it. - - On the i960, in fact, the name of this register in another frame is - "mud" -- there is no overlap between the windows. Each window is - simply saved into the stack (true for our purposes, after having been - flushed; normally they reside on-chip and are restored from on-chip - without ever going to memory). */ - -static int -register_in_window_p (int regnum) -{ - return regnum <= R15_REGNUM; -} - -/* i960_find_saved_register () - - Return the address in which frame FRAME's value of register REGNUM - has been saved in memory. Or return zero if it has not been saved. - If REGNUM specifies the SP, the value we return is actually the SP - value, not an address where it was saved. */ - -static CORE_ADDR -i960_find_saved_register (struct frame_info *frame, int regnum) -{ - register struct frame_info *frame1 = NULL; - register CORE_ADDR addr = 0; - - if (frame == NULL) /* No regs saved if want current frame */ - return 0; - - /* We assume that a register in a register window will only be saved - in one place (since the name changes and/or disappears as you go - towards inner frames), so we only call get_frame_saved_regs on - the current frame. This is directly in contradiction to the - usage below, which assumes that registers used in a frame must be - saved in a lower (more interior) frame. This change is a result - of working on a register window machine; get_frame_saved_regs - always returns the registers saved within a frame, within the - context (register namespace) of that frame. */ - - /* However, note that we don't want this to return anything if - nothing is saved (if there's a frame inside of this one). Also, - callers to this routine asking for the stack pointer want the - stack pointer saved for *this* frame; this is returned from the - next frame. */ - - if (register_in_window_p (regnum)) - { - frame1 = get_next_frame (frame); - if (!frame1) - return 0; /* Registers of this frame are active. */ - - /* Get the SP from the next frame in; it will be this - current frame. */ - if (regnum != SP_REGNUM) - frame1 = frame; - - FRAME_INIT_SAVED_REGS (frame1); - return frame1->saved_regs[regnum]; /* ... which might be zero */ - } - - /* Note that this next routine assumes that registers used in - frame x will be saved only in the frame that x calls and - frames interior to it. This is not true on the sparc, but the - above macro takes care of it, so we should be all right. */ - while (1) - { - QUIT; - frame1 = get_next_frame (frame); - if (frame1 == 0) - break; - frame = frame1; - FRAME_INIT_SAVED_REGS (frame1); - if (frame1->saved_regs[regnum]) - addr = frame1->saved_regs[regnum]; - } - - return addr; -} - -/* i960_get_saved_register () - - Find register number REGNUM relative to FRAME and put its (raw, - target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the - variable was optimized out (and thus can't be fetched). Set *LVAL - to lval_memory, lval_register, or not_lval, depending on whether - the value was fetched from memory, from a register, or in a strange - and non-modifiable way (e.g. a frame pointer which was calculated - rather than fetched). Set *ADDRP to the address, either in memory - on as a REGISTER_BYTE offset into the registers array. - - Note that this implementation never sets *LVAL to not_lval. But it - can be replaced by defining GET_SAVED_REGISTER and supplying your - own. - - The argument RAW_BUFFER must point to aligned memory. */ - -void -i960_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, - enum lval_type *lval) -{ - CORE_ADDR addr; - - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - addr = i960_find_saved_register (frame, regnum); - if (addr != 0) - { - if (lval != NULL) - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer != NULL) - { - /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - (LONGEST) addr); - } - if (addrp != NULL) - *addrp = 0; - return; - } - if (raw_buffer != NULL) - target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); - } - else - { - if (lval != NULL) - *lval = lval_register; - addr = REGISTER_BYTE (regnum); - if (raw_buffer != NULL) - read_register_gen (regnum, raw_buffer); - } - if (addrp != NULL) - *addrp = addr; -} - -/* Examine an i960 function prologue, recording the addresses at which - registers are saved explicitly by the prologue code, and returning - the address of the first instruction after the prologue (but not - after the instruction at address LIMIT, as explained below). - - LIMIT places an upper bound on addresses of the instructions to be - examined. If the prologue code scan reaches LIMIT, the scan is - aborted and LIMIT is returned. This is used, when examining the - prologue for the current frame, to keep examine_prologue () from - claiming that a given register has been saved when in fact the - instruction that saves it has not yet been executed. LIMIT is used - at other times to stop the scan when we hit code after the true - function prologue (e.g. for the first source line) which might - otherwise be mistaken for function prologue. - - The format of the function prologue matched by this routine is - derived from examination of the source to gcc960 1.21, particularly - the routine i960_function_prologue (). A "regular expression" for - the function prologue is given below: - - (lda LRn, g14 - mov g14, g[0-7] - (mov 0, g14) | (lda 0, g14))? - - (mov[qtl]? g[0-15], r[4-15])* - ((addo [1-31], sp, sp) | (lda n(sp), sp))? - (st[qtl]? g[0-15], n(fp))* - - (cmpobne 0, g14, LFn - mov sp, g14 - lda 0x30(sp), sp - LFn: stq g0, (g14) - stq g4, 0x10(g14) - stq g8, 0x20(g14))? - - (st g14, n(fp))? - (mov g13,r[4-15])? - */ - -/* Macros for extracting fields from i960 instructions. */ - -#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos)) -#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width)) - -#define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5) -#define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5) -#define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) -#define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) -#define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12) - -/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or - is not the address of a valid instruction, the address of the next - instruction beyond ADDR otherwise. *PWORD1 receives the first word - of the instruction, and (for two-word instructions), *PWORD2 receives - the second. */ - -#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \ - (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0) - -static CORE_ADDR -examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, - CORE_ADDR frame_addr, struct frame_saved_regs *fsr) -{ - register CORE_ADDR next_ip; - register int src, dst; - register unsigned int *pcode; - unsigned int insn1, insn2; - int size; - int within_leaf_prologue; - CORE_ADDR save_addr; - static unsigned int varargs_prologue_code[] = - { - 0x3507a00c, /* cmpobne 0x0, g14, LFn */ - 0x5cf01601, /* mov sp, g14 */ - 0x8c086030, /* lda 0x30(sp), sp */ - 0xb2879000, /* LFn: stq g0, (g14) */ - 0xb2a7a010, /* stq g4, 0x10(g14) */ - 0xb2c7a020 /* stq g8, 0x20(g14) */ - }; - - /* Accept a leaf procedure prologue code fragment if present. - Note that ip might point to either the leaf or non-leaf - entry point; we look for the non-leaf entry point first: */ - - within_leaf_prologue = 0; - if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2)) - && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */ - || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */ - { - within_leaf_prologue = 1; - next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2); - } - - /* Now look for the prologue code at a leaf entry point: */ - - if (next_ip - && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ - && REG_SRCDST (insn1) <= G0_REGNUM + 7) - { - within_leaf_prologue = 1; - if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2)) - && (insn1 == 0x8cf00000 /* lda 0, g14 */ - || insn1 == 0x5cf01e00)) /* mov 0, g14 */ - { - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - within_leaf_prologue = 0; - } - } - - /* If something that looks like the beginning of a leaf prologue - has been seen, but the remainder of the prologue is missing, bail. - We don't know what we've got. */ - - if (within_leaf_prologue) - return (ip); - - /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4. - This may cause us to mistake the moving of a register - parameter to a local register for the saving of a callee-saved - register, but that can't be helped, since with the - "-fcall-saved" flag, any register can be made callee-saved. */ - - while (next_ip - && (insn1 & 0xfc802fb0) == 0x5c000610 - && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) - { - src = REG_SRC1 (insn1); - size = EXTRACT_FIELD (insn1, 24, 2) + 1; - save_addr = frame_addr + ((dst - R0_REGNUM) * 4); - while (size--) - { - fsr->regs[src++] = save_addr; - save_addr += 4; - } - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - } - - /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */ - - if (next_ip && - ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */ - || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */ - || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */ - { - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - } - - /* Accept zero or more instances of "st[qtl]? gx, n(fp)". - This may cause us to mistake the copying of a register - parameter to the frame for the saving of a callee-saved - register, but that can't be helped, since with the - "-fcall-saved" flag, any register can be made callee-saved. - We can, however, refuse to accept a save of register g14, - since that is matched explicitly below. */ - - while (next_ip && - ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */ - || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */ - || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */ - || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */ - && ((src = MEM_SRCDST (insn1)) != G14_REGNUM)) - { - save_addr = frame_addr + ((insn1 & BITMASK (12, 1)) - ? insn2 : MEMA_OFFSET (insn1)); - size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3) - : ((insn1 & BITMASK (27, 1)) ? 2 : 1); - while (size--) - { - fsr->regs[src++] = save_addr; - save_addr += 4; - } - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - } - - /* Accept the varargs prologue code if present. */ - - size = sizeof (varargs_prologue_code) / sizeof (int); - pcode = varargs_prologue_code; - while (size-- && next_ip && *pcode++ == insn1) - { - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - } - - /* Accept an optional "st g14, n(fp)". */ - - if (next_ip && - ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */ - || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */ - { - fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1)) - ? insn2 : MEMA_OFFSET (insn1)); - ip = next_ip; - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); - } - - /* Accept zero or one instance of "mov g13, ry", where y >= 4. - This is saving the address where a struct should be returned. */ - - if (next_ip - && (insn1 & 0xff802fbf) == 0x5c00061d - && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) - { - save_addr = frame_addr + ((dst - R0_REGNUM) * 4); - fsr->regs[G0_REGNUM + 13] = save_addr; - ip = next_ip; -#if 0 /* We'll need this once there is a subsequent instruction examined. */ - next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -#endif - } - - return (ip); -} - -/* Given an ip value corresponding to the start of a function, - return the ip of the first instruction after the function - prologue. */ - -CORE_ADDR -i960_skip_prologue (CORE_ADDR ip) -{ - struct frame_saved_regs saved_regs_dummy; - struct symtab_and_line sal; - CORE_ADDR limit; - - sal = find_pc_line (ip, 0); - limit = (sal.end) ? sal.end : 0xffffffff; - - return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy)); -} - -/* Put here the code to store, into a struct frame_saved_regs, - the addresses of the saved registers of frame described by FRAME_INFO. - This includes special registers such as pc and fp saved in special - ways in the stack frame. sp is even more special: - the address we return for it IS the sp for the next frame. - - We cache the result of doing this in the frame_obstack, since it is - fairly expensive. */ - -void -frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr) -{ - register CORE_ADDR next_addr; - register CORE_ADDR *saved_regs; - register int regnum; - register struct frame_saved_regs *cache_fsr; - CORE_ADDR ip; - struct symtab_and_line sal; - CORE_ADDR limit; - - if (!fi->fsr) - { - cache_fsr = (struct frame_saved_regs *) - frame_obstack_alloc (sizeof (struct frame_saved_regs)); - memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); - fi->fsr = cache_fsr; - - /* Find the start and end of the function prologue. If the PC - is in the function prologue, we only consider the part that - has executed already. */ - - ip = get_pc_function_start (fi->pc); - sal = find_pc_line (ip, 0); - limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc; - - examine_prologue (ip, limit, fi->frame, cache_fsr); - - /* Record the addresses at which the local registers are saved. - Strictly speaking, we should only do this for non-leaf procedures, - but no one will ever look at these values if it is a leaf procedure, - since local registers are always caller-saved. */ - - next_addr = (CORE_ADDR) fi->frame; - saved_regs = cache_fsr->regs; - for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++) - { - *saved_regs++ = next_addr; - next_addr += 4; - } - - cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM]; - } - - *fsr = *fi->fsr; - - /* Fetch the value of the sp from memory every time, since it - is conceivable that it has changed since the cache was flushed. - This unfortunately undoes much of the savings from caching the - saved register values. I suggest adding an argument to - get_frame_saved_regs () specifying the register number we're - interested in (or -1 for all registers). This would be passed - through to FRAME_FIND_SAVED_REGS (), permitting more efficient - computation of saved register addresses (e.g., on the i960, - we don't have to examine the prologue to find local registers). - -- markf@wrs.com - FIXME, we don't need to refetch this, since the cache is cleared - every time the child process is restarted. If GDB itself - modifies SP, it has to clear the cache by hand (does it?). -gnu */ - - fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4); -} - -/* Return the address of the argument block for the frame - described by FI. Returns 0 if the address is unknown. */ - -CORE_ADDR -frame_args_address (struct frame_info *fi, int must_be_correct) -{ - struct frame_saved_regs fsr; - CORE_ADDR ap; - - /* If g14 was saved in the frame by the function prologue code, return - the saved value. If the frame is current and we are being sloppy, - return the value of g14. Otherwise, return zero. */ - - get_frame_saved_regs (fi, &fsr); - if (fsr.regs[G14_REGNUM]) - ap = read_memory_integer (fsr.regs[G14_REGNUM], 4); - else - { - if (must_be_correct) - return 0; /* Don't cache this result */ - if (get_next_frame (fi)) - ap = 0; - else - ap = read_register (G14_REGNUM); - if (ap == 0) - ap = fi->frame; - } - fi->arg_pointer = ap; /* Cache it for next time */ - return ap; -} - -/* Return the address of the return struct for the frame - described by FI. Returns 0 if the address is unknown. */ - -CORE_ADDR -frame_struct_result_address (struct frame_info *fi) -{ - struct frame_saved_regs fsr; - CORE_ADDR ap; - - /* If the frame is non-current, check to see if g14 was saved in the - frame by the function prologue code; return the saved value if so, - zero otherwise. If the frame is current, return the value of g14. - - FIXME, shouldn't this use the saved value as long as we are past - the function prologue, and only use the current value if we have - no saved value and are at TOS? -- gnu@cygnus.com */ - - if (get_next_frame (fi)) - { - get_frame_saved_regs (fi, &fsr); - if (fsr.regs[G13_REGNUM]) - ap = read_memory_integer (fsr.regs[G13_REGNUM], 4); - else - ap = 0; - } - else - ap = read_register (G13_REGNUM); - - return ap; -} - -/* Return address to which the currently executing leafproc will return, - or 0 if IP, the value of the instruction pointer from the currently - executing function, is not in a leafproc (or if we can't tell if it - is). - - Do this by finding the starting address of the routine in which IP lies. - If the instruction there is "mov g14, gx" (where x is in [0,7]), this - is a leafproc and the return address is in register gx. Well, this is - true unless the return address points at a RET instruction in the current - procedure, which indicates that we have a 'dual entry' routine that - has been entered through the CALL entry point. */ - -CORE_ADDR -leafproc_return (CORE_ADDR ip) -{ - register struct minimal_symbol *msymbol; - char *p; - int dst; - unsigned int insn1, insn2; - CORE_ADDR return_addr; - - if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL) - { - if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf")) - { - if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2) - && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ - && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7) - { - /* Get the return address. If the "mov g14, gx" - instruction hasn't been executed yet, read - the return address from g14; otherwise, read it - from the register into which g14 was moved. */ - - return_addr = - read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol)) - ? G14_REGNUM : dst); - - /* We know we are in a leaf procedure, but we don't know - whether the caller actually did a "bal" to the ".lf" - entry point, or a normal "call" to the non-leaf entry - point one instruction before. In the latter case, the - return address will be the address of a "ret" - instruction within the procedure itself. We test for - this below. */ - - if (!next_insn (return_addr, &insn1, &insn2) - || (insn1 & 0xff000000) != 0xa000000 /* ret */ - || lookup_minimal_symbol_by_pc (return_addr) != msymbol) - return (return_addr); - } - } - } - - return (0); -} - -/* Immediately after a function call, return the saved pc. - Can't go through the frames for this because on some machines - the new frame is not set up until the new function executes - some instructions. - On the i960, the frame *is* set up immediately after the call, - unless the function is a leaf procedure. */ - -CORE_ADDR -saved_pc_after_call (struct frame_info *frame) -{ - CORE_ADDR saved_pc; - - saved_pc = leafproc_return (get_frame_pc (frame)); - if (!saved_pc) - saved_pc = FRAME_SAVED_PC (frame); - - return saved_pc; -} - -/* Discard from the stack the innermost frame, - restoring all saved registers. */ - -void -i960_pop_frame (void) -{ - register struct frame_info *current_fi, *prev_fi; - register int i; - CORE_ADDR save_addr; - CORE_ADDR leaf_return_addr; - struct frame_saved_regs fsr; - char local_regs_buf[16 * 4]; - - current_fi = get_current_frame (); - - /* First, undo what the hardware does when we return. - If this is a non-leaf procedure, restore local registers from - the save area in the calling frame. Otherwise, load the return - address obtained from leafproc_return () into the rip. */ - - leaf_return_addr = leafproc_return (current_fi->pc); - if (!leaf_return_addr) - { - /* Non-leaf procedure. Restore local registers, incl IP. */ - prev_fi = get_prev_frame (current_fi); - read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf)); - write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf, - sizeof (local_regs_buf)); - - /* Restore frame pointer. */ - write_register (FP_REGNUM, prev_fi->frame); - } - else - { - /* Leaf procedure. Just restore the return address into the IP. */ - write_register (RIP_REGNUM, leaf_return_addr); - } - - /* Now restore any global regs that the current function had saved. */ - get_frame_saved_regs (current_fi, &fsr); - for (i = G0_REGNUM; i < G14_REGNUM; i++) - { - save_addr = fsr.regs[i]; - if (save_addr != 0) - write_register (i, read_memory_integer (save_addr, 4)); - } - - /* Flush the frame cache, create a frame for the new innermost frame, - and make it the current frame. */ - - flush_cached_frames (); -} - -/* Given a 960 stop code (fault or trace), return the signal which - corresponds. */ - -enum target_signal -i960_fault_to_signal (int fault) -{ - switch (fault) - { - case 0: - return TARGET_SIGNAL_BUS; /* parallel fault */ - case 1: - return TARGET_SIGNAL_UNKNOWN; - case 2: - return TARGET_SIGNAL_ILL; /* operation fault */ - case 3: - return TARGET_SIGNAL_FPE; /* arithmetic fault */ - case 4: - return TARGET_SIGNAL_FPE; /* floating point fault */ - - /* constraint fault. This appears not to distinguish between - a range constraint fault (which should be SIGFPE) and a privileged - fault (which should be SIGILL). */ - case 5: - return TARGET_SIGNAL_ILL; - - case 6: - return TARGET_SIGNAL_SEGV; /* virtual memory fault */ - - /* protection fault. This is for an out-of-range argument to - "calls". I guess it also could be SIGILL. */ - case 7: - return TARGET_SIGNAL_SEGV; - - case 8: - return TARGET_SIGNAL_BUS; /* machine fault */ - case 9: - return TARGET_SIGNAL_BUS; /* structural fault */ - case 0xa: - return TARGET_SIGNAL_ILL; /* type fault */ - case 0xb: - return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ - case 0xc: - return TARGET_SIGNAL_BUS; /* process fault */ - case 0xd: - return TARGET_SIGNAL_SEGV; /* descriptor fault */ - case 0xe: - return TARGET_SIGNAL_BUS; /* event fault */ - case 0xf: - return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ - case 0x10: - return TARGET_SIGNAL_TRAP; /* single-step trace */ - case 0x11: - return TARGET_SIGNAL_TRAP; /* branch trace */ - case 0x12: - return TARGET_SIGNAL_TRAP; /* call trace */ - case 0x13: - return TARGET_SIGNAL_TRAP; /* return trace */ - case 0x14: - return TARGET_SIGNAL_TRAP; /* pre-return trace */ - case 0x15: - return TARGET_SIGNAL_TRAP; /* supervisor call trace */ - case 0x16: - return TARGET_SIGNAL_TRAP; /* breakpoint trace */ - default: - return TARGET_SIGNAL_UNKNOWN; - } -} - -/****************************************/ -/* MEM format */ -/****************************************/ - -struct tabent -{ - char *name; - char numops; -}; - -/* Return instruction length, either 4 or 8. When NOPRINT is non-zero - (TRUE), don't output any text. (Actually, as implemented, if NOPRINT - is 0, abort() is called.) */ - -static int -mem (unsigned long memaddr, unsigned long word1, unsigned long word2, - int noprint) -{ - int i, j; - int len; - int mode; - int offset; - const char *reg1, *reg2, *reg3; - - /* This lookup table is too sparse to make it worth typing in, but not - * so large as to make a sparse array necessary. We allocate the - * table at runtime, initialize all entries to empty, and copy the - * real ones in from an initialization table. - * - * NOTE: In this table, the meaning of 'numops' is: - * 1: single operand - * 2: 2 operands, load instruction - * -2: 2 operands, store instruction - */ - static struct tabent *mem_tab = NULL; -/* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */ -#define MEM_MIN 0x80 -#define MEM_MAX 0xcf -#define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent)) - - static struct - { - int opcode; - char *name; - char numops; - } - mem_init[] = - { - 0x80, "ldob", 2, - 0x82, "stob", -2, - 0x84, "bx", 1, - 0x85, "balx", 2, - 0x86, "callx", 1, - 0x88, "ldos", 2, - 0x8a, "stos", -2, - 0x8c, "lda", 2, - 0x90, "ld", 2, - 0x92, "st", -2, - 0x98, "ldl", 2, - 0x9a, "stl", -2, - 0xa0, "ldt", 2, - 0xa2, "stt", -2, - 0xb0, "ldq", 2, - 0xb2, "stq", -2, - 0xc0, "ldib", 2, - 0xc2, "stib", -2, - 0xc8, "ldis", 2, - 0xca, "stis", -2, - 0, NULL, 0 - }; - - if (mem_tab == NULL) - { - mem_tab = (struct tabent *) xmalloc (MEM_SIZ); - memset (mem_tab, '\0', MEM_SIZ); - for (i = 0; mem_init[i].opcode != 0; i++) - { - j = mem_init[i].opcode - MEM_MIN; - mem_tab[j].name = mem_init[i].name; - mem_tab[j].numops = mem_init[i].numops; - } - } - - i = ((word1 >> 24) & 0xff) - MEM_MIN; - mode = (word1 >> 10) & 0xf; - - if ((mem_tab[i].name != NULL) /* Valid instruction */ - && ((mode == 5) || (mode >= 12))) - { /* With 32-bit displacement */ - len = 8; - } - else - { - len = 4; - } - - if (noprint) - { - return len; - } - internal_error (__FILE__, __LINE__, "failed internal consistency check"); -} - -/* Read the i960 instruction at 'memaddr' and return the address of - the next instruction after that, or 0 if 'memaddr' is not the - address of a valid instruction. The first word of the instruction - is stored at 'pword1', and the second word, if any, is stored at - 'pword2'. */ - -static CORE_ADDR -next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2) -{ - int len; - char buf[8]; - - /* Read the two (potential) words of the instruction at once, - to eliminate the overhead of two calls to read_memory (). - FIXME: Loses if the first one is readable but the second is not - (e.g. last word of the segment). */ - - read_memory (memaddr, buf, 8); - *pword1 = extract_unsigned_integer (buf, 4); - *pword2 = extract_unsigned_integer (buf + 4, 4); - - /* Divide instruction set into classes based on high 4 bits of opcode */ - - switch ((*pword1 >> 28) & 0xf) - { - case 0x0: - case 0x1: /* ctrl */ - - case 0x2: - case 0x3: /* cobr */ - - case 0x5: - case 0x6: - case 0x7: /* reg */ - len = 4; - break; - - case 0x8: - case 0x9: - case 0xa: - case 0xb: - case 0xc: - len = mem (memaddr, *pword1, *pword2, 1); - break; - - default: /* invalid instruction */ - len = 0; - break; - } - - if (len) - return memaddr + len; - else - return 0; -} - -/* 'start_frame' is a variable in the MON960 runtime startup routine - that contains the frame pointer of the 'start' routine (the routine - that calls 'main'). By reading its contents out of remote memory, - we can tell where the frame chain ends: backtraces should halt before - they display this frame. */ - -int -mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe) -{ - struct symbol *sym; - struct minimal_symbol *msymbol; - - /* crtmon960.o is an assembler module that is assumed to be linked - * first in an i80960 executable. It contains the true entry point; - * it performs startup up initialization and then calls 'main'. - * - * 'sf' is the name of a variable in crtmon960.o that is set - * during startup to the address of the first frame. - * - * 'a' is the address of that variable in 80960 memory. - */ - static char sf[] = "start_frame"; - CORE_ADDR a; - - - chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers - contain return status info in them. */ - if (chain == 0) - { - return 0; - } - - sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL, - (struct symtab **) NULL); - if (sym != 0) - { - a = SYMBOL_VALUE (sym); - } - else - { - msymbol = lookup_minimal_symbol (sf, NULL, NULL); - if (msymbol == NULL) - return 0; - a = SYMBOL_VALUE_ADDRESS (msymbol); - } - - return (chain != read_memory_integer (a, 4)); -} - - -void -_initialize_i960_tdep (void) -{ - check_host (); - - tm_print_insn = print_insn_i960; -} +// OBSOLETE /* Target-machine dependent code for the Intel 960 +// OBSOLETE +// OBSOLETE Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, +// OBSOLETE 2001, 2002 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE Contributed by Intel Corporation. +// OBSOLETE examine_prologue and other parts contributed by Wind River Systems. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "symtab.h" +// OBSOLETE #include "value.h" +// OBSOLETE #include "frame.h" +// OBSOLETE #include "floatformat.h" +// OBSOLETE #include "target.h" +// OBSOLETE #include "gdbcore.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE #include "gdb_string.h" +// OBSOLETE +// OBSOLETE static CORE_ADDR next_insn (CORE_ADDR memaddr, +// OBSOLETE unsigned int *pword1, unsigned int *pword2); +// OBSOLETE +// OBSOLETE struct type * +// OBSOLETE i960_register_type (int regnum) +// OBSOLETE { +// OBSOLETE if (regnum < FP0_REGNUM) +// OBSOLETE return builtin_type_int32; +// OBSOLETE else +// OBSOLETE return builtin_type_i960_ext; +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE /* Does the specified function use the "struct returning" convention +// OBSOLETE or the "value returning" convention? The "value returning" convention +// OBSOLETE almost invariably returns the entire value in registers. The +// OBSOLETE "struct returning" convention often returns the entire value in +// OBSOLETE memory, and passes a pointer (out of or into the function) saying +// OBSOLETE where the value (is or should go). +// OBSOLETE +// OBSOLETE Since this sometimes depends on whether it was compiled with GCC, +// OBSOLETE this is also an argument. This is used in call_function to build a +// OBSOLETE stack, and in value_being_returned to print return values. +// OBSOLETE +// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit. +// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */ +// OBSOLETE +// OBSOLETE int +// OBSOLETE i960_use_struct_convention (int gcc_p, struct type *type) +// OBSOLETE { +// OBSOLETE return (TYPE_LENGTH (type) > 16); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* gdb960 is always running on a non-960 host. Check its characteristics. +// OBSOLETE This routine must be called as part of gdb initialization. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE check_host (void) +// OBSOLETE { +// OBSOLETE int i; +// OBSOLETE +// OBSOLETE static struct typestruct +// OBSOLETE { +// OBSOLETE int hostsize; /* Size of type on host */ +// OBSOLETE int i960size; /* Size of type on i960 */ +// OBSOLETE char *typename; /* Name of type, for error msg */ +// OBSOLETE } +// OBSOLETE types[] = +// OBSOLETE { +// OBSOLETE { +// OBSOLETE sizeof (short), 2, "short" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE { +// OBSOLETE sizeof (int), 4, "int" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE { +// OBSOLETE sizeof (long), 4, "long" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE { +// OBSOLETE sizeof (float), 4, "float" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE { +// OBSOLETE sizeof (double), 8, "double" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE { +// OBSOLETE sizeof (char *), 4, "pointer" +// OBSOLETE } +// OBSOLETE , +// OBSOLETE }; +// OBSOLETE #define TYPELEN (sizeof(types) / sizeof(struct typestruct)) +// OBSOLETE +// OBSOLETE /* Make sure that host type sizes are same as i960 +// OBSOLETE */ +// OBSOLETE for (i = 0; i < TYPELEN; i++) +// OBSOLETE { +// OBSOLETE if (types[i].hostsize != types[i].i960size) +// OBSOLETE { +// OBSOLETE printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n", +// OBSOLETE types[i].typename, types[i].i960size); +// OBSOLETE } +// OBSOLETE +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Is this register part of the register window system? A yes answer +// OBSOLETE implies that 1) The name of this register will not be the same in +// OBSOLETE other frames, and 2) This register is automatically "saved" upon +// OBSOLETE subroutine calls and thus there is no need to search more than one +// OBSOLETE stack frame for it. +// OBSOLETE +// OBSOLETE On the i960, in fact, the name of this register in another frame is +// OBSOLETE "mud" -- there is no overlap between the windows. Each window is +// OBSOLETE simply saved into the stack (true for our purposes, after having been +// OBSOLETE flushed; normally they reside on-chip and are restored from on-chip +// OBSOLETE without ever going to memory). */ +// OBSOLETE +// OBSOLETE static int +// OBSOLETE register_in_window_p (int regnum) +// OBSOLETE { +// OBSOLETE return regnum <= R15_REGNUM; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* i960_find_saved_register () +// OBSOLETE +// OBSOLETE Return the address in which frame FRAME's value of register REGNUM +// OBSOLETE has been saved in memory. Or return zero if it has not been saved. +// OBSOLETE If REGNUM specifies the SP, the value we return is actually the SP +// OBSOLETE value, not an address where it was saved. */ +// OBSOLETE +// OBSOLETE static CORE_ADDR +// OBSOLETE i960_find_saved_register (struct frame_info *frame, int regnum) +// OBSOLETE { +// OBSOLETE register struct frame_info *frame1 = NULL; +// OBSOLETE register CORE_ADDR addr = 0; +// OBSOLETE +// OBSOLETE if (frame == NULL) /* No regs saved if want current frame */ +// OBSOLETE return 0; +// OBSOLETE +// OBSOLETE /* We assume that a register in a register window will only be saved +// OBSOLETE in one place (since the name changes and/or disappears as you go +// OBSOLETE towards inner frames), so we only call get_frame_saved_regs on +// OBSOLETE the current frame. This is directly in contradiction to the +// OBSOLETE usage below, which assumes that registers used in a frame must be +// OBSOLETE saved in a lower (more interior) frame. This change is a result +// OBSOLETE of working on a register window machine; get_frame_saved_regs +// OBSOLETE always returns the registers saved within a frame, within the +// OBSOLETE context (register namespace) of that frame. */ +// OBSOLETE +// OBSOLETE /* However, note that we don't want this to return anything if +// OBSOLETE nothing is saved (if there's a frame inside of this one). Also, +// OBSOLETE callers to this routine asking for the stack pointer want the +// OBSOLETE stack pointer saved for *this* frame; this is returned from the +// OBSOLETE next frame. */ +// OBSOLETE +// OBSOLETE if (register_in_window_p (regnum)) +// OBSOLETE { +// OBSOLETE frame1 = get_next_frame (frame); +// OBSOLETE if (!frame1) +// OBSOLETE return 0; /* Registers of this frame are active. */ +// OBSOLETE +// OBSOLETE /* Get the SP from the next frame in; it will be this +// OBSOLETE current frame. */ +// OBSOLETE if (regnum != SP_REGNUM) +// OBSOLETE frame1 = frame; +// OBSOLETE +// OBSOLETE FRAME_INIT_SAVED_REGS (frame1); +// OBSOLETE return frame1->saved_regs[regnum]; /* ... which might be zero */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Note that this next routine assumes that registers used in +// OBSOLETE frame x will be saved only in the frame that x calls and +// OBSOLETE frames interior to it. This is not true on the sparc, but the +// OBSOLETE above macro takes care of it, so we should be all right. */ +// OBSOLETE while (1) +// OBSOLETE { +// OBSOLETE QUIT; +// OBSOLETE frame1 = get_next_frame (frame); +// OBSOLETE if (frame1 == 0) +// OBSOLETE break; +// OBSOLETE frame = frame1; +// OBSOLETE FRAME_INIT_SAVED_REGS (frame1); +// OBSOLETE if (frame1->saved_regs[regnum]) +// OBSOLETE addr = frame1->saved_regs[regnum]; +// OBSOLETE } +// OBSOLETE +// OBSOLETE return addr; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* i960_get_saved_register () +// OBSOLETE +// OBSOLETE Find register number REGNUM relative to FRAME and put its (raw, +// OBSOLETE target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the +// OBSOLETE variable was optimized out (and thus can't be fetched). Set *LVAL +// OBSOLETE to lval_memory, lval_register, or not_lval, depending on whether +// OBSOLETE the value was fetched from memory, from a register, or in a strange +// OBSOLETE and non-modifiable way (e.g. a frame pointer which was calculated +// OBSOLETE rather than fetched). Set *ADDRP to the address, either in memory +// OBSOLETE on as a REGISTER_BYTE offset into the registers array. +// OBSOLETE +// OBSOLETE Note that this implementation never sets *LVAL to not_lval. But it +// OBSOLETE can be replaced by defining GET_SAVED_REGISTER and supplying your +// OBSOLETE own. +// OBSOLETE +// OBSOLETE The argument RAW_BUFFER must point to aligned memory. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE i960_get_saved_register (char *raw_buffer, +// OBSOLETE int *optimized, +// OBSOLETE CORE_ADDR *addrp, +// OBSOLETE struct frame_info *frame, +// OBSOLETE int regnum, +// OBSOLETE enum lval_type *lval) +// OBSOLETE { +// OBSOLETE CORE_ADDR addr; +// OBSOLETE +// OBSOLETE if (!target_has_registers) +// OBSOLETE error ("No registers."); +// OBSOLETE +// OBSOLETE /* Normal systems don't optimize out things with register numbers. */ +// OBSOLETE if (optimized != NULL) +// OBSOLETE *optimized = 0; +// OBSOLETE addr = i960_find_saved_register (frame, regnum); +// OBSOLETE if (addr != 0) +// OBSOLETE { +// OBSOLETE if (lval != NULL) +// OBSOLETE *lval = lval_memory; +// OBSOLETE if (regnum == SP_REGNUM) +// OBSOLETE { +// OBSOLETE if (raw_buffer != NULL) +// OBSOLETE { +// OBSOLETE /* Put it back in target format. */ +// OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), +// OBSOLETE (LONGEST) addr); +// OBSOLETE } +// OBSOLETE if (addrp != NULL) +// OBSOLETE *addrp = 0; +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE if (raw_buffer != NULL) +// OBSOLETE target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE if (lval != NULL) +// OBSOLETE *lval = lval_register; +// OBSOLETE addr = REGISTER_BYTE (regnum); +// OBSOLETE if (raw_buffer != NULL) +// OBSOLETE read_register_gen (regnum, raw_buffer); +// OBSOLETE } +// OBSOLETE if (addrp != NULL) +// OBSOLETE *addrp = addr; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Examine an i960 function prologue, recording the addresses at which +// OBSOLETE registers are saved explicitly by the prologue code, and returning +// OBSOLETE the address of the first instruction after the prologue (but not +// OBSOLETE after the instruction at address LIMIT, as explained below). +// OBSOLETE +// OBSOLETE LIMIT places an upper bound on addresses of the instructions to be +// OBSOLETE examined. If the prologue code scan reaches LIMIT, the scan is +// OBSOLETE aborted and LIMIT is returned. This is used, when examining the +// OBSOLETE prologue for the current frame, to keep examine_prologue () from +// OBSOLETE claiming that a given register has been saved when in fact the +// OBSOLETE instruction that saves it has not yet been executed. LIMIT is used +// OBSOLETE at other times to stop the scan when we hit code after the true +// OBSOLETE function prologue (e.g. for the first source line) which might +// OBSOLETE otherwise be mistaken for function prologue. +// OBSOLETE +// OBSOLETE The format of the function prologue matched by this routine is +// OBSOLETE derived from examination of the source to gcc960 1.21, particularly +// OBSOLETE the routine i960_function_prologue (). A "regular expression" for +// OBSOLETE the function prologue is given below: +// OBSOLETE +// OBSOLETE (lda LRn, g14 +// OBSOLETE mov g14, g[0-7] +// OBSOLETE (mov 0, g14) | (lda 0, g14))? +// OBSOLETE +// OBSOLETE (mov[qtl]? g[0-15], r[4-15])* +// OBSOLETE ((addo [1-31], sp, sp) | (lda n(sp), sp))? +// OBSOLETE (st[qtl]? g[0-15], n(fp))* +// OBSOLETE +// OBSOLETE (cmpobne 0, g14, LFn +// OBSOLETE mov sp, g14 +// OBSOLETE lda 0x30(sp), sp +// OBSOLETE LFn: stq g0, (g14) +// OBSOLETE stq g4, 0x10(g14) +// OBSOLETE stq g8, 0x20(g14))? +// OBSOLETE +// OBSOLETE (st g14, n(fp))? +// OBSOLETE (mov g13,r[4-15])? +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /* Macros for extracting fields from i960 instructions. */ +// OBSOLETE +// OBSOLETE #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos)) +// OBSOLETE #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width)) +// OBSOLETE +// OBSOLETE #define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5) +// OBSOLETE #define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5) +// OBSOLETE #define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) +// OBSOLETE #define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) +// OBSOLETE #define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12) +// OBSOLETE +// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or +// OBSOLETE is not the address of a valid instruction, the address of the next +// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word +// OBSOLETE of the instruction, and (for two-word instructions), *PWORD2 receives +// OBSOLETE the second. */ +// OBSOLETE +// OBSOLETE #define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \ +// OBSOLETE (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0) +// OBSOLETE +// OBSOLETE static CORE_ADDR +// OBSOLETE examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, +// OBSOLETE CORE_ADDR frame_addr, struct frame_saved_regs *fsr) +// OBSOLETE { +// OBSOLETE register CORE_ADDR next_ip; +// OBSOLETE register int src, dst; +// OBSOLETE register unsigned int *pcode; +// OBSOLETE unsigned int insn1, insn2; +// OBSOLETE int size; +// OBSOLETE int within_leaf_prologue; +// OBSOLETE CORE_ADDR save_addr; +// OBSOLETE static unsigned int varargs_prologue_code[] = +// OBSOLETE { +// OBSOLETE 0x3507a00c, /* cmpobne 0x0, g14, LFn */ +// OBSOLETE 0x5cf01601, /* mov sp, g14 */ +// OBSOLETE 0x8c086030, /* lda 0x30(sp), sp */ +// OBSOLETE 0xb2879000, /* LFn: stq g0, (g14) */ +// OBSOLETE 0xb2a7a010, /* stq g4, 0x10(g14) */ +// OBSOLETE 0xb2c7a020 /* stq g8, 0x20(g14) */ +// OBSOLETE }; +// OBSOLETE +// OBSOLETE /* Accept a leaf procedure prologue code fragment if present. +// OBSOLETE Note that ip might point to either the leaf or non-leaf +// OBSOLETE entry point; we look for the non-leaf entry point first: */ +// OBSOLETE +// OBSOLETE within_leaf_prologue = 0; +// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2)) +// OBSOLETE && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */ +// OBSOLETE || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */ +// OBSOLETE { +// OBSOLETE within_leaf_prologue = 1; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Now look for the prologue code at a leaf entry point: */ +// OBSOLETE +// OBSOLETE if (next_ip +// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ +// OBSOLETE && REG_SRCDST (insn1) <= G0_REGNUM + 7) +// OBSOLETE { +// OBSOLETE within_leaf_prologue = 1; +// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2)) +// OBSOLETE && (insn1 == 0x8cf00000 /* lda 0, g14 */ +// OBSOLETE || insn1 == 0x5cf01e00)) /* mov 0, g14 */ +// OBSOLETE { +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE within_leaf_prologue = 0; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* If something that looks like the beginning of a leaf prologue +// OBSOLETE has been seen, but the remainder of the prologue is missing, bail. +// OBSOLETE We don't know what we've got. */ +// OBSOLETE +// OBSOLETE if (within_leaf_prologue) +// OBSOLETE return (ip); +// OBSOLETE +// OBSOLETE /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4. +// OBSOLETE This may cause us to mistake the moving of a register +// OBSOLETE parameter to a local register for the saving of a callee-saved +// OBSOLETE register, but that can't be helped, since with the +// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved. */ +// OBSOLETE +// OBSOLETE while (next_ip +// OBSOLETE && (insn1 & 0xfc802fb0) == 0x5c000610 +// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) +// OBSOLETE { +// OBSOLETE src = REG_SRC1 (insn1); +// OBSOLETE size = EXTRACT_FIELD (insn1, 24, 2) + 1; +// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4); +// OBSOLETE while (size--) +// OBSOLETE { +// OBSOLETE fsr->regs[src++] = save_addr; +// OBSOLETE save_addr += 4; +// OBSOLETE } +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */ +// OBSOLETE +// OBSOLETE if (next_ip && +// OBSOLETE ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */ +// OBSOLETE || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */ +// OBSOLETE || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */ +// OBSOLETE { +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Accept zero or more instances of "st[qtl]? gx, n(fp)". +// OBSOLETE This may cause us to mistake the copying of a register +// OBSOLETE parameter to the frame for the saving of a callee-saved +// OBSOLETE register, but that can't be helped, since with the +// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved. +// OBSOLETE We can, however, refuse to accept a save of register g14, +// OBSOLETE since that is matched explicitly below. */ +// OBSOLETE +// OBSOLETE while (next_ip && +// OBSOLETE ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */ +// OBSOLETE || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */ +// OBSOLETE || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */ +// OBSOLETE || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */ +// OBSOLETE && ((src = MEM_SRCDST (insn1)) != G14_REGNUM)) +// OBSOLETE { +// OBSOLETE save_addr = frame_addr + ((insn1 & BITMASK (12, 1)) +// OBSOLETE ? insn2 : MEMA_OFFSET (insn1)); +// OBSOLETE size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3) +// OBSOLETE : ((insn1 & BITMASK (27, 1)) ? 2 : 1); +// OBSOLETE while (size--) +// OBSOLETE { +// OBSOLETE fsr->regs[src++] = save_addr; +// OBSOLETE save_addr += 4; +// OBSOLETE } +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Accept the varargs prologue code if present. */ +// OBSOLETE +// OBSOLETE size = sizeof (varargs_prologue_code) / sizeof (int); +// OBSOLETE pcode = varargs_prologue_code; +// OBSOLETE while (size-- && next_ip && *pcode++ == insn1) +// OBSOLETE { +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Accept an optional "st g14, n(fp)". */ +// OBSOLETE +// OBSOLETE if (next_ip && +// OBSOLETE ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */ +// OBSOLETE || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */ +// OBSOLETE { +// OBSOLETE fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1)) +// OBSOLETE ? insn2 : MEMA_OFFSET (insn1)); +// OBSOLETE ip = next_ip; +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Accept zero or one instance of "mov g13, ry", where y >= 4. +// OBSOLETE This is saving the address where a struct should be returned. */ +// OBSOLETE +// OBSOLETE if (next_ip +// OBSOLETE && (insn1 & 0xff802fbf) == 0x5c00061d +// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) +// OBSOLETE { +// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4); +// OBSOLETE fsr->regs[G0_REGNUM + 13] = save_addr; +// OBSOLETE ip = next_ip; +// OBSOLETE #if 0 /* We'll need this once there is a subsequent instruction examined. */ +// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +// OBSOLETE #endif +// OBSOLETE } +// OBSOLETE +// OBSOLETE return (ip); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Given an ip value corresponding to the start of a function, +// OBSOLETE return the ip of the first instruction after the function +// OBSOLETE prologue. */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE i960_skip_prologue (CORE_ADDR ip) +// OBSOLETE { +// OBSOLETE struct frame_saved_regs saved_regs_dummy; +// OBSOLETE struct symtab_and_line sal; +// OBSOLETE CORE_ADDR limit; +// OBSOLETE +// OBSOLETE sal = find_pc_line (ip, 0); +// OBSOLETE limit = (sal.end) ? sal.end : 0xffffffff; +// OBSOLETE +// OBSOLETE return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, +// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. +// OBSOLETE This includes special registers such as pc and fp saved in special +// OBSOLETE ways in the stack frame. sp is even more special: +// OBSOLETE the address we return for it IS the sp for the next frame. +// OBSOLETE +// OBSOLETE We cache the result of doing this in the frame_obstack, since it is +// OBSOLETE fairly expensive. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr) +// OBSOLETE { +// OBSOLETE register CORE_ADDR next_addr; +// OBSOLETE register CORE_ADDR *saved_regs; +// OBSOLETE register int regnum; +// OBSOLETE register struct frame_saved_regs *cache_fsr; +// OBSOLETE CORE_ADDR ip; +// OBSOLETE struct symtab_and_line sal; +// OBSOLETE CORE_ADDR limit; +// OBSOLETE +// OBSOLETE if (!fi->fsr) +// OBSOLETE { +// OBSOLETE cache_fsr = (struct frame_saved_regs *) +// OBSOLETE frame_obstack_alloc (sizeof (struct frame_saved_regs)); +// OBSOLETE memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); +// OBSOLETE fi->fsr = cache_fsr; +// OBSOLETE +// OBSOLETE /* Find the start and end of the function prologue. If the PC +// OBSOLETE is in the function prologue, we only consider the part that +// OBSOLETE has executed already. */ +// OBSOLETE +// OBSOLETE ip = get_pc_function_start (fi->pc); +// OBSOLETE sal = find_pc_line (ip, 0); +// OBSOLETE limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc; +// OBSOLETE +// OBSOLETE examine_prologue (ip, limit, fi->frame, cache_fsr); +// OBSOLETE +// OBSOLETE /* Record the addresses at which the local registers are saved. +// OBSOLETE Strictly speaking, we should only do this for non-leaf procedures, +// OBSOLETE but no one will ever look at these values if it is a leaf procedure, +// OBSOLETE since local registers are always caller-saved. */ +// OBSOLETE +// OBSOLETE next_addr = (CORE_ADDR) fi->frame; +// OBSOLETE saved_regs = cache_fsr->regs; +// OBSOLETE for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++) +// OBSOLETE { +// OBSOLETE *saved_regs++ = next_addr; +// OBSOLETE next_addr += 4; +// OBSOLETE } +// OBSOLETE +// OBSOLETE cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM]; +// OBSOLETE } +// OBSOLETE +// OBSOLETE *fsr = *fi->fsr; +// OBSOLETE +// OBSOLETE /* Fetch the value of the sp from memory every time, since it +// OBSOLETE is conceivable that it has changed since the cache was flushed. +// OBSOLETE This unfortunately undoes much of the savings from caching the +// OBSOLETE saved register values. I suggest adding an argument to +// OBSOLETE get_frame_saved_regs () specifying the register number we're +// OBSOLETE interested in (or -1 for all registers). This would be passed +// OBSOLETE through to FRAME_FIND_SAVED_REGS (), permitting more efficient +// OBSOLETE computation of saved register addresses (e.g., on the i960, +// OBSOLETE we don't have to examine the prologue to find local registers). +// OBSOLETE -- markf@wrs.com +// OBSOLETE FIXME, we don't need to refetch this, since the cache is cleared +// OBSOLETE every time the child process is restarted. If GDB itself +// OBSOLETE modifies SP, it has to clear the cache by hand (does it?). -gnu */ +// OBSOLETE +// OBSOLETE fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Return the address of the argument block for the frame +// OBSOLETE described by FI. Returns 0 if the address is unknown. */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE frame_args_address (struct frame_info *fi, int must_be_correct) +// OBSOLETE { +// OBSOLETE struct frame_saved_regs fsr; +// OBSOLETE CORE_ADDR ap; +// OBSOLETE +// OBSOLETE /* If g14 was saved in the frame by the function prologue code, return +// OBSOLETE the saved value. If the frame is current and we are being sloppy, +// OBSOLETE return the value of g14. Otherwise, return zero. */ +// OBSOLETE +// OBSOLETE get_frame_saved_regs (fi, &fsr); +// OBSOLETE if (fsr.regs[G14_REGNUM]) +// OBSOLETE ap = read_memory_integer (fsr.regs[G14_REGNUM], 4); +// OBSOLETE else +// OBSOLETE { +// OBSOLETE if (must_be_correct) +// OBSOLETE return 0; /* Don't cache this result */ +// OBSOLETE if (get_next_frame (fi)) +// OBSOLETE ap = 0; +// OBSOLETE else +// OBSOLETE ap = read_register (G14_REGNUM); +// OBSOLETE if (ap == 0) +// OBSOLETE ap = fi->frame; +// OBSOLETE } +// OBSOLETE fi->arg_pointer = ap; /* Cache it for next time */ +// OBSOLETE return ap; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Return the address of the return struct for the frame +// OBSOLETE described by FI. Returns 0 if the address is unknown. */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE frame_struct_result_address (struct frame_info *fi) +// OBSOLETE { +// OBSOLETE struct frame_saved_regs fsr; +// OBSOLETE CORE_ADDR ap; +// OBSOLETE +// OBSOLETE /* If the frame is non-current, check to see if g14 was saved in the +// OBSOLETE frame by the function prologue code; return the saved value if so, +// OBSOLETE zero otherwise. If the frame is current, return the value of g14. +// OBSOLETE +// OBSOLETE FIXME, shouldn't this use the saved value as long as we are past +// OBSOLETE the function prologue, and only use the current value if we have +// OBSOLETE no saved value and are at TOS? -- gnu@cygnus.com */ +// OBSOLETE +// OBSOLETE if (get_next_frame (fi)) +// OBSOLETE { +// OBSOLETE get_frame_saved_regs (fi, &fsr); +// OBSOLETE if (fsr.regs[G13_REGNUM]) +// OBSOLETE ap = read_memory_integer (fsr.regs[G13_REGNUM], 4); +// OBSOLETE else +// OBSOLETE ap = 0; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE ap = read_register (G13_REGNUM); +// OBSOLETE +// OBSOLETE return ap; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Return address to which the currently executing leafproc will return, +// OBSOLETE or 0 if IP, the value of the instruction pointer from the currently +// OBSOLETE executing function, is not in a leafproc (or if we can't tell if it +// OBSOLETE is). +// OBSOLETE +// OBSOLETE Do this by finding the starting address of the routine in which IP lies. +// OBSOLETE If the instruction there is "mov g14, gx" (where x is in [0,7]), this +// OBSOLETE is a leafproc and the return address is in register gx. Well, this is +// OBSOLETE true unless the return address points at a RET instruction in the current +// OBSOLETE procedure, which indicates that we have a 'dual entry' routine that +// OBSOLETE has been entered through the CALL entry point. */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE leafproc_return (CORE_ADDR ip) +// OBSOLETE { +// OBSOLETE register struct minimal_symbol *msymbol; +// OBSOLETE char *p; +// OBSOLETE int dst; +// OBSOLETE unsigned int insn1, insn2; +// OBSOLETE CORE_ADDR return_addr; +// OBSOLETE +// OBSOLETE if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL) +// OBSOLETE { +// OBSOLETE if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf")) +// OBSOLETE { +// OBSOLETE if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2) +// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ +// OBSOLETE && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7) +// OBSOLETE { +// OBSOLETE /* Get the return address. If the "mov g14, gx" +// OBSOLETE instruction hasn't been executed yet, read +// OBSOLETE the return address from g14; otherwise, read it +// OBSOLETE from the register into which g14 was moved. */ +// OBSOLETE +// OBSOLETE return_addr = +// OBSOLETE read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol)) +// OBSOLETE ? G14_REGNUM : dst); +// OBSOLETE +// OBSOLETE /* We know we are in a leaf procedure, but we don't know +// OBSOLETE whether the caller actually did a "bal" to the ".lf" +// OBSOLETE entry point, or a normal "call" to the non-leaf entry +// OBSOLETE point one instruction before. In the latter case, the +// OBSOLETE return address will be the address of a "ret" +// OBSOLETE instruction within the procedure itself. We test for +// OBSOLETE this below. */ +// OBSOLETE +// OBSOLETE if (!next_insn (return_addr, &insn1, &insn2) +// OBSOLETE || (insn1 & 0xff000000) != 0xa000000 /* ret */ +// OBSOLETE || lookup_minimal_symbol_by_pc (return_addr) != msymbol) +// OBSOLETE return (return_addr); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE return (0); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Immediately after a function call, return the saved pc. +// OBSOLETE Can't go through the frames for this because on some machines +// OBSOLETE the new frame is not set up until the new function executes +// OBSOLETE some instructions. +// OBSOLETE On the i960, the frame *is* set up immediately after the call, +// OBSOLETE unless the function is a leaf procedure. */ +// OBSOLETE +// OBSOLETE CORE_ADDR +// OBSOLETE saved_pc_after_call (struct frame_info *frame) +// OBSOLETE { +// OBSOLETE CORE_ADDR saved_pc; +// OBSOLETE +// OBSOLETE saved_pc = leafproc_return (get_frame_pc (frame)); +// OBSOLETE if (!saved_pc) +// OBSOLETE saved_pc = FRAME_SAVED_PC (frame); +// OBSOLETE +// OBSOLETE return saved_pc; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Discard from the stack the innermost frame, +// OBSOLETE restoring all saved registers. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE i960_pop_frame (void) +// OBSOLETE { +// OBSOLETE register struct frame_info *current_fi, *prev_fi; +// OBSOLETE register int i; +// OBSOLETE CORE_ADDR save_addr; +// OBSOLETE CORE_ADDR leaf_return_addr; +// OBSOLETE struct frame_saved_regs fsr; +// OBSOLETE char local_regs_buf[16 * 4]; +// OBSOLETE +// OBSOLETE current_fi = get_current_frame (); +// OBSOLETE +// OBSOLETE /* First, undo what the hardware does when we return. +// OBSOLETE If this is a non-leaf procedure, restore local registers from +// OBSOLETE the save area in the calling frame. Otherwise, load the return +// OBSOLETE address obtained from leafproc_return () into the rip. */ +// OBSOLETE +// OBSOLETE leaf_return_addr = leafproc_return (current_fi->pc); +// OBSOLETE if (!leaf_return_addr) +// OBSOLETE { +// OBSOLETE /* Non-leaf procedure. Restore local registers, incl IP. */ +// OBSOLETE prev_fi = get_prev_frame (current_fi); +// OBSOLETE read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf)); +// OBSOLETE write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf, +// OBSOLETE sizeof (local_regs_buf)); +// OBSOLETE +// OBSOLETE /* Restore frame pointer. */ +// OBSOLETE write_register (FP_REGNUM, prev_fi->frame); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE /* Leaf procedure. Just restore the return address into the IP. */ +// OBSOLETE write_register (RIP_REGNUM, leaf_return_addr); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Now restore any global regs that the current function had saved. */ +// OBSOLETE get_frame_saved_regs (current_fi, &fsr); +// OBSOLETE for (i = G0_REGNUM; i < G14_REGNUM; i++) +// OBSOLETE { +// OBSOLETE save_addr = fsr.regs[i]; +// OBSOLETE if (save_addr != 0) +// OBSOLETE write_register (i, read_memory_integer (save_addr, 4)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Flush the frame cache, create a frame for the new innermost frame, +// OBSOLETE and make it the current frame. */ +// OBSOLETE +// OBSOLETE flush_cached_frames (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Given a 960 stop code (fault or trace), return the signal which +// OBSOLETE corresponds. */ +// OBSOLETE +// OBSOLETE enum target_signal +// OBSOLETE i960_fault_to_signal (int fault) +// OBSOLETE { +// OBSOLETE switch (fault) +// OBSOLETE { +// OBSOLETE case 0: +// OBSOLETE return TARGET_SIGNAL_BUS; /* parallel fault */ +// OBSOLETE case 1: +// OBSOLETE return TARGET_SIGNAL_UNKNOWN; +// OBSOLETE case 2: +// OBSOLETE return TARGET_SIGNAL_ILL; /* operation fault */ +// OBSOLETE case 3: +// OBSOLETE return TARGET_SIGNAL_FPE; /* arithmetic fault */ +// OBSOLETE case 4: +// OBSOLETE return TARGET_SIGNAL_FPE; /* floating point fault */ +// OBSOLETE +// OBSOLETE /* constraint fault. This appears not to distinguish between +// OBSOLETE a range constraint fault (which should be SIGFPE) and a privileged +// OBSOLETE fault (which should be SIGILL). */ +// OBSOLETE case 5: +// OBSOLETE return TARGET_SIGNAL_ILL; +// OBSOLETE +// OBSOLETE case 6: +// OBSOLETE return TARGET_SIGNAL_SEGV; /* virtual memory fault */ +// OBSOLETE +// OBSOLETE /* protection fault. This is for an out-of-range argument to +// OBSOLETE "calls". I guess it also could be SIGILL. */ +// OBSOLETE case 7: +// OBSOLETE return TARGET_SIGNAL_SEGV; +// OBSOLETE +// OBSOLETE case 8: +// OBSOLETE return TARGET_SIGNAL_BUS; /* machine fault */ +// OBSOLETE case 9: +// OBSOLETE return TARGET_SIGNAL_BUS; /* structural fault */ +// OBSOLETE case 0xa: +// OBSOLETE return TARGET_SIGNAL_ILL; /* type fault */ +// OBSOLETE case 0xb: +// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ +// OBSOLETE case 0xc: +// OBSOLETE return TARGET_SIGNAL_BUS; /* process fault */ +// OBSOLETE case 0xd: +// OBSOLETE return TARGET_SIGNAL_SEGV; /* descriptor fault */ +// OBSOLETE case 0xe: +// OBSOLETE return TARGET_SIGNAL_BUS; /* event fault */ +// OBSOLETE case 0xf: +// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ +// OBSOLETE case 0x10: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* single-step trace */ +// OBSOLETE case 0x11: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* branch trace */ +// OBSOLETE case 0x12: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* call trace */ +// OBSOLETE case 0x13: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* return trace */ +// OBSOLETE case 0x14: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* pre-return trace */ +// OBSOLETE case 0x15: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* supervisor call trace */ +// OBSOLETE case 0x16: +// OBSOLETE return TARGET_SIGNAL_TRAP; /* breakpoint trace */ +// OBSOLETE default: +// OBSOLETE return TARGET_SIGNAL_UNKNOWN; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /****************************************/ +// OBSOLETE /* MEM format */ +// OBSOLETE /****************************************/ +// OBSOLETE +// OBSOLETE struct tabent +// OBSOLETE { +// OBSOLETE char *name; +// OBSOLETE char numops; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE /* Return instruction length, either 4 or 8. When NOPRINT is non-zero +// OBSOLETE (TRUE), don't output any text. (Actually, as implemented, if NOPRINT +// OBSOLETE is 0, abort() is called.) */ +// OBSOLETE +// OBSOLETE static int +// OBSOLETE mem (unsigned long memaddr, unsigned long word1, unsigned long word2, +// OBSOLETE int noprint) +// OBSOLETE { +// OBSOLETE int i, j; +// OBSOLETE int len; +// OBSOLETE int mode; +// OBSOLETE int offset; +// OBSOLETE const char *reg1, *reg2, *reg3; +// OBSOLETE +// OBSOLETE /* This lookup table is too sparse to make it worth typing in, but not +// OBSOLETE * so large as to make a sparse array necessary. We allocate the +// OBSOLETE * table at runtime, initialize all entries to empty, and copy the +// OBSOLETE * real ones in from an initialization table. +// OBSOLETE * +// OBSOLETE * NOTE: In this table, the meaning of 'numops' is: +// OBSOLETE * 1: single operand +// OBSOLETE * 2: 2 operands, load instruction +// OBSOLETE * -2: 2 operands, store instruction +// OBSOLETE */ +// OBSOLETE static struct tabent *mem_tab = NULL; +// OBSOLETE /* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */ +// OBSOLETE #define MEM_MIN 0x80 +// OBSOLETE #define MEM_MAX 0xcf +// OBSOLETE #define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent)) +// OBSOLETE +// OBSOLETE static struct +// OBSOLETE { +// OBSOLETE int opcode; +// OBSOLETE char *name; +// OBSOLETE char numops; +// OBSOLETE } +// OBSOLETE mem_init[] = +// OBSOLETE { +// OBSOLETE 0x80, "ldob", 2, +// OBSOLETE 0x82, "stob", -2, +// OBSOLETE 0x84, "bx", 1, +// OBSOLETE 0x85, "balx", 2, +// OBSOLETE 0x86, "callx", 1, +// OBSOLETE 0x88, "ldos", 2, +// OBSOLETE 0x8a, "stos", -2, +// OBSOLETE 0x8c, "lda", 2, +// OBSOLETE 0x90, "ld", 2, +// OBSOLETE 0x92, "st", -2, +// OBSOLETE 0x98, "ldl", 2, +// OBSOLETE 0x9a, "stl", -2, +// OBSOLETE 0xa0, "ldt", 2, +// OBSOLETE 0xa2, "stt", -2, +// OBSOLETE 0xb0, "ldq", 2, +// OBSOLETE 0xb2, "stq", -2, +// OBSOLETE 0xc0, "ldib", 2, +// OBSOLETE 0xc2, "stib", -2, +// OBSOLETE 0xc8, "ldis", 2, +// OBSOLETE 0xca, "stis", -2, +// OBSOLETE 0, NULL, 0 +// OBSOLETE }; +// OBSOLETE +// OBSOLETE if (mem_tab == NULL) +// OBSOLETE { +// OBSOLETE mem_tab = (struct tabent *) xmalloc (MEM_SIZ); +// OBSOLETE memset (mem_tab, '\0', MEM_SIZ); +// OBSOLETE for (i = 0; mem_init[i].opcode != 0; i++) +// OBSOLETE { +// OBSOLETE j = mem_init[i].opcode - MEM_MIN; +// OBSOLETE mem_tab[j].name = mem_init[i].name; +// OBSOLETE mem_tab[j].numops = mem_init[i].numops; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE i = ((word1 >> 24) & 0xff) - MEM_MIN; +// OBSOLETE mode = (word1 >> 10) & 0xf; +// OBSOLETE +// OBSOLETE if ((mem_tab[i].name != NULL) /* Valid instruction */ +// OBSOLETE && ((mode == 5) || (mode >= 12))) +// OBSOLETE { /* With 32-bit displacement */ +// OBSOLETE len = 8; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE len = 4; +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (noprint) +// OBSOLETE { +// OBSOLETE return len; +// OBSOLETE } +// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Read the i960 instruction at 'memaddr' and return the address of +// OBSOLETE the next instruction after that, or 0 if 'memaddr' is not the +// OBSOLETE address of a valid instruction. The first word of the instruction +// OBSOLETE is stored at 'pword1', and the second word, if any, is stored at +// OBSOLETE 'pword2'. */ +// OBSOLETE +// OBSOLETE static CORE_ADDR +// OBSOLETE next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2) +// OBSOLETE { +// OBSOLETE int len; +// OBSOLETE char buf[8]; +// OBSOLETE +// OBSOLETE /* Read the two (potential) words of the instruction at once, +// OBSOLETE to eliminate the overhead of two calls to read_memory (). +// OBSOLETE FIXME: Loses if the first one is readable but the second is not +// OBSOLETE (e.g. last word of the segment). */ +// OBSOLETE +// OBSOLETE read_memory (memaddr, buf, 8); +// OBSOLETE *pword1 = extract_unsigned_integer (buf, 4); +// OBSOLETE *pword2 = extract_unsigned_integer (buf + 4, 4); +// OBSOLETE +// OBSOLETE /* Divide instruction set into classes based on high 4 bits of opcode */ +// OBSOLETE +// OBSOLETE switch ((*pword1 >> 28) & 0xf) +// OBSOLETE { +// OBSOLETE case 0x0: +// OBSOLETE case 0x1: /* ctrl */ +// OBSOLETE +// OBSOLETE case 0x2: +// OBSOLETE case 0x3: /* cobr */ +// OBSOLETE +// OBSOLETE case 0x5: +// OBSOLETE case 0x6: +// OBSOLETE case 0x7: /* reg */ +// OBSOLETE len = 4; +// OBSOLETE break; +// OBSOLETE +// OBSOLETE case 0x8: +// OBSOLETE case 0x9: +// OBSOLETE case 0xa: +// OBSOLETE case 0xb: +// OBSOLETE case 0xc: +// OBSOLETE len = mem (memaddr, *pword1, *pword2, 1); +// OBSOLETE break; +// OBSOLETE +// OBSOLETE default: /* invalid instruction */ +// OBSOLETE len = 0; +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (len) +// OBSOLETE return memaddr + len; +// OBSOLETE else +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* 'start_frame' is a variable in the MON960 runtime startup routine +// OBSOLETE that contains the frame pointer of the 'start' routine (the routine +// OBSOLETE that calls 'main'). By reading its contents out of remote memory, +// OBSOLETE we can tell where the frame chain ends: backtraces should halt before +// OBSOLETE they display this frame. */ +// OBSOLETE +// OBSOLETE int +// OBSOLETE mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe) +// OBSOLETE { +// OBSOLETE struct symbol *sym; +// OBSOLETE struct minimal_symbol *msymbol; +// OBSOLETE +// OBSOLETE /* crtmon960.o is an assembler module that is assumed to be linked +// OBSOLETE * first in an i80960 executable. It contains the true entry point; +// OBSOLETE * it performs startup up initialization and then calls 'main'. +// OBSOLETE * +// OBSOLETE * 'sf' is the name of a variable in crtmon960.o that is set +// OBSOLETE * during startup to the address of the first frame. +// OBSOLETE * +// OBSOLETE * 'a' is the address of that variable in 80960 memory. +// OBSOLETE */ +// OBSOLETE static char sf[] = "start_frame"; +// OBSOLETE CORE_ADDR a; +// OBSOLETE +// OBSOLETE +// OBSOLETE chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers +// OBSOLETE contain return status info in them. */ +// OBSOLETE if (chain == 0) +// OBSOLETE { +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE +// OBSOLETE sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL, +// OBSOLETE (struct symtab **) NULL); +// OBSOLETE if (sym != 0) +// OBSOLETE { +// OBSOLETE a = SYMBOL_VALUE (sym); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE msymbol = lookup_minimal_symbol (sf, NULL, NULL); +// OBSOLETE if (msymbol == NULL) +// OBSOLETE return 0; +// OBSOLETE a = SYMBOL_VALUE_ADDRESS (msymbol); +// OBSOLETE } +// OBSOLETE +// OBSOLETE return (chain != read_memory_integer (a, 4)); +// OBSOLETE } +// OBSOLETE +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_i960_tdep (void) +// OBSOLETE { +// OBSOLETE check_host (); +// OBSOLETE +// OBSOLETE tm_print_insn = print_insn_i960; +// OBSOLETE } diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 89009de0ce9..18741944a5a 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -101,7 +101,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct static gdbarch_use_struct_convention_ftype ia64_use_struct_convention; static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation; static gdbarch_init_extra_frame_info_ftype ia64_init_extra_frame_info; -static gdbarch_store_return_value_ftype ia64_store_return_value; 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; @@ -2193,7 +2192,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value); set_gdbarch_store_struct_return (gdbarch, ia64_store_struct_return); - set_gdbarch_store_return_value (gdbarch, ia64_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, ia64_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address); set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 83267ad9ab2..433332555e8 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1549,32 +1549,48 @@ path_command (char *dirname, int from_tty) #ifdef REGISTER_NAMES char *gdb_register_names[] = REGISTER_NAMES; #endif -/* Print out the machine register regnum. If regnum is -1, - print all registers (fpregs == 1) or all non-float registers - (fpregs == 0). +/* Print out the machine register regnum. If regnum is -1, print all + registers (print_all == 1) or all non-float and non-vector + registers (print_all == 0). For most machines, having all_registers_info() print the - register(s) one per line is good enough. If a different format - is required, (eg, for MIPS or Pyramid 90x, which both have - lots of regs), or there is an existing convention for showing - all the registers, define the macro DO_REGISTERS_INFO(regnum, fp) - to provide that format. */ + register(s) one per line is good enough. If a different format is + required, (eg, for MIPS or Pyramid 90x, which both have lots of + regs), or there is an existing convention for showing all the + registers, define the architecture method PRINT_REGISTERS_INFO to + provide that format. */ void -do_registers_info (int regnum, int fpregs) +default_print_registers_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame, + int regnum, int print_all) { - register int i; - int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE); + int i; + const int numregs = NUM_REGS + NUM_PSEUDO_REGS; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE); + + /* FIXME: cagney/2002-03-08: This should be deprecated. */ + if (DO_REGISTERS_INFO_P ()) + { + DO_REGISTERS_INFO (regnum, print_all); + return; + } for (i = 0; i < numregs; i++) { - /* Decide between printing all regs, nonfloat regs, or specific reg. */ + /* Decide between printing all regs, non-float / vector regs, or + specific reg. */ if (regnum == -1) { - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs) - continue; + if (!print_all) + { + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) + continue; + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i))) + continue; + } } else { @@ -1587,16 +1603,19 @@ do_registers_info (int regnum, int fpregs) if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0') continue; - fputs_filtered (REGISTER_NAME (i), gdb_stdout); - print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout); + fputs_filtered (REGISTER_NAME (i), file); + print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file); /* Get the data in raw format. */ - if (! frame_register_read (selected_frame, i, raw_buffer)) + if (! frame_register_read (frame, i, raw_buffer)) { - printf_filtered ("*value not available*\n"); + fprintf_filtered (file, "*value not available*\n"); continue; } + /* FIXME: cagney/2002-08-03: This code shouldn't be necessary. + The function frame_register_read() should have returned the + pre-cooked register so no conversion is necessary. */ /* Convert raw data to virtual format if necessary. */ if (REGISTER_CONVERTIBLE (i)) { @@ -1609,31 +1628,40 @@ do_registers_info (int regnum, int fpregs) REGISTER_VIRTUAL_SIZE (i)); } - /* If virtual format is floating, print it that way, and in raw hex. */ + /* If virtual format is floating, print it that way, and in raw + hex. */ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) { - register int j; + int j; val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 0, 1, 0, Val_pretty_default); + file, 0, 1, 0, Val_pretty_default); - printf_filtered ("\t(raw 0x"); + fprintf_filtered (file, "\t(raw 0x"); for (j = 0; j < REGISTER_RAW_SIZE (i); j++) { - register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j - : REGISTER_RAW_SIZE (i) - 1 - j; - printf_filtered ("%02x", (unsigned char) raw_buffer[idx]); + int idx; + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + idx = j; + else + idx = REGISTER_RAW_SIZE (i) - 1 - j; + fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]); } - printf_filtered (")"); + fprintf_filtered (file, ")"); } - /* Else print as integer in hex and in decimal. */ else { + /* Print the register in hex. */ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 'x', 1, 0, Val_pretty_default); - printf_filtered ("\t"); - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 0, 1, 0, Val_pretty_default); + /* If not a vector register, print it also according to its + natural format. */ + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0) + { + printf_filtered ("\t"); + val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + gdb_stdout, 0, 1, 0, Val_pretty_default); + } } /* The SPARC wants to print even-numbered float regs as doubles @@ -1642,7 +1670,7 @@ do_registers_info (int regnum, int fpregs) PRINT_REGISTER_HOOK (i); #endif - printf_filtered ("\n"); + fprintf_filtered (file, "\n"); } } @@ -1659,7 +1687,8 @@ registers_info (char *addr_exp, int fpregs) if (!addr_exp) { - DO_REGISTERS_INFO (-1, fpregs); + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, + selected_frame, -1, fpregs); return; } @@ -1684,7 +1713,8 @@ registers_info (char *addr_exp, int fpregs) error ("%.*s: invalid register", (int) (end - addr_exp), addr_exp); found: - DO_REGISTERS_INFO (regnum, fpregs); + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, + selected_frame, regnum, fpregs); addr_exp = end; while (*addr_exp == ' ' || *addr_exp == '\t') @@ -1704,6 +1734,41 @@ nofp_registers_info (char *addr_exp, int from_tty) { registers_info (addr_exp, 0); } + +static void +print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame, const char *args) +{ + if (gdbarch_print_vector_info_p (gdbarch)) + gdbarch_print_vector_info (gdbarch, file, frame, args); + else + { + int regnum; + int printed_something = 0; + + if (!target_has_registers) + error ("The program has no registers now."); + if (selected_frame == NULL) + error ("No selected frame."); + + for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) + { + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (regnum))) + { + printed_something = 1; + gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1); + } + } + if (!printed_something) + fprintf_filtered (file, "No vector information\n"); + } +} + +static void +vector_info (char *args, int from_tty) +{ + print_vector_info (current_gdbarch, gdb_stdout, selected_frame, args); +} /* @@ -1845,9 +1910,46 @@ interrupt_target_command (char *args, int from_tty) /* ARGSUSED */ static void -float_info (char *addr_exp, int from_tty) +print_float_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame, const char *args) +{ + if (gdbarch_print_float_info_p (gdbarch)) + gdbarch_print_float_info (gdbarch, file, frame, args); + else + { +#ifdef FLOAT_INFO +#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL +#error "FLOAT_INFO defined in multi-arch" +#endif + FLOAT_INFO; +#else + int regnum; + int printed_something = 0; + + if (!target_has_registers) + error ("The program has no registers now."); + if (selected_frame == NULL) + error ("No selected frame."); + + for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) + { + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) + { + printed_something = 1; + gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1); + } + } + if (!printed_something) + fprintf_filtered (file, "\ +No floating-point info available for this processor.\n"); +#endif + } +} + +static void +float_info (char *args, int from_tty) { - gdbarch_print_float_info (current_gdbarch, gdb_stdout, selected_frame); + print_float_info (current_gdbarch, gdb_stdout, selected_frame, args); } /* ARGSUSED */ @@ -2042,6 +2144,9 @@ Register name as argument means describe only that register."); add_info ("float", float_info, "Print the status of the floating point unit\n"); + add_info ("vector", vector_info, + "Print the status of the vector unit\n"); + inferior_environ = make_environ (); init_environ (inferior_environ); } diff --git a/gdb/inferior.h b/gdb/inferior.h index 716daf93ac1..8035ccd9825 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -152,6 +152,8 @@ extern void kill_inferior (void); extern void generic_mourn_inferior (void); +extern void terminal_save_ours (void); + extern void terminal_ours (void); extern int run_stack_dummy (CORE_ADDR , struct regcache *); @@ -205,7 +207,10 @@ extern void resume (int, enum target_signal); /* From misc files */ -extern void do_registers_info (int, int); +extern void default_print_registers_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame, + int regnum, int all); extern void store_inferior_registers (int); diff --git a/gdb/inflow.c b/gdb/inflow.c index 526acdfdc7e..b37fc541c91 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -200,6 +200,23 @@ terminal_init_inferior_with_pgrp (int pgrp) } } +/* Save the terminal settings again. This is necessary for the TUI + when it switches to TUI or non-TUI mode; curses changes the terminal + and gdb must be able to restore it correctly. */ + +void +terminal_save_ours () +{ + if (gdb_has_a_terminal ()) + { + /* We could just as well copy our_ttystate (if we felt like adding + a new function serial_copy_tty_state). */ + if (our_ttystate) + xfree (our_ttystate); + our_ttystate = serial_get_tty_state (stdin_serial); + } +} + void terminal_init_inferior (void) { diff --git a/gdb/infrun.c b/gdb/infrun.c index 672d5f93c65..b6c23425459 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -173,13 +173,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC; #define SKIP_SOLIB_RESOLVER(pc) 0 #endif -/* In some shared library schemes, the return path from a shared library - call may need to go through a trampoline too. */ - -#ifndef IN_SOLIB_RETURN_TRAMPOLINE -#define IN_SOLIB_RETURN_TRAMPOLINE(pc,name) 0 -#endif - /* This function returns TRUE if pc is the address of an instruction that lies within the dynamic linker (such as the event hook, or the dld itself). @@ -997,16 +990,9 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) trap_expected = 1; else { - int temp = insert_breakpoints (); - if (temp) - { - print_sys_errmsg ("insert_breakpoints", temp); - error ("Cannot insert breakpoints.\n\ -The same program may be running in another process,\n\ -or you may have requested too many hardware\n\ -breakpoints and/or watchpoints.\n"); - } - + insert_breakpoints (); + /* If we get here there was no call to error() in + insert breakpoints -- so they were inserted. */ breakpoints_inserted = 1; } @@ -1408,6 +1394,7 @@ handle_inferior_event (struct execution_control_state *ecs) { CORE_ADDR tmp; int stepped_after_stopped_by_watchpoint; + int sw_single_step_trap_p = 0; /* Cache the last pid/waitstatus. */ target_last_wait_ptid = ecs->ptid; @@ -1826,10 +1813,11 @@ handle_inferior_event (struct execution_control_state *ecs) if (stop_signal == TARGET_SIGNAL_TRAP) { - if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) - ecs->random_signal = 0; - else if (breakpoints_inserted - && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK)) + /* Check if a regular breakpoint has been hit before checking + for a potential single step breakpoint. Otherwise, GDB will + not see this breakpoint hit when stepping onto breakpoints. */ + if (breakpoints_inserted + && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK)) { ecs->random_signal = 0; if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK, @@ -1885,6 +1873,22 @@ handle_inferior_event (struct execution_control_state *ecs) } } } + else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) + { + /* Readjust the stop_pc as it is off by DECR_PC_AFTER_BREAK + compared to the value it would have if the system stepping + capability was used. This allows the rest of the code in + this function to use this address without having to worry + whether software single step is in use or not. */ + if (DECR_PC_AFTER_BREAK) + { + stop_pc -= DECR_PC_AFTER_BREAK; + write_pc_pid (stop_pc, ecs->ptid); + } + + sw_single_step_trap_p = 1; + ecs->random_signal = 0; + } } else ecs->random_signal = 1; @@ -2099,22 +2103,23 @@ handle_inferior_event (struct execution_control_state *ecs) This is only important on targets where DECR_PC_AFTER_BREAK is non-zero. The prev_pc test is meant to distinguish between singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - /* Pass TRUE if our reason for stopping is something other - than hitting a breakpoint. We do this by checking that - 1) stepping is going on and 2) we didn't hit a breakpoint - in a signal handler without an intervening stop in - sigtramp, which is detected by a new stack pointer value - below any usual function calling stack adjustments. */ - (currently_stepping (ecs) - && prev_pc != - stop_pc - DECR_PC_AFTER_BREAK - && !(step_range_end - && INNER_THAN (read_sp (), - (step_sp - - 16))))); + jump to the instruction following a trap instruction. + + Therefore, pass TRUE if our reason for stopping is + something other than hitting a breakpoint. We do this by + checking that either: we detected earlier a software single + step trap or, 1) stepping is going on and 2) we didn't hit + a breakpoint in a signal handler without an intervening stop + in sigtramp, which is detected by a new stack pointer value + below any usual function calling stack adjustments. */ + stop_bpstat = + bpstat_stop_status + (&stop_pc, + sw_single_step_trap_p + || (currently_stepping (ecs) + && prev_pc != stop_pc - DECR_PC_AFTER_BREAK + && !(step_range_end + && INNER_THAN (read_sp (), (step_sp - 16))))); /* Following in case break condition called a function. */ stop_print_frame = 1; @@ -3367,16 +3372,6 @@ normal_stop (void) if (target_has_execution && get_current_frame ()) (get_current_frame ())->pc = read_pc (); - if (breakpoints_failed) - { - target_terminal_ours_for_output (); - print_sys_errmsg ("While inserting breakpoints", breakpoints_failed); - printf_filtered ("Stopped; cannot insert breakpoints.\n\ -The same program may be running in another process,\n\ -or you may have requested too many hardware breakpoints\n\ -and/or watchpoints.\n"); - } - if (target_has_execution && breakpoints_inserted) { if (remove_breakpoints ()) diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 9035310c494..e49681192fe 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -774,6 +774,7 @@ init_child_ops (void) child_ops.to_terminal_init = terminal_init_inferior; child_ops.to_terminal_inferior = terminal_inferior; child_ops.to_terminal_ours_for_output = terminal_ours_for_output; + child_ops.to_terminal_save_ours = terminal_save_ours; child_ops.to_terminal_ours = terminal_ours; child_ops.to_terminal_info = child_terminal_info; child_ops.to_kill = kill_inferior; diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index b98ec5ab521..d5b5c0c1c4d 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -56,8 +56,7 @@ supply_gregset (gregset_t *gregsetp) register int regi; register greg_t *regp = &(*gregsetp)[0]; int gregoff = sizeof (greg_t) - MIPS_REGSIZE; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + static char zerobuf[32] = {0}; for (regi = 0; regi <= CTX_RA; regi++) supply_register (regi, (char *) (regp + regi) + gregoff); @@ -120,8 +119,7 @@ void supply_fpregset (fpregset_t *fpregsetp) { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + static char zerobuf[32] = {0}; /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index f0fd0f5ea25..1ddfcb576c6 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -30,6 +30,7 @@ #include "jv-lang.h" #include "c-lang.h" #include "annotate.h" +#include "gdb_string.h" /* Local functions */ diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index cb5b19f3148..cd577fbe3a0 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -21,6 +21,7 @@ #include "defs.h" #include "gdb_assert.h" +#include "gdb_string.h" #include #include #include diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index c66df986689..f76def3a3a2 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -198,10 +198,12 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid, return note_data; } -struct linux_corefile_thread_data { - bfd *obfd; +struct linux_corefile_thread_data +{ + bfd *obfd; char *note_data; - int *note_size; + int *note_size; + int num_notes; }; /* Function: linux_corefile_thread_callback @@ -224,6 +226,7 @@ linux_corefile_thread_callback (struct thread_info *ti, void *data) ti->ptid, args->note_data, args->note_size); + args->num_notes++; inferior_ptid = saved_ptid; registers_changed (); target_fetch_registers (-1); /* FIXME should not be necessary; @@ -271,11 +274,12 @@ linux_make_note_section (bfd *obfd, int *note_size) thread_args.obfd = obfd; thread_args.note_data = note_data; thread_args.note_size = note_size; + thread_args.num_notes = 0; iterate_over_threads (linux_corefile_thread_callback, &thread_args); - if (thread_args.note_data == note_data) + if (thread_args.num_notes == 0) { /* iterate_over_threads didn't come up with any threads; - just use inferior_ptid. */ + just use inferior_ptid. */ note_data = linux_do_thread_registers (obfd, inferior_ptid, note_data, note_size); } diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index c29101b9c36..28e62a87f76 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -4474,6 +4474,7 @@ init_m3_ops (void) m3_ops.to_terminal_init = terminal_init_inferior; m3_ops.to_terminal_inferior = terminal_inferior; m3_ops.to_terminal_ours_for_output = terminal_ours_for_output; + m3_ops.to_terminal_save_ours = terminal_save_ours; m3_ops.to_terminal_ours = terminal_ours; m3_ops.to_terminal_info = child_terminal_info; m3_ops.to_kill = m3_kill_inferior; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index c4389145e79..aa1a226754f 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for Motorola 68HC11 & 68HC12 Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - Contributed by Stephane Carrez, stcarrez@worldnet.fr + Contributed by Stephane Carrez, stcarrez@nerim.fr This file is part of GDB. @@ -36,7 +36,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "target.h" #include "opcode/m68hc11.h" +#include "elf/m68hc11.h" +#include "elf-bfd.h" + +/* Macros for setting and testing a bit in a minimal symbol. + For 68HC11/68HC12 we have two flags that tell which return + type the function is using. This is used for prologue and frame + analysis to compute correct stack frame layout. + + The MSB of the minimal symbol's "info" field is used for this purpose. + This field is already being used to store the symbol size, so the + assumption is that the symbol size cannot exceed 2^30. + + MSYMBOL_SET_RTC Actually sets the "RTC" bit. + MSYMBOL_SET_RTI Actually sets the "RTI" bit. + MSYMBOL_IS_RTC Tests the "RTC" bit in a minimal symbol. + MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. + MSYMBOL_SIZE Returns the size of the minimal symbol, + i.e. the "info" field with the "special" bit + masked out. */ + +#define MSYMBOL_SET_RTC(msym) \ + MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \ + | 0x80000000) + +#define MSYMBOL_SET_RTI(msym) \ + MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \ + | 0x40000000) + +#define MSYMBOL_IS_RTC(msym) \ + (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0) + +#define MSYMBOL_IS_RTI(msym) \ + (((long) MSYMBOL_INFO (msym) & 0x40000000) != 0) + +#define MSYMBOL_SIZE(msym) \ + ((long) MSYMBOL_INFO (msym) & 0x3fffffff) + +enum insn_return_kind { + RETURN_RTS, + RETURN_RTC, + RETURN_RTI +}; + /* Register numbers of various important registers. Note that some of these values are "real" register numbers, and correspond to the general registers of the machine, @@ -53,7 +96,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define HARD_A_REGNUM 5 #define HARD_B_REGNUM 6 #define HARD_CCR_REGNUM 7 -#define M68HC11_LAST_HARD_REG (HARD_CCR_REGNUM) + +/* 68HC12 page number register. + Note: to keep a compatibility with gcc register naming, we must + not have to rename FP and other soft registers. The page register + is a real hard register and must therefore be counted by NUM_REGS. + For this it has the same number as Z register (which is not used). */ +#define HARD_PAGE_REGNUM 8 +#define M68HC11_LAST_HARD_REG (HARD_PAGE_REGNUM) /* Z is replaced by X or Y by gcc during machine reorg. ??? There is no way to get it and even know whether @@ -78,6 +128,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define M68HC11_REG_SIZE (2) +#define M68HC12_NUM_REGS (9) +#define M68HC12_NUM_PSEUDO_REGS ((M68HC11_MAX_SOFT_REGS+5)+1-1) +#define M68HC12_HARD_PC_REGNUM (SOFT_D32_REGNUM+1) + struct insn_sequence; struct gdbarch_tdep { @@ -89,18 +143,25 @@ struct gdbarch_tdep /* Description of instructions in the prologue. */ struct insn_sequence *prologue; + + /* True if the page memory bank register is available + and must be used. */ + int use_page_register; + + /* ELF flags for ABI. */ + int elf_flags; }; #define M6811_TDEP gdbarch_tdep (current_gdbarch) #define STACK_CORRECTION (M6811_TDEP->stack_correction) +#define USE_PAGE_REGISTER (M6811_TDEP->use_page_register) struct frame_extra_info { - int frame_reg; CORE_ADDR return_pc; - CORE_ADDR dummy; int frameless; int size; + enum insn_return_kind return_kind; }; /* Table of registers for 68HC11. This includes the hard registers @@ -109,7 +170,7 @@ static char * m68hc11_register_names[] = { "x", "d", "y", "sp", "pc", "a", "b", - "ccr", "z", "frame","tmp", "zs", "xy", 0, + "ccr", "page", "frame","tmp", "zs", "xy", 0, "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", "d16", "d17", "d18", "d19", "d20", "d21", @@ -223,6 +284,24 @@ m68hc11_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int regno, void *buf) { + /* The PC is a pseudo reg only for 68HC12 with the memory bank + addressing mode. */ + if (regno == M68HC12_HARD_PC_REGNUM) + { + const int regsize = TYPE_LENGTH (builtin_type_uint32); + CORE_ADDR pc = read_register (HARD_PC_REGNUM); + int page = read_register (HARD_PAGE_REGNUM); + + if (pc >= 0x8000 && pc < 0xc000) + { + pc -= 0x8000; + pc += (page << 14); + pc += 0x1000000; + } + store_unsigned_integer (buf, regsize, pc); + return; + } + m68hc11_initialize_register_info (); /* Fetch a soft register: translate into a memory read. */ @@ -243,6 +322,28 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int regno, const void *buf) { + /* The PC is a pseudo reg only for 68HC12 with the memory bank + addressing mode. */ + if (regno == M68HC12_HARD_PC_REGNUM) + { + const int regsize = TYPE_LENGTH (builtin_type_uint32); + char *tmp = alloca (regsize); + CORE_ADDR pc; + + memcpy (tmp, buf, regsize); + pc = extract_unsigned_integer (tmp, regsize); + if (pc >= 0x1000000) + { + pc -= 0x1000000; + write_register (HARD_PAGE_REGNUM, (pc >> 14) & 0x0ff); + pc &= 0x03fff; + write_register (HARD_PC_REGNUM, pc + 0x8000); + } + else + write_register (HARD_PC_REGNUM, pc); + return; + } + m68hc11_initialize_register_info (); /* Store a soft register: translate into a memory write. */ @@ -258,6 +359,11 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch, static const char * m68hc11_register_name (int reg_nr) { + if (reg_nr == M68HC12_HARD_PC_REGNUM && USE_PAGE_REGISTER) + return "pc"; + if (reg_nr == HARD_PC_REGNUM && USE_PAGE_REGISTER) + return "ppc"; + if (reg_nr < 0) return NULL; if (reg_nr >= M68HC11_ALL_REGS) @@ -301,7 +407,15 @@ m68hc11_frame_saved_pc (struct frame_info *frame) static CORE_ADDR m68hc11_frame_args_address (struct frame_info *frame) { - return frame->frame + frame->extra_info->size + STACK_CORRECTION + 2; + CORE_ADDR addr; + + addr = frame->frame + frame->extra_info->size + STACK_CORRECTION + 2; + if (frame->extra_info->return_kind == RETURN_RTC) + addr += 1; + else if (frame->extra_info->return_kind == RETURN_RTI) + addr += 7; + + return addr; } static CORE_ADDR @@ -364,6 +478,8 @@ m68hc11_pop_frame (void) #define M6812_PB_PSHW (0xae) #define M6812_OP_STS (0x7f) #define M6812_OP_LEAS (0x1b) +#define M6812_OP_PSHX (0x34) +#define M6812_OP_PSHY (0x35) /* Operand extraction. */ #define OP_DIRECT (0x100) /* 8-byte direct addressing. */ @@ -423,6 +539,8 @@ static struct insn_sequence m6812_prologue[] = { OP_IMM_HIGH, OP_IMM_LOW } }, { P_SET_FRAME, 3, { M6812_OP_STS, OP_IMM_HIGH, OP_IMM_LOW } }, { P_LOCAL_N, 2, { M6812_OP_LEAS, OP_PBYTE } }, + { P_LOCAL_2, 1, { M6812_OP_PSHX } }, + { P_LOCAL_2, 1, { M6812_OP_PSHY } }, { P_LAST, 0 } }; @@ -512,6 +630,28 @@ m68hc11_analyze_instruction (struct insn_sequence *seq, CORE_ADDR *pc, return 0; } +/* Return the instruction that the function at the PC is using. */ +static enum insn_return_kind +m68hc11_get_return_insn (CORE_ADDR pc) +{ + struct minimal_symbol *sym; + + /* A flag indicating that this is a STO_M68HC12_FAR or STO_M68HC12_INTERRUPT + function is stored by elfread.c in the high bit of the info field. + Use this to decide which instruction the function uses to return. */ + sym = lookup_minimal_symbol_by_pc (pc); + if (sym == 0) + return RETURN_RTS; + + if (MSYMBOL_IS_RTC (sym)) + return RETURN_RTC; + else if (MSYMBOL_IS_RTI (sym)) + return RETURN_RTI; + else + return RETURN_RTS; +} + + /* Analyze the function prologue to find some information about the function: - the PC of the first line (for m68hc11_skip_prologue) @@ -686,11 +826,6 @@ m68hc11_frame_chain (struct frame_info *frame) addr = frame->frame + frame->extra_info->size + STACK_CORRECTION - 2; addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF; - if (addr == 0) - { - return (CORE_ADDR) 0; - } - return addr; } @@ -704,19 +839,35 @@ m68hc11_frame_init_saved_regs (struct frame_info *fi) { CORE_ADDR pc; CORE_ADDR addr; - + if (fi->saved_regs == NULL) frame_saved_regs_zalloc (fi); else memset (fi->saved_regs, 0, sizeof (fi->saved_regs)); pc = fi->pc; + fi->extra_info->return_kind = m68hc11_get_return_insn (pc); m68hc11_guess_from_prologue (pc, fi->frame, &pc, &fi->extra_info->size, fi->saved_regs); addr = fi->frame + fi->extra_info->size + STACK_CORRECTION; if (soft_regs[SOFT_FP_REGNUM].name) fi->saved_regs[SOFT_FP_REGNUM] = addr - 2; + + /* Take into account how the function was called/returns. */ + if (fi->extra_info->return_kind == RETURN_RTC) + { + fi->saved_regs[HARD_PAGE_REGNUM] = addr; + addr++; + } + else if (fi->extra_info->return_kind == RETURN_RTI) + { + fi->saved_regs[HARD_CCR_REGNUM] = addr; + fi->saved_regs[HARD_D_REGNUM] = addr + 1; + fi->saved_regs[HARD_X_REGNUM] = addr + 3; + fi->saved_regs[HARD_Y_REGNUM] = addr + 5; + addr += 7; + } fi->saved_regs[HARD_SP_REGNUM] = addr; fi->saved_regs[HARD_PC_REGNUM] = fi->saved_regs[HARD_SP_REGNUM]; } @@ -736,20 +887,27 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fromleaf) { + fi->extra_info->return_kind = m68hc11_get_return_insn (fi->pc); fi->extra_info->return_pc = m68hc11_saved_pc_after_call (fi); } else { - addr = fi->frame + fi->extra_info->size + STACK_CORRECTION; + addr = fi->saved_regs[HARD_PC_REGNUM]; addr = read_memory_unsigned_integer (addr, 2) & 0x0ffff; + + /* Take into account the 68HC12 specific call (PC + page). */ + if (fi->extra_info->return_kind == RETURN_RTC + && addr >= 0x08000 && addr < 0x0c000 + && USE_PAGE_REGISTER) + { + CORE_ADDR page_addr = fi->saved_regs[HARD_PAGE_REGNUM]; + + unsigned page = read_memory_unsigned_integer (page_addr, 1); + addr -= 0x08000; + addr += ((page & 0x0ff) << 14); + addr += 0x1000000; + } fi->extra_info->return_pc = addr; -#if 0 - printf ("Pc@0x%04x, FR 0x%04x, size %d, read ret @0x%04x -> 0x%04x\n", - fi->pc, - fi->frame, fi->size, - addr & 0x0ffff, - fi->return_pc); -#endif } } @@ -775,11 +933,18 @@ show_regs (char *args, int from_tty) ccr & M6811_V_BIT ? 'V' : '-', ccr & M6811_C_BIT ? 'C' : '-'); - printf_filtered ("D=%04x IX=%04x IY=%04x\n", + printf_filtered ("D=%04x IX=%04x IY=%04x", (int) read_register (HARD_D_REGNUM), (int) read_register (HARD_X_REGNUM), (int) read_register (HARD_Y_REGNUM)); + if (USE_PAGE_REGISTER) + { + printf_filtered (" Page=%02x", + (int) read_register (HARD_PAGE_REGNUM)); + } + printf_filtered ("\n"); + nr = 0; for (i = SOFT_D1_REGNUM; i < M68HC11_ALL_REGS; i++) { @@ -887,7 +1052,20 @@ m68hc11_call_dummy_address (void) static struct type * m68hc11_register_virtual_type (int reg_nr) { - return builtin_type_uint16; + switch (reg_nr) + { + case HARD_PAGE_REGNUM: + case HARD_A_REGNUM: + case HARD_B_REGNUM: + case HARD_CCR_REGNUM: + return builtin_type_uint8; + + case M68HC12_HARD_PC_REGNUM: + return builtin_type_uint32; + + default: + return builtin_type_uint16; + } } static void @@ -1010,7 +1188,35 @@ m68hc11_register_byte (int reg_nr) static int m68hc11_register_raw_size (int reg_nr) { - return M68HC11_REG_SIZE; + switch (reg_nr) + { + case HARD_PAGE_REGNUM: + case HARD_A_REGNUM: + case HARD_B_REGNUM: + case HARD_CCR_REGNUM: + return 1; + + case M68HC12_HARD_PC_REGNUM: + return 4; + + default: + return M68HC11_REG_SIZE; + } +} + +/* Test whether the ELF symbol corresponds to a function using rtc or + rti to return. */ + +static void +m68hc11_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) +{ + unsigned char flags; + + flags = ((elf_symbol_type *)sym)->internal_elf_sym.st_other; + if (flags & STO_M68HC12_FAR) + MSYMBOL_SET_RTC (msym); + if (flags & STO_M68HC12_INTERRUPT) + MSYMBOL_SET_RTI (msym); } static int @@ -1030,31 +1236,58 @@ m68hc11_gdbarch_init (struct gdbarch_info info, {0}; struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; + int elf_flags; soft_reg_initialized = 0; - + + /* Extract the elf_flags if available. */ + if (info.abfd != NULL + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) + elf_flags = elf_elfheader (info.abfd)->e_flags; + else + elf_flags = 0; + /* try to find a pre-existing architecture */ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) { + if (gdbarch_tdep (arches->gdbarch)->elf_flags != elf_flags) + continue; + return arches->gdbarch; } /* Need a new architecture. Fill in a target specific vector. */ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); + tdep->elf_flags = elf_flags; switch (info.bfd_arch_info->arch) { case bfd_arch_m68hc11: tdep->stack_correction = 1; + tdep->use_page_register = 0; tdep->prologue = m6811_prologue; + set_gdbarch_addr_bit (gdbarch, 16); + set_gdbarch_num_pseudo_regs (gdbarch, M68HC11_NUM_PSEUDO_REGS); + set_gdbarch_pc_regnum (gdbarch, HARD_PC_REGNUM); + set_gdbarch_num_regs (gdbarch, M68HC11_NUM_REGS); break; case bfd_arch_m68hc12: tdep->stack_correction = 0; + tdep->use_page_register = elf_flags & E_M68HC12_BANKS; tdep->prologue = m6812_prologue; + set_gdbarch_addr_bit (gdbarch, elf_flags & E_M68HC12_BANKS ? 32 : 16); + set_gdbarch_num_pseudo_regs (gdbarch, + elf_flags & E_M68HC12_BANKS + ? M68HC12_NUM_PSEUDO_REGS + : M68HC11_NUM_PSEUDO_REGS); + set_gdbarch_pc_regnum (gdbarch, elf_flags & E_M68HC12_BANKS + ? M68HC12_HARD_PC_REGNUM : HARD_PC_REGNUM); + set_gdbarch_num_regs (gdbarch, elf_flags & E_M68HC12_BANKS + ? M68HC12_NUM_REGS : M68HC11_NUM_REGS); break; default: @@ -1066,10 +1299,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info, programs. The size of these types should normally be set according to the dwarf2 debug information. */ set_gdbarch_short_bit (gdbarch, 16); - set_gdbarch_int_bit (gdbarch, 16); + set_gdbarch_int_bit (gdbarch, elf_flags & E_M68HC11_I32 ? 32 : 16); set_gdbarch_float_bit (gdbarch, 32); - set_gdbarch_double_bit (gdbarch, 64); - set_gdbarch_long_double_bit (gdbarch, 64); + set_gdbarch_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32); + set_gdbarch_long_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32); set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_ptr_bit (gdbarch, 16); set_gdbarch_long_long_bit (gdbarch, 64); @@ -1090,11 +1323,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_read_sp (gdbarch, generic_target_read_sp); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); - set_gdbarch_num_regs (gdbarch, M68HC11_NUM_REGS); - set_gdbarch_num_pseudo_regs (gdbarch, M68HC11_NUM_PSEUDO_REGS); set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM); set_gdbarch_fp_regnum (gdbarch, SOFT_FP_REGNUM); - set_gdbarch_pc_regnum (gdbarch, HARD_PC_REGNUM); set_gdbarch_register_name (gdbarch, m68hc11_register_name); set_gdbarch_register_size (gdbarch, 2); set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2); @@ -1124,7 +1354,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return); - set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value); + 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); @@ -1141,7 +1371,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register); set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return); - set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value); + 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_use_struct_convention (gdbarch, m68hc11_use_struct_convention); @@ -1155,6 +1385,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_stack_align (gdbarch, m68hc11_stack_align); set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11); + /* Minsymbol frobbing. */ + set_gdbarch_elf_make_msymbol_special (gdbarch, + m68hc11_elf_make_msymbol_special); + set_gdbarch_believe_pcc_promotion (gdbarch, 1); return gdbarch; diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index b00b0ee3c94..31e8e660dc8 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1015,7 +1015,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_store_struct_return (gdbarch, m68k_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, m68k_deprecated_extract_return_value); - set_gdbarch_store_return_value (gdbarch, m68k_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, m68k_store_return_value); set_gdbarch_frame_chain (gdbarch, m68k_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid); diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index d4cb61b1a0f..a53aaa00c92 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -1131,7 +1131,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid); set_gdbarch_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs); set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc); - set_gdbarch_store_return_value (gdbarch, mcore_store_return_value); + 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); diff --git a/gdb/memattr.c b/gdb/memattr.c index aaaaba7903a..05ad413cc0a 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -235,7 +235,6 @@ mem_info_command (char *args, int from_tty) for (m = mem_region_chain; m; m = m->next) { - CORE_ADDR hi; char *tmp; printf_filtered ("%-3d %-3c\t", m->number, @@ -246,13 +245,22 @@ mem_info_command (char *args, int from_tty) tmp = local_hex_string_custom ((unsigned long) m->lo, "016l"); printf_filtered ("%s ", tmp); - hi = (m->hi == 0 ? ~0 : m->hi); if (TARGET_ADDR_BIT <= 32) - tmp = local_hex_string_custom ((unsigned long) hi, "08l"); + { + if (m->hi == 0) + tmp = "0x100000000"; + else + tmp = local_hex_string_custom ((unsigned long) m->hi, "08l"); + } else - tmp = local_hex_string_custom ((unsigned long) hi, "016l"); - + { + if (m->hi == 0) + tmp = "0x10000000000000000"; + else + tmp = local_hex_string_custom ((unsigned long) m->hi, "016l"); + } + printf_filtered ("%s ", tmp); /* Print a token for each attribute. diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 3706e2d8673..b8d41db2e3b 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -56,8 +56,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; /* Figure out where the longjmp will land. We expect the first arg to be a pointer to the jmp_buf structure from - which we extract the pc (JB_PC) that we will land at. The pc is copied - into PC. This routine returns 1 on success. */ + which we extract the pc (MIPS_LINUX_JB_PC) that we will land at. The pc + is copied into PC. This routine returns 1 on success. */ int mips_linux_get_longjmp_target (CORE_ADDR *pc) @@ -67,8 +67,9 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc) jb_addr = read_register (A0_REGNUM); - if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, - TARGET_PTR_BIT / TARGET_CHAR_BIT)) + if (target_read_memory (jb_addr + + MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE, + buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); @@ -83,7 +84,9 @@ supply_gregset (elf_gregset_t *gregsetp) { int regi; elf_greg_t *regp = *gregsetp; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + + memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); for (regi = EF_REG0; regi <= EF_REG31; regi++) supply_register ((regi - EF_REG0), (char *)(regp + regi)); @@ -172,7 +175,9 @@ void supply_fpregset (elf_fpregset_t *fpregsetp) { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + + memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index b12395d4909..58e1a8b128d 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -138,7 +138,6 @@ struct gdbarch_tdep int mips_last_fp_arg_regnum; int mips_default_saved_regsize; int mips_fp_register_double; - int mips_regs_have_home_p; int mips_default_stack_argsize; int gdb_target_is_mips64; int default_mask_address_p; @@ -174,6 +173,97 @@ mips_saved_regsize (void) return 4; } +/* Functions for setting and testing a bit in a minimal symbol that + marks it as 16-bit function. The MSB of the minimal symbol's + "info" field is used for this purpose. This field is already + being used to store the symbol size, so the assumption is + that the symbol size cannot exceed 2^31. + + ELF_MAKE_MSYMBOL_SPECIAL tests whether an ELF symbol is "special", + i.e. refers to a 16-bit function, and sets a "special" bit in a + minimal symbol to mark it as a 16-bit function + + MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol + MSYMBOL_SIZE returns the size of the minimal symbol, i.e. + the "info" field with the "special" bit masked out */ + +static void +mips_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) +{ + if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16) + { + MSYMBOL_INFO (msym) = (char *) + (((long) MSYMBOL_INFO (msym)) | 0x80000000); + SYMBOL_VALUE_ADDRESS (msym) |= 1; + } +} + +static int +msymbol_is_special (struct minimal_symbol *msym) +{ + return (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0); +} + +static long +msymbol_size (struct minimal_symbol *msym) +{ + return ((long) MSYMBOL_INFO (msym) & 0x7fffffff); +} + +/* XFER a value from the big/little/left end of the register. + Depending on the size of the value it might occupy the entire + register or just part of it. Make an allowance for this, aligning + things accordingly. */ + +static void +mips_xfer_register (struct regcache *regcache, int reg_num, int length, + enum bfd_endian endian, bfd_byte *in, const bfd_byte *out, + int buf_offset) +{ + bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + int reg_offset = 0; + /* Need to transfer the left or right part of the register, based on + the targets byte order. */ + switch (endian) + { + case BFD_ENDIAN_BIG: + reg_offset = REGISTER_RAW_SIZE (reg_num) - length; + break; + case BFD_ENDIAN_LITTLE: + reg_offset = 0; + break; + case BFD_ENDIAN_UNKNOWN: /* Indicates no alignment. */ + reg_offset = 0; + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + if (mips_debug) + fprintf_unfiltered (gdb_stderr, + "xfer $%d, reg offset %d, buf offset %d, length %d, ", + reg_num, reg_offset, buf_offset, length); + if (mips_debug && out != NULL) + { + int i; + fprintf_unfiltered (gdb_stdlog, "out "); + for (i = 0; i < length; i++) + fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]); + } + if (in != NULL) + regcache_raw_read_part (regcache, reg_num, reg_offset, length, in + buf_offset); + if (out != NULL) + regcache_raw_write_part (regcache, reg_num, reg_offset, length, out + buf_offset); + if (mips_debug && in != NULL) + { + int i; + fprintf_unfiltered (gdb_stdlog, "in "); + for (i = 0; i < length; i++) + fprintf_unfiltered (gdb_stdlog, "%02x", in[buf_offset + i]); + } + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, "\n"); +} + /* Determine if a MIPS3 or later cpu is operating in MIPS{1,2} FPU compatiblity mode. A return value of 1 means that we have physical 64-bit registers, but should treat them as 32-bit registers. */ @@ -206,11 +296,6 @@ mips2_fp_compat (void) MIPS_FPU_TYPE. */ #define FP_REGISTER_DOUBLE (gdbarch_tdep (current_gdbarch)->mips_fp_register_double) -/* Does the caller allocate a ``home'' for each register used in the - function call? The N32 ABI and MIPS_EABI do not, the others do. */ - -#define MIPS_REGS_HAVE_HOME_P (gdbarch_tdep (current_gdbarch)->mips_regs_have_home_p) - /* The amount of space reserved on the stack for registers. This is different to MIPS_SAVED_REGSIZE as it determines the alignment of data allocated after the registers have run out. */ @@ -249,7 +334,7 @@ static CORE_ADDR heuristic_proc_start (CORE_ADDR); static CORE_ADDR read_next_frame_reg (struct frame_info *, int); -int mips_set_processor_type (char *); +static int mips_set_processor_type (char *); static void mips_show_processor_type_command (char *, int); @@ -285,7 +370,7 @@ static struct cmd_list_element *showmipscmdlist = NULL; char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES; char **mips_processor_reg_names = mips_generic_reg_names; -const char * +static const char * mips_register_name (int i) { return mips_processor_reg_names[i]; @@ -428,7 +513,7 @@ mips_print_extra_frame_info (struct frame_info *fi) static int mips64_transfers_32bit_regs_p = 0; -int +static int mips_register_raw_size (int reg_nr) { if (mips64_transfers_32bit_regs_p) @@ -445,7 +530,7 @@ mips_register_raw_size (int reg_nr) /* Convert between RAW and VIRTUAL registers. The RAW register size defines the remote-gdb packet. */ -int +static int mips_register_convertible (int reg_nr) { if (mips64_transfers_32bit_regs_p) @@ -454,7 +539,7 @@ mips_register_convertible (int reg_nr) return (REGISTER_RAW_SIZE (reg_nr) > REGISTER_VIRTUAL_SIZE (reg_nr)); } -void +static void mips_register_convert_to_virtual (int n, struct type *virtual_type, char *raw_buf, char *virt_buf) { @@ -468,7 +553,7 @@ mips_register_convert_to_virtual (int n, struct type *virtual_type, TYPE_LENGTH (virtual_type)); } -void +static void mips_register_convert_to_raw (struct type *virtual_type, int n, char *virt_buf, char *raw_buf) { @@ -483,6 +568,38 @@ mips_register_convert_to_raw (struct type *virtual_type, int n, TYPE_LENGTH (virtual_type)); } +void +mips_register_convert_to_type (int regnum, struct type *type, char *buffer) +{ + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && REGISTER_RAW_SIZE (regnum) == 4 + && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32 + && TYPE_CODE(type) == TYPE_CODE_FLT + && TYPE_LENGTH(type) == 8) + { + char temp[4]; + memcpy (temp, ((char *)(buffer))+4, 4); + memcpy (((char *)(buffer))+4, (buffer), 4); + memcpy (((char *)(buffer)), temp, 4); + } +} + +void +mips_register_convert_from_type (int regnum, struct type *type, char *buffer) +{ +if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && REGISTER_RAW_SIZE (regnum) == 4 + && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32 + && TYPE_CODE(type) == TYPE_CODE_FLT + && TYPE_LENGTH(type) == 8) + { + char temp[4]; + memcpy (temp, ((char *)(buffer))+4, 4); + memcpy (((char *)(buffer))+4, (buffer), 4); + memcpy (((char *)(buffer)), temp, 4); + } +} + /* Return the GDB type object for the "standard" data type of data in register REG. @@ -519,6 +636,14 @@ mips_register_virtual_type (int reg) } } +/* TARGET_READ_SP -- Remove useless bits from the stack pointer. */ + +static CORE_ADDR +mips_read_sp (void) +{ + return ADDR_BITS_REMOVE (read_register (SP_REGNUM)); +} + /* Should the upper word of 64-bit addresses be zeroed? */ enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO; @@ -565,19 +690,19 @@ show_mask_address (char *cmd, int from_tty, struct cmd_list_element *c) /* Should call_function allocate stack space for a struct return? */ -int +static int mips_eabi_use_struct_convention (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE); } -int +static int mips_n32n64_use_struct_convention (int gcc_p, struct type *type) { - return 1; /* Structures are returned by ref in extra arg0. */ + return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE); } -int +static int mips_o32_use_struct_convention (int gcc_p, struct type *type) { return 1; /* Structures are returned by ref in extra arg0. */ @@ -605,7 +730,7 @@ mips_n32n64_reg_struct_has_addr (int gcc_p, struct type *type) return 0; /* Assumption: N32/N64 never passes struct by ref. */ } -int +static int mips_o32_reg_struct_has_addr (int gcc_p, struct type *type) { return 0; /* Assumption: O32/O64 never passes struct by ref. */ @@ -627,7 +752,7 @@ pc_is_mips16 (bfd_vma memaddr) MIPS16 or normal MIPS. */ sym = lookup_minimal_symbol_by_pc (memaddr); if (sym) - return MSYMBOL_IS_SPECIAL (sym); + return msymbol_is_special (sym); else return 0; } @@ -795,7 +920,7 @@ mips32_relative_offset (unsigned long inst) /* Determine whate to set a single step breakpoint while considering branch prediction */ -CORE_ADDR +static CORE_ADDR mips32_next_pc (CORE_ADDR pc) { unsigned long inst; @@ -1234,7 +1359,7 @@ extended_mips16_next_pc (CORE_ADDR pc, return pc; } -CORE_ADDR +static CORE_ADDR mips16_next_pc (CORE_ADDR pc) { unsigned int insn = fetch_mips_16 (pc); @@ -1256,7 +1381,15 @@ mips_next_pc (CORE_ADDR pc) } /* Guaranteed to set fci->saved_regs to some values (it never leaves it - NULL). */ + NULL). + + Note: kevinb/2002-08-09: The only caller of this function is (and + should remain) mips_frame_init_saved_regs(). In fact, + aside from calling mips_find_saved_regs(), mips_frame_init_saved_regs() + does nothing more than set frame->saved_regs[SP_REGNUM]. These two + functions should really be combined and now that there is only one + caller, it should be straightforward. (Watch out for multiple returns + though.) */ static void mips_find_saved_regs (struct frame_info *fci) @@ -1465,7 +1598,7 @@ read_next_frame_reg (struct frame_info *fi, int regno) else { if (fi->saved_regs == NULL) - mips_find_saved_regs (fi); + FRAME_INIT_SAVED_REGS (fi); if (fi->saved_regs[regno]) return read_memory_integer (ADDR_BITS_REMOVE (fi->saved_regs[regno]), MIPS_SAVED_REGSIZE); } @@ -1548,12 +1681,12 @@ mips_init_frame_pc_first (int fromleaf, struct frame_info *prev) pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) : prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); - tmp = mips_skip_stub (pc); + tmp = SKIP_TRAMPOLINE_CODE (pc); prev->pc = tmp ? tmp : pc; } -CORE_ADDR +static CORE_ADDR mips_frame_saved_pc (struct frame_info *frame) { CORE_ADDR saved_pc; @@ -2263,9 +2396,9 @@ get_frame_pointer (struct frame_info *frame, PROC_FRAME_ADJUST (proc_desc)); } -mips_extra_func_info_t cached_proc_desc; +static mips_extra_func_info_t cached_proc_desc; -CORE_ADDR +static CORE_ADDR mips_frame_chain (struct frame_info *frame) { mips_extra_func_info_t proc_desc; @@ -2277,7 +2410,7 @@ mips_frame_chain (struct frame_info *frame) /* Check if the PC is inside a call stub. If it is, fetch the PC of the caller of that stub. */ - if ((tmp = mips_skip_stub (saved_pc)) != 0) + if ((tmp = SKIP_TRAMPOLINE_CODE (saved_pc)) != 0) saved_pc = tmp; /* Look up the procedure descriptor for this PC. */ @@ -2292,15 +2425,17 @@ mips_frame_chain (struct frame_info *frame) we loop forever if we see a zero size frame. */ if (PROC_FRAME_REG (proc_desc) == SP_REGNUM && PROC_FRAME_OFFSET (proc_desc) == 0 - /* The previous frame from a sigtramp frame might be frameless - and have frame size zero. */ - && !frame->signal_handler_caller) + /* The previous frame from a sigtramp frame might be frameless + and have frame size zero. */ + && !frame->signal_handler_caller + /* Check if this is a call dummy frame. */ + && frame->pc != CALL_DUMMY_ADDRESS ()) return 0; else return get_frame_pointer (frame, proc_desc); } -void +static void mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) { int regnum; @@ -2342,6 +2477,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); fci->saved_regs[PC_REGNUM] = fci->saved_regs[RA_REGNUM]; + /* Set value of previous frame's stack pointer. Remember that + saved_regs[SP_REGNUM] is special in that it contains the + value of the stack pointer register. The other saved_regs + values are addresses (in the inferior) at which a given + register's value may be found. */ + fci->saved_regs[SP_REGNUM] = fci->frame; } } @@ -2429,58 +2570,59 @@ mips_type_needs_double_align (struct type *type) return 0; } -CORE_ADDR -mips_push_arguments (int nargs, - struct value **args, - CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr) +/* Macros to round N up or down to the next A boundary; + A must be a power of two. */ + +#define ROUND_DOWN(n,a) ((n) & ~((a)-1)) +#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1)) + +static CORE_ADDR +mips_eabi_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + int struct_return, + CORE_ADDR struct_addr) { int argreg; int float_argreg; int argnum; int len = 0; int stack_offset = 0; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - /* Macros to round N up or down to the next A boundary; A must be - a power of two. */ -#define ROUND_DOWN(n,a) ((n) & ~((a)-1)) -#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1)) /* First ensure that the stack and structure return address (if any) - are properly aligned. The stack has to be at least 64-bit aligned - even on 32-bit machines, because doubles must be 64-bit aligned. - On at least one MIPS variant, stack frames need to be 128-bit - aligned, so we round to this widest known alignment. */ + are properly aligned. The stack has to be at least 64-bit + aligned even on 32-bit machines, because doubles must be 64-bit + aligned. For n32 and n64, stack frames need to be 128-bit + aligned, so we round to this widest known alignment. */ + sp = ROUND_DOWN (sp, 16); struct_addr = ROUND_DOWN (struct_addr, 16); - /* Now make space on the stack for the args. We allocate more + /* Now make space on the stack for the args. We allocate more than necessary for EABI, because the first few arguments are - passed in registers, but that's OK. */ + passed in registers, but that's OK. */ for (argnum = 0; argnum < nargs; argnum++) - len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), MIPS_STACK_ARGSIZE); + len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), + MIPS_STACK_ARGSIZE); sp -= ROUND_UP (len, 16); if (mips_debug) - fprintf_unfiltered (gdb_stdlog, "mips_push_arguments: sp=0x%lx allocated %d\n", - (long) sp, ROUND_UP (len, 16)); + fprintf_unfiltered (gdb_stdlog, + "mips_eabi_push_arguments: sp=0x%s allocated %d\n", + paddr_nz (sp), ROUND_UP (len, 16)); /* Initialize the integer and float register pointers. */ argreg = A0_REGNUM; float_argreg = FPA0_REGNUM; - /* the struct_return pointer occupies the first parameter-passing reg */ + /* The struct_return pointer occupies the first parameter-passing reg. */ if (struct_return) { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_push_arguments: struct_return reg=%d 0x%lx\n", - argreg, (long) struct_addr); + "mips_eabi_push_arguments: struct_return reg=%d 0x%s\n", + argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); - if (MIPS_REGS_HAVE_HOME_P) - stack_offset += MIPS_STACK_ARGSIZE; } /* Now load as many as possible of the first arguments into @@ -2489,7 +2631,7 @@ mips_push_arguments (int nargs, for (argnum = 0; argnum < nargs; argnum++) { char *val; - char valbuf[MAX_REGISTER_RAW_SIZE]; + char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); struct value *arg = args[argnum]; struct type *arg_type = check_typedef (VALUE_TYPE (arg)); int len = TYPE_LENGTH (arg_type); @@ -2497,13 +2639,12 @@ mips_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_push_arguments: %d len=%d type=%d", + "mips_eabi_push_arguments: %d len=%d type=%d", argnum + 1, len, (int) typecode); /* The EABI passes structures that do not fit in a register by - reference. In all other cases, pass the structure by value. */ - if (MIPS_EABI - && len > MIPS_SAVED_REGSIZE + reference. */ + if (len > MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) { store_address (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg)); @@ -2519,8 +2660,8 @@ mips_push_arguments (int nargs, /* 32-bit ABIs always start floating point arguments in an even-numbered floating point register. Round the FP register up before the check to see if there are any FP registers - left. Non MIPS_EABI targets also pass the FP in the integer - registers so also round up normal registers. */ + left. Non MIPS_EABI targets also pass the FP in the integer + registers so also round up normal registers. */ if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type)) { @@ -2539,7 +2680,7 @@ mips_push_arguments (int nargs, because those registers are normally skipped. */ /* MIPS_EABI squeezes a struct that contains a single floating point value into an FP register instead of pushing it onto the - stack. */ + stack. */ if (fp_register_arg_p (typecode, arg_type) && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) { @@ -2554,13 +2695,6 @@ mips_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, 4)); write_register (float_argreg++, regval); - if (!MIPS_EABI) - { - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", - argreg, phex (regval, 4)); - write_register (argreg++, regval); - } /* Write the high word of the double to the odd register(s). */ regval = extract_unsigned_integer (val + 4 - low_offset, 4); @@ -2568,42 +2702,217 @@ mips_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, 4)); write_register (float_argreg++, regval); - if (!MIPS_EABI) - { - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", - argreg, phex (regval, 4)); - write_register (argreg++, regval); - } - } else { /* This is a floating point value that fits entirely in a single register. */ /* On 32 bit ABI's the float_argreg is further adjusted - above to ensure that it is even register aligned. */ + above to ensure that it is even register aligned. */ LONGEST regval = extract_unsigned_integer (val, len); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, len)); write_register (float_argreg++, regval); - if (!MIPS_EABI) + } + } + else + { + /* Copy the argument to general registers or the stack in + register-sized pieces. Large arguments are split between + registers and stack. */ + /* Note: structs whose size is not a multiple of MIPS_REGSIZE + are treated specially: Irix cc passes them in registers + where gcc sometimes puts them on the stack. For maximum + compatibility, we will put them in both places. */ + int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) && + (len % MIPS_SAVED_REGSIZE != 0)); + + /* Note: Floating-point values that didn't fit into an FP + register are only written to memory. */ + while (len > 0) + { + /* Remember if the argument was written to the stack. */ + int stack_used_p = 0; + int partial_len = + len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE; + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " -- partial=%d", + partial_len); + + /* Write this portion of the argument to the stack. */ + if (argreg > MIPS_LAST_ARG_REGNUM + || odd_sized_struct + || fp_register_arg_p (typecode, arg_type)) + { + /* Should shorter than int integer values be + promoted to int before being stored? */ + int longword_offset = 0; + CORE_ADDR addr; + stack_used_p = 1; + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + if (MIPS_STACK_ARGSIZE == 8 && + (typecode == TYPE_CODE_INT || + typecode == TYPE_CODE_PTR || + typecode == TYPE_CODE_FLT) && len <= 4) + longword_offset = MIPS_STACK_ARGSIZE - len; + else if ((typecode == TYPE_CODE_STRUCT || + typecode == TYPE_CODE_UNION) && + TYPE_LENGTH (arg_type) < MIPS_STACK_ARGSIZE) + longword_offset = MIPS_STACK_ARGSIZE - len; + } + + if (mips_debug) + { + fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s", + paddr_nz (stack_offset)); + fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s", + paddr_nz (longword_offset)); + } + + addr = sp + stack_offset + longword_offset; + + if (mips_debug) + { + int i; + fprintf_unfiltered (gdb_stdlog, " @0x%s ", + paddr_nz (addr)); + for (i = 0; i < partial_len; i++) + { + fprintf_unfiltered (gdb_stdlog, "%02x", + val[i] & 0xff); + } + } + write_memory (addr, val, partial_len); + } + + /* Note!!! This is NOT an else clause. Odd sized + structs may go thru BOTH paths. Floating point + arguments will not. */ + /* Write this portion of the argument to a general + purpose register. */ + if (argreg <= MIPS_LAST_ARG_REGNUM + && !fp_register_arg_p (typecode, arg_type)) { - /* CAGNEY: 32 bit MIPS ABI's always reserve two FP - registers for each argument. The below is (my - guess) to ensure that the corresponding integer - register has reserved the same space. */ + LONGEST regval = extract_unsigned_integer (val, partial_len); + if (mips_debug) - fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", - argreg, phex (regval, len)); + fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", + argreg, + phex (regval, MIPS_SAVED_REGSIZE)); write_register (argreg, regval); - argreg += FP_REGISTER_DOUBLE ? 1 : 2; + argreg++; } + + len -= partial_len; + val += partial_len; + + /* Compute the the offset into the stack at which we + will copy the next parameter. + + In the new EABI (and the NABI32), the stack_offset + only needs to be adjusted when it has been used. */ + + if (stack_used_p) + stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE); } - /* Reserve space for the FP register. */ - if (MIPS_REGS_HAVE_HOME_P) - stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE); + } + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, "\n"); + } + + /* Return adjusted stack pointer. */ + return sp; +} + +/* N32/N64 version of push_arguments. */ + +static CORE_ADDR +mips_n32n64_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + int struct_return, + CORE_ADDR struct_addr) +{ + int argreg; + int float_argreg; + int argnum; + int len = 0; + int stack_offset = 0; + + /* First ensure that the stack and structure return address (if any) + are properly aligned. The stack has to be at least 64-bit + aligned even on 32-bit machines, because doubles must be 64-bit + aligned. For n32 and n64, stack frames need to be 128-bit + aligned, so we round to this widest known alignment. */ + + sp = ROUND_DOWN (sp, 16); + struct_addr = ROUND_DOWN (struct_addr, 16); + + /* Now make space on the stack for the args. */ + for (argnum = 0; argnum < nargs; argnum++) + len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), + MIPS_STACK_ARGSIZE); + sp -= ROUND_UP (len, 16); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_n32n64_push_arguments: sp=0x%s allocated %d\n", + paddr_nz (sp), ROUND_UP (len, 16)); + + /* Initialize the integer and float register pointers. */ + argreg = A0_REGNUM; + float_argreg = FPA0_REGNUM; + + /* The struct_return pointer occupies the first parameter-passing reg. */ + if (struct_return) + { + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_n32n64_push_arguments: struct_return reg=%d 0x%s\n", + argreg, paddr_nz (struct_addr)); + write_register (argreg++, struct_addr); + } + + /* Now load as many as possible of the first arguments into + registers, and push the rest onto the stack. Loop thru args + from first to last. */ + for (argnum = 0; argnum < nargs; argnum++) + { + char *val; + char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + struct value *arg = args[argnum]; + struct type *arg_type = check_typedef (VALUE_TYPE (arg)); + int len = TYPE_LENGTH (arg_type); + enum type_code typecode = TYPE_CODE (arg_type); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_n32n64_push_arguments: %d len=%d type=%d", + argnum + 1, len, (int) typecode); + + val = (char *) VALUE_CONTENTS (arg); + + if (fp_register_arg_p (typecode, arg_type) + && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) + { + /* This is a floating point value that fits entirely + in a single register. */ + /* On 32 bit ABI's the float_argreg is further adjusted + above to ensure that it is even register aligned. */ + LONGEST regval = extract_unsigned_integer (val, len); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, len)); + write_register (float_argreg++, regval); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, len)); + write_register (argreg, regval); + argreg += 1; } else { @@ -2616,21 +2925,14 @@ mips_push_arguments (int nargs, compatibility, we will put them in both places. */ int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) && (len % MIPS_SAVED_REGSIZE != 0)); - /* Structures should be aligned to eight bytes (even arg registers) - on MIPS_ABI_O32 if their first member has double precision. */ - if (tdep->mips_abi == MIPS_ABI_O32 - && mips_type_needs_double_align (arg_type)) - { - if ((argreg & 1)) - argreg++; - } /* Note: Floating-point values that didn't fit into an FP - register are only written to memory. */ + register are only written to memory. */ while (len > 0) { - /* Rememer if the argument was written to the stack. */ + /* Rememer if the argument was written to the stack. */ int stack_used_p = 0; - int partial_len = len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE; + int partial_len = len < MIPS_SAVED_REGSIZE ? + len : MIPS_SAVED_REGSIZE; if (mips_debug) fprintf_unfiltered (gdb_stdlog, " -- partial=%d", @@ -2661,10 +2963,10 @@ mips_push_arguments (int nargs, if (mips_debug) { - fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%lx", - (long) stack_offset); - fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%lx", - (long) longword_offset); + fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s", + paddr_nz (stack_offset)); + fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s", + paddr_nz (longword_offset)); } addr = sp + stack_offset + longword_offset; @@ -2672,10 +2974,12 @@ mips_push_arguments (int nargs, if (mips_debug) { int i; - fprintf_unfiltered (gdb_stdlog, " @0x%lx ", (long) addr); + fprintf_unfiltered (gdb_stdlog, " @0x%s ", + paddr_nz (addr)); for (i = 0; i < partial_len; i++) { - fprintf_unfiltered (gdb_stdlog, "%02x", val[i] & 0xff); + fprintf_unfiltered (gdb_stdlog, "%02x", + val[i] & 0xff); } } write_memory (addr, val, partial_len); @@ -2683,9 +2987,9 @@ mips_push_arguments (int nargs, /* Note!!! This is NOT an else clause. Odd sized structs may go thru BOTH paths. Floating point - arguments will not. */ + arguments will not. */ /* Write this portion of the argument to a general - purpose register. */ + purpose register. */ if (argreg <= MIPS_LAST_ARG_REGNUM && !fp_register_arg_p (typecode, arg_type)) { @@ -2700,9 +3004,6 @@ mips_push_arguments (int nargs, It does not seem to be necessary to do the same for integral types. - Also don't do this adjustment on EABI and O64 - binaries. - cagney/2001-07-23: gdb/179: Also, GCC, when outputting LE O32 with sizeof (struct) < MIPS_SAVED_REGSIZE, generates a left shift as @@ -2716,9 +3017,7 @@ mips_push_arguments (int nargs, left shift OR this new ABI gets identified as such and GDB gets tweaked accordingly. */ - if (!MIPS_EABI - && MIPS_SAVED_REGSIZE < 8 - && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && partial_len < MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) @@ -2731,12 +3030,6 @@ mips_push_arguments (int nargs, phex (regval, MIPS_SAVED_REGSIZE)); write_register (argreg, regval); argreg++; - - /* If this is the old ABI, prevent subsequent floating - point arguments from being passed in floating point - registers. */ - if (!MIPS_EABI) - float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1; } len -= partial_len; @@ -2745,16 +3038,609 @@ mips_push_arguments (int nargs, /* Compute the the offset into the stack at which we will copy the next parameter. - In older ABIs, the caller reserved space for - registers that contained arguments. This was loosely - refered to as their "home". Consequently, space is - always allocated. + In N32 (N64?), the stack_offset only needs to be + adjusted when it has been used. */ - In the new EABI (and the NABI32), the stack_offset - only needs to be adjusted when it has been used.. */ + if (stack_used_p) + stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE); + } + } + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, "\n"); + } + + /* Return adjusted stack pointer. */ + return sp; +} + +/* O32 version of push_arguments. */ + +static CORE_ADDR +mips_o32_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + int struct_return, + CORE_ADDR struct_addr) +{ + int argreg; + int float_argreg; + int argnum; + int len = 0; + int stack_offset = 0; + + /* First ensure that the stack and structure return address (if any) + are properly aligned. The stack has to be at least 64-bit + aligned even on 32-bit machines, because doubles must be 64-bit + aligned. For n32 and n64, stack frames need to be 128-bit + aligned, so we round to this widest known alignment. */ + + sp = ROUND_DOWN (sp, 16); + struct_addr = ROUND_DOWN (struct_addr, 16); + + /* Now make space on the stack for the args. */ + for (argnum = 0; argnum < nargs; argnum++) + len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), + MIPS_STACK_ARGSIZE); + sp -= ROUND_UP (len, 16); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o32_push_arguments: sp=0x%s allocated %d\n", + paddr_nz (sp), ROUND_UP (len, 16)); + + /* Initialize the integer and float register pointers. */ + argreg = A0_REGNUM; + float_argreg = FPA0_REGNUM; + + /* The struct_return pointer occupies the first parameter-passing reg. */ + if (struct_return) + { + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o32_push_arguments: struct_return reg=%d 0x%s\n", + argreg, paddr_nz (struct_addr)); + write_register (argreg++, struct_addr); + stack_offset += MIPS_STACK_ARGSIZE; + } + + /* Now load as many as possible of the first arguments into + registers, and push the rest onto the stack. Loop thru args + from first to last. */ + for (argnum = 0; argnum < nargs; argnum++) + { + char *val; + char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + struct value *arg = args[argnum]; + struct type *arg_type = check_typedef (VALUE_TYPE (arg)); + int len = TYPE_LENGTH (arg_type); + enum type_code typecode = TYPE_CODE (arg_type); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o32_push_arguments: %d len=%d type=%d", + argnum + 1, len, (int) typecode); + + val = (char *) VALUE_CONTENTS (arg); + + /* 32-bit ABIs always start floating point arguments in an + even-numbered floating point register. Round the FP register + up before the check to see if there are any FP registers + left. O32/O64 targets also pass the FP in the integer + registers so also round up normal registers. */ + if (!FP_REGISTER_DOUBLE + && fp_register_arg_p (typecode, arg_type)) + { + if ((float_argreg & 1)) + float_argreg++; + } + + /* Floating point arguments passed in registers have to be + treated specially. On 32-bit architectures, doubles + are passed in register pairs; the even register gets + the low word, and the odd register gets the high word. + On O32/O64, the first two floating point arguments are + also copied to general registers, because MIPS16 functions + don't use float registers for arguments. This duplication of + arguments in general registers can't hurt non-MIPS16 functions + because those registers are normally skipped. */ + + if (fp_register_arg_p (typecode, arg_type) + && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) + { + if (!FP_REGISTER_DOUBLE && len == 8) + { + int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; + unsigned long regval; + + /* Write the low word of the double to the even register(s). */ + regval = extract_unsigned_integer (val + low_offset, 4); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, 4)); + write_register (float_argreg++, regval); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, 4)); + write_register (argreg++, regval); + + /* Write the high word of the double to the odd register(s). */ + regval = extract_unsigned_integer (val + 4 - low_offset, 4); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, 4)); + write_register (float_argreg++, regval); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, 4)); + write_register (argreg++, regval); + } + else + { + /* This is a floating point value that fits entirely + in a single register. */ + /* On 32 bit ABI's the float_argreg is further adjusted + above to ensure that it is even register aligned. */ + LONGEST regval = extract_unsigned_integer (val, len); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, len)); + write_register (float_argreg++, regval); + /* CAGNEY: 32 bit MIPS ABI's always reserve two FP + registers for each argument. The below is (my + guess) to ensure that the corresponding integer + register has reserved the same space. */ + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, len)); + write_register (argreg, regval); + argreg += FP_REGISTER_DOUBLE ? 1 : 2; + } + /* Reserve space for the FP register. */ + stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE); + } + else + { + /* Copy the argument to general registers or the stack in + register-sized pieces. Large arguments are split between + registers and stack. */ + /* Note: structs whose size is not a multiple of MIPS_REGSIZE + are treated specially: Irix cc passes them in registers + where gcc sometimes puts them on the stack. For maximum + compatibility, we will put them in both places. */ + int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) && + (len % MIPS_SAVED_REGSIZE != 0)); + /* Structures should be aligned to eight bytes (even arg registers) + on MIPS_ABI_O32, if their first member has double precision. */ + if (MIPS_SAVED_REGSIZE < 8 + && mips_type_needs_double_align (arg_type)) + { + if ((argreg & 1)) + argreg++; + } + /* Note: Floating-point values that didn't fit into an FP + register are only written to memory. */ + while (len > 0) + { + /* Remember if the argument was written to the stack. */ + int stack_used_p = 0; + int partial_len = + len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE; + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " -- partial=%d", + partial_len); + + /* Write this portion of the argument to the stack. */ + if (argreg > MIPS_LAST_ARG_REGNUM + || odd_sized_struct + || fp_register_arg_p (typecode, arg_type)) + { + /* Should shorter than int integer values be + promoted to int before being stored? */ + int longword_offset = 0; + CORE_ADDR addr; + stack_used_p = 1; + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + if (MIPS_STACK_ARGSIZE == 8 && + (typecode == TYPE_CODE_INT || + typecode == TYPE_CODE_PTR || + typecode == TYPE_CODE_FLT) && len <= 4) + longword_offset = MIPS_STACK_ARGSIZE - len; + } + + if (mips_debug) + { + fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s", + paddr_nz (stack_offset)); + fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s", + paddr_nz (longword_offset)); + } + + addr = sp + stack_offset + longword_offset; + + if (mips_debug) + { + int i; + fprintf_unfiltered (gdb_stdlog, " @0x%s ", + paddr_nz (addr)); + for (i = 0; i < partial_len; i++) + { + fprintf_unfiltered (gdb_stdlog, "%02x", + val[i] & 0xff); + } + } + write_memory (addr, val, partial_len); + } + + /* Note!!! This is NOT an else clause. Odd sized + structs may go thru BOTH paths. Floating point + arguments will not. */ + /* Write this portion of the argument to a general + purpose register. */ + if (argreg <= MIPS_LAST_ARG_REGNUM + && !fp_register_arg_p (typecode, arg_type)) + { + LONGEST regval = extract_signed_integer (val, partial_len); + /* Value may need to be sign extended, because + MIPS_REGSIZE != MIPS_SAVED_REGSIZE. */ + + /* A non-floating-point argument being passed in a + general register. If a struct or union, and if + the remaining length is smaller than the register + size, we have to adjust the register value on + big endian targets. + + It does not seem to be necessary to do the + same for integral types. + + Also don't do this adjustment on O64 binaries. + + cagney/2001-07-23: gdb/179: Also, GCC, when + outputting LE O32 with sizeof (struct) < + MIPS_SAVED_REGSIZE, generates a left shift as + part of storing the argument in a register a + register (the left shift isn't generated when + sizeof (struct) >= MIPS_SAVED_REGSIZE). Since it + is quite possible that this is GCC contradicting + the LE/O32 ABI, GDB has not been adjusted to + accommodate this. Either someone needs to + demonstrate that the LE/O32 ABI specifies such a + left shift OR this new ABI gets identified as + such and GDB gets tweaked accordingly. */ + + if (MIPS_SAVED_REGSIZE < 8 + && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && partial_len < MIPS_SAVED_REGSIZE + && (typecode == TYPE_CODE_STRUCT || + typecode == TYPE_CODE_UNION)) + regval <<= ((MIPS_SAVED_REGSIZE - partial_len) * + TARGET_CHAR_BIT); + + if (mips_debug) + fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", + argreg, + phex (regval, MIPS_SAVED_REGSIZE)); + write_register (argreg, regval); + argreg++; + + /* Prevent subsequent floating point arguments from + being passed in floating point registers. */ + float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1; + } + + len -= partial_len; + val += partial_len; + + /* Compute the the offset into the stack at which we + will copy the next parameter. + + In older ABIs, the caller reserved space for + registers that contained arguments. This was loosely + refered to as their "home". Consequently, space is + always allocated. */ + + stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE); + } + } + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, "\n"); + } + + /* Return adjusted stack pointer. */ + return sp; +} + +/* O64 version of push_arguments. */ + +static CORE_ADDR +mips_o64_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + int struct_return, + CORE_ADDR struct_addr) +{ + int argreg; + int float_argreg; + int argnum; + int len = 0; + int stack_offset = 0; + + /* First ensure that the stack and structure return address (if any) + are properly aligned. The stack has to be at least 64-bit + aligned even on 32-bit machines, because doubles must be 64-bit + aligned. For n32 and n64, stack frames need to be 128-bit + aligned, so we round to this widest known alignment. */ + + sp = ROUND_DOWN (sp, 16); + struct_addr = ROUND_DOWN (struct_addr, 16); + + /* Now make space on the stack for the args. */ + for (argnum = 0; argnum < nargs; argnum++) + len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), + MIPS_STACK_ARGSIZE); + sp -= ROUND_UP (len, 16); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o64_push_arguments: sp=0x%s allocated %d\n", + paddr_nz (sp), ROUND_UP (len, 16)); + + /* Initialize the integer and float register pointers. */ + argreg = A0_REGNUM; + float_argreg = FPA0_REGNUM; + + /* The struct_return pointer occupies the first parameter-passing reg. */ + if (struct_return) + { + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o64_push_arguments: struct_return reg=%d 0x%s\n", + argreg, paddr_nz (struct_addr)); + write_register (argreg++, struct_addr); + stack_offset += MIPS_STACK_ARGSIZE; + } + + /* Now load as many as possible of the first arguments into + registers, and push the rest onto the stack. Loop thru args + from first to last. */ + for (argnum = 0; argnum < nargs; argnum++) + { + char *val; + char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + struct value *arg = args[argnum]; + struct type *arg_type = check_typedef (VALUE_TYPE (arg)); + int len = TYPE_LENGTH (arg_type); + enum type_code typecode = TYPE_CODE (arg_type); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, + "mips_o64_push_arguments: %d len=%d type=%d", + argnum + 1, len, (int) typecode); + + val = (char *) VALUE_CONTENTS (arg); + + /* 32-bit ABIs always start floating point arguments in an + even-numbered floating point register. Round the FP register + up before the check to see if there are any FP registers + left. O32/O64 targets also pass the FP in the integer + registers so also round up normal registers. */ + if (!FP_REGISTER_DOUBLE + && fp_register_arg_p (typecode, arg_type)) + { + if ((float_argreg & 1)) + float_argreg++; + } + + /* Floating point arguments passed in registers have to be + treated specially. On 32-bit architectures, doubles + are passed in register pairs; the even register gets + the low word, and the odd register gets the high word. + On O32/O64, the first two floating point arguments are + also copied to general registers, because MIPS16 functions + don't use float registers for arguments. This duplication of + arguments in general registers can't hurt non-MIPS16 functions + because those registers are normally skipped. */ + + if (fp_register_arg_p (typecode, arg_type) + && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) + { + if (!FP_REGISTER_DOUBLE && len == 8) + { + int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; + unsigned long regval; + + /* Write the low word of the double to the even register(s). */ + regval = extract_unsigned_integer (val + low_offset, 4); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, 4)); + write_register (float_argreg++, regval); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, 4)); + write_register (argreg++, regval); + + /* Write the high word of the double to the odd register(s). */ + regval = extract_unsigned_integer (val + 4 - low_offset, 4); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, 4)); + write_register (float_argreg++, regval); + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, 4)); + write_register (argreg++, regval); + } + else + { + /* This is a floating point value that fits entirely + in a single register. */ + /* On 32 bit ABI's the float_argreg is further adjusted + above to ensure that it is even register aligned. */ + LONGEST regval = extract_unsigned_integer (val, len); + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", + float_argreg, phex (regval, len)); + write_register (float_argreg++, regval); + /* CAGNEY: 32 bit MIPS ABI's always reserve two FP + registers for each argument. The below is (my + guess) to ensure that the corresponding integer + register has reserved the same space. */ + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", + argreg, phex (regval, len)); + write_register (argreg, regval); + argreg += FP_REGISTER_DOUBLE ? 1 : 2; + } + /* Reserve space for the FP register. */ + stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE); + } + else + { + /* Copy the argument to general registers or the stack in + register-sized pieces. Large arguments are split between + registers and stack. */ + /* Note: structs whose size is not a multiple of MIPS_REGSIZE + are treated specially: Irix cc passes them in registers + where gcc sometimes puts them on the stack. For maximum + compatibility, we will put them in both places. */ + int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) && + (len % MIPS_SAVED_REGSIZE != 0)); + /* Structures should be aligned to eight bytes (even arg registers) + on MIPS_ABI_O32, if their first member has double precision. */ + if (MIPS_SAVED_REGSIZE < 8 + && mips_type_needs_double_align (arg_type)) + { + if ((argreg & 1)) + argreg++; + } + /* Note: Floating-point values that didn't fit into an FP + register are only written to memory. */ + while (len > 0) + { + /* Remember if the argument was written to the stack. */ + int stack_used_p = 0; + int partial_len = + len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE; + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, " -- partial=%d", + partial_len); + + /* Write this portion of the argument to the stack. */ + if (argreg > MIPS_LAST_ARG_REGNUM + || odd_sized_struct + || fp_register_arg_p (typecode, arg_type)) + { + /* Should shorter than int integer values be + promoted to int before being stored? */ + int longword_offset = 0; + CORE_ADDR addr; + stack_used_p = 1; + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + if (MIPS_STACK_ARGSIZE == 8 && + (typecode == TYPE_CODE_INT || + typecode == TYPE_CODE_PTR || + typecode == TYPE_CODE_FLT) && len <= 4) + longword_offset = MIPS_STACK_ARGSIZE - len; + } - if (MIPS_REGS_HAVE_HOME_P || stack_used_p) - stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE); + if (mips_debug) + { + fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s", + paddr_nz (stack_offset)); + fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s", + paddr_nz (longword_offset)); + } + + addr = sp + stack_offset + longword_offset; + + if (mips_debug) + { + int i; + fprintf_unfiltered (gdb_stdlog, " @0x%s ", + paddr_nz (addr)); + for (i = 0; i < partial_len; i++) + { + fprintf_unfiltered (gdb_stdlog, "%02x", + val[i] & 0xff); + } + } + write_memory (addr, val, partial_len); + } + + /* Note!!! This is NOT an else clause. Odd sized + structs may go thru BOTH paths. Floating point + arguments will not. */ + /* Write this portion of the argument to a general + purpose register. */ + if (argreg <= MIPS_LAST_ARG_REGNUM + && !fp_register_arg_p (typecode, arg_type)) + { + LONGEST regval = extract_signed_integer (val, partial_len); + /* Value may need to be sign extended, because + MIPS_REGSIZE != MIPS_SAVED_REGSIZE. */ + + /* A non-floating-point argument being passed in a + general register. If a struct or union, and if + the remaining length is smaller than the register + size, we have to adjust the register value on + big endian targets. + + It does not seem to be necessary to do the + same for integral types. + + Also don't do this adjustment on O64 binaries. + + cagney/2001-07-23: gdb/179: Also, GCC, when + outputting LE O32 with sizeof (struct) < + MIPS_SAVED_REGSIZE, generates a left shift as + part of storing the argument in a register a + register (the left shift isn't generated when + sizeof (struct) >= MIPS_SAVED_REGSIZE). Since it + is quite possible that this is GCC contradicting + the LE/O32 ABI, GDB has not been adjusted to + accommodate this. Either someone needs to + demonstrate that the LE/O32 ABI specifies such a + left shift OR this new ABI gets identified as + such and GDB gets tweaked accordingly. */ + + if (MIPS_SAVED_REGSIZE < 8 + && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && partial_len < MIPS_SAVED_REGSIZE + && (typecode == TYPE_CODE_STRUCT || + typecode == TYPE_CODE_UNION)) + regval <<= ((MIPS_SAVED_REGSIZE - partial_len) * + TARGET_CHAR_BIT); + + if (mips_debug) + fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", + argreg, + phex (regval, MIPS_SAVED_REGSIZE)); + write_register (argreg, regval); + argreg++; + + /* Prevent subsequent floating point arguments from + being passed in floating point registers. */ + float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1; + } + + len -= partial_len; + val += partial_len; + + /* Compute the the offset into the stack at which we + will copy the next parameter. + + In older ABIs, the caller reserved space for + registers that contained arguments. This was loosely + refered to as their "home". Consequently, space is + always allocated. */ + + stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE); } } if (mips_debug) @@ -2765,7 +3651,7 @@ mips_push_arguments (int nargs, return sp; } -CORE_ADDR +static CORE_ADDR mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { /* Set the return address register to point to the entry @@ -2777,7 +3663,7 @@ mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp) static void mips_push_register (CORE_ADDR * sp, int regno) { - char buffer[MAX_REGISTER_RAW_SIZE]; + char *buffer = alloca (MAX_REGISTER_RAW_SIZE); int regsize; int offset; if (MIPS_SAVED_REGSIZE < REGISTER_RAW_SIZE (regno)) @@ -2800,7 +3686,7 @@ mips_push_register (CORE_ADDR * sp, int regno) /* MASK(i,j) == (1<saved_regs == NULL) - mips_find_saved_regs (frame); + FRAME_INIT_SAVED_REGS (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) { if (regnum != SP_REGNUM && regnum != PC_REGNUM @@ -2899,6 +3785,7 @@ mips_pop_frame (void) read_memory_integer (frame->saved_regs[regnum], MIPS_SAVED_REGSIZE)); } + write_register (SP_REGNUM, new_sp); flush_cached_frames (); @@ -2937,6 +3824,13 @@ mips_pop_frame (void) } } +static void +mips_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, + struct value **args, struct type *type, int gcc_p) +{ + write_register(T9_REGNUM, fun); +} + /* Floating point register management. Background: MIPS1 & 2 fp registers are 32 bits wide. To support @@ -3056,7 +3950,7 @@ mips_read_fp_register_double (int regno, char *rare_buffer) static void mips_print_register (int regnum, int all) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); /* Get the data in raw format. */ if (!frame_register_read (selected_frame, regnum, raw_buffer)) @@ -3073,7 +3967,7 @@ mips_print_register (int regnum, int all) || mips2_fp_compat ()) && !((regnum - FP0_REGNUM) & 1)) { - char dbuffer[2 * MAX_REGISTER_RAW_SIZE]; + char *dbuffer = alloca (2 * MAX_REGISTER_RAW_SIZE); mips_read_fp_register_double (regnum, dbuffer); @@ -3208,7 +4102,7 @@ static int do_gp_register_row (int regnum) { /* do values for GP (int) regs */ - char raw_buffer[MAX_REGISTER_RAW_SIZE]; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */ int col, byte; int start_regnum = regnum; @@ -3266,7 +4160,7 @@ do_gp_register_row (int regnum) /* MIPS_DO_REGISTERS_INFO(): called by "info register" command */ -void +static void mips_do_registers_info (int regnum, int fpregs) { if (regnum != -1) /* do one specified register */ @@ -3294,15 +4188,6 @@ mips_do_registers_info (int regnum, int fpregs) } } -/* Return number of args passed to a frame. described by FIP. - Can return -1, meaning no way to tell. */ - -int -mips_frame_num_args (struct frame_info *frame) -{ - return -1; -} - /* Is this a branch with a delay slot? */ static int is_delayed (unsigned long); @@ -3541,7 +4426,7 @@ mips16_skip_prologue (CORE_ADDR pc) We must skip more in the case where part of the prologue is in the delay slot of a non-prologue instruction). */ -CORE_ADDR +static CORE_ADDR mips_skip_prologue (CORE_ADDR pc) { /* See if we can determine the end of the prologue via the symbol table. @@ -3676,10 +4561,29 @@ return_value_location (struct type *valtype, /* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ -void -mips_extract_return_value (struct type *valtype, - char regbuf[REGISTER_BYTES], - char *valbuf) +static void +mips_eabi_extract_return_value (struct type *valtype, + char regbuf[REGISTER_BYTES], + char *valbuf) +{ + struct return_value_word lo; + struct return_value_word hi; + return_value_location (valtype, &hi, &lo); + + memcpy (valbuf + lo.buf_offset, + regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset, + lo.len); + + if (hi.len > 0) + memcpy (valbuf + hi.buf_offset, + regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset, + hi.len); +} + +static void +mips_o64_extract_return_value (struct type *valtype, + char regbuf[REGISTER_BYTES], + char *valbuf) { struct return_value_word lo; struct return_value_word hi; @@ -3698,10 +4602,34 @@ mips_extract_return_value (struct type *valtype, /* Given a return value in `valbuf' with a type `valtype', write it's value into the appropriate register. */ -void -mips_store_return_value (struct type *valtype, char *valbuf) +static void +mips_eabi_store_return_value (struct type *valtype, char *valbuf) +{ + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + struct return_value_word lo; + struct return_value_word hi; + return_value_location (valtype, &hi, &lo); + + memset (raw_buffer, 0, sizeof (raw_buffer)); + memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len); + write_register_bytes (REGISTER_BYTE (lo.reg), + raw_buffer, + REGISTER_RAW_SIZE (lo.reg)); + + if (hi.len > 0) + { + memset (raw_buffer, 0, sizeof (raw_buffer)); + memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len); + write_register_bytes (REGISTER_BYTE (hi.reg), + raw_buffer, + REGISTER_RAW_SIZE (hi.reg)); + } +} + +static void +mips_o64_store_return_value (struct type *valtype, char *valbuf) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; + char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); struct return_value_word lo; struct return_value_word hi; return_value_location (valtype, &hi, &lo); @@ -3722,10 +4650,274 @@ mips_store_return_value (struct type *valtype, char *valbuf) } } +/* O32 ABI stuff. */ + +static void +mips_o32_xfer_return_value (struct type *type, + struct regcache *regcache, + bfd_byte *in, const bfd_byte *out) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (TYPE_CODE (type) == TYPE_CODE_FLT + && TYPE_LENGTH (type) == 4 + && tdep->mips_fpu_type != MIPS_FPU_NONE) + { + /* A single-precision floating-point value. It fits in the + least significant part of FP0. */ + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n"); + mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type), + TARGET_BYTE_ORDER, in, out, 0); + } + else if (TYPE_CODE (type) == TYPE_CODE_FLT + && TYPE_LENGTH (type) == 8 + && tdep->mips_fpu_type != MIPS_FPU_NONE) + { + /* A double-precision floating-point value. It fits in the + least significant part of FP0/FP1 but with byte ordering + based on the target (???). */ + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return float in $fp0/$fp1\n"); + switch (TARGET_BYTE_ORDER) + { + case BFD_ENDIAN_LITTLE: + mips_xfer_register (regcache, FP0_REGNUM + 0, 4, + TARGET_BYTE_ORDER, in, out, 0); + mips_xfer_register (regcache, FP0_REGNUM + 1, 4, + TARGET_BYTE_ORDER, in, out, 4); + break; + case BFD_ENDIAN_BIG: + mips_xfer_register (regcache, FP0_REGNUM + 1, 4, + TARGET_BYTE_ORDER, in, out, 0); + mips_xfer_register (regcache, FP0_REGNUM + 0, 4, + TARGET_BYTE_ORDER, in, out, 4); + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + } +#if 0 + else if (TYPE_CODE (type) == TYPE_CODE_STRUCT + && TYPE_NFIELDS (type) <= 2 + && TYPE_NFIELDS (type) >= 1 + && ((TYPE_NFIELDS (type) == 1 + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) + == TYPE_CODE_FLT)) + || (TYPE_NFIELDS (type) == 2 + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) + == TYPE_CODE_FLT) + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1)) + == TYPE_CODE_FLT))) + && tdep->mips_fpu_type != MIPS_FPU_NONE) + { + /* A struct that contains one or two floats. Each value is part + in the least significant part of their floating point + register.. */ + bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + int regnum; + int field; + for (field = 0, regnum = FP0_REGNUM; + field < TYPE_NFIELDS (type); + field++, regnum += 2) + { + int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + / TARGET_CHAR_BIT); + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset); + mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), + TARGET_BYTE_ORDER, in, out, offset); + } + } +#endif +#if 0 + else if (TYPE_CODE (type) == TYPE_CODE_STRUCT + || TYPE_CODE (type) == TYPE_CODE_UNION) + { + /* A structure or union. Extract the left justified value, + regardless of the byte order. I.e. DO NOT USE + mips_xfer_lower. */ + int offset; + int regnum; + for (offset = 0, regnum = V0_REGNUM; + offset < TYPE_LENGTH (type); + offset += REGISTER_RAW_SIZE (regnum), regnum++) + { + int xfer = REGISTER_RAW_SIZE (regnum); + if (offset + xfer > TYPE_LENGTH (type)) + xfer = TYPE_LENGTH (type) - offset; + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n", + offset, xfer, regnum); + mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN, + in, out, offset); + } + } +#endif + else + { + /* A scalar extract each part but least-significant-byte + justified. o32 thinks registers are 4 byte, regardless of + the ISA. mips_stack_argsize controls this. */ + int offset; + int regnum; + for (offset = 0, regnum = V0_REGNUM; + offset < TYPE_LENGTH (type); + offset += mips_stack_argsize (), regnum++) + { + int xfer = mips_stack_argsize (); + int pos = 0; + if (offset + xfer > TYPE_LENGTH (type)) + xfer = TYPE_LENGTH (type) - offset; + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n", + offset, xfer, regnum); + mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER, + in, out, offset); + } + } +} + +static void +mips_o32_extract_return_value (struct type *type, + struct regcache *regcache, + void *valbuf) +{ + mips_o32_xfer_return_value (type, regcache, valbuf, NULL); +} + +static void +mips_o32_store_return_value (struct type *type, char *valbuf) +{ + mips_o32_xfer_return_value (type, current_regcache, NULL, valbuf); +} + +/* N32/N44 ABI stuff. */ + +static void +mips_n32n64_xfer_return_value (struct type *type, + struct regcache *regcache, + bfd_byte *in, const bfd_byte *out) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (TYPE_CODE (type) == TYPE_CODE_FLT + && tdep->mips_fpu_type != MIPS_FPU_NONE) + { + /* A floating-point value belongs in the least significant part + of FP0. */ + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n"); + mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type), + TARGET_BYTE_ORDER, in, out, 0); + } + else if (TYPE_CODE (type) == TYPE_CODE_STRUCT + && TYPE_NFIELDS (type) <= 2 + && TYPE_NFIELDS (type) >= 1 + && ((TYPE_NFIELDS (type) == 1 + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) + == TYPE_CODE_FLT)) + || (TYPE_NFIELDS (type) == 2 + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) + == TYPE_CODE_FLT) + && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1)) + == TYPE_CODE_FLT))) + && tdep->mips_fpu_type != MIPS_FPU_NONE) + { + /* A struct that contains one or two floats. Each value is part + in the least significant part of their floating point + register.. */ + bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + int regnum; + int field; + for (field = 0, regnum = FP0_REGNUM; + field < TYPE_NFIELDS (type); + field++, regnum += 2) + { + int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + / TARGET_CHAR_BIT); + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset); + mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), + TARGET_BYTE_ORDER, in, out, offset); + } + } + else if (TYPE_CODE (type) == TYPE_CODE_STRUCT + || TYPE_CODE (type) == TYPE_CODE_UNION) + { + /* A structure or union. Extract the left justified value, + regardless of the byte order. I.e. DO NOT USE + mips_xfer_lower. */ + int offset; + int regnum; + for (offset = 0, regnum = V0_REGNUM; + offset < TYPE_LENGTH (type); + offset += REGISTER_RAW_SIZE (regnum), regnum++) + { + int xfer = REGISTER_RAW_SIZE (regnum); + if (offset + xfer > TYPE_LENGTH (type)) + xfer = TYPE_LENGTH (type) - offset; + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n", + offset, xfer, regnum); + mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN, + in, out, offset); + } + } + else + { + /* A scalar extract each part but least-significant-byte + justified. */ + int offset; + int regnum; + for (offset = 0, regnum = V0_REGNUM; + offset < TYPE_LENGTH (type); + offset += REGISTER_RAW_SIZE (regnum), regnum++) + { + int xfer = REGISTER_RAW_SIZE (regnum); + int pos = 0; + if (offset + xfer > TYPE_LENGTH (type)) + xfer = TYPE_LENGTH (type) - offset; + if (mips_debug) + fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n", + offset, xfer, regnum); + mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER, + in, out, offset); + } + } +} + +static void +mips_n32n64_extract_return_value (struct type *type, + struct regcache *regcache, + void *valbuf) +{ + mips_n32n64_xfer_return_value (type, regcache, valbuf, NULL); +} + +static void +mips_n32n64_store_return_value (struct type *type, char *valbuf) +{ + mips_n32n64_xfer_return_value (type, current_regcache, NULL, valbuf); +} + +static void +mips_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) +{ + /* Nothing to do -- push_arguments does all the work. */ +} + +static CORE_ADDR +mips_extract_struct_value_address (struct regcache *ignore) +{ + /* FIXME: This will only work at random. The caller passes the + struct_return address in V0, but it is not preserved. It may + still be there, or this may be a random value. */ + return read_register (V0_REGNUM); +} + /* Exported procedure: Is PC in the signal trampoline code */ -int -in_sigtramp (CORE_ADDR pc, char *ignore) +static int +mips_pc_in_sigtramp (CORE_ADDR pc, char *ignore) { if (sigtramp_address == 0) fixup_sigtramp (); @@ -3848,7 +5040,7 @@ mips_show_processor_type_command (char *args, int from_tty) /* Modify the actual processor type. */ -int +static int mips_set_processor_type (char *str) { int i; @@ -3950,7 +5142,7 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info) (if necessary) to point to the actual memory location where the breakpoint should be inserted. */ -const unsigned char * +static const unsigned char * mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) @@ -4032,7 +5224,7 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) This function implements the SKIP_TRAMPOLINE_CODE macro. */ -CORE_ADDR +static CORE_ADDR mips_skip_stub (CORE_ADDR pc) { char *name; @@ -4115,7 +5307,7 @@ mips_skip_stub (CORE_ADDR pc) /* Return non-zero if the PC is inside a call thunk (aka stub or trampoline). This implements the IN_SOLIB_CALL_TRAMPOLINE macro. */ -int +static int mips_in_call_stub (CORE_ADDR pc, char *name) { CORE_ADDR start_addr; @@ -4143,7 +5335,7 @@ mips_in_call_stub (CORE_ADDR pc, char *name) /* Return non-zero if the PC is inside a return thunk (aka stub or trampoline). This implements the IN_SOLIB_RETURN_TRAMPOLINE macro. */ -int +static int mips_in_return_stub (CORE_ADDR pc, char *name) { CORE_ADDR start_addr; @@ -4193,7 +5385,7 @@ mips_ignore_helper (CORE_ADDR pc) point (e.g. programs in ROM) should define a symbol __CALL_DUMMY_ADDRESS whose address is the location where the breakpoint should be placed. */ -CORE_ADDR +static CORE_ADDR mips_call_dummy_address (void) { struct minimal_symbol *sym; @@ -4411,7 +5603,7 @@ mips_gdbarch_init (struct gdbarch_info info, osabi = gdbarch_lookup_osabi (info.abfd); } - /* Check ELF_FLAGS to see if it specifies the ABI being used. */ + /* Check ELF_FLAGS to see if it specifies the ABI being used. */ switch ((elf_flags & EF_MIPS_ABI)) { case E_MIPS_ABI_O32: @@ -4471,11 +5663,6 @@ mips_gdbarch_init (struct gdbarch_info info, } } -#ifdef MIPS_DEFAULT_ABI - if (mips_abi == MIPS_ABI_UNKNOWN) - mips_abi = MIPS_DEFAULT_ABI; -#endif - if (mips_abi == MIPS_ABI_UNKNOWN) mips_abi = MIPS_ABI_O32; @@ -4505,7 +5692,7 @@ mips_gdbarch_init (struct gdbarch_info info, arches = gdbarch_list_lookup_by_info (arches->next, &info)) { /* MIPS needs to be pedantic about which ABI the object is - using. */ + using. */ if (gdbarch_tdep (arches->gdbarch)->elf_flags != elf_flags) continue; if (gdbarch_tdep (arches->gdbarch)->mips_abi != mips_abi) @@ -4514,31 +5701,38 @@ mips_gdbarch_init (struct gdbarch_info info, return arches->gdbarch; } - /* Need a new architecture. Fill in a target specific vector. */ + /* Need a new architecture. Fill in a target specific vector. */ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; tdep->osabi = osabi; - /* Initially set everything according to the default ABI/ISA. */ + /* Initially set everything according to the default ABI/ISA. */ set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); set_gdbarch_float_bit (gdbarch, 32); set_gdbarch_double_bit (gdbarch, 64); set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_register_raw_size (gdbarch, mips_register_raw_size); + set_gdbarch_max_register_raw_size (gdbarch, 8); + set_gdbarch_max_register_virtual_size (gdbarch, 8); tdep->found_abi = found_abi; tdep->mips_abi = mips_abi; + set_gdbarch_elf_make_msymbol_special (gdbarch, + mips_elf_make_msymbol_special); + switch (mips_abi) { case MIPS_ABI_O32: + set_gdbarch_push_arguments (gdbarch, mips_o32_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_o32_store_return_value); + set_gdbarch_extract_return_value (gdbarch, mips_o32_extract_return_value); tdep->mips_default_saved_regsize = 4; tdep->mips_default_stack_argsize = 4; tdep->mips_fp_register_double = 0; tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 4 - 1; - tdep->mips_regs_have_home_p = 1; tdep->gdb_target_is_mips64 = 0; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); @@ -4550,12 +5744,14 @@ mips_gdbarch_init (struct gdbarch_info info, mips_o32_use_struct_convention); break; case MIPS_ABI_O64: + set_gdbarch_push_arguments (gdbarch, mips_o64_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_o64_store_return_value); + set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value); tdep->mips_default_saved_regsize = 8; tdep->mips_default_stack_argsize = 8; tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 4 - 1; - tdep->mips_regs_have_home_p = 1; tdep->gdb_target_is_mips64 = 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); @@ -4567,12 +5763,14 @@ mips_gdbarch_init (struct gdbarch_info info, mips_o32_use_struct_convention); break; case MIPS_ABI_EABI32: + set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); + set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 4; tdep->mips_default_stack_argsize = 4; tdep->mips_fp_register_double = 0; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; - tdep->mips_regs_have_home_p = 0; tdep->gdb_target_is_mips64 = 0; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); @@ -4584,12 +5782,14 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_EABI64: + set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); + set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 8; tdep->mips_default_stack_argsize = 8; tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; - tdep->mips_regs_have_home_p = 0; tdep->gdb_target_is_mips64 = 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 64); @@ -4601,12 +5801,14 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_N32: + set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); + set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; tdep->mips_default_stack_argsize = 8; tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; - tdep->mips_regs_have_home_p = 0; tdep->gdb_target_is_mips64 = 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); @@ -4630,12 +5832,14 @@ mips_gdbarch_init (struct gdbarch_info info, mips_n32n64_reg_struct_has_addr); break; case MIPS_ABI_N64: + set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); + set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; tdep->mips_default_stack_argsize = 8; tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; - tdep->mips_regs_have_home_p = 0; tdep->gdb_target_is_mips64 = 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 64); @@ -4669,7 +5873,7 @@ mips_gdbarch_init (struct gdbarch_info info, ``We deliberately don't allow "-gp32" to set the MIPS_32BITMODE flag in object files because to do so would make it impossible to - link with libraries compiled without "-gp32". This is + link with libraries compiled without "-gp32". This is unnecessarily restrictive. We could solve this problem by adding "-gp32" multilibs to gcc, @@ -4679,10 +5883,10 @@ mips_gdbarch_init (struct gdbarch_info info, But even more unhelpfully, the default linker output target for mips64-elf is elf32-bigmips, and has EF_MIPS_32BIT_MODE set, even for 64-bit programs - you need to change the ABI to change this, - and not all gcc targets support that currently. Therefore using + and not all gcc targets support that currently. Therefore using this flag to detect 32-bit mode would do the wrong thing given the current gcc - it would make GDB treat these 64-bit programs - as 32-bit programs by default. */ + as 32-bit programs by default. */ /* enable/disable the MIPS FPU */ if (!mips_fpu_type_auto) @@ -4709,16 +5913,19 @@ mips_gdbarch_init (struct gdbarch_info info, /* MIPS version of register names. NOTE: At present the MIPS register name management is part way between the old - #undef/#define REGISTER_NAMES and the new REGISTER_NAME(nr). - Further work on it is required. */ + Further work on it is required. */ + /* NOTE: many targets (esp. embedded) do not go thru the + gdbarch_register_name vector at all, instead bypassing it + by defining REGISTER_NAMES. */ set_gdbarch_register_name (gdbarch, mips_register_name); set_gdbarch_read_pc (gdbarch, mips_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); + set_gdbarch_read_sp (gdbarch, mips_read_sp); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); - /* Add/remove bits from an address. The MIPS needs be careful to - ensure that all 32 bit addresses are sign extended to 64 bits. */ + /* Add/remove bits from an address. The MIPS needs be careful to + ensure that all 32 bit addresses are sign extended to 64 bits. */ set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove); /* There's a mess in stack frame creation. See comments in @@ -4726,7 +5933,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first); set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop); - /* Map debug register numbers onto internal register numbers. */ + /* Map debug register numbers onto internal register numbers. */ set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum); set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum); @@ -4741,19 +5948,36 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); + set_gdbarch_push_return_address (gdbarch, mips_push_return_address); + set_gdbarch_push_dummy_frame (gdbarch, mips_push_dummy_frame); + set_gdbarch_pop_frame (gdbarch, mips_pop_frame); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); + set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy); set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); - set_gdbarch_push_arguments (gdbarch, mips_push_arguments); - set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); + set_gdbarch_register_convertible (gdbarch, mips_register_convertible); + set_gdbarch_register_convert_to_virtual (gdbarch, + mips_register_convert_to_virtual); + set_gdbarch_register_convert_to_raw (gdbarch, + mips_register_convert_to_raw); + set_gdbarch_coerce_float_to_double (gdbarch, mips_coerce_float_to_double); + set_gdbarch_frame_chain (gdbarch, mips_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); + set_gdbarch_frameless_function_invocation (gdbarch, + generic_frameless_function_invocation_not); + set_gdbarch_frame_saved_pc (gdbarch, mips_frame_saved_pc); + set_gdbarch_frame_args_address (gdbarch, default_frame_address); + set_gdbarch_frame_locals_address (gdbarch, default_frame_address); + set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + set_gdbarch_frame_args_skip (gdbarch, 0); + set_gdbarch_get_saved_register (gdbarch, mips_get_saved_register); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); @@ -4767,13 +5991,28 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_address_to_pointer (gdbarch, address_to_signed_pointer); set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address); + set_gdbarch_function_start_offset (gdbarch, 0); + /* There are MIPS targets which do not yet use this since they still define REGISTER_VIRTUAL_TYPE. */ set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type); + set_gdbarch_register_virtual_size (gdbarch, generic_register_size); + + set_gdbarch_do_registers_info (gdbarch, mips_do_registers_info); + set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp); /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch, osabi); + set_gdbarch_store_struct_return (gdbarch, mips_store_struct_return); + set_gdbarch_extract_struct_value_address (gdbarch, + mips_extract_struct_value_address); + + set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_stub); + + set_gdbarch_in_solib_call_trampoline (gdbarch, mips_in_call_stub); + set_gdbarch_in_solib_return_trampoline (gdbarch, mips_in_return_stub); + return gdbarch; } @@ -4866,9 +6105,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n", FP_REGISTER_DOUBLE); - fprintf_unfiltered (file, - "mips_dump_tdep: MIPS_REGS_HAVE_HOME_P = %d\n", - MIPS_REGS_HAVE_HOME_P); fprintf_unfiltered (file, "mips_dump_tdep: MIPS_DEFAULT_STACK_ARGSIZE = %d\n", MIPS_DEFAULT_STACK_ARGSIZE); @@ -4898,9 +6134,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: CPLUS_MARKER = %c\n", CPLUS_MARKER); - fprintf_unfiltered (file, - "mips_dump_tdep: DEFAULT_MIPS_TYPE = %s\n", - DEFAULT_MIPS_TYPE); fprintf_unfiltered (file, "mips_dump_tdep: DO_REGISTERS_INFO # %s\n", XSTRING (DO_REGISTERS_INFO)); @@ -4910,9 +6143,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: ECOFF_REG_TO_REGNUM # %s\n", XSTRING (ECOFF_REG_TO_REGNUM (REGNUM))); - fprintf_unfiltered (file, - "mips_dump_tdep: ELF_MAKE_MSYMBOL_SPECIAL # %s\n", - XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (SYM, MSYM))); fprintf_unfiltered (file, "mips_dump_tdep: FCRCS_REGNUM = %d\n", FCRCS_REGNUM); @@ -5009,11 +6239,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: MIPS_SAVED_REGSIZE = %d\n", MIPS_SAVED_REGSIZE); - fprintf_unfiltered (file, - "mips_dump_tdep: MSYMBOL_IS_SPECIAL = function?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: MSYMBOL_SIZE # %s\n", - XSTRING (MSYMBOL_SIZE (MSYM))); fprintf_unfiltered (file, "mips_dump_tdep: OP_LDFPR = used?\n"); fprintf_unfiltered (file, diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 18bea39529c..6e7bada4cad 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1173,7 +1173,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, 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_store_return_value (gdbarch, mn10300_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value); set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return); set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame); set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index ae81ebe4eb5..58c2e13c10c 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -337,51 +337,6 @@ ns32k_frame_locals_address (struct frame_info *frame) return (frame->frame); } -static void -ns32k_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, - struct frame_info *frame, int regnum, - enum lval_type *lval) -{ - CORE_ADDR addr; - - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - addr = find_saved_register (frame, regnum); - if (addr != 0) - { - if (lval != NULL) - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer != NULL) - { - /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - (LONGEST) addr); - } - if (addrp != NULL) - *addrp = 0; - return; - } - if (raw_buffer != NULL) - target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); - } - else - { - if (lval != NULL) - *lval = lval_register; - addr = REGISTER_BYTE (regnum); - if (raw_buffer != NULL) - read_register_gen (regnum, raw_buffer); - } - if (addrp != NULL) - *addrp = addr; -} - /* Code to initialize the addresses of the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special ways in the stack frame. sp is even more special: the address we @@ -614,14 +569,12 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_get_saved_register (gdbarch, ns32k_get_saved_register); - set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Return value info */ set_gdbarch_store_struct_return (gdbarch, ns32k_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value); - set_gdbarch_store_return_value (gdbarch, ns32k_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ns32k_extract_struct_value_address); diff --git a/gdb/osabi.c b/gdb/osabi.c index 580c7e19756..682dbba9c6f 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_string.h" #include "osabi.h" #include "elf-bfd.h" @@ -232,13 +233,8 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch, if (osabi == GDB_OSABI_UNKNOWN) { - /* Don't complain about not knowing the OS ABI if we don't - have an inferior. */ - if (info.abfd) - fprintf_filtered - (gdb_stderr, "GDB doesn't recognize the OS ABI of the inferior. " - "Attempting to continue with the default %s settings", - bfd_printable_arch_mach (arch_info->arch, arch_info->mach)); + /* Don't complain about an unknown OSABI. Assume the user knows + what they are doing. */ return; } diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 8e13b6e860a..88c8cc09a90 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -20,6 +20,7 @@ /* This file is derived from c-lang.c */ #include "defs.h" +#include "gdb_string.h" #include "symtab.h" #include "gdbtypes.h" #include "expression.h" diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index 3bd741da2b1..48c5647e5da 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -72,6 +72,8 @@ struct gdbarch_tdep int ppc_mq_regnum; /* Multiply/Divide extension register */ int ppc_vr0_regnum; /* First AltiVec register */ int ppc_vrsave_regnum; /* Last AltiVec register */ + int ppc_ev0_regnum; /* First ev register */ + int ppc_ev31_regnum; /* Last ev register */ int lr_frame_offset; /* Offset to ABI specific location where link register is saved. */ }; diff --git a/gdb/proc-api.c b/gdb/proc-api.c index fa6667f1a83..3e8b19841ac 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -397,9 +397,13 @@ static struct trans rw_table[] = { #ifdef PCCSIG /* solaris */ { PCCSIG, "PCCSIG", "clear current signal" }, #endif +#ifdef PCDSTOP /* solaris */ { PCDSTOP, "PCDSTOP", "post stop request" }, +#endif { PCKILL, "PCKILL", "post a signal" }, +#ifdef PCNICE /* solaris */ { PCNICE, "PCNICE", "set nice priority" }, +#endif #ifdef PCREAD /* solaris */ { PCREAD, "PCREAD", "read from the address space" }, { PCWRITE, "PCWRITE", "write to the address space" }, @@ -419,7 +423,9 @@ static struct trans rw_table[] = { { PCSEXIT, "PCSEXIT", "set traced syscall exit set" }, { PCSFAULT, "PCSFAULT", "set traced fault set" }, { PCSFPREG, "PCSFPREG", "set floating point registers" }, +#ifdef PCSHOLD /* solaris */ { PCSHOLD, "PCSHOLD", "set signal mask" }, +#endif { PCSREG, "PCSREG", "set general registers" }, { PCSSIG, "PCSSIG", "set current signal" }, { PCSTOP, "PCSTOP", "post stop request and wait" }, @@ -433,7 +439,9 @@ static struct trans rw_table[] = { #ifdef PCTWSTOP /* solaris */ { PCTWSTOP, "PCTWSTOP", "wait for stop, with timeout arg" }, #endif +#ifdef PCUNKILL /* solaris */ { PCUNKILL, "PCUNKILL", "delete a pending signal" }, +#endif #ifdef PCUNSET /* solaris */ { PCUNSET, "PCUNSET", "unset modes" }, #endif @@ -518,12 +526,14 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout, (sysset_t *) &arg[1], 0); break; +#ifdef PCSHOLD case PCSHOLD: fprintf (procfs_file ? procfs_file : stdout, "write (PCSHOLD) "); proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout, (sigset_t *) &arg[1], 0); break; +#endif case PCSSIG: fprintf (procfs_file ? procfs_file : stdout, "write (PCSSIG) "); @@ -542,10 +552,14 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) fprintf (procfs_file ? procfs_file : stdout, "clearFlt "); if (arg[1] & PRSTEP) fprintf (procfs_file ? procfs_file : stdout, "step "); +#ifdef PRSABORT if (arg[1] & PRSABORT) fprintf (procfs_file ? procfs_file : stdout, "syscallAbort "); +#endif +#ifdef PRSTOP if (arg[1] & PRSTOP) fprintf (procfs_file ? procfs_file : stdout, "stopReq "); +#endif fprintf (procfs_file ? procfs_file : stdout, "\n"); break; diff --git a/gdb/procfs.c b/gdb/procfs.c index 76888992646..ff8a7d3fb25 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -136,6 +136,8 @@ static int proc_find_memory_regions (int (*) (CORE_ADDR, static char * procfs_make_note_section (bfd *, int *); +static int procfs_can_use_hw_breakpoint (int, int, int); + struct target_ops procfs_ops; /* the target vector */ static void @@ -168,6 +170,7 @@ init_procfs_ops (void) procfs_ops.to_terminal_inferior = terminal_inferior; procfs_ops.to_terminal_ours_for_output = terminal_ours_for_output; procfs_ops.to_terminal_ours = terminal_ours; + procfs_ops.to_terminal_save_ours = terminal_save_ours; procfs_ops.to_terminal_info = child_terminal_info; procfs_ops.to_find_new_threads = procfs_find_new_threads; @@ -183,6 +186,7 @@ init_procfs_ops (void) procfs_ops.to_has_thread_control = tc_schedlock; procfs_ops.to_find_memory_regions = proc_find_memory_regions; procfs_ops.to_make_corefile_notes = procfs_make_note_section; + procfs_ops.to_can_use_hw_breakpoint = procfs_can_use_hw_breakpoint; procfs_ops.to_magic = OPS_MAGIC; } @@ -5138,6 +5142,37 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, return 0; } +/* Return non-zero if we can set a hardware watchpoint of type TYPE. TYPE + is one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, + or bp_hardware_watchpoint. CNT is the number of watchpoints used so + far. + + Note: procfs_can_use_hw_breakpoint() is not yet used by all + procfs.c targets due to the fact that some of them still define + TARGET_CAN_USE_HARDWARE_WATCHPOINT. */ + +static int +procfs_can_use_hw_breakpoint (int type, int cnt, int othertype) +{ +#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS + return 0; +#else + /* Due to the way that proc_set_watchpoint() is implemented, host + and target pointers must be of the same size. If they are not, + we can't use hardware watchpoints. This limitation is due to the + fact that proc_set_watchpoint() calls address_to_host_pointer(); + a close inspection of address_to_host_pointer will reveal that + an internal error will be generated when the host and target + pointer sizes are different. */ + if (sizeof (void *) != TYPE_LENGTH (builtin_type_void_data_ptr)) + return 0; + + /* Other tests here??? */ + + return 1; +#endif +} + /* * Function: stopped_by_watchpoint * diff --git a/gdb/regcache.c b/gdb/regcache.c index acda8320ff9..ab65c67a47b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -28,6 +28,7 @@ #include "regcache.h" #include "gdb_assert.h" #include "gdb_string.h" +#include "gdbcmd.h" /* For maintenanceprintlist. */ /* * DATA STRUCTURE @@ -76,24 +77,22 @@ struct regcache_descr /* Useful constant. Largest of all the registers. */ long max_register_size; + + /* Cached table containing the type of each register. */ + struct type **register_type; }; -static void * -init_legacy_regcache_descr (struct gdbarch *gdbarch) +void +init_legacy_regcache_descr (struct gdbarch *gdbarch, + struct regcache_descr *descr) { int i; - struct regcache_descr *descr; /* FIXME: cagney/2002-05-11: gdbarch_data() should take that ``gdbarch'' as a parameter. */ gdb_assert (gdbarch != NULL); - descr = XMALLOC (struct regcache_descr); - descr->gdbarch = gdbarch; - descr->legacy_p = 1; - /* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers in the register buffer. Unfortunatly some architectures do. */ - descr->nr_cooked_registers = NUM_REGS + NUM_PSEUDO_REGS; descr->nr_raw_registers = descr->nr_cooked_registers; descr->sizeof_raw_register_valid_p = descr->nr_cooked_registers; @@ -111,6 +110,8 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch) descr->sizeof_register[i] = REGISTER_RAW_SIZE (i); if (descr->max_register_size < REGISTER_RAW_SIZE (i)) descr->max_register_size = REGISTER_RAW_SIZE (i); + if (descr->max_register_size < REGISTER_VIRTUAL_SIZE (i)) + descr->max_register_size = REGISTER_VIRTUAL_SIZE (i); } /* Come up with the real size of the registers buffer. */ @@ -132,7 +133,6 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch) if (descr->sizeof_raw_registers < regend) descr->sizeof_raw_registers = regend; } - return descr; } static void * @@ -142,35 +142,52 @@ init_regcache_descr (struct gdbarch *gdbarch) struct regcache_descr *descr; gdb_assert (gdbarch != NULL); - /* If an old style architecture, construct the register cache - description using all the register macros. */ - if (!gdbarch_pseudo_register_read_p (gdbarch) - && !gdbarch_pseudo_register_write_p (gdbarch)) - return init_legacy_regcache_descr (gdbarch); - - descr = XMALLOC (struct regcache_descr); + /* Create an initial, zero filled, table. */ + descr = XCALLOC (1, struct regcache_descr); descr->gdbarch = gdbarch; - descr->legacy_p = 0; /* Total size of the register space. The raw registers are mapped directly onto the raw register cache while the pseudo's are either mapped onto raw-registers or memory. */ descr->nr_cooked_registers = NUM_REGS + NUM_PSEUDO_REGS; + /* Fill in a table of register types. */ + descr->register_type = XCALLOC (descr->nr_cooked_registers, + struct type *); + for (i = 0; i < descr->nr_cooked_registers; i++) + { + descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i); + } + + /* If an old style architecture, fill in the remainder of the + register cache descriptor using the register macros. */ + if (!gdbarch_pseudo_register_read_p (gdbarch) + && !gdbarch_pseudo_register_write_p (gdbarch)) + { + descr->legacy_p = 1; + init_legacy_regcache_descr (gdbarch, descr); + return descr; + } + /* Construct a strictly RAW register cache. Don't allow pseudo's into the register cache. */ descr->nr_raw_registers = NUM_REGS; - descr->sizeof_raw_register_valid_p = NUM_REGS; + + /* FIXME: cagney/2002-08-13: Overallocate the register_valid_p + array. This pretects GDB from erant code that accesses elements + of the global register_valid_p[] array in the range [NUM_REGS + .. NUM_REGS + NUM_PSEUDO_REGS). */ + descr->sizeof_raw_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS; /* Lay out the register cache. The pseud-registers are included in the layout even though their value isn't stored in the register cache. Some code, via read_register_bytes() access a register using an offset/length rather than a register number. - NOTE: cagney/2002-05-22: Only REGISTER_VIRTUAL_TYPE() needs to be - used when constructing the register cache. It is assumed that - register raw size, virtual size and type length of the type are - all the same. */ + NOTE: cagney/2002-05-22: Only register_type() is used when + constructing the register cache. It is assumed that the + register's raw size, virtual size and type length are all the + same. */ { long offset = 0; @@ -179,7 +196,7 @@ init_regcache_descr (struct gdbarch *gdbarch) descr->max_register_size = 0; for (i = 0; i < descr->nr_cooked_registers; i++) { - descr->sizeof_register[i] = TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i)); + descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]); descr->register_offset[i] = offset; offset += descr->sizeof_register[i]; if (descr->max_register_size < descr->sizeof_register[i]) @@ -233,6 +250,27 @@ xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr) xfree (descr); } +/* Utility functions returning useful register attributes stored in + the regcache descr. */ + +struct type * +register_type (struct gdbarch *gdbarch, int regnum) +{ + struct regcache_descr *descr = regcache_descr (gdbarch); + gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers); + return descr->register_type[regnum]; +} + +/* Utility functions returning useful register attributes stored in + the regcache descr. */ + +int +max_register_size (struct gdbarch *gdbarch) +{ + struct regcache_descr *descr = regcache_descr (gdbarch); + return descr->max_register_size; +} + /* The register cache for storing raw register values. */ struct regcache @@ -365,17 +403,6 @@ regcache_valid_p (struct regcache *regcache, int regnum) return regcache->raw_register_valid_p[regnum]; } -CORE_ADDR -regcache_raw_read_as_address (struct regcache *regcache, int regnum) -{ - char *buf; - gdb_assert (regcache != NULL); - gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers); - buf = alloca (regcache->descr->sizeof_register[regnum]); - regcache_raw_read (regcache, regnum, buf); - return extract_address (buf, regcache->descr->sizeof_register[regnum]); -} - char * deprecated_grub_regcache_for_registers (struct regcache *regcache) { @@ -441,7 +468,9 @@ register_cached (int regnum) void set_register_cached (int regnum, int state) { - register_valid[regnum] = state; + gdb_assert (regnum >= 0); + gdb_assert (regnum < current_regcache->descr->nr_raw_registers); + current_regcache->raw_register_valid_p[regnum] = state; } /* REGISTER_CHANGED @@ -495,7 +524,7 @@ registers_changed (void) gdb gives control to the user (ie watchpoints). */ alloca (0); - for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) + for (i = 0; i < current_regcache->descr->nr_raw_registers; i++) set_register_cached (i, 0); if (registers_changed_hook) @@ -670,6 +699,54 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf) regcache->descr->sizeof_register[regnum]); } +void +regcache_raw_read_signed (struct regcache *regcache, int regnum, LONGEST *val) +{ + char *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + regcache_raw_read (regcache, regnum, buf); + (*val) = extract_signed_integer (buf, + regcache->descr->sizeof_register[regnum]); +} + +void +regcache_raw_read_unsigned (struct regcache *regcache, int regnum, + ULONGEST *val) +{ + char *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + regcache_raw_read (regcache, regnum, buf); + (*val) = extract_unsigned_integer (buf, + regcache->descr->sizeof_register[regnum]); +} + +void +regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val) +{ + void *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + store_signed_integer (buf, regcache->descr->sizeof_register[regnum], val); + regcache_raw_write (regcache, regnum, buf); +} + +void +regcache_raw_write_unsigned (struct regcache *regcache, int regnum, + ULONGEST val) +{ + void *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum], val); + regcache_raw_write (regcache, regnum, buf); +} + void read_register_gen (int regnum, char *buf) { @@ -695,6 +772,32 @@ regcache_cooked_read (struct regcache *regcache, int regnum, void *buf) regnum, buf); } +void +regcache_cooked_read_signed (struct regcache *regcache, int regnum, + LONGEST *val) +{ + char *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + regcache_cooked_read (regcache, regnum, buf); + (*val) = extract_signed_integer (buf, + regcache->descr->sizeof_register[regnum]); +} + +void +regcache_cooked_read_unsigned (struct regcache *regcache, int regnum, + ULONGEST *val) +{ + char *buf; + gdb_assert (regcache != NULL); + gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers); + buf = alloca (regcache->descr->sizeof_register[regnum]); + regcache_cooked_read (regcache, regnum, buf); + (*val) = extract_unsigned_integer (buf, + regcache->descr->sizeof_register[regnum]); +} + /* Write register REGNUM at MYADDR to the target. MYADDR points at REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */ @@ -868,6 +971,175 @@ write_register_bytes (int myregstart, char *myaddr, int inlen) } } +/* Perform a partial register transfer using a read, modify, write + operation. */ + +typedef void (regcache_read_ftype) (struct regcache *regcache, int regnum, + void *buf); +typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, + const void *buf); + +void +regcache_xfer_part (struct regcache *regcache, int regnum, + int offset, int len, void *in, const void *out, + regcache_read_ftype *read, regcache_write_ftype *write) +{ + struct regcache_descr *descr = regcache->descr; + bfd_byte *reg = alloca (descr->max_register_size); + gdb_assert (offset >= 0 && offset <= descr->sizeof_register[regnum]); + gdb_assert (len >= 0 && offset + len <= descr->sizeof_register[regnum]); + /* Something to do? */ + if (offset + len == 0) + return; + /* Read (when needed) ... */ + if (in != NULL + || offset > 0 + || offset + len < descr->sizeof_register[regnum]) + { + gdb_assert (read != NULL); + read (regcache, regnum, reg); + } + /* ... modify ... */ + if (in != NULL) + memcpy (in, reg + offset, len); + if (out != NULL) + memcpy (reg + offset, out, len); + /* ... write (when needed). */ + if (out != NULL) + { + gdb_assert (write != NULL); + write (regcache, regnum, reg); + } +} + +void +regcache_raw_read_part (struct regcache *regcache, int regnum, + int offset, int len, void *buf) +{ + struct regcache_descr *descr = regcache->descr; + gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers); + regcache_xfer_part (regcache, regnum, offset, len, buf, NULL, + regcache_raw_read, regcache_raw_write); +} + +void +regcache_raw_write_part (struct regcache *regcache, int regnum, + int offset, int len, const void *buf) +{ + struct regcache_descr *descr = regcache->descr; + gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers); + regcache_xfer_part (regcache, regnum, offset, len, NULL, buf, + regcache_raw_read, regcache_raw_write); +} + +void +regcache_cooked_read_part (struct regcache *regcache, int regnum, + int offset, int len, void *buf) +{ + struct regcache_descr *descr = regcache->descr; + gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers); + regcache_xfer_part (regcache, regnum, offset, len, buf, NULL, + regcache_cooked_read, regcache_cooked_write); +} + +void +regcache_cooked_write_part (struct regcache *regcache, int regnum, + int offset, int len, const void *buf) +{ + struct regcache_descr *descr = regcache->descr; + gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers); + regcache_xfer_part (regcache, regnum, offset, len, NULL, buf, + regcache_cooked_read, regcache_cooked_write); +} + +/* Hack to keep code that view the register buffer as raw bytes + working. */ + +int +register_offset_hack (struct gdbarch *gdbarch, int regnum) +{ + struct regcache_descr *descr = regcache_descr (gdbarch); + gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers); + return descr->register_offset[regnum]; +} + +static void +cooked_xfer_using_offset_hack (struct regcache *regcache, + int buf_start, int buf_len, void *in_b, + const void *out_b) +{ + struct regcache_descr *descr = regcache->descr; + struct gdbarch *gdbarch = descr->gdbarch; + bfd_byte *in_buf = in_b; + const bfd_byte *out_buf = out_b; + int buf_end = buf_start + buf_len; + int regnum; + char *reg_buf = alloca (descr->max_register_size); + + /* NOTE: cagney/2002-08-17: This code assumes that the register + offsets are strictly increasing and do not overlap. If this + isn't the case then the bug is in the target architecture and NOT + this code. */ + + /* NOTE: cagney/2002-08-17: This code assumes that only the + registers covered by BUF_START:BUF_LEN should be transfered. If, + for some reason, there is a gap between two registers, then that + gap isn't transfered. (The gap shouldn't be there but that is + another story.) */ + + /* Iterate through all registers looking for those that lie within + BUF_START:BUF_LEN. */ + + for (regnum = 0; regnum < descr->nr_cooked_registers; regnum++) + { + /* The register's location. */ + int reg_start = descr->register_offset[regnum]; + int reg_len = descr->sizeof_register[regnum]; + int reg_end = reg_start + reg_len; + + /* The START, END and LEN that falls within the current + register. */ + int xfer_start; + int xfer_end; + int xfer_len; + + /* start = max (reg_start, buf_start) */ + if (reg_start > buf_start) + xfer_start = reg_start; + else + xfer_start = buf_start; + + /* end = min (reg_end, buf_end) */ + if (reg_end < buf_end) + xfer_end = reg_end; + else + xfer_end = buf_end; + + /* The number of bytes to transfer. If there isn't anything to + transfer (the end is before the start) this will be -ve. */ + xfer_len = xfer_end - xfer_start; + + if (xfer_len > 0) + regcache_xfer_part (regcache, regnum, xfer_start - reg_start, + xfer_len, in_b, out_b, regcache_cooked_read, + regcache_cooked_write); + } +} + +void +regcache_cooked_read_using_offset_hack (struct regcache *regcache, + int buf_start, int buf_len, void *b) +{ + cooked_xfer_using_offset_hack (regcache, buf_start, buf_len, b, NULL); +} + +void +regcache_cooked_write_using_offset_hack (struct regcache *regcache, + int buf_start, int buf_len, + const void *b) +{ + cooked_xfer_using_offset_hack (regcache, buf_start, buf_len, NULL, b); +} /* Return the contents of register REGNUM as an unsigned integer. */ @@ -1185,6 +1457,245 @@ build_regcache (void) register_valid = deprecated_grub_regcache_for_register_valid (current_regcache); } +static void +dump_endian_bytes (struct ui_file *file, enum bfd_endian endian, + const unsigned char *buf, long len) +{ + int i; + switch (endian) + { + case BFD_ENDIAN_BIG: + for (i = 0; i < len; i++) + fprintf_unfiltered (file, "%02x", buf[i]); + break; + case BFD_ENDIAN_LITTLE: + for (i = len - 1; i >= 0; i--) + fprintf_unfiltered (file, "%02x", buf[i]); + break; + default: + internal_error (__FILE__, __LINE__, "Bad switch"); + } +} + +enum regcache_dump_what +{ + regcache_dump_none, regcache_dump_raw, regcache_dump_cooked +}; + +static void +regcache_dump (struct regcache *regcache, struct ui_file *file, + enum regcache_dump_what what_to_dump) +{ + struct cleanup *cleanups = make_cleanup (null_cleanup, NULL); + int regnum; + int footnote_nr = 0; + int footnote_register_size = 0; + int footnote_register_offset = 0; + int footnote_register_type_name_null = 0; + long register_offset = 0; + unsigned char *buf = alloca (regcache->descr->max_register_size); + +#if 0 + fprintf_unfiltered (file, "legacy_p %d\n", regcache->descr->legacy_p); + fprintf_unfiltered (file, "nr_raw_registers %d\n", + regcache->descr->nr_raw_registers); + fprintf_unfiltered (file, "nr_cooked_registers %d\n", + regcache->descr->nr_cooked_registers); + fprintf_unfiltered (file, "sizeof_raw_registers %ld\n", + regcache->descr->sizeof_raw_registers); + fprintf_unfiltered (file, "sizeof_raw_register_valid_p %ld\n", + regcache->descr->sizeof_raw_register_valid_p); + fprintf_unfiltered (file, "max_register_size %ld\n", + regcache->descr->max_register_size); + fprintf_unfiltered (file, "NUM_REGS %d\n", NUM_REGS); + fprintf_unfiltered (file, "NUM_PSEUDO_REGS %d\n", NUM_PSEUDO_REGS); +#endif + + gdb_assert (regcache->descr->nr_cooked_registers + == (NUM_REGS + NUM_PSEUDO_REGS)); + + for (regnum = -1; regnum < regcache->descr->nr_cooked_registers; regnum++) + { + /* Name. */ + if (regnum < 0) + fprintf_unfiltered (file, " %-10s", "Name"); + else + { + const char *p = REGISTER_NAME (regnum); + if (p == NULL) + p = ""; + else if (p[0] == '\0') + p = "''"; + fprintf_unfiltered (file, " %-10s", p); + } + + /* Number. */ + if (regnum < 0) + fprintf_unfiltered (file, " %4s", "Nr"); + else + fprintf_unfiltered (file, " %4d", regnum); + + /* Relative number. */ + if (regnum < 0) + fprintf_unfiltered (file, " %4s", "Rel"); + else if (regnum < NUM_REGS) + fprintf_unfiltered (file, " %4d", regnum); + else + fprintf_unfiltered (file, " %4d", (regnum - NUM_REGS)); + + /* Offset. */ + if (regnum < 0) + fprintf_unfiltered (file, " %6s ", "Offset"); + else + { + fprintf_unfiltered (file, " %6ld", + regcache->descr->register_offset[regnum]); + if (register_offset != regcache->descr->register_offset[regnum] + || register_offset != REGISTER_BYTE (regnum) + || (regnum > 0 + && (regcache->descr->register_offset[regnum] + != (regcache->descr->register_offset[regnum - 1] + + regcache->descr->sizeof_register[regnum - 1]))) + ) + { + if (!footnote_register_offset) + footnote_register_offset = ++footnote_nr; + fprintf_unfiltered (file, "*%d", footnote_register_offset); + } + else + fprintf_unfiltered (file, " "); + register_offset = (regcache->descr->register_offset[regnum] + + regcache->descr->sizeof_register[regnum]); + } + + /* Size. */ + if (regnum < 0) + fprintf_unfiltered (file, " %5s ", "Size"); + else + { + fprintf_unfiltered (file, " %5ld", + regcache->descr->sizeof_register[regnum]); + if ((regcache->descr->sizeof_register[regnum] + != REGISTER_RAW_SIZE (regnum)) + || (regcache->descr->sizeof_register[regnum] + != REGISTER_VIRTUAL_SIZE (regnum)) + || (regcache->descr->sizeof_register[regnum] + != TYPE_LENGTH (register_type (regcache->descr->gdbarch, + regnum))) + ) + { + if (!footnote_register_size) + footnote_register_size = ++footnote_nr; + fprintf_unfiltered (file, "*%d", footnote_register_size); + } + else + fprintf_unfiltered (file, " "); + } + + /* Type. */ + if (regnum < 0) + fprintf_unfiltered (file, " %-20s", "Type"); + else + { + static const char blt[] = "builtin_type"; + const char *t = TYPE_NAME (register_type (regcache->descr->gdbarch, + regnum)); + if (t == NULL) + { + char *n; + if (!footnote_register_type_name_null) + footnote_register_type_name_null = ++footnote_nr; + xasprintf (&n, "*%d", footnote_register_type_name_null); + make_cleanup (xfree, n); + t = n; + } + /* Chop a leading builtin_type. */ + if (strncmp (t, blt, strlen (blt)) == 0) + t += strlen (blt); + fprintf_unfiltered (file, " %-20s", t); + } + + /* Value, raw. */ + if (what_to_dump == regcache_dump_raw) + { + if (regnum < 0) + fprintf_unfiltered (file, "Raw value"); + else if (regnum >= regcache->descr->nr_raw_registers) + fprintf_unfiltered (file, ""); + else if (!regcache_valid_p (regcache, regnum)) + fprintf_unfiltered (file, ""); + else + { + regcache_raw_read (regcache, regnum, buf); + fprintf_unfiltered (file, "0x"); + dump_endian_bytes (file, TARGET_BYTE_ORDER, buf, + REGISTER_RAW_SIZE (regnum)); + } + } + + /* Value, cooked. */ + if (what_to_dump == regcache_dump_cooked) + { + if (regnum < 0) + fprintf_unfiltered (file, "Cooked value"); + else + { + regcache_cooked_read (regcache, regnum, buf); + fprintf_unfiltered (file, "0x"); + dump_endian_bytes (file, TARGET_BYTE_ORDER, buf, + REGISTER_VIRTUAL_SIZE (regnum)); + } + } + + fprintf_unfiltered (file, "\n"); + } + + if (footnote_register_size) + fprintf_unfiltered (file, "*%d: Inconsistent register sizes.\n", + footnote_register_size); + if (footnote_register_offset) + fprintf_unfiltered (file, "*%d: Inconsistent register offsets.\n", + footnote_register_offset); + if (footnote_register_type_name_null) + fprintf_unfiltered (file, + "*%d: Register type's name NULL.\n", + footnote_register_type_name_null); + do_cleanups (cleanups); +} + +static void +regcache_print (char *args, enum regcache_dump_what what_to_dump) +{ + if (args == NULL) + regcache_dump (current_regcache, gdb_stdout, what_to_dump); + else + { + struct ui_file *file = gdb_fopen (args, "w"); + if (file == NULL) + perror_with_name ("maintenance print architecture"); + regcache_dump (current_regcache, file, what_to_dump); + ui_file_delete (file); + } +} + +static void +maintenance_print_registers (char *args, int from_tty) +{ + regcache_print (args, regcache_dump_none); +} + +static void +maintenance_print_raw_registers (char *args, int from_tty) +{ + regcache_print (args, regcache_dump_raw); +} + +static void +maintenance_print_cooked_registers (char *args, int from_tty) +{ + regcache_print (args, regcache_dump_cooked); +} + void _initialize_regcache (void) { @@ -1201,4 +1712,21 @@ _initialize_regcache (void) /* Initialize the thread/process associated with the current set of registers. For now, -1 is special, and means `no current process'. */ registers_ptid = pid_to_ptid (-1); + + add_cmd ("registers", class_maintenance, + maintenance_print_registers, + "Print the internal register configuration.\ +Takes an optional file parameter.", + &maintenanceprintlist); + add_cmd ("raw-registers", class_maintenance, + maintenance_print_raw_registers, + "Print the internal register configuration including raw values.\ +Takes an optional file parameter.", + &maintenanceprintlist); + add_cmd ("cooked-registers", class_maintenance, + maintenance_print_cooked_registers, + "Print the internal register configuration including cooked values.\ +Takes an optional file parameter.", + &maintenanceprintlist); + } diff --git a/gdb/regcache.h b/gdb/regcache.h index 5ca7babad67..4ddcda38104 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -38,14 +38,52 @@ struct regcache *regcache_xmalloc (struct gdbarch *gdbarch); void regcache_raw_read (struct regcache *regcache, int rawnum, void *buf); void regcache_raw_write (struct regcache *regcache, int rawnum, const void *buf); +extern void regcache_raw_read_signed (struct regcache *regcache, + int regnum, LONGEST *val); +extern void regcache_raw_read_unsigned (struct regcache *regcache, + int regnum, ULONGEST *val); +extern void regcache_raw_write_signed (struct regcache *regcache, + int regnum, LONGEST val); +extern void regcache_raw_write_unsigned (struct regcache *regcache, + int regnum, ULONGEST val); + +/* Partial transfer of a raw registers. These perform read, modify, + write style operations. */ + +void regcache_raw_read_part (struct regcache *regcache, int regnum, + int offset, int len, void *buf); +void regcache_raw_write_part (struct regcache *regcache, int regnum, + int offset, int len, const void *buf); + int regcache_valid_p (struct regcache *regcache, int regnum); -CORE_ADDR regcache_raw_read_as_address (struct regcache *regcache, int rawnum); /* Transfer a cooked register [0..NUM_REGS+NUM_PSEUDO_REGS). */ void regcache_cooked_read (struct regcache *regcache, int rawnum, void *buf); void regcache_cooked_write (struct regcache *regcache, int rawnum, const void *buf); +/* NOTE: cagney/2002-08-13: At present GDB has no reliable mechanism + for indicating when a ``cooked'' register was constructed from + invalid or unavailable ``raw'' registers. One fairly easy way of + adding such a mechanism would be for the cooked functions to return + a register valid indication. Given the possibility of such a + change, the extract functions below use a reference parameter, + rather than a function result. */ + +/* Read a register as a signed/unsigned quantity. */ +extern void regcache_cooked_read_signed (struct regcache *regcache, + int regnum, LONGEST *val); +extern void regcache_cooked_read_unsigned (struct regcache *regcache, + int regnum, ULONGEST *val); + +/* Partial transfer of a cooked register. These perform read, modify, + write style operations. */ + +void regcache_cooked_read_part (struct regcache *regcache, int regnum, + int offset, int len, void *buf); +void regcache_cooked_write_part (struct regcache *regcache, int regnum, + int offset, int len, const void *buf); + /* Transfer a raw register [0..NUM_REGS) between the regcache and the target. These functions are called by the target in response to a target_fetch_registers() or target_store_registers(). */ @@ -54,6 +92,58 @@ extern void supply_register (int regnum, const void *val); extern void regcache_collect (int regnum, void *buf); +/* The register's ``offset''. + + NOTE: cagney/2002-08-17: The ``struct value'' and expression + evaluator treat the register cache as a large liner buffer. + Instead of reading/writing a register using its register number, + the code read/writes registers by specifying their offset into the + buffer and a number of bytes. The code also assumes that these + byte read/writes can cross register boundaries, adjacent registers + treated as a contiguous set of bytes. + + The below map that model onto the real register cache. New code + should go out of their way to avoid using these interfaces. + + FIXME: cagney/2002-08-17: The ``struct value'' and expression + evaluator should be fixed. Instead of using the { offset, length } + pair to describe a value within one or more registers, the code + should use a chain of { regnum, offset, len } tripples. */ + +extern int register_offset_hack (struct gdbarch *gdbarch, int regnum); +extern void regcache_cooked_read_using_offset_hack (struct regcache *regcache, + int offset, int len, + void *buf); +extern void regcache_cooked_write_using_offset_hack (struct regcache *regcache, + int offset, int len, + const void *buf); + + +/* The type of a register. This function is slightly more efficient + then its gdbarch vector counterpart since it returns a precomputed + value stored in a table. + + NOTE: cagney/2002-08-17: The original macro was called + REGISTER_VIRTUAL_TYPE. This was because the register could have + different raw and cooked (nee virtual) representations. The + CONVERTABLE methods being used to convert between the two + representations. Current code does not do this. Instead, the + first [0..NUM_REGS) registers are 1:1 raw:cooked, and the type + exactly describes the register's representation. Consequently, the + ``virtual'' has been dropped. + + FIXME: cagney/2002-08-17: A number of architectures, including the + MIPS, are currently broken in this regard. */ + +extern struct type *register_type (struct gdbarch *gdbarch, int regnum); + + +/* Return the size of the largest register. Used when allocating + space for an aribtrary register value. */ + +extern int max_register_size (struct gdbarch *gdbarch); + + /* DEPRECATED: Character array containing an image of the inferior programs' registers for the most recently referenced thread. */ diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c index 679dfad919e..ffbe7d850df 100644 --- a/gdb/remote-nindy.c +++ b/gdb/remote-nindy.c @@ -1,762 +1,762 @@ -/* Memory-access and commands for remote NINDY process, for GDB. - - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002 Free Software Foundation, Inc. - - Contributed by Intel Corporation. Modified from remote.c by Chris Benenati. - - GDB is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY. No author or distributor accepts responsibility to anyone - for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. - Refer to the GDB General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GDB, - but only under the conditions described in the GDB General Public - License. A copy of this license is supposed to have been given to you - along with GDB so you can know your rights and responsibilities. It - should be in a file named COPYING. Among other things, the copyright - notice and this notice must be preserved on all copies. - - In other words, go ahead and share GDB, but don't try to stop - anyone else from sharing it farther. Help stamp out software hoarding! */ - -/* - Except for the data cache routines, this file bears little resemblence - to remote.c. A new (although similar) protocol has been specified, and - portions of the code are entirely dependent on having an i80960 with a - NINDY ROM monitor at the other end of the line. - */ - -/***************************************************************************** - * - * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR. - * - * - * MODES OF OPERATION - * ----- -- --------- - * - * As far as NINDY is concerned, GDB is always in one of two modes: command - * mode or passthrough mode. - * - * In command mode (the default) pre-defined packets containing requests - * are sent by GDB to NINDY. NINDY never talks except in reponse to a request. - * - * Once the the user program is started, GDB enters passthrough mode, to give - * the user program access to the terminal. GDB remains in this mode until - * NINDY indicates that the program has stopped. - * - * - * PASSTHROUGH MODE - * ----------- ---- - * - * GDB writes all input received from the keyboard directly to NINDY, and writes - * all characters received from NINDY directly to the monitor. - * - * Keyboard input is neither buffered nor echoed to the monitor. - * - * GDB remains in passthrough mode until NINDY sends a single ^P character, - * to indicate that the user process has stopped. - * - * Note: - * GDB assumes NINDY performs a 'flushreg' when the user program stops. - * - * - * COMMAND MODE - * ------- ---- - * - * All info (except for message ack and nak) is transferred between gdb - * and the remote processor in messages of the following format: - * - * # - * - * where - * # is a literal character - * - * ASCII information; all numeric information is in the - * form of hex digits ('0'-'9' and lowercase 'a'-'f'). - * - * - * is a pair of ASCII hex digits representing an 8-bit - * checksum formed by adding together each of the - * characters in . - * - * The receiver of a message always sends a single character to the sender - * to indicate that the checksum was good ('+') or bad ('-'); the sender - * re-transmits the entire message over until a '+' is received. - * - * In response to a command NINDY always sends back either data or - * a result code of the form "Xnn", where "nn" are hex digits and "X00" - * means no errors. (Exceptions: the "s" and "c" commands don't respond.) - * - * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A - * FULL DESCRIPTION OF LEGAL COMMANDS. - * - * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST - * OF STOP CODES. - * - ***************************************************************************/ - -#include "defs.h" -#include -#include -#include - -#include "frame.h" -#include "inferior.h" -#include "bfd.h" -#include "symfile.h" -#include "target.h" -#include "gdbcore.h" -#include "command.h" -#include "floatformat.h" -#include "regcache.h" - -#include -#include -#include "serial.h" -#include "nindy-share/env.h" -#include "nindy-share/stop.h" -#include "remote-utils.h" - -extern int unlink (); -extern char *getenv (); -extern char *mktemp (); - -extern void generic_mourn_inferior (); - -extern struct target_ops nindy_ops; -extern FILE *instream; - -extern char ninStopWhy (); -extern int ninMemGet (); -extern int ninMemPut (); - -int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */ -int nindy_old_protocol; /* nonzero if want to use old protocol */ -char *nindy_ttyname; /* name of tty to talk to nindy on, or null */ - -#define DLE '\020' /* Character NINDY sends to indicate user program has - * halted. */ -#define TRUE 1 -#define FALSE 0 - -/* From nindy-share/nindy.c. */ -extern struct serial *nindy_serial; - -static int have_regs = 0; /* 1 iff regs read since i960 last halted */ -static int regs_changed = 0; /* 1 iff regs were modified since last read */ - -extern char *exists (); - -static void nindy_fetch_registers (int); - -static void nindy_store_registers (int); - -static char *savename; - -static void -nindy_close (int quitting) -{ - if (nindy_serial != NULL) - serial_close (nindy_serial); - nindy_serial = NULL; - - if (savename) - xfree (savename); - savename = 0; -} - -/* Open a connection to a remote debugger. - FIXME, there should be "set" commands for the options that are - now specified with gdb command-line options (old_protocol, - and initial_brk). */ -void -nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */ - int from_tty) -{ - char baudrate[1024]; - - if (!name) - error_no_arg ("serial port device name"); - - target_preopen (from_tty); - - nindy_close (0); - - have_regs = regs_changed = 0; - - /* Allow user to interrupt the following -- we could hang if there's - no NINDY at the other end of the remote tty. */ - immediate_quit++; - /* If baud_rate is -1, then ninConnect will not recognize the baud rate - and will deal with the situation in a (more or less) reasonable - fashion. */ - sprintf (baudrate, "%d", baud_rate); - ninConnect (name, baudrate, - nindy_initial_brk, !from_tty, nindy_old_protocol); - immediate_quit--; - - if (nindy_serial == NULL) - { - perror_with_name (name); - } - - savename = savestring (name, strlen (name)); - push_target (&nindy_ops); - - target_fetch_registers (-1); - - init_thread_list (); - init_wait_for_inferior (); - clear_proceed_status (); - normal_stop (); -} - -/* User-initiated quit of nindy operations. */ - -static void -nindy_detach (char *name, int from_tty) -{ - if (name) - error ("Too many arguments"); - pop_target (); -} - -static void -nindy_files_info (void) -{ - /* FIXME: this lies about the baud rate if we autobauded. */ - printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename, - baud_rate, - nindy_old_protocol ? " in old protocol" : "", - nindy_initial_brk ? " with initial break" : ""); -} - -/* Return the number of characters in the buffer BUF before - the first DLE character. N is maximum number of characters to - consider. */ - -static -int -non_dle (char *buf, int n) -{ - int i; - - for (i = 0; i < n; i++) - { - if (buf[i] == DLE) - { - break; - } - } - return i; -} - -/* Tell the remote machine to resume. */ - -void -nindy_resume (ptid_t ptid, int step, enum target_signal siggnal) -{ - if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal) - warning ("Can't send signals to remote NINDY targets."); - - if (regs_changed) - { - nindy_store_registers (-1); - regs_changed = 0; - } - have_regs = 0; - ninGo (step); -} - -/* FIXME, we can probably use the normal terminal_inferior stuff here. - We have to do terminal_inferior and then set up the passthrough - settings initially. Thereafter, terminal_ours and terminal_inferior - will automatically swap the settings around for us. */ - -struct clean_up_tty_args -{ - serial_ttystate state; - struct serial *serial; -}; -static struct clean_up_tty_args tty_args; - -static void -clean_up_tty (PTR ptrarg) -{ - struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg; - serial_set_tty_state (args->serial, args->state); - xfree (args->state); - warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); -} - -/* Recover from ^Z or ^C while remote process is running */ -static void (*old_ctrlc) (); -#ifdef SIGTSTP -static void (*old_ctrlz) (); -#endif - -static void -clean_up_int (void) -{ - serial_set_tty_state (tty_args.serial, tty_args.state); - xfree (tty_args.state); - - signal (SIGINT, old_ctrlc); -#ifdef SIGTSTP - signal (SIGTSTP, old_ctrlz); -#endif - error ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); -} - -/* Wait until the remote machine stops. While waiting, operate in passthrough - * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from - * stdin to NINDY. - * - * Return to caller, storing status in 'status' just as `wait' would. - */ - -static ptid_t -nindy_wait (ptid_t ptid, struct target_waitstatus *status) -{ - fd_set fds; - int c; - char buf[2]; - int i, n; - unsigned char stop_exit; - unsigned char stop_code; - struct cleanup *old_cleanups; - long ip_value, fp_value, sp_value; /* Reg values from stop */ - - status->kind = TARGET_WAITKIND_EXITED; - status->value.integer = 0; - - /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */ - - /* Save current tty attributes, and restore them when done. */ - tty_args.serial = serial_fdopen (0); - tty_args.state = serial_get_tty_state (tty_args.serial); - old_ctrlc = signal (SIGINT, clean_up_int); -#ifdef SIGTSTP - old_ctrlz = signal (SIGTSTP, clean_up_int); -#endif - - old_cleanups = make_cleanup (clean_up_tty, &tty_args); - - /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret - and perform echo. */ - /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close - enough. */ - serial_raw (tty_args.serial); - - while (1) - { - /* Input on remote */ - c = serial_readchar (nindy_serial, -1); - if (c == SERIAL_ERROR) - { - error ("Cannot read from serial line"); - } - else if (c == 0x1b) /* ESC */ - { - c = serial_readchar (nindy_serial, -1); - c &= ~0x40; - } - else if (c != 0x10) /* DLE */ - /* Write out any characters preceding DLE */ - { - buf[0] = (char) c; - write (1, buf, 1); - } - else - { - stop_exit = ninStopWhy (&stop_code, - &ip_value, &fp_value, &sp_value); - if (!stop_exit && (stop_code == STOP_SRQ)) - { - immediate_quit++; - ninSrq (); - immediate_quit--; - } - else - { - /* Get out of loop */ - supply_register (IP_REGNUM, - (char *) &ip_value); - supply_register (FP_REGNUM, - (char *) &fp_value); - supply_register (SP_REGNUM, - (char *) &sp_value); - break; - } - } - } - - serial_set_tty_state (tty_args.serial, tty_args.state); - xfree (tty_args.state); - discard_cleanups (old_cleanups); - - if (stop_exit) - { - status->kind = TARGET_WAITKIND_EXITED; - status->value.integer = stop_code; - } - else - { - /* nindy has some special stop code need to be handled */ - if (stop_code == STOP_GDB_BPT) - stop_code = TRACE_STEP; - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = i960_fault_to_signal (stop_code); - } - return inferior_ptid; -} - -/* Read the remote registers into the block REGS. */ - -/* This is the block that ninRegsGet and ninRegsPut handles. */ -struct nindy_regs -{ - char local_regs[16 * 4]; - char global_regs[16 * 4]; - char pcw_acw[2 * 4]; - char ip[4]; - char tcw[4]; - char fp_as_double[4 * 8]; -}; - -static void -nindy_fetch_registers (int regno) -{ - struct nindy_regs nindy_regs; - int regnum; - - immediate_quit++; - ninRegsGet ((char *) &nindy_regs); - immediate_quit--; - - memcpy (®isters[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4); - memcpy (®isters[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4); - memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4); - memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4); - memcpy (®isters[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4); - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8); - - registers_fetched (); -} - -static void -nindy_prepare_to_store (void) -{ - /* Fetch all regs if they aren't already here. */ - read_register_bytes (0, NULL, REGISTER_BYTES); -} - -static void -nindy_store_registers (int regno) -{ - struct nindy_regs nindy_regs; - int regnum; - - memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * 4); - memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * 4); - memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2 * 4); - memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1 * 4); - memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1 * 4); - memcpy (nindy_regs.fp_as_double, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8 * 4); - - immediate_quit++; - ninRegsPut ((char *) &nindy_regs); - immediate_quit--; -} - -/* Copy LEN bytes to or from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. Copy to inferior if - SHOULD_WRITE is nonzero. Returns the length copied. TARGET is - unused. */ - -int -nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, - int should_write, struct mem_attrib *attrib, - struct target_ops *target) -{ - int res; - - if (len <= 0) - return 0; - - if (should_write) - res = ninMemPut (memaddr, myaddr, len); - else - res = ninMemGet (memaddr, myaddr, len); - - return res; -} - -static void -nindy_create_inferior (char *execfile, char *args, char **env) -{ - int entry_pt; - int pid; - - if (args && *args) - error ("Can't pass arguments to remote NINDY process"); - - if (execfile == 0 || exec_bfd == 0) - error ("No executable file specified"); - - entry_pt = (int) bfd_get_start_address (exec_bfd); - - pid = 42; - - /* The "process" (board) is already stopped awaiting our commands, and - the program is already downloaded. We just set its PC and go. */ - - inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */ - - clear_proceed_status (); - - /* Tell wait_for_inferior that we've started a new process. */ - init_wait_for_inferior (); - - /* Set up the "saved terminal modes" of the inferior - based on what modes we are starting it with. */ - target_terminal_init (); - - /* Install inferior's terminal modes. */ - target_terminal_inferior (); - - /* insert_step_breakpoint (); FIXME, do we need this? */ - /* Let 'er rip... */ - proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); -} - -static void -reset_command (char *args, int from_tty) -{ - if (nindy_serial == NULL) - { - error ("No target system to reset -- use 'target nindy' command."); - } - if (query ("Really reset the target system?", 0, 0)) - { - serial_send_break (nindy_serial); - tty_flush (nindy_serial); - } -} - -void -nindy_kill (char *args, int from_tty) -{ - return; /* Ignore attempts to kill target system */ -} - -/* Clean up when a program exits. - - The program actually lives on in the remote processor's RAM, and may be - run again without a download. Don't leave it full of breakpoint - instructions. */ - -void -nindy_mourn_inferior (void) -{ - remove_breakpoints (); - unpush_target (&nindy_ops); - generic_mourn_inferior (); /* Do all the proper things now */ -} - -/* Pass the args the way catch_errors wants them. */ -static int -nindy_open_stub (char *arg) -{ - nindy_open (arg, 1); - return 1; -} - -static void -nindy_load (char *filename, int from_tty) -{ - asection *s; - /* Can't do unix style forking on a VMS system, so we'll use bfd to do - all the work for us - */ - - bfd *file = bfd_openr (filename, 0); - if (!file) - { - perror_with_name (filename); - return; - } - - if (!bfd_check_format (file, bfd_object)) - { - error ("can't prove it's an object file\n"); - return; - } - - for (s = file->sections; s; s = s->next) - { - if (s->flags & SEC_LOAD) - { - char *buffer = xmalloc (s->_raw_size); - bfd_get_section_contents (file, s, buffer, 0, s->_raw_size); - printf ("Loading section %s, size %x vma %x\n", - s->name, - s->_raw_size, - s->vma); - ninMemPut (s->vma, buffer, s->_raw_size); - xfree (buffer); - } - } - bfd_close (file); -} - -static int -load_stub (char *arg) -{ - target_load (arg, 1); - return 1; -} - -/* This routine is run as a hook, just before the main command loop is - entered. If gdb is configured for the i960, but has not had its - nindy target specified yet, this will loop prompting the user to do so. - - Unlike the loop provided by Intel, we actually let the user get out - of this with a RETURN. This is useful when e.g. simply examining - an i960 object file on the host system. */ - -void -nindy_before_main_loop (void) -{ - char ttyname[100]; - char *p, *p2; - - while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */ - { /* remote tty not specified yet */ - if (instream == stdin) - { - printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: "); - gdb_flush (gdb_stdout); - } - fgets (ttyname, sizeof (ttyname) - 1, stdin); - - /* Strip leading and trailing whitespace */ - for (p = ttyname; isspace (*p); p++) - { - ; - } - if (*p == '\0') - { - return; /* User just hit spaces or return, wants out */ - } - for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++) - { - ; - } - *p2 = '\0'; - if (STREQ ("quit", p)) - { - exit (1); - } - - if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL)) - { - /* Now that we have a tty open for talking to the remote machine, - download the executable file if one was specified. */ - if (exec_bfd) - { - catch_errors (load_stub, bfd_get_filename (exec_bfd), "", - RETURN_MASK_ALL); - } - } - } -} - -/* Define the target subroutine names */ - -struct target_ops nindy_ops; - -static void -init_nindy_ops (void) -{ - nindy_ops.to_shortname = "nindy"; - "Remote serial target in i960 NINDY-specific protocol", - nindy_ops.to_longname = "Use a remote i960 system running NINDY connected by a serial line.\n\ -Specify the name of the device the serial line is connected to.\n\ -The speed (baud rate), whether to use the old NINDY protocol,\n\ -and whether to send a break on startup, are controlled by options\n\ -specified when you started GDB."; - nindy_ops.to_doc = ""; - nindy_ops.to_open = nindy_open; - nindy_ops.to_close = nindy_close; - nindy_ops.to_attach = 0; - nindy_ops.to_post_attach = NULL; - nindy_ops.to_require_attach = NULL; - nindy_ops.to_detach = nindy_detach; - nindy_ops.to_require_detach = NULL; - nindy_ops.to_resume = nindy_resume; - nindy_ops.to_wait = nindy_wait; - nindy_ops.to_post_wait = NULL; - nindy_ops.to_fetch_registers = nindy_fetch_registers; - nindy_ops.to_store_registers = nindy_store_registers; - nindy_ops.to_prepare_to_store = nindy_prepare_to_store; - nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory; - nindy_ops.to_files_info = nindy_files_info; - nindy_ops.to_insert_breakpoint = memory_insert_breakpoint; - nindy_ops.to_remove_breakpoint = memory_remove_breakpoint; - nindy_ops.to_terminal_init = 0; - nindy_ops.to_terminal_inferior = 0; - nindy_ops.to_terminal_ours_for_output = 0; - nindy_ops.to_terminal_ours = 0; - nindy_ops.to_terminal_info = 0; /* Terminal crud */ - nindy_ops.to_kill = nindy_kill; - nindy_ops.to_load = nindy_load; - nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */ - nindy_ops.to_create_inferior = nindy_create_inferior; - nindy_ops.to_post_startup_inferior = NULL; - nindy_ops.to_acknowledge_created_inferior = NULL; - nindy_ops.to_clone_and_follow_inferior = NULL; - nindy_ops.to_post_follow_inferior_by_clone = NULL; - nindy_ops.to_insert_fork_catchpoint = NULL; - nindy_ops.to_remove_fork_catchpoint = NULL; - nindy_ops.to_insert_vfork_catchpoint = NULL; - nindy_ops.to_remove_vfork_catchpoint = NULL; - nindy_ops.to_has_forked = NULL; - nindy_ops.to_has_vforked = NULL; - nindy_ops.to_can_follow_vfork_prior_to_exec = NULL; - nindy_ops.to_post_follow_vfork = NULL; - nindy_ops.to_insert_exec_catchpoint = NULL; - nindy_ops.to_remove_exec_catchpoint = NULL; - nindy_ops.to_has_execd = NULL; - nindy_ops.to_reported_exec_events_per_exec_call = NULL; - nindy_ops.to_has_exited = NULL; - nindy_ops.to_mourn_inferior = nindy_mourn_inferior; - nindy_ops.to_can_run = 0; /* can_run */ - nindy_ops.to_notice_signals = 0; /* notice_signals */ - nindy_ops.to_thread_alive = 0; /* to_thread_alive */ - nindy_ops.to_stop = 0; /* to_stop */ - nindy_ops.to_pid_to_exec_file = NULL; - nindy_ops.to_stratum = process_stratum; - nindy_ops.DONT_USE = 0; /* next */ - nindy_ops.to_has_all_memory = 1; - nindy_ops.to_has_memory = 1; - nindy_ops.to_has_stack = 1; - nindy_ops.to_has_registers = 1; - nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */ - nindy_ops.to_sections = 0; - nindy_ops.to_sections_end = 0; /* Section pointers */ - nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */ -} - -void -_initialize_nindy (void) -{ - init_nindy_ops (); - add_target (&nindy_ops); - add_com ("reset", class_obscure, reset_command, - "Send a 'break' to the remote target system.\n\ -Only useful if the target has been equipped with a circuit\n\ -to perform a hard reset when a break is detected."); -} +// OBSOLETE /* Memory-access and commands for remote NINDY process, for GDB. +// OBSOLETE +// OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, +// OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE Contributed by Intel Corporation. Modified from remote.c by Chris Benenati. +// OBSOLETE +// OBSOLETE GDB is distributed in the hope that it will be useful, but WITHOUT ANY +// OBSOLETE WARRANTY. No author or distributor accepts responsibility to anyone +// OBSOLETE for the consequences of using it or for whether it serves any +// OBSOLETE particular purpose or works at all, unless he says so in writing. +// OBSOLETE Refer to the GDB General Public License for full details. +// OBSOLETE +// OBSOLETE Everyone is granted permission to copy, modify and redistribute GDB, +// OBSOLETE but only under the conditions described in the GDB General Public +// OBSOLETE License. A copy of this license is supposed to have been given to you +// OBSOLETE along with GDB so you can know your rights and responsibilities. It +// OBSOLETE should be in a file named COPYING. Among other things, the copyright +// OBSOLETE notice and this notice must be preserved on all copies. +// OBSOLETE +// OBSOLETE In other words, go ahead and share GDB, but don't try to stop +// OBSOLETE anyone else from sharing it farther. Help stamp out software hoarding! */ +// OBSOLETE +// OBSOLETE /* +// OBSOLETE Except for the data cache routines, this file bears little resemblence +// OBSOLETE to remote.c. A new (although similar) protocol has been specified, and +// OBSOLETE portions of the code are entirely dependent on having an i80960 with a +// OBSOLETE NINDY ROM monitor at the other end of the line. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE /***************************************************************************** +// OBSOLETE * +// OBSOLETE * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR. +// OBSOLETE * +// OBSOLETE * +// OBSOLETE * MODES OF OPERATION +// OBSOLETE * ----- -- --------- +// OBSOLETE * +// OBSOLETE * As far as NINDY is concerned, GDB is always in one of two modes: command +// OBSOLETE * mode or passthrough mode. +// OBSOLETE * +// OBSOLETE * In command mode (the default) pre-defined packets containing requests +// OBSOLETE * are sent by GDB to NINDY. NINDY never talks except in reponse to a request. +// OBSOLETE * +// OBSOLETE * Once the the user program is started, GDB enters passthrough mode, to give +// OBSOLETE * the user program access to the terminal. GDB remains in this mode until +// OBSOLETE * NINDY indicates that the program has stopped. +// OBSOLETE * +// OBSOLETE * +// OBSOLETE * PASSTHROUGH MODE +// OBSOLETE * ----------- ---- +// OBSOLETE * +// OBSOLETE * GDB writes all input received from the keyboard directly to NINDY, and writes +// OBSOLETE * all characters received from NINDY directly to the monitor. +// OBSOLETE * +// OBSOLETE * Keyboard input is neither buffered nor echoed to the monitor. +// OBSOLETE * +// OBSOLETE * GDB remains in passthrough mode until NINDY sends a single ^P character, +// OBSOLETE * to indicate that the user process has stopped. +// OBSOLETE * +// OBSOLETE * Note: +// OBSOLETE * GDB assumes NINDY performs a 'flushreg' when the user program stops. +// OBSOLETE * +// OBSOLETE * +// OBSOLETE * COMMAND MODE +// OBSOLETE * ------- ---- +// OBSOLETE * +// OBSOLETE * All info (except for message ack and nak) is transferred between gdb +// OBSOLETE * and the remote processor in messages of the following format: +// OBSOLETE * +// OBSOLETE * # +// OBSOLETE * +// OBSOLETE * where +// OBSOLETE * # is a literal character +// OBSOLETE * +// OBSOLETE * ASCII information; all numeric information is in the +// OBSOLETE * form of hex digits ('0'-'9' and lowercase 'a'-'f'). +// OBSOLETE * +// OBSOLETE * +// OBSOLETE * is a pair of ASCII hex digits representing an 8-bit +// OBSOLETE * checksum formed by adding together each of the +// OBSOLETE * characters in . +// OBSOLETE * +// OBSOLETE * The receiver of a message always sends a single character to the sender +// OBSOLETE * to indicate that the checksum was good ('+') or bad ('-'); the sender +// OBSOLETE * re-transmits the entire message over until a '+' is received. +// OBSOLETE * +// OBSOLETE * In response to a command NINDY always sends back either data or +// OBSOLETE * a result code of the form "Xnn", where "nn" are hex digits and "X00" +// OBSOLETE * means no errors. (Exceptions: the "s" and "c" commands don't respond.) +// OBSOLETE * +// OBSOLETE * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A +// OBSOLETE * FULL DESCRIPTION OF LEGAL COMMANDS. +// OBSOLETE * +// OBSOLETE * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST +// OBSOLETE * OF STOP CODES. +// OBSOLETE * +// OBSOLETE ***************************************************************************/ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #include "frame.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "bfd.h" +// OBSOLETE #include "symfile.h" +// OBSOLETE #include "target.h" +// OBSOLETE #include "gdbcore.h" +// OBSOLETE #include "command.h" +// OBSOLETE #include "floatformat.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include "serial.h" +// OBSOLETE #include "nindy-share/env.h" +// OBSOLETE #include "nindy-share/stop.h" +// OBSOLETE #include "remote-utils.h" +// OBSOLETE +// OBSOLETE extern int unlink (); +// OBSOLETE extern char *getenv (); +// OBSOLETE extern char *mktemp (); +// OBSOLETE +// OBSOLETE extern void generic_mourn_inferior (); +// OBSOLETE +// OBSOLETE extern struct target_ops nindy_ops; +// OBSOLETE extern FILE *instream; +// OBSOLETE +// OBSOLETE extern char ninStopWhy (); +// OBSOLETE extern int ninMemGet (); +// OBSOLETE extern int ninMemPut (); +// OBSOLETE +// OBSOLETE int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */ +// OBSOLETE int nindy_old_protocol; /* nonzero if want to use old protocol */ +// OBSOLETE char *nindy_ttyname; /* name of tty to talk to nindy on, or null */ +// OBSOLETE +// OBSOLETE #define DLE '\020' /* Character NINDY sends to indicate user program has +// OBSOLETE * halted. */ +// OBSOLETE #define TRUE 1 +// OBSOLETE #define FALSE 0 +// OBSOLETE +// OBSOLETE /* From nindy-share/nindy.c. */ +// OBSOLETE extern struct serial *nindy_serial; +// OBSOLETE +// OBSOLETE static int have_regs = 0; /* 1 iff regs read since i960 last halted */ +// OBSOLETE static int regs_changed = 0; /* 1 iff regs were modified since last read */ +// OBSOLETE +// OBSOLETE extern char *exists (); +// OBSOLETE +// OBSOLETE static void nindy_fetch_registers (int); +// OBSOLETE +// OBSOLETE static void nindy_store_registers (int); +// OBSOLETE +// OBSOLETE static char *savename; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_close (int quitting) +// OBSOLETE { +// OBSOLETE if (nindy_serial != NULL) +// OBSOLETE serial_close (nindy_serial); +// OBSOLETE nindy_serial = NULL; +// OBSOLETE +// OBSOLETE if (savename) +// OBSOLETE xfree (savename); +// OBSOLETE savename = 0; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Open a connection to a remote debugger. +// OBSOLETE FIXME, there should be "set" commands for the options that are +// OBSOLETE now specified with gdb command-line options (old_protocol, +// OBSOLETE and initial_brk). */ +// OBSOLETE void +// OBSOLETE nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */ +// OBSOLETE int from_tty) +// OBSOLETE { +// OBSOLETE char baudrate[1024]; +// OBSOLETE +// OBSOLETE if (!name) +// OBSOLETE error_no_arg ("serial port device name"); +// OBSOLETE +// OBSOLETE target_preopen (from_tty); +// OBSOLETE +// OBSOLETE nindy_close (0); +// OBSOLETE +// OBSOLETE have_regs = regs_changed = 0; +// OBSOLETE +// OBSOLETE /* Allow user to interrupt the following -- we could hang if there's +// OBSOLETE no NINDY at the other end of the remote tty. */ +// OBSOLETE immediate_quit++; +// OBSOLETE /* If baud_rate is -1, then ninConnect will not recognize the baud rate +// OBSOLETE and will deal with the situation in a (more or less) reasonable +// OBSOLETE fashion. */ +// OBSOLETE sprintf (baudrate, "%d", baud_rate); +// OBSOLETE ninConnect (name, baudrate, +// OBSOLETE nindy_initial_brk, !from_tty, nindy_old_protocol); +// OBSOLETE immediate_quit--; +// OBSOLETE +// OBSOLETE if (nindy_serial == NULL) +// OBSOLETE { +// OBSOLETE perror_with_name (name); +// OBSOLETE } +// OBSOLETE +// OBSOLETE savename = savestring (name, strlen (name)); +// OBSOLETE push_target (&nindy_ops); +// OBSOLETE +// OBSOLETE target_fetch_registers (-1); +// OBSOLETE +// OBSOLETE init_thread_list (); +// OBSOLETE init_wait_for_inferior (); +// OBSOLETE clear_proceed_status (); +// OBSOLETE normal_stop (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* User-initiated quit of nindy operations. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_detach (char *name, int from_tty) +// OBSOLETE { +// OBSOLETE if (name) +// OBSOLETE error ("Too many arguments"); +// OBSOLETE pop_target (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_files_info (void) +// OBSOLETE { +// OBSOLETE /* FIXME: this lies about the baud rate if we autobauded. */ +// OBSOLETE printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename, +// OBSOLETE baud_rate, +// OBSOLETE nindy_old_protocol ? " in old protocol" : "", +// OBSOLETE nindy_initial_brk ? " with initial break" : ""); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Return the number of characters in the buffer BUF before +// OBSOLETE the first DLE character. N is maximum number of characters to +// OBSOLETE consider. */ +// OBSOLETE +// OBSOLETE static +// OBSOLETE int +// OBSOLETE non_dle (char *buf, int n) +// OBSOLETE { +// OBSOLETE int i; +// OBSOLETE +// OBSOLETE for (i = 0; i < n; i++) +// OBSOLETE { +// OBSOLETE if (buf[i] == DLE) +// OBSOLETE { +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE return i; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Tell the remote machine to resume. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE nindy_resume (ptid_t ptid, int step, enum target_signal siggnal) +// OBSOLETE { +// OBSOLETE if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal) +// OBSOLETE warning ("Can't send signals to remote NINDY targets."); +// OBSOLETE +// OBSOLETE if (regs_changed) +// OBSOLETE { +// OBSOLETE nindy_store_registers (-1); +// OBSOLETE regs_changed = 0; +// OBSOLETE } +// OBSOLETE have_regs = 0; +// OBSOLETE ninGo (step); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* FIXME, we can probably use the normal terminal_inferior stuff here. +// OBSOLETE We have to do terminal_inferior and then set up the passthrough +// OBSOLETE settings initially. Thereafter, terminal_ours and terminal_inferior +// OBSOLETE will automatically swap the settings around for us. */ +// OBSOLETE +// OBSOLETE struct clean_up_tty_args +// OBSOLETE { +// OBSOLETE serial_ttystate state; +// OBSOLETE struct serial *serial; +// OBSOLETE }; +// OBSOLETE static struct clean_up_tty_args tty_args; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE clean_up_tty (PTR ptrarg) +// OBSOLETE { +// OBSOLETE struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg; +// OBSOLETE serial_set_tty_state (args->serial, args->state); +// OBSOLETE xfree (args->state); +// OBSOLETE warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Recover from ^Z or ^C while remote process is running */ +// OBSOLETE static void (*old_ctrlc) (); +// OBSOLETE #ifdef SIGTSTP +// OBSOLETE static void (*old_ctrlz) (); +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE static void +// OBSOLETE clean_up_int (void) +// OBSOLETE { +// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state); +// OBSOLETE xfree (tty_args.state); +// OBSOLETE +// OBSOLETE signal (SIGINT, old_ctrlc); +// OBSOLETE #ifdef SIGTSTP +// OBSOLETE signal (SIGTSTP, old_ctrlz); +// OBSOLETE #endif +// OBSOLETE error ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Wait until the remote machine stops. While waiting, operate in passthrough +// OBSOLETE * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from +// OBSOLETE * stdin to NINDY. +// OBSOLETE * +// OBSOLETE * Return to caller, storing status in 'status' just as `wait' would. +// OBSOLETE */ +// OBSOLETE +// OBSOLETE static ptid_t +// OBSOLETE nindy_wait (ptid_t ptid, struct target_waitstatus *status) +// OBSOLETE { +// OBSOLETE fd_set fds; +// OBSOLETE int c; +// OBSOLETE char buf[2]; +// OBSOLETE int i, n; +// OBSOLETE unsigned char stop_exit; +// OBSOLETE unsigned char stop_code; +// OBSOLETE struct cleanup *old_cleanups; +// OBSOLETE long ip_value, fp_value, sp_value; /* Reg values from stop */ +// OBSOLETE +// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; +// OBSOLETE status->value.integer = 0; +// OBSOLETE +// OBSOLETE /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */ +// OBSOLETE +// OBSOLETE /* Save current tty attributes, and restore them when done. */ +// OBSOLETE tty_args.serial = serial_fdopen (0); +// OBSOLETE tty_args.state = serial_get_tty_state (tty_args.serial); +// OBSOLETE old_ctrlc = signal (SIGINT, clean_up_int); +// OBSOLETE #ifdef SIGTSTP +// OBSOLETE old_ctrlz = signal (SIGTSTP, clean_up_int); +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE old_cleanups = make_cleanup (clean_up_tty, &tty_args); +// OBSOLETE +// OBSOLETE /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret +// OBSOLETE and perform echo. */ +// OBSOLETE /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close +// OBSOLETE enough. */ +// OBSOLETE serial_raw (tty_args.serial); +// OBSOLETE +// OBSOLETE while (1) +// OBSOLETE { +// OBSOLETE /* Input on remote */ +// OBSOLETE c = serial_readchar (nindy_serial, -1); +// OBSOLETE if (c == SERIAL_ERROR) +// OBSOLETE { +// OBSOLETE error ("Cannot read from serial line"); +// OBSOLETE } +// OBSOLETE else if (c == 0x1b) /* ESC */ +// OBSOLETE { +// OBSOLETE c = serial_readchar (nindy_serial, -1); +// OBSOLETE c &= ~0x40; +// OBSOLETE } +// OBSOLETE else if (c != 0x10) /* DLE */ +// OBSOLETE /* Write out any characters preceding DLE */ +// OBSOLETE { +// OBSOLETE buf[0] = (char) c; +// OBSOLETE write (1, buf, 1); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE stop_exit = ninStopWhy (&stop_code, +// OBSOLETE &ip_value, &fp_value, &sp_value); +// OBSOLETE if (!stop_exit && (stop_code == STOP_SRQ)) +// OBSOLETE { +// OBSOLETE immediate_quit++; +// OBSOLETE ninSrq (); +// OBSOLETE immediate_quit--; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE /* Get out of loop */ +// OBSOLETE supply_register (IP_REGNUM, +// OBSOLETE (char *) &ip_value); +// OBSOLETE supply_register (FP_REGNUM, +// OBSOLETE (char *) &fp_value); +// OBSOLETE supply_register (SP_REGNUM, +// OBSOLETE (char *) &sp_value); +// OBSOLETE break; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state); +// OBSOLETE xfree (tty_args.state); +// OBSOLETE discard_cleanups (old_cleanups); +// OBSOLETE +// OBSOLETE if (stop_exit) +// OBSOLETE { +// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; +// OBSOLETE status->value.integer = stop_code; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE /* nindy has some special stop code need to be handled */ +// OBSOLETE if (stop_code == STOP_GDB_BPT) +// OBSOLETE stop_code = TRACE_STEP; +// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; +// OBSOLETE status->value.sig = i960_fault_to_signal (stop_code); +// OBSOLETE } +// OBSOLETE return inferior_ptid; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Read the remote registers into the block REGS. */ +// OBSOLETE +// OBSOLETE /* This is the block that ninRegsGet and ninRegsPut handles. */ +// OBSOLETE struct nindy_regs +// OBSOLETE { +// OBSOLETE char local_regs[16 * 4]; +// OBSOLETE char global_regs[16 * 4]; +// OBSOLETE char pcw_acw[2 * 4]; +// OBSOLETE char ip[4]; +// OBSOLETE char tcw[4]; +// OBSOLETE char fp_as_double[4 * 8]; +// OBSOLETE }; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_fetch_registers (int regno) +// OBSOLETE { +// OBSOLETE struct nindy_regs nindy_regs; +// OBSOLETE int regnum; +// OBSOLETE +// OBSOLETE immediate_quit++; +// OBSOLETE ninRegsGet ((char *) &nindy_regs); +// OBSOLETE immediate_quit--; +// OBSOLETE +// OBSOLETE memcpy (®isters[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4); +// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8); +// OBSOLETE +// OBSOLETE registers_fetched (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_prepare_to_store (void) +// OBSOLETE { +// OBSOLETE /* Fetch all regs if they aren't already here. */ +// OBSOLETE read_register_bytes (0, NULL, REGISTER_BYTES); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_store_registers (int regno) +// OBSOLETE { +// OBSOLETE struct nindy_regs nindy_regs; +// OBSOLETE int regnum; +// OBSOLETE +// OBSOLETE memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * 4); +// OBSOLETE memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * 4); +// OBSOLETE memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2 * 4); +// OBSOLETE memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1 * 4); +// OBSOLETE memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1 * 4); +// OBSOLETE memcpy (nindy_regs.fp_as_double, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8 * 4); +// OBSOLETE +// OBSOLETE immediate_quit++; +// OBSOLETE ninRegsPut ((char *) &nindy_regs); +// OBSOLETE immediate_quit--; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Copy LEN bytes to or from inferior's memory starting at MEMADDR +// OBSOLETE to debugger memory starting at MYADDR. Copy to inferior if +// OBSOLETE SHOULD_WRITE is nonzero. Returns the length copied. TARGET is +// OBSOLETE unused. */ +// OBSOLETE +// OBSOLETE int +// OBSOLETE nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, +// OBSOLETE int should_write, struct mem_attrib *attrib, +// OBSOLETE struct target_ops *target) +// OBSOLETE { +// OBSOLETE int res; +// OBSOLETE +// OBSOLETE if (len <= 0) +// OBSOLETE return 0; +// OBSOLETE +// OBSOLETE if (should_write) +// OBSOLETE res = ninMemPut (memaddr, myaddr, len); +// OBSOLETE else +// OBSOLETE res = ninMemGet (memaddr, myaddr, len); +// OBSOLETE +// OBSOLETE return res; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_create_inferior (char *execfile, char *args, char **env) +// OBSOLETE { +// OBSOLETE int entry_pt; +// OBSOLETE int pid; +// OBSOLETE +// OBSOLETE if (args && *args) +// OBSOLETE error ("Can't pass arguments to remote NINDY process"); +// OBSOLETE +// OBSOLETE if (execfile == 0 || exec_bfd == 0) +// OBSOLETE error ("No executable file specified"); +// OBSOLETE +// OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd); +// OBSOLETE +// OBSOLETE pid = 42; +// OBSOLETE +// OBSOLETE /* The "process" (board) is already stopped awaiting our commands, and +// OBSOLETE the program is already downloaded. We just set its PC and go. */ +// OBSOLETE +// OBSOLETE inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */ +// OBSOLETE +// OBSOLETE clear_proceed_status (); +// OBSOLETE +// OBSOLETE /* Tell wait_for_inferior that we've started a new process. */ +// OBSOLETE init_wait_for_inferior (); +// OBSOLETE +// OBSOLETE /* Set up the "saved terminal modes" of the inferior +// OBSOLETE based on what modes we are starting it with. */ +// OBSOLETE target_terminal_init (); +// OBSOLETE +// OBSOLETE /* Install inferior's terminal modes. */ +// OBSOLETE target_terminal_inferior (); +// OBSOLETE +// OBSOLETE /* insert_step_breakpoint (); FIXME, do we need this? */ +// OBSOLETE /* Let 'er rip... */ +// OBSOLETE proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE reset_command (char *args, int from_tty) +// OBSOLETE { +// OBSOLETE if (nindy_serial == NULL) +// OBSOLETE { +// OBSOLETE error ("No target system to reset -- use 'target nindy' command."); +// OBSOLETE } +// OBSOLETE if (query ("Really reset the target system?", 0, 0)) +// OBSOLETE { +// OBSOLETE serial_send_break (nindy_serial); +// OBSOLETE tty_flush (nindy_serial); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE void +// OBSOLETE nindy_kill (char *args, int from_tty) +// OBSOLETE { +// OBSOLETE return; /* Ignore attempts to kill target system */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Clean up when a program exits. +// OBSOLETE +// OBSOLETE The program actually lives on in the remote processor's RAM, and may be +// OBSOLETE run again without a download. Don't leave it full of breakpoint +// OBSOLETE instructions. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE nindy_mourn_inferior (void) +// OBSOLETE { +// OBSOLETE remove_breakpoints (); +// OBSOLETE unpush_target (&nindy_ops); +// OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Pass the args the way catch_errors wants them. */ +// OBSOLETE static int +// OBSOLETE nindy_open_stub (char *arg) +// OBSOLETE { +// OBSOLETE nindy_open (arg, 1); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nindy_load (char *filename, int from_tty) +// OBSOLETE { +// OBSOLETE asection *s; +// OBSOLETE /* Can't do unix style forking on a VMS system, so we'll use bfd to do +// OBSOLETE all the work for us +// OBSOLETE */ +// OBSOLETE +// OBSOLETE bfd *file = bfd_openr (filename, 0); +// OBSOLETE if (!file) +// OBSOLETE { +// OBSOLETE perror_with_name (filename); +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (!bfd_check_format (file, bfd_object)) +// OBSOLETE { +// OBSOLETE error ("can't prove it's an object file\n"); +// OBSOLETE return; +// OBSOLETE } +// OBSOLETE +// OBSOLETE for (s = file->sections; s; s = s->next) +// OBSOLETE { +// OBSOLETE if (s->flags & SEC_LOAD) +// OBSOLETE { +// OBSOLETE char *buffer = xmalloc (s->_raw_size); +// OBSOLETE bfd_get_section_contents (file, s, buffer, 0, s->_raw_size); +// OBSOLETE printf ("Loading section %s, size %x vma %x\n", +// OBSOLETE s->name, +// OBSOLETE s->_raw_size, +// OBSOLETE s->vma); +// OBSOLETE ninMemPut (s->vma, buffer, s->_raw_size); +// OBSOLETE xfree (buffer); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE bfd_close (file); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static int +// OBSOLETE load_stub (char *arg) +// OBSOLETE { +// OBSOLETE target_load (arg, 1); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* This routine is run as a hook, just before the main command loop is +// OBSOLETE entered. If gdb is configured for the i960, but has not had its +// OBSOLETE nindy target specified yet, this will loop prompting the user to do so. +// OBSOLETE +// OBSOLETE Unlike the loop provided by Intel, we actually let the user get out +// OBSOLETE of this with a RETURN. This is useful when e.g. simply examining +// OBSOLETE an i960 object file on the host system. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE nindy_before_main_loop (void) +// OBSOLETE { +// OBSOLETE char ttyname[100]; +// OBSOLETE char *p, *p2; +// OBSOLETE +// OBSOLETE while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */ +// OBSOLETE { /* remote tty not specified yet */ +// OBSOLETE if (instream == stdin) +// OBSOLETE { +// OBSOLETE printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: "); +// OBSOLETE gdb_flush (gdb_stdout); +// OBSOLETE } +// OBSOLETE fgets (ttyname, sizeof (ttyname) - 1, stdin); +// OBSOLETE +// OBSOLETE /* Strip leading and trailing whitespace */ +// OBSOLETE for (p = ttyname; isspace (*p); p++) +// OBSOLETE { +// OBSOLETE ; +// OBSOLETE } +// OBSOLETE if (*p == '\0') +// OBSOLETE { +// OBSOLETE return; /* User just hit spaces or return, wants out */ +// OBSOLETE } +// OBSOLETE for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++) +// OBSOLETE { +// OBSOLETE ; +// OBSOLETE } +// OBSOLETE *p2 = '\0'; +// OBSOLETE if (STREQ ("quit", p)) +// OBSOLETE { +// OBSOLETE exit (1); +// OBSOLETE } +// OBSOLETE +// OBSOLETE if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL)) +// OBSOLETE { +// OBSOLETE /* Now that we have a tty open for talking to the remote machine, +// OBSOLETE download the executable file if one was specified. */ +// OBSOLETE if (exec_bfd) +// OBSOLETE { +// OBSOLETE catch_errors (load_stub, bfd_get_filename (exec_bfd), "", +// OBSOLETE RETURN_MASK_ALL); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Define the target subroutine names */ +// OBSOLETE +// OBSOLETE struct target_ops nindy_ops; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE init_nindy_ops (void) +// OBSOLETE { +// OBSOLETE nindy_ops.to_shortname = "nindy"; +// OBSOLETE "Remote serial target in i960 NINDY-specific protocol", +// OBSOLETE nindy_ops.to_longname = "Use a remote i960 system running NINDY connected by a serial line.\n\ +// OBSOLETE Specify the name of the device the serial line is connected to.\n\ +// OBSOLETE The speed (baud rate), whether to use the old NINDY protocol,\n\ +// OBSOLETE and whether to send a break on startup, are controlled by options\n\ +// OBSOLETE specified when you started GDB."; +// OBSOLETE nindy_ops.to_doc = ""; +// OBSOLETE nindy_ops.to_open = nindy_open; +// OBSOLETE nindy_ops.to_close = nindy_close; +// OBSOLETE nindy_ops.to_attach = 0; +// OBSOLETE nindy_ops.to_post_attach = NULL; +// OBSOLETE nindy_ops.to_require_attach = NULL; +// OBSOLETE nindy_ops.to_detach = nindy_detach; +// OBSOLETE nindy_ops.to_require_detach = NULL; +// OBSOLETE nindy_ops.to_resume = nindy_resume; +// OBSOLETE nindy_ops.to_wait = nindy_wait; +// OBSOLETE nindy_ops.to_post_wait = NULL; +// OBSOLETE nindy_ops.to_fetch_registers = nindy_fetch_registers; +// OBSOLETE nindy_ops.to_store_registers = nindy_store_registers; +// OBSOLETE nindy_ops.to_prepare_to_store = nindy_prepare_to_store; +// OBSOLETE nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory; +// OBSOLETE nindy_ops.to_files_info = nindy_files_info; +// OBSOLETE nindy_ops.to_insert_breakpoint = memory_insert_breakpoint; +// OBSOLETE nindy_ops.to_remove_breakpoint = memory_remove_breakpoint; +// OBSOLETE nindy_ops.to_terminal_init = 0; +// OBSOLETE nindy_ops.to_terminal_inferior = 0; +// OBSOLETE nindy_ops.to_terminal_ours_for_output = 0; +// OBSOLETE nindy_ops.to_terminal_ours = 0; +// OBSOLETE nindy_ops.to_terminal_info = 0; /* Terminal crud */ +// OBSOLETE nindy_ops.to_kill = nindy_kill; +// OBSOLETE nindy_ops.to_load = nindy_load; +// OBSOLETE nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */ +// OBSOLETE nindy_ops.to_create_inferior = nindy_create_inferior; +// OBSOLETE nindy_ops.to_post_startup_inferior = NULL; +// OBSOLETE nindy_ops.to_acknowledge_created_inferior = NULL; +// OBSOLETE nindy_ops.to_clone_and_follow_inferior = NULL; +// OBSOLETE nindy_ops.to_post_follow_inferior_by_clone = NULL; +// OBSOLETE nindy_ops.to_insert_fork_catchpoint = NULL; +// OBSOLETE nindy_ops.to_remove_fork_catchpoint = NULL; +// OBSOLETE nindy_ops.to_insert_vfork_catchpoint = NULL; +// OBSOLETE nindy_ops.to_remove_vfork_catchpoint = NULL; +// OBSOLETE nindy_ops.to_has_forked = NULL; +// OBSOLETE nindy_ops.to_has_vforked = NULL; +// OBSOLETE nindy_ops.to_can_follow_vfork_prior_to_exec = NULL; +// OBSOLETE nindy_ops.to_post_follow_vfork = NULL; +// OBSOLETE nindy_ops.to_insert_exec_catchpoint = NULL; +// OBSOLETE nindy_ops.to_remove_exec_catchpoint = NULL; +// OBSOLETE nindy_ops.to_has_execd = NULL; +// OBSOLETE nindy_ops.to_reported_exec_events_per_exec_call = NULL; +// OBSOLETE nindy_ops.to_has_exited = NULL; +// OBSOLETE nindy_ops.to_mourn_inferior = nindy_mourn_inferior; +// OBSOLETE nindy_ops.to_can_run = 0; /* can_run */ +// OBSOLETE nindy_ops.to_notice_signals = 0; /* notice_signals */ +// OBSOLETE nindy_ops.to_thread_alive = 0; /* to_thread_alive */ +// OBSOLETE nindy_ops.to_stop = 0; /* to_stop */ +// OBSOLETE nindy_ops.to_pid_to_exec_file = NULL; +// OBSOLETE nindy_ops.to_stratum = process_stratum; +// OBSOLETE nindy_ops.DONT_USE = 0; /* next */ +// OBSOLETE nindy_ops.to_has_all_memory = 1; +// OBSOLETE nindy_ops.to_has_memory = 1; +// OBSOLETE nindy_ops.to_has_stack = 1; +// OBSOLETE nindy_ops.to_has_registers = 1; +// OBSOLETE nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */ +// OBSOLETE nindy_ops.to_sections = 0; +// OBSOLETE nindy_ops.to_sections_end = 0; /* Section pointers */ +// OBSOLETE nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */ +// OBSOLETE } +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_nindy (void) +// OBSOLETE { +// OBSOLETE init_nindy_ops (); +// OBSOLETE add_target (&nindy_ops); +// OBSOLETE add_com ("reset", class_obscure, reset_command, +// OBSOLETE "Send a 'break' to the remote target system.\n\ +// OBSOLETE Only useful if the target has been equipped with a circuit\n\ +// OBSOLETE to perform a hard reset when a break is detected."); +// OBSOLETE } diff --git a/gdb/remote-nrom.c b/gdb/remote-nrom.c index 436c3d272a6..31336b61ff2 100644 --- a/gdb/remote-nrom.c +++ b/gdb/remote-nrom.c @@ -1,351 +1,351 @@ -/* Remote debugging with the XLNT Designs, Inc (XDI) NetROM. - Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000 - Free Software Foundation, Inc. - Contributed by: - Roger Moyers - XLNT Designs, Inc. - 15050 Avenue of Science, Suite 106 - San Diego, CA 92128 - (619)487-9320 - roger@xlnt.com - Adapted from work done at Cygnus Support in remote-nindy.c, - later merged in by Stan Shebs at Cygnus. - - 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 "gdbcmd.h" -#include "serial.h" -#include "target.h" - -/* Default ports used to talk with the NetROM. */ - -#define DEFAULT_NETROM_LOAD_PORT 1236 -#define DEFAULT_NETROM_CONTROL_PORT 1237 - -static void nrom_close (int quitting); - -/* New commands. */ - -static void nrom_passthru (char *, int); - -/* We talk to the NetROM over these sockets. */ - -static struct serial *load_desc = NULL; -static struct serial *ctrl_desc = NULL; - -static int load_port = DEFAULT_NETROM_LOAD_PORT; -static int control_port = DEFAULT_NETROM_CONTROL_PORT; - -static char nrom_hostname[100]; - -/* Forward data declaration. */ - -extern struct target_ops nrom_ops; - -/* Scan input from the remote system, until STRING is found. Print chars that - don't match. */ - -static int -expect (char *string) -{ - char *p = string; - int c; - - immediate_quit++; - - while (1) - { - c = serial_readchar (ctrl_desc, 5); - - if (c == *p++) - { - if (*p == '\0') - { - immediate_quit--; - return 0; - } - } - else - { - fputc_unfiltered (c, gdb_stdout); - p = string; - if (c == *p) - p++; - } - } -} - -static void -nrom_kill (void) -{ - nrom_close (0); -} - -static struct serial * -open_socket (char *name, int port) -{ - char sockname[100]; - struct serial *desc; - - sprintf (sockname, "%s:%d", name, port); - desc = serial_open (sockname); - if (!desc) - perror_with_name (sockname); - - return desc; -} - -static void -load_cleanup (void) -{ - serial_close (load_desc); - load_desc = NULL; -} - -/* Download a file specified in ARGS to the netROM. */ - -static void -nrom_load (char *args, int fromtty) -{ - int fd, rd_amt, fsize; - bfd *pbfd; - asection *section; - char *downloadstring = "download 0\n"; - struct cleanup *old_chain; - - /* Tell the netrom to get ready to download. */ - if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring))) - error ("nrom_load: control_send() of `%s' failed", downloadstring); - - expect ("Waiting for a connection...\n"); - - load_desc = open_socket (nrom_hostname, load_port); - - old_chain = make_cleanup (load_cleanup, 0); - - pbfd = bfd_openr (args, 0); - - if (pbfd) - { - make_cleanup (bfd_close, pbfd); - - if (!bfd_check_format (pbfd, bfd_object)) - error ("\"%s\": not in executable format: %s", - args, bfd_errmsg (bfd_get_error ())); - - for (section = pbfd->sections; section; section = section->next) - { - if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC) - { - bfd_vma section_address; - unsigned long section_size; - const char *section_name; - - section_name = bfd_get_section_name (pbfd, section); - section_address = bfd_get_section_vma (pbfd, section); - section_size = bfd_section_size (pbfd, section); - - if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) - { - file_ptr fptr; - - printf_filtered ("[Loading section %s at %x (%d bytes)]\n", - section_name, section_address, - section_size); - - fptr = 0; - - while (section_size > 0) - { - char buffer[1024]; - int count; - - count = min (section_size, 1024); - - bfd_get_section_contents (pbfd, section, buffer, fptr, - count); - - serial_write (load_desc, buffer, count); - section_address += count; - fptr += count; - section_size -= count; - } - } - else - /* BSS and such */ - { - printf_filtered ("[section %s: not loading]\n", - section_name); - } - } - } - } - else - error ("\"%s\": Could not open", args); - - do_cleanups (old_chain); -} - -/* Open a connection to the remote NetROM devices. */ - -static void -nrom_open (char *name, int from_tty) -{ - int errn; - - if (!name || strchr (name, '/') || strchr (name, ':')) - error ( - "To open a NetROM connection, you must specify the hostname\n\ -or IP address of the NetROM device you wish to use."); - - strcpy (nrom_hostname, name); - - target_preopen (from_tty); - - unpush_target (&nrom_ops); - - ctrl_desc = open_socket (nrom_hostname, control_port); - - push_target (&nrom_ops); - - if (from_tty) - printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname); -} - -/* Close out all files and local state before this target loses control. */ - -static void -nrom_close (int quitting) -{ - if (load_desc) - serial_close (load_desc); - if (ctrl_desc) - serial_close (ctrl_desc); -} - -/* Pass arguments directly to the NetROM. */ - -static void -nrom_passthru (char *args, int fromtty) -{ - char buf[1024]; - - sprintf (buf, "%s\n", args); - if (serial_write (ctrl_desc, buf, strlen (buf))) - error ("nrom_reset: control_send() of `%s'failed", args); -} - -static void -nrom_mourn (void) -{ - unpush_target (&nrom_ops); - generic_mourn_inferior (); -} - -/* Define the target vector. */ - -struct target_ops nrom_ops; - -static void -init_nrom_ops (void) -{ - nrom_ops.to_shortname = "nrom"; - nrom_ops.to_longname = "Remote XDI `NetROM' target"; - nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet"; - nrom_ops.to_open = nrom_open; - nrom_ops.to_close = nrom_close; - nrom_ops.to_attach = NULL; - nrom_ops.to_post_attach = NULL; - nrom_ops.to_require_attach = NULL; - nrom_ops.to_detach = NULL; - nrom_ops.to_require_detach = NULL; - nrom_ops.to_resume = NULL; - nrom_ops.to_wait = NULL; - nrom_ops.to_post_wait = NULL; - nrom_ops.to_fetch_registers = NULL; - nrom_ops.to_store_registers = NULL; - nrom_ops.to_prepare_to_store = NULL; - nrom_ops.to_xfer_memory = NULL; - nrom_ops.to_files_info = NULL; - nrom_ops.to_insert_breakpoint = NULL; - nrom_ops.to_remove_breakpoint = NULL; - nrom_ops.to_terminal_init = NULL; - nrom_ops.to_terminal_inferior = NULL; - nrom_ops.to_terminal_ours_for_output = NULL; - nrom_ops.to_terminal_ours = NULL; - nrom_ops.to_terminal_info = NULL; - nrom_ops.to_kill = nrom_kill; - nrom_ops.to_load = nrom_load; - nrom_ops.to_lookup_symbol = NULL; - nrom_ops.to_create_inferior = NULL; - nrom_ops.to_post_startup_inferior = NULL; - nrom_ops.to_acknowledge_created_inferior = NULL; - nrom_ops.to_clone_and_follow_inferior = NULL; - nrom_ops.to_post_follow_inferior_by_clone = NULL; - nrom_ops.to_insert_fork_catchpoint = NULL; - nrom_ops.to_remove_fork_catchpoint = NULL; - nrom_ops.to_insert_vfork_catchpoint = NULL; - nrom_ops.to_remove_vfork_catchpoint = NULL; - nrom_ops.to_has_forked = NULL; - nrom_ops.to_has_vforked = NULL; - nrom_ops.to_can_follow_vfork_prior_to_exec = NULL; - nrom_ops.to_post_follow_vfork = NULL; - nrom_ops.to_insert_exec_catchpoint = NULL; - nrom_ops.to_remove_exec_catchpoint = NULL; - nrom_ops.to_has_execd = NULL; - nrom_ops.to_reported_exec_events_per_exec_call = NULL; - nrom_ops.to_has_exited = NULL; - nrom_ops.to_mourn_inferior = nrom_mourn; - nrom_ops.to_can_run = NULL; - nrom_ops.to_notice_signals = 0; - nrom_ops.to_thread_alive = 0; - nrom_ops.to_stop = 0; - nrom_ops.to_pid_to_exec_file = NULL; - nrom_ops.to_stratum = download_stratum; - nrom_ops.DONT_USE = NULL; - nrom_ops.to_has_all_memory = 1; - nrom_ops.to_has_memory = 1; - nrom_ops.to_has_stack = 1; - nrom_ops.to_has_registers = 1; - nrom_ops.to_has_execution = 0; - nrom_ops.to_sections = NULL; - nrom_ops.to_sections_end = NULL; - nrom_ops.to_magic = OPS_MAGIC; -} - -void -_initialize_remote_nrom (void) -{ - init_nrom_ops (); - add_target (&nrom_ops); - - add_show_from_set ( - add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port, - "Set the port to use for NetROM downloads\n", &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port, - "Set the port to use for NetROM debugger services\n", &setlist), - &showlist); - - add_cmd ("nrom", no_class, nrom_passthru, - "Pass arguments as command to NetROM", - &cmdlist); -} +// OBSOLETE /* Remote debugging with the XLNT Designs, Inc (XDI) NetROM. +// OBSOLETE Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000 +// OBSOLETE Free Software Foundation, Inc. +// OBSOLETE Contributed by: +// OBSOLETE Roger Moyers +// OBSOLETE XLNT Designs, Inc. +// OBSOLETE 15050 Avenue of Science, Suite 106 +// OBSOLETE San Diego, CA 92128 +// OBSOLETE (619)487-9320 +// OBSOLETE roger@xlnt.com +// OBSOLETE Adapted from work done at Cygnus Support in remote-nindy.c, +// OBSOLETE later merged in by Stan Shebs at Cygnus. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "defs.h" +// OBSOLETE #include "gdbcmd.h" +// OBSOLETE #include "serial.h" +// OBSOLETE #include "target.h" +// OBSOLETE +// OBSOLETE /* Default ports used to talk with the NetROM. */ +// OBSOLETE +// OBSOLETE #define DEFAULT_NETROM_LOAD_PORT 1236 +// OBSOLETE #define DEFAULT_NETROM_CONTROL_PORT 1237 +// OBSOLETE +// OBSOLETE static void nrom_close (int quitting); +// OBSOLETE +// OBSOLETE /* New commands. */ +// OBSOLETE +// OBSOLETE static void nrom_passthru (char *, int); +// OBSOLETE +// OBSOLETE /* We talk to the NetROM over these sockets. */ +// OBSOLETE +// OBSOLETE static struct serial *load_desc = NULL; +// OBSOLETE static struct serial *ctrl_desc = NULL; +// OBSOLETE +// OBSOLETE static int load_port = DEFAULT_NETROM_LOAD_PORT; +// OBSOLETE static int control_port = DEFAULT_NETROM_CONTROL_PORT; +// OBSOLETE +// OBSOLETE static char nrom_hostname[100]; +// OBSOLETE +// OBSOLETE /* Forward data declaration. */ +// OBSOLETE +// OBSOLETE extern struct target_ops nrom_ops; +// OBSOLETE +// OBSOLETE /* Scan input from the remote system, until STRING is found. Print chars that +// OBSOLETE don't match. */ +// OBSOLETE +// OBSOLETE static int +// OBSOLETE expect (char *string) +// OBSOLETE { +// OBSOLETE char *p = string; +// OBSOLETE int c; +// OBSOLETE +// OBSOLETE immediate_quit++; +// OBSOLETE +// OBSOLETE while (1) +// OBSOLETE { +// OBSOLETE c = serial_readchar (ctrl_desc, 5); +// OBSOLETE +// OBSOLETE if (c == *p++) +// OBSOLETE { +// OBSOLETE if (*p == '\0') +// OBSOLETE { +// OBSOLETE immediate_quit--; +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE fputc_unfiltered (c, gdb_stdout); +// OBSOLETE p = string; +// OBSOLETE if (c == *p) +// OBSOLETE p++; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_kill (void) +// OBSOLETE { +// OBSOLETE nrom_close (0); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static struct serial * +// OBSOLETE open_socket (char *name, int port) +// OBSOLETE { +// OBSOLETE char sockname[100]; +// OBSOLETE struct serial *desc; +// OBSOLETE +// OBSOLETE sprintf (sockname, "%s:%d", name, port); +// OBSOLETE desc = serial_open (sockname); +// OBSOLETE if (!desc) +// OBSOLETE perror_with_name (sockname); +// OBSOLETE +// OBSOLETE return desc; +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE load_cleanup (void) +// OBSOLETE { +// OBSOLETE serial_close (load_desc); +// OBSOLETE load_desc = NULL; +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Download a file specified in ARGS to the netROM. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_load (char *args, int fromtty) +// OBSOLETE { +// OBSOLETE int fd, rd_amt, fsize; +// OBSOLETE bfd *pbfd; +// OBSOLETE asection *section; +// OBSOLETE char *downloadstring = "download 0\n"; +// OBSOLETE struct cleanup *old_chain; +// OBSOLETE +// OBSOLETE /* Tell the netrom to get ready to download. */ +// OBSOLETE if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring))) +// OBSOLETE error ("nrom_load: control_send() of `%s' failed", downloadstring); +// OBSOLETE +// OBSOLETE expect ("Waiting for a connection...\n"); +// OBSOLETE +// OBSOLETE load_desc = open_socket (nrom_hostname, load_port); +// OBSOLETE +// OBSOLETE old_chain = make_cleanup (load_cleanup, 0); +// OBSOLETE +// OBSOLETE pbfd = bfd_openr (args, 0); +// OBSOLETE +// OBSOLETE if (pbfd) +// OBSOLETE { +// OBSOLETE make_cleanup (bfd_close, pbfd); +// OBSOLETE +// OBSOLETE if (!bfd_check_format (pbfd, bfd_object)) +// OBSOLETE error ("\"%s\": not in executable format: %s", +// OBSOLETE args, bfd_errmsg (bfd_get_error ())); +// OBSOLETE +// OBSOLETE for (section = pbfd->sections; section; section = section->next) +// OBSOLETE { +// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC) +// OBSOLETE { +// OBSOLETE bfd_vma section_address; +// OBSOLETE unsigned long section_size; +// OBSOLETE const char *section_name; +// OBSOLETE +// OBSOLETE section_name = bfd_get_section_name (pbfd, section); +// OBSOLETE section_address = bfd_get_section_vma (pbfd, section); +// OBSOLETE section_size = bfd_section_size (pbfd, section); +// OBSOLETE +// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) +// OBSOLETE { +// OBSOLETE file_ptr fptr; +// OBSOLETE +// OBSOLETE printf_filtered ("[Loading section %s at %x (%d bytes)]\n", +// OBSOLETE section_name, section_address, +// OBSOLETE section_size); +// OBSOLETE +// OBSOLETE fptr = 0; +// OBSOLETE +// OBSOLETE while (section_size > 0) +// OBSOLETE { +// OBSOLETE char buffer[1024]; +// OBSOLETE int count; +// OBSOLETE +// OBSOLETE count = min (section_size, 1024); +// OBSOLETE +// OBSOLETE bfd_get_section_contents (pbfd, section, buffer, fptr, +// OBSOLETE count); +// OBSOLETE +// OBSOLETE serial_write (load_desc, buffer, count); +// OBSOLETE section_address += count; +// OBSOLETE fptr += count; +// OBSOLETE section_size -= count; +// OBSOLETE } +// OBSOLETE } +// OBSOLETE else +// OBSOLETE /* BSS and such */ +// OBSOLETE { +// OBSOLETE printf_filtered ("[section %s: not loading]\n", +// OBSOLETE section_name); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE } +// OBSOLETE else +// OBSOLETE error ("\"%s\": Could not open", args); +// OBSOLETE +// OBSOLETE do_cleanups (old_chain); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Open a connection to the remote NetROM devices. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_open (char *name, int from_tty) +// OBSOLETE { +// OBSOLETE int errn; +// OBSOLETE +// OBSOLETE if (!name || strchr (name, '/') || strchr (name, ':')) +// OBSOLETE error ( +// OBSOLETE "To open a NetROM connection, you must specify the hostname\n\ +// OBSOLETE or IP address of the NetROM device you wish to use."); +// OBSOLETE +// OBSOLETE strcpy (nrom_hostname, name); +// OBSOLETE +// OBSOLETE target_preopen (from_tty); +// OBSOLETE +// OBSOLETE unpush_target (&nrom_ops); +// OBSOLETE +// OBSOLETE ctrl_desc = open_socket (nrom_hostname, control_port); +// OBSOLETE +// OBSOLETE push_target (&nrom_ops); +// OBSOLETE +// OBSOLETE if (from_tty) +// OBSOLETE printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Close out all files and local state before this target loses control. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_close (int quitting) +// OBSOLETE { +// OBSOLETE if (load_desc) +// OBSOLETE serial_close (load_desc); +// OBSOLETE if (ctrl_desc) +// OBSOLETE serial_close (ctrl_desc); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Pass arguments directly to the NetROM. */ +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_passthru (char *args, int fromtty) +// OBSOLETE { +// OBSOLETE char buf[1024]; +// OBSOLETE +// OBSOLETE sprintf (buf, "%s\n", args); +// OBSOLETE if (serial_write (ctrl_desc, buf, strlen (buf))) +// OBSOLETE error ("nrom_reset: control_send() of `%s'failed", args); +// OBSOLETE } +// OBSOLETE +// OBSOLETE static void +// OBSOLETE nrom_mourn (void) +// OBSOLETE { +// OBSOLETE unpush_target (&nrom_ops); +// OBSOLETE generic_mourn_inferior (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Define the target vector. */ +// OBSOLETE +// OBSOLETE struct target_ops nrom_ops; +// OBSOLETE +// OBSOLETE static void +// OBSOLETE init_nrom_ops (void) +// OBSOLETE { +// OBSOLETE nrom_ops.to_shortname = "nrom"; +// OBSOLETE nrom_ops.to_longname = "Remote XDI `NetROM' target"; +// OBSOLETE nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet"; +// OBSOLETE nrom_ops.to_open = nrom_open; +// OBSOLETE nrom_ops.to_close = nrom_close; +// OBSOLETE nrom_ops.to_attach = NULL; +// OBSOLETE nrom_ops.to_post_attach = NULL; +// OBSOLETE nrom_ops.to_require_attach = NULL; +// OBSOLETE nrom_ops.to_detach = NULL; +// OBSOLETE nrom_ops.to_require_detach = NULL; +// OBSOLETE nrom_ops.to_resume = NULL; +// OBSOLETE nrom_ops.to_wait = NULL; +// OBSOLETE nrom_ops.to_post_wait = NULL; +// OBSOLETE nrom_ops.to_fetch_registers = NULL; +// OBSOLETE nrom_ops.to_store_registers = NULL; +// OBSOLETE nrom_ops.to_prepare_to_store = NULL; +// OBSOLETE nrom_ops.to_xfer_memory = NULL; +// OBSOLETE nrom_ops.to_files_info = NULL; +// OBSOLETE nrom_ops.to_insert_breakpoint = NULL; +// OBSOLETE nrom_ops.to_remove_breakpoint = NULL; +// OBSOLETE nrom_ops.to_terminal_init = NULL; +// OBSOLETE nrom_ops.to_terminal_inferior = NULL; +// OBSOLETE nrom_ops.to_terminal_ours_for_output = NULL; +// OBSOLETE nrom_ops.to_terminal_ours = NULL; +// OBSOLETE nrom_ops.to_terminal_info = NULL; +// OBSOLETE nrom_ops.to_kill = nrom_kill; +// OBSOLETE nrom_ops.to_load = nrom_load; +// OBSOLETE nrom_ops.to_lookup_symbol = NULL; +// OBSOLETE nrom_ops.to_create_inferior = NULL; +// OBSOLETE nrom_ops.to_post_startup_inferior = NULL; +// OBSOLETE nrom_ops.to_acknowledge_created_inferior = NULL; +// OBSOLETE nrom_ops.to_clone_and_follow_inferior = NULL; +// OBSOLETE nrom_ops.to_post_follow_inferior_by_clone = NULL; +// OBSOLETE nrom_ops.to_insert_fork_catchpoint = NULL; +// OBSOLETE nrom_ops.to_remove_fork_catchpoint = NULL; +// OBSOLETE nrom_ops.to_insert_vfork_catchpoint = NULL; +// OBSOLETE nrom_ops.to_remove_vfork_catchpoint = NULL; +// OBSOLETE nrom_ops.to_has_forked = NULL; +// OBSOLETE nrom_ops.to_has_vforked = NULL; +// OBSOLETE nrom_ops.to_can_follow_vfork_prior_to_exec = NULL; +// OBSOLETE nrom_ops.to_post_follow_vfork = NULL; +// OBSOLETE nrom_ops.to_insert_exec_catchpoint = NULL; +// OBSOLETE nrom_ops.to_remove_exec_catchpoint = NULL; +// OBSOLETE nrom_ops.to_has_execd = NULL; +// OBSOLETE nrom_ops.to_reported_exec_events_per_exec_call = NULL; +// OBSOLETE nrom_ops.to_has_exited = NULL; +// OBSOLETE nrom_ops.to_mourn_inferior = nrom_mourn; +// OBSOLETE nrom_ops.to_can_run = NULL; +// OBSOLETE nrom_ops.to_notice_signals = 0; +// OBSOLETE nrom_ops.to_thread_alive = 0; +// OBSOLETE nrom_ops.to_stop = 0; +// OBSOLETE nrom_ops.to_pid_to_exec_file = NULL; +// OBSOLETE nrom_ops.to_stratum = download_stratum; +// OBSOLETE nrom_ops.DONT_USE = NULL; +// OBSOLETE nrom_ops.to_has_all_memory = 1; +// OBSOLETE nrom_ops.to_has_memory = 1; +// OBSOLETE nrom_ops.to_has_stack = 1; +// OBSOLETE nrom_ops.to_has_registers = 1; +// OBSOLETE nrom_ops.to_has_execution = 0; +// OBSOLETE nrom_ops.to_sections = NULL; +// OBSOLETE nrom_ops.to_sections_end = NULL; +// OBSOLETE nrom_ops.to_magic = OPS_MAGIC; +// OBSOLETE } +// OBSOLETE +// OBSOLETE void +// OBSOLETE _initialize_remote_nrom (void) +// OBSOLETE { +// OBSOLETE init_nrom_ops (); +// OBSOLETE add_target (&nrom_ops); +// OBSOLETE +// OBSOLETE add_show_from_set ( +// OBSOLETE add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port, +// OBSOLETE "Set the port to use for NetROM downloads\n", &setlist), +// OBSOLETE &showlist); +// OBSOLETE +// OBSOLETE add_show_from_set ( +// OBSOLETE add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port, +// OBSOLETE "Set the port to use for NetROM debugger services\n", &setlist), +// OBSOLETE &showlist); +// OBSOLETE +// OBSOLETE add_cmd ("nrom", no_class, nrom_passthru, +// OBSOLETE "Pass arguments as command to NetROM", +// OBSOLETE &cmdlist); +// OBSOLETE } diff --git a/gdb/remote-vx960.c b/gdb/remote-vx960.c index 08568bc4ca6..87435da259f 100644 --- a/gdb/remote-vx960.c +++ b/gdb/remote-vx960.c @@ -1,160 +1,160 @@ -/* i80960-dependent portions of the RPC protocol - used with a VxWorks target - - Contributed by Wind River Systems. - - 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 -#include "defs.h" - -#include "vx-share/regPacket.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" -#include "gdbcore.h" -#include "command.h" -#include "symtab.h" -#include "symfile.h" /* for struct complaint */ -#include "regcache.h" - -#include "gdb_string.h" -#include -#include -#include -#include -#include - -#ifdef _AIX /* IBM claims "void *malloc()" not char * */ -#define malloc bogon_malloc -#endif - -#include -#include /* UTek's doesn't #incl this */ -#include -#include "vx-share/ptrace.h" -#include "vx-share/xdr_ptrace.h" -#include "vx-share/xdr_ld.h" -#include "vx-share/xdr_rdb.h" -#include "vx-share/dbgRpcLib.h" - -/* get rid of value.h if possible */ -#include -#include - -/* Flag set if target has fpu */ - -extern int target_has_fp; - -/* 960 floating point format descriptor, from "i960-tdep.c." */ - -extern struct ext_format ext_format_i960; - -/* Generic register read/write routines in remote-vx.c. */ - -extern void net_read_registers (); -extern void net_write_registers (); - -/* Read a register or registers from the VxWorks target. - REGNO is the register to read, or -1 for all; currently, - it is ignored. FIXME look at regno to improve efficiency. */ - -void -vx_read_register (int regno) -{ - char i960_greg_packet[I960_GREG_PLEN]; - char i960_fpreg_packet[I960_FPREG_PLEN]; - - /* Get general-purpose registers. When copying values into - registers [], don't assume that a location in registers [] - is properly aligned for the target data type. */ - - net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS); - - bcopy (&i960_greg_packet[I960_R_R0], - ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE); - bcopy (&i960_greg_packet[I960_R_G0], - ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE); - bcopy (&i960_greg_packet[I960_R_PCW], - ®isters[REGISTER_BYTE (PCW_REGNUM)], sizeof (int)); - bcopy (&i960_greg_packet[I960_R_ACW], - ®isters[REGISTER_BYTE (ACW_REGNUM)], sizeof (int)); - bcopy (&i960_greg_packet[I960_R_TCW], - ®isters[REGISTER_BYTE (TCW_REGNUM)], sizeof (int)); - - /* If the target has floating point registers, fetch them. - Otherwise, zero the floating point register values in - registers[] for good measure, even though we might not - need to. */ - - if (target_has_fp) - { - net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN, - PTRACE_GETFPREGS); - bcopy (&i960_fpreg_packet[I960_R_FP0], - ®isters[REGISTER_BYTE (FP0_REGNUM)], - REGISTER_RAW_SIZE (FP0_REGNUM) * 4); - } - else - bzero (®isters[REGISTER_BYTE (FP0_REGNUM)], - REGISTER_RAW_SIZE (FP0_REGNUM) * 4); - - /* Mark the register cache valid. */ - - registers_fetched (); -} - -/* Store a register or registers into the VxWorks target. - REGNO is the register to store, or -1 for all; currently, - it is ignored. FIXME look at regno to improve efficiency. */ - -void -vx_write_register (int regno) -{ - char i960_greg_packet[I960_GREG_PLEN]; - char i960_fpreg_packet[I960_FPREG_PLEN]; - - /* Store floating-point registers. When copying values from - registers [], don't assume that a location in registers [] - is properly aligned for the target data type. */ - - bcopy (®isters[REGISTER_BYTE (R0_REGNUM)], - &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE); - bcopy (®isters[REGISTER_BYTE (G0_REGNUM)], - &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE); - bcopy (®isters[REGISTER_BYTE (PCW_REGNUM)], - &i960_greg_packet[I960_R_PCW], sizeof (int)); - bcopy (®isters[REGISTER_BYTE (ACW_REGNUM)], - &i960_greg_packet[I960_R_ACW], sizeof (int)); - bcopy (®isters[REGISTER_BYTE (TCW_REGNUM)], - &i960_greg_packet[I960_R_TCW], sizeof (int)); - - net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS); - - /* Store floating point registers if the target has them. */ - - if (target_has_fp) - { - bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], - &i960_fpreg_packet[I960_R_FP0], - REGISTER_RAW_SIZE (FP0_REGNUM) * 4); - - net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN, - PTRACE_SETFPREGS); - } -} +// OBSOLETE /* i80960-dependent portions of the RPC protocol +// OBSOLETE used with a VxWorks target +// OBSOLETE +// OBSOLETE Contributed by Wind River Systems. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include "defs.h" +// OBSOLETE +// OBSOLETE #include "vx-share/regPacket.h" +// OBSOLETE #include "frame.h" +// OBSOLETE #include "inferior.h" +// OBSOLETE #include "target.h" +// OBSOLETE #include "gdbcore.h" +// OBSOLETE #include "command.h" +// OBSOLETE #include "symtab.h" +// OBSOLETE #include "symfile.h" /* for struct complaint */ +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #include "gdb_string.h" +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE #ifdef _AIX /* IBM claims "void *malloc()" not char * */ +// OBSOLETE #define malloc bogon_malloc +// OBSOLETE #endif +// OBSOLETE +// OBSOLETE #include +// OBSOLETE #include /* UTek's doesn't #incl this */ +// OBSOLETE #include +// OBSOLETE #include "vx-share/ptrace.h" +// OBSOLETE #include "vx-share/xdr_ptrace.h" +// OBSOLETE #include "vx-share/xdr_ld.h" +// OBSOLETE #include "vx-share/xdr_rdb.h" +// OBSOLETE #include "vx-share/dbgRpcLib.h" +// OBSOLETE +// OBSOLETE /* get rid of value.h if possible */ +// OBSOLETE #include +// OBSOLETE #include +// OBSOLETE +// OBSOLETE /* Flag set if target has fpu */ +// OBSOLETE +// OBSOLETE extern int target_has_fp; +// OBSOLETE +// OBSOLETE /* 960 floating point format descriptor, from "i960-tdep.c." */ +// OBSOLETE +// OBSOLETE extern struct ext_format ext_format_i960; +// OBSOLETE +// OBSOLETE /* Generic register read/write routines in remote-vx.c. */ +// OBSOLETE +// OBSOLETE extern void net_read_registers (); +// OBSOLETE extern void net_write_registers (); +// OBSOLETE +// OBSOLETE /* Read a register or registers from the VxWorks target. +// OBSOLETE REGNO is the register to read, or -1 for all; currently, +// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE vx_read_register (int regno) +// OBSOLETE { +// OBSOLETE char i960_greg_packet[I960_GREG_PLEN]; +// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN]; +// OBSOLETE +// OBSOLETE /* Get general-purpose registers. When copying values into +// OBSOLETE registers [], don't assume that a location in registers [] +// OBSOLETE is properly aligned for the target data type. */ +// OBSOLETE +// OBSOLETE net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS); +// OBSOLETE +// OBSOLETE bcopy (&i960_greg_packet[I960_R_R0], +// OBSOLETE ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE); +// OBSOLETE bcopy (&i960_greg_packet[I960_R_G0], +// OBSOLETE ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE); +// OBSOLETE bcopy (&i960_greg_packet[I960_R_PCW], +// OBSOLETE ®isters[REGISTER_BYTE (PCW_REGNUM)], sizeof (int)); +// OBSOLETE bcopy (&i960_greg_packet[I960_R_ACW], +// OBSOLETE ®isters[REGISTER_BYTE (ACW_REGNUM)], sizeof (int)); +// OBSOLETE bcopy (&i960_greg_packet[I960_R_TCW], +// OBSOLETE ®isters[REGISTER_BYTE (TCW_REGNUM)], sizeof (int)); +// OBSOLETE +// OBSOLETE /* If the target has floating point registers, fetch them. +// OBSOLETE Otherwise, zero the floating point register values in +// OBSOLETE registers[] for good measure, even though we might not +// OBSOLETE need to. */ +// OBSOLETE +// OBSOLETE if (target_has_fp) +// OBSOLETE { +// OBSOLETE net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN, +// OBSOLETE PTRACE_GETFPREGS); +// OBSOLETE bcopy (&i960_fpreg_packet[I960_R_FP0], +// OBSOLETE ®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE bzero (®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); +// OBSOLETE +// OBSOLETE /* Mark the register cache valid. */ +// OBSOLETE +// OBSOLETE registers_fetched (); +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* Store a register or registers into the VxWorks target. +// OBSOLETE REGNO is the register to store, or -1 for all; currently, +// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */ +// OBSOLETE +// OBSOLETE void +// OBSOLETE vx_write_register (int regno) +// OBSOLETE { +// OBSOLETE char i960_greg_packet[I960_GREG_PLEN]; +// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN]; +// OBSOLETE +// OBSOLETE /* Store floating-point registers. When copying values from +// OBSOLETE registers [], don't assume that a location in registers [] +// OBSOLETE is properly aligned for the target data type. */ +// OBSOLETE +// OBSOLETE bcopy (®isters[REGISTER_BYTE (R0_REGNUM)], +// OBSOLETE &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE); +// OBSOLETE bcopy (®isters[REGISTER_BYTE (G0_REGNUM)], +// OBSOLETE &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE); +// OBSOLETE bcopy (®isters[REGISTER_BYTE (PCW_REGNUM)], +// OBSOLETE &i960_greg_packet[I960_R_PCW], sizeof (int)); +// OBSOLETE bcopy (®isters[REGISTER_BYTE (ACW_REGNUM)], +// OBSOLETE &i960_greg_packet[I960_R_ACW], sizeof (int)); +// OBSOLETE bcopy (®isters[REGISTER_BYTE (TCW_REGNUM)], +// OBSOLETE &i960_greg_packet[I960_R_TCW], sizeof (int)); +// OBSOLETE +// OBSOLETE net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS); +// OBSOLETE +// OBSOLETE /* Store floating point registers if the target has them. */ +// OBSOLETE +// OBSOLETE if (target_has_fp) +// OBSOLETE { +// OBSOLETE bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], +// OBSOLETE &i960_fpreg_packet[I960_R_FP0], +// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); +// OBSOLETE +// OBSOLETE net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN, +// OBSOLETE PTRACE_SETFPREGS); +// OBSOLETE } +// OBSOLETE } diff --git a/gdb/remote.c b/gdb/remote.c index 0c3f23a527e..1584d6bc7d4 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -94,9 +94,8 @@ static void remote_async_open (char *name, int from_tty); static void extended_remote_open (char *name, int from_tty); static void extended_remote_async_open (char *name, int from_tty); -static void remote_open_1 (char *, int, struct target_ops *, int extended_p); -static void remote_async_open_1 (char *, int, struct target_ops *, - int extended_p); +static void remote_open_1 (char *, int, struct target_ops *, int extended_p, + int async_p); static void remote_close (int quitting); @@ -205,10 +204,6 @@ static void show_packet_config_cmd (struct packet_config *config); static void update_packet_config (struct packet_config *config); -/* Define the target subroutine names */ - -void open_remote_target (char *, int, struct target_ops *, int); - void _initialize_remote (void); /* Description of the remote protocol. Strictly speaking, when the @@ -2160,14 +2155,14 @@ remote_start_remote (struct ui_out *uiout, void *dummy) static void remote_open (char *name, int from_tty) { - remote_open_1 (name, from_tty, &remote_ops, 0); + remote_open_1 (name, from_tty, &remote_ops, 0, 0); } /* Just like remote_open, but with asynchronous support. */ static void remote_async_open (char *name, int from_tty) { - remote_async_open_1 (name, from_tty, &remote_async_ops, 0); + remote_open_1 (name, from_tty, &remote_async_ops, 0, 1); } /* Open a connection to a remote debugger using the extended @@ -2176,14 +2171,16 @@ remote_async_open (char *name, int from_tty) static void extended_remote_open (char *name, int from_tty) { - remote_open_1 (name, from_tty, &extended_remote_ops, 1 /*extended_p */ ); + remote_open_1 (name, from_tty, &extended_remote_ops, 1 /*extended_p */, + 0 /* async_p */); } /* Just like extended_remote_open, but with asynchronous support. */ static void extended_remote_async_open (char *name, int from_tty) { - remote_async_open_1 (name, from_tty, &extended_async_remote_ops, 1 /*extended_p */ ); + remote_open_1 (name, from_tty, &extended_async_remote_ops, + 1 /*extended_p */, 1 /* async_p */); } /* Generic code for opening a connection to a remote target. */ @@ -2264,7 +2261,7 @@ remote_serial_open (char *name) static void remote_open_1 (char *name, int from_tty, struct target_ops *target, - int extended_p) + int extended_p, int async_p) { int ex; struct remote_state *rs = get_remote_state (); @@ -2274,7 +2271,8 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.)."); /* See FIXME above */ - wait_forever_enabled_p = 1; + if (!async_p) + wait_forever_enabled_p = 1; target_preopen (from_tty); @@ -2324,6 +2322,22 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, someday have a notion of debugging several processes. */ inferior_ptid = pid_to_ptid (MAGIC_NULL_PID); + + if (async_p) + { + /* With this target we start out by owning the terminal. */ + remote_async_terminal_ours_p = 1; + + /* FIXME: cagney/1999-09-23: During the initial connection it is + assumed that the target is already ready and able to respond to + requests. Unfortunately remote_start_remote() eventually calls + wait_for_inferior() with no timeout. wait_forever_enabled_p gets + around this. Eventually a mechanism that allows + wait_for_inferior() to expect/get timeouts will be + implemented. */ + wait_forever_enabled_p = 0; + } + #ifdef SOLIB_CREATE_INFERIOR_HOOK /* First delete any symbols previously loaded from shared libraries. */ no_shared_libraries (NULL, 0); @@ -2352,126 +2366,13 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, if (ex < 0) { pop_target (); + if (async_p) + wait_forever_enabled_p = 1; throw_exception (ex); } - if (extended_p) - { - /* Tell the remote that we are using the extended protocol. */ - char *buf = alloca (rs->remote_packet_size); - putpkt ("!"); - getpkt (buf, (rs->remote_packet_size), 0); - } -#ifdef SOLIB_CREATE_INFERIOR_HOOK - /* FIXME: need a master target_open vector from which all - remote_opens can be called, so that stuff like this can - go there. Failing that, the following code must be copied - to the open function for any remote target that wants to - support svr4 shared libraries. */ - - /* Set up to detect and load shared libraries. */ - if (exec_bfd) /* No use without an exec file. */ - { - SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); - remote_check_symbols (symfile_objfile); - } -#endif -} - -/* Just like remote_open but with asynchronous support. */ -static void -remote_async_open_1 (char *name, int from_tty, struct target_ops *target, - int extended_p) -{ - int ex; - struct remote_state *rs = get_remote_state (); - if (name == 0) - error ("To open a remote debug connection, you need to specify what\n" - "serial device is attached to the remote system\n" - "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.)."); - - target_preopen (from_tty); - - unpush_target (target); - - remote_desc = remote_serial_open (name); - if (!remote_desc) - perror_with_name (name); - - if (baud_rate != -1) - { - if (serial_setbaudrate (remote_desc, baud_rate)) - { - serial_close (remote_desc); - perror_with_name (name); - } - } - - serial_raw (remote_desc); - - /* If there is something sitting in the buffer we might take it as a - response to a command, which would be bad. */ - serial_flush_input (remote_desc); - - if (from_tty) - { - puts_filtered ("Remote debugging using "); - puts_filtered (name); - puts_filtered ("\n"); - } - - push_target (target); /* Switch to using remote target now */ - - init_all_packet_configs (); - - general_thread = -2; - continue_thread = -2; - - /* Probe for ability to use "ThreadInfo" query, as required. */ - use_threadinfo_query = 1; - use_threadextra_query = 1; - - /* Without this, some commands which require an active target (such - as kill) won't work. This variable serves (at least) double duty - as both the pid of the target process (if it has such), and as a - flag indicating that a target is active. These functions should - be split out into seperate variables, especially since GDB will - someday have a notion of debugging several processes. */ - inferior_ptid = pid_to_ptid (MAGIC_NULL_PID); - - /* With this target we start out by owning the terminal. */ - remote_async_terminal_ours_p = 1; - - /* FIXME: cagney/1999-09-23: During the initial connection it is - assumed that the target is already ready and able to respond to - requests. Unfortunately remote_start_remote() eventually calls - wait_for_inferior() with no timeout. wait_forever_enabled_p gets - around this. Eventually a mechanism that allows - wait_for_inferior() to expect/get timeouts will be - implemented. */ - wait_forever_enabled_p = 0; - -#ifdef SOLIB_CREATE_INFERIOR_HOOK - /* First delete any symbols previously loaded from shared libraries. */ - no_shared_libraries (NULL, 0); -#endif - - /* Start the remote connection; if error, discard this target. See - the comments in remote_open_1() for further details such as the - need to re-throw the exception. */ - ex = catch_exceptions (uiout, - remote_start_remote, NULL, - "Couldn't establish connection to remote" - " target\n", - RETURN_MASK_ALL); - if (ex < 0) - { - pop_target (); - wait_forever_enabled_p = 1; - throw_exception (ex); - } - - wait_forever_enabled_p = 1; + if (async_p) + wait_forever_enabled_p = 1; if (extended_p) { @@ -4985,11 +4886,11 @@ remote_insert_hw_breakpoint (CORE_ADDR addr, char *shadow) char *buf = alloca (rs->remote_packet_size); char *p = buf; - /* The length field should be set to soething so that the packet is - well formed. */ + /* The length field should be set to the size of a breakpoint + instruction. */ + + BREAKPOINT_FROM_PC (&addr, &len); - len = strlen (shadow); - len = len ? len : 1; if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE) error ("Can't set hardware breakpoint without the '%s' (%s) packet\n", remote_protocol_Z[Z_PACKET_HARDWARE_BP].name, @@ -5026,8 +4927,12 @@ remote_remove_hw_breakpoint (CORE_ADDR addr, char *shadow) struct remote_state *rs = get_remote_state (); char *buf = alloca (rs->remote_packet_size); char *p = buf; - - len = sizeof (shadow); + + /* The length field should be set to the size of a breakpoint + instruction. */ + + BREAKPOINT_FROM_PC (&addr, &len); + if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE) error ("Can't clear hardware breakpoint without the '%s' (%s) packet\n", remote_protocol_Z[Z_PACKET_HARDWARE_BP].name, @@ -5073,18 +4978,6 @@ push_remote_target (char *name, int from_tty) remote_open (name, from_tty); } -/* Other targets want to use the entire remote serial module but with - certain remote_ops overridden. */ - -void -open_remote_target (char *name, int from_tty, struct target_ops *target, - int extended_p) -{ - printf_filtered ("Selecting the %sremote protocol\n", - (extended_p ? "extended-" : "")); - remote_open_1 (name, from_tty, target, extended_p); -} - /* Table used by the crc32 function to calcuate the checksum. */ static unsigned long crc32_table[256] = diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 58b1af757cb..f6618618272 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -67,12 +67,14 @@ struct rs6000_framedata int saved_gpr; /* smallest # of saved gpr */ int saved_fpr; /* smallest # of saved fpr */ int saved_vr; /* smallest # of saved vr */ + int saved_ev; /* smallest # of saved ev */ int alloca_reg; /* alloca register number (frame ptr) */ char frameless; /* true if frameless functions. */ char nosavedpc; /* true if pc not saved. */ int gpr_offset; /* offset of saved gprs from prev sp */ int fpr_offset; /* offset of saved fprs from prev sp */ int vr_offset; /* offset of saved vrs from prev sp */ + int ev_offset; /* offset of saved evs from prev sp */ int lr_offset; /* offset of saved lr */ int cr_offset; /* offset of saved cr */ int vrsave_offset; /* offset of saved vrsave register */ @@ -86,12 +88,9 @@ struct reg unsigned char sz32; /* size on 32-bit arch, 0 if nonextant */ unsigned char sz64; /* size on 64-bit arch, 0 if nonextant */ unsigned char fpr; /* whether register is floating-point */ + unsigned char pseudo; /* whether register is pseudo */ }; -/* Return the current architecture's gdbarch_tdep structure. */ - -#define TDEP gdbarch_tdep (current_gdbarch) - /* Breakpoint shadows for the single step instructions will be kept here. */ static struct sstep_breaks @@ -124,6 +123,17 @@ static void frame_get_saved_regs (struct frame_info * fi, struct rs6000_framedata * fdatap); static CORE_ADDR frame_initial_stack_address (struct frame_info *); +/* Is REGNO an AltiVec register? Return 1 if so, 0 otherwise. */ +int +altivec_register_p (int regno) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0) + return 0; + else + return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum); +} + /* Read a LEN-byte address from debugged memory address MEMADDR. */ static CORE_ADDR @@ -252,7 +262,7 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety) fi = get_current_frame (); if (fi != NULL) dest = read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, - TDEP->wordsize); + gdbarch_tdep (current_gdbarch)->wordsize); } } @@ -362,11 +372,13 @@ rs6000_software_single_step (enum target_signal signal, - saved_gpr is the number of the first saved gpr. - saved_fpr is the number of the first saved fpr. - saved_vr is the number of the first saved vr. + - saved_ev is the number of the first saved ev. - alloca_reg is the number of the register used for alloca() handling. Otherwise -1. - gpr_offset is the offset of the first saved gpr from the previous frame. - fpr_offset is the offset of the first saved fpr from the previous frame. - vr_offset is the offset of the first saved vr from the previous frame. + - ev_offset is the offset of the first saved ev from the previous frame. - lr_offset is the offset of the saved lr - cr_offset is the offset of the saved cr - vrsave_offset is the offset of the saved vrsave register @@ -444,13 +456,16 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) int lr_reg = -1; int cr_reg = -1; int vr_reg = -1; + int ev_reg = -1; + long ev_offset = 0; int vrsave_reg = -1; int reg; int framep = 0; int minimal_toc_loaded = 0; int prev_insn_was_prologue_insn = 1; int num_skip_non_prologue_insns = 0; - + const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch); + /* Attempt to find the end of the prologue when no limit is specified. Note that refine_prologue_limit() has been written so that it may be used to "refine" the limits of non-zero PC values too, but this @@ -470,6 +485,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) fdata->saved_gpr = -1; fdata->saved_fpr = -1; fdata->saved_vr = -1; + fdata->saved_ev = -1; fdata->alloca_reg = -1; fdata->frameless = 1; fdata->nosavedpc = 1; @@ -536,7 +552,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) } else if ((op & 0xffff0000) == 0x60000000) { - /* nop */ + /* nop */ /* Allow nops in the prologue, but do not consider them to be part of the prologue unless followed by other prologue instructions. */ @@ -650,7 +666,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) else if ((op & 0xfc0007fe) == 0x7c000378 && /* mr(.) Rx,Ry */ (((op >> 21) & 31) >= 3) && /* R3 >= Ry >= R10 */ (((op >> 21) & 31) <= 10) && - (((op >> 16) & 31) >= fdata->saved_gpr)) /* Rx: local var reg */ + ((long) ((op >> 16) & 31) >= fdata->saved_gpr)) /* Rx: local var reg */ { continue; @@ -731,7 +747,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) in a pair of insns to save the vector registers on the stack. */ /* 001110 00000 00000 iiii iiii iiii iiii */ - else if ((op & 0xffff0000) == 0x38000000) /* li r0, SIMM */ + /* 001110 01110 00000 iiii iiii iiii iiii */ + else if ((op & 0xffff0000) == 0x38000000 /* li r0, SIMM */ + || (op & 0xffff0000) == 0x39c00000) /* li r14, SIMM */ { li_found_pc = pc; vr_saved_offset = SIGNED_SHORT (op); @@ -757,6 +775,104 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) } } /* End AltiVec related instructions. */ + + /* Start BookE related instructions. */ + /* Store gen register S at (r31+uimm). + Any register less than r13 is volatile, so we don't care. */ + /* 000100 sssss 11111 iiiii 01100100001 */ + else if (arch_info->mach == bfd_mach_ppc_e500 + && (op & 0xfc1f07ff) == 0x101f0321) /* evstdd Rs,uimm(R31) */ + { + if ((op & 0x03e00000) >= 0x01a00000) /* Rs >= r13 */ + { + unsigned int imm; + ev_reg = GET_SRC_REG (op); + imm = (op >> 11) & 0x1f; + ev_offset = imm * 8; + /* If this is the first vector reg to be saved, or if + it has a lower number than others previously seen, + reupdate the frame info. */ + if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg) + { + fdata->saved_ev = ev_reg; + fdata->ev_offset = ev_offset + offset; + } + } + continue; + } + /* Store gen register rS at (r1+rB). */ + /* 000100 sssss 00001 bbbbb 01100100000 */ + else if (arch_info->mach == bfd_mach_ppc_e500 + && (op & 0xffe007ff) == 0x13e00320) /* evstddx RS,R1,Rb */ + { + if (pc == (li_found_pc + 4)) + { + ev_reg = GET_SRC_REG (op); + /* If this is the first vector reg to be saved, or if + it has a lower number than others previously seen, + reupdate the frame info. */ + /* We know the contents of rB from the previous instruction. */ + if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg) + { + fdata->saved_ev = ev_reg; + fdata->ev_offset = vr_saved_offset + offset; + } + vr_saved_offset = -1; + ev_reg = -1; + li_found_pc = 0; + } + continue; + } + /* Store gen register r31 at (rA+uimm). */ + /* 000100 11111 aaaaa iiiii 01100100001 */ + else if (arch_info->mach == bfd_mach_ppc_e500 + && (op & 0xffe007ff) == 0x13e00321) /* evstdd R31,Ra,UIMM */ + { + /* Wwe know that the source register is 31 already, but + it can't hurt to compute it. */ + ev_reg = GET_SRC_REG (op); + ev_offset = ((op >> 11) & 0x1f) * 8; + /* If this is the first vector reg to be saved, or if + it has a lower number than others previously seen, + reupdate the frame info. */ + if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg) + { + fdata->saved_ev = ev_reg; + fdata->ev_offset = ev_offset + offset; + } + + continue; + } + /* Store gen register S at (r31+r0). + Store param on stack when offset from SP bigger than 4 bytes. */ + /* 000100 sssss 11111 00000 01100100000 */ + else if (arch_info->mach == bfd_mach_ppc_e500 + && (op & 0xfc1fffff) == 0x101f0320) /* evstddx Rs,R31,R0 */ + { + if (pc == (li_found_pc + 4)) + { + if ((op & 0x03e00000) >= 0x01a00000) + { + ev_reg = GET_SRC_REG (op); + /* If this is the first vector reg to be saved, or if + it has a lower number than others previously seen, + reupdate the frame info. */ + /* We know the contents of r0 from the previous + instruction. */ + if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg) + { + fdata->saved_ev = ev_reg; + fdata->ev_offset = vr_saved_offset + offset; + } + ev_reg = -1; + } + vr_saved_offset = -1; + li_found_pc = 0; + continue; + } + } + /* End BookE related instructions. */ + else { /* Not a recognized prologue instruction. @@ -773,7 +889,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) trampolines. */ break; if ((op & 0xf4000000) == 0x40000000) /* bxx */ - /* Never skip branches. */ + /* Never skip branches. */ break; if (num_skip_non_prologue_insns++ > max_skip_non_prologue_insns) @@ -794,9 +910,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) /* If the first thing after skipping a prolog is a branch to a function, this might be a call to an initializer in main(), introduced by gcc2. - We'd like to skip over it as well. Fortunately, xlc does some extra + We'd like to skip over it as well. Fortunately, xlc does some extra work before calling a function right after a prologue, thus we can - single out such gcc2 behaviour. */ + single out such gcc2 behaviour. */ if ((op & 0xfc000001) == 0x48000001) @@ -806,8 +922,8 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) if (op == 0x4def7b82) { /* cror 0xf, 0xf, 0xf (nop) */ - /* check and see if we are in main. If so, skip over this initializer - function as well. */ + /* Check and see if we are in main. If so, skip over this + initializer function as well. */ tmp = find_pc_misc_function (pc); if (tmp >= 0 && STREQ (misc_function_vector[tmp].name, main_name ())) @@ -827,7 +943,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) *************************************************************************/ -/* Pop the innermost frame, go back to the caller. */ +/* Pop the innermost frame, go back to the caller. */ static void rs6000_pop_frame (void) @@ -850,14 +966,14 @@ rs6000_pop_frame (void) /* Make sure that all registers are valid. */ read_register_bytes (0, NULL, REGISTER_BYTES); - /* figure out previous %pc value. If the function is frameless, it is + /* Figure out previous %pc value. If the function is frameless, it is still in the link register, otherwise walk the frames and retrieve the - saved %pc value in the previous frame. */ + saved %pc value in the previous frame. */ addr = get_pc_function_start (frame->pc); (void) skip_prologue (addr, frame->pc, &fdata); - wordsize = TDEP->wordsize; + wordsize = gdbarch_tdep (current_gdbarch)->wordsize; if (fdata.frameless) prev_sp = sp; else @@ -870,7 +986,7 @@ rs6000_pop_frame (void) /* reset %pc value. */ write_register (PC_REGNUM, lr); - /* reset register values if any was saved earlier. */ + /* reset register values if any was saved earlier. */ if (fdata.saved_gpr != -1) { @@ -898,7 +1014,7 @@ rs6000_pop_frame (void) } /* Fixup the call sequence of a dummy function, with the real function - address. Its arguments will be passed by gdb. */ + address. Its arguments will be passed by gdb. */ static void rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun, @@ -920,8 +1036,8 @@ rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun, the first eight words of the argument list (that might be less than eight parameters if some parameters occupy more than one word) are passed in r3..r10 registers. float and double parameters are - passed in fpr's, in addition to that. Rest of the parameters if any - are passed in user stack. There might be cases in which half of the + passed in fpr's, in addition to that. Rest of the parameters if any + are passed in user stack. There might be cases in which half of the parameter is copied into registers, the other half is pushed into stack. @@ -930,7 +1046,7 @@ rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun, If the function is returning a structure, then the return address is passed in r3, then the first 7 words of the parameters can be passed in registers, - starting from r4. */ + starting from r4. */ static CORE_ADDR rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp, @@ -942,20 +1058,20 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int argbytes; /* current argument byte */ char tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ - int wordsize = TDEP->wordsize; + int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; struct value *arg = 0; struct type *type; CORE_ADDR saved_sp; - /* The first eight words of ther arguments are passed in registers. Copy - them appropriately. + /* The first eight words of ther arguments are passed in registers. + Copy them appropriately. If the function is returning a `struct', then the first word (which - will be passed in r3) is used for struct return address. In that + will be passed in r3) is used for struct return address. In that case we should advance one word and start from r4 register to copy - parameters. */ + parameters. */ ii = struct_return ? 1 : 0; @@ -989,9 +1105,9 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (TYPE_CODE (type) == TYPE_CODE_FLT) { - /* floating point arguments are passed in fpr's, as well as gpr's. + /* Floating point arguments are passed in fpr's, as well as gpr's. There are 13 fpr's reserved for passing parameters. At this point - there is no way we would run out of them. */ + there is no way we would run out of them. */ if (len > 8) printf_unfiltered ( @@ -1006,7 +1122,7 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (len > reg_size) { - /* Argument takes more than one register. */ + /* Argument takes more than one register. */ while (argbytes < len) { memset (®isters[REGISTER_BYTE (ii + 3)], 0, reg_size); @@ -1023,7 +1139,8 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp, --ii; } else - { /* Argument can fit in one register. No problem. */ + { + /* Argument can fit in one register. No problem. */ int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0; memset (®isters[REGISTER_BYTE (ii + 3)], 0, reg_size); memcpy ((char *)®isters[REGISTER_BYTE (ii + 3)] + adj, @@ -1036,17 +1153,17 @@ ran_out_of_registers_for_arguments: saved_sp = read_sp (); - /* location for 8 parameters are always reserved. */ + /* Location for 8 parameters are always reserved. */ sp -= wordsize * 8; - /* another six words for back chain, TOC register, link register, etc. */ + /* Another six words for back chain, TOC register, link register, etc. */ sp -= wordsize * 6; - /* stack pointer must be quadword aligned */ + /* Stack pointer must be quadword aligned. */ sp &= -16; - /* if there are more arguments, allocate space for them in - the stack, then push them starting from the ninth one. */ + /* If there are more arguments, allocate space for them in + the stack, then push them starting from the ninth one. */ if ((argno < nargs) || argbytes) { @@ -1066,19 +1183,20 @@ ran_out_of_registers_for_arguments: space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4; } - /* add location required for the rest of the parameters */ + /* Add location required for the rest of the parameters. */ space = (space + 15) & -16; sp -= space; - /* This is another instance we need to be concerned about securing our - stack space. If we write anything underneath %sp (r1), we might conflict - with the kernel who thinks he is free to use this area. So, update %sp - first before doing anything else. */ + /* This is another instance we need to be concerned about + securing our stack space. If we write anything underneath %sp + (r1), we might conflict with the kernel who thinks he is free + to use this area. So, update %sp first before doing anything + else. */ write_register (SP_REGNUM, sp); - /* if the last argument copied into the registers didn't fit there - completely, push the rest of it into stack. */ + /* If the last argument copied into the registers didn't fit there + completely, push the rest of it into stack. */ if (argbytes) { @@ -1089,7 +1207,7 @@ ran_out_of_registers_for_arguments: ii += ((len - argbytes + 3) & -4) / 4; } - /* push the rest of the arguments into stack. */ + /* Push the rest of the arguments into stack. */ for (; argno < nargs; ++argno) { @@ -1098,7 +1216,8 @@ ran_out_of_registers_for_arguments: len = TYPE_LENGTH (type); - /* float types should be passed in fpr's, as well as in the stack. */ + /* Float types should be passed in fpr's, as well as in the + stack. */ if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13) { @@ -1117,7 +1236,7 @@ ran_out_of_registers_for_arguments: } } else - /* Secure stack areas first, before doing anything else. */ + /* Secure stack areas first, before doing anything else. */ write_register (SP_REGNUM, sp); /* set back chain properly */ @@ -1129,7 +1248,7 @@ ran_out_of_registers_for_arguments: } /* Function: ppc_push_return_address (pc, sp) - Set up the return address for the inferior function call. */ + Set up the return address for the inferior function call. */ static CORE_ADDR ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp) @@ -1140,7 +1259,63 @@ ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp) } /* Extract a function return value of type TYPE from raw register array - REGBUF, and copy that return value into VALBUF in virtual format. */ + REGBUF, and copy that return value into VALBUF in virtual format. */ +static void +e500_extract_return_value (struct type *valtype, struct regcache *regbuf, void *valbuf) +{ + int offset = 0; + int vallen = TYPE_LENGTH (valtype); + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY + && vallen == 8 + && TYPE_VECTOR (valtype)) + { + regcache_raw_read (regbuf, tdep->ppc_ev0_regnum + 3, valbuf); + } + else + { + /* Return value is copied starting from r3. Note that r3 for us + is a pseudo register. */ + int offset = 0; + int return_regnum = tdep->ppc_gp0_regnum + 3; + int reg_size = REGISTER_RAW_SIZE (return_regnum); + int reg_part_size; + char *val_buffer; + int copied = 0; + int i = 0; + + /* Compute where we will start storing the value from. */ + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + if (vallen <= reg_size) + offset = reg_size - vallen; + else + offset = reg_size + (reg_size - vallen); + } + + /* How big does the local buffer need to be? */ + if (vallen <= reg_size) + val_buffer = alloca (reg_size); + else + val_buffer = alloca (vallen); + + /* Read all we need into our private buffer. We copy it in + chunks that are as long as one register, never shorter, even + if the value is smaller than the register. */ + while (copied < vallen) + { + reg_part_size = REGISTER_RAW_SIZE (return_regnum + i); + /* It is a pseudo/cooked register. */ + regcache_cooked_read (regbuf, return_regnum + i, + val_buffer + copied); + copied += reg_part_size; + i++; + } + /* Put the stuff in the return buffer. */ + memcpy (valbuf, val_buffer + offset, vallen); + } +} static void rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf) @@ -1155,7 +1330,7 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf) float ff; /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes. We need to truncate the return value into float size (4 byte) if - necessary. */ + necessary. */ if (TYPE_LENGTH (valtype) > 4) /* this is a double */ memcpy (valbuf, @@ -1284,7 +1459,7 @@ rs6000_skip_trampoline_code (CORE_ADDR pc) return 0; } ii = read_register (11); /* r11 holds destination addr */ - pc = read_memory_addr (ii, TDEP->wordsize); /* (r11) value */ + pc = read_memory_addr (ii, gdbarch_tdep (current_gdbarch)->wordsize); /* (r11) value */ return pc; } @@ -1304,13 +1479,13 @@ rs6000_frameless_function_invocation (struct frame_info *fi) func_start = get_pc_function_start (fi->pc); /* If we failed to find the start of the function, it is a mistake - to inspect the instructions. */ + to inspect the instructions. */ if (!func_start) { /* A frame with a zero PC is usually created by dereferencing a NULL function pointer, normally causing an immediate core dump of the - inferior. Mark function as frameless, as the inferior has no chance + inferior. Mark function as frameless, as the inferior has no chance of setting up a stack frame. */ if (fi->pc == 0) return 1; @@ -1322,14 +1497,14 @@ rs6000_frameless_function_invocation (struct frame_info *fi) return fdata.frameless; } -/* Return the PC saved in a frame */ +/* Return the PC saved in a frame. */ CORE_ADDR rs6000_frame_saved_pc (struct frame_info *fi) { CORE_ADDR func_start; struct rs6000_framedata fdata; - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int wordsize = tdep->wordsize; if (fi->signal_handler_caller) @@ -1341,7 +1516,7 @@ rs6000_frame_saved_pc (struct frame_info *fi) func_start = get_pc_function_start (fi->pc); /* If we failed to find the start of the function, it is a mistake - to inspect the instructions. */ + to inspect the instructions. */ if (!func_start) return 0; @@ -1387,16 +1562,18 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) frame_saved_regs_zalloc (fi); /* If there were any saved registers, figure out parent's stack - pointer. */ + pointer. */ /* The following is true only if the frame doesn't have a call to - alloca(), FIXME. */ + alloca(), FIXME. */ if (fdatap->saved_fpr == 0 && fdatap->saved_gpr == 0 && fdatap->saved_vr == 0 + && fdatap->saved_ev == 0 && fdatap->lr_offset == 0 && fdatap->cr_offset == 0 - && fdatap->vr_offset == 0) + && fdatap->vr_offset == 0 + && fdatap->ev_offset == 0) frame_addr = 0; else /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most @@ -1450,6 +1627,23 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) } } + /* if != -1, fdatap->saved_ev is the smallest number of saved_ev. + All vr's from saved_ev to ev31 are saved. ????? */ + if (tdep->ppc_ev0_regnum != -1 && tdep->ppc_ev31_regnum != -1) + { + if (fdatap->saved_ev >= 0) + { + int i; + CORE_ADDR ev_addr = frame_addr + fdatap->ev_offset; + for (i = fdatap->saved_ev; i < 32; i++) + { + fi->saved_regs[tdep->ppc_ev0_regnum + i] = ev_addr; + fi->saved_regs[tdep->ppc_gp0_regnum + i] = ev_addr + 4; + ev_addr += REGISTER_RAW_SIZE (tdep->ppc_ev0_regnum); + } + } + } + /* If != 0, fdatap->cr_offset is the offset from the frame that holds the CR. */ if (fdatap->cr_offset != 0) @@ -1467,8 +1661,8 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) } /* Return the address of a frame. This is the inital %sp value when the frame - was first allocated. For functions calling alloca(), it might be saved in - an alloca register. */ + was first allocated. For functions calling alloca(), it might be saved in + an alloca register. */ static CORE_ADDR frame_initial_stack_address (struct frame_info *fi) @@ -1477,23 +1671,24 @@ frame_initial_stack_address (struct frame_info *fi) struct rs6000_framedata fdata; struct frame_info *callee_fi; - /* if the initial stack pointer (frame address) of this frame is known, - just return it. */ + /* If the initial stack pointer (frame address) of this frame is known, + just return it. */ if (fi->extra_info->initial_sp) return fi->extra_info->initial_sp; - /* find out if this function is using an alloca register.. */ + /* Find out if this function is using an alloca register. */ (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, &fdata); - /* if saved registers of this frame are not known yet, read and cache them. */ + /* If saved registers of this frame are not known yet, read and + cache them. */ if (!fi->saved_regs) frame_get_saved_regs (fi, &fdata); /* If no alloca register used, then fi->frame is the value of the %sp for - this frame, and it is good enough. */ + this frame, and it is good enough. */ if (fdata.alloca_reg < 0) { @@ -1524,7 +1719,7 @@ frame_initial_stack_address (struct frame_info *fi) (its caller). */ /* FRAME_CHAIN takes a frame's nominal address - and produces the frame's chain-pointer. */ + 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. */ @@ -1533,7 +1728,7 @@ CORE_ADDR rs6000_frame_chain (struct frame_info *thisframe) { CORE_ADDR fp, fpp, lr; - int wordsize = TDEP->wordsize; + int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) return thisframe->frame; /* dummy frame same as caller's frame */ @@ -1564,7 +1759,7 @@ rs6000_frame_chain (struct frame_info *thisframe) } /* Return the size of register REG when words are WORDSIZE bytes long. If REG - isn't available with that word size, return 0. */ + isn't available with that word size, return 0. */ static int regsize (const struct reg *reg, int wordsize) @@ -1573,12 +1768,12 @@ regsize (const struct reg *reg, int wordsize) } /* Return the name of register number N, or null if no such register exists - in the current architecture. */ + in the current architecture. */ static const char * rs6000_register_name (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; if (!regsize (reg, tdep->wordsize)) @@ -1592,16 +1787,16 @@ rs6000_register_name (int n) static int rs6000_register_byte (int n) { - return TDEP->regoff[n]; + return gdbarch_tdep (current_gdbarch)->regoff[n]; } /* Return the number of bytes of storage in the actual machine representation - for register N if that register is available, else return 0. */ + for register N if that register is available, else return 0. */ static int rs6000_register_raw_size (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; return regsize (reg, tdep->wordsize); } @@ -1612,7 +1807,7 @@ rs6000_register_raw_size (int n) static struct type * rs6000_register_virtual_type (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; if (reg->fpr) @@ -1623,7 +1818,10 @@ rs6000_register_virtual_type (int n) switch (size) { case 8: - return builtin_type_int64; + if (tdep->ppc_ev0_regnum <= n && n <= tdep->ppc_ev31_regnum) + return builtin_type_vec64; + else + return builtin_type_int64; break; case 16: return builtin_type_vec128; @@ -1638,7 +1836,7 @@ rs6000_register_virtual_type (int n) /* For the PowerPC, it appears that the debug info marks float parameters as floats regardless of whether the function is prototyped, but the actual values are always passed in as doubles. Tell gdb to always assume that - floats are passed as doubles and then converted in the callee. */ + floats are passed as doubles and then converted in the callee. */ static int rs6000_coerce_float_to_double (struct type *formal, struct type *actual) @@ -1650,17 +1848,17 @@ rs6000_coerce_float_to_double (struct type *formal, struct type *actual) to virtual format. The register format for RS/6000 floating point registers is always - double, we need a conversion if the memory format is float. */ + double, we need a conversion if the memory format is float. */ static int rs6000_register_convertible (int n) { - const struct reg *reg = TDEP->regs + n; + const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + n; return reg->fpr; } /* Convert data from raw format for register N in buffer FROM - to virtual format with type TYPE in buffer TO. */ + to virtual format with type TYPE in buffer TO. */ static void rs6000_register_convert_to_virtual (int n, struct type *type, @@ -1676,7 +1874,7 @@ rs6000_register_convert_to_virtual (int n, struct type *type, } /* Convert data from virtual format with type TYPE in buffer FROM - to raw format for register N in buffer TO. */ + to raw format for register N in buffer TO. */ static void rs6000_register_convert_to_raw (struct type *type, int n, @@ -1691,185 +1889,70 @@ rs6000_register_convert_to_raw (struct type *type, int n, memcpy (to, from, REGISTER_RAW_SIZE (n)); } -int -altivec_register_p (int regno) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0) - return 0; - else - return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum); -} - static void -rs6000_do_altivec_registers (int regnum) +e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int reg_nr, void *buffer) { - int i; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE); - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + int base_regnum; + int offset = 0; + char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - for (i = tdep->ppc_vr0_regnum; i <= tdep->ppc_vrsave_regnum; i++) + if (reg_nr >= tdep->ppc_gp0_regnum + && reg_nr <= tdep->ppc_gplast_regnum) { - /* If we want just one reg, check that this is the one we want. */ - if (regnum != -1 && i != regnum) - continue; - - /* If the register name is empty, it is undefined for this - processor, so don't display anything. */ - if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0') - continue; - - fputs_filtered (REGISTER_NAME (i), gdb_stdout); - print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout); - - /* Get the data in raw format. */ - if (!frame_register_read (selected_frame, i, raw_buffer)) - { - printf_filtered ("*value not available*\n"); - continue; - } - - /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (i)) - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), - raw_buffer, virtual_buffer); - else - memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i)); - - /* Print as integer in hex only. */ - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 'x', 1, 0, Val_pretty_default); - printf_filtered ("\n"); + base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; + + /* Build the value in the provided buffer. */ + /* Read the raw register of which this one is the lower portion. */ + regcache_raw_read (regcache, base_regnum, temp_buffer); + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + offset = 4; + memcpy ((char *) buffer, temp_buffer + offset, 4); } } static void -rs6000_altivec_registers_info (char *addr_exp, int from_tty) +e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, + int reg_nr, const void *buffer) { - int regnum, numregs; - register char *end; - - if (!target_has_registers) - error ("The program has no registers now."); - if (selected_frame == NULL) - error ("No selected frame."); + int base_regnum; + int offset = 0; + char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if (!addr_exp) + if (reg_nr >= tdep->ppc_gp0_regnum + && reg_nr <= tdep->ppc_gplast_regnum) { - rs6000_do_altivec_registers (-1); - return; + base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; + /* reg_nr is 32 bit here, and base_regnum is 64 bits. */ + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + offset = 4; + + /* Let's read the value of the base register into a temporary + buffer, so that overwriting the last four bytes with the new + value of the pseudo will leave the upper 4 bytes unchanged. */ + regcache_raw_read (regcache, base_regnum, temp_buffer); + + /* Write as an 8 byte quantity. */ + memcpy (temp_buffer + offset, (char *) buffer, 4); + regcache_raw_write (regcache, base_regnum, temp_buffer); } - - numregs = NUM_REGS + NUM_PSEUDO_REGS; - do - { - if (addr_exp[0] == '$') - addr_exp++; - end = addr_exp; - while (*end != '\0' && *end != ' ' && *end != '\t') - ++end; - - regnum = target_map_name_to_register (addr_exp, end - addr_exp); - if (regnum < 0) - { - regnum = numregs; - if (*addr_exp >= '0' && *addr_exp <= '9') - regnum = atoi (addr_exp); /* Take a number */ - if (regnum >= numregs) /* Bad name, or bad number */ - error ("%.*s: invalid register", end - addr_exp, addr_exp); - } - - rs6000_do_altivec_registers (regnum); - - addr_exp = end; - while (*addr_exp == ' ' || *addr_exp == '\t') - ++addr_exp; - } - while (*addr_exp != '\0'); } -static void -rs6000_do_registers_info (int regnum, int fpregs) +/* Convert a dwarf2 register number to a gdb REGNUM. */ +static int +e500_dwarf2_reg_to_regnum (int num) { - register int i; - int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE); - - for (i = 0; i < numregs; i++) - { - /* Decide between printing all regs, nonfloat regs, or specific reg. */ - if (regnum == -1) - { - if ((TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs) - || (altivec_register_p (i) && !fpregs)) - continue; - } - else - { - if (i != regnum) - continue; - } - - /* If the register name is empty, it is undefined for this - processor, so don't display anything. */ - if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0') - continue; - - fputs_filtered (REGISTER_NAME (i), gdb_stdout); - print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout); - - /* Get the data in raw format. */ - if (!frame_register_read (selected_frame, i, raw_buffer)) - { - printf_filtered ("*value not available*\n"); - continue; - } - - /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (i)) - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), - raw_buffer, virtual_buffer); - else - memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i)); - - /* If virtual format is floating, print it that way, and in raw hex. */ - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) - { - register int j; - - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 0, 1, 0, Val_pretty_default); - - printf_filtered ("\t(raw 0x"); - for (j = 0; j < REGISTER_RAW_SIZE (i); j++) - { - register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j - : REGISTER_RAW_SIZE (i) - 1 - j; - printf_filtered ("%02x", (unsigned char) raw_buffer[idx]); - } - printf_filtered (")"); - } - else - { - /* Print the register in hex. */ - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 'x', 1, 0, Val_pretty_default); - /* If not a vector register, print it also in decimal. */ - if (!altivec_register_p (i)) - { - printf_filtered ("\t"); - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, - gdb_stdout, 0, 1, 0, Val_pretty_default); - } - } - printf_filtered ("\n"); - } + int regnum; + if (0 <= num && num <= 31) + return num + gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum; + else + return num; } /* Convert a dbx stab register number (from `r' declaration) to a gdb - REGNUM. */ + REGNUM. */ static int rs6000_stab_reg_to_regnum (int num) { @@ -1901,7 +1984,7 @@ rs6000_stab_reg_to_regnum (int num) In RS/6000, struct return addresses are passed as an extra parameter in r3. In function return, callee is not responsible of returning this address back. Since gdb needs to find it, we will store in a designated variable - `rs6000_struct_return_address'. */ + `rs6000_struct_return_address'. */ static void rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) @@ -1912,6 +1995,27 @@ rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ +static void +e500_store_return_value (struct type *type, char *valbuf) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + /* Everything is returned in GPR3 and up. */ + int copied = 0; + int i = 0; + int len = TYPE_LENGTH (type); + while (copied < len) + { + int regnum = gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3 + i; + int reg_size = REGISTER_RAW_SIZE (regnum); + char *reg_val_buf = alloca (reg_size); + + memcpy (reg_val_buf, valbuf + copied, reg_size); + copied += reg_size; + write_register_gen (regnum, reg_val_buf); + i++; + } +} static void rs6000_store_return_value (struct type *type, char *valbuf) @@ -1922,7 +2026,7 @@ rs6000_store_return_value (struct type *type, char *valbuf) /* Floating point values are returned starting from FPR1 and up. Say a double_double_double type could be returned in - FPR1/FPR2/FPR3 triple. */ + FPR1/FPR2/FPR3 triple. */ write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf, TYPE_LENGTH (type)); @@ -1934,7 +2038,7 @@ rs6000_store_return_value (struct type *type, char *valbuf) valbuf, TYPE_LENGTH (type)); } else - /* Everything else is returned in GPR3 and up. */ + /* Everything else is returned in GPR3 and up. */ write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3), valbuf, TYPE_LENGTH (type)); } @@ -1952,7 +2056,7 @@ rs6000_extract_struct_value_address (char *regbuf) /* Return whether PC is in a dummy function call. FIXME: This just checks for the end of the stack, which is broken - for things like stepping through gcc nested function stubs. */ + for things like stepping through gcc nested function stubs. */ static int rs6000_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp) @@ -1960,7 +2064,7 @@ rs6000_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp) return sp < pc && pc < fp; } -/* Hook called when a new child process is started. */ +/* Hook called when a new child process is started. */ void rs6000_create_inferior (int pid) @@ -1998,7 +2102,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) return addr; /* ADDR is in the data space, so it's a special function pointer. */ - return read_memory_addr (addr, TDEP->wordsize); + return read_memory_addr (addr, gdbarch_tdep (current_gdbarch)->wordsize); } @@ -2039,41 +2143,44 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) would introduce a really large gap between fpscr and the rest of the registers for most processors. */ -/* Convenience macros for populating register arrays. */ +/* Convenience macros for populating register arrays. */ -/* Within another macro, convert S to a string. */ +/* Within another macro, convert S to a string. */ #define STR(s) #s /* Return a struct reg defining register NAME that's 32 bits on 32-bit systems - and 64 bits on 64-bit systems. */ -#define R(name) { STR(name), 4, 8, 0 } + and 64 bits on 64-bit systems. */ +#define R(name) { STR(name), 4, 8, 0, 0 } /* Return a struct reg defining register NAME that's 32 bits on all - systems. */ -#define R4(name) { STR(name), 4, 4, 0 } + systems. */ +#define R4(name) { STR(name), 4, 4, 0, 0 } /* Return a struct reg defining register NAME that's 64 bits on all - systems. */ -#define R8(name) { STR(name), 8, 8, 0 } + systems. */ +#define R8(name) { STR(name), 8, 8, 0, 0 } /* Return a struct reg defining register NAME that's 128 bits on all - systems. */ -#define R16(name) { STR(name), 16, 16, 0 } + systems. */ +#define R16(name) { STR(name), 16, 16, 0, 0 } + +/* Return a struct reg defining floating-point register NAME. */ +#define F(name) { STR(name), 8, 8, 1, 0 } -/* Return a struct reg defining floating-point register NAME. */ -#define F(name) { STR(name), 8, 8, 1 } +/* Return a struct reg defining a pseudo register NAME. */ +#define P(name) { STR(name), 4, 8, 0, 1} /* Return a struct reg defining register NAME that's 32 bits on 32-bit - systems and that doesn't exist on 64-bit systems. */ -#define R32(name) { STR(name), 4, 0, 0 } + systems and that doesn't exist on 64-bit systems. */ +#define R32(name) { STR(name), 4, 0, 0, 0 } /* Return a struct reg defining register NAME that's 64 bits on 64-bit - systems and that doesn't exist on 32-bit systems. */ -#define R64(name) { STR(name), 0, 8, 0 } + systems and that doesn't exist on 32-bit systems. */ +#define R64(name) { STR(name), 0, 8, 0, 0 } -/* Return a struct reg placeholder for a register that doesn't exist. */ -#define R0 { 0, 0, 0, 0 } +/* Return a struct reg placeholder for a register that doesn't exist. */ +#define R0 { 0, 0, 0, 0, 0 } /* UISA registers common across all architectures, including POWER. */ @@ -2103,6 +2210,10 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) #define PPC_UISA_SPRS \ /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R4(fpscr) +/* UISA-level SPRs for PowerPC without floating point support. */ +#define PPC_UISA_NOFP_SPRS \ + /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R0 + /* Segment registers, for PowerPC. */ #define PPC_SEGMENT_REGS \ /* 71 */ R32(sr0), R32(sr1), R32(sr2), R32(sr3), \ @@ -2122,7 +2233,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) /* 112 */ R(srr0), R(srr1), R(tbl), R(tbu), \ /* 116 */ R4(dec), R(dabr), R4(ear) -/* AltiVec registers */ +/* AltiVec registers. */ #define PPC_ALTIVEC_REGS \ /*119*/R16(vr0), R16(vr1), R16(vr2), R16(vr3), R16(vr4), R16(vr5), R16(vr6), R16(vr7), \ /*127*/R16(vr8), R16(vr9), R16(vr10),R16(vr11),R16(vr12),R16(vr13),R16(vr14),R16(vr15), \ @@ -2130,8 +2241,22 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) /*143*/R16(vr24),R16(vr25),R16(vr26),R16(vr27),R16(vr28),R16(vr29),R16(vr30),R16(vr31), \ /*151*/R4(vscr), R4(vrsave) +/* Vectors of hi-lo general purpose registers. */ +#define PPC_EV_REGS \ + /* 0*/R8(ev0), R8(ev1), R8(ev2), R8(ev3), R8(ev4), R8(ev5), R8(ev6), R8(ev7), \ + /* 8*/R8(ev8), R8(ev9), R8(ev10),R8(ev11),R8(ev12),R8(ev13),R8(ev14),R8(ev15), \ + /*16*/R8(ev16),R8(ev17),R8(ev18),R8(ev19),R8(ev20),R8(ev21),R8(ev22),R8(ev23), \ + /*24*/R8(ev24),R8(ev25),R8(ev26),R8(ev27),R8(ev28),R8(ev29),R8(ev30),R8(ev31) + +/* Lower half of the EV registers. */ +#define PPC_GPRS_PSEUDO_REGS \ + /* 0 */ P(r0), P(r1), P(r2), P(r3), P(r4), P(r5), P(r6), P(r7), \ + /* 8 */ P(r8), P(r9), P(r10),P(r11),P(r12),P(r13),P(r14),P(r15), \ + /* 16 */ P(r16),P(r17),P(r18),P(r19),P(r20),P(r21),P(r22),P(r23), \ + /* 24 */ P(r24),P(r25),P(r26),P(r27),P(r28),P(r29),P(r30),P(r31), \ + /* IBM POWER (pre-PowerPC) architecture, user-level view. We only cover - user-level SPR's. */ + user-level SPR's. */ static const struct reg registers_power[] = { COMMON_UISA_REGS, @@ -2140,7 +2265,7 @@ static const struct reg registers_power[] = }; /* PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only - view of the PowerPC. */ + view of the PowerPC. */ static const struct reg registers_powerpc[] = { COMMON_UISA_REGS, @@ -2156,7 +2281,7 @@ static const struct reg registers_powerpc_nofp[] = PPC_UISA_SPRS }; -/* IBM PowerPC 403. */ +/* IBM PowerPC 403. */ static const struct reg registers_403[] = { COMMON_UISA_REGS, @@ -2171,7 +2296,7 @@ static const struct reg registers_403[] = /* 139 */ R(pbl1), R(pbu1), R(pbl2), R(pbu2) }; -/* IBM PowerPC 403GC. */ +/* IBM PowerPC 403GC. */ static const struct reg registers_403GC[] = { COMMON_UISA_REGS, @@ -2188,7 +2313,7 @@ static const struct reg registers_403GC[] = /* 147 */ R(tbhu), R(tblu) }; -/* Motorola PowerPC 505. */ +/* Motorola PowerPC 505. */ static const struct reg registers_505[] = { COMMON_UISA_REGS, @@ -2198,7 +2323,7 @@ static const struct reg registers_505[] = /* 119 */ R(eie), R(eid), R(nri) }; -/* Motorola PowerPC 860 or 850. */ +/* Motorola PowerPC 860 or 850. */ static const struct reg registers_860[] = { COMMON_UISA_REGS, @@ -2232,7 +2357,7 @@ static const struct reg registers_601[] = /* 123 */ R(pir), R(mq), R(rtcu), R(rtcl) }; -/* Motorola PowerPC 602. */ +/* Motorola PowerPC 602. */ static const struct reg registers_602[] = { COMMON_UISA_REGS, @@ -2244,7 +2369,7 @@ static const struct reg registers_602[] = /* 127 */ R(sebr), R(ser), R(sp), R(lt) }; -/* Motorola/IBM PowerPC 603 or 603e. */ +/* Motorola/IBM PowerPC 603 or 603e. */ static const struct reg registers_603[] = { COMMON_UISA_REGS, @@ -2256,7 +2381,7 @@ static const struct reg registers_603[] = /* 127 */ R(hash2), R(imiss), R(icmp), R(rpa) }; -/* Motorola PowerPC 604 or 604e. */ +/* Motorola PowerPC 604 or 604e. */ static const struct reg registers_604[] = { COMMON_UISA_REGS, @@ -2268,7 +2393,7 @@ static const struct reg registers_604[] = /* 127 */ R(sia), R(sda) }; -/* Motorola/IBM PowerPC 750 or 740. */ +/* Motorola/IBM PowerPC 750 or 740. */ static const struct reg registers_750[] = { COMMON_UISA_REGS, @@ -2284,7 +2409,7 @@ static const struct reg registers_750[] = }; -/* Motorola PowerPC 7400. */ +/* Motorola PowerPC 7400. */ static const struct reg registers_7400[] = { /* gpr0-gpr31, fpr0-fpr31 */ @@ -2299,6 +2424,18 @@ static const struct reg registers_7400[] = /* FIXME? Add more registers? */ }; +/* Motorola e500. */ +static const struct reg registers_e500[] = +{ + R(pc), R(ps), + /* cr, lr, ctr, xer, "" */ + PPC_UISA_NOFP_SPRS, + /* 7...38 */ + PPC_EV_REGS, + /* 39...70 */ + PPC_GPRS_PSEUDO_REGS +}; + /* Information about a particular processor variant. */ struct variant @@ -2309,20 +2446,53 @@ struct variant /* English description of the variant. */ char *description; - /* bfd_arch_info.arch corresponding to variant. */ + /* bfd_arch_info.arch corresponding to variant. */ enum bfd_architecture arch; - /* bfd_arch_info.mach corresponding to variant. */ + /* bfd_arch_info.mach corresponding to variant. */ unsigned long mach; + /* Number of real registers. */ + int nregs; + + /* Number of pseudo registers. */ + int npregs; + + /* Number of total registers (the sum of nregs and npregs). */ + int num_tot_regs; + /* Table of register names; registers[R] is the name of the register number R. */ - int nregs; const struct reg *regs; }; -#define num_registers(list) (sizeof (list) / sizeof((list)[0])) +#define tot_num_registers(list) (sizeof (list) / sizeof((list)[0])) +static int +num_registers (const struct reg *reg_list, int num_tot_regs) +{ + int i; + int nregs = 0; + + for (i = 0; i < num_tot_regs; i++) + if (!reg_list[i].pseudo) + nregs++; + + return nregs; +} + +static int +num_pseudo_registers (const struct reg *reg_list, int num_tot_regs) +{ + int i; + int npregs = 0; + + for (i = 0; i < num_tot_regs; i++) + if (reg_list[i].pseudo) + npregs ++; + + return npregs; +} /* Information in this table comes from the following web sites: IBM: http://www.chips.ibm.com:80/products/embedded/ @@ -2334,62 +2504,101 @@ struct variant If you add entries to this table, please be sure to allow the new value as an argument to the --with-cpu flag, in configure.in. */ -static const struct variant variants[] = +static struct variant variants[] = { + {"powerpc", "PowerPC user-level", bfd_arch_powerpc, - bfd_mach_ppc, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"power", "POWER user-level", bfd_arch_rs6000, - bfd_mach_rs6k, num_registers (registers_power), registers_power}, + bfd_mach_rs6k, -1, -1, tot_num_registers (registers_power), + registers_power}, {"403", "IBM PowerPC 403", bfd_arch_powerpc, - bfd_mach_ppc_403, num_registers (registers_403), registers_403}, + bfd_mach_ppc_403, -1, -1, tot_num_registers (registers_403), + registers_403}, {"601", "Motorola PowerPC 601", bfd_arch_powerpc, - bfd_mach_ppc_601, num_registers (registers_601), registers_601}, + bfd_mach_ppc_601, -1, -1, tot_num_registers (registers_601), + registers_601}, {"602", "Motorola PowerPC 602", bfd_arch_powerpc, - bfd_mach_ppc_602, num_registers (registers_602), registers_602}, + bfd_mach_ppc_602, -1, -1, tot_num_registers (registers_602), + registers_602}, {"603", "Motorola/IBM PowerPC 603 or 603e", bfd_arch_powerpc, - bfd_mach_ppc_603, num_registers (registers_603), registers_603}, + bfd_mach_ppc_603, -1, -1, tot_num_registers (registers_603), + registers_603}, {"604", "Motorola PowerPC 604 or 604e", bfd_arch_powerpc, - 604, num_registers (registers_604), registers_604}, + 604, -1, -1, tot_num_registers (registers_604), + registers_604}, {"403GC", "IBM PowerPC 403GC", bfd_arch_powerpc, - bfd_mach_ppc_403gc, num_registers (registers_403GC), registers_403GC}, + bfd_mach_ppc_403gc, -1, -1, tot_num_registers (registers_403GC), + registers_403GC}, {"505", "Motorola PowerPC 505", bfd_arch_powerpc, - bfd_mach_ppc_505, num_registers (registers_505), registers_505}, + bfd_mach_ppc_505, -1, -1, tot_num_registers (registers_505), + registers_505}, {"860", "Motorola PowerPC 860 or 850", bfd_arch_powerpc, - bfd_mach_ppc_860, num_registers (registers_860), registers_860}, + bfd_mach_ppc_860, -1, -1, tot_num_registers (registers_860), + registers_860}, {"750", "Motorola/IBM PowerPC 750 or 740", bfd_arch_powerpc, - bfd_mach_ppc_750, num_registers (registers_750), registers_750}, + bfd_mach_ppc_750, -1, -1, tot_num_registers (registers_750), + registers_750}, {"7400", "Motorola/IBM PowerPC 7400 (G4)", bfd_arch_powerpc, - bfd_mach_ppc_7400, num_registers (registers_7400), registers_7400}, + bfd_mach_ppc_7400, -1, -1, tot_num_registers (registers_7400), + registers_7400}, + {"e500", "Motorola PowerPC e500", bfd_arch_powerpc, + bfd_mach_ppc_e500, -1, -1, tot_num_registers (registers_e500), + registers_e500}, /* 64-bit */ {"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc, - bfd_mach_ppc64, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc64, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"620", "Motorola PowerPC 620", bfd_arch_powerpc, - bfd_mach_ppc_620, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc_620, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"630", "Motorola PowerPC 630", bfd_arch_powerpc, - bfd_mach_ppc_630, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc_630, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"a35", "PowerPC A35", bfd_arch_powerpc, - bfd_mach_ppc_a35, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc_a35, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"rs64ii", "PowerPC rs64ii", bfd_arch_powerpc, - bfd_mach_ppc_rs64ii, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc_rs64ii, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, {"rs64iii", "PowerPC rs64iii", bfd_arch_powerpc, - bfd_mach_ppc_rs64iii, num_registers (registers_powerpc), registers_powerpc}, + bfd_mach_ppc_rs64iii, -1, -1, tot_num_registers (registers_powerpc), + registers_powerpc}, - /* FIXME: I haven't checked the register sets of the following. */ + /* FIXME: I haven't checked the register sets of the following. */ {"rs1", "IBM POWER RS1", bfd_arch_rs6000, - bfd_mach_rs6k_rs1, num_registers (registers_power), registers_power}, + bfd_mach_rs6k_rs1, -1, -1, tot_num_registers (registers_power), + registers_power}, {"rsc", "IBM POWER RSC", bfd_arch_rs6000, - bfd_mach_rs6k_rsc, num_registers (registers_power), registers_power}, + bfd_mach_rs6k_rsc, -1, -1, tot_num_registers (registers_power), + registers_power}, {"rs2", "IBM POWER RS2", bfd_arch_rs6000, - bfd_mach_rs6k_rs2, num_registers (registers_power), registers_power}, + bfd_mach_rs6k_rs2, -1, -1, tot_num_registers (registers_power), + registers_power}, - {0, 0, 0, 0} + {0, 0, 0, 0, 0, 0, 0, 0} }; -#undef num_registers +/* Initialize the number of registers and pseudo registers in each variant. */ + +static void +init_variants (void) +{ + struct variant *v; + + for (v = variants; v->name; v++) + { + if (v->nregs == -1) + v->nregs = num_registers (v->regs, v->num_tot_regs); + if (v->npregs == -1) + v->npregs = num_pseudo_registers (v->regs, v->num_tot_regs); + } +} /* Return the variant corresponding to architecture ARCH and machine number - MACH. If no such variant exists, return null. */ + MACH. If no such variant exists, return null. */ static const struct variant * find_variant_by_arch (enum bfd_architecture arch, unsigned long mach) @@ -2417,7 +2626,7 @@ gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) during this debugging session. Called e.g. at program startup, when reading a core file, and when reading - a binary file. */ + a binary file. */ static struct gdbarch * rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) @@ -2432,6 +2641,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) bfd abfd; int sysv_abi; enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; + asection *sect; from_xcoff_exec = info.abfd && info.abfd->format == bfd_object && bfd_get_flavour (info.abfd) == bfd_target_xcoff_flavour; @@ -2445,7 +2655,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) osabi = gdbarch_lookup_osabi (info.abfd); /* Check word size. If INFO is from a binary file, infer it from - that, else choose a likely default. */ + that, else choose a likely default. */ if (from_xcoff_exec) { if (bfd_xcoff_is_xcoff64 (info.abfd)) @@ -2469,14 +2679,14 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) wordsize = 4; } - /* Find a candidate among extant architectures. */ + /* Find a candidate among extant architectures. */ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) { /* Word size in the various PowerPC bfd_arch_info structs isn't meaningful, because 64-bit CPUs can run in 32-bit mode. So, perform - separate word size check. */ + separate word size check. */ tdep = gdbarch_tdep (arches->gdbarch); if (tdep && tdep->wordsize == wordsize && tdep->osabi == osabi) return arches->gdbarch; @@ -2505,10 +2715,34 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); tdep->wordsize = wordsize; tdep->osabi = osabi; + + /* For e500 executables, the apuinfo section is of help here. Such + section contains the identifier and revision number of each + Application-specific Processing Unit that is present on the + chip. The content of the section is determined by the assembler + which looks at each instruction and determines which unit (and + which version of it) can execute it. In our case we just look for + the existance of the section. */ + + if (info.abfd) + { + sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo"); + if (sect) + { + arch = info.bfd_arch_info->arch; + mach = bfd_mach_ppc_e500; + bfd_default_set_arch_mach (&abfd, arch, mach); + info.bfd_arch_info = bfd_get_arch_info (&abfd); + } + } + gdbarch = gdbarch_alloc (&info, tdep); power = arch == bfd_arch_rs6000; - /* Choose variant. */ + /* Initialize the number of real and pseudo registers in each variant. */ + init_variants (); + + /* Choose variant. */ v = find_variant_by_arch (arch, mach); if (!v) return NULL; @@ -2531,20 +2765,53 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->ppc_mq_regnum = -1; tdep->ppc_fpscr_regnum = power ? 71 : 70; + set_gdbarch_pc_regnum (gdbarch, 64); + set_gdbarch_sp_regnum (gdbarch, 1); + set_gdbarch_fp_regnum (gdbarch, 1); + set_gdbarch_deprecated_extract_return_value (gdbarch, + rs6000_extract_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, rs6000_store_return_value); + if (v->arch == bfd_arch_powerpc) switch (v->mach) { case bfd_mach_ppc: tdep->ppc_vr0_regnum = 71; tdep->ppc_vrsave_regnum = 104; + tdep->ppc_ev0_regnum = -1; + tdep->ppc_ev31_regnum = -1; break; case bfd_mach_ppc_7400: tdep->ppc_vr0_regnum = 119; tdep->ppc_vrsave_regnum = 153; + tdep->ppc_ev0_regnum = -1; + tdep->ppc_ev31_regnum = -1; + break; + case bfd_mach_ppc_e500: + tdep->ppc_gp0_regnum = 39; + tdep->ppc_gplast_regnum = 70; + tdep->ppc_toc_regnum = -1; + tdep->ppc_ps_regnum = 1; + tdep->ppc_cr_regnum = 2; + tdep->ppc_lr_regnum = 3; + tdep->ppc_ctr_regnum = 4; + tdep->ppc_xer_regnum = 5; + tdep->ppc_ev0_regnum = 7; + tdep->ppc_ev31_regnum = 38; + set_gdbarch_pc_regnum (gdbarch, 0); + set_gdbarch_sp_regnum (gdbarch, 40); + set_gdbarch_fp_regnum (gdbarch, 40); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum); + set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write); + set_gdbarch_extract_return_value (gdbarch, e500_extract_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, e500_store_return_value); break; default: tdep->ppc_vr0_regnum = -1; tdep->ppc_vrsave_regnum = -1; + tdep->ppc_ev0_regnum = -1; + tdep->ppc_ev31_regnum = -1; break; } @@ -2557,8 +2824,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->lr_frame_offset = 8; /* Calculate byte offsets in raw register array. */ - tdep->regoff = xmalloc (v->nregs * sizeof (int)); - for (i = off = 0; i < v->nregs; i++) + tdep->regoff = xmalloc (v->num_tot_regs * sizeof (int)); + for (i = off = 0; i < v->num_tot_regs; i++) { tdep->regoff[i] = off; off += regsize (v->regs + i, wordsize); @@ -2577,9 +2844,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_num_regs (gdbarch, v->nregs); - set_gdbarch_sp_regnum (gdbarch, 1); - set_gdbarch_fp_regnum (gdbarch, 1); - set_gdbarch_pc_regnum (gdbarch, 64); + set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); set_gdbarch_register_name (gdbarch, rs6000_register_name); set_gdbarch_register_size (gdbarch, wordsize); set_gdbarch_register_bytes (gdbarch, off); @@ -2589,7 +2854,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_virtual_size (gdbarch, generic_register_size); set_gdbarch_max_register_virtual_size (gdbarch, 16); set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type); - set_gdbarch_do_registers_info (gdbarch, rs6000_do_registers_info); set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); @@ -2623,9 +2887,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual); set_gdbarch_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw); set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum); - - set_gdbarch_deprecated_extract_return_value (gdbarch, rs6000_extract_return_value); - /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments() is correct for the SysV ABI when the wordsize is 8, but I'm also fairly certain that ppc_sysv_abi_push_arguments() will give even @@ -2639,7 +2900,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_arguments (gdbarch, rs6000_push_arguments); set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return); - set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address); set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame); @@ -2722,8 +2982,4 @@ _initialize_rs6000_tdep (void) add_prefix_cmd ("powerpc", class_info, rs6000_info_powerpc_command, "Various POWERPC info specific commands.", &info_powerpc_cmdlist, "info powerpc ", 0, &infolist); - - add_cmd ("altivec", class_info, rs6000_altivec_registers_info, - "Display the contents of the AltiVec registers.", - &info_powerpc_cmdlist); } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 0a0086f107c..49a15a2f46a 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1774,7 +1774,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_store_struct_return (gdbarch, s390_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value); - set_gdbarch_store_return_value (gdbarch, s390_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value); /* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always. */ diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 67ebbf3fc9b..b133b035f6b 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -4199,7 +4199,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; gdbarch_register_name_ftype *sh_register_name; - gdbarch_store_return_value_ftype *sh_store_return_value; + gdbarch_deprecated_store_return_value_ftype *sh_store_return_value; gdbarch_register_virtual_type_ftype *sh_register_virtual_type; enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; @@ -4565,7 +4565,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, sh_push_return_address); - set_gdbarch_store_return_value (gdbarch, sh_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sh_store_return_value); set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_decr_pc_after_break (gdbarch, 0); diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c index 0057e60e377..82c63d89978 100644 --- a/gdb/signals/signals.c +++ b/gdb/signals/signals.c @@ -25,6 +25,7 @@ #else #include "defs.h" #include "target.h" +#include "gdb_string.h" #endif #include diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 50caed39d99..35cb5786561 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1556,6 +1556,7 @@ init_sol_thread_ops (void) sol_thread_ops.to_terminal_inferior = terminal_inferior; sol_thread_ops.to_terminal_ours_for_output = terminal_ours_for_output; sol_thread_ops.to_terminal_ours = terminal_ours; + sol_thread_ops.to_terminal_save_ours = terminal_save_ours; sol_thread_ops.to_terminal_info = child_terminal_info; sol_thread_ops.to_kill = sol_thread_kill_inferior; sol_thread_ops.to_load = 0; diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 12dbaaa5100..033cc8170bf 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -3220,7 +3220,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 32 * 4; tdep->print_insn_mach = bfd_mach_sparc; @@ -3231,7 +3231,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4); set_gdbarch_register_name (gdbarch, sparclet_register_name); - set_gdbarch_store_return_value (gdbarch, sparclet_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparclet_store_return_value); tdep->has_fpu = 0; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 0; tdep->print_insn_mach = bfd_mach_sparc_sparclet; @@ -3242,7 +3242,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 80); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4); set_gdbarch_register_name (gdbarch, sparclite_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 0; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 0; tdep->print_insn_mach = bfd_mach_sparc_sparclite; @@ -3253,7 +3253,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->print_insn_mach = bfd_mach_sparc; tdep->fp_register_bytes = 32 * 4; tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ @@ -3264,7 +3264,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 32 * 4; tdep->print_insn_mach = bfd_mach_sparc; @@ -3275,7 +3275,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 80); set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4); set_gdbarch_register_name (gdbarch, sparclite_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 0; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 0; tdep->print_insn_mach = bfd_mach_sparc_sparclite; @@ -3286,7 +3286,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 125); set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); set_gdbarch_register_name (gdbarch, sparc64_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 64 * 4; tdep->print_insn_mach = bfd_mach_sparc_v9a; @@ -3297,7 +3297,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 125); set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); set_gdbarch_register_name (gdbarch, sparc64_register_name); - set_gdbarch_store_return_value (gdbarch, sparc_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ tdep->fp_register_bytes = 64 * 4; tdep->print_insn_mach = bfd_mach_sparc_v9a; diff --git a/gdb/stack.c b/gdb/stack.c index 1a5020ec15d..30ebc09dee7 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1519,6 +1519,15 @@ select_frame (struct frame_info *fi) if (selected_frame_level_changed_hook) selected_frame_level_changed_hook (frame_relative_level (fi)); + /* FIXME: kseitz/2002-08-28: It would be nice to call + selected_frame_level_changed_event right here, but due to limitations + in the current interfaces, we would end up flooding UIs with events + because select_frame is used extensively internally. + + Once we have frame-parameterized frame (and frame-related) commands, + the event notification can be moved here, since this function will only + be called when the users selected frame is being changed. */ + /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if desired. */ if (fi) @@ -1622,7 +1631,7 @@ select_frame_command_wrapper (char *level_exp, int from_tty) static void select_frame_command (char *level_exp, int from_tty) { - register struct frame_info *frame; + struct frame_info *frame; int level = frame_relative_level (selected_frame); if (!target_has_stack) diff --git a/gdb/target.c b/gdb/target.c index ec1979b4f90..75d022ff200 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -138,6 +138,8 @@ static void debug_to_terminal_inferior (void); static void debug_to_terminal_ours_for_output (void); +static void debug_to_terminal_save_ours (void); + static void debug_to_terminal_ours (void); static void debug_to_terminal_info (char *, int); @@ -445,6 +447,9 @@ cleanup_target (struct target_ops *t) de_fault (to_terminal_ours, (void (*) (void)) target_ignore); + de_fault (to_terminal_save_ours, + (void (*) (void)) + target_ignore); de_fault (to_terminal_info, default_terminal_info); de_fault (to_kill, @@ -608,6 +613,7 @@ update_current_target (void) INHERIT (to_terminal_inferior, t); INHERIT (to_terminal_ours_for_output, t); INHERIT (to_terminal_ours, t); + INHERIT (to_terminal_save_ours, t); INHERIT (to_terminal_info, t); INHERIT (to_kill, t); INHERIT (to_load, t); @@ -1979,6 +1985,14 @@ debug_to_terminal_ours (void) fprintf_unfiltered (gdb_stdlog, "target_terminal_ours ()\n"); } +static void +debug_to_terminal_save_ours (void) +{ + debug_target.to_terminal_save_ours (); + + fprintf_unfiltered (gdb_stdlog, "target_terminal_save_ours ()\n"); +} + static void debug_to_terminal_info (char *arg, int from_tty) { @@ -2405,6 +2419,7 @@ setup_target_debug (void) current_target.to_terminal_inferior = debug_to_terminal_inferior; current_target.to_terminal_ours_for_output = debug_to_terminal_ours_for_output; current_target.to_terminal_ours = debug_to_terminal_ours; + current_target.to_terminal_save_ours = debug_to_terminal_save_ours; current_target.to_terminal_info = debug_to_terminal_info; current_target.to_kill = debug_to_kill; current_target.to_load = debug_to_load; diff --git a/gdb/target.h b/gdb/target.h index c165801bfcc..18b95b0cea9 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -264,6 +264,7 @@ struct target_ops void (*to_terminal_inferior) (void); void (*to_terminal_ours_for_output) (void); void (*to_terminal_ours) (void); + void (*to_terminal_save_ours) (void); void (*to_terminal_info) (char *, int); void (*to_kill) (void); void (*to_load) (char *, int); @@ -626,6 +627,14 @@ extern void print_section_info (struct target_ops *, bfd *); #define target_terminal_ours() \ (*current_target.to_terminal_ours) () +/* Save our terminal settings. + This is called from TUI after entering or leaving the curses + mode. Since curses modifies our terminal this call is here + to take this change into account. */ + +#define target_terminal_save_ours() \ + (*current_target.to_terminal_save_ours) () + /* Print useful information about our terminal status, if such a thing exists. */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 65650dd235e..68165669536 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -21,6 +21,43 @@ out what version of MI is running. Use this to determine the proper output of setting a breakpoint. +2002-08-29 Jim Blandy + + * gdb.threads/pthreads.exp: Move the portable thread compilation + code into a function in lib/gdb.exp, and call that from here. + * lib/gdb.exp (gdb_compile_pthreads): New function. + +2002-08-29 Keith Seitz + + * lib/mi-support.exp (mi_gdb_test): Add global declaration for + expect_out so that callers can get at it. + +2002-08-23 Daniel Jacobowitz + + * gdb.threads/print-threads.c: New file. + * gdb.threads/print-threads.exp: New file. + * gdb.threads/schedlock.c: New file. + * gdb.threads/schedlock.exp: New file. + +2002-08-22 Elena Zannoni + + * gdb.arch/altivec-abi.exp: The source C file is altivec-abi.c, + not altivec.c. + +2002-08-17 Mark Kettenis + + * gdb.base/return.exp: Remove i*86-*-* from list of xfail'ed + targets. The problem should be fixed now. + +2002-08-15 Mark Kettenis + + * gdb.java/jv-print.exp: Fix p '' and p ''' tests to deal with + 2002-07-24 change that removes final dots from error messages. + +2002-08-13 Tom Tromey + + * gdb.base/readline.exp: New file. + 2002-08-01 Andrew Cagney * lib/gdb.exp (gdb_expect_list): Only print one pass, fail, or diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp index 8a9f29dd813..2e4504a1a30 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.exp +++ b/gdb/testsuite/gdb.arch/altivec-abi.exp @@ -26,7 +26,7 @@ if $tracelevel then { } # -# This file uses altivec.c for input. +# This file uses altivec-abi.c for input. # set prms_id 0 @@ -37,7 +37,7 @@ if ![istarget "powerpc-*altivec"] then { return } -set testfile "altivec" +set testfile "altivec-abi" set binfile ${objdir}/${subdir}/${testfile} set src1 ${srcdir}/${subdir}/${testfile}.c @@ -58,16 +58,16 @@ if ![runto_main] then { gdb_suppress_tests } -gdb_test "b marker" "Breakpoint 2 at.*file.*altivec.c, line \[0-9\]+." "break marker" -gdb_test "continue" "Breakpoint 2.*marker.*altivec.c.*" "continue to marker" -gdb_test "finish" "Run till exit from .0.*in marker.*at.*altivec.c.*main \\(\\) at.*altivec.c.*result = vec_func \\(vshort,.*goes in v2.*" "back to main (1)" +gdb_test "b marker" "Breakpoint 2 at.*file.*altivec-abi.c, line \[0-9\]+." "break marker" +gdb_test "continue" "Breakpoint 2.*marker.*altivec-abi.c.*" "continue to marker" +gdb_test "finish" "Run till exit from .0.*in marker.*at.*altivec-abi.c.*main \\(\\) at.*altivec-abi.c.*result = vec_func \\(vshort,.*goes in v2.*" "back to main (1)" # now all the arguments of vec_fun are initialized set pattern "vec_func .vshort_f=.111, 222, 333, 444, 555, 666, 777, 888., vushort_f=.100, 200, 300, 400, 500, 600, 700, 800., vint_f=.-10, -20, -30, -40., vuint_f=.1111, 2222, 3333, 4444., vchar_f=.abcdefghilmnopqr., vuchar_f=.ABCDEFGHILMNOPQR., vfloat_f=.1.25, 3.75, 5.5, 1.25., x_f=.1, 2, 3, 4, 5, 6, 7, 8., y_f=.12, 22, 32, 42., a_f=.vector of chars.., b_f=.5.5, 4.5, 3.75, 2.25., c_f=.1.25, 3.5, 5.5, 7.75., intv_on_stack_f=.12, 34, 56, 78.." set pattern1 $pattern -append pattern1 " at.*altivec.c.*vint_res = vec_add.*vint_f, intv_on_stack_f.;" +append pattern1 " at.*altivec-abi.c.*vint_res = vec_add.*vint_f, intv_on_stack_f.;" # Now let's call the function. This function has > 12 args, # the last one will go on the stack. @@ -85,7 +85,7 @@ gdb_test "step" \ "step into vec_fun" set pattern2 $pattern -append pattern2 " at.*altivec.c.*in main.*result = vec_func .vshort,.*goes in v2.*Value returned is.*= .2, 2, 2, 2." +append pattern2 " at.*altivec-abi.c.*in main.*result = vec_func .vshort,.*goes in v2.*Value returned is.*= .2, 2, 2, 2." # Let's see if the result is returned correctly. gdb_test "finish" \ @@ -95,14 +95,14 @@ gdb_test "finish" \ # can we print the args correctly for this function? gdb_test "break struct_of_vector_func" "" "" -set pattern "struct_of_vector_func .vector_struct=.vshort1 = .1, 2, 3, 4, 5, 6, 7, 8., vshort2 = .11, 12, 13, 14, 15, 16, 17, 18., vshort3 = .21, 22, 23, 24, 25, 26, 27, 28., vshort4 = .31, 32, 33, 34, 35, 36, 37, 38... at.*altivec.c.*" +set pattern "struct_of_vector_func .vector_struct=.vshort1 = .1, 2, 3, 4, 5, 6, 7, 8., vshort2 = .11, 12, 13, 14, 15, 16, 17, 18., vshort3 = .21, 22, 23, 24, 25, 26, 27, 28., vshort4 = .31, 32, 33, 34, 35, 36, 37, 38... at.*altivec-abi.c.*" gdb_test "continue" \ "Breakpoint 3, $pattern.*vector_struct.vshort1 = vec_add .vector_struct.vshort1, vector_struct.vshort2.;" \ "continue to struct_of_vector_func" gdb_test "finish" \ - "Run till exit from .0 $pattern\[ \r\n\]+main.*altivec.c.*array_of_vector_func.*" \ + "Run till exit from .0 $pattern\[ \r\n\]+main.*altivec-abi.c.*array_of_vector_func.*" \ "back to main (2)" gdb_test "step" "" "step into array_of_vector_func" diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index dfaf965ca99..3db28b187b6 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -440,7 +440,120 @@ proc deprecated_command_test {} { "deprecate with no arguments" } +proc bp_deleted_in_command_test {} { + global gdb_prompt + + gdb_test "set args 1" "" "set args in bp_deleted_in_command_test" + delete_breakpoints + + # Create a breakpoint, and associate a command-list to it, with + # one command that deletes this breakpoint. + gdb_test "break factorial" \ + "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ + "breakpoint in bp_deleted_in_command_test" + + send_gdb "commands\n" + gdb_expect { + -re "Type commands for when breakpoint .* is hit, one per line.*>" { + pass "begin commands in bp_deleted_in_command_test" + } + -re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_test"} + timeout {fail "(timeout) begin commands bp_deleted_in_command_test"} + } + send_gdb "silent\n" + gdb_expect { + -re ">" {pass "add silent command"} + -re "$gdb_prompt $" {fail "add silent command"} + timeout {fail "(timeout) add silent command"} + } + send_gdb "clear factorial\n" + gdb_expect { + -re ">" {pass "add clear command"} + -re "$gdb_prompt $" {fail "add clear command"} + timeout {fail "(timeout) add clear command"} } + send_gdb "printf \"factorial command-list executed\\n\"\n" + gdb_expect { + -re ">" {pass "add printf command"} + -re "$gdb_prompt $" {fail "add printf command"} + timeout {fail "(timeout) add printf command"} + } + send_gdb "cont\n" + gdb_expect { + -re ">" {pass "add cont command"} + -re "$gdb_prompt $" {fail "add cont command"} + timeout {fail "(timeout) add cont command"} } + send_gdb "end\n" + gdb_expect { + -re "$gdb_prompt $" {pass "end commands"} + timeout {fail "(timeout) end commands"} + } + gdb_run_cmd + gdb_expect { + -re ".*factorial command-list executed.*1.*Program exited normally.*$gdb_prompt $" { + pass "run factorial until breakpoint" + } + -re ".*$gdb_prompt $" { + fail "run factorial until breakpoint" + } + default { fail "(timeout) run factorial until breakpoint" } + timeout { fail "(timeout) run factorial until breakpoint" } + } +} + +proc temporary_breakpoint_commands {} { + global gdb_prompt + + gdb_test "set args 1" "" "set args in temporary_breakpoint_commands" + delete_breakpoints + + # Create a temporary breakpoint, and associate a commands list to it. + # This test will verify that this commands list is executed when the + # breakpoint is hit. + gdb_test "tbreak factorial" \ + "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ + "breakpoint in temporary_breakpoint_commands" + + send_gdb "commands\n" + gdb_expect { + -re "Type commands for when breakpoint .* is hit, one per line.*>" { + pass "begin commands in bp_deleted_in_command_test" + } + -re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_test"} + timeout {fail "(timeout) begin commands bp_deleted_in_command_test"} + } + send_gdb "silent\n" + gdb_expect { + -re ">" {pass "add silent tbreak command"} + -re "$gdb_prompt $" {fail "add silent tbreak command"} + timeout {fail "(timeout) add silent tbreak command"} + } + send_gdb "printf \"factorial tbreak commands executed\\n\"\n" + gdb_expect { + -re ">" {pass "add printf tbreak command"} + -re "$gdb_prompt $" {fail "add printf tbreak command"} + timeout {fail "(timeout) add printf tbreak command"} + } + send_gdb "cont\n" + gdb_expect { + -re ">" {pass "add cont tbreak command"} + -re "$gdb_prompt $" {fail "add cont tbreak command"} + timeout {fail "(timeout) add cont tbreak command"} } + send_gdb "end\n" + gdb_expect { + -re "$gdb_prompt $" {pass "end tbreak commands"} + timeout {fail "(timeout) end tbreak commands"} + } + + gdb_run_cmd + gdb_expect { + -re ".*factorial tbreak commands executed.*1.*Program exited normally.*" { + pass "run factorial until temporary breakpoint" + } + timeout { fail "(timeout) run factorial until temporary breakpoint" } + } +} + gdbvar_simple_if_test gdbvar_simple_while_test gdbvar_complex_if_while_test @@ -454,3 +567,5 @@ user_defined_command_test watchpoint_command_test test_command_prompt_position deprecated_command_test +bp_deleted_in_command_test +temporary_breakpoint_commands diff --git a/gdb/testsuite/gdb.base/return.exp b/gdb/testsuite/gdb.base/return.exp index e7a536bdac6..2f8946d3020 100644 --- a/gdb/testsuite/gdb.base/return.exp +++ b/gdb/testsuite/gdb.base/return.exp @@ -91,19 +91,6 @@ proc return_tests { } { setup_xfail "m6811-*-*" gdb_test "next" "printf.*" "next over call to func3" - # This test is going to fail on all i*86 systems using an i*87. - # When returning a floating point value from a function, all known - # compilers do this via a `fldl' instruction, which pushes the floating - # value on the i387 stack. This causes two problems: - # a) Most i*86 targets do not store (or cannot store, see comment in - # in i386v-nat.c:i386_register_u_addr) the floating point registers - # to the target. - # b) gdb would have to figure out if the `fldl' instruction (or variants - # of it) has already been executed. If not, it would have to simulate - # a push instruction, as it is not enough to write the register, - # the floating point `stack pointer' has to be updated too. - # Do not expect this to get fixed anytime soon. - # This test also fails for sparc Solaris 2.3 & 2.4, but passes under 2.5 # At the time the `next' is issued, the floating point unit for the # process is not yet initialized, and the storing of the floating @@ -113,8 +100,8 @@ proc return_tests { } { # process start, making this test pass, it will be for a version that # is not xfailed. - setup_xfail "i*86-*-*" "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*" - gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with i*86 and sparc solaris" + setup_xfail "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*" + gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with sparc solaris)" } diff --git a/gdb/testsuite/gdb.java/jv-print.exp b/gdb/testsuite/gdb.java/jv-print.exp index fb5dad73a28..00da1f33ad4 100644 --- a/gdb/testsuite/gdb.java/jv-print.exp +++ b/gdb/testsuite/gdb.java/jv-print.exp @@ -89,8 +89,8 @@ proc test_integer_literals_rejected {} { global gdb_prompt test_print_reject "p 0x" - gdb_test "p ''" "Empty character constant\\." - gdb_test "p '''" "Empty character constant\\." + gdb_test "p ''" "Empty character constant" + gdb_test "p '''" "Empty character constant" test_print_reject "p '\\'" # Note that this turns into "p '\\\'" at gdb's input. diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index 0703395d78b..dc9b7a838f0 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -39,42 +39,16 @@ set binfile ${objdir}/${subdir}/${testfile} # carriage return) set horiz "\[^\n\r\]*" -set built_binfile 0 if [istarget "*-*-linux"] then { set target_cflags "-D_MIT_POSIX_THREADS" } else { set target_cflags "" } -set why_msg "unrecognized error" -foreach lib {-lpthreads -lpthread -lthread} { - set options "debug" - lappend options "incdir=${objdir}/${subdir}" - lappend options "libs=$lib" - set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] - switch -regexp -- $ccout { - ".*no posix threads support.*" { - set why_msg "missing threads include file" - break - } - ".*cannot open -lpthread.*" { - set why_msg "missing runtime threads library" - } - ".*Can't find library for -lpthread.*" { - set why_msg "missing runtime threads library" - } - {^$} { - pass "successfully compiled posix threads test case" - set built_binfile 1 - break - } - } -} -if {$built_binfile == "0"} { - unsupported "Couldn't compile ${srcfile}, ${why_msg}" - return -1 + +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}/${subdir}"]] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -# Now we can proceed with the real testing. # Start with a fresh gdb. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b4a0b8a0bd0..8949910b9ec 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1171,6 +1171,42 @@ proc gdb_compile {source dest type options} { return $result; } + +# This is just like gdb_compile, above, except that it tries compiling +# against several different thread libraries, to see which one this +# system has. +proc gdb_compile_pthreads {source dest type options} { + set build_binfile 0 + set why_msg "unrecognized error" + foreach lib {-lpthreads -lpthread -lthread} { + # This kind of wipes out whatever libs the caller may have + # set. Or maybe theirs will override ours. How infelicitous. + set options_with_lib [concat $options [list libs=$lib]] + set ccout [gdb_compile $source $dest $type $options_with_lib] + switch -regexp -- $ccout { + ".*no posix threads support.*" { + set why_msg "missing threads include file" + break + } + ".*cannot open -lpthread.*" { + set why_msg "missing runtime threads library" + } + ".*Can't find library for -lpthread.*" { + set why_msg "missing runtime threads library" + } + {^$} { + pass "successfully compiled posix threads test case" + set built_binfile 1 + break + } + } + } + if {$built_binfile == "0"} { + unsupported "Couldn't compile $source: ${why_msg}" + return -1 + } +} + proc send_gdb { string } { global suppress_flag; if { $suppress_flag } { diff --git a/gdb/top.c b/gdb/top.c index 48b3384d0b7..4d3b7719cb0 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1083,6 +1083,8 @@ gdb_rl_operate_and_get_next_completion (void) static int gdb_rl_operate_and_get_next (int count, int key) { + int where; + if (event_loop_p) { /* Use the async hook. */ @@ -1095,8 +1097,20 @@ gdb_rl_operate_and_get_next (int count, int key) rl_pre_input_hook = (Function *) gdb_rl_operate_and_get_next_completion; } - /* Add 1 because we eventually want the next line. */ - operate_saved_history = where_history () + 1; + /* Find the current line, and find the next line to use. */ + where = where_history(); + + /* FIXME: kettenis/20020817: max_input_history is renamed into + history_max_entries in readline-4.2. When we do a new readline + import, we should probably change it here too, even though + readline maintains backwards compatibility for now by still + defining max_input_history. */ + if ((history_is_stifled () && (history_length >= max_input_history)) || + (where >= history_length - 1)) + operate_saved_history = where; + else + operate_saved_history = where + 1; + return rl_newline (1, key); } diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index d278c6a73a7..0e19a122e12 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,233 @@ +2002-08-29 Stephane Carrez + + * tui.c (tuiGetLowDisassemblyAddress): Moved from here. + * tuiDisassem.c (tuiGetLowDisassemblyAddress): To here, and use + tui_find_disassembly_address to find the starting address of + disassemble window. + +2002-08-28 Stephane Carrez + + * tuiDisassem.c (tui_disassemble): New function to disassemble + several lines in a buffer. + (tui_find_disassembly_address): New function to search backward + or forward a disassembly line. + (tuiSetDisassemContent): Use tui_disassemble to obtain the real + content and format it in the window. + (tuiShowDisassemAndUpdateSource): Remove unused locals. + (tuiVerticalDisassemScroll): Use tui_find_disassembly_address to + obtain the address to disassemble for the scrolling. + * tuiDisassem.h (tuiGetBeginAsmAddress): Update. + * tuiSourceWin.c (tuiUpdateSourceWindowAsIs): Don't pass symtab. + +2002-08-28 Stephane Carrez + + * tuiIO.c (CTRL_CHAR): Redefine and use readline 4.3 definition. + +2002-08-26 Stephane Carrez + + Fix PR gdb/393: + * tui.c (tui_disable): Update gdb's knowledge of its terminal + using target_terminal_save_ours. + (tui_enable): Likewise. + +2002-08-25 Stephane Carrez + + * tui.c (tui_rl_switch_mode): Renames tui_switch_mode. + (tui_rl_change_windows): Renames tui_change_windows. + (tui_rl_delete_other_windows): Renames tui_delete_other_windows. + (tui_initialize_readline): Update. + +2002-08-25 Stephane Carrez + + * tuiDisassem.c (tuiSetDisassemContent): Use breakpoint_here_p. + (_hasBreak): Remove. + +2002-08-25 Stephane Carrez + + * tuiDisassem.c (tuiGetBeginAsmAddress): Use lookup_minimal_symbol + to find symbol address. + +2002-08-25 Stephane Carrez + + * tuiSourceWin.c (tui_display_main): Rename from tuiDisplayMainFunction + and use tuiGetBeginAsmAddress. + * tuiSourceWin.h (tui_display_main): Declare. + * tui.h (tuiDisplayMainFunction): Remove. + * tui-hooks.c (tui_new_objfile_hook): Update. + +2002-08-25 Stephane Carrez + + * tuiSource.h (m_tuiShowSourceAsIs): Remove macro. + (tuiShowSourceAsIs): Don't declare. + +2002-08-25 Stephane Carrez + + * tui-hooks.c (tui_selected_frame_level_changed_hook): Always update + the frame position. + +2002-08-25 Stephane Carrez + + * tuiStack.c (tuiSetLocatorContent): Remove. + (tuiUpdateLocatorInfoFromFrame): Remove. + (tui_set_locator_info): Allocate the content buffer if necessary. + (tui_set_locator_filename): Call tui_set_locator_info directly. + (tuiShowFrameInfo): Likewise and use find_pc_line instead of + find_pc_symtab. + +2002-08-25 Stephane Carrez + + * tuiSourceWin.c (tuiDisplayMainFunction): Update to use + tuiUpdateLocatorFilename. + * tuiStack.c (tuiSetLocatorInfo): Make it static. + (tuiSetLocatorContent): Likewise. + (tuiUpdateLocatorInfoFromFrame): Likewise. + (tuiSwitchFilename): Remove. + (tui_set_locator_filename): New function + (tui_set_locator_info): Rename from tuiSetLocatorInfo to GNU-ify; + use tui_set_locator_filename to record the filename. + (tuiUpdateLocatorFilename): Likewise. + (tuiUpdateLocatorInfoFromFrame): Update. + (tuiSetLocatorContent): Likewise. + * tuiStack.h (tuiClearLocatorContent): Don't declare. + (tuiSetLocatorInfo, tuiSetLocatorContent): Likewise. + (tuiUpdateLocatorInfoFromFrame, tuiSwitchFilename): Likewise. + +2002-08-25 Stephane Carrez + + * tuiSourceWin.c (tuiSetHasBreakAt): Use filename for breakpoint + comparison; cleanup. + * tuiSource.c (tuiSetSourceContent): Set window title and filename. + * tuiGeneralWin.c (boxWin): Print optional title on top of window. + * tuiData.h (TuiSourceInfo): Add filename member. + (TuiGenWinInfo): Add title member. + * tuiData.c (initGenericPart): Clear title. + (freeWindow): Free title and filename; remove unused locals. + (initWinInfo): Clear filename. + (tuiDelWindow): Free it; remove unused locals. + +2002-08-25 Stephane Carrez + + * tuiStack.h (tuiGetLocatorFilename): Don't declare. + (tuiUpdateLocatorDisplay): Likewise. + * tuiStack.c (tuiGetLocatorFilename): Remove. + (tuiShowFrameInfo): Use tuiSetLocatorContent and tuiShowLocatorContent + instead of tuiUpdateLocatorDisplay. + (tuiUpdateLocatorDisplay): Remove. + +2002-08-25 Stephane Carrez + + * tuiStack.h (tuiClearLocatorDisplay): Don't declare. + * tuiStack.c (tuiClearLocatorDisplay): Remove. + (tuiShowLocatorContent): Use wclrtoeol to clear end of status line. + (tuiUpdateLocatorDisplay): Don't call tuiClearLocatorDisplay. + +2002-08-25 Stephane Carrez + + * tuiStack.c (tui_get_function_from_frame): Rename from + _getFuncNameFromFrame; use print_address_symbolic to get symbolic + name of address. + (tuiUpdateLocatorInfoFromFrame): Update. + +2002-08-25 Stephane Carrez + + * tuiRegs.c (tuiDisplayRegistersFrom): Remove unused locals. + (_tuiRegisterFormat, _tuiSetSpecialRegsContent): Likewise. + (_tuiSetGeneralAndSpecialRegsContent): Likewise. + (_tuiSetFloatRegsContent): Likewise. + (_tuiRegisterName): Return a const char*. + * tuiData.h (_TuiDataElement): Use const char* for name. + +2002-08-25 Stephane Carrez + + * tuiSourceWin.h (tuiEraseAllSourceContent): Don't declare. + (tuiShowAllExecInfosContent): Likewise. + * tuiSourceWin.c (tuiEraseAllSourceContent): Remove. + (tuiShowAllExecInfosContent): Remove. + (tuiAllocSourceBuffer): Remove unused locals. + +2002-08-25 Stephane Carrez + + * tuiStack.c (tui_update_command): Rename _tuiUpdateLocation_command + to follow other gdb's command names; use execute_command; cleanup. + (_initialize_tuiStack): Update. + +2002-08-25 Stephane Carrez + + * tuiWin.h (tui_update_gdb_sizes): Declare. + +2002-08-24 Stephane Carrez + + * tui.c (strcat_to_buf): Use const char* for source item. + (tui_enable): Update the windows if there is a selected frame. + * tui.h (strcat_to_buf): Update prototype. + (strcat_to_buf_with_fmt): Remove. + +2002-08-24 Stephane Carrez + + * tuiWin.c (tui_update_gdb_sizes): New function to tell gdb what + is the size of command window. + (tuiResizeAll): Call it instead of init_page_info. + * tui.c (tui_enable): Call it to resize to TUI command window. + (tui_disable): Likewise for plain screen. + +2002-08-24 Stephane Carrez + + * tui.c (tui_enable): Use tuiSetLayout instead of showLayout and + use tuiShowFrameInfo instead of tuiSetLocatorContent. + * tuiLayout.h (showLayout): Remove. + * tuiLayout.c (_showSourceOrDisassemAndCommand): Remove unused locals. + (_showSourceDisassemCommand): Likewise. + (showLayout): Make it static. + (lastLayout): Remove. + +2002-08-24 Stephane Carrez + + * tuiSourceWin.c (tui_show_source_line): New function. + (tuiShowSourceContent): Call it and avoid clearing the window before + redrawing it. + (tuiClearAllSourceWinsContent): Remove. + * tuiSourceWin.h (tuiClearAllSourceWinsContent): Don't declare. + * tuiWin.h (tuiClearWinFocus, tuiClearWinFocusFrom): Don't declare. + * tuiWin.c (tuiClearWinFocus, tuiClearWinFocusFrom): Remove. + (tuiRefreshAll): Don't clear the window. + (_makeVisibleWithNewHeight): Don't clear locator line. + (tuiResizeAll): Remove unused locals. + (_tuiAdjustWinHeights): Likewise. + (_makeInvisibleAndSetNewHeight): Likewise. + (_newHeightOk): Likewise. + * tuiLayout.c (showLayout): Don't clear source windows. + (tuiSetLayout): Don't clear the window. + (_initAndMakeWin): Likewise for status line. + * tuiGeneralWin.c (makeVisible): Don't clear or refresh the window. + (makeWindow): Likewise. + (tuiClearWin): Remove. + * tuiGeneralWin.h (tuiClearWin): Don't declare. + +2002-08-24 Stephane Carrez + + * tuiSourceWin.c (tuiSrcWinIsDisplayed): Remove. + (tuiAsmWinIsDisplayed): Remove. + (tuiShowAllSourceWinsContent): Remove. + (tuiUpdateOnEnd): Remove. + * tuiGeneralWin.c (scrollWinForward): Remove. + (scrollWinBackward): Remove. + (_winResize): Don't declare. + * tui.h (tuiUpdateOnEnd): Don't declare. + (vcatch_errors, va_catch_errors): Likewise. + * tuiSourceWin.h (tuiUpdateOnEnd): Likewise. + (tuiShowAllSourceWinsContent): Likewise. + * tuiGeneralWin.h (scrollWinForward): Likewise. + (scrollWinBackward): Likewise. + +2002-08-24 Stephane Carrez + + * tuiRegs.c (_tuiRegisterFormat): Use gdbarch_print_registers_info. + +2002-08-18 Daniel Jacobowitz + + Fix PR gdb/655 + * tui.c: Disable include. + 2002-03-15 Andrew Cagney * tui-out.c (XMALLOC): Delete macro. Update copyright. diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 27556acfd15..d6051942a23 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -71,9 +71,7 @@ static void tui_new_objfile_hook (struct objfile* objfile) { if (tui_active) - { - tuiDisplayMainFunction (); - } + tui_display_main (); if (tui_target_new_objfile_chain) tui_target_new_objfile_chain (objfile); @@ -309,10 +307,10 @@ tui_selected_frame_level_changed_hook (int level) would be 0 here, and select_source_symtab would abort the command by calling the 'error' function */ if (s) - { - select_source_symtab (s); - tuiShowFrameInfo (fi); - } + select_source_symtab (s); + + /* Display the frame position (even if there is no symbols). */ + tuiShowFrameInfo (fi); /* Refresh the register window if it's visible. */ if (tui_is_window_visible (DATA_WIN)) diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 7912efc8765..ab2c201fba6 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -48,7 +48,9 @@ #endif #include #include +#if 0 #include +#endif #include #include "defs.h" #include "gdbcmd.h" @@ -72,7 +74,7 @@ static int tui_finish_init = 1; /* Switch the output mode between TUI/standard gdb. */ static int -tui_switch_mode (void) +tui_rl_switch_mode (void) { if (tui_active) { @@ -105,15 +107,16 @@ tui_switch_mode (void) return 0; } -/* Change the TUI layout to show a next layout. +/* TUI readline command. + Change the TUI layout to show a next layout. This function is bound to CTRL-X 2. It is intended to provide a functionality close to the Emacs split-window command. We always show two windows (src+asm), (src+regs) or (asm+regs). */ static int -tui_change_windows (void) +tui_rl_change_windows (void) { if (!tui_active) - tui_switch_mode (); + tui_rl_switch_mode (); if (tui_active) { @@ -155,13 +158,13 @@ tui_change_windows (void) return 0; } - -/* Delete the second TUI window to only show one. */ +/* TUI readline command. + Delete the second TUI window to only show one. */ static int -tui_delete_other_windows (void) +tui_rl_delete_other_windows (void) { if (!tui_active) - tui_switch_mode (); + tui_rl_switch_mode (); if (tui_active) { @@ -197,12 +200,12 @@ tui_initialize_readline () { rl_initialize (); - rl_add_defun ("tui-switch-mode", tui_switch_mode, -1); - rl_bind_key_in_map ('a', tui_switch_mode, emacs_ctlx_keymap); - rl_bind_key_in_map ('A', tui_switch_mode, emacs_ctlx_keymap); - rl_bind_key_in_map (CTRL ('A'), tui_switch_mode, emacs_ctlx_keymap); - rl_bind_key_in_map ('1', tui_delete_other_windows, emacs_ctlx_keymap); - rl_bind_key_in_map ('2', tui_change_windows, emacs_ctlx_keymap); + rl_add_defun ("tui-switch-mode", tui_rl_switch_mode, -1); + rl_bind_key_in_map ('a', tui_rl_switch_mode, emacs_ctlx_keymap); + rl_bind_key_in_map ('A', tui_rl_switch_mode, emacs_ctlx_keymap); + rl_bind_key_in_map (CTRL ('A'), tui_rl_switch_mode, emacs_ctlx_keymap); + rl_bind_key_in_map ('1', tui_rl_delete_other_windows, emacs_ctlx_keymap); + rl_bind_key_in_map ('2', tui_rl_change_windows, emacs_ctlx_keymap); } /* Enter in the tui mode (curses). @@ -235,8 +238,8 @@ tui_enable (void) setTermWidthTo (COLS); def_prog_mode (); - tuiSetLocatorContent (0); - showLayout (SRC_COMMAND); + tuiShowFrameInfo (0); + tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS); tuiSetWinFocusTo (srcWin); keypad (cmdWin->generic.handle, TRUE); wrefresh (cmdWin->generic.handle); @@ -259,7 +262,14 @@ tui_enable (void) tui_version = 1; tui_active = 1; + if (selected_frame) + tuiShowFrameInfo (selected_frame); + refresh (); + + /* Update gdb's knowledge of its terminal. */ + target_terminal_save_ours (); + tui_update_gdb_sizes (); } /* Leave the tui mode. @@ -282,8 +292,12 @@ tui_disable (void) so that terminal management with the inferior works. */ tui_setup_io (0); + /* Update gdb's knowledge of its terminal. */ + target_terminal_save_ours (); + tui_version = 0; tui_active = 0; + tui_update_gdb_sizes (); } /* Wrapper on top of free() to ensure that input address @@ -297,33 +311,8 @@ tuiFree (char *ptr) } } -/* Determine what the low address will be to display in the TUI's - disassembly window. This may or may not be the same as the - low address input. */ -CORE_ADDR -tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc) -{ - int line; - CORE_ADDR newLow; - - /* Determine where to start the disassembly so that the pc is about in the - middle of the viewport. */ - for (line = 0, newLow = pc; - (newLow > low && - line < (tuiDefaultWinViewportHeight (DISASSEM_WIN, - DISASSEM_COMMAND) / 2));) - { - bfd_byte buffer[4]; - - newLow -= sizeof (bfd_getb32 (buffer)); - line++; - } - - return newLow; -} - void -strcat_to_buf (char *buf, int buflen, char *itemToAdd) +strcat_to_buf (char *buf, int buflen, const char *itemToAdd) { if (itemToAdd != (char *) NULL && buf != (char *) NULL) { diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h index fcea91afe66..9cc538d1568 100644 --- a/gdb/tui/tui.h +++ b/gdb/tui/tui.h @@ -48,11 +48,7 @@ Opaque (*OpaqueFuncPtr) (va_list); */ typedef OpaqueFuncPtr TuiOpaqueFuncPtr; -extern Opaque vcatch_errors (OpaqueFuncPtr, ...); -extern Opaque va_catch_errors (OpaqueFuncPtr, va_list); - -extern void strcat_to_buf (char *, int, char *); -extern void strcat_to_buf_with_fmt (char *, int, char *, ...); +extern void strcat_to_buf (char *, int, const char *); /* Types of error returns */ typedef enum @@ -129,9 +125,7 @@ extern void tui_vStartNewLines (va_list); extern TuiStatus tui_set_layout (const char *); /* tuiSourceWin.c */ -extern void tuiDisplayMainFunction (void); extern void tuiUpdateAllExecInfos (void); -extern void tuiUpdateOnEnd (void); extern void tui_vAllSetHasBreakAt (va_list); extern void tui_vUpdateSourceWindowsWithAddr (va_list); diff --git a/gdb/tui/tuiData.c b/gdb/tui/tuiData.c index 30efba8b11c..45508e061b8 100644 --- a/gdb/tui/tuiData.c +++ b/gdb/tui/tuiData.c @@ -843,9 +843,8 @@ initGenericPart (TuiGenWinInfoPtr win) win->content = (OpaquePtr) NULL; win->contentInUse = win->isVisible = FALSE; - - return; -} /* initGenericPart */ + win->title = 0; +} /* @@ -914,6 +913,7 @@ initWinInfo (TuiWinInfoPtr winInfo) winInfo->detail.sourceInfo.hasLocator = FALSE; winInfo->detail.sourceInfo.horizontalOffset = 0; winInfo->detail.sourceInfo.startLineOrAddr.addr = 0; + winInfo->detail.sourceInfo.filename = 0; break; case DATA_WIN: winInfo->detail.dataDisplayInfo.dataContent = (TuiWinContent) NULL; @@ -1040,19 +1040,13 @@ addContentElements (TuiGenWinInfoPtr winInfo, int numElements) } /* addContentElements */ -/* - ** tuiDelWindow(). - ** Delete all curses windows associated with winInfo, leaving everything - ** else in tact. - */ +/* Delete all curses windows associated with winInfo, leaving everything + else intact. */ void tuiDelWindow (TuiWinInfoPtr winInfo) { - Opaque detail; - int i; TuiGenWinInfoPtr genericWin; - switch (winInfo->generic.type) { case SRC_WIN: @@ -1064,6 +1058,11 @@ tuiDelWindow (TuiWinInfoPtr winInfo) genericWin->handle = (WINDOW *) NULL; genericWin->isVisible = FALSE; } + if (winInfo->detail.sourceInfo.filename) + { + xfree (winInfo->detail.sourceInfo.filename); + winInfo->detail.sourceInfo.filename = 0; + } genericWin = winInfo->detail.sourceInfo.executionInfo; if (genericWin != (TuiGenWinInfoPtr) NULL) { @@ -1075,14 +1074,10 @@ tuiDelWindow (TuiWinInfoPtr winInfo) case DATA_WIN: if (winInfo->generic.content != (OpaquePtr) NULL) { - int i; - - tuiDelDataWindows ( - winInfo->detail.dataDisplayInfo.regsContent, - winInfo->detail.dataDisplayInfo.regsContentCount); - tuiDelDataWindows ( - winInfo->detail.dataDisplayInfo.dataContent, - winInfo->detail.dataDisplayInfo.dataContentCount); + tuiDelDataWindows (winInfo->detail.dataDisplayInfo.regsContent, + winInfo->detail.dataDisplayInfo.regsContentCount); + tuiDelDataWindows (winInfo->detail.dataDisplayInfo.dataContent, + winInfo->detail.dataDisplayInfo.dataContentCount); } break; default: @@ -1094,9 +1089,7 @@ tuiDelWindow (TuiWinInfoPtr winInfo) winInfo->generic.handle = (WINDOW *) NULL; winInfo->generic.isVisible = FALSE; } - - return; -} /* tuiDelWindow */ +} /* @@ -1105,11 +1098,8 @@ tuiDelWindow (TuiWinInfoPtr winInfo) void freeWindow (TuiWinInfoPtr winInfo) { - Opaque detail; - int i; TuiGenWinInfoPtr genericWin; - switch (winInfo->generic.type) { case SRC_WIN: @@ -1121,6 +1111,11 @@ freeWindow (TuiWinInfoPtr winInfo) genericWin->handle = (WINDOW *) NULL; } freeWinContent (genericWin); + if (winInfo->detail.sourceInfo.filename) + { + xfree (winInfo->detail.sourceInfo.filename); + winInfo->detail.sourceInfo.filename = 0; + } genericWin = winInfo->detail.sourceInfo.executionInfo; if (genericWin != (TuiGenWinInfoPtr) NULL) { @@ -1161,10 +1156,10 @@ freeWindow (TuiWinInfoPtr winInfo) winInfo->generic.handle = (WINDOW *) NULL; freeWinContent (&winInfo->generic); } + if (winInfo->generic.title) + xfree (winInfo->generic.title); xfree (winInfo); - - return; -} /* freeWindow */ +} /* diff --git a/gdb/tui/tuiData.h b/gdb/tui/tuiData.h index 9edf00046ea..36d7853f736 100644 --- a/gdb/tui/tuiData.h +++ b/gdb/tui/tuiData.h @@ -1,5 +1,5 @@ /* TUI data manipulation routines. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -42,6 +42,7 @@ int viewportHeight; /* viewport height */ int lastVisibleLine; /* index of last visible line */ int isVisible; /* whether the window is visible or not */ + char* title; /* Window title to display. */ } TuiGenWinInfo, *TuiGenWinInfoPtr; @@ -170,7 +171,7 @@ TuiSourceElement, *TuiSourceElementPtr; /* Elements in the data display window content */ typedef struct _TuiDataElement { - char *name; + const char *name; int itemNo; /* the register number, or data display number */ TuiDataType type; Opaque value; @@ -244,6 +245,7 @@ typedef struct _TuiSourceInfo TuiGenWinInfoPtr executionInfo; /* execution information window */ int horizontalOffset; /* used for horizontal scroll */ TuiLineOrAddress startLineOrAddr; + char* filename; } TuiSourceInfo, *TuiSourceInfoPtr; diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index 8e59e68d693..50a6d0ef9f7 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -53,109 +53,240 @@ #include "tuiStack.h" #include "tui-file.h" +struct tui_asm_line +{ + CORE_ADDR addr; + char* addr_string; + char* insn; +}; + +/* Function to set the disassembly window's content. + Disassemble count lines starting at pc. + Return address of the count'th instruction after pc. */ +static CORE_ADDR +tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count) +{ + struct ui_file *gdb_dis_out; + disassemble_info asm_info; -/***************************************** -** STATIC LOCAL FUNCTIONS FORWARD DECLS ** -******************************************/ + /* now init the ui_file structure */ + gdb_dis_out = tui_sfileopen (256); -static struct breakpoint *_hasBreak (CORE_ADDR); + memcpy (&asm_info, TARGET_PRINT_INSN_INFO, sizeof (asm_info)); + asm_info.stream = gdb_dis_out; + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + asm_info.endian = BFD_ENDIAN_BIG; + else + asm_info.endian = BFD_ENDIAN_LITTLE; -/***************************************** -** PUBLIC FUNCTIONS ** -******************************************/ + if (TARGET_ARCHITECTURE != NULL) + asm_info.mach = TARGET_ARCHITECTURE->mach; -/* - ** tuiSetDisassemContent(). - ** Function to set the disassembly window's content. - */ + /* Now construct each line */ + for (; count > 0; count--, lines++) + { + if (lines->addr_string) + xfree (lines->addr_string); + if (lines->insn) + xfree (lines->insn); + + print_address (pc, gdb_dis_out); + lines->addr = pc; + lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out)); + + ui_file_rewind (gdb_dis_out); + + pc = pc + TARGET_PRINT_INSN (pc, &asm_info); + + lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out)); + + /* reset the buffer to empty */ + ui_file_rewind (gdb_dis_out); + } + ui_file_delete (gdb_dis_out); + return pc; +} + +/* Find the disassembly address that corresponds to FROM lines + above or below the PC. Variable sized instructions are taken + into account by the algorithm. */ +static CORE_ADDR +tui_find_disassembly_address (CORE_ADDR pc, int from) +{ + register CORE_ADDR newLow; + int maxLines; + int i; + struct tui_asm_line* lines; + + maxLines = (from > 0) ? from : - from; + if (maxLines <= 1) + return pc; + + lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line) + * maxLines); + memset (lines, 0, sizeof (struct tui_asm_line) * maxLines); + + newLow = pc; + if (from > 0) + { + tui_disassemble (lines, pc, maxLines); + newLow = lines[maxLines - 1].addr; + } + else + { + CORE_ADDR last_addr; + int pos; + struct minimal_symbol* msymbol; + + /* Find backward an address which is a symbol + and for which disassembling from that address will fill + completely the window. */ + pos = maxLines - 1; + do { + newLow -= 1 * maxLines; + msymbol = lookup_minimal_symbol_by_pc_section (newLow, 0); + + if (msymbol) + newLow = SYMBOL_VALUE_ADDRESS (msymbol); + else + newLow += 1 * maxLines; + + tui_disassemble (lines, newLow, maxLines); + last_addr = lines[pos].addr; + } while (last_addr > pc && msymbol); + + /* Scan forward disassembling one instruction at a time + until the last visible instruction of the window + matches the pc. We keep the disassembled instructions + in the 'lines' window and shift it downward (increasing + its addresses). */ + if (last_addr < pc) + do + { + CORE_ADDR next_addr; + + pos++; + if (pos >= maxLines) + pos = 0; + + next_addr = tui_disassemble (&lines[pos], last_addr, 1); + + /* If there are some problems while disassembling exit. */ + if (next_addr <= last_addr) + break; + last_addr = next_addr; + } while (last_addr <= pc); + pos++; + if (pos >= maxLines) + pos = 0; + newLow = lines[pos].addr; + } + for (i = 0; i < maxLines; i++) + { + xfree (lines[i].addr_string); + xfree (lines[i].insn); + } + return newLow; +} + +/* Function to set the disassembly window's content. */ TuiStatus -tuiSetDisassemContent (struct symtab *s, CORE_ADDR startAddr) +tuiSetDisassemContent (CORE_ADDR pc) { TuiStatus ret = TUI_FAILURE; - struct ui_file *gdb_dis_out; - - if (startAddr != 0) + register int i; + register int offset = disassemWin->detail.sourceInfo.horizontalOffset; + register int lineWidth, maxLines; + CORE_ADDR cur_pc; + TuiGenWinInfoPtr locator = locatorWinInfoPtr (); + int tab_len = tuiDefaultTabLen (); + struct tui_asm_line* lines; + int insn_pos; + int addr_size, max_size; + char* line; + + if (pc == 0) + return TUI_FAILURE; + + ret = tuiAllocSourceBuffer (disassemWin); + if (ret != TUI_SUCCESS) + return ret; + + disassemWin->detail.sourceInfo.startLineOrAddr.addr = pc; + cur_pc = (CORE_ADDR) + (((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr); + + maxLines = disassemWin->generic.height - 2; /* account for hilite */ + + /* Get temporary table that will hold all strings (addr & insn). */ + lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line) + * maxLines); + memset (lines, 0, sizeof (struct tui_asm_line) * maxLines); + + lineWidth = disassemWin->generic.width - 1; + + tui_disassemble (lines, pc, maxLines); + + /* See what is the maximum length of an address and of a line. */ + addr_size = 0; + max_size = 0; + for (i = 0; i < maxLines; i++) { - register int i, desc; + size_t len = strlen (lines[i].addr_string); + if (len > addr_size) + addr_size = len; - if ((ret = tuiAllocSourceBuffer (disassemWin)) == TUI_SUCCESS) - { - register int offset = disassemWin->detail.sourceInfo.horizontalOffset; - register int threshold, curLine = 0, lineWidth, maxLines; - CORE_ADDR newpc, pc; - disassemble_info asmInfo; - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); -extern void strcat_address (CORE_ADDR, char *, int); -extern void strcat_address_numeric (CORE_ADDR, int, char *, int); - int curLen = 0; - int tab_len = tuiDefaultTabLen (); - - maxLines = disassemWin->generic.height - 2; /* account for hilite */ - lineWidth = disassemWin->generic.width - 1; - threshold = (lineWidth - 1) + offset; - - /* now init the ui_file structure */ - gdb_dis_out = tui_sfileopen (threshold); - - asmInfo = tm_print_insn_info; - asmInfo.stream = gdb_dis_out; - - disassemWin->detail.sourceInfo.startLineOrAddr.addr = startAddr; - - /* Now construct each line */ - for (curLine = 0, pc = startAddr; (curLine < maxLines);) - { - TuiWinElementPtr element = (TuiWinElementPtr) disassemWin->generic.content[curLine]; - struct breakpoint *bp; - - print_address (pc, gdb_dis_out); - - curLen = strlen (tui_file_get_strbuf (gdb_dis_out)); - i = curLen - ((curLen / tab_len) * tab_len); - - /* adjust buffer length if necessary */ - tui_file_adjust_strbuf ((tab_len - i > 0) ? (tab_len - i) : 0, gdb_dis_out); - - /* Add spaces to make the instructions start onthe same column */ - while (i < tab_len) - { - tui_file_get_strbuf (gdb_dis_out)[curLen] = ' '; - i++; - curLen++; - } - tui_file_get_strbuf (gdb_dis_out)[curLen] = '\0'; - - newpc = pc + ((*tm_print_insn) (pc, &asmInfo)); - - /* Now copy the line taking the offset into account */ - if (strlen (tui_file_get_strbuf (gdb_dis_out)) > offset) - strcpy (element->whichElement.source.line, - &(tui_file_get_strbuf (gdb_dis_out)[offset])); - else - element->whichElement.source.line[0] = '\0'; - element->whichElement.source.lineOrAddr.addr = pc; - element->whichElement.source.isExecPoint = - (pc == (CORE_ADDR) ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr); - bp = _hasBreak (pc); - element->whichElement.source.hasBreak = - (bp != (struct breakpoint *) NULL && - (!element->whichElement.source.isExecPoint || - (bp->disposition != disp_del || bp->hit_count <= 0))); - curLine++; - pc = newpc; - /* reset the buffer to empty */ - tui_file_get_strbuf (gdb_dis_out)[0] = '\0'; - } - ui_file_delete (gdb_dis_out); - gdb_dis_out = NULL; - disassemWin->generic.contentSize = curLine; - ret = TUI_SUCCESS; - } + len = strlen (lines[i].insn) + tab_len; + if (len > max_size) + max_size = len; } + max_size += addr_size + tab_len; - return ret; -} /* tuiSetDisassemContent */ + /* Allocate memory to create each line. */ + line = (char*) alloca (max_size); + insn_pos = (1 + (addr_size / tab_len)) * tab_len; + + /* Now construct each line */ + for (i = 0; i < maxLines; i++) + { + TuiWinElementPtr element; + TuiSourceElement* src; + int curLen; + + element = (TuiWinElementPtr) disassemWin->generic.content[i]; + src = &element->whichElement.source; + strcpy (line, lines[i].addr_string); + curLen = strlen (line); + + /* Add spaces to make the instructions start on the same column */ + while (curLen < insn_pos) + { + strcat (line, " "); + curLen++; + } + + strcat (line, lines[i].insn); + + /* Now copy the line taking the offset into account */ + if (strlen (line) > offset) + strcpy (src->line, &line[offset]); + else + src->line[0] = '\0'; + + src->lineOrAddr.addr = lines[i].addr; + src->isExecPoint = lines[i].addr == cur_pc; + + /* See whether there is a breakpoint installed. */ + src->hasBreak = (!src->isExecPoint + && breakpoint_here_p (pc) != no_breakpoint_here); + + xfree (lines[i].addr_string); + xfree (lines[i].insn); + } + disassemWin->generic.contentSize = i; + return TUI_SUCCESS; +} /* @@ -196,7 +327,7 @@ tuiShowDisassemAndUpdateSource (CORE_ADDR startAddr) if (currentLayout () == SRC_DISASSEM_COMMAND) { TuiLineOrAddress val; - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); + /* ** Update what is in the source window if it is displayed too, ** note that it follows what is in the disassembly window and visa-versa @@ -231,13 +362,19 @@ tuiGetBeginAsmAddress (void) if (element->addr == 0) { - /*the target is not executing, because the pc is 0 */ - - addr = parse_and_eval_address ("main"); - - if (addr == 0) - addr = parse_and_eval_address ("MAIN"); - + struct minimal_symbol *main_symbol; + + /* Find address of the start of program. + Note: this should be language specific. */ + main_symbol = lookup_minimal_symbol ("main", NULL, NULL); + if (main_symbol == 0) + main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL); + if (main_symbol == 0) + main_symbol = lookup_minimal_symbol ("_start", NULL, NULL); + if (main_symbol) + addr = SYMBOL_VALUE_ADDRESS (main_symbol); + else + addr = 0; } else /* the target is executing */ addr = element->addr; @@ -245,6 +382,23 @@ tuiGetBeginAsmAddress (void) return addr; } /* tuiGetBeginAsmAddress */ +/* Determine what the low address will be to display in the TUI's + disassembly window. This may or may not be the same as the + low address input. */ +CORE_ADDR +tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc) +{ + int pos; + + /* Determine where to start the disassembly so that the pc is about in the + middle of the viewport. */ + pos = tuiDefaultWinViewportHeight (DISASSEM_WIN, DISASSEM_COMMAND) / 2; + pc = tui_find_disassembly_address (pc, -pos); + + if (pc < low) + pc = low; + return pc; +} /* ** tuiVerticalDisassemScroll(). @@ -256,9 +410,11 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, { if (disassemWin->generic.content != (OpaquePtr) NULL) { - CORE_ADDR pc, lowAddr; + CORE_ADDR pc; TuiWinContent content; struct symtab *s; + TuiLineOrAddress val; + int maxLines, dir; content = (TuiWinContent) disassemWin->generic.content; if (current_source_symtab == (struct symtab *) NULL) @@ -266,60 +422,12 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, else s = current_source_symtab; + /* account for hilite */ + maxLines = disassemWin->generic.height - 2; pc = content[0]->whichElement.source.lineOrAddr.addr; - if (find_pc_partial_function (pc, (char **) NULL, &lowAddr, - (CORE_ADDR) 0) == 0) - error ("No function contains program counter for selected frame.\n"); - else - { - register int line = 0; - register CORE_ADDR newLow; - bfd_byte buffer[4]; - TuiLineOrAddress val; - - newLow = pc; - if (scrollDirection == FORWARD_SCROLL) - { - for (; line < numToScroll; line++) - newLow += sizeof (bfd_getb32 (buffer)); - } - else - { - for (; newLow != 0 && line < numToScroll; line++) - newLow -= sizeof (bfd_getb32 (buffer)); - } - val.addr = newLow; - tuiUpdateSourceWindowAsIs (disassemWin, s, val, FALSE); - } - } - - return; -} /* tuiVerticalDisassemScroll */ - - + dir = (scrollDirection == FORWARD_SCROLL) ? maxLines : - maxLines; -/***************************************** -** STATIC LOCAL FUNCTIONS ** -******************************************/ -/* - ** _hasBreak(). - ** Answer whether there is a break point at the input line in the - ** source file indicated - */ -static struct breakpoint * -_hasBreak (CORE_ADDR addr) -{ - struct breakpoint *bpWithBreak = (struct breakpoint *) NULL; - struct breakpoint *bp; - extern struct breakpoint *breakpoint_chain; - - - for (bp = breakpoint_chain; - (bp != (struct breakpoint *) NULL && - bpWithBreak == (struct breakpoint *) NULL); - bp = bp->next) - if (addr == bp->address) - bpWithBreak = bp; - - return bpWithBreak; -} /* _hasBreak */ + val.addr = tui_find_disassembly_address (pc, dir); + tuiUpdateSourceWindowAsIs (disassemWin, s, val, FALSE); + } +} diff --git a/gdb/tui/tuiDisassem.h b/gdb/tui/tuiDisassem.h index f0aabdfb4c2..67284259bf0 100644 --- a/gdb/tui/tuiDisassem.h +++ b/gdb/tui/tuiDisassem.h @@ -31,7 +31,7 @@ /***************************************** ** PUBLIC FUNCTION EXTERNAL DECLS ** ******************************************/ -extern TuiStatus tuiSetDisassemContent (struct symtab *, CORE_ADDR); +extern TuiStatus tuiSetDisassemContent (CORE_ADDR); extern void tuiShowDisassem (CORE_ADDR); extern void tuiShowDisassemAndUpdateSource (CORE_ADDR); extern void tuiVerticalDisassemScroll (TuiScrollDirection, int); diff --git a/gdb/tui/tuiGeneralWin.c b/gdb/tui/tuiGeneralWin.c index b3f8b919a5d..e250ca2ac78 100644 --- a/gdb/tui/tuiGeneralWin.c +++ b/gdb/tui/tuiGeneralWin.c @@ -45,12 +45,6 @@ #include "tuiGeneralWin.h" #include "tuiWin.h" -/* - ** local support functions - */ -static void _winResize (void); - - /*********************** ** PUBLIC FUNCTIONS ***********************/ @@ -124,6 +118,8 @@ boxWin (TuiGenWinInfoPtr winInfo, int highlightFlag) tui_border_hline, tui_border_hline, tui_border_ulcorner, tui_border_urcorner, tui_border_llcorner, tui_border_lrcorner); + if (winInfo->title) + mvwaddstr (win, 0, 3, winInfo->title); wattroff (win, attrs); } } @@ -197,43 +193,8 @@ makeWindow (TuiGenWinInfoPtr winInfo, int boxIt) boxWin (winInfo, NO_HILITE); winInfo->isVisible = TRUE; scrollok (handle, TRUE); - tuiRefreshWin (winInfo); - -#ifndef FOR_TEST - if ( /*!m_WinIsAuxillary(winInfo->type) && */ - (winInfo->type != CMD_WIN) && - (winInfo->content == (OpaquePtr) NULL)) - { - mvwaddstr (handle, 1, 1, winName (winInfo)); - tuiRefreshWin (winInfo); - } -#endif /*FOR_TEST */ } - - return; -} /* makeWindow */ - - -/* - ** tuiClearWin(). - ** Clear the window of all contents without calling wclear. - */ -void -tuiClearWin (TuiGenWinInfoPtr winInfo) -{ - if (m_genWinPtrNotNull (winInfo) && winInfo->handle != (WINDOW *) NULL) - { - int curRow, curCol; - - for (curRow = 0; (curRow < winInfo->height); curRow++) - for (curCol = 0; (curCol < winInfo->width); curCol++) - mvwaddch (winInfo->handle, curRow, curCol, ' '); - - tuiRefreshWin (winInfo); - } - - return; -} /* tuiClearWin */ +} /* @@ -258,13 +219,11 @@ makeVisible (TuiGenWinInfoPtr winInfo, int visible) (winInfo->type != CMD_WIN && !m_winIsAuxillary (winInfo->type))); winInfo->isVisible = TRUE; } - tuiRefreshWin (winInfo); } else if (!visible && winInfo->isVisible && winInfo->handle != (WINDOW *) NULL) { winInfo->isVisible = FALSE; - tuiClearWin (winInfo); tuiDelwin (winInfo->handle); winInfo->handle = (WINDOW *) NULL; } @@ -297,90 +256,6 @@ makeAllVisible (int visible) return; } /* makeAllVisible */ - -/* - ** scrollWinForward - */ -void -scrollWinForward (TuiGenWinInfoPtr winInfo, int numLines) -{ - if (winInfo->content != (OpaquePtr) NULL && - winInfo->lastVisibleLine < winInfo->contentSize - 1) - { - int i, firstLine, newLastLine; - - firstLine = winInfo->lastVisibleLine - winInfo->viewportHeight + 1; - if (winInfo->lastVisibleLine + numLines > winInfo->contentSize) - newLastLine = winInfo->contentSize - 1; - else - newLastLine = winInfo->lastVisibleLine + numLines - 1; - - for (i = (newLastLine - winInfo->viewportHeight); - (i <= newLastLine); i++) - { - TuiWinElementPtr line; - int lineHeight; - - line = (TuiWinElementPtr) winInfo->content[i]; - if (line->highlight) - wstandout (winInfo->handle); - mvwaddstr (winInfo->handle, - i - (newLastLine - winInfo->viewportHeight), - 1, - displayableWinContentOf (winInfo, line)); - if (line->highlight) - wstandend (winInfo->handle); - lineHeight = winElementHeight (winInfo, line); - newLastLine += (lineHeight - 1); - } - winInfo->lastVisibleLine = newLastLine; - } - - return; -} /* scrollWinForward */ - - -/* - ** scrollWinBackward - */ -void -scrollWinBackward (TuiGenWinInfoPtr winInfo, int numLines) -{ - if (winInfo->content != (OpaquePtr) NULL && - (winInfo->lastVisibleLine - winInfo->viewportHeight) > 0) - { - int i, newLastLine, firstLine; - - firstLine = winInfo->lastVisibleLine - winInfo->viewportHeight + 1; - if ((firstLine - numLines) < 0) - newLastLine = winInfo->viewportHeight - 1; - else - newLastLine = winInfo->lastVisibleLine - numLines + 1; - - for (i = newLastLine - winInfo->viewportHeight; (i <= newLastLine); i++) - { - TuiWinElementPtr line; - int lineHeight; - - line = (TuiWinElementPtr) winInfo->content[i]; - if (line->highlight) - wstandout (winInfo->handle); - mvwaddstr (winInfo->handle, - i - (newLastLine - winInfo->viewportHeight), - 1, - displayableWinContentOf (winInfo, line)); - if (line->highlight) - wstandend (winInfo->handle); - lineHeight = winElementHeight (winInfo, line); - newLastLine += (lineHeight - 1); - } - winInfo->lastVisibleLine = newLastLine; - } - - return; -} /* scrollWinBackward */ - - /* ** refreshAll(). ** Function to refresh all the windows currently displayed diff --git a/gdb/tui/tuiGeneralWin.h b/gdb/tui/tuiGeneralWin.h index 60c54f1bbe7..42d1ce46add 100644 --- a/gdb/tui/tuiGeneralWin.h +++ b/gdb/tui/tuiGeneralWin.h @@ -1,5 +1,5 @@ /* General window behavior. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -25,12 +25,9 @@ /* ** Functions */ -extern void tuiClearWin (TuiGenWinInfoPtr); extern void unhighlightWin (TuiWinInfoPtr); extern void makeVisible (TuiGenWinInfoPtr, int); extern void makeAllVisible (int); -extern void scrollWinForward (TuiGenWinInfoPtr, int); -extern void scrollWinBackward (TuiGenWinInfoPtr, int); extern void makeWindow (TuiGenWinInfoPtr, int); extern TuiWinInfoPtr copyWin (TuiWinInfoPtr); extern void boxWin (TuiGenWinInfoPtr, int); diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c index d664128ebd6..fe389af28fe 100644 --- a/gdb/tui/tuiIO.c +++ b/gdb/tui/tuiIO.c @@ -59,6 +59,10 @@ #include #include +/* Use definition from readline 4.3. */ +#undef CTRL_CHAR +#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) + /* This file controls the IO interactions between gdb and curses. When the TUI is enabled, gdb has two modes a curses and a standard mode. diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c index aa98882d9d3..c3eae72c3c5 100644 --- a/gdb/tui/tuiLayout.c +++ b/gdb/tui/tuiLayout.c @@ -58,7 +58,7 @@ /******************************* ** Static Local Decls ********************************/ - +static void showLayout (TuiLayoutType); static void _initGenWinInfo (TuiGenWinInfoPtr, TuiWinType, int, int, int, int); static void _initAndMakeWin (Opaque *, TuiWinType, int, int, int, int, int); static void _showSourceOrDisassemAndCommand (TuiLayoutType); @@ -86,20 +86,8 @@ static void _tuiHandleXDBLayout (TuiLayoutDefPtr); #define LAYOUT_USAGE "Usage: layout prev | next | \n" -/*************************************** -** Static Local Data -***************************************/ -static TuiLayoutType lastLayout = UNDEFINED_LAYOUT; - -/*************************************** -** PUBLIC FUNCTIONS -***************************************/ - -/* - ** showLayout(). - ** Show the screen layout defined - */ -void +/* Show the screen layout defined. */ +static void showLayout (TuiLayoutType layout) { TuiLayoutType curLayout = currentLayout (); @@ -111,7 +99,6 @@ showLayout (TuiLayoutType layout) ** should free the content and reallocate on next display of ** source/asm */ - tuiClearAllSourceWinsContent (NO_EMPTY_SOURCE_PROMPT); freeAllSourceWinsContent (); clearSourceWindows (); if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) @@ -146,9 +133,7 @@ showLayout (TuiLayoutType layout) } } } - - return; -} /* showLayout */ +} /* @@ -195,8 +180,6 @@ tuiSetLayout (TuiLayoutType layoutType, { if (newLayout != curLayout) { - if (winWithFocus != cmdWin) - tuiClearWinFocus (); showLayout (newLayout); /* ** Now determine where focus should be @@ -291,7 +274,7 @@ tuiSetLayout (TuiLayoutType layoutType, status = TUI_FAILURE; return status; -} /* tuiSetLayout */ +} /* ** tuiAddWinToLayout(). @@ -794,8 +777,6 @@ _showDisassemCommand (void) static void _showSourceDisassemCommand (void) { - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - if (currentLayout () != SRC_DISASSEM_COMMAND) { int cmdHeight, srcHeight, asmHeight; @@ -1033,13 +1014,9 @@ _initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType, ((TuiWinInfoPtr) opaqueWinInfo)->canHighlight = TRUE; } makeWindow (generic, boxIt); - if (winType == LOCATOR_WIN) - tuiClearLocatorDisplay (); } *winInfoPtr = opaqueWinInfo; - - return; -} /* _initAndMakeWin */ +} /* @@ -1092,7 +1069,6 @@ _showSourceOrDisassemAndCommand (TuiLayoutType layoutType) if (currentLayout () != layoutType) { TuiWinInfoPtr *winInfoPtr; - int areaLeft; int srcHeight, cmdHeight; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); diff --git a/gdb/tui/tuiLayout.h b/gdb/tui/tuiLayout.h index 8646318f1da..f6b0ed79c68 100644 --- a/gdb/tui/tuiLayout.h +++ b/gdb/tui/tuiLayout.h @@ -1,5 +1,5 @@ /* TUI layout window management. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -22,7 +22,6 @@ #ifndef TUI_LAYOUT_H #define TUI_LAYOUT_H -extern void showLayout (TuiLayoutType); extern void tuiAddWinToLayout (TuiWinType); extern int tuiDefaultWinHeight (TuiWinType, TuiLayoutType); extern int tuiDefaultWinViewportHeight (TuiWinType, TuiLayoutType); diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c index d76c67ea8be..928eb416fd5 100644 --- a/gdb/tui/tuiRegs.c +++ b/gdb/tui/tuiRegs.c @@ -46,6 +46,7 @@ #include "gdbtypes.h" #include "gdbcmd.h" #include "frame.h" +#include "regcache.h" #include "inferior.h" #include "target.h" #include "tuiLayout.h" @@ -86,7 +87,7 @@ ******************************************/ static TuiStatus _tuiSetRegsContent (int, int, struct frame_info *, TuiRegisterDisplayType, int); -static char *_tuiRegisterName (int); +static const char *_tuiRegisterName (int); static TuiStatus _tuiGetRegisterRawValue (int, char *, struct frame_info *); static void _tuiSetRegisterElement (int, struct frame_info *, TuiDataElementPtr, int); @@ -311,7 +312,7 @@ tuiDisplayRegistersFrom (int startElementNo) dataWin->detail.dataDisplayInfo.regsContentCount > 0) { register int i = startElementNo; - int j, valueCharsWide, charsWide, itemWinWidth, curY, labelWidth; + int j, valueCharsWide, itemWinWidth, curY, labelWidth; enum precision_type precision; precision = (dataWin->detail.dataDisplayInfo.regsDisplayType @@ -435,8 +436,6 @@ tuiDisplayRegElementAtLine (int startElementNo, int startLineNo) int tuiDisplayRegistersFromLine (int lineNo, int forceDisplay) { - int elementNo; - if (dataWin->detail.dataDisplayInfo.regsContentCount > 0) { int line, elementNo; @@ -595,7 +594,7 @@ registers.\n", ** _tuiRegisterName(). ** Return the register name. */ -static char * +static const char * _tuiRegisterName (int regNum) { return REGISTER_NAME (regNum); @@ -622,7 +621,7 @@ _tuiRegisterFormat (char *buf, int bufLen, int regNum, { struct ui_file *stream; struct ui_file *old_stdout; - char *name; + const char *name; struct cleanup *cleanups; char *p; int pos; @@ -639,7 +638,8 @@ _tuiRegisterFormat (char *buf, int bufLen, int regNum, stream = tui_sfileopen (bufLen); gdb_stdout = stream; cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout); - do_registers_info (regNum, 0); + gdbarch_print_registers_info (current_gdbarch, stream, selected_frame, + regNum, 1); /* Save formatted output in the buffer. */ p = tui_file_get_strbuf (stream); @@ -700,15 +700,9 @@ static TuiStatus _tuiSetSpecialRegsContent (int refreshValuesOnly) { TuiStatus ret = TUI_FAILURE; - int i, endRegNum; + int endRegNum; endRegNum = FP0_REGNUM - 1; -#if 0 - endRegNum = (-1); - for (i = START_SPECIAL_REGS; (i < NUM_REGS && endRegNum < 0); i++) - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) - endRegNum = i - 1; -#endif ret = _tuiSetRegsContent (START_SPECIAL_REGS, endRegNum, selected_frame, @@ -727,15 +721,9 @@ static TuiStatus _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly) { TuiStatus ret = TUI_FAILURE; - int i, endRegNum = (-1); + int endRegNum = (-1); endRegNum = FP0_REGNUM - 1; -#if 0 - endRegNum = (-1); - for (i = 0; (i < NUM_REGS && endRegNum < 0); i++) - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) - endRegNum = i - 1; -#endif ret = _tuiSetRegsContent ( 0, endRegNum, selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly); @@ -750,15 +738,9 @@ static TuiStatus _tuiSetFloatRegsContent (TuiRegisterDisplayType dpyType, int refreshValuesOnly) { TuiStatus ret = TUI_FAILURE; - int i, startRegNum; + int startRegNum; startRegNum = FP0_REGNUM; -#if 0 - startRegNum = (-1); - for (i = NUM_REGS - 1; (i >= 0 && startRegNum < 0); i--) - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) != TYPE_CODE_FLT) - startRegNum = i + 1; -#endif ret = _tuiSetRegsContent (startRegNum, NUM_REGS - 1, selected_frame, diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c index 1552ac79d0d..f844b3639d2 100644 --- a/gdb/tui/tuiSource.c +++ b/gdb/tui/tuiSource.c @@ -54,13 +54,6 @@ #include "tuiSource.h" -/***************************************** -** EXTERNAL DATA DECLS ** -******************************************/ -extern int current_source_line; -extern struct symtab *current_source_symtab; - - /***************************************** ** STATIC LOCAL FUNCTIONS FORWARD DECLS ** ******************************************/ @@ -68,19 +61,6 @@ extern struct symtab *current_source_symtab; static struct breakpoint *_hasBreak (char *, int); -/***************************************** -** STATIC LOCAL DATA ** -******************************************/ - - -/***************************************** -** PUBLIC FUNCTIONS ** -******************************************/ - -/********************************* -** SOURCE/DISASSEM FUNCTIONS ** -*********************************/ - /* ** tuiSetSourceContent(). ** Function to display source in the source window. @@ -94,7 +74,7 @@ tuiSetSourceContent (struct symtab *s, int lineNo, int noerror) { register FILE *stream; register int i, desc, c, lineWidth, nlines; - register char *srcLine; + register char *srcLine = 0; if ((ret = tuiAllocSourceBuffer (srcWin)) == TUI_SUCCESS) { @@ -136,17 +116,24 @@ tuiSetSourceContent (struct symtab *s, int lineNo, int noerror) { register int offset, curLineNo, curLine, curLen, threshold; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - /* - ** Determine the threshold for the length of the line - ** and the offset to start the display - */ - offset = srcWin->detail.sourceInfo.horizontalOffset; + TuiSourceInfoPtr src = &srcWin->detail.sourceInfo; + + if (srcWin->generic.title) + xfree (srcWin->generic.title); + srcWin->generic.title = xstrdup (s->filename); + + if (src->filename) + xfree (src->filename); + src->filename = xstrdup (s->filename); + + /* Determine the threshold for the length of the line + and the offset to start the display. */ + offset = src->horizontalOffset; threshold = (lineWidth - 1) + offset; stream = fdopen (desc, FOPEN_RT); clearerr (stream); curLine = 0; - curLineNo = - srcWin->detail.sourceInfo.startLineOrAddr.lineNo = lineNo; + curLineNo = src->startLineOrAddr.lineNo = lineNo; if (offset > 0) srcLine = (char *) xmalloc ( (threshold + 1) * sizeof (char)); diff --git a/gdb/tui/tuiSource.h b/gdb/tui/tuiSource.h index 2c04988ec2b..96cf8652aca 100644 --- a/gdb/tui/tuiSource.h +++ b/gdb/tui/tuiSource.h @@ -1,5 +1,5 @@ /* TUI display source window. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -26,16 +26,8 @@ extern TuiStatus tuiSetSourceContent (struct symtab *, int, int); extern void tuiShowSource (struct symtab *, TuiLineOrAddress, int); -extern void tuiShowSourceAsIs (struct symtab *, Opaque, int); extern int tuiSourceIsDisplayed (char *); extern void tuiVerticalSourceScroll (TuiScrollDirection, int); - -/******************* -** MACROS ** -*******************/ -#define m_tuiShowSourceAsIs(s, line, noerror) tuiUpdateSourceWindowAsIs(srcWin, s, line, noerror) - - #endif /*_TUI_SOURCE_H*/ diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index 7563c940de0..b2ce594dbe3 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -56,80 +56,28 @@ #include "tuiDisassem.h" -/***************************************** -** EXTERNAL FUNCTION DECLS ** -******************************************/ - -/***************************************** -** EXTERNAL DATA DECLS ** -******************************************/ -extern int current_source_line; -extern struct symtab *current_source_symtab; - - -/***************************************** -** STATIC LOCAL FUNCTIONS FORWARD DECLS ** -******************************************/ - -/***************************************** -** STATIC LOCAL DATA ** -******************************************/ - - -/***************************************** -** PUBLIC FUNCTIONS ** -******************************************/ - -/********************************* -** SOURCE/DISASSEM FUNCTIONS ** -*********************************/ - -/* - ** tuiSrcWinIsDisplayed(). - */ -int -tuiSrcWinIsDisplayed (void) -{ - return (m_winPtrNotNull (srcWin) && srcWin->generic.isVisible); -} /* tuiSrcWinIsDisplayed */ - - -/* - ** tuiAsmWinIsDisplayed(). - */ -int -tuiAsmWinIsDisplayed (void) -{ - return (m_winPtrNotNull (disassemWin) && disassemWin->generic.isVisible); -} /* tuiAsmWinIsDisplayed */ - - -/* - ** tuiDisplayMainFunction(). - ** Function to display the "main" routine" - */ +/* Function to display the "main" routine. */ void -tuiDisplayMainFunction (void) +tui_display_main (void) { if ((sourceWindows ())->count > 0) { CORE_ADDR addr; - addr = parse_and_eval_address ("main"); - if (addr == (CORE_ADDR) 0) - addr = parse_and_eval_address ("MAIN"); + addr = tuiGetBeginAsmAddress (); if (addr != (CORE_ADDR) 0) { struct symtab_and_line sal; tuiUpdateSourceWindowsWithAddr (addr); sal = find_pc_line (addr, 0); - tuiSwitchFilename (sal.symtab->filename); + if (sal.symtab) + tuiUpdateLocatorFilename (sal.symtab->filename); + else + tuiUpdateLocatorFilename ("??"); } } - - return; -} /* tuiDisplayMainFunction */ +} @@ -163,7 +111,7 @@ tuiUpdateSourceWindowAsIs (TuiWinInfoPtr winInfo, struct symtab *s, if (winInfo->generic.type == SRC_WIN) ret = tuiSetSourceContent (s, lineOrAddr.lineNo, noerror); else - ret = tuiSetDisassemContent (s, lineOrAddr.addr); + ret = tuiSetDisassemContent (lineOrAddr.addr); if (ret == TUI_FAILURE) { @@ -297,22 +245,6 @@ tuiClearSourceContent (TuiWinInfoPtr winInfo, int displayPrompt) } /* tuiClearSourceContent */ -/* - ** tuiClearAllSourceWinsContent(). - */ -void -tuiClearAllSourceWinsContent (int displayPrompt) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiClearSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i], - displayPrompt); - - return; -} /* tuiClearAllSourceWinsContent */ - - /* ** tuiEraseSourceContent(). */ @@ -356,21 +288,30 @@ tuiEraseSourceContent (TuiWinInfoPtr winInfo, int displayPrompt) } /* tuiEraseSourceContent */ -/* - ** tuiEraseAllSourceContent(). - */ -void -tuiEraseAllSourceWinsContent (int displayPrompt) +/* Redraw the complete line of a source or disassembly window. */ +static void +tui_show_source_line (TuiWinInfoPtr winInfo, int lineno) { - int i; + TuiWinElementPtr line; + int x, y; - for (i = 0; i < (sourceWindows ())->count; i++) - tuiEraseSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i], - displayPrompt); + line = (TuiWinElementPtr) winInfo->generic.content[lineno - 1]; + if (line->whichElement.source.isExecPoint) + wattron (winInfo->generic.handle, A_STANDOUT); - return; -} /* tuiEraseAllSourceWinsContent */ + mvwaddstr (winInfo->generic.handle, lineno, 1, + line->whichElement.source.line); + if (line->whichElement.source.isExecPoint) + wattroff (winInfo->generic.handle, A_STANDOUT); + /* Clear to end of line but stop before the border. */ + getyx (winInfo->generic.handle, y, x); + while (x + 1 < winInfo->generic.width) + { + waddch (winInfo->generic.handle, ' '); + getyx (winInfo->generic.handle, y, x); + } +} /* ** tuiShowSourceContent(). @@ -378,42 +319,20 @@ tuiEraseAllSourceWinsContent (int displayPrompt) void tuiShowSourceContent (TuiWinInfoPtr winInfo) { - int curLine, i, curX; - - tuiEraseSourceContent (winInfo, (winInfo->generic.contentSize <= 0)); if (winInfo->generic.contentSize > 0) { - char *line; - - for (curLine = 1; (curLine <= winInfo->generic.contentSize); curLine++) - mvwaddstr ( - winInfo->generic.handle, - curLine, - 1, - ((TuiWinElementPtr) - winInfo->generic.content[curLine - 1])->whichElement.source.line); + int lineno; + + for (lineno = 1; lineno <= winInfo->generic.contentSize; lineno++) + tui_show_source_line (winInfo, lineno); } + else + tuiEraseSourceContent (winInfo, TRUE); + checkAndDisplayHighlightIfNeeded (winInfo); tuiRefreshWin (&winInfo->generic); winInfo->generic.contentInUse = TRUE; - - return; -} /* tuiShowSourceContent */ - - -/* - ** tuiShowAllSourceWinsContent() - */ -void -tuiShowAllSourceWinsContent (void) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiShowSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]); - - return; -} /* tuiShowAllSourceWinsContent */ +} /* @@ -497,19 +416,11 @@ tuiSetHasBreakAt (struct breakpoint *bp, TuiWinInfoPtr winInfo, int hasBreak) if (winInfo == srcWin) { - char *fileNameDisplayed = (char *) NULL; - - if (((TuiWinElementPtr) - locator->content[0])->whichElement.locator.fileName != - (char *) NULL) - fileNameDisplayed = ((TuiWinElementPtr) - locator->content[0])->whichElement.locator.fileName; - else if (current_source_symtab != (struct symtab *) NULL) - fileNameDisplayed = current_source_symtab->filename; + TuiSourceInfoPtr src = &winInfo->detail.sourceInfo; - gotIt = (fileNameDisplayed != (char *) NULL && + gotIt = (src->filename != (char *) NULL && bp->source_file != NULL && - (strcmp (bp->source_file, fileNameDisplayed) == 0) && + (strcmp (bp->source_file, src->filename) == 0) && content[i]->whichElement.source.lineOrAddr.lineNo == bp->line_number); } @@ -657,21 +568,6 @@ tuiShowExecInfoContent (TuiWinInfoPtr winInfo) } /* tuiShowExecInfoContent */ -/* - ** tuiShowAllExecInfosContent() - */ -void -tuiShowAllExecInfosContent (void) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiShowExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]); - - return; -} /* tuiShowAllExecInfosContent */ - - /* ** tuiEraseExecInfoContent(). */ @@ -686,22 +582,6 @@ tuiEraseExecInfoContent (TuiWinInfoPtr winInfo) return; } /* tuiEraseExecInfoContent */ - -/* - ** tuiEraseAllExecInfosContent() - */ -void -tuiEraseAllExecInfosContent (void) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiEraseExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]); - - return; -} /* tuiEraseAllExecInfosContent */ - - /* ** tuiClearExecInfoContent(). */ @@ -714,22 +594,6 @@ tuiClearExecInfoContent (TuiWinInfoPtr winInfo) return; } /* tuiClearExecInfoContent */ - -/* - ** tuiClearAllExecInfosContent() - */ -void -tuiClearAllExecInfosContent (void) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiClearExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]); - - return; -} /* tuiClearAllExecInfosContent */ - - /* ** tuiUpdateExecInfo(). ** Function to update the execution info window @@ -756,60 +620,11 @@ tuiUpdateAllExecInfos (void) return; } /* tuiUpdateAllExecInfos */ - - -/* tuiUpdateOnEnd() - ** elz: This function clears the execution info from the source windows - ** and resets the locator to display no line info, procedure info, pc - ** info. It is called by stack_publish_stopped_with_no_frame, which - ** is called then the target terminates execution - */ -void -tuiUpdateOnEnd (void) -{ - int i; - TuiGenWinInfoPtr locator; - char *filename; - TuiWinInfoPtr winInfo; - - locator = locatorWinInfoPtr (); - - /* for all the windows (src, asm) */ - for (i = 0; i < (sourceWindows ())->count; i++) - { - TuiLineOrAddress l; - - winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i]; - - l.addr = -1; - l.lineNo = -1; - tuiSetIsExecPointAt (l, winInfo); /* the target is'n running */ - /* -1 should not match any line number or pc */ - tuiSetExecInfoContent (winInfo); /*set winInfo so that > is'n displayed */ - tuiShowExecInfoContent (winInfo); /* display the new contents */ - } - - /*now update the locator */ - tuiClearLocatorDisplay (); - tuiGetLocatorFilename (locator, &filename); - tuiSetLocatorInfo ( - filename, - (char *) NULL, - 0, - (CORE_ADDR) 0, - &((TuiWinElementPtr) locator->content[0])->whichElement.locator); - tuiShowLocatorContent (); - - return; -} /* tuiUpdateOnEnd */ - - - TuiStatus tuiAllocSourceBuffer (TuiWinInfoPtr winInfo) { - register char *srcLine, *srcLineBuf; - register int i, lineWidth, c, maxLines; + register char *srcLineBuf; + register int i, lineWidth, maxLines; TuiStatus ret = TUI_FAILURE; maxLines = winInfo->generic.height; /* less the highlight box */ diff --git a/gdb/tui/tuiSourceWin.h b/gdb/tui/tuiSourceWin.h index ced01f74682..803cb900f96 100644 --- a/gdb/tui/tuiSourceWin.h +++ b/gdb/tui/tuiSourceWin.h @@ -1,5 +1,5 @@ /* TUI display source/assembly window. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -22,7 +22,8 @@ #ifndef _TUI_SOURCEWIN_H #define _TUI_SOURCEWIN_H -extern void tuiDisplayMainFunction (void); +/* Function to display the "main" routine. */ +extern void tui_display_main (void); extern void tuiUpdateSourceWindow (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress, int); extern void tuiUpdateSourceWindowAsIs (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress, @@ -31,19 +32,13 @@ extern void tuiUpdateSourceWindowsWithAddr (CORE_ADDR); extern void tuiUpdateSourceWindowsWithLine (struct symtab *, int); extern void tuiUpdateSourceWindowsFromLocator (void); extern void tuiClearSourceContent (TuiWinInfoPtr, int); -extern void tuiClearAllSourceWinsContent (int); extern void tuiEraseSourceContent (TuiWinInfoPtr, int); -extern void tuiEraseAllSourceWinsContent (int); extern void tuiSetSourceContentNil (TuiWinInfoPtr, char *); extern void tuiShowSourceContent (TuiWinInfoPtr); -extern void tuiShowAllSourceWinsContent (void); extern void tuiHorizontalSourceScroll (TuiWinInfoPtr, TuiScrollDirection, int); -extern void tuiUpdateOnEnd (void); - extern TuiStatus tuiSetExecInfoContent (TuiWinInfoPtr); extern void tuiShowExecInfoContent (TuiWinInfoPtr); -extern void tuiShowAllExecInfosContent (void); extern void tuiEraseExecInfoContent (TuiWinInfoPtr); extern void tuiEraseAllExecInfosContent (void); extern void tuiClearExecInfoContent (TuiWinInfoPtr); diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c index 43d022928f6..d3f040484c0 100644 --- a/gdb/tui/tuiStack.c +++ b/gdb/tui/tuiStack.c @@ -44,6 +44,7 @@ #include "breakpoint.h" #include "frame.h" #include "command.h" +#include "top.h" #include "tui.h" #include "tuiData.h" @@ -51,49 +52,54 @@ #include "tuiGeneralWin.h" #include "tuiSource.h" #include "tuiSourceWin.h" +#include "tui-file.h" -/***************************************** -** STATIC LOCAL FUNCTIONS FORWARD DECLS ** -******************************************/ - -static char *_getFuncNameFromFrame (struct frame_info *); -static void _tuiUpdateLocation_command (char *, int); +/* Get a printable name for the function at the address. + The symbol name is demangled if demangling is turned on. + Returns a pointer to a static area holding the result. */ +static char* tui_get_function_from_frame (struct frame_info *fi); +/* Set the filename portion of the locator. */ +static void tui_set_locator_filename (const char *filename); +/* Update the locator, with the provided arguments. */ +static void tui_set_locator_info (const char *filename, const char *procname, + int lineno, CORE_ADDR addr); -/***************************************** -** PUBLIC FUNCTION ** -******************************************/ +static void tui_update_command (char *, int); + -/* - ** tuiClearLocatorDisplay() - */ -void -tuiClearLocatorDisplay (void) +/* Get a printable name for the function at the address. + The symbol name is demangled if demangling is turned on. + Returns a pointer to a static area holding the result. */ +static char* +tui_get_function_from_frame (struct frame_info *fi) { - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - int i; - - if (locator->handle != (WINDOW *) NULL) - { - /* No need to werase, since writing a line of - * blanks which we do below, is equivalent. - */ - /* werase(locator->handle); */ - wmove (locator->handle, 0, 0); - wstandout (locator->handle); - for (i = 0; i < locator->width; i++) - waddch (locator->handle, ' '); - wstandend (locator->handle); - tuiRefreshWin (locator); - wmove (locator->handle, 0, 0); - locator->contentInUse = FALSE; - } - - return; -} /* tuiClearLocatorDisplay */ - + static char name[256]; + struct ui_file *stream = tui_sfileopen (256); + char *p; + + print_address_symbolic (fi->pc, stream, demangle, ""); + p = tui_file_get_strbuf (stream); + + /* Use simple heuristics to isolate the function name. The symbol can + be demangled and we can have function parameters. Remove them because + the status line is too short to display them. */ + if (*p == '<') + p++; + strncpy (name, p, sizeof (name)); + p = strchr (name, '('); + if (!p) + p = strchr (name, '>'); + if (p) + *p = 0; + p = strchr (name, '+'); + if (p) + *p = 0; + ui_file_delete (stream); + return name; +} /* ** tuiShowLocatorContent() @@ -114,6 +120,7 @@ tuiShowLocatorContent (void) wmove (locator->handle, 0, 0); wstandout (locator->handle); waddstr (locator->handle, string); + wclrtoeol (locator->handle); wstandend (locator->handle); tuiRefreshWin (locator); wmove (locator->handle, 0, 0); @@ -126,178 +133,56 @@ tuiShowLocatorContent (void) return; } /* tuiShowLocatorContent */ - -/* Update the locator, with the provided arguments. */ -void -tuiSetLocatorInfo (char *fname, char *procname, int lineNo, - CORE_ADDR addr, TuiLocatorElementPtr element) -{ - element->fileName[0] = (char) 0; - element->procName[0] = (char) 0; - strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, fname); - strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname); - element->lineNo = lineNo; - element->addr = addr; -} - - -/* - ** tuiUpdateLocatorFilename(). - ** Update only the filename portion of the locator. - */ -void -tuiUpdateLocatorFilename (const char *fileName) -{ - TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - - if (locator->content[0] == (Opaque) NULL) - tuiSetLocatorContent ((struct frame_info *) NULL); - ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0; - strcat_to_buf (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName, - MAX_LOCATOR_ELEMENT_LEN, - fileName); - - tuiShowLocatorContent (); - - return; -} /* tuiUpdateLocatorFilename */ - -/* - ** tuiSwitchFilename(). - ** Update the filename portion of the locator. Clear the other info in locator. - ** (elz) - */ -void -tuiSwitchFilename (char *fileName) +/* Set the filename portion of the locator. */ +static void +tui_set_locator_filename (const char *filename) { TuiGenWinInfoPtr locator = locatorWinInfoPtr (); + TuiLocatorElementPtr element; if (locator->content[0] == (Opaque) NULL) - tuiSetLocatorContent ((struct frame_info *) NULL); - ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0; - - tuiSetLocatorInfo (fileName, - (char *) NULL, - 0, - (CORE_ADDR) 0, - &((TuiWinElementPtr) locator->content[0])->whichElement.locator); - - tuiShowLocatorContent (); - - return; -} /* tuiSwitchFilename */ - - -/* - ** tuiGetLocatorFilename(). - ** Get the filename portion of the locator. - ** (elz) - */ -void -tuiGetLocatorFilename (TuiGenWinInfoPtr locator, char **filename) -{ - - /* the current filename could be non known, in which case the xmalloc would - allocate no memory, because the length would be 0 */ - if (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName) { - int name_length = - strlen (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName); - - (*filename) = (char *) xmalloc (name_length + 1); - strcpy ((*filename), - ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName); + tui_set_locator_info (filename, NULL, 0, 0); + return; } - return; -} /* tuiGetLocatorFilename */ - - -/* - ** tuiUpdateLocatorInfoFromFrame(). - ** Function to update the locator, with the information extracted from frameInfo - */ -void -tuiUpdateLocatorInfoFromFrame (struct frame_info *frameInfo, - TuiLocatorElementPtr element) -{ - struct symtab_and_line symtabAndLine; - - /* now get the new info */ - symtabAndLine = find_pc_line (frameInfo->pc, - (frameInfo->next != (struct frame_info *) NULL && - !frameInfo->next->signal_handler_caller && - !frame_in_dummy (frameInfo->next))); - if (symtabAndLine.symtab && symtabAndLine.symtab->filename) - tuiSetLocatorInfo (symtabAndLine.symtab->filename, - _getFuncNameFromFrame (frameInfo), - symtabAndLine.line, - frameInfo->pc, - element); - else - tuiSetLocatorInfo ((char *) NULL, - _getFuncNameFromFrame (frameInfo), - 0, - frameInfo->pc, - element); - - return; -} /* tuiUpdateLocatorInfoFromFrame */ - + element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator; + element->fileName[0] = 0; + strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, filename); +} -/* - ** tuiSetLocatorContent(). - ** Function to set the content of the locator - */ -void -tuiSetLocatorContent (struct frame_info *frameInfo) +/* Update the locator, with the provided arguments. */ +static void +tui_set_locator_info (const char *filename, const char *procname, int lineno, + CORE_ADDR addr) { TuiGenWinInfoPtr locator = locatorWinInfoPtr (); - TuiWinElementPtr element; - struct symtab_and_line symtabAndLine; + TuiLocatorElementPtr element; - /* Allocate the element if necessary */ + /* Allocate the locator content if necessary. */ if (locator->contentSize <= 0) { - TuiWinContent contentPtr; - - if ((locator->content = (OpaquePtr) allocContent (1, locator->type)) == (OpaquePtr) NULL) - error ("Unable to Allocate Memory to Display Location."); + locator->content = (OpaquePtr) allocContent (1, locator->type); locator->contentSize = 1; } - if (frameInfo != (struct frame_info *) NULL) - tuiUpdateLocatorInfoFromFrame (frameInfo, - &((TuiWinElementPtr) locator->content[0])->whichElement.locator); - else - tuiSetLocatorInfo ((char *) NULL, - (char *) NULL, - 0, - (CORE_ADDR) 0, - &((TuiWinElementPtr) locator->content[0])->whichElement.locator); - return; -} /* tuiSetLocatorContent */ - + element = &((TuiWinElementPtr) locator->content[0])->whichElement.locator; + element->procName[0] = (char) 0; + strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname); + element->lineNo = lineno; + element->addr = addr; + tui_set_locator_filename (filename); +} -/* - ** tuiUpdateLocatorDisplay(). - ** Function to update the locator display - */ +/* Update only the filename portion of the locator. */ void -tuiUpdateLocatorDisplay (struct frame_info *frameInfo) +tuiUpdateLocatorFilename (const char *filename) { - tuiClearLocatorDisplay (); - tuiSetLocatorContent (frameInfo); + tui_set_locator_filename (filename); tuiShowLocatorContent (); +} - return; -} /* tuiUpdateLocatorDisplay */ - - -/* - ** tuiShowFrameInfo(). - ** Function to print the frame inforrmation for the TUI. - */ +/* Function to print the frame information for the TUI. */ void tuiShowFrameInfo (struct frame_info *fi) { @@ -307,19 +192,24 @@ tuiShowFrameInfo (struct frame_info *fi) if (fi) { register int startLine, i; - register struct symtab *s; CORE_ADDR low; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); int sourceAlreadyDisplayed; - - - s = find_pc_symtab (fi->pc); - if (s == 0) - return; - + struct symtab_and_line sal; + + sal = find_pc_line (fi->pc, + (fi->next != (struct frame_info *) NULL && + !fi->next->signal_handler_caller && + !frame_in_dummy (fi->next))); + + sourceAlreadyDisplayed = sal.symtab != 0 + && tuiSourceIsDisplayed (sal.symtab->filename); + tui_set_locator_info (sal.symtab == 0 ? "??" : sal.symtab->filename, + tui_get_function_from_frame (fi), + sal.line, + fi->pc); + tuiShowLocatorContent (); startLine = 0; - sourceAlreadyDisplayed = tuiSourceIsDisplayed (s->filename); - tuiUpdateLocatorDisplay (fi); for (i = 0; i < (sourceWindows ())->count; i++) { TuiWhichElement *item; @@ -347,7 +237,7 @@ tuiShowFrameInfo (struct frame_info *fi) l.lineNo = startLine; if (!(sourceAlreadyDisplayed && tuiLineIsDisplayed (item->locator.lineNo, winInfo, TRUE))) - tuiUpdateSourceWindow (winInfo, s, l, TRUE); + tuiUpdateSourceWindow (winInfo, sal.symtab, l, TRUE); else { l.lineNo = item->locator.lineNo; @@ -361,7 +251,7 @@ tuiShowFrameInfo (struct frame_info *fi) TuiLineOrAddress a; a.addr = low; if (!tuiAddrIsDisplayed (item->locator.addr, winInfo, TRUE)) - tuiUpdateSourceWindow (winInfo, s, a, TRUE); + tuiUpdateSourceWindow (winInfo, sal.symtab, a, TRUE); else { a.addr = item->locator.addr; @@ -374,7 +264,8 @@ tuiShowFrameInfo (struct frame_info *fi) } else { - tuiUpdateLocatorDisplay (fi); + tui_set_locator_info (NULL, NULL, 0, (CORE_ADDR) 0); + tuiShowLocatorContent (); for (i = 0; i < (sourceWindows ())->count; i++) { winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i]; @@ -382,70 +273,23 @@ tuiShowFrameInfo (struct frame_info *fi) tuiUpdateExecInfo (winInfo); } } +} - return; -} /* tuiShowFrameInfo */ - -/* - ** _initialize_tuiStack(). - ** Function to initialize gdb commands, for tui window stack manipulation. - */ +/* Function to initialize gdb commands, for tui window stack manipulation. */ void _initialize_tuiStack (void) { - add_com ("update", class_tui, _tuiUpdateLocation_command, - "Update the source window and locator to display the current execution point.\n"); + add_com ("update", class_tui, tui_update_command, + "Update the source window and locator to display the current " + "execution point.\n"); } - -/***************************************** -** STATIC LOCAL FUNCTIONS ** -******************************************/ - -/* - ** _getFuncNameFromFrame(). - */ -static char * -_getFuncNameFromFrame (struct frame_info *frameInfo) -{ - char *funcName = (char *) NULL; - - find_pc_partial_function (frameInfo->pc, - &funcName, - (CORE_ADDR *) NULL, - (CORE_ADDR *) NULL); - return funcName; -} /* _getFuncNameFromFrame */ - - -/* - ** _tuiUpdateLocation_command(). - ** Command to update the display with the current execution point - */ +/* Command to update the display with the current execution point. */ static void -_tuiUpdateLocation_command (char *arg, int fromTTY) +tui_update_command (char *arg, int from_tty) { -#ifndef TRY -extern void frame_command (char *, int); - frame_command ("0", FALSE); -#else - struct frame_info *curFrame; - - /* Obtain the current execution point */ - if ((curFrame = get_current_frame ()) != (struct frame_info *) NULL) - { - struct frame_info *frame; - int curLevel = 0; - - for (frame = get_prev_frame (curLevel); - (frame != (struct frame_info *) NULL && (frame != curFrame)); - frame = get_prev_frame (frame)) - curLevel++; + char cmd[sizeof("frame 0")]; - if (curFrame != (struct frame_info *) NULL) - print_frame_info (frame, curLevel, 0, 1); - } -#endif - - return; -} /* _tuiUpdateLocation_command */ + strcpy (cmd, "frame 0"); + execute_command (cmd, from_tty); +} diff --git a/gdb/tui/tuiStack.h b/gdb/tui/tuiStack.h index 90aab5abe22..14be4974bed 100644 --- a/gdb/tui/tuiStack.h +++ b/gdb/tui/tuiStack.h @@ -1,5 +1,5 @@ /* TUI display locator. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -25,20 +25,9 @@ ** This header file supports */ -extern void tuiSetLocatorInfo (char *, char *, int, CORE_ADDR, - TuiLocatorElementPtr); extern void tuiUpdateLocatorFilename (const char *); -extern void tuiUpdateLocatorInfoFromFrame - (struct frame_info *, TuiLocatorElementPtr); -extern void tuiUpdateLocatorDisplay (struct frame_info *); -extern void tuiSetLocatorContent (struct frame_info *); extern void tuiShowLocatorContent (void); -extern void tuiClearLocatorContent (void); -extern void tuiClearLocatorDisplay (void); -extern void tuiSwitchFilename (char *); extern void tuiShowFrameInfo (struct frame_info *); -extern void tuiGetLocatorFilename (TuiGenWinInfoPtr, char **); - #endif /*_TUI_STACK_H*/ diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index a33f6613606..82c3d4951f4 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -52,6 +52,7 @@ #include "breakpoint.h" #include "frame.h" #include "cli/cli-cmds.h" +#include "top.h" #include "tui.h" #include "tuiData.h" @@ -63,11 +64,6 @@ #include "tuiSourceWin.h" #include "tuiDataWin.h" -/******************************* -** External Declarations -********************************/ -extern void init_page_info (); - /******************************* ** Static Local Decls ********************************/ @@ -396,36 +392,21 @@ Usage: w <#lines>\n"); add_show_from_set (c, &tui_showlist); } - -/* - ** tuiClearWinFocusFrom - ** Clear the logical focus from winInfo - */ +/* Update gdb's knowledge of the terminal size. */ void -tuiClearWinFocusFrom (TuiWinInfoPtr winInfo) +tui_update_gdb_sizes () { - if (m_winPtrNotNull (winInfo)) - { - if (winInfo->generic.type != CMD_WIN) - unhighlightWin (winInfo); - tuiSetWinWithFocus ((TuiWinInfoPtr) NULL); - } - - return; -} /* tuiClearWinFocusFrom */ - - -/* - ** tuiClearWinFocus(). - ** Clear the window that has focus. - */ -void -tuiClearWinFocus (void) -{ - tuiClearWinFocusFrom (tuiWinWithFocus ()); + char cmd[50]; + extern int screenheight, screenwidth; /* in readline */ - return; -} /* tuiClearWinFocus */ + /* Set to TUI command window dimension or use readline values. */ + sprintf (cmd, "set width %d", + tui_active ? cmdWin->generic.width : screenwidth); + execute_command (cmd, 0); + sprintf (cmd, "set height %d", + tui_active ? cmdWin->generic.height : screenheight); + execute_command (cmd, 0); +} /* @@ -607,9 +588,6 @@ tuiRefreshAll (void) { case SRC_WIN: case DISASSEM_WIN: - tuiClearWin (&winList[type]->generic); - if (winList[type]->detail.sourceInfo.hasLocator) - tuiClearLocatorDisplay (); tuiShowSourceContent (winList[type]); checkAndDisplayHighlightIfNeeded (winList[type]); tuiEraseExecInfoContent (winList[type]); @@ -623,11 +601,8 @@ tuiRefreshAll (void) } } } - tuiClearLocatorDisplay (); tuiShowLocatorContent (); - - return; -} /* tuiRefreshAll */ +} /* @@ -650,12 +625,12 @@ tuiResizeAll (void) TuiWinInfoPtr firstWin, secondWin; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); TuiWinType winType; - int i, newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; + int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; /* turn keypad off while we resize */ if (winWithFocus != cmdWin) keypad (cmdWin->generic.handle, FALSE); - init_page_info (); + tui_update_gdb_sizes (); setTermHeightTo (screenheight); setTermWidthTo (screenwidth); if (curLayout == SRC_DISASSEM_COMMAND || @@ -1076,7 +1051,7 @@ The window name specified must be valid and visible.\n"); warning ("Invalid window height specified.\n%s", WIN_HEIGHT_USAGE); else - init_page_info (); + tui_update_gdb_sizes (); } else warning ("Invalid window height specified.\n%s", @@ -1168,7 +1143,7 @@ _tuiAdjustWinHeights (TuiWinInfoPtr primaryWinInfo, int newHeight) status = TUI_SUCCESS; if (newHeight != primaryWinInfo->generic.height) { - int i, diff; + int diff; TuiWinInfoPtr winInfo; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); TuiLayoutType curLayout = currentLayout (); @@ -1316,7 +1291,6 @@ static void _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) { int i; - struct symtab *s; TuiGenWinInfoPtr genWinInfo; @@ -1365,9 +1339,7 @@ _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) default: break; } - - return; -} /* _makeInvisibleAndSetNewHeight */ +} /* @@ -1379,7 +1351,6 @@ _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) static void _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) { - int i; struct symtab *s; m_beVisible (&winInfo->generic); @@ -1421,7 +1392,6 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) if (m_hasLocator (winInfo)) { m_beVisible (locatorWinInfoPtr ()); - tuiClearLocatorDisplay (); tuiShowLocatorContent (); } break; @@ -1450,7 +1420,7 @@ _newHeightOk (TuiWinInfoPtr primaryWinInfo, int newHeight) if (ok) { - int diff, curHeight; + int diff; TuiLayoutType curLayout = currentLayout (); diff = (newHeight - primaryWinInfo->generic.height) * (-1); diff --git a/gdb/tui/tuiWin.h b/gdb/tui/tuiWin.h index ac210421e0d..bc260804888 100644 --- a/gdb/tui/tuiWin.h +++ b/gdb/tui/tuiWin.h @@ -1,5 +1,5 @@ /* TUI window generic functions. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -37,8 +37,6 @@ extern void tuiScrollLeft (TuiWinInfoPtr, int); extern void tuiScrollRight (TuiWinInfoPtr, int); extern void tui_scroll (TuiScrollDirection, TuiWinInfoPtr, int); extern void tuiSetWinFocusTo (TuiWinInfoPtr); -extern void tuiClearWinFocusFrom (TuiWinInfoPtr); -extern void tuiClearWinFocus (void); extern void tuiResizeAll (void); extern void tuiRefreshAll (void); extern void tuiSigwinchHandler (int); @@ -54,5 +52,8 @@ extern int tui_active_border_attrs; extern int tui_update_variables (); +/* Update gdb's knowledge of the terminal size. */ +extern void tui_update_gdb_sizes (void); + #endif /*_TUI_WIN_H*/ diff --git a/gdb/uw-thread.c b/gdb/uw-thread.c index 617cfbd9f81..cc6ed6daf4c 100644 --- a/gdb/uw-thread.c +++ b/gdb/uw-thread.c @@ -116,6 +116,14 @@ /* Prototypes for supply_gregset etc. */ #include "gregset.h" +/* Offset from SP to first arg on stack at first instruction of a + function. We provide a default here that's right for most, if not + all, targets that use this file. */ + +#ifndef SP_ARG0 +#define SP_ARG0 (1 * 4) +#endif + /* Whether to emit debugging output. */ #define DEBUG 0 diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 50980fa11cf..3752dced66b 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1273,7 +1273,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_arguments (gdbarch, v850_push_arguments); set_gdbarch_pop_frame (gdbarch, v850_pop_frame); set_gdbarch_store_struct_return (gdbarch, v850_store_struct_return); - set_gdbarch_store_return_value (gdbarch, v850_store_return_value); + 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); set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); diff --git a/gdb/valops.c b/gdb/valops.c index c834d05d385..bfd8f32d6a3 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -361,18 +361,11 @@ value_cast (struct type *type, struct value *arg2) value_zero (t1, not_lval), 0, t1, 1); if (v) { - struct value *v2 = value_ind (arg2); - VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v) - + VALUE_OFFSET (v); - - /* JYG: adjust the new pointer value and - embedded offset. */ - v2->aligner.contents[0] -= VALUE_EMBEDDED_OFFSET (v); - VALUE_EMBEDDED_OFFSET (v2) = 0; - - v2 = value_addr (v2); - VALUE_TYPE (v2) = type; - return v2; + CORE_ADDR addr2 = value_as_address (arg2); + addr2 -= (VALUE_ADDRESS (v) + + VALUE_OFFSET (v) + + VALUE_EMBEDDED_OFFSET (v)); + return value_from_pointer (type, addr2); } } } @@ -770,7 +763,7 @@ value_assign (struct value *toval, struct value *fromval) if (regno > VALUE_FRAME_REGNUM (toval) + reg_offset) regno = -1; if (register_changed_hook) - register_changed_hook (regno); + register_changed_hook (-1); target_changed_event (); } break; @@ -2061,11 +2054,18 @@ search_struct_field (char *name, struct value *arg1, int offset, { struct value *v; if (TYPE_FIELD_STATIC (type, i)) - v = value_static_field (type, i); + { + v = value_static_field (type, i); + if (v == 0) + error ("field %s is nonexistent or has been optimised out", + name); + } else - v = value_primitive_field (arg1, offset, i, type); - if (v == 0) - error ("there is no field named %s", name); + { + v = value_primitive_field (arg1, offset, i, type); + if (v == 0) + error ("there is no field named %s", name); + } return v; } @@ -3050,7 +3050,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, { v = value_static_field (t, i); if (v == NULL) - error ("Internal error: could not find static variable %s", + error ("static field %s has been optimized out", name); return v; } diff --git a/gdb/valprint.c b/gdb/valprint.c index f27fd31eb0c..b1c47a123d4 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -332,7 +332,7 @@ print_longest (struct ui_file *stream, int format, int use_local, fprintf_filtered (stream, use_local ? local_decimal_format_custom ("ll") : "%lld", - val_long); + (long long) val_long); break; case 'u': fprintf_filtered (stream, "%llu", (long long) val_long); @@ -341,13 +341,13 @@ print_longest (struct ui_file *stream, int format, int use_local, fprintf_filtered (stream, use_local ? local_hex_format_custom ("ll") : "%llx", - val_long); + (unsigned long long) val_long); break; case 'o': fprintf_filtered (stream, use_local ? local_octal_format_custom ("ll") : "%llo", - val_long); + (unsigned long long) val_long); break; case 'b': fprintf_filtered (stream, local_hex_format_custom ("02ll"), val_long); diff --git a/gdb/values.c b/gdb/values.c index debea40b828..a0c9794bced 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -793,7 +793,9 @@ unpack_pointer (struct type *type, char *valaddr) } -/* Get the value of the FIELDN'th field (which must be static) of TYPE. */ +/* Get the value of the FIELDN'th field (which must be static) of + TYPE. Return NULL if the field doesn't exist or has been + optimized out. */ struct value * value_static_field (struct type *type, int fieldno) @@ -809,7 +811,14 @@ value_static_field (struct type *type, int fieldno) { char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno); struct symbol *sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL); - if (sym == NULL) + /* In some cases (involving uninitalized, unreferenced static + const integral members), g++ -gdwarf-2 can emit debugging + information giving rise to symbols whose SYMBOL_CLASS is + LOC_UNRESOLVED. In that case, do a minimal symbol lookup. + If it returns a useful value, then the symbol was defined + elsewhere, so we use that information. Otherwise, return + NULL. */ + if (sym == NULL || SYMBOL_CLASS (sym) == LOC_UNRESOLVED) { /* With some compilers, e.g. HP aCC, static data members are reported as non-debuggable symbols */ @@ -1327,7 +1336,7 @@ set_return_value (struct value *val) || code == TYPE_CODE_UNION) /* FIXME, implement struct return. */ error ("GDB does not support specifying a struct or union return value."); - STORE_RETURN_VALUE (type, VALUE_CONTENTS (val)); + STORE_RETURN_VALUE (type, current_regcache, VALUE_CONTENTS (val)); } void diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 46dce5a6cd4..709ef383c83 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -45,11 +45,9 @@ static gdbarch_frame_saved_pc_ftype vax_frame_saved_pc; static gdbarch_frame_args_address_ftype vax_frame_args_address; static gdbarch_frame_locals_address_ftype vax_frame_locals_address; static gdbarch_frame_init_saved_regs_ftype vax_frame_init_saved_regs; -static gdbarch_get_saved_register_ftype vax_get_saved_register; static gdbarch_store_struct_return_ftype vax_store_struct_return; static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value; -static gdbarch_store_return_value_ftype vax_store_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype vax_extract_struct_value_address; @@ -124,51 +122,6 @@ vax_register_virtual_type (int regno) return (builtin_type_int); } -static void -vax_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, - struct frame_info *frame, int regnum, - enum lval_type *lval) -{ - CORE_ADDR addr; - - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - addr = find_saved_register (frame, regnum); - if (addr != 0) - { - if (lval != NULL) - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer != NULL) - { - /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - (LONGEST) addr); - } - if (addrp != NULL) - *addrp = 0; - return; - } - if (raw_buffer != NULL) - target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); - } - else - { - if (lval != NULL) - *lval = lval_register; - addr = REGISTER_BYTE (regnum); - if (raw_buffer != NULL) - read_register_gen (regnum, raw_buffer); - } - if (addrp != NULL) - *addrp = addr; -} - static void vax_frame_init_saved_regs (struct frame_info *frame) { @@ -691,14 +644,12 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 4); - set_gdbarch_get_saved_register (gdbarch, vax_get_saved_register); - set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Return value info */ set_gdbarch_store_struct_return (gdbarch, vax_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value); - set_gdbarch_store_return_value (gdbarch, vax_store_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); /* Call dummy info */ diff --git a/gdb/version.in b/gdb/version.in index 8e6621bb688..3a2a9df4d8d 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2002-08-09-cvs +2002-08-29-cvs diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index e0377c5afe4..781a84126cb 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1791,6 +1791,7 @@ init_child_ops (void) child_ops.to_terminal_inferior = terminal_inferior; child_ops.to_terminal_ours_for_output = terminal_ours_for_output; child_ops.to_terminal_ours = terminal_ours; + child_ops.to_terminal_save_ours = terminal_save_ours; child_ops.to_terminal_info = child_terminal_info; child_ops.to_kill = child_kill_inferior; child_ops.to_load = 0; diff --git a/gdb/wince.c b/gdb/wince.c index a640bea74b2..92c115820b4 100644 --- a/gdb/wince.c +++ b/gdb/wince.c @@ -1910,6 +1910,7 @@ init_child_ops (void) child_ops.to_terminal_inferior = terminal_inferior; child_ops.to_terminal_ours_for_output = terminal_ours_for_output; child_ops.to_terminal_ours = terminal_ours; + child_ops.to_terminal_save_ours = terminal_save_ours; child_ops.to_terminal_info = child_terminal_info; child_ops.to_kill = child_kill_inferior; child_ops.to_load = child_load; diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 37d8fc80346..a47f5e7e5af 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1096,7 +1096,7 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Write into the appropriate registers a function return value stored in VALBUF of type TYPE, given in virtual format. */ - set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, x86_64_store_return_value); /* Offset from address of function to start of its code. */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 8e283b861ea..d3583139c63 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1090,7 +1090,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments); set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame); set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return); - set_gdbarch_store_return_value (gdbarch, xstormy16_store_return_value); + 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, xstormy16_use_struct_convention); diff --git a/include/ChangeLog b/include/ChangeLog index 39f18740bd0..e018f1ec506 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,11 @@ +2002-08-28 Michael Hayes + + * coff/internal.h: Add new relocation types. + * coff/ti.h: Add file-header flags for tic4x code. + * dis-asm.h: Add standard disassembler for tic4x. + * opcode/tic4x.h: New file. + * coff/tic4x.h: New file + 2002-08-07 H.J. Lu * bfdlink.h (bfd_link_info): Add allow_undefined_version. diff --git a/include/coff/internal.h b/include/coff/internal.h index 4babbd4de5f..b9b6368f039 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -600,6 +600,7 @@ struct internal_reloc }; #define R_DIR16 1 +#define R_REL24 5 #define R_DIR32 6 #define R_IMAGEBASE 7 #define R_RELBYTE 15 @@ -608,12 +609,15 @@ struct internal_reloc #define R_PCRBYTE 18 #define R_PCRWORD 19 #define R_PCRLONG 20 +#define R_PCR24 21 #define R_IPRSHORT 24 #define R_IPRLONG 26 #define R_GETSEG 29 #define R_GETPA 30 #define R_TAGWORD 31 #define R_JUMPTARG 32 /* strange 29k 00xx00xx reloc */ +#define R_PARTLS16 32 +#define R_PARTMS8 33 #define R_PCR16L 128 #define R_PCR26L 129 diff --git a/include/coff/ti.h b/include/coff/ti.h index d98fc89bd1f..0a59b226a32 100644 --- a/include/coff/ti.h +++ b/include/coff/ti.h @@ -118,6 +118,7 @@ struct external_filehdr #define F_RELFLG (0x0001) #define F_EXEC (0x0002) #define F_LNNO (0x0004) +#define F_VERS (0x0010) /* TMS320C4x code */ /* F_LSYMS needs to be redefined in your source file */ #define F_LSYMS_TICOFF (0x0010) /* normal COFF is 0x8 */ diff --git a/include/dis-asm.h b/include/dis-asm.h index 84c436d4f18..0109068f3f8 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -229,6 +229,7 @@ extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*)); +extern int print_insn_tic4x PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_tic54x PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_tic80 PARAMS ((bfd_vma, disassemble_info*)); extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*)); diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index e7b8b76d471..0ffa6ab9d31 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,22 @@ +2002-08-28 Catherine Moore + + * elf/v850.h (R_V850_LONGCALL, R_V850_ALIGN, + R_V850_LONGJUMP): New relocations. + +2002-08-15 Alan Modra + + * i370.h: Define relocs using reloc-macros.h. + +2002-08-13 Stephane Carrez + + * m68hc11.h (E_M68HC12_BANKS, E_M68HC11_I32, E_M68HC11_F64, + EF_M68HC11_ABI): Define for ABI specification. + (STO_M68HC12_FAR, STO_M68HC12_INTERRUPT): Symbol flags for + linker and debugger. + (R_M68HC11_24, R_M68HC11_LO16, R_M68HC11_PAGE): New relocs. + (R_M68HC11_RL_JUMP, R_M68HC11_RL_GROUP): New reloc for linker + relaxation. + 2002-07-15 Denis Chertykov Frank Ch. Eigler Ben Elliston diff --git a/include/elf/i370.h b/include/elf/i370.h index b6f478535a5..fd5ec4739d5 100644 --- a/include/elf/i370.h +++ b/include/elf/i370.h @@ -1,5 +1,5 @@ /* i370 ELF support for BFD. - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _ELF_I370_H #define _ELF_I370_H +#include "elf/reloc-macros.h" + /* Processor specific section headers, sh_type field */ #define SHT_ORDERED SHT_HIPROC /* Link editor is to sort the \ @@ -41,6 +43,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ builds when those objects \ are not to be furhter \ relocated. */ -#endif /* _ELF_I370_H */ +/* i370 relocations + Note that there is really just one relocation that we currently + support (and only one that we seem to need, at the moment), and + that is the 31-bit address relocation. Note that the 370/390 + only supports a 31-bit (2GB) address space. */ +START_RELOC_NUMBERS (i370_reloc_type) + RELOC_NUMBER (R_I370_NONE, 0) + RELOC_NUMBER (R_I370_ADDR31, 1) + RELOC_NUMBER (R_I370_ADDR32, 2) + RELOC_NUMBER (R_I370_ADDR16, 3) + RELOC_NUMBER (R_I370_REL31, 4) + RELOC_NUMBER (R_I370_REL32, 5) + RELOC_NUMBER (R_I370_ADDR12, 6) + RELOC_NUMBER (R_I370_REL12, 7) + RELOC_NUMBER (R_I370_ADDR8, 8) + RELOC_NUMBER (R_I370_REL8, 9) + RELOC_NUMBER (R_I370_COPY, 10) + RELOC_NUMBER (R_I370_RELATIVE, 11) +END_RELOC_NUMBERS (R_I370_max) + +#endif /* _ELF_I370_H */ diff --git a/include/elf/m68hc11.h b/include/elf/m68hc11.h index 0f9546d7404..c4ef37d979e 100644 --- a/include/elf/m68hc11.h +++ b/include/elf/m68hc11.h @@ -1,5 +1,5 @@ /* m68hc11 & m68hc12 ELF support for BFD. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -37,6 +37,41 @@ START_RELOC_NUMBERS (elf_m68hc11_reloc_type) /* These are GNU extensions to enable C++ vtable garbage collection. */ RELOC_NUMBER (R_M68HC11_GNU_VTINHERIT, 9) RELOC_NUMBER (R_M68HC11_GNU_VTENTRY, 10) + + RELOC_NUMBER (R_M68HC11_24, 11) + RELOC_NUMBER (R_M68HC11_LO16, 12) + RELOC_NUMBER (R_M68HC11_PAGE, 13) + + /* GNU extension for linker relaxation. + Mark beginning of a jump instruction (any form). */ + RELOC_NUMBER (R_M68HC11_RL_JUMP, 20) + + /* Mark beginning of Gcc relaxation group instruction. */ + RELOC_NUMBER (R_M68HC11_RL_GROUP, 21) END_RELOC_NUMBERS (R_M68HC11_max) +/* Processor specific flags for the ELF header e_flags field. */ + +/* ABI identification. */ +#define EF_M68HC11_ABI 0x00000000F + +/* Integers are 32-bit long. */ +#define E_M68HC11_I32 0x000000001 + +/* Doubles are 64-bit long. */ +#define E_M68HC11_F64 0x000000002 + +/* Uses 68HC12 memory banks. */ +#define E_M68HC12_BANKS 0x000000004 + + +/* Special values for the st_other field in the symbol table. These + are used for 68HC12 to identify far functions (must be called with + 'call' and returns with 'rtc'). */ +#define STO_M68HC12_FAR 0x80 + +/* Identify interrupt handlers. This is used by the debugger to + correctly compute the stack frame. */ +#define STO_M68HC12_INTERRUPT 0x40 + #endif diff --git a/include/elf/v850.h b/include/elf/v850.h index 62b9541e8e9..a15c9ee0864 100644 --- a/include/elf/v850.h +++ b/include/elf/v850.h @@ -1,22 +1,22 @@ /* V850 ELF support for BFD. - Copyright 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 2000, 2002 Free Software Foundation, Inc. Created by Michael Meissner, Cygnus Support -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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. */ /* This file holds definitions specific to the MIPS ELF ABI. Note that most of this is not actually implemented by BFD. */ @@ -35,18 +35,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* v850e code. */ #define E_V850E_ARCH 0x10000000 -/* v850ea code. */ -#define E_V850EA_ARCH 0x20000000 +/* Flags for the st_other field. */ +#define V850_OTHER_SDA 0x01 /* Symbol had SDA relocations. */ +#define V850_OTHER_ZDA 0x02 /* Symbol had ZDA relocations. */ +#define V850_OTHER_TDA 0x04 /* Symbol had TDA relocations. */ +#define V850_OTHER_TDA_BYTE 0x08 /* Symbol had TDA byte relocations. */ +#define V850_OTHER_ERROR 0x80 /* Symbol had an error reported. */ -/* Flags for the st_other field */ -#define V850_OTHER_SDA 0x01 /* symbol had SDA relocations */ -#define V850_OTHER_ZDA 0x02 /* symbol had ZDA relocations */ -#define V850_OTHER_TDA 0x04 /* symbol had TDA relocations */ -#define V850_OTHER_TDA_BYTE 0x08 /* symbol had TDA byte relocations */ -#define V850_OTHER_ERROR 0x80 /* symbol had an error reported */ - -/* V850 relocations */ +/* V850 relocations. */ #include "elf/reloc-macros.h" START_RELOC_NUMBERS (v850_reloc_type) @@ -75,6 +72,9 @@ START_RELOC_NUMBERS (v850_reloc_type) RELOC_NUMBER( R_V850_CALLT_16_16_OFFSET, 22) /* For callt */ RELOC_NUMBER (R_V850_GNU_VTINHERIT, 23) RELOC_NUMBER (R_V850_GNU_VTENTRY, 24) + RELOC_NUMBER (R_V850_LONGCALL, 25) + RELOC_NUMBER (R_V850_LONGJUMP, 26) + RELOC_NUMBER (R_V850_ALIGN, 27) END_RELOC_NUMBERS (R_V850_max) @@ -103,5 +103,4 @@ END_RELOC_NUMBERS (R_V850_max) /* Section contains the .scommon data. */ #define SHT_V850_ZCOMMON 0x70000002 - #endif /* _ELF_V850_H */ diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 385b1915298..b950eefc368 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,24 @@ +2002-08-19 Elena Zannoni + + From matthew green + + * ppc.h (PPC_OPCODE_SPE): New opcode flag for Powerpc e500 + instructions. + (PPC_OPCODE_ISEL, PPC_OPCODE_BRLOCK, PPC_OPCODE_PMR, + PPC_OPCODE_CACHELCK, PPC_OPCODE_RFMCI): New opcode flags for the + e500x2 Integer select, branch locking, performance monitor, + cache locking and machine check APUs, respectively. + (PPC_OPCODE_EFS): New opcode type for efs* instructions. + (PPC_OPCODE_CLASSIC): New opcode type for Classic PowerPC instructions. + +2002-08-13 Stephane Carrez + + * m68hc11.h (M6812_OP_PAGE): Define to identify call operand. + (M68HC12_BANK_VIRT, M68HC12_BANK_MASK, M68HC12_BANK_BASE, + M68HC12_BANK_SHIFT, M68HC12_BANK_PAGE_MASK): Define for 68HC12 + memory banks. + (M6811_OC1M5, M6811_OC1M4, M6811_MODF): Fix value. + 2002-07-09 Thiemo Seufer * mips.h (INSN_MIPS16): New define. diff --git a/include/opcode/m68hc11.h b/include/opcode/m68hc11.h index 52a24613078..a538026f84a 100644 --- a/include/opcode/m68hc11.h +++ b/include/opcode/m68hc11.h @@ -1,6 +1,6 @@ /* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table - Copyright 1999, 2000 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -191,7 +191,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * /* Flags of the SPSR register. */ #define M6811_SPIF 0x80 /* SPI Transfer Complete flag */ #define M6811_WCOL 0x40 /* Write Collision */ -#define M6811_MODF 0x20 /* Mode Fault */ +#define M6811_MODF 0x10 /* Mode Fault */ /* Flags of the ADCTL register. */ #define M6811_CCF 0x80 /* Conversions Complete Flag */ @@ -212,8 +212,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * /* Flags of the OC1M register. */ #define M6811_OC1M7 0x80 /* Output Compare 7 */ #define M6811_OC1M6 0x40 /* 6 */ -#define M6811_OC1M5 0x40 /* 5 */ -#define M6811_OC1M4 0x40 /* 4 */ +#define M6811_OC1M5 0x20 /* 5 */ +#define M6811_OC1M4 0x10 /* 4 */ #define M6811_OC1M3 0x08 /* 3 */ /* Flags of the OC1D register. */ @@ -341,7 +341,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * #define M6812_OP_IDX_2 0x0800 /* N,r N:16-bits */ #define M6812_OP_D_IDX 0x1000 /* Indirect indexed: [D,r] */ #define M6812_OP_D_IDX_2 0x2000 /* [N,r] N:16-bits */ -#define M6811_OP_MASK 0x0FFFF +#define M6812_OP_PAGE 0x4000 /* Page number */ +#define M6811_OP_MASK 0x07FFF +#define M6811_OP_BRANCH 0x00008000 /* Branch, jsr, call */ #define M6811_OP_BITMASK 0x00010000 /* Bitmask: # */ #define M6811_OP_JUMP_REL 0x00020000 /* Pc-Relative: */ #define M6812_OP_JUMP_REL16 0x00040000 /* Pc-relative: */ @@ -376,6 +378,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * #define M6811_OP_HIGH_ADDR 0x01000000 /* Used internally by gas. */ #define M6811_OP_LOW_ADDR 0x02000000 +#define M68HC12_BANK_VIRT 0x01000000 +#define M68HC12_BANK_MASK 0x00003fff +#define M68HC12_BANK_BASE 0x00008000 +#define M68HC12_BANK_SHIFT 14 +#define M68HC12_BANK_PAGE_MASK 0x0ff + + /* CPU identification. */ #define cpu6811 0x01 #define cpu6812 0x02 diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h index f7db66f63a8..ffd313acd52 100644 --- a/include/opcode/ppc.h +++ b/include/opcode/ppc.h @@ -107,6 +107,30 @@ extern const int powerpc_num_opcodes; /* Opcode isn't supported by Power4 architecture. */ #define PPC_OPCODE_NOPOWER4 (040000) +/* Opcode is only supported by POWERPC Classic architecture. */ +#define PPC_OPCODE_CLASSIC (0100000) + +/* Opcode is only supported by e500x2 Core. */ +#define PPC_OPCODE_SPE (0200000) + +/* Opcode is supported by e500x2 Integer select APU. */ +#define PPC_OPCODE_ISEL (0400000) + +/* Opcode is an e500 SPE floating point instruction. */ +#define PPC_OPCODE_EFS (01000000) + +/* Opcode is supported by branch locking APU. */ +#define PPC_OPCODE_BRLOCK (02000000) + +/* Opcode is supported by performance monitor APU. */ +#define PPC_OPCODE_PMR (04000000) + +/* Opcode is supported by cache locking APU. */ +#define PPC_OPCODE_CACHELCK (010000000) + +/* Opcode is supported by machine check APU. */ +#define PPC_OPCODE_RFMCI (020000000) + /* A macro to extract the major opcode from an instruction. */ #define PPC_OP(i) (((i) >> 26) & 0x3f) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index eb229bf9191..7fd83af1707 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,126 @@ +2002-08-28 Svein E. Seldal + + * configure.in: Added bfd_tic4x_arch. + * configure: Regenerate. + * Makefile.am: Added tic4x-dis.o target. + * Makefile.in: Regenerate. + +2002-08-28 Michael Hayes + + * disassemble.c: Added tic4x target and c4x + disassembler routine. + * tic4x-dis.c: New file. + +2002-08-16 Christian Groessler + + * z8k-dis.c (unparse_instr): case CLASS_BA: Designate hex + values as those. + * z8kgen.c (opt): Fix definition of "in rd,imm16" opcode. + * z8k-opc.h: Regenerated with new z8kgen.c. + +2002-08-19 Elena Zannoni + + From matthew green + + * ppc-dis.c (powerpc_dialect): Support `-m500', `-m500x2' and + `-mefs'. Turn off AltiVec for E500 and efs. + (print_insn_powerpc): Don't print an AltiVec instruction if the + dialect is not efs. + + * ppc-opc.c (insert_pmrn, extract_pmrn, insert_ev2, extract_ev2, + insert_ev4, extract_ev4, insert_ev8, extract_ev8): New functions + for extracting pmrn/evld/evstd/etc operands. + (CRB, CRFD, CRFS, DC, RD): New instruction fields. + (CT): Make this equal to RD + 1. + (PMRN): New operand. + (RA): Update. + (EVUIMM, EVUIMM_2, EVUIMM_4, EVUIMM_8): New operands. + (WS): Update. + (EVSEL, EVSEL_MASK): New instruction form and mask for EVSEL. + (ISEL, ISEL_MASK): New instruction form and mask for ISEL. + (XISEL, XISEL_MASK): New instruction form and mask for ISEL. + (CTX, CTX_MASK): New instruction form and mask for context cache + instructions. + (UCTX, UCTX_MASK): New instruction form and mask for user context + cache instructions. + (XC, XC_MASK, XUC, XUC_MASK): New instruction forms. + (CLASSIC): New define. + (PPCESPE): New define. + (PPCISEL, , PPCBRLK, PPCPMR, PPCCHLK, PPCRFMI): New + defines for integer select, cache control, branch + locking, power management, cache locking and machine check + APU instructions, respectively. + (efsabs, efsnabs, efsneg, efsadd, efssub, efsmul, + efsdiv, efscmpgt, efscmplt, efscmpeq, efststgt, efststlt, + efststeq, efscfui, efsctuiz, efscfsi, efscfuf, efscfsf, + efsctui, efsctsi, efsctsiz, efsctuf, efsctsf, + evaddw, evaddiw, evsubfw, evsubifw, evabs, evneg, evextsb, + evextsh, evrndw, evcntlzw, evcntlsw, brinc, evand, evandc, evor, + evorc, evxor, eveqv, evnand, evnor, evrlw, evrlwi, evslw, evslwi, + evsrws, evsrwu, evsrwis, evsrwiu, evsplati, evsplatfi, evmergehi, + evmergelo, evmergehilo, evmergelohi, evcmpgts, evcmpgtu, evcmplts, + evcmpltu, evcmpeq, evsel, evldd, evlddx, evldw, evldwx, evldh, + evldhx, evlwhe, evlwhex, evlwhou, evlwhoux, evlwhos, evlwhosx, + evlwwsplat, evlwwsplatx, evlwhsplat, evlwhsplatx, evlhhesplat, + evlhhesplatx, evlhousplat, evlhousplatx, evlhossplat, evlhossplatx, + evstdd, evstddx, evstdw, evstdwx, evstdh, evstdhx, evstwwe, + evstwwex, evstwwo, evstwwox, evstwhe, evstwhex, evstwho, evstwhox, + evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul, evfsdiv, + evfscmpgt, evfscmplt, evfscmpeq, evfststgt, evfststlt, evfststeq, + evfscfui, evfsctuiz, evfscfsi, evfscfuf, evfscfsf, evfsctui, + evfsctsi, evfsctsiz, evfsctuf, evfsctsf, evsabs, evsnabs, evsneg, + evsadd, evssub, evsmul, evsdiv, evscmpgt, evsgmplt, evsgmpeq, + evststgt, evststlt, evststeq, evscfui, evscfsi, evscfuf, evscfsf, + evsctui, evsctuiz, evsctsi, evsctsiz, evsctuf, evsctsf, evmhossf, + evmhossfa, evmhosmf, evmhosmfa, evmhosmi, evmhosmia, evmhoumi, + evmhoumia, evmhessf, evmhessfa, evmhesmf, evmhesmfa, evmhesmi, + evmhesmia, evmheumi, evmheumia, evmhossfaaw, evmhossiaaw, + evmhosmfaaw, evmhosmiaaw, evmhousiaaw, evmhoumiaaw, evmhessfaaw, + evmhessiaaw, evmhesmfaaw, evmhesmiaaw, evmheusiaaw, evmheumiaaw, + evmhossfanw, evmhossianw, evmhosmfanw, evmhosmianw, evmhousianw, + evmhoumianw, evmhessfanw, evmhessianw, evmhesmfanw, evmhesmianw, + evmheusianw, evmheumianw, evmhogsmfaa, evmhogsmiaa, evmhogumiaa, + evmhegsmfaa, evmhegsmiaa, evmhegumiaa, evmhogsmfan, evmhogsmian, + evmhogumian, evmhegsmfan, evmhegsmian, evmhegumian, evmwhssf, + evmwhssfa, evmwhssfaa, evmwhssmaa, evmwhsmfaa, evmwhsmiaa, + evmwhusiaa, evmwhumiaa, evmwhssfan, evmwhssian, evmwhsmfan, + evmwhsmian, evmwhusian, evmwhumian, evmwhgssfaa, evmwhgsmfaa, + evmwhgsmiaa, evmwhgumiaa, evmwhgssfan, evmwhgsmfan, evmwhgsmian, + evmwhgumian, evmwhsmf, evmwhsmfa, evmshsmi, evmshsmia, evmshumi, + evmshumia, evmmlssf, evmmlssfa, evmwlsmf, evmwlsmfa, evmwlumi, + evmwlumia, evmwlssfaaw, evmwlssiaaw, evmwlsmfaaw, evmwlsmiaaw, + evmwlusiaaw, evmwlumiaaw, evmwissfanw, evmwissianw, evmwlsmfanw, + evmwlsmianw, evmwlusianw, evmwlumianw, evmwssf, evmwssfa, + evmwsmf, evmwsmfa, evmwsmi, evmwsmia, evmwumi, evmwumia, + evmwssfaa, evmwsmfaa, evmwsmiaa, evmwumiaa, evmwssfan, evmwsmfan, + evmwsmian, evmwumian, evaddssiaaw, evaddsmiaaw, evaddusiaaw, + evaddumiaaw, evsubfssiaaw, evsubfsmiaaw, evsubfusiaaw, + evsubfumiaaw, evmra, evdivws, evdivws): New e500x2 Core Complex + instructions. + (rfmci): New machine check APU instruction. + (isel): New integer select APU instructino. + (icbtls, icbtlse, icblc, icblce, dcbtls, dcbtlse, dcbtstls, + dcbtstlse, dcblc, dcblce): New cache control APU instructions. + (mtspefscr, mfspefscr): New instructions. + (mfpmr, mtpmr): New performance monitor APU instructions. + (savecontext): New context cache APU instructions. + (bblels, bbelr): New branch locking APU instructions. + (bblels, bbelr): New instructions. + (mftbl, mftbu, mftb): Set as CLASSIC instructions. Add BOOKE alias. + +2002-08-13 Stephane Carrez + + * m68hc11-opc.c: Update call operand to accept the page definition. + Identify instructions that are branches and calls to generate a + RL_JUMP relocation. + +2002-08-13 Stephane Carrez + + * m68hc11-dis.c (print_insn): Take into account 68HC12 memory + banks and fix disassembling of call instruction. + (print_indexed_operand): New param to tell whether + it was an indirect addressing operand (for disassembling call). + 2002-08-09 Nick Clifton * po/sv.po: Updated Swedish translation. diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index d2f043cf7d7..d2c21434f00 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -140,6 +140,7 @@ CFILES = \ sparc-dis.c \ sparc-opc.c \ tic30-dis.c \ + tic4x-dis.c \ tic54x-dis.c \ tic54x-opc.c \ tic80-dis.c \ @@ -243,6 +244,7 @@ ALL_MACHINES = \ sparc-dis.lo \ sparc-opc.lo \ tic30-dis.lo \ + tic4x-dis.lo \ tic54x-dis.lo \ tic54x-opc.lo \ tic80-dis.lo \ @@ -721,6 +723,8 @@ sparc-opc.lo: sparc-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/sparc.h tic30-dis.lo: tic30-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/tic30.h +tic4x-dis.lo: tic4x-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/tic4x.h tic54x-dis.lo: tic54x-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/tic54x.h \ $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index c2a5c5afc5e..634161834a3 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -251,6 +251,7 @@ CFILES = \ sparc-dis.c \ sparc-opc.c \ tic30-dis.c \ + tic4x-dis.c \ tic54x-dis.c \ tic54x-opc.c \ tic80-dis.c \ @@ -355,6 +356,7 @@ ALL_MACHINES = \ sparc-dis.lo \ sparc-opc.lo \ tic30-dis.lo \ + tic4x-dis.lo \ tic54x-dis.lo \ tic54x-opc.lo \ tic80-dis.lo \ @@ -447,7 +449,7 @@ acinclude.m4 aclocal.m4 config.in configure configure.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES) OBJECTS = libopcodes.a.$(OBJEXT) $(libopcodes_la_OBJECTS) @@ -1217,6 +1219,8 @@ sparc-opc.lo: sparc-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/sparc.h tic30-dis.lo: tic30-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/tic30.h +tic4x-dis.lo: tic4x-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/tic4x.h tic54x-dis.lo: tic54x-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/tic54x.h \ $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h diff --git a/opcodes/configure b/opcodes/configure index 9b6992b1fca..6825a0b020b 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -4654,6 +4654,7 @@ if test x${all_targets} = xfalse ; then bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;; bfd_tahoe_arch) ;; bfd_tic30_arch) ta="$ta tic30-dis.lo" ;; + bfd_tic4x_arch) ta="$ta tic4x-dis.lo" ;; bfd_tic54x_arch) ta="$ta tic54x-dis.lo tic54x-opc.lo" ;; bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;; bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; diff --git a/opcodes/configure.in b/opcodes/configure.in index 3ce5e379218..0e5eb6f5fb4 100644 --- a/opcodes/configure.in +++ b/opcodes/configure.in @@ -229,6 +229,7 @@ if test x${all_targets} = xfalse ; then bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;; bfd_tahoe_arch) ;; bfd_tic30_arch) ta="$ta tic30-dis.lo" ;; + bfd_tic4x_arch) ta="$ta tic4x-dis.lo" ;; bfd_tic54x_arch) ta="$ta tic54x-dis.lo tic54x-opc.lo" ;; bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;; bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index 88fa63573a6..4d78a73b403 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -60,6 +60,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARCH_sh #define ARCH_sparc #define ARCH_tic30 +#define ARCH_tic4x #define ARCH_tic54x #define ARCH_tic80 #define ARCH_v850 @@ -305,6 +306,11 @@ disassembler (abfd) disassemble = print_insn_tic30; break; #endif +#ifdef ARCH_tic4x + case bfd_arch_tic4x: + disassemble = print_insn_tic4x; + break; +#endif #ifdef ARCH_tic54x case bfd_arch_tic54x: disassemble = print_insn_tic54x; diff --git a/opcodes/m68hc11-dis.c b/opcodes/m68hc11-dis.c index bb0cc207d4d..c721d16e0c4 100644 --- a/opcodes/m68hc11-dis.c +++ b/opcodes/m68hc11-dis.c @@ -1,6 +1,6 @@ /* m68hc11-dis.c -- Motorola 68HC11 & 68HC12 disassembly - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@nerim.fr) 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 @@ -40,7 +40,7 @@ static const char *const reg_dst_table[] = { static int read_memory PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *)); static int print_indexed_operand - PARAMS ((bfd_vma, struct disassemble_info *, int)); + PARAMS ((bfd_vma, struct disassemble_info *, int*, int)); static int print_insn PARAMS ((bfd_vma, struct disassemble_info *, int)); @@ -68,9 +68,10 @@ read_memory (memaddr, buffer, size, info) /* Read the 68HC12 indexed operand byte and print the corresponding mode. Returns the number of bytes read or -1 if failure. */ static int -print_indexed_operand (memaddr, info, mov_insn) +print_indexed_operand (memaddr, info, indirect, mov_insn) bfd_vma memaddr; struct disassemble_info *info; + int *indirect; int mov_insn; { bfd_byte buffer[4]; @@ -79,6 +80,9 @@ print_indexed_operand (memaddr, info, mov_insn) short sval; int pos = 1; + if (indirect) + *indirect = 0; + status = read_memory (memaddr, &buffer[0], 1, info); if (status != 0) { @@ -140,6 +144,8 @@ print_indexed_operand (memaddr, info, mov_insn) sval = ((buffer[0] << 8) | (buffer[1] & 0x0FF)); (*info->fprintf_func) (info->stream, "[%u,%s]", sval & 0x0ffff, reg_name[reg]); + if (indirect) + *indirect = 1; } else if ((buffer[0] & 0x4) == 0) { @@ -189,6 +195,8 @@ print_indexed_operand (memaddr, info, mov_insn) case 3: default: (*info->fprintf_func) (info->stream, "[D,%s]", reg_name[reg]); + if (indirect) + *indirect = 1; break; } } @@ -440,12 +448,19 @@ print_insn (memaddr, info, arch) /* Analyze the 68HC12 indexed byte. */ if (format & M6812_INDEXED_FLAGS) { - status = print_indexed_operand (memaddr + pos, info, 0); + int indirect; + + status = print_indexed_operand (memaddr + pos, info, &indirect, 0); if (status < 0) { return status; } pos += status; + + /* The indirect addressing mode of the call instruction does + not need the page code. */ + if ((format & M6812_OP_PAGE) && indirect) + format &= ~M6812_OP_PAGE; } /* 68HC12 dbcc/ibcc/tbcc operands. */ @@ -532,6 +547,8 @@ print_insn (memaddr, info, arch) if (format & (M6811_OP_IMM16 | M6811_OP_IND16)) { int val; + bfd_vma addr; + unsigned page = 0; status = read_memory (memaddr + pos + offset, &buffer[0], 2, info); if (status != 0) @@ -546,6 +563,38 @@ print_insn (memaddr, info, arch) val = ((buffer[0] << 8) | (buffer[1] & 0x0FF)); val &= 0x0FFFF; + addr = val; + if (format & M6812_OP_PAGE) + { + status = read_memory (memaddr + pos + offset, buffer, 1, info); + if (status != 0) + return status; + + page = (unsigned) buffer[0]; + if (addr >= M68HC12_BANK_BASE && addr < 0x0c000) + addr = ((val - M68HC12_BANK_BASE) + | (page << M68HC12_BANK_SHIFT)) + + M68HC12_BANK_VIRT; + } + else if ((arch & cpu6812) + && addr >= M68HC12_BANK_BASE && addr < 0x0c000) + { + int cur_page; + bfd_vma vaddr; + + if (memaddr >= M68HC12_BANK_VIRT) + cur_page = ((memaddr - M68HC12_BANK_VIRT) + >> M68HC12_BANK_SHIFT); + else + cur_page = 0; + + vaddr = ((addr - M68HC12_BANK_BASE) + + (cur_page << M68HC12_BANK_SHIFT)) + + M68HC12_BANK_VIRT; + if (!info->symbol_at_address_func (addr, info) + && info->symbol_at_address_func (vaddr, info)) + addr = vaddr; + } if (format & M6811_OP_IMM16) { format &= ~M6811_OP_IMM16; @@ -554,13 +603,21 @@ print_insn (memaddr, info, arch) else format &= ~M6811_OP_IND16; - (*info->print_address_func) (val, info); + (*info->print_address_func) (addr, info); + if (format & M6812_OP_PAGE) + { + (* info->fprintf_func) (info->stream, " {"); + (* info->print_address_func) (val, info); + (* info->fprintf_func) (info->stream, ", %d}", page); + format &= ~M6812_OP_PAGE; + pos += 1; + } } if (format & M6812_OP_IDX_P2) { (*info->fprintf_func) (info->stream, ", "); - status = print_indexed_operand (memaddr + pos + offset, info, 1); + status = print_indexed_operand (memaddr + pos + offset, info, 0, 1); if (status < 0) return status; pos += status; @@ -584,6 +641,21 @@ print_insn (memaddr, info, arch) (*info->print_address_func) (val, info); } + if (format & M6812_OP_PAGE) + { + int val; + + status = read_memory (memaddr + pos + offset, &buffer[0], 1, info); + if (status != 0) + { + return status; + } + pos += 1; + + val = buffer[0] & 0x0ff; + (*info->fprintf_func) (info->stream, ", %d", val); + } + #ifdef DEBUG /* Consistency check. 'format' must be 0, so that we have handled all formats; and the computed size of the insn must match the diff --git a/opcodes/m68hc11-opc.c b/opcodes/m68hc11-opc.c index 1e37971ee81..53cb35852fa 100644 --- a/opcodes/m68hc11-opc.c +++ b/opcodes/m68hc11-opc.c @@ -1,6 +1,6 @@ /* m68hc11-opc.c -- Motorola 68HC11 & 68HC12 opcode list - Copyright 1999, 2000 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -76,6 +76,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define OP_IX M6811_OP_IX #define OP_IY M6811_OP_IY #define OP_IND16 M6811_OP_IND16 +#define OP_PAGE M6812_OP_PAGE #define OP_IDX M6812_OP_IDX #define OP_IDX_1 M6812_OP_IDX_1 #define OP_IDX_2 M6812_OP_IDX_2 @@ -83,8 +84,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define OP_D_IDX_2 M6812_OP_D_IDX_2 #define OP_DIRECT M6811_OP_DIRECT #define OP_BITMASK M6811_OP_BITMASK -#define OP_JUMP_REL M6811_OP_JUMP_REL -#define OP_JUMP_REL16 M6812_OP_JUMP_REL16 +#define OP_BRANCH M6811_OP_BRANCH +#define OP_JUMP_REL (M6811_OP_JUMP_REL|OP_BRANCH) +#define OP_JUMP_REL16 (M6812_OP_JUMP_REL16|OP_BRANCH) #define OP_REG M6812_OP_REG #define OP_REG_1 M6812_OP_REG #define OP_REG_2 M6812_OP_REG_2 @@ -325,12 +327,18 @@ const struct m68hc11_opcode m68hc11_opcodes[] = { { "bvc", OP_JUMP_REL, 2, 0x28, 1, 3, CHG_NONE, cpu6811 | cpu6812 }, { "bvs", OP_JUMP_REL, 2, 0x29, 1, 3, CHG_NONE, cpu6811 | cpu6812 }, - { "call", OP_IND16, 4, 0x4a, 8, 8, CHG_NONE, cpu6812 }, - { "call", OP_IDX, 3, 0x4b, 8, 8, CHG_NONE, cpu6812 }, - { "call", OP_IDX_1, 4, 0x4b, 8, 8, CHG_NONE, cpu6812 }, - { "call", OP_IDX_2, 5, 0x4b, 9, 9, CHG_NONE, cpu6812 }, - { "call", OP_D_IDX, 2, 0x4b, 10, 10, CHG_NONE, cpu6812 }, - { "call", OP_D_IDX_2, 4, 0x4b, 10, 10, CHG_NONE, cpu6812 }, + { "call", OP_IND16 | OP_PAGE + | OP_BRANCH, 4, 0x4a, 8, 8, CHG_NONE, cpu6812 }, + { "call", OP_IDX | OP_PAGE + | OP_BRANCH, 3, 0x4b, 8, 8, CHG_NONE, cpu6812 }, + { "call", OP_IDX_1 | OP_PAGE + | OP_BRANCH, 4, 0x4b, 8, 8, CHG_NONE, cpu6812 }, + { "call", OP_IDX_2 | OP_PAGE + | OP_BRANCH, 5, 0x4b, 9, 9, CHG_NONE, cpu6812 }, + { "call", OP_D_IDX + | OP_BRANCH, 2, 0x4b, 10, 10, CHG_NONE, cpu6812 }, + { "call", OP_D_IDX_2 + | OP_BRANCH, 4, 0x4b, 10, 10, CHG_NONE, cpu6812 }, { "cba", OP_NONE, 1, 0x11, 2, 2, CHG_NZVC, cpu6811 }, { "cba", OP_NONE | OP_PAGE2,2, 0x17, 2, 2, CHG_NZVC, cpu6812 }, @@ -564,22 +572,22 @@ const struct m68hc11_opcode m68hc11_opcodes[] = { { "iny", OP_NONE |OP_PAGE2, 2, 0x08, 4, 4, CHG_Z, cpu6811 }, { "iny", OP_NONE, 1, 0x02, 1, 1, CHG_Z, cpu6812 }, - { "jmp", OP_IND16, 3, 0x7e, 3, 3, CHG_NONE, cpu6811 }, + { "jmp", OP_IND16 | OP_BRANCH, 3, 0x7e, 3, 3, CHG_NONE, cpu6811 }, { "jmp", OP_IX, 2, 0x6e, 3, 3, CHG_NONE, cpu6811 }, { "jmp", OP_IY | OP_PAGE2, 3, 0x6e, 4, 4, CHG_NONE, cpu6811 }, - { "jmp", OP_IND16, 3, 0x06, 3, 3, CHG_NONE, cpu6812 }, + { "jmp", OP_IND16 | OP_BRANCH, 3, 0x06, 3, 3, CHG_NONE, cpu6812 }, { "jmp", OP_IDX, 2, 0x05, 3, 3, CHG_NONE, cpu6812 }, { "jmp", OP_IDX_1, 3, 0x05, 3, 3, CHG_NONE, cpu6812 }, { "jmp", OP_IDX_2, 4, 0x05, 4, 4, CHG_NONE, cpu6812 }, { "jmp", OP_D_IDX, 2, 0x05, 6, 6, CHG_NONE, cpu6812 }, { "jmp", OP_D_IDX_2, 4, 0x05, 6, 6, CHG_NONE, cpu6812 }, - { "jsr", OP_DIRECT, 2, 0x9d, 5, 5, CHG_NONE, cpu6811 }, - { "jsr", OP_IND16, 3, 0xbd, 6, 6, CHG_NONE, cpu6811 }, + { "jsr", OP_DIRECT | OP_BRANCH, 2, 0x9d, 5, 5, CHG_NONE, cpu6811 }, + { "jsr", OP_IND16 | OP_BRANCH, 3, 0xbd, 6, 6, CHG_NONE, cpu6811 }, { "jsr", OP_IX, 2, 0xad, 6, 6, CHG_NONE, cpu6811 }, { "jsr", OP_IY | OP_PAGE2, 3, 0xad, 6, 6, CHG_NONE, cpu6811 }, - { "jsr", OP_DIRECT, 2, 0x17, 4, 4, CHG_NONE, cpu6812 }, - { "jsr", OP_IND16, 3, 0x16, 4, 3, CHG_NONE, cpu6812 }, + { "jsr", OP_DIRECT | OP_BRANCH, 2, 0x17, 4, 4, CHG_NONE, cpu6812 }, + { "jsr", OP_IND16 | OP_BRANCH, 3, 0x16, 4, 3, CHG_NONE, cpu6812 }, { "jsr", OP_IDX, 2, 0x15, 4, 4, CHG_NONE, cpu6812 }, { "jsr", OP_IDX_1, 3, 0x15, 4, 4, CHG_NONE, cpu6812 }, { "jsr", OP_IDX_2, 4, 0x15, 5, 5, CHG_NONE, cpu6812 }, diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index 0ac8275af22..bd4dfaca6de 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -53,7 +53,29 @@ powerpc_dialect(info) || strcmp (info->disassembler_options, "booke64") == 0)) dialect |= PPC_OPCODE_BOOKE | PPC_OPCODE_BOOKE64; else - dialect |= PPC_OPCODE_403 | PPC_OPCODE_601; + if ((info->mach == bfd_mach_ppc_e500) + || (info->disassembler_options + && ( strcmp (info->disassembler_options, "e500") == 0 + || strcmp (info->disassembler_options, "e500x2") == 0))) + { + dialect |= PPC_OPCODE_BOOKE + | PPC_OPCODE_SPE | PPC_OPCODE_ISEL + | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK + | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK + | PPC_OPCODE_RFMCI; + /* efs* and AltiVec conflict. */ + dialect &= ~PPC_OPCODE_ALTIVEC; + } + else + if (info->disassembler_options + && (strcmp (info->disassembler_options, "efs") == 0)) + { + dialect |= PPC_OPCODE_EFS; + /* efs* and AltiVec conflict. */ + dialect &= ~PPC_OPCODE_ALTIVEC; + } + else + dialect |= PPC_OPCODE_403 | PPC_OPCODE_601 | PPC_OPCODE_COMMON; if (info->disassembler_options && strcmp (info->disassembler_options, "power4") == 0) @@ -153,6 +175,9 @@ print_insn_powerpc (memaddr, info, bigendian, dialect) || (opcode->flags & dialect) == 0) continue; + if ((dialect & PPC_OPCODE_EFS) && (opcode->flags & PPC_OPCODE_ALTIVEC)) + continue; + /* Make two passes over the operands. First see if any of them have extraction functions, and, if they do, make sure the instruction is valid. */ diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c index 70167f7e9cb..9ba4e25ee09 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -100,6 +100,10 @@ static unsigned long insert_nsi PARAMS ((unsigned long, long, int, const char **)); static long extract_nsi PARAMS ((unsigned long, int, int *)); +static unsigned long insert_pmrn + PARAMS ((unsigned long, long, int, const char **)); +static long extract_pmrn + PARAMS ((unsigned long, int, int *)); static unsigned long insert_ral PARAMS ((unsigned long, long, int, const char **)); static unsigned long insert_ram @@ -122,6 +126,18 @@ static unsigned long insert_tbr PARAMS ((unsigned long, long, int, const char **)); static long extract_tbr PARAMS ((unsigned long, int, int *)); +static unsigned long insert_ev2 + PARAMS ((unsigned long, long, int, const char **)); +static long extract_ev2 + PARAMS ((unsigned long, int, int *)); +static unsigned long insert_ev4 + PARAMS ((unsigned long, long, int, const char **)); +static long extract_ev4 + PARAMS ((unsigned long, int, int *)); +static unsigned long insert_ev8 + PARAMS ((unsigned long, long, int, const char **)); +static long extract_ev8 + PARAMS ((unsigned long, int, int *)); /* The operands table. @@ -235,8 +251,21 @@ const struct powerpc_operand powerpc_operands[] = #define CR BT + 1 { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, + /* The CRB field in an X form instruction. */ +#define CRB CR + 1 + { 5, 6, 0, 0, 0 }, + + /* The CRFD field in an X form instruction. */ +#define CRFD CRB + 1 + { 3, 23, 0, 0, 0 }, + + /* The CRFS field in an X form instruction. */ +#define CRFS CRFD + 1 + { 3, 0, 0, 0, 0 }, + /* The CT field in an X form instruction. */ -#define CT CR + 1 +#define CT CRFS + 1 +#define RD CT { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL }, /* The D field in a D form instruction. This is a displacement off @@ -365,8 +394,12 @@ const struct powerpc_operand powerpc_operands[] = { 16, 0, insert_nsi, extract_nsi, PPC_OPERAND_NEGATIVE | PPC_OPERAND_SIGNED }, + /* The PMRN field in an X form instruction. */ +#define PMRN NSI + 1 + { 16, 0, insert_pmrn, extract_pmrn, PPC_OPERAND_GPR }, + /* The RA field in an D, DS, X, XO, M, or MDS form instruction. */ -#define RA NSI + 1 +#define RA PMRN + 1 #define RA_MASK (0x1f << 16) { 5, 16, 0, 0, PPC_OPERAND_GPR }, @@ -505,8 +538,24 @@ const struct powerpc_operand powerpc_operands[] = #define SHB UIMM + 1 { 4, 6, 0, 0, 0 }, + /* The other UIMM field in a EVX form instruction. */ +#define EVUIMM SHB + 1 + { 5, 11, 0, 0, 0 }, + + /* The other UIMM field in a half word EVX form instruction. */ +#define EVUIMM_2 EVUIMM + 1 + { 5, 11, insert_ev2, extract_ev2, PPC_OPERAND_PARENS }, + + /* The other UIMM field in a word EVX form instruction. */ +#define EVUIMM_4 EVUIMM_2 + 1 + { 5, 11, insert_ev4, extract_ev4, PPC_OPERAND_PARENS }, + + /* The other UIMM field in a double EVX form instruction. */ +#define EVUIMM_8 EVUIMM_4 + 1 + { 8, 11, insert_ev8, extract_ev8, PPC_OPERAND_PARENS }, + /* The WS field. */ -#define WS SHB + 1 +#define WS EVUIMM_8 + 1 #define WS_MASK (0x7 << 11) { 3, 11, 0, 0, 0 }, @@ -829,6 +878,75 @@ extract_boe (insn, dialect, invalid) return value & 0x1e; } +static unsigned long +insert_ev2 (insn, value, dialect, errmsg) + unsigned long insn; + long value; + int dialect ATTRIBUTE_UNUSED; + const char ** errmsg ATTRIBUTE_UNUSED; +{ + if ((value & 1) != 0 && errmsg != NULL) + *errmsg = _("offset not a multiple of 2"); + if ((value > 62) != 0 && errmsg != NULL) + *errmsg = _("offset greater than 62"); + return insn | ((value & 0xf8) << 8); +} + +static long +extract_ev2 (insn, dialect, invalid) + unsigned long insn; + int dialect ATTRIBUTE_UNUSED; + int * invalid ATTRIBUTE_UNUSED; +{ + return (insn >> 8) & 0xf8; +} + +static unsigned long +insert_ev4 (insn, value, dialect, errmsg) + unsigned long insn; + long value; + int dialect ATTRIBUTE_UNUSED; + const char ** errmsg ATTRIBUTE_UNUSED; +{ + if ((value & 3) != 0 && errmsg != NULL) + *errmsg = _("offset not a multiple of 4"); + if ((value > 124) != 0 && errmsg != NULL) + *errmsg = _("offset greater than 124"); + return insn | ((value & 0xf8) << 8); +} + +static long +extract_ev4 (insn, dialect, invalid) + unsigned long insn; + int dialect ATTRIBUTE_UNUSED; + int * invalid ATTRIBUTE_UNUSED; +{ + return (insn >> 8) & 0xf8; +} + +static unsigned long +insert_ev8 (insn, value, dialect, errmsg) + unsigned long insn; + long value; + int dialect ATTRIBUTE_UNUSED; + const char ** errmsg ATTRIBUTE_UNUSED; +{ + if ((value & 7) != 0 && errmsg != NULL) + *errmsg = _("offset not a multiple of 8"); + if ((value > 248) != 0 && errmsg != NULL) + *errmsg = _("offset greater than 248"); + return insn | ((value & 0xf8) << 8); +} + +static long +extract_ev8 (insn, dialect, invalid) + unsigned long insn; + int dialect ATTRIBUTE_UNUSED; + int * invalid ATTRIBUTE_UNUSED; +{ + return (insn >> 8) & 0xf8; +} + /* The DS field in a DS form instruction. This is like D, but the lower two bits are forced to zero. */ @@ -1111,6 +1229,28 @@ extract_nsi (insn, dialect, invalid) return - (((insn & 0xffff) ^ 0x8000) - 0x8000); } +/* The PMRN field in a X form instruction. + This has 5+5 bits switched around. */ + +static unsigned long +insert_pmrn (insn, value, dialect, errmsg) + unsigned long insn; + long value; + int dialect ATTRIBUTE_UNUSED; + const char **errmsg ATTRIBUTE_UNUSED; +{ + return insn | ((value & 0x1f) << 16) | ((value & 0x3e) << 11); +} + +static long +extract_pmrn (insn, dialect, invalid) + unsigned long insn; + int dialect ATTRIBUTE_UNUSED; + int *invalid ATTRIBUTE_UNUSED; +{ + return ((insn >> 16) & 0x1f) | ((insn >> 11) & 0x3e); +} + /* The RA field in a D or X form instruction which is an updating load, which means that the RA field may not be zero and may not equal the RT field. */ @@ -1332,6 +1472,14 @@ extract_tbr (insn, dialect, invalid) #define BBOYBI_MASK (BBOYCB_MASK | BI_MASK) #define BBOATBI_MASK (BBOAT2CB_MASK | BI_MASK) +/* An Context form instruction. */ +#define CTX(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x7)) +#define CTX_MASK CTX(0x3f, 0x7) + +/* An User Context form instruction. */ +#define UCTX(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x1f)) +#define UCTX_MASK UCTX(0x3f, 0x1f) + /* The main opcode mask with the RA field clear. */ #define DRA_MASK (OP_MASK | RA_MASK) @@ -1343,6 +1491,10 @@ extract_tbr (insn, dialect, invalid) #define DEO(op, xop) (OP (op) | ((xop) & 0xf)) #define DE_MASK DEO (0x3e, 0xf) +/* An EVSEL form instruction. */ +#define EVSEL(op, xop) (OP (op) | (((unsigned long)(xop)) & 0xff) << 3) +#define EVSEL_MASK EVSEL(0x3f, 0xff) + /* An M form instruction. */ #define M(op, rc) (OP (op) | ((rc) & 1)) #define M_MASK M (0x3f, 1) @@ -1457,6 +1609,10 @@ extract_tbr (insn, dialect, invalid) #define XFL(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | (((unsigned long)(rc)) & 1)) #define XFL_MASK (XFL (0x3f, 0x3ff, 1) | (((unsigned long)1) << 25) | (((unsigned long)1) << 16)) +/* An X form isel instruction. */ +#define XISEL(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1)) +#define XISEL_MASK XISEL(0x3f, 0x1f) + /* An XL form instruction with the LK field set to 0. */ #define XL(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1)) @@ -1528,6 +1684,10 @@ extract_tbr (insn, dialect, invalid) /* An X form instruction with everything filled in except the E field. */ #define XE_MASK (0xffff7fff) +/* An X form user context instruction. */ +#define XUC(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x1f)) +#define XUC_MASK XUC(0x3f, 0x1f) + /* The BO encodings used in extended conditional branch mnemonics. */ #define BODNZF (0x0) #define BODNZFP (0x1) @@ -1609,6 +1769,14 @@ extract_tbr (insn, dialect, invalid) #define MFDEC2 PPC_OPCODE_PPC | PPC_OPCODE_601 #define BOOKE PPC_OPCODE_BOOKE #define BOOKE64 PPC_OPCODE_BOOKE64 +#define CLASSIC PPC_OPCODE_CLASSIC +#define PPCSPE PPC_OPCODE_SPE +#define PPCISEL PPC_OPCODE_ISEL +#define PPCEFS PPC_OPCODE_EFS +#define PPCBRLK PPC_OPCODE_BRLOCK +#define PPCPMR PPC_OPCODE_PMR +#define PPCCHLK PPC_OPCODE_CACHELCK +#define PPCRFMCI PPC_OPCODE_RFMCI /* The opcode table. @@ -1918,6 +2086,306 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "vupklsh", VX(4, 718), VX_MASK, PPCVEC, { VD, VB } }, { "vxor", VX(4, 1220), VX_MASK, PPCVEC, { VD, VA, VB } }, +{ "evaddw", VX(4, 512), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evaddiw", VX(4, 514), VX_MASK, PPCSPE, { RD, RB, UIMM } }, +{ "evsubfw", VX(4, 516), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evsubifw", VX(4, 518), VX_MASK, PPCSPE, { RD, UIMM, RB } }, +{ "evabs", VX(4, 520), VX_MASK, PPCSPE, { RD, RA } }, +{ "evneg", VX(4, 521), VX_MASK, PPCSPE, { RD, RA } }, +{ "evextsb", VX(4, 522), VX_MASK, PPCSPE, { RD, RA } }, +{ "evextsh", VX(4, 523), VX_MASK, PPCSPE, { RD, RA } }, +{ "evrndw", VX(4, 524), VX_MASK, PPCSPE, { RD, RA } }, +{ "evcntlzw", VX(4, 525), VX_MASK, PPCSPE, { RD, RA } }, +{ "evcntlsw", VX(4, 526), VX_MASK, PPCSPE, { RD, RA } }, + +{ "brinc", VX(4, 527), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evand", VX(4, 529), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evandc", VX(4, 530), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evor", VX(4, 535), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evorc", VX(4, 539), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evxor", VX(4, 534), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "eveqv", VX(4, 537), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evnand", VX(4, 542), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evnor", VX(4, 536), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evrlw", VX(4, 552), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evrlwi", VX(4, 554), VX_MASK, PPCSPE, { RD, RA, EVUIMM } }, +{ "evslw", VX(4, 548), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evslwi", VX(4, 550), VX_MASK, PPCSPE, { RD, RA, EVUIMM } }, +{ "evsrws", VX(4, 545), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evsrwu", VX(4, 544), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evsrwis", VX(4, 547), VX_MASK, PPCSPE, { RD, RA, EVUIMM } }, +{ "evsrwiu", VX(4, 546), VX_MASK, PPCSPE, { RD, RA, EVUIMM } }, +{ "evsplati", VX(4, 553), VX_MASK, PPCSPE, { RD, SIMM } }, +{ "evsplatfi", VX(4, 555), VX_MASK, PPCSPE, { RD, SIMM } }, +{ "evmergehi", VX(4, 556), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmergelo", VX(4, 557), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmergehilo",VX(4,558), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmergelohi",VX(4,559), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evcmpgts", VX(4, 561), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evcmpgtu", VX(4, 560), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evcmplts", VX(4, 563), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evcmpltu", VX(4, 562), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evcmpeq", VX(4, 564), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evsel", EVSEL(4,79),EVSEL_MASK, PPCSPE, { RD, RA, RB, CRFS } }, + +{ "evldd", VX(4, 769), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evlddx", VX(4, 768), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evldw", VX(4, 771), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evldwx", VX(4, 770), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evldh", VX(4, 773), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evldhx", VX(4, 772), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlwhe", VX(4, 785), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evlwhex", VX(4, 784), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlwhou", VX(4, 789), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evlwhoux", VX(4, 788), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlwhos", VX(4, 791), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evlwhosx", VX(4, 790), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlwwsplat",VX(4, 793), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evlwwsplatx",VX(4, 792), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlwhsplat",VX(4, 797), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evlwhsplatx",VX(4, 796), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlhhesplat",VX(4, 777), VX_MASK, PPCSPE, { RS, EVUIMM_2, RA } }, +{ "evlhhesplatx",VX(4, 776), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlhhousplat",VX(4, 781), VX_MASK, PPCSPE, { RS, EVUIMM_2, RA } }, +{ "evlhhousplatx",VX(4, 780), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evlhhossplat",VX(4, 783), VX_MASK, PPCSPE, { RS, EVUIMM_2, RA } }, +{ "evlhhossplatx",VX(4, 782), VX_MASK, PPCSPE, { RS, RA, RB } }, + +{ "evstdd", VX(4, 801), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evstddx", VX(4, 800), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstdw", VX(4, 803), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evstdwx", VX(4, 802), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstdh", VX(4, 805), VX_MASK, PPCSPE, { RS, EVUIMM_8, RA } }, +{ "evstdhx", VX(4, 804), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstwwe", VX(4, 825), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evstwwex", VX(4, 824), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstwwo", VX(4, 829), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evstwwox", VX(4, 828), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstwhe", VX(4, 817), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evstwhex", VX(4, 816), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "evstwho", VX(4, 821), VX_MASK, PPCSPE, { RS, EVUIMM_4, RA } }, +{ "evstwhox", VX(4, 820), VX_MASK, PPCSPE, { RS, RA, RB } }, + +{ "evfsabs", VX(4, 644), VX_MASK, PPCSPE, { RD, RA } }, +{ "evfsnabs", VX(4, 645), VX_MASK, PPCSPE, { RD, RA } }, +{ "evfsneg", VX(4, 656), VX_MASK, PPCSPE, { RD, RA } }, +{ "evfsadd", VX(4, 640), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evfssub", VX(4, 641), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evfsmul", VX(4, 648), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evfsdiv", VX(4, 649), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evfscmpgt", VX(4, 652), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfscmplt", VX(4, 653), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfscmpeq", VX(4, 654), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfststgt", VX(4, 668), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfststlt", VX(4, 669), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfststeq", VX(4, 670), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evfscfui", VX(4, 656), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctuiz", VX(4, 664), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfscfsi", VX(4, 657), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfscfuf", VX(4, 658), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfscfsf", VX(4, 659), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctui", VX(4, 660), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctsi", VX(4, 661), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctsiz", VX(4, 666), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctuf", VX(4, 662), VX_MASK, PPCSPE, { RD, RB } }, +{ "evfsctsf", VX(4, 663), VX_MASK, PPCSPE, { RD, RB } }, + +{ "efsabs", VX(4, 708), VX_MASK, PPCEFS, { RD, RA } }, +{ "efsnabs", VX(4, 709), VX_MASK, PPCEFS, { RD, RA } }, +{ "efsneg", VX(4, 710), VX_MASK, PPCEFS, { RD, RA } }, +{ "efsadd", VX(4, 704), VX_MASK, PPCEFS, { RD, RA, RB } }, +{ "efssub", VX(4, 705), VX_MASK, PPCEFS, { RD, RA, RB } }, +{ "efsmul", VX(4, 712), VX_MASK, PPCEFS, { RD, RA, RB } }, +{ "efsdiv", VX(4, 713), VX_MASK, PPCEFS, { RD, RA, RB } }, +{ "efscmpgt", VX(4, 716), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efscmplt", VX(4, 717), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efscmpeq", VX(4, 718), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efststgt", VX(4, 732), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efststlt", VX(4, 733), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efststeq", VX(4, 734), VX_MASK, PPCEFS, { CRFD, RA, RB } }, +{ "efscfui", VX(4, 720), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctuiz", VX(4, 728), VX_MASK, PPCEFS, { RD, RB } }, +{ "efscfsi", VX(4, 721), VX_MASK, PPCEFS, { RD, RB } }, +{ "efscfuf", VX(4, 722), VX_MASK, PPCEFS, { RD, RB } }, +{ "efscfsf", VX(4, 723), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctui", VX(4, 724), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctsi", VX(4, 725), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctsiz", VX(4, 730), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctuf", VX(4, 726), VX_MASK, PPCEFS, { RD, RB } }, +{ "efsctsf", VX(4, 727), VX_MASK, PPCEFS, { RD, RB } }, + +{ "evsabs", VX(4, 708), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsnabs", VX(4, 709), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsneg", VX(4, 710), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsadd", VX(4, 704), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evssub", VX(4, 705), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evsmul", VX(4, 712), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evsdiv", VX(4, 713), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evscmpgt", VX(4, 716), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evsgmplt", VX(4, 717), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evsgmpeq", VX(4, 718), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evststgt", VX(4, 732), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evststlt", VX(4, 733), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evststeq", VX(4, 734), VX_MASK, PPCSPE, { CRFD, RA, RB } }, +{ "evscfui", VX(4, 720), VX_MASK, PPCSPE, { RD, RB } }, +{ "evscfsi", VX(4, 721), VX_MASK, PPCSPE, { RD, RB } }, +{ "evscfuf", VX(4, 722), VX_MASK, PPCSPE, { RD, RB } }, +{ "evscfsf", VX(4, 723), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctui", VX(4, 724), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctuiz", VX(4, 728), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctsi", VX(4, 725), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctsiz", VX(4, 730), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctuf", VX(4, 726), VX_MASK, PPCSPE, { RD, RB } }, +{ "evsctsf", VX(4, 727), VX_MASK, PPCSPE, { RD, RB } }, + +{ "evmhossf", VX(4, 1031), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhossfa", VX(4, 1063), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmf", VX(4, 1039), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmfa", VX(4, 1071), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmi", VX(4, 1037), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmia", VX(4, 1069), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhoumi", VX(4, 1036), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhoumia", VX(4, 1068), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessf", VX(4, 1027), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessfa", VX(4, 1059), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmf", VX(4, 1035), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmfa", VX(4, 1067), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmi", VX(4, 1033), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmia", VX(4, 1065), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheumi", VX(4, 1032), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheumia", VX(4, 1064), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmhossfaaw",VX(4, 1287), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhossiaaw",VX(4, 1285), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmfaaw",VX(4, 1295), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmiaaw",VX(4, 1293), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhousiaaw",VX(4, 1284), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhoumiaaw",VX(4, 1292), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessfaaw",VX(4, 1283), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessiaaw",VX(4, 1281), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmfaaw",VX(4, 1291), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmiaaw",VX(4, 1289), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheusiaaw",VX(4, 1280), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheumiaaw",VX(4, 1288), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmhossfanw",VX(4, 1415), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhossianw",VX(4, 1413), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmfanw",VX(4, 1423), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhosmianw",VX(4, 1421), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhousianw",VX(4, 1412), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhoumianw",VX(4, 1420), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessfanw",VX(4, 1411), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhessianw",VX(4, 1409), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmfanw",VX(4, 1419), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhesmianw",VX(4, 1417), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheusianw",VX(4, 1408), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmheumianw",VX(4, 1416), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmhogsmfaa",VX(4, 1327), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhogsmiaa",VX(4, 1325), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhogumiaa",VX(4, 1324), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegsmfaa",VX(4, 1323), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegsmiaa",VX(4, 1321), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegumiaa",VX(4, 1320), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmhogsmfan",VX(4, 1455), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhogsmian",VX(4, 1453), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhogumian",VX(4, 1452), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegsmfan",VX(4, 1451), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegsmian",VX(4, 1449), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmhegumian",VX(4, 1448), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwhssf", VX(4, 1095), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhssfa", VX(4, 1127), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmf", VX(4, 1103), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmfa", VX(4, 1135), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmi", VX(4, 1101), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmia", VX(4, 1133), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhumi", VX(4, 1100), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhumia", VX(4, 1132), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwlssf", VX(4, 1091), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlssfa", VX(4, 1123), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmf", VX(4, 1099), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmfa", VX(4, 1131), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlumi", VX(4, 1096), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlumia", VX(4, 1128), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwhssfaa",VX(4, 1351), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhssmaa",VX(4, 1349), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmfaa",VX(4, 1359), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmiaa",VX(4, 1357), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhusiaa",VX(4, 1348), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhumiaa",VX(4, 1356), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwlssfaaw",VX(4, 1347), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlssiaaw",VX(4, 1345), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmfaaw",VX(4, 1355), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmiaaw",VX(4, 1353), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlusiaaw",VX(4, 1344), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlumiaaw",VX(4, 1352), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwhssfan",VX(4, 1479), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhssian",VX(4, 1477), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmfan",VX(4, 1487), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhsmian",VX(4, 1485), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhusian",VX(4, 1476), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhumian",VX(4, 1484), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwlssfanw",VX(4, 1475), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlssianw",VX(4, 1473), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmfanw",VX(4, 1483), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlsmianw",VX(4, 1481), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlusianw",VX(4, 1472), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwlumianw",VX(4, 1480), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwhgssfaa",VX(4, 1383), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgsmfaa",VX(4, 1391), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgsmiaa",VX(4, 1381), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgumiaa",VX(4, 1380), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwhgssfan",VX(4, 1511), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgsmfan",VX(4, 1519), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgsmian",VX(4, 1509), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwhgumian",VX(4, 1508), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwssf", VX(4, 1107), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwssfa", VX(4, 1139), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmf", VX(4, 1115), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmfa", VX(4, 1147), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmi", VX(4, 1113), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmia", VX(4, 1145), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwumi", VX(4, 1112), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwumia", VX(4, 1144), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwssfaa", VX(4, 1363), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmfaa", VX(4, 1371), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmiaa", VX(4, 1369), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwumiaa", VX(4, 1368), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evmwssfan", VX(4, 1491), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmfan", VX(4, 1499), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwsmian", VX(4, 1497), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evmwumian", VX(4, 1496), VX_MASK, PPCSPE, { RD, RA, RB } }, + +{ "evaddssiaaw",VX(4, 1217), VX_MASK, PPCSPE, { RD, RA } }, +{ "evaddsmiaaw",VX(4, 1225), VX_MASK, PPCSPE, { RD, RA } }, +{ "evaddusiaaw",VX(4, 1216), VX_MASK, PPCSPE, { RD, RA } }, +{ "evaddumiaaw",VX(4, 1224), VX_MASK, PPCSPE, { RD, RA } }, + +{ "evsubfssiaaw",VX(4, 1219), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsubfsmiaaw",VX(4, 1227), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsubfusiaaw",VX(4, 1218), VX_MASK, PPCSPE, { RD, RA } }, +{ "evsubfumiaaw",VX(4, 1226), VX_MASK, PPCSPE, { RD, RA } }, + +{ "evmra", VX(4, 1220), VX_MASK, PPCSPE, { RD, RA } }, + +{ "evdivws", VX(4, 1222), VX_MASK, PPCSPE, { RD, RA, RB } }, +{ "evdivwu", VX(4, 1223), VX_MASK, PPCSPE, { RD, RA, RB } }, + { "mulli", OP(7), OP_MASK, PPCCOM, { RT, RA, SI } }, { "muli", OP(7), OP_MASK, PWRCOM, { RT, RA, SI } }, @@ -2467,6 +2935,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "crnot", XL(19,33), XL_MASK, PPCCOM, { BT, BA, BBA } }, { "crnor", XL(19,33), XL_MASK, COM, { BT, BA, BB } }, +{ "rfmci", X(19,38), 0xffffffff, PPCRFMCI, { 0 } }, + { "rfi", XL(19,50), 0xffffffff, COM, { 0 } }, { "rfci", XL(19,51), 0xffffffff, PPC403, { 0 } }, @@ -2785,6 +3255,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mulhwu", XO(31,11,0,0), XO_MASK, PPC, { RT, RA, RB } }, { "mulhwu.", XO(31,11,0,1), XO_MASK, PPC, { RT, RA, RB } }, +{ "isel", XISEL(31,15),XISEL_MASK, PPCISEL, { RT, RA, RB, CRB } }, + { "mfcr", X(31,19), XRARB_MASK, COM, { RT } }, { "lwarx", X(31,20), X_MASK, PPC, { RT, RA, RB } }, @@ -2914,6 +3386,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "wrtee", X(31,131), XRARB_MASK, PPC403, { RS } }, { "wrtee", X(31,131), XRARB_MASK, BOOKE, { RS } }, +{ "dcbtstls",X(31,134), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "subfe", XO(31,136,0,0), XO_MASK, PPCCOM, { RT, RA, RB } }, { "sfe", XO(31,136,0,0), XO_MASK, PWRCOM, { RT, RA, RB } }, { "subfe.", XO(31,136,0,1), XO_MASK, PPCCOM, { RT, RA, RB } }, @@ -2932,6 +3406,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "addeo.", XO(31,138,1,1), XO_MASK, PPCCOM, { RT, RA, RB } }, { "aeo.", XO(31,138,1,1), XO_MASK, PWRCOM, { RT, RA, RB } }, +{ "dcbtstlse",X(31,142),X_MASK, PPCCHLK, { CT, RA, RB }}, + { "mtcr", XFXM(31,144,0xff), XFXFXM_MASK|FXM_MASK, COM, { RS }}, { "mtcrf", X(31,144), XFXFXM_MASK, COM, { FXM, RS } }, @@ -2957,6 +3433,9 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "wrteei", X(31,163), XE_MASK, PPC403, { E } }, { "wrteei", X(31,163), XE_MASK, BOOKE, { E } }, +{ "dcbtls", X(31,166), X_MASK, PPCCHLK, { CT, RA, RB }}, +{ "dcbtlse", X(31,174), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "mtmsrd", X(31,178), XRLARB_MASK, PPC64, { RS, MTMSRD_L } }, { "stdux", X(31,181), X_MASK, PPC64, { RS, RAS, RB } }, @@ -3001,6 +3480,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "stbxe", X(31,223), X_MASK, BOOKE64, { RS, RA, RB } }, +{ "icblc", X(31,230), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "subfme", XO(31,232,0,0), XORB_MASK, PPCCOM, { RT, RA } }, { "sfme", XO(31,232,0,0), XORB_MASK, PWRCOM, { RT, RA } }, { "subfme.", XO(31,232,0,1), XORB_MASK, PPCCOM, { RT, RA } }, @@ -3033,6 +3514,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mullwo.", XO(31,235,1,1), XO_MASK, PPCCOM, { RT, RA, RB } }, { "mulso.", XO(31,235,1,1), XO_MASK, PWRCOM, { RT, RA, RB } }, +{ "icblce", X(31,238), X_MASK, PPCCHLK, { CT, RA, RB }}, { "mtsrin", X(31,242), XRA_MASK, PPC32, { RS, RB } }, { "mtsri", X(31,242), XRA_MASK, POWER32, { RS, RB } }, @@ -3137,6 +3619,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "divo", XO(31,331,1,0), XO_MASK, M601, { RT, RA, RB } }, { "divo.", XO(31,331,1,1), XO_MASK, M601, { RT, RA, RB } }, +{ "mfpmr", X(31,334), X_MASK, PPCPMR, { RT, PMRN }}, + { "mfmq", XSPR(31,339,0), XSPR_MASK, M601, { RT } }, { "mfxer", XSPR(31,339,1), XSPR_MASK, COM, { RT } }, { "mfrtcu", XSPR(31,339,4), XSPR_MASK, COM, { RT } }, @@ -3181,6 +3665,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mfasr", XSPR(31,339,280), XSPR_MASK, PPC64, { RT } }, { "mfear", XSPR(31,339,282), XSPR_MASK, PPC, { RT } }, { "mfpvr", XSPR(31,339,287), XSPR_MASK, PPC, { RT } }, +{ "mfspefscr",XSPR(31,339,512), XSPR_MASK, PPCSPE, { RT } }, { "mfibatu", XSPR(31,339,528), XSPRBAT_MASK, PPC, { RT, SPRBAT } }, { "mfibatl", XSPR(31,339,529), XSPRBAT_MASK, PPC, { RT, SPRBAT } }, { "mfdbatu", XSPR(31,339,536), XSPRBAT_MASK, PPC, { RT, SPRBAT } }, @@ -3296,9 +3781,9 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "tlbia", X(31,370), 0xffffffff, PPC, { 0 } }, -{ "mftbl", XSPR(31,371,268), XSPR_MASK, PPC, { RT } }, -{ "mftbu", XSPR(31,371,269), XSPR_MASK, PPC, { RT } }, -{ "mftb", X(31,371), X_MASK, PPC, { RT, TBR } }, +{ "mftbl", XSPR(31,371,268), XSPR_MASK, CLASSIC, { RT } }, +{ "mftbu", XSPR(31,371,269), XSPR_MASK, CLASSIC, { RT } }, +{ "mftb", X(31,371), X_MASK, CLASSIC, { RT, TBR } }, { "lwaux", X(31,373), X_MASK, PPC64, { RT, RAL, RB } }, @@ -3308,12 +3793,16 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mtdcrx", X(31,387), X_MASK, BOOKE, { RA, RS } }, +{ "dcblc", X(31,390), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "subfe64", XO(31,392,0,0), XO_MASK, BOOKE64, { RT, RA, RB } }, { "subfe64o",XO(31,392,1,0), XO_MASK, BOOKE64, { RT, RA, RB } }, { "adde64", XO(31,394,0,0), XO_MASK, BOOKE64, { RT, RA, RB } }, { "adde64o", XO(31,394,1,0), XO_MASK, BOOKE64, { RT, RA, RB } }, +{ "dcblce", X(31,398), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "slbmte", X(31,402), XRA_MASK, PPC64, { RS, RB } }, { "sthx", X(31,407), X_MASK, COM, { RS, RA, RB } }, @@ -3444,6 +3933,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mtear", XSPR(31,467,282), XSPR_MASK, PPC, { RS } }, { "mttbl", XSPR(31,467,284), XSPR_MASK, PPC, { RS } }, { "mttbu", XSPR(31,467,285), XSPR_MASK, PPC, { RS } }, +{ "mtspefscr",XSPR(31,467,512),XSPR_MASK, PPCSPE, { RT } }, { "mtibatu", XSPR(31,467,528), XSPRBAT_MASK, PPC, { SPRBAT, RS } }, { "mtibatl", XSPR(31,467,529), XSPRBAT_MASK, PPC, { SPRBAT, RS } }, { "mtdbatu", XSPR(31,467,536), XSPRBAT_MASK, PPC, { SPRBAT, RS } }, @@ -3514,6 +4004,10 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "dcread", X(31,486), X_MASK, PPC403, { RT, RA, RB }}, +{ "mtpmr", X(31,462), X_MASK, PPCPMR, { PMRN, RS }}, + +{ "icbtls", X(31,486), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "nabs", XO(31,488,0,0), XORB_MASK, M601, { RT, RA } }, { "subfme64",XO(31,488,0,0), XORB_MASK, BOOKE64, { RT, RA } }, { "nabs.", XO(31,488,0,1), XORB_MASK, M601, { RT, RA } }, @@ -3534,6 +4028,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "divwo", XO(31,491,1,0), XO_MASK, PPC, { RT, RA, RB } }, { "divwo.", XO(31,491,1,1), XO_MASK, PPC, { RT, RA, RB } }, +{ "icbtlse", X(31,494), X_MASK, PPCCHLK, { CT, RA, RB }}, + { "slbia", X(31,498), 0xffffffff, PPC64, { 0 } }, { "cli", X(31,502), XRB_MASK, POWER, { RT, RA } }, @@ -3542,6 +4038,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "mcrxr", X(31,512), XRARB_MASK|(3<<21), COM, { BF } }, +{ "bblels", X(31,518), X_MASK, PPCBRLK, { 0 }}, { "mcrxr64", X(31,544), XRARB_MASK|(3<<21), BOOKE, { BF } }, { "clcs", X(31,531), XRB_MASK, M601, { RT, RA } }, @@ -3572,6 +4069,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { { "lfsxe", X(31,543), X_MASK, BOOKE64, { FRT, RA, RB } }, +{ "bbelr", X(31,550), X_MASK, PPCBRLK, { 0 }}, { "tlbsync", X(31,566), 0xffffffff, PPC, { 0 } }, { "lfsux", X(31,567), X_MASK, COM, { FRT, RAS, RB } }, @@ -4060,6 +4558,9 @@ const struct powerpc_macro powerpc_macros[] = { { "clrlslwi",4, PPCCOM, "rlwinm %0,%1,%3,(%2)-(%3),31-(%3)" }, { "clrlslwi.",4, PPCCOM, "rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" }, +{ "mftbl", 1, BOOKE, "mfspr %0,tbl" }, +{ "mftbu", 1, BOOKE, "mfspr %0,tbu" }, +{ "mftb", 2, BOOKE, "mfspr %0,%1" }, }; const int powerpc_num_macros = diff --git a/opcodes/z8k-dis.c b/opcodes/z8k-dis.c index d375e6908d2..6c1913892c8 100644 --- a/opcodes/z8k-dis.c +++ b/opcodes/z8k-dis.c @@ -515,10 +515,10 @@ unparse_instr (instr_data, is_segmented) break; case CLASS_BA: if (is_segmented) - sprintf (tmp_str, "rr%ld(#%lx)", instr_data->arg_reg[datum_value], + sprintf (tmp_str, "rr%ld(#0x%lx)", instr_data->arg_reg[datum_value], instr_data->immediate); else - sprintf (tmp_str, "r%ld(#%lx)", instr_data->arg_reg[datum_value], + sprintf (tmp_str, "r%ld(#0x%lx)", instr_data->arg_reg[datum_value], instr_data->immediate); strcat (out_str, tmp_str); break; diff --git a/opcodes/z8k-opc.h b/opcodes/z8k-opc.h index 025cfabdd65..0e478bfd0e8 100644 --- a/opcodes/z8k-opc.h +++ b/opcodes/z8k-opc.h @@ -1621,14 +1621,14 @@ opcode_entry_type z8k_table[] = { {CLASS_BIT+3,CLASS_BIT+0xd,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,135}, -/* 0011 1101 dddd 0100 imm16 *** in rd,imm16 */ +/* 0011 1011 dddd 0100 imm16 *** in rd,imm16 */ { #ifdef NICENAMES "in rd,imm16",16,12, 0x00, #endif "in",OPC_in,0,{CLASS_REG_WORD+(ARG_RD),CLASS_IMM+(ARG_IMM16),}, - {CLASS_BIT+3,CLASS_BIT+0xd,CLASS_REG+(ARG_RD),CLASS_BIT+4,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,136}, + {CLASS_BIT+3,CLASS_BIT+0xb,CLASS_REG+(ARG_RD),CLASS_BIT+4,CLASS_IMM+(ARG_IMM16),0,0,0,0,},2,4,136}, /* 0011 1100 ssN0 dddd *** inb rbd,@rs */ diff --git a/opcodes/z8kgen.c b/opcodes/z8kgen.c index fa8505939a9..5bd9240c021 100644 --- a/opcodes/z8kgen.c +++ b/opcodes/z8kgen.c @@ -209,8 +209,8 @@ struct op opt[] = "------", 8, 16, "0111 1010 0000 0000", "halt", 0, "------", 10, 16, "0011 1101 ssN0 dddd", "in rd,@rs", 0, - "------", 12, 16, "0011 1101 dddd 0100 imm16", "in rd,imm16", 0, "------", 12, 8, "0011 1100 ssN0 dddd", "inb rbd,@rs", 0, + "------", 12, 16, "0011 1011 dddd 0100 imm16", "in rd,imm16", 0, "------", 10, 8, "0011 1010 dddd 0100 imm16", "inb rbd,imm16", 0, "-ZSV--", 11, 16, "0010 1001 ddN0 imm4m1", "inc @rd,imm4m1", 0, "-ZSV--", 14, 16, "0110 1001 ddN0 imm4m1 address_dst", "inc address_dst(rd),imm4m1", 0, diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index d3387ee58e8..403d870d66c 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,3 +1,8 @@ +2002-08-23 Andrew Cagney + + * support/config.guess: Import version 2002-08-23. + * support/config.sub: Import version 2002-08-22. + 2002-07-19 Chris Demetriou * support/config.guess: Update from ../config.guess. diff --git a/readline/examples/excallback.c b/readline/examples/excallback.c index ca03fc3dafd..3d4bb189c69 100644 --- a/readline/examples/excallback.c +++ b/readline/examples/excallback.c @@ -153,6 +153,8 @@ process_line(char *line) } else { fprintf(stderr, "|%s|\n", line); } + + free (line); } int diff --git a/readline/support/config.guess b/readline/support/config.guess index ffcb6435df7..c5438deabca 100755 --- a/readline/support/config.guess +++ b/readline/support/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2002-07-09' +timestamp='2002-08-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -231,6 +231,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build cat <$dummy.s .data \$Lformat: @@ -256,7 +257,6 @@ main: jsr \$26,exit .end main EOF - eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `$dummy` in @@ -281,6 +281,9 @@ EOF 2-1307) UNAME_MACHINE="alphaev68" ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; esac fi rm -f $dummy.s $dummy && rmdir $tmpdir @@ -875,7 +878,7 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; @@ -986,6 +989,9 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) @@ -1079,6 +1085,9 @@ EOF SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; diff --git a/readline/support/config.sub b/readline/support/config.sub index 9ff085efaf7..b0222f7ea0b 100755 --- a/readline/support/config.sub +++ b/readline/support/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2002-07-03' +timestamp='2002-08-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -239,6 +239,7 @@ case $basic_machine in | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ + | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ @@ -246,6 +247,7 @@ case $basic_machine in | mipsisa32 | mipsisa32el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ns16k | ns32k \ @@ -307,6 +309,7 @@ case $basic_machine in | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ @@ -314,6 +317,7 @@ case $basic_machine in | mipsisa32-* | mipsisa32el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39 | mipstx39el \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ @@ -745,13 +749,13 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -772,22 +776,22 @@ case $basic_machine in power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown - ;; + ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown - ;; + ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; @@ -818,6 +822,12 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; sequent) basic_machine=i386-sequent ;; @@ -883,7 +893,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -941,8 +951,8 @@ case $basic_machine in os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -967,7 +977,7 @@ case $basic_machine in basic_machine=i386-pc os=-windows32-msvcrt ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; ymp) @@ -1022,7 +1032,7 @@ case $basic_machine in sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -1172,7 +1182,7 @@ case $os in os=-rtmk-nova ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; -nsk*) os=-nsk @@ -1211,8 +1221,8 @@ case $os in -xenix) os=-xenix ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; -none) ;; @@ -1249,7 +1259,7 @@ case $basic_machine in pdp10-*) os=-tops20 ;; - pdp11-*) + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1342,19 +1352,19 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) diff --git a/sim/ChangeLog b/sim/ChangeLog index 4d6c1ade985..35bcfb5dd9c 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,7 @@ +2002-08-24 Geoffrey Keating + + * MAINTAINERS: Update my email address. + 2002-07-17 Andrew Cagney * w65/: Delete directory. diff --git a/sim/MAINTAINERS b/sim/MAINTAINERS index 9615a13bb07..e54adb50433 100644 --- a/sim/MAINTAINERS +++ b/sim/MAINTAINERS @@ -11,7 +11,7 @@ gdb-patches@sources.redhat.com arm Nick Clifton ppc Andrew Cagney -ppc Geoff Keating +ppc Geoff Keating m68hc11 Stephane Carrez mips Andrew Cagney mips Chris Demetriou diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index acd66adb5ae..9ce404ed6bd 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2002-08-15 Nick Clifton + + * armos.c (ARMul_OSHandleSWI): Catch and ignore SWIs of -1, they + can be caused by an interrupted system call being resumed by GDB. + 2002-07-05 Nick Clifton * armemu.c (ARMul_Emulate32): Add more tests for valid MIA, MIAPH diff --git a/sim/arm/armos.c b/sim/arm/armos.c index ccf9a576e87..c4cb0517560 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -553,6 +553,13 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number) /* R0 is a reason code. */ switch (state->Reg[0]) { + case -1: + /* This can happen when a SWI is interrupted (eg receiving a + ctrl-C whilst processing SWIRead()). The SWI will complete + returning -1 in r0 to the caller. If GDB is then used to + resume the system call the reason code will now be -1. */ + return TRUE; + /* Unimplemented reason codes. */ case AngelSWI_Reason_ReadC: case AngelSWI_Reason_IsTTY: @@ -685,6 +692,13 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number) /* These are used by the FPE code. */ break; + case -1: + /* This can happen when a SWI is interrupted (eg receiving a + ctrl-C whilst processing SWIRead()). The SWI will complete + returning -1 in r0 to the caller. If GDB is then used to + resume the system call the reason code will now be -1. */ + return TRUE; + case 0x180001: /* RedBoot's Syscall SWI in ARM mode. */ if (swi_mask & SWI_MASK_REDBOOT) { diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 8e7aabc42ee..ae252fd2769 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2002-08-29 Dave Brolley + + * Make-common.in (CGEN_READ_SCM): Remove ../../cgen/stamp-cgen. + 2002-07-17 Andrew Cagney * run-sim.h: Add #ifdef RUN_SIM_H wrapper. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 744295a02cb..1f29f6a13f6 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -655,7 +655,7 @@ CGEN = `if [ -f ../../guile/libguile/guile ]; then echo ../../guile/libguile/gui CGENFLAGS = -v CGEN_CPU_DIR = $(CGENDIR)/cpu -CGEN_READ_SCM = ../../cgen/stamp-cgen $(CGENDIR)/sim.scm +CGEN_READ_SCM = $(CGENDIR)/sim.scm CGEN_ARCH_SCM = $(CGENDIR)/sim-arch.scm CGEN_CPU_SCM = $(CGENDIR)/sim-cpu.scm $(CGENDIR)/sim-model.scm CGEN_DECODE_SCM = $(CGENDIR)/sim-decode.scm diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 8ef6284daa7..9484c2226ef 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,12 @@ +2002-08-28 Dave Brolley + + * gen-support.c (gen_support_h): Generate + '#define semantic_illegal _semantic_illegal'. + +2002-08-22 Chris Demetriou + + * compare_igen_models: New script. + 2002-06-17 Andrew Cagney * gen.c (gen_entry_expand_opcode): Initialize ``value'' to -1 and diff --git a/sim/igen/gen-support.c b/sim/igen/gen-support.c index 93efaa74f72..e2663ac5fc6 100644 --- a/sim/igen/gen-support.c +++ b/sim/igen/gen-support.c @@ -141,10 +141,14 @@ gen_support_h (lf *file, lf_printf(file, "#define _SD SD_ /* deprecated */\n"); lf_printf(file, "\n"); - /* Map _instruction_word and _idecode_issue onto the - shorter instruction_word and idecode_issue. Map defined here as, - name space problems are created when the name is defined in - idecode.h */ + /* Map _xxxx onto the shorter xxxx for the following names: + + instruction_word + idecode_issue + semantic_illegal + + Map defined here as name space problems are created when the name is + defined in idecode.h */ if (strcmp (options.module.idecode.prefix.l, "") != 0) { lf_indent_suppress (file); @@ -159,6 +163,12 @@ gen_support_h (lf *file, options.module.idecode.prefix.l, "idecode_issue"); lf_printf (file, "\n"); + lf_indent_suppress (file); + lf_printf (file, "#define %s %s%s\n", + "semantic_illegal", + options.module.idecode.prefix.l, + "semantic_illegal"); + lf_printf (file, "\n"); } /* output a declaration for all functions */ diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index 7c08019283b..abe5f55c533 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,56 @@ +2002-08-13 Stephane Carrez + + * dv-m68hc11eepr.c (struct m68hc11eepr ): Use const char* for filename. + +2002-08-13 Marko Kohtala + + * interp.c (sim_prepare_for_program): Look up the image for the + reset vector and set cpu_use_elf_start to 1 if not found. + (sim_open): Do not set cpu_use_elf_start. + +2002-08-13 Marko Kohtala + + * interp.c (sim_hw_configure): Return 1 for success. + (sim_prepare_for_program): Use the sim_hw_configure exit code to + return SIM_RC_FAIL. + +2002-08-13 Stephane Carrez + + * dv-m68hc11.c (m68hc11cpu_io_read_buffer): Translate memory + bank window to some virtual address to read from extended memory. + (m68hc11cpu_io_write_buffer): Likewise for writing. + (attach_m68hc11_regs): When use_bank property is defined, attach + to the 68HC12 16K memory bank window. + * interp.c (sim_hw_configure): Create memory region for banked + memory. + +2002-08-13 Stephane Carrez + + * interp.c (sim_hw_configure): Connect port-X to cpu-write-port. + * dv-m68hc11.c (m68hc11cpu_ports): Add cpu-write-port input. + (m68hc11cpu_port_event): Handle CPU_WRITE_PORT event. + +2002-08-13 Marko Kohtala + + * dv-m68hc11.c (m68hc11cpu_io_write): Fix to update IO mapping + when IO mapping changed, not when internal RAM mapping is changed. + +2002-08-13 Stephane Carrez + + * m68hc11_sim.c (cpu_special): Handle call and rtc instructions. + * sim-main.h (M6812_CALL_INDIRECT): Add to enum. + (m6811_regs): Add page register. + (cpu_set_page, cpu_get_page): New macros. + (phys_to_virt): New function. + (cpu_get_indexed_operand_addr, cpu_return): Declare. + * gencode.c: Identify indirect addressing mode for call and fix daa. + (gen_function_entry): New param to tell if src8/dst8 locals are + necessary. + (gen_interpreter): Use it to avoid generation of unused variables. + * interp.c (sim_fetch_register): Allow to read page register; page + register, A, B and CCR are only 1 byte wide. + (sim_store_register): Likewise for writing. + 2002-06-16 Andrew Cagney * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c index 25449cdb571..669a045357a 100644 --- a/sim/m68hc11/dv-m68hc11.c +++ b/sim/m68hc11/dv-m68hc11.c @@ -1,6 +1,6 @@ /* dv-m68hc11.c -- CPU 68HC11&68HC12 as a device. Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Written by Stephane Carrez (stcarrez@nerim.fr) (From a driver model Contributed by Cygnus Solutions.) This program is free software; you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include "sim-hw.h" #include "hw-main.h" #include "sim-options.h" +#include "hw-base.h" #include /* DEVICE @@ -159,6 +160,7 @@ enum { SET_PORT_A, SET_PORT_C, SET_PORT_D, + CPU_WRITE_PORT, PORT_A, PORT_B, PORT_C, @@ -178,6 +180,8 @@ static const struct hw_port_descriptor m68hc11cpu_ports[] = { { "set-port-c", SET_PORT_C, 0, input_port, }, { "set-port-d", SET_PORT_D, 0, input_port, }, + { "cpu-write-port", CPU_WRITE_PORT, 0, input_port, }, + /* Events generated for connection to other devices. */ { "cpu-reset", CPU_RESET_PORT, 0, output_port, }, @@ -317,6 +321,13 @@ attach_m68hc11_regs (struct hw *me, cpu->cpu_frequency = 8*1000*1000; } + if (hw_find_property (me, "use_bank") != NULL) + hw_attach_address (hw_parent (me), 0, + exec_map, + 0x08000, + 0x04000, + me); + cpu_mode = "expanded"; if (hw_find_property (me, "mode") != NULL) cpu_mode = hw_find_string_property (me, "mode"); @@ -532,6 +543,9 @@ m68hc11cpu_port_event (struct hw *me, m68hc11cpu_set_port (me, cpu, M6811_PORTD, level); break; + case CPU_WRITE_PORT: + break; + default: hw_abort (me, "bad switch"); break; @@ -829,6 +843,14 @@ m68hc11cpu_io_read_buffer (struct hw *me, sd = hw_system (me); cpu = STATE_CPU (sd, 0); + if (base >= 0x8000 && base < 0xc000) + { + address_word virt_addr = phys_to_virt (cpu, base); + if (virt_addr != base) + return sim_core_read_buffer (sd, cpu, space, dest, + virt_addr, nr_bytes); + } + /* Handle reads for the sub-devices. */ base -= controller->attach_address; result = sim_core_read_buffer (sd, cpu, @@ -1002,7 +1024,7 @@ m68hc11cpu_io_write (struct hw *me, sim_cpu *cpu, /* Update IO mapping. Detach from the old address and attach to the new one. */ - if ((old_bank & 0xF0) != (val & 0xF0)) + if ((old_bank & 0x0F) != (val & 0x0F)) { struct m68hc11cpu *controller = hw_data (me); @@ -1018,7 +1040,7 @@ m68hc11cpu_io_write (struct hw *me, sim_cpu *cpu, controller->attach_size, me); } - if ((old_bank & 0x0F) != (val & 0x0F)) + if ((old_bank & 0xF0) != (val & 0xF0)) { ; } @@ -1068,6 +1090,14 @@ m68hc11cpu_io_write_buffer (struct hw *me, sd = hw_system (me); cpu = STATE_CPU (sd, 0); + + if (base >= 0x8000 && base < 0xc000) + { + address_word virt_addr = phys_to_virt (cpu, base); + if (virt_addr != base) + return sim_core_write_buffer (sd, cpu, space, source, + virt_addr, nr_bytes); + } base -= controller->attach_address; result = sim_core_write_buffer (sd, cpu, io_map, source, base, nr_bytes); diff --git a/sim/m68hc11/dv-m68hc11eepr.c b/sim/m68hc11/dv-m68hc11eepr.c index fb99068fe87..a06eb442050 100644 --- a/sim/m68hc11/dv-m68hc11eepr.c +++ b/sim/m68hc11/dv-m68hc11eepr.c @@ -1,6 +1,6 @@ /* dv-m68hc11eepr.c -- Simulation of the 68HC11 Internal EEPROM. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@nerim.fr) (From a driver model Contributed by Cygnus Solutions.) This program is free software; you can redistribute it and/or modify @@ -119,7 +119,7 @@ struct m68hc11eepr /* Minimum time in CPU cycles for programming the EEPROM. */ unsigned long eeprom_min_cycles; - char* file_name; + const char* file_name; }; diff --git a/sim/m68hc11/gencode.c b/sim/m68hc11/gencode.c index 8c32e3e1649..c602656a659 100644 --- a/sim/m68hc11/gencode.c +++ b/sim/m68hc11/gencode.c @@ -1,6 +1,6 @@ /* gencode.c -- Motorola 68HC11 & 68HC12 Emulator Generator - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -284,6 +284,7 @@ cpu_set_ccr_Z (proc, dst16 == 0);\n\ /* 68HC12 special instructions. */ { "bgnd", "cpu_special (proc, M6812_BGND)" }, { "call8", "cpu_special (proc, M6812_CALL)" }, + { "call_ind", "cpu_special (proc, M6812_CALL_INDIRECT)" }, { "dbcc8", "cpu_dbcc (proc)" }, { "ediv", "cpu_special (proc, M6812_EDIV)" }, { "emul", "{ uint32 src1 = (uint32) cpu_get_d (proc);\ @@ -384,7 +385,7 @@ struct m6811_opcode_def m6811_page1_opcodes[] = { { "page3", 0, "page3", 1, 0x1a, 0, 0, CHG_NONE }, /* After 'daa', the Z flag is undefined. Mark it as changed. */ - { "daa", "a->a", "daa8", 1, 0x19, 2, 2, CHG_NZVC }, + { "daa", "", "daa8", 1, 0x19, 2, 2, CHG_NZVC }, { "aba", "b,a->a", "add8", 1, 0x1b, 2, 2, CHG_HNZVC}, { "bset", "(x),#->(x)","or8", 3, 0x1c, 7, 7, CLR_V_CHG_NZ }, { "bclr", "(x),#->(x)","bclr8", 3, 0x1d, 7, 7, CLR_V_CHG_NZ }, @@ -821,8 +822,8 @@ struct m6811_opcode_def m6812_page1_opcodes[] = { { "bvc", "r", 0, 2, 0x28, 1, 3, CHG_NONE }, { "bvs", "r", 0, 2, 0x29, 1, 3, CHG_NONE }, - { "call", "()", "call8", 4, 0x4a, 8, 8, CHG_NONE }, - { "call", "[]", "call8", 2, 0x4b, 8, 8, CHG_NONE }, + { "call", "", "call8", 4, 0x4a, 8, 8, CHG_NONE }, + { "call", "", "call_ind",2, 0x4b, 8, 8, CHG_NONE }, { "clr", "->()", "clr8", 3, 0x79, 3, 3, SET_Z_CLR_NVC }, { "clr", "->[]", "clr8", 2, 0x69, 2, 2, SET_Z_CLR_NVC }, @@ -1977,8 +1978,11 @@ gen_cycle_table (FILE *fp, const char *name, print (fp, 0, "};\n\n"); } +#define USE_SRC8 1 +#define USE_DST8 2 + void -gen_function_entry (FILE *fp, const char *name) +gen_function_entry (FILE *fp, const char *name, int locals) { /* Generate interpretor entry point. */ print (fp, 0, "%s (proc)\n", name); @@ -1988,7 +1992,10 @@ gen_function_entry (FILE *fp, const char *name) /* Interpretor local variables. */ print (fp, indent_level, "unsigned char op;"); print (fp, indent_level, "uint16 addr, src16, dst16;"); - print (fp, indent_level, "uint8 src8, dst8;\n"); + if (locals & USE_SRC8) + print (fp, indent_level, "uint8 src8;\n"); + if (locals & USE_DST8) + print (fp, indent_level, "uint8 dst8;\n"); } void @@ -2050,14 +2057,14 @@ gen_interpreter (FILE *fp) gen_cycle_table (fp, "cycles_page4", m6811_page4_opcodes, TABLE_SIZE (m6811_page4_opcodes)); - gen_function_entry (fp, "static void\ncpu_page3_interp"); + gen_function_entry (fp, "static void\ncpu_page3_interp", 0); gen_interpreter_for_table (fp, indent_level, m6811_page3_opcodes, TABLE_SIZE(m6811_page3_opcodes), "cycles_page3"); gen_function_close (fp); - gen_function_entry (fp, "static void\ncpu_page4_interp"); + gen_function_entry (fp, "static void\ncpu_page4_interp", 0); gen_interpreter_for_table (fp, indent_level, m6811_page4_opcodes, TABLE_SIZE(m6811_page4_opcodes), @@ -2065,7 +2072,8 @@ gen_interpreter (FILE *fp) gen_function_close (fp); /* Generate the page 2, 3 and 4 handlers. */ - gen_function_entry (fp, "static void\ncpu_page2_interp"); + gen_function_entry (fp, "static void\ncpu_page2_interp", + USE_SRC8 | USE_DST8); gen_interpreter_for_table (fp, indent_level, m6811_page2_opcodes, TABLE_SIZE(m6811_page2_opcodes), @@ -2073,7 +2081,8 @@ gen_interpreter (FILE *fp) gen_function_close (fp); /* Generate the interpretor entry point. */ - gen_function_entry (fp, "void\ncpu_interp_m6811"); + gen_function_entry (fp, "void\ncpu_interp_m6811", + USE_SRC8 | USE_DST8); gen_interpreter_for_table (fp, indent_level, m6811_page1_opcodes, TABLE_SIZE(m6811_page1_opcodes), @@ -2087,7 +2096,8 @@ gen_interpreter (FILE *fp) gen_cycle_table (fp, "cycles_page2", m6812_page2_opcodes, TABLE_SIZE (m6812_page2_opcodes)); - gen_function_entry (fp, "static void\ncpu_page2_interp"); + gen_function_entry (fp, "static void\ncpu_page2_interp", + USE_SRC8 | USE_DST8); gen_interpreter_for_table (fp, indent_level, m6812_page2_opcodes, TABLE_SIZE(m6812_page2_opcodes), @@ -2095,7 +2105,8 @@ gen_interpreter (FILE *fp) gen_function_close (fp); /* Generate the interpretor entry point. */ - gen_function_entry (fp, "void\ncpu_interp_m6812"); + gen_function_entry (fp, "void\ncpu_interp_m6812", + USE_SRC8 | USE_DST8); gen_interpreter_for_table (fp, indent_level, m6812_page1_opcodes, TABLE_SIZE(m6812_page1_opcodes), diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index ee2acef698c..74674ce2969 100644 --- a/sim/m68hc11/interp.c +++ b/sim/m68hc11/interp.c @@ -1,6 +1,6 @@ /* interp.c -- Simulator for Motorola 68HC11/68HC12 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, the GNU debugger. @@ -166,7 +166,7 @@ sim_board_reset (SIM_DESC sd) cpu_restart (cpu); } -int +static int sim_hw_configure (SIM_DESC sd) { const struct bfd_arch_info *arch; @@ -229,6 +229,10 @@ sim_hw_configure (SIM_DESC sd) sim_hw_parse (sd, "/m68hc11/m68hc11eepr/reg 0xb000 512"); sim_hw_parse (sd, "/m68hc11 > cpu-reset reset /m68hc11/m68hc11eepr"); } + sim_hw_parse (sd, "/m68hc11 > port-a cpu-write-port /m68hc11"); + sim_hw_parse (sd, "/m68hc11 > port-b cpu-write-port /m68hc11"); + sim_hw_parse (sd, "/m68hc11 > port-c cpu-write-port /m68hc11"); + sim_hw_parse (sd, "/m68hc11 > port-d cpu-write-port /m68hc11"); cpu->hw_cpu = sim_hw_parse (sd, "/m68hc11"); } else @@ -238,11 +242,14 @@ sim_hw_configure (SIM_DESC sd) { /* Allocate core external memory. */ sim_do_commandf (sd, "memory region 0x%lx@%d,0x%lx", - 0x8000, M6811_RAM_LEVEL, 0x8000); + 0xC000, M6811_RAM_LEVEL, 0x4000); sim_do_commandf (sd, "memory region 0x000@%d,0x8000", M6811_RAM_LEVEL); + sim_do_commandf (sd, "memory region 0x01000000@%d,0x100000", + M6811_RAM_LEVEL); sim_hw_parse (sd, "/m68hc12/reg 0x0 0x3FF"); + sim_hw_parse (sd, "/m68hc12/use_bank 1"); } if (!hw_tree_find_property (device_tree, "/m68hc12/m68hc12sio@1/reg")) @@ -256,6 +263,7 @@ sim_hw_configure (SIM_DESC sd) /* M68hc11 Timer configuration. */ sim_hw_parse (sd, "/m68hc12/m68hc12tim/reg 0x1b 0x5"); sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12tim"); + sim_hw_parse (sd, "/m68hc12 > capture capture /m68hc12/m68hc12tim"); } /* Create the SPI device. */ @@ -277,9 +285,13 @@ sim_hw_configure (SIM_DESC sd) sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12eepr"); } + sim_hw_parse (sd, "/m68hc12 > port-a cpu-write-port /m68hc12"); + sim_hw_parse (sd, "/m68hc12 > port-b cpu-write-port /m68hc12"); + sim_hw_parse (sd, "/m68hc12 > port-c cpu-write-port /m68hc12"); + sim_hw_parse (sd, "/m68hc12 > port-d cpu-write-port /m68hc12"); cpu->hw_cpu = sim_hw_parse (sd, "/m68hc12"); } - return 0; + return 1; } static int @@ -289,10 +301,36 @@ sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd) cpu = STATE_CPU (sd, 0); - sim_hw_configure (sd); + if (!sim_hw_configure (sd)) + return SIM_RC_FAIL; + if (abfd != NULL) { + asection *s; cpu->cpu_elf_start = bfd_get_start_address (abfd); + /* See if any section sets the reset address */ + cpu->cpu_use_elf_start = 1; + for (s = abfd->sections; s && cpu->cpu_use_elf_start; s = s->next) + { + if (s->flags & SEC_LOAD) + { + bfd_size_type size; + + size = bfd_get_section_size_before_reloc (s); + if (size > 0) + { + bfd_vma lma; + + if (STATE_LOAD_AT_LMA_P (sd)) + lma = bfd_section_lma (abfd, s); + else + lma = bfd_section_vma (abfd, s); + + if (lma <= 0xFFFE && lma+size >= 0x10000) + cpu->cpu_use_elf_start = 0; + } + } + } } /* reset all state information */ @@ -319,7 +357,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, cpu_initialize (sd, cpu); - cpu->cpu_use_elf_start = 1; if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK) { free_state (sd); @@ -468,16 +505,19 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length) { sim_cpu *cpu; uint16 val; + int size = 2; cpu = STATE_CPU (sd, 0); switch (rn) { case A_REGNUM: val = cpu_get_a (cpu); + size = 1; break; case B_REGNUM: val = cpu_get_b (cpu); + size = 1; break; case D_REGNUM: @@ -502,6 +542,12 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length) case PSW_REGNUM: val = cpu_get_ccr (cpu); + size = 1; + break; + + case PAGE_REGNUM: + val = cpu_get_page (cpu); + size = 1; break; default: @@ -510,7 +556,7 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length) } memory[0] = val >> 8; memory[1] = val & 0x0FF; - return 2; + return size; } int @@ -533,11 +579,11 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length) case A_REGNUM: cpu_set_a (cpu, val); - break; + return 1; case B_REGNUM: cpu_set_b (cpu, val); - break; + return 1; case X_REGNUM: cpu_set_x (cpu, val); @@ -557,7 +603,11 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length) case PSW_REGNUM: cpu_set_ccr (cpu, val); - break; + return 1; + + case PAGE_REGNUM: + cpu_set_page (cpu, val); + return 1; default: break; diff --git a/sim/m68hc11/m68hc11_sim.c b/sim/m68hc11/m68hc11_sim.c index d9fb807e937..fe5985f8f1c 100644 --- a/sim/m68hc11/m68hc11_sim.c +++ b/sim/m68hc11/m68hc11_sim.c @@ -1,6 +1,6 @@ /* m6811_cpu.c -- 68HC11&68HC12 CPU Emulation Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -907,6 +907,60 @@ cpu_special (sim_cpu *cpu, enum M6811_Special special) } break; + case M6812_CALL: + { + uint8 page; + uint16 addr; + + addr = cpu_fetch16 (cpu); + page = cpu_fetch8 (cpu); + + cpu_m68hc12_push_uint16 (cpu, cpu_get_pc (cpu)); + cpu_m68hc12_push_uint8 (cpu, cpu_get_page (cpu)); + + cpu_set_page (cpu, page); + cpu_set_pc (cpu, addr); + } + break; + + case M6812_CALL_INDIRECT: + { + uint8 code; + uint16 addr; + uint8 page; + + code = memory_read8 (cpu, cpu_get_pc (cpu)); + /* Indirect addressing call has the page specified in the + memory location pointed to by the address. */ + if ((code & 0xE3) == 0xE3) + { + addr = cpu_get_indexed_operand_addr (cpu, 0); + page = memory_read8 (cpu, addr + 2); + addr = memory_read16 (cpu, addr); + } + else + { + /* Otherwise, page is in the opcode. */ + addr = cpu_get_indexed_operand16 (cpu, 0); + page = cpu_fetch8 (cpu); + } + cpu_m68hc12_push_uint16 (cpu, cpu_get_pc (cpu)); + cpu_m68hc12_push_uint8 (cpu, cpu_get_page (cpu)); + cpu_set_page (cpu, page); + cpu_set_pc (cpu, addr); + } + break; + + case M6812_RTC: + { + uint8 page = cpu_m68hc12_pop_uint8 (cpu); + uint16 addr = cpu_m68hc12_pop_uint16 (cpu); + + cpu_set_page (cpu, page); + cpu_set_pc (cpu, addr); + } + break; + case M6812_ETBL: default: sim_engine_halt (CPU_STATE (cpu), cpu, NULL, diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index 75c3b5b8451..c8933a0791f 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -1,6 +1,6 @@ /* sim-main.h -- Simulator for Motorola 68HC11 & 68HC12 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - Written by Stephane Carrez (stcarrez@worldnet.fr) + Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, the GNU debugger. @@ -80,6 +80,7 @@ enum cpu_type #define B_REGNUM 6 #define PSW_REGNUM 7 #define Z_REGNUM 8 +#define PAGE_REGNUM 9 typedef struct m6811_regs { unsigned short d; @@ -88,6 +89,7 @@ typedef struct m6811_regs { unsigned short sp; unsigned short pc; unsigned char ccr; + unsigned short page; } m6811_regs; @@ -126,6 +128,7 @@ enum M6811_Special /* 68HC12 instructions. */ M6812_BGND, M6812_CALL, + M6812_CALL_INDIRECT, M6812_IDIVS, M6812_EDIV, M6812_EDIVS, @@ -232,6 +235,7 @@ struct _sim_cpu { #define cpu_get_sp(PROC) ((PROC)->cpu_regs.sp) #define cpu_get_a(PROC) ((PROC->cpu_regs.d >> 8) & 0x0FF) #define cpu_get_b(PROC) ((PROC->cpu_regs.d) & 0x0FF) +#define cpu_get_page(PROC) (PROC->cpu_regs.page) /* 68HC12 specific and Motorola internal registers. */ #define cpu_get_tmp3(PROC) (0) @@ -240,10 +244,11 @@ struct _sim_cpu { #define cpu_set_d(PROC,VAL) (((PROC)->cpu_regs.d) = (VAL)) #define cpu_set_x(PROC,VAL) (((PROC)->cpu_regs.ix) = (VAL)) #define cpu_set_y(PROC,VAL) (((PROC)->cpu_regs.iy) = (VAL)) +#define cpu_set_page(PROC,VAL) ((PROC->cpu_regs.page) = (VAL)) /* 68HC12 specific and Motorola internal registers. */ #define cpu_set_tmp3(PROC,VAL) (0) -#define cpu_set_tmp2(PROC,VAL) (0) +#define cpu_set_tmp2(PROC,VAL) (void) (0) #if 0 /* This is a function in m68hc11_sim.c to keep track of the frame. */ @@ -287,11 +292,21 @@ extern void cpu_memory_exception (struct _sim_cpu *proc, uint16 addr, const char *message); +inline address_word +phys_to_virt (sim_cpu *cpu, address_word addr) +{ + if (addr >= 0x8000 && addr < 0xc000) + return ((address_word) (addr) - 0x8000) + + (((address_word) cpu->cpu_regs.page) << 14) + 0x01000000; + else + return (address_word) (addr); +} + inline uint8 memory_read8 (sim_cpu *cpu, uint16 addr) { uint8 val; - + if (sim_core_read_buffer (CPU_STATE (cpu), cpu, 0, &val, addr, 1) != 1) { cpu_memory_exception (cpu, SIM_SIGSEGV, addr, @@ -314,7 +329,7 @@ inline uint16 memory_read16 (sim_cpu *cpu, uint16 addr) { uint8 b[2]; - + if (sim_core_read_buffer (CPU_STATE (cpu), cpu, 0, b, addr, 2) != 2) { cpu_memory_exception (cpu, SIM_SIGSEGV, addr, @@ -523,6 +538,11 @@ extern void cpu_info (SIM_DESC sd, sim_cpu *proc); extern int cpu_initialize (SIM_DESC sd, sim_cpu *cpu); +/* Returns the address of a 68HC12 indexed operand. + Pre and post modifications are handled on the source register. */ +extern uint16 cpu_get_indexed_operand_addr (sim_cpu* cpu, int restrict); + +extern void cpu_return (sim_cpu *cpu); extern void cpu_set_sp (sim_cpu *cpu, uint16 val); extern int cpu_reset (sim_cpu *cpu); extern int cpu_restart (sim_cpu *cpu); diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index cb20ad5f864..c8b3aabdc4a 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,12 @@ +2002-08-29 Nick Clifton + + From 2001-08-23 Catherine Moore + + * Makefile.in: Add gen-zero-r0 option. + * sim-main.h (GPR_SET, GPR_CLEAR): Define. + * simops.c (OP_24007E0): Sign extend the imm9 + operand of a mul instruction. + 2002-06-17 Andrew Cagney * simops.c (trace_result): Fix printf formatting. diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in index 110cb1761f9..89029d6a627 100644 --- a/sim/v850/Makefile.in +++ b/sim/v850/Makefile.in @@ -82,6 +82,7 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen ../igen/igen \ $(IGEN_TRACE) \ -G gen-direct-access \ + -G gen-zero-r0 \ -i $(IGEN_INSN) \ -o $(IGEN_DC) \ -x \ diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h index 37ea31f3f4c..a16ec00a699 100644 --- a/sim/v850/sim-main.h +++ b/sim/v850/sim-main.h @@ -366,6 +366,8 @@ do { \ #endif +#define GPR_SET(N, VAL) (State.regs[(N)] = (VAL)) +#define GPR_CLEAR(N) (State.regs[(N)] = 0) extern void divun ( unsigned int N, unsigned long int als, diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 9a83d0796a2..d8a4d58ae11 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -2458,7 +2458,7 @@ OP_24007E0 (void) { trace_input ("mul", OP_IMM_REG_REG, 0); - Multiply64 (true, (OP[3] & 0x1f) | ((OP[3] >> 13) & 0x1e0)); + Multiply64 (true, SEXT9 ((OP[3] & 0x1f) | ((OP[3] >> 13) & 0x1e0))); trace_output (OP_IMM_REG_REG); diff --git a/texinfo/texinfo.tex b/texinfo/texinfo.tex index 9994f1d9b23..b0a1cfc3e72 100644 --- a/texinfo/texinfo.tex +++ b/texinfo/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2002-02-14.08} +\def\texinfoversion{2002-06-04.06} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, % 2000, 01, 02 Free Software Foundation, Inc. @@ -53,7 +53,7 @@ % texindex foo.?? % tex foo.texi % tex foo.texi -% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. +% dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. @@ -846,8 +846,7 @@ where each line of input produces a line of output.} % @math gets a chance to work. This could perhaps be fixed, but for now % at least we can have real math in the main text, where it's needed most. % -% -\let\implicitmath = $ +\let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make @@ -857,10 +856,22 @@ where each line of input produces a line of output.} {\catcode95 = \active % 95 = _ \gdef\mathunderscore{% \catcode95=\active - \def_{\ifnum\fam=\slfam\_\else\sb\fi}% + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% }} % -\def\math{\tex\mathcode`\_="8000\mathunderscore \implicitmath\finishmath} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathcode`\_="8000 \mathunderscore + \let\\ = \mathbackslash + \implicitmath\finishmath} \def\finishmath#1{#1\implicitmath\Etex} % @bullet and @minus need the same treatment as @math, just above. @@ -987,11 +998,11 @@ where each line of input produces a line of output.} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{} \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\unnumbsecentry ##1##2{} + \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\unnumbsubsecentry ##1##2{} + \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \def\unnumbsubsubsecentry ##1##2{} + \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} \input \jobname.toc \def\chapentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} @@ -1000,16 +1011,16 @@ where each line of input produces a line of output.} \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\secentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\unnumbsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\unnumbsecentry ##1##2##3{% + \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} \def\subsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\unnumbsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\unnumbsubsecentry ##1##2##3##4{% + \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} \def\subsubsecentry ##1##2##3##4##5##6{% \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \def\unnumbsubsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\unnumbsubsubsecentry ##1##2##3##4##5{% + \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} \input \jobname.toc \endgroup\fi }} @@ -1431,11 +1442,19 @@ where each line of input produces a line of output.} \def\realdash{-} \def\codedash{-\discretionary{}{}{}} -\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} \def\codex #1{\tclose{#1}\endgroup} -%\let\exp=\tclose %Was temporary - % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. @@ -1637,8 +1656,6 @@ where each line of input produces a line of output.} \global\let\contents = \relax \global\let\shortcontents = \relax \fi - % - \ifpdf \pdfmakepagedesttrue \fi } \def\finishtitlepage{% @@ -2396,20 +2413,19 @@ width0pt\relax} \fi \let\item = \relax } -% Ignore @ignore ... @end ignore. +% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, +% @direntry, and @documentdescription. % \def\ignore{\doignore{ignore}} - -% Also ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, -% @documentdescription, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} \def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifplaintext{\doignore{ifplaintext}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} -\def\documentdescription{\doignore{documentdescription}} \def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\documentdescriptionword{documentdescription} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. @@ -2436,14 +2452,21 @@ width0pt\relax} \fi % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 + \def\ignoreword{#1}% + \ifx\ignoreword\documentdescriptionword + % The c kludge breaks documentdescription, since + % `documentdescription' contains a `c'. Means not everything will + % be ignored inside @documentdescription, but oh well... + \else + % Make the letter c a comment character so that the rest of the line + % will be ignored. This way, the document can have (for example) + % @c @end ifinfo + % and the @end ifinfo will be properly ignored. + % (We've just changed @ to catcode 12.) + \catcode`\c = 14 + \fi % - % And now expand that command. + % And now expand the command defined above. \doignoretext } @@ -2634,19 +2657,21 @@ width0pt\relax} \fi \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} -% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text -% following, through the first @end iftex (etc.). Make `@end iftex' -% (etc.) valid only after an @iftex. +% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we +% read the text following, through the first @end iftex (etc.). Make +% `@end iftex' (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} \def\ifnothtml{\conditionalsucceed{ifnothtml}} \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} +\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} +\defineunmatchedend{ifnotplaintext} -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no +% We can't just want to start a group at @iftex (etc.) and end it at +% @end iftex, since then @set commands inside the conditional have no % effect (they'd get reverted at the end of the group). So we must % define \Eiftex to redefine itself to be its previous value. (We can't % just define it to fail again with an ``unmatched end'' error, since @@ -2861,7 +2886,7 @@ width0pt\relax} \fi % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the -% expansion of \tie (\\leavevmode \penalty \@M \ ). +% expansion of \tie (\leavevmode \penalty \@M \ ). {\obeyspaces \gdef\unsepspaces{\obeyspaces\let =\space}} @@ -3613,7 +3638,8 @@ width0pt\relax} \fi \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% + {\the\toks0}{\the\chapno}}}% \temp \unnumbnoderef \nobreak @@ -3652,7 +3678,7 @@ width0pt\relax} \fi \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% - {\the\toks0}}}% + {\the\toks0}{\the\chapno}{\the\secno}}}% \temp \unnumbnoderef \nobreak @@ -3693,7 +3719,7 @@ width0pt\relax} \fi \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% - {\the\toks0}}}% + {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \unnumbnoderef \nobreak @@ -3905,7 +3931,7 @@ width0pt\relax} \fi % argument, which will end up as the last argument to the \...entry macro. % % We open the .toc file here instead of at @setfilename or any other -% given time so that @contents can be put in the document anywhere. +% fixed time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% @@ -3914,6 +3940,14 @@ width0pt\relax} \fi \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi + % + % Tell \shipout to create a page destination if we're doing pdf, which + % will be the target of the links in the table of contents. We can't + % just do it on every page because the title pages are numbered 1 and + % 2 (the page numbers aren't printed), and so are the first two pages + % of the document. Thus, we'd have two destinations named `1', and + % two named `2'. + \ifpdf \pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in @@ -3978,11 +4012,11 @@ width0pt\relax} \fi \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2{} + \def\unnumbsecentry ##1##2##3{} \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2{} + \def\unnumbsubsecentry ##1##2##3##4{} \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2{} + \def\unnumbsubsubsecentry ##1##2##3##4##5{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 @@ -4044,16 +4078,16 @@ width0pt\relax} \fi % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} +\def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} +\def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} +\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc @@ -4114,36 +4148,27 @@ width0pt\relax} \fi \message{environments,} % @foo ... @end foo. +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. -% Furthermore, these definitions must come after we define our fonts. -\newbox\dblarrowbox \newbox\longdblarrowbox -\newbox\pushcharbox \newbox\bullbox -\newbox\equivbox \newbox\errorbox - -%{\tentt -%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} -%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} -%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} -%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} -% Adapted from the manmac format (p.420 of TeXbook) -%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex -% depth .1ex\hfil} -%} - -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} +% The @error{} command. % Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} - +% \global\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. @@ -4154,8 +4179,7 @@ width0pt\relax} \fi \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} - -% The @error{} command. +% \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. @@ -4195,9 +4219,9 @@ width0pt\relax} \fi \def\@{@}% \let\Etex=\endgroup} -% Define @lisp ... @endlisp. +% Define @lisp ... @end lisp. % @lisp does a \begingroup so it can rebind things, -% including the definition of @endlisp (which normally is erroneous). +% including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in @@ -4595,6 +4619,21 @@ width0pt\relax} \fi \endgroup\nonfillfinish\endgroup } +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +\newbox\copyingbox +% +\def\copying{\begingroup + \parindent = 0pt % looks wrong on title page + \def\Ecopying{\egroup\endgroup}% + \global\setbox\copyingbox = \vbox\bgroup +} + +% @insertcopying. +% +\def\insertcopying{\unvcopy\copyingbox} + \message{defuns,} % @defun etc. @@ -4691,56 +4730,60 @@ width0pt\relax} \fi {\df #1}\enskip % Generate function name } -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - +% Common pieces to start any @def... % #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. +% #2 is the \...x control sequence (which our caller defines). +% #3 is the control sequence to process the header, such as \defunheader. +% +\def\parsebodycommon#1#2#3{% + \begingroup\inENV + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we want to allow a + % break after all. + \ifnum\lastpenalty = 10000 \penalty0 \fi + \medbreak + % + % Define the \E... end token that this defining construct specifies + % so that it will exit this group. + \def#1{\endgraf\endgroup\medbreak}% + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +% Process body of @defun, @deffn, @defmac, etc. +% +\def\defparsebody#1#2#3{% + \parsebodycommon{#1}{#2}{#3}% + \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% + \catcode61=\active % 61 is `=' + \begingroup\obeylines\activeparens + \spacesplit#3% +} + +% #1, #2, #3 are the common arguments (see \defparsebody). % #4, delimited by the space, is the class name. % -\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} +\def\defmethparsebody#1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#4}}% +} % Used for @deftypemethod and @deftypeivar. -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. +% #1, #2, #3 are the common arguments (see \defparsebody). % #4, delimited by a space, is the class name. % #5 is the method's return type. % -\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% +\def\deftypemethparsebody#1#2#3#4 #5 {% + \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} + \begingroup\obeylines\activeparens + \spacesplit{#3{#4}{#5}}% +} % Used for @deftypeop. The change from \deftypemethparsebody is an % extra argument at the beginning which is the `category', instead of it @@ -4749,64 +4792,49 @@ width0pt\relax} \fi % input at hand. Thus also need a control sequence (passed as #5) for % the \E... definition to assign the category name to. % -\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% +\def\deftypeopparsebody#1#2#3#4#5 #6 {% + \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 ##3 {% \def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} + \begingroup\obeylines\activeparens + \spacesplit{#3{#5}{#6}}% +} + +% For @defop. +\def\defopparsebody #1#2#3#4#5 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 {\def#4{##1}% + \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#5}}% +} % These parsing functions are similar to the preceding ones % except that they do not make parens into active characters. % These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. % -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent +\def\defvarparsebody #1#2#3{% + \parsebodycommon{#1}{#2}{#3}% + \def#2{\begingroup\obeylines\spacesplit#3}% + \catcode61=\active % \begingroup\obeylines + \spacesplit#3% +} + +% @defopvar. +\def\defopvarparsebody #1#2#3#4#5 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 {\def#4{##1}% + \begingroup\obeylines\spacesplit{#3{##2}}}% + \begingroup\obeylines + \spacesplit{#3{#5}}% } \def\defvrparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \begingroup\obeylines \spacesplit{#3{#4}}% } @@ -4821,6 +4849,8 @@ width0pt\relax} \fi % \def\deftpparsebody #1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \begingroup\obeylines \spacesplit{\parsetpheaderline{#3{#4}}}\empty } @@ -4837,33 +4867,19 @@ width0pt\relax} \fi #1{\removeemptybraces#2\relax}{#3}% }% -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} - % Split up #2 at the first space token. % call #1 with two arguments: % the first is all of #2 before the space token, % the second is all of #2 after that space token. % If #2 contains no space token, all of it is passed as the first arg % and the second is passed as empty. - +% {\obeylines \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% \ifx\relax #3% #1{#2}{}\else #1{#2}{#3#4}\fi}} -% So much for the things common to all kinds of definitions. - % Define @defun. % First, define the processing that is wanted for arguments of \defun @@ -5273,7 +5289,7 @@ width0pt\relax} \fi \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax - \else \errmessage{The name \the\macname\space is reserved}\fi + \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% % Add the macroname to \macrolist @@ -6173,7 +6189,7 @@ should work if nowhere else does.} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} -\def\normaldollar{$} +\def\normaldollar{$}%$ font-lock fix % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, @@ -6222,7 +6238,7 @@ should work if nowhere else does.} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar} +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix %\catcode 27=\active %\def^^[{$\diamondsuit$} @@ -6267,7 +6283,7 @@ should work if nowhere else does.} @let<=@normalless @let>=@normalgreater @let+=@normalplus -@let$=@normaldollar} +@let$=@normaldollar}%$ font-lock fix @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @@ -6278,7 +6294,7 @@ should work if nowhere else does.} @let<=@normalless @let>=@normalgreater @let+=@normalplus -@let$=@normaldollar} +@let$=@normaldollar}%$ font-lock fix % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash.