From: nobody <> Date: Sun, 2 Feb 2003 23:00:07 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: interps-20030202-branchpoint X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cddd45abf62af6ed70c8c67601a9f09da0a939b0;p=external%2Fbinutils.git This commit was manufactured by cvs2svn to create branch 'interps-20030202-branch'. Sprout from cagney-unwind-20030108-branch 2003-01-09 20:50:26 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'cagney-' Cherrypick from master 2003-02-02 23:00:06 UTC Alan Modra 'daily update': ChangeLog Makefile.in Makefile.tpl bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/aclocal.m4 bfd/archures.c bfd/bfd-in2.h bfd/bfd.c bfd/coffcode.h bfd/config.bfd bfd/cpu-sh.c bfd/elf-bfd.h bfd/elf.c bfd/elf32-i386.c bfd/elf32-mips.c bfd/elf32-ppc.c bfd/elf32-s390.c bfd/elf32-sh.c bfd/elf32-sh64-com.c bfd/elf32-sh64.c bfd/elf32-sh64.h bfd/elf32-sparc.c bfd/elf64-alpha.c bfd/elf64-mips.c bfd/elf64-mmix.c bfd/elf64-ppc.c bfd/elf64-s390.c bfd/elf64-sparc.c bfd/elfn32-mips.c bfd/elfxx-ia64.c bfd/elfxx-mips.c bfd/elfxx-mips.h bfd/elfxx-target.h bfd/libbfd.h bfd/opncls.c bfd/po/SRC-POTFILES.in bfd/reloc.c bfd/version.h config.if configure configure.in gdb/ChangeLog gdb/ChangeLog-2002 gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/README gdb/acinclude.m4 gdb/aclocal.m4 gdb/ada-valprint.c gdb/alpha-nat.c gdb/alpha-tdep.c gdb/alpha-tdep.h gdb/ax-gdb.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/c-exp.y gdb/c-valprint.c gdb/charset.c gdb/cli/cli-decode.h gdb/cli/cli-script.c gdb/complaints.c gdb/complaints.h gdb/config.in gdb/config/alpha/nm-linux.h gdb/config/djgpp/fnchange.lst gdb/config/h8500/tm-h8500.h gdb/config/i386/tm-ptx.h gdb/config/i386/tm-symmetry.h gdb/config/i386/xm-i386sco.h gdb/config/m68k/nm-apollo68b.h gdb/config/m68k/tm-sun3.h gdb/config/nm-lynx.h gdb/config/ns32k/nm-nbsd.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/sparc/tm-sp64.h gdb/config/sparc/tm-sparc.h gdb/configure gdb/configure.host gdb/configure.in gdb/configure.tgt gdb/corefile.c gdb/corelow.c gdb/cp-valprint.c gdb/cris-tdep.c gdb/d10v-tdep.c gdb/dbxread.c gdb/defs.h gdb/demangle.c gdb/disasm.c gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/stabs.texinfo gdb/dummy-frame.c gdb/dummy-frame.h gdb/dve3900-rom.c gdb/dwarf2cfi.c gdb/dwarf2read.c gdb/dwarfread.c gdb/elfread.c gdb/eval.c gdb/exec.c gdb/expprint.c gdb/expression.h gdb/f-exp.y gdb/f-typeprint.c gdb/f-valprint.c gdb/findvar.c gdb/frame-unwind.c gdb/frame-unwind.h gdb/frame.c gdb/frame.h gdb/gcore.c gdb/gdb-stabs.h gdb/gdb_dirent.h gdb/gdb_indent.sh gdb/gdb_mbuild.sh gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbcore.h gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-v2-abi.c gdb/hppa-tdep.c gdb/hppab-nat.c gdb/hppah-nat.c gdb/hpread.c gdb/hpux-thread.c gdb/i386v-nat.c gdb/infcmd.c gdb/inferior.h gdb/infrun.c gdb/inftarg.c gdb/irix4-nat.c gdb/jv-typeprint.c gdb/language.c gdb/language.h gdb/lin-lwp.c gdb/linespec.c gdb/lynx-nat.c gdb/m32r-tdep.c gdb/m68klinux-nat.c gdb/main.c gdb/maint.c gdb/mdebugread.c gdb/mi/ChangeLog gdb/mi/gdbmi.texinfo gdb/mi/mi-cmd-env.c gdb/mi/mi-cmd-var.c gdb/mi/mi-main.c gdb/mips-nat.c gdb/mips-tdep.c gdb/mipsv4-nat.c gdb/mn10200-tdep.c gdb/monitor.c gdb/monitor.h gdb/objc-exp.y gdb/objfiles.c gdb/objfiles.h gdb/ocd.c gdb/parse.c gdb/proc-utils.h gdb/procfs.c gdb/remote-e7000.c gdb/remote-mips.c gdb/remote-sds.c gdb/remote-sim.c gdb/remote-vx.c gdb/rom68k-rom.c gdb/rs6000-nat.c gdb/scm-lang.c gdb/scm-lang.h gdb/sentinel-frame.c gdb/sentinel-frame.h gdb/ser-go32.c gdb/sh-tdep.c gdb/solib-svr4.c gdb/solib.c gdb/somread.c gdb/somsolib.c gdb/somsolib.h gdb/source.c gdb/sparc-tdep.c gdb/stabsread.c gdb/stabsread.h gdb/stack.c gdb/symfile.c gdb/symfile.h gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/gdb.arch/altivec-abi.exp gdb/testsuite/gdb.arch/altivec-regs.exp gdb/testsuite/gdb.asm/arm.inc gdb/testsuite/gdb.asm/asm-source.exp gdb/testsuite/gdb.base/advance.c gdb/testsuite/gdb.base/advance.exp gdb/testsuite/gdb.base/args.c gdb/testsuite/gdb.base/args.exp gdb/testsuite/gdb.base/break.exp gdb/testsuite/gdb.base/constvars.exp gdb/testsuite/gdb.base/default.exp gdb/testsuite/gdb.base/display.exp gdb/testsuite/gdb.base/float.exp gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.base/long_long.exp gdb/testsuite/gdb.base/mips_pro.exp gdb/testsuite/gdb.base/overlays.exp gdb/testsuite/gdb.base/printcmds.exp gdb/testsuite/gdb.base/relocate.exp gdb/testsuite/gdb.base/selftest.exp gdb/testsuite/gdb.base/setshow.exp gdb/testsuite/gdb.base/step-line.exp gdb/testsuite/gdb.base/step-test.exp gdb/testsuite/gdb.base/until.exp gdb/testsuite/gdb.c++/cplusfuncs.exp gdb/testsuite/gdb.c++/demangle.exp gdb/testsuite/gdb.c++/inherit.exp gdb/testsuite/gdb.c++/local.exp gdb/testsuite/gdb.c++/overload.exp gdb/testsuite/gdb.c++/printmethod.exp gdb/testsuite/gdb.c++/virtfunc.exp gdb/testsuite/gdb.mi/gdb669.exp gdb/testsuite/gdb.mi/gdb792.exp gdb/testsuite/gdb.mi/mi-console.exp gdb/testsuite/gdb.mi/mi-pthreads.exp gdb/testsuite/gdb.mi/mi-syn-frame.c gdb/testsuite/gdb.mi/mi-syn-frame.exp gdb/testsuite/gdb.mi/mi-var-child.exp gdb/testsuite/gdb.mi/mi-var-display.exp gdb/testsuite/gdb.mi/mi1-console.exp gdb/testsuite/gdb.mi/mi1-pthreads.exp gdb/testsuite/gdb.threads/killed.exp gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/mi-support.exp gdb/thread-db.c gdb/thread.c gdb/top.c gdb/typeprint.c gdb/utils.c gdb/v850ice.c gdb/valarith.c gdb/valops.c gdb/value.h gdb/values.c gdb/version.in gdb/win32-nat.c gdb/x86-64-linux-nat.c gdb/x86-64-linux-tdep.c gdb/xcoffread.c gdb/z8k-tdep.c include/ChangeLog include/coff/ti.h include/coff/tic4x.h include/elf/ChangeLog include/elf/common.h include/elf/mips.h include/elf/ppc.h include/elf/ppc64.h include/elf/s390.h include/elf/sh.h include/elf/sparc.h include/hashtab.h include/opcode/ChangeLog include/opcode/hppa.h include/opcode/m68hc11.h include/splay-tree.h libiberty/ChangeLog libiberty/Makefile.in libiberty/configure libiberty/configure.in libiberty/functions.texi libiberty/hashtab.c libiberty/pex-common.h libiberty/pex-djgpp.c libiberty/pex-mpw.c libiberty/pex-msdos.c libiberty/pex-os2.c libiberty/pex-unix.c libiberty/pex-win32.c libiberty/pexecute.txh opcodes/ChangeLog opcodes/Makefile.am opcodes/Makefile.in opcodes/alpha-opc.c opcodes/po/POTFILES.in opcodes/sh-dis.c opcodes/sh-opc.h opcodes/sh64-dis.c opcodes/sparc-dis.c readline/ChangeLog.gdb readline/display.c sim/arm/ChangeLog sim/arm/README sim/h8300/ChangeLog sim/h8300/compile.c sim/mips/ChangeLog sim/mips/mips.igen Delete: gdb/a68v-nat.c gdb/config/i386/i386dgux.mh gdb/config/i386/i386mk.mh gdb/config/i386/i386mk.mt gdb/config/i386/i386v32.mh gdb/config/i386/tm-i386os9k.h gdb/config/i386/xm-i386v32.h gdb/config/m68k/es1800.mt gdb/hp300ux-nat.c gdb/mon960-rom.c gdb/nindy-share/Makefile gdb/nindy-share/Onindy.c gdb/nindy-share/README gdb/nindy-share/VERSION gdb/nindy-share/b.out.h gdb/nindy-share/block_io.h gdb/nindy-share/coff.h gdb/nindy-share/env.h gdb/nindy-share/nindy.c gdb/nindy-share/stop.h gdb/nindy-share/ttyflush.c gdb/nindy-tdep.c gdb/ptx4-nat.c gdb/remote-es.c gdb/saber.suppress libiberty/pexecute.c sim/arm/README.Cygnus --- diff --git a/ChangeLog b/ChangeLog index 5545640..6c4d112 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,57 @@ +2003-01-31 Frank Ch. Eigler + + * Makefile.tpl (all-sid): Add libiberty/bfd/opcodes dependencies. + * Makefile.in: Regenerated. + +2003-01-30 Alexandre Oliva + + * config.if: Copy from GCC. + +2003-01-27 Phil Edwards + + * configure.in: Revert 24Jan change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Revert previous change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Make rda native-only. + * configure: Regenerate. + +2003-01-19 Nathanael Nerode + + * configure.in: Add missing \. + * configure: Rebuilt. + +2003-01-17 Jakub Jelinek + + * configure.in (baseargs): Avoid using \| in sed regular + expressions. + * configure: Rebuilt. + +2003-01-16 Jakub Jelinek + + * configure.in (baseargs): Remove all supported forms of + --cache-file, --srcdir, --host, --build and --target options + from argument lists. + * configure: Rebuilt. + +2003-01-15 Alexandre Oliva + + * configure.in (noconfigdirs): Don't skip gas on IRIX 6. + * configure: Rebuilt. + +2003-01-09 Nathanael Nerode + + * configure.in: Substitute TOPLEVEL_CONFIGURE_ARGUMENTS. + * Makefile.tpl: Pass TOPLEVEL_CONFIGURE_ARGUMENTS to gcc. + * Makefile.in: Regenerate. + * configure: Regenerate. + 2003-01-09 Christian Cornelssen * Makefile.tpl (BASE_FLAGS_TO_PASS): Also pass DESTDIR. diff --git a/Makefile.in b/Makefile.in index 7acf526..453db17 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,9 @@ enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ gcc_version_trigger = @gcc_version_trigger@ gcc_version = @gcc_version@ +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ + srcdir = @srcdir@ prefix = @prefix@ @@ -7369,6 +7372,7 @@ configure-gcc: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ AR="$(AR)"; export AR; \ AS="$(AS)"; export AS; \ @@ -7578,7 +7582,7 @@ all-itcl: maybe-all-tcl maybe-all-tk # We put install-tcl before install-itcl because itcl wants to run a # program on installation which uses the Tcl libraries. install-itcl: maybe-install-tcl -all-sid: maybe-all-tcl maybe-all-tk +all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk install-sid: maybe-install-tcl maybe-install-tk all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb configure-tk: maybe-configure-tcl diff --git a/Makefile.tpl b/Makefile.tpl index 5e42382..9918494 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -49,6 +49,9 @@ enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ gcc_version_trigger = @gcc_version_trigger@ gcc_version = @gcc_version@ +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ + srcdir = @srcdir@ prefix = @prefix@ @@ -1105,6 +1108,7 @@ configure-gcc: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ AR="$(AR)"; export AR; \ AS="$(AS)"; export AS; \ @@ -1314,7 +1318,7 @@ all-itcl: maybe-all-tcl maybe-all-tk # We put install-tcl before install-itcl because itcl wants to run a # program on installation which uses the Tcl libraries. install-itcl: maybe-install-tcl -all-sid: maybe-all-tcl maybe-all-tk +all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk install-sid: maybe-install-tcl maybe-install-tk all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb configure-tk: maybe-configure-tcl diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 44f3ac3..ef1e407 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,361 @@ +2003-01-31 Graydon Hoare + + * Makefile.am (opncls.lo): Add dependency upon libiberty.h. + * Makefile.in: Regenerate. + * opncls.c (calc_crc32, get_debug_link_info, + seperate_debug_file_exists, find_seperate_debug_file): New + internal functions. + (bfd_follow_gnu_debuglink): New function. Follow the pointer + contained inside a .gnu_debuglink section. + * bfd-in2.h: Regenerate. + +2003-01-29 Alexandre Oliva + + * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference + entry->abfd when it's NULL. + +2003-01-27 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle + _bfd_elf_section_offset returning -2 the same way as -1. + + * elfxx-mips.c (mips_elf_multi_got): New function. + (struct mips_got_entry): Make symndx and gotidx signed. Moved + addend into union along with address and link hash entry. + (struct mips_got_info): Added bfd2got and next. + (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx. + (mips_elf_got_section, mips_elf_create_got_section): Use + SEC_EXCLUDE bit to tell whether we really need the got + section. Take boolean arguments to disregard an excluded + section, or to create it as excluded. Adjust all callers. + Use mips_elf_got_section all over. + (mips_elf_local_got_index, mips_elf_got_page, + mips_elf_got16_entry): Take input bfd as argument, and pass it + on to mips_elf_create_local_got_entry. + (mips_elf_global_got_index, mips_elf_create_local_got_entry): + Take input bfd as argument, and manage entries in the + appropriate GOT. + (mips_elf_got_offset_from_index): Take input bfd as argument, + and use it to adjust the GP offset of the bfd. + (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move + unreferenced GOT entries of global symbols to the end. + (mips_elf_record_global_got_symbol): Take input bfd as + argument. Add entries to the master GOT hash table. + (struct mips_elf_bfd2got_hash): New. + (struct mips_elf_got_per_bfd_arg): New. + (struct mips_elf_set_global_got_offset_arg): New. + (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash, + mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash, + mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd, + mips_elf_merge_gots, mips_elf_set_global_got_offset, + mips_elf_resolve_final_got_entry, + mips_elf_resolve_final_got_entries, mips_elf_adjust_gp, + mips_elf_got_for_ibfd): New functions. + (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT. + (MIPS_ELF_GOT_MAX_SIZE): New macro. + (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT. + (mips_elf_got_entry_hash): Take new fields into account. Use + mips_elf_hash_bfd_vma. + (mips_elf_got_entry_eq): Take new fields into account. + (mips_elf_create_got_section): Initialize new fields. + (mips_elf_calculate_relocation): Pass input_bfd to functions + that now take it. Adjust gp for the input_bfd. + (mips_elf_allocate_dynamic_relocation, + mips_elf_create_dynamic_relocation, + _bfd_mips_elf_create_dynamic_sections): Use... + (mips_elf_rel_dyn_section): New function. Borrow code from... + (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that + now take it. Create the got section if needed, even if + excluded, before recording a global got symbol. Move some + code to... + (mips_elf_record_local_got_symbol): New fn. + (_bfd_mips_elf_size_dynamic_sections): Disable combreloc. + Compute multi-got global entries offsets. Move GOT code to... + (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got + if the GOT is too big. + (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of + undefweak symbol to zero. Generate dynamic relocations for + non-primary GOT entries for global symbols. + (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got + case. Generate dynamic relocations for local got entries. + Sort dynamic relocations on N64 too, using... + (sort_dynamic_relocs_64): New fns. + (_bfd_mips_elf_hide_symbol): Adjust multi-got counters. + (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT. + +2003-01-27 Alexandre Oliva + + * bfd.c (struct _bfd): Added id field. + * opncls.c (_bfd_id_counter): New static variable. + (_bfd_new_bfd): Use it. + * bfd-in2.h: Rebuilt. + +2003-01-25 Alan Modra + + * elf32-sparc.c (bfd_elf32_new_section_hook): Define. + +2003-01-25 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs. + (elf32_sparc_rev32_howto): New variable. + (sparc_reloc_map): Add TLS relocs. + (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto): + Handle REV32. + (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject): + New functions. + (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry, + struct elf32_sparc_link_hash_table): + New structures. + (elf32_sparc_tdata, elf32_sparc_local_got_tls_type, + elf32_sparc_hash_table): Define. + (link_hash_newfunc, elf32_sparc_link_hash_table_create, + create_got_section, elf32_sparc_create_dynamic_sections, + elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New + functions. + (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc + reference counting. + (elf32_sparc_gc_sweep_hook): Likewise. + (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_size_dynamic_sections): Likewise. + (elf32_sparc_relocate_section): Likewise. + (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff): + New functions. + (elf32_sparc_object_p): Allocate backend private object data. + (bfd_elf32_bfd_link_hash_table_create, + elf_backend_copy_indirect_symbol, bfd_elf32_mkobject, + elf_backend_can_refcount): Define. + (elf_backend_create_dynamic_sections): Define to + elf32_sparc_create_dynamic_sections. + * reloc.c: Add SPARC TLS relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs. + (sparc_reloc_map): Likewise. + +2003-01-24 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition, + s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions. + (elf_howto_table): Add TLS relocs. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_link_hash_entry): Add tls_type. + (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type): + New macros. + (elf_s390_link_hash_table): Add tls_ldm_got. + (link_hash_newfunc): Initialize tls_type. + (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got. + (elf_s390_copy_indirect_symbol): Copy tls_type information. + (elf_s390_check_relocs): Support TLS relocs. + (elf_s390_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject): Define for TLS. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add s390 TLS relocations. + +2003-01-24 Charles Lepple clepple.ghz.cc + + * aclocal.m4: Fix name of --enable-install-libbfd switch. + +2003-01-23 Nick Clifton + + * Add sh2e support: + + 2002-04-02 Elena Zannoni + + * archures.c (bfd_mach_sh2e): Added. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (arch_info_struct): Added SH2e. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E. + +2003-01-23 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change + dynindx to an int. Rearrange for better packing. + * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done. + * elf32-mips.c (bfd_elf32_new_section_hook): Define. + * elf32-sh64.h: New. Split out from include/elf/sh.h. + (struct _sh64_elf_section_data): New struct. + (sh64_elf_section_data): Don't dereference sh64_info (was tdata). + * elf32-sh64-com.c: Include elf32-sh64.h. + * elf32-sh64.c: Likewise. + (sh64_elf_new_section_hook): New function. + (bfd_elf32_new_section_hook): Define. + (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change. + (sh64_bfd_elf_copy_private_section_data): Likewise. + (sh64_elf_final_write_processing): Likewise. + * elf32-sparc.c (struct elf32_sparc_section_data): New. + (elf32_sparc_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (elf32_sparc_relax_section): Adjust to use sec_do_relax. + (elf32_sparc_relocate_section): Likewise. + * elf64-mips.c (bfd_elf64_new_section_hook): Define. + * elf64-mmix.c (struct _mmix_elf_section_data): New. + (mmix_elf_section_data): Define. Use throughout file. + (mmix_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-ppc.c (struct _ppc64_elf_section_data): New. + (ppc64_elf_section_data): Define. Use throughout. + (ppc64_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-sparc.c (struct sparc64_elf_section_data): New. + (sparc64_elf_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (sparc64_elf_relax_section): Adjust to use sec_do_relax. + (sparc64_elf_relocate_section): Likewise. + (bfd_elf64_new_section_hook): Define. + * elfn32-mips.c (bfd_elf32_new_section_hook): Define. + * elfxx-mips.c (struct _mips_elf_section_data): New. + (mips_elf_section_data): Define. Use throughout. + (_bfd_mips_elf_new_section_hook): New function. + (mips_elf_create_got_section): Don't alloc used_by_bfd. + * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare. + * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New. + (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value. + (elf64_alpha_adjust_dynamic_symbol): Set them. + (elf64_alpha_size_plt_section_1): Reset them when plt entry removed. + (elf64_alpha_relax_tls_get_addr): Handle LDM relocs. Frob the + symbol index when relaxing LDM to TPREL. + (elf64_alpha_relax_section): Likewise. Allow relaxation of GD + relocs, even if the target isn't locally defined. + (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero. + (elf64_alpha_relocate_section): Likewise. Force TP-relative + relocs vs symndx 0 to the tp base. + +2003-01-21 Fabio Alemagna + + * config.bfd: Handle i[3456]86-*-aros*. + +2003-01-21 Andreas Schwab + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define. + (struct ppc_elf_link_hash_entry): Define. + (ppc_elf_hash_entry): New function. + (struct ppc_elf_link_hash_table): Define. + (ppc_elf_hash_table): New function. + (ppc_elf_link_hash_newfunc): New function. + (ppc_elf_link_hash_table_create): New function. + (ppc_elf_copy_indirect_symbol): New function. + (allocate_dynrelocs): New function. + (readonly_dynrelocs): New function. + (ppc_elf_size_dynamic_sections): Allocate space for dynamic + relocs and determine DT_TEXTREL. + (ppc_elf_check_relocs): Don't do that here, just count the + dynamic relocs. + (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the + removed section. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_copy_indirect_symbol): Define. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and + TPREL also get a reloc if shared. Remove SREL support. + (elf64_alpha_emit_dynrel): New. + (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL + and GOTTPREL relocs to local symbols against the tp base. + (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel. + + * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got + use count before clobbering r_type. + (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn + ordering would mean dataflow inspection is necessary. + +2003-01-20 Svein E. Seldal + + * coffcode.h (coff_set_flags): Added get/set arch hooks. + +2003-01-20 Fabio Alemagna + + * elf32-sh.c: Treat elfNN_bed like other macros defined in + elfxx-target.h and #undef it before #define'ing it. + * elf32-i386.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + +2003-01-20 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_adjust_gotplt): New prototype. + (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add + R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16, + R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16, + R_390_PLTOFF32 and R_390_PLTOFF64. + (elf_s390_reloc_type_lookup): Likewise. + (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track + of GOTPLT references to a function. + (link_hash_newfunc): Initialize gotplt_refcount. + (elf_s390_check_relocs): Move allocation of local_got_refcounts array + and creation of the got section out of the main switch. Add support + for the gotoff, gotplt and pltoff relocations. + (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt + and pltoff. + (elf_s390_adjust_gotplt): New function. + (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed + plt entries. + (allocate_dynrelocs): Add comment. + (elf_s390_relocate_section): Change r_type to unsigned. Add support + for gotoff, gotplt and pltoff relocations. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12, + BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64, + BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32 + and BFD_RELOC_390_PLTOFF64. + +2003-01-18 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle + R_IA64_TPREL64[LM]SB against non-global symbol properly. + +2003-01-16 Jakub Jelinek + + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add + self_dtpmod_done and self_dtpmod_offset. + (allocate_global_data_got): Only use one got entry for all + dtpmod relocs against local symbols. + (allocate_dynrel_entries): Only need .rela.got entry for + dtpmod against global symbol. + (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset. + Reserve space in .rela.got for the local dtpmod entry. + (set_got_entry): Initialize the common local dtpmod .got entry. + (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB + and R_IA_64_DTPREL64MSB. + +2003-01-16 Alan Modra + + * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h. + (R_PPC_*): Rename all occurrences to R_PPC64_*. + (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30. + (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type. + (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other + relative relocs, not with absolute ones. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-01-15 Andreas Schwab + + * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a + relocation against a non-allocated readonly section. + +2003-01-10 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too. + 2002-01-08 Klee Dienes * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 4a2f2e8..6f05319 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -877,7 +877,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/objalloc.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -1018,7 +1019,8 @@ coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/libiberty.h \ + coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h @@ -1180,10 +1182,10 @@ elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h +elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1215,20 +1217,22 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h elfxx-mips.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h +elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ + $(INCDIR)/coff/external.h $(INCDIR)/hashtab.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h elfxx-mips.h $(INCDIR)/elf/mips.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ $(INCDIR)/coff/external.h ecoffswap.h elf32-target.h -elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ +elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -1250,12 +1254,12 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(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-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h + $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -1545,7 +1549,7 @@ elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/reloc-macros.h \ elf64-ppc.h elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 798e2fb..e6a600f 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1410,7 +1410,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/objalloc.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -1551,7 +1552,8 @@ coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/libiberty.h \ + coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h @@ -1713,10 +1715,10 @@ elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h +elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1748,20 +1750,22 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h elfxx-mips.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h +elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ + $(INCDIR)/coff/external.h $(INCDIR)/hashtab.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h elfxx-mips.h $(INCDIR)/elf/mips.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ $(INCDIR)/coff/external.h ecoffswap.h elf32-target.h -elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ +elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -1783,12 +1787,12 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(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-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h + $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -2078,7 +2082,7 @@ elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/reloc-macros.h \ elf64-ppc.h elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index fd54b1b..9e739ea 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -139,7 +139,7 @@ AC_SUBST(INTLLIBS) AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, -[ --install-libbfd controls installation of libbfd and related headers], +[ --enable-install-libbfd controls installation of libbfd and related headers], install_libbfd_p=$enableval, if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes diff --git a/bfd/archures.c b/bfd/archures.c index f881444..08015f9 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -213,6 +213,7 @@ DESCRIPTION .#define bfd_mach_sh 1 .#define bfd_mach_sh2 0x20 .#define bfd_mach_sh_dsp 0x2d +.#define bfd_mach_sh2e 0x2e .#define bfd_mach_sh3 0x30 .#define bfd_mach_sh3_dsp 0x3d .#define bfd_mach_sh3e 0x3e diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index f679fcc..a079599 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -880,6 +880,9 @@ bfd_make_writable PARAMS ((bfd *abfd)); bfd_boolean bfd_make_readable PARAMS ((bfd *abfd)); +char * +bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir)); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1640,6 +1643,7 @@ enum bfd_architecture #define bfd_mach_sh 1 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2e 0x2e #define bfd_mach_sh3 0x30 #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e @@ -2162,6 +2166,32 @@ relocation types already defined. */ /* SPARC little endian relocation */ BFD_RELOC_SPARC_REV32, +/* SPARC TLS relocations */ + BFD_RELOC_SPARC_TLS_GD_HI22, + BFD_RELOC_SPARC_TLS_GD_LO10, + BFD_RELOC_SPARC_TLS_GD_ADD, + BFD_RELOC_SPARC_TLS_GD_CALL, + BFD_RELOC_SPARC_TLS_LDM_HI22, + BFD_RELOC_SPARC_TLS_LDM_LO10, + BFD_RELOC_SPARC_TLS_LDM_ADD, + BFD_RELOC_SPARC_TLS_LDM_CALL, + BFD_RELOC_SPARC_TLS_LDO_HIX22, + BFD_RELOC_SPARC_TLS_LDO_LOX10, + BFD_RELOC_SPARC_TLS_LDO_ADD, + BFD_RELOC_SPARC_TLS_IE_HI22, + BFD_RELOC_SPARC_TLS_IE_LO10, + BFD_RELOC_SPARC_TLS_IE_LD, + BFD_RELOC_SPARC_TLS_IE_LDX, + BFD_RELOC_SPARC_TLS_IE_ADD, + BFD_RELOC_SPARC_TLS_LE_HIX22, + BFD_RELOC_SPARC_TLS_LE_LOX10, + BFD_RELOC_SPARC_TLS_DTPMOD32, + BFD_RELOC_SPARC_TLS_DTPMOD64, + BFD_RELOC_SPARC_TLS_DTPOFF32, + BFD_RELOC_SPARC_TLS_DTPOFF64, + BFD_RELOC_SPARC_TLS_TPOFF32, + BFD_RELOC_SPARC_TLS_TPOFF64, + /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when @@ -2996,6 +3026,55 @@ into 22 bits. */ /* 32 bit rel. offset to GOT entry. */ BFD_RELOC_390_GOTENT, +/* 64 bit offset to GOT. */ + BFD_RELOC_390_GOTOFF64, + +/* 12-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT12, + +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT16, + +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT32, + +/* 64-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT64, + +/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLTENT, + +/* 16-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF16, + +/* 32-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF32, + +/* 64-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF64, + +/* s390 tls relocations. */ + BFD_RELOC_390_TLS_LOAD, + BFD_RELOC_390_TLS_GDCALL, + BFD_RELOC_390_TLS_LDCALL, + BFD_RELOC_390_TLS_GD32, + BFD_RELOC_390_TLS_GD64, + BFD_RELOC_390_TLS_GOTIE12, + BFD_RELOC_390_TLS_GOTIE32, + BFD_RELOC_390_TLS_GOTIE64, + BFD_RELOC_390_TLS_LDM32, + BFD_RELOC_390_TLS_LDM64, + BFD_RELOC_390_TLS_IE32, + BFD_RELOC_390_TLS_IE64, + BFD_RELOC_390_TLS_IEENT, + BFD_RELOC_390_TLS_LE32, + BFD_RELOC_390_TLS_LE64, + BFD_RELOC_390_TLS_LDO32, + BFD_RELOC_390_TLS_LDO64, + BFD_RELOC_390_TLS_DTPMOD, + BFD_RELOC_390_TLS_DTPOFF, + BFD_RELOC_390_TLS_TPOFF, + /* Scenix IP2K - 9-bit register number / data address */ BFD_RELOC_IP2K_FR9, @@ -3460,6 +3539,9 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb /* Extracted from bfd.c. */ struct _bfd { + /* A unique identifier of the BFD */ + unsigned int id; + /* The filename the application opened the BFD with. */ const char *filename; diff --git a/bfd/bfd.c b/bfd/bfd.c index f9051c0..1a332a8 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -36,6 +36,9 @@ CODE_FRAGMENT . .struct _bfd .{ +. {* A unique identifier of the BFD *} +. unsigned int id; +. . {* The filename the application opened the BFD with. *} . const char *filename; . diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 36ae1a9..7ce60db 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -2128,6 +2128,7 @@ coff_set_arch_mach_hook (abfd, filehdr) /* this TI COFF section should be used by all new TI COFF v0 targets */ case TICOFF0MAGIC: arch = TICOFF_TARGET_ARCH; + machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags); break; #endif #endif @@ -2142,6 +2143,7 @@ coff_set_arch_mach_hook (abfd, filehdr) #ifdef TI_TARGET_ID case TI_TARGET_ID: arch = TICOFF_TARGET_ARCH; + machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags); break; #endif default: @@ -2612,6 +2614,7 @@ coff_set_flags (abfd, magicp, flagsp) return FALSE; } } + TICOFF_TARGET_MACHINE_SET (flagsp, bfd_get_mach (abfd)); return TRUE; #endif diff --git a/bfd/config.bfd b/bfd/config.bfd index ec364a0..96d4765 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -374,6 +374,9 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; + i[3456]86-*-aros*) + targ_defvec=bfd_elf32_i386_vec + ;; i[3456]86-*-chorus*) targ_defvec=bfd_elf32_i386_vec ;; diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c index 3331c27..9d9087f 100644 --- a/bfd/cpu-sh.c +++ b/bfd/cpu-sh.c @@ -1,23 +1,23 @@ /* BFD library support routines for the Hitachi-SH architecture. - Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002 + Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Hacked by Steve Chamberlain of 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. */ #include "bfd.h" #include "sysdep.h" @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if 0 /* This routine is provided two arch_infos and returns whether - they'd be compatible */ + they'd be compatible. */ static const bfd_arch_info_type * compatible (a,b) @@ -33,20 +33,19 @@ compatible (a,b) const bfd_arch_info_type *b; { if (a->arch != b->arch || a->mach != b->mach) - return NULL; + return NULL; return a; } #endif #define SH_NEXT &arch_info_struct[0] #define SH2_NEXT &arch_info_struct[1] -#define SH_DSP_NEXT &arch_info_struct[2] -#define SH3_NEXT &arch_info_struct[3] -#define SH3_DSP_NEXT &arch_info_struct[4] -#define SH3E_NEXT &arch_info_struct[5] -#define SH4_NEXT NULL -#undef SH4_NEXT -#define SH4_NEXT &arch_info_struct[6] +#define SH2E_NEXT &arch_info_struct[2] +#define SH_DSP_NEXT &arch_info_struct[3] +#define SH3_NEXT &arch_info_struct[4] +#define SH3_DSP_NEXT &arch_info_struct[5] +#define SH3E_NEXT &arch_info_struct[6] +#define SH4_NEXT &arch_info_struct[7] #define SH64_NEXT NULL static const bfd_arch_info_type arch_info_struct[] = @@ -70,6 +69,20 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_sh, + bfd_mach_sh2e, + "sh", /* arch_name */ + "sh2e", /* printable name */ + 1, + FALSE, /* not the default */ + bfd_default_compatible, + bfd_default_scan, + SH2E_NEXT + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_sh, bfd_mach_sh_dsp, "sh", /* arch_name */ "sh-dsp", /* printable name */ diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 8e5e024..394f70c 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -941,13 +941,6 @@ struct bfd_elf_section_data /* The number of relocations currently assigned to REL_HDR2. */ unsigned int rel_count2; - /* A pointer to a linked list tracking dynamic relocs copied for - local symbols. */ - PTR local_dynrel; - - /* A pointer to the bfd section used for dynamic relocs. */ - asection *sreloc; - /* The ELF section number of this section. Only used for an output file. */ int this_idx; @@ -960,6 +953,12 @@ struct bfd_elf_section_data REL_HDR2 if any. Only used for an output file. */ int rel_idx2; + /* Used by the backend linker when generating a shared library to + record the dynamic symbol index for a section symbol + corresponding to this section. A value of 0 means that there is + no dynamic symbol for this section. */ + int dynindx; + /* Used by the backend linker to store the symbol hash table entries associated with relocs against global symbols. */ struct elf_link_hash_entry **rel_hashes; @@ -969,17 +968,12 @@ struct bfd_elf_section_data pointer may be NULL. It is used by the backend linker. */ Elf_Internal_Rela *relocs; - /* Used by the backend linker when generating a shared library to - record the dynamic symbol index for a section symbol - corresponding to this section. A value of 0 means that there is - no dynamic symbol for this section. */ - long dynindx; - - /* A pointer used for various section optimizations. */ - PTR sec_info; + /* A pointer to a linked list tracking dynamic relocs copied for + local symbols. */ + PTR local_dynrel; - /* Type of that information. */ - enum elf_link_info_type sec_info_type; + /* A pointer to the bfd section used for dynamic relocs. */ + asection *sreloc; union { /* Group name, if this section is a member of a group. */ @@ -993,8 +987,11 @@ struct bfd_elf_section_data the linker. */ asection *next_in_group; - /* A pointer available for the processor specific ELF backend. */ - PTR tdata; + /* A pointer used for various section optimizations. */ + PTR sec_info; + + /* Type of sec_info information. */ + enum elf_link_info_type sec_info_type; /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; diff --git a/bfd/elf.c b/bfd/elf.c index 22349bd..7c20971 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,6 +1,6 @@ /* ELF executable support for BFD. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2136,12 +2136,16 @@ _bfd_elf_new_section_hook (abfd, sec) asection *sec; { struct bfd_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); - sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt); - if (!sdata) - return FALSE; - sec->used_by_bfd = (PTR) sdata; + sdata = (struct bfd_elf_section_data *) sec->used_by_bfd; + if (sdata == NULL) + { + bfd_size_type amt = sizeof (*sdata); + sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + } /* Indicate whether or not this section should use RELA relocations. */ sdata->use_rela_p diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 9c94887..69292da 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1,22 +1,22 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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" @@ -41,9 +41,9 @@ static struct bfd_hash_entry *link_hash_newfunc static struct bfd_link_hash_table *elf_i386_link_hash_table_create PARAMS ((bfd *)); static bfd_boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf_i386_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static void elf_i386_copy_indirect_symbol PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, struct elf_link_hash_entry *)); @@ -51,9 +51,9 @@ static int elf_i386_tls_transition PARAMS ((struct bfd_link_info *, int, int)); static bfd_boolean elf_i386_mkobject - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean elf_i386_object_p - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean elf_i386_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -88,7 +88,7 @@ static enum elf_reloc_type_class elf_i386_reloc_type_class static bfd_boolean elf_i386_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -#define USE_REL 1 /* 386 uses REL relocations instead of RELA */ +#define USE_REL 1 /* 386 uses REL relocations instead of RELA. */ #include "elf/i386.h" @@ -3423,11 +3423,8 @@ elf_i386_post_process_headers (abfd, link_info) } #undef elf_backend_post_process_headers -#define elf_backend_post_process_headers elf_i386_post_process_headers - -#define elf32_bed elf32_i386_fbsd_bed +#define elf_backend_post_process_headers elf_i386_post_process_headers +#undef elf32_bed +#define elf32_bed elf32_i386_fbsd_bed #include "elf32-target.h" - -#undef elf_backend_post_process_headers -#undef elf32_bed diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 485bd2c..1399f00 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -1917,6 +1917,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define bfd_elf32_bfd_is_local_label_name \ mips_elf_is_local_label_name #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf32_bfd_get_relocated_section_contents \ _bfd_elf_mips_get_relocated_section_contents diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 2406c67..acd9d84 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1,5 +1,5 @@ /* PowerPC-specific support for 32-bit ELF - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -33,6 +33,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* RELA relocations are used here. */ +static struct bfd_hash_entry *ppc_elf_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_link_hash_table *ppc_elf_link_hash_table_create + PARAMS ((bfd *abfd)); +static void ppc_elf_copy_indirect_symbol + PARAMS ((struct elf_backend_data *bed, struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind)); static reloc_howto_type *ppc_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void ppc_elf_info_to_howto @@ -77,6 +85,10 @@ static bfd_boolean ppc_elf_gc_sweep_hook const Elf_Internal_Rela *relocs)); static bfd_boolean ppc_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static bfd_boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static bfd_boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); static bfd_boolean ppc_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean ppc_elf_relocate_section @@ -134,6 +146,149 @@ static bfd_boolean ppc_elf_grok_psinfo || ELF_ST_VISIBILITY (H->other) != STV_DEFAULT) \ && (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) +/* The PPC linker needs to keep track of the number of relocs that it + 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 ppc_elf_dyn_relocs +{ + struct ppc_elf_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ + bfd_size_type count; +}; + +/* PPC ELF linker hash entry. */ + +struct ppc_elf_link_hash_entry +{ + struct elf_link_hash_entry root; + + /* Track dynamic relocs copied for this symbol. */ + struct ppc_elf_dyn_relocs *dyn_relocs; +}; + +#define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) + +/* PPC ELF linker hash table. */ + +struct ppc_elf_link_hash_table +{ + struct elf_link_hash_table root; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; + +/* Get the PPC ELF linker hash table from a link_info structure. */ + +#define ppc_elf_hash_table(p) \ + ((struct ppc_elf_link_hash_table *) (p)->hash) + +/* Create an entry in a PPC ELF linker hash table. */ + +static struct bfd_hash_entry * +ppc_elf_link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct ppc_elf_link_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) + ppc_elf_hash_entry (entry)->dyn_relocs = NULL; + + return entry; +} + +/* Create a PPC ELF linker hash table. */ + +static struct bfd_link_hash_table * +ppc_elf_link_hash_table_create (abfd) + bfd *abfd; +{ + struct ppc_elf_link_hash_table *ret; + + ret = ((struct ppc_elf_link_hash_table *) + bfd_malloc (sizeof (struct ppc_elf_link_hash_table))); + if (ret == NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, + ppc_elf_link_hash_newfunc)) + { + free (ret); + return NULL; + } + + ret->sym_sec.abfd = NULL; + + return &ret->root.root; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +ppc_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; + struct elf_link_hash_entry *dir, *ind; +{ + struct ppc_elf_link_hash_entry *edir, *eind; + + edir = (struct ppc_elf_link_hash_entry *) dir; + eind = (struct ppc_elf_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct ppc_elf_dyn_relocs **pp; + struct ppc_elf_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* 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 ppc_elf_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + 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); +} + static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max]; static reloc_howto_type ppc_elf_howto_raw[] = { @@ -1903,6 +2058,65 @@ ppc_elf_adjust_dynamic_symbol (info, h) return TRUE; } +/* Allocate space in associated reloc sections for dynamic relocs. */ + +static bfd_boolean +allocate_dynrelocs (h, info) + struct elf_link_hash_entry *h; + PTR info ATTRIBUTE_UNUSED; +{ + struct ppc_elf_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; + + for (p = ppc_elf_hash_entry (h)->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 bfd_boolean +readonly_dynrelocs (h, info) + struct elf_link_hash_entry *h; + PTR info; +{ + struct ppc_elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + { + asection *s = p->sec->output_section; + + if (s != NULL + && ((s->flags & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC))) + { + ((struct bfd_link_info *) info)->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return FALSE; + } + } + return TRUE; +} + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -1914,6 +2128,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) asection *s; bfd_boolean plt; bfd_boolean relocs; + bfd *ibfd; #ifdef DEBUG fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); @@ -1953,6 +2168,45 @@ ppc_elf_size_dynamic_sections (output_bfd, info) } } + /* Allocate space for local sym dynamic relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct ppc_elf_dyn_relocs *p; + + for (p = ((struct ppc_elf_dyn_relocs *) + elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + 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) + { + elf_section_data (p->sec)->sreloc->_raw_size + += p->count * sizeof (Elf32_External_Rela); + if ((p->sec->output_section->flags + & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC)) + info->flags |= DF_TEXTREL; + } + } + } + } + + /* Allocate space for global sym dynamic relocs. */ + elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, NULL); + /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ @@ -2064,11 +2318,16 @@ ppc_elf_size_dynamic_sections (output_bfd, info) 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 (elf_hash_table (info), readonly_dynrelocs, + (PTR) info); + if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) return FALSE; - info->flags |= DF_TEXTREL; } } #undef add_dynamic_entry @@ -2403,6 +2662,9 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) default: if (info->shared) { + struct ppc_elf_dyn_relocs *p; + struct ppc_elf_dyn_relocs **head; + #ifdef DEBUG fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n", (h && h->root.root.string) ? h->root.root.string : ""); @@ -2437,18 +2699,46 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return FALSE; } - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; + elf_section_data (sec)->sreloc = sreloc; } - sreloc->_raw_size += sizeof (Elf32_External_Rela); + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + { + head = &ppc_elf_hash_entry (h)->dyn_relocs; + } + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = (bfd_section_from_r_symndx + (abfd, &ppc_elf_hash_table (info)->sym_sec, + sec, r_symndx)); + if (s == NULL) + return FALSE; + + head = ((struct ppc_elf_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + } + + p = *head; + if (p == NULL || p->sec != sec) + { + p = ((struct ppc_elf_dyn_relocs *) + bfd_alloc (elf_hash_table (info)->dynobj, sizeof *p)); + if (p == NULL) + return FALSE; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + } - /* FIXME: We should here do what the m68k and i386 - backends do: if the reloc is pc-relative, record it - in case it turns out that the reloc is unnecessary - because the symbol is forced local by versioning or - we are linking with -Bdynamic. Fortunately this - case is not frequent. */ + p->count++; } break; @@ -2514,6 +2804,8 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) 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); @@ -2552,9 +2844,26 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) if (h->plt.refcount > 0) h->plt.refcount--; } - break; + /* Fall through */ default: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_elf_dyn_relocs **pp, *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + for (pp = &ppc_elf_hash_entry (h)->dyn_relocs; + (p = *pp) != NULL; + pp = &p->next) + if (p->sec == sec) + { + if (--p->count == 0) + *pp = p->next; + break; + } + } break; } @@ -3414,6 +3723,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = sgot->output_offset + off - 4; } + if (r_type == R_PPC_GOT16_HA) + addend += ((relocation + addend) & 0x8000) << 1; break; /* Indirect .sdata relocation */ @@ -3946,7 +4257,7 @@ ppc_elf_begin_write_processing (abfd, link_info) unsigned long datum; char * ptr; - + asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME); if (asec == NULL) continue; @@ -3957,7 +4268,7 @@ ppc_elf_begin_write_processing (abfd, link_info) error_message = _("corrupt or empty %s section in %s"); goto fail; } - + if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0 || (bfd_bread (buffer + offset, length, ibfd) != length)) { @@ -4011,7 +4322,7 @@ ppc_elf_begin_write_processing (abfd, link_info) if (! bfd_set_section_size (abfd, asec, output_section_size)) ibfd = abfd, error_message = _("warning: unable to set size of %s section in %s"); - + fail: free (buffer); @@ -4071,7 +4382,7 @@ ppc_elf_final_write_processing (abfd, linker) bfd_put_32 (abfd, num_entries, buffer + 4); bfd_put_32 (abfd, 0x2, buffer + 8); strcpy (buffer + 12, APUINFO_LABEL); - + length = 20; for (i = 0; i < num_entries; i++) { @@ -4081,10 +4392,10 @@ ppc_elf_final_write_processing (abfd, linker) if (length != asec->_raw_size) _bfd_error_handler (_("failed to compute new APUinfo section.")); - + if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length)) _bfd_error_handler (_("failed to install new APUinfo section.")); - + free (buffer); apuinfo_list_finish (); @@ -4120,6 +4431,7 @@ ppc_elf_final_write_processing (abfd, linker) #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags #define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link +#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create #define elf_backend_object_p ppc_elf_object_p #define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook @@ -4128,6 +4440,7 @@ ppc_elf_final_write_processing (abfd, linker) #define elf_backend_relocate_section ppc_elf_relocate_section #define elf_backend_create_dynamic_sections ppc_elf_create_dynamic_sections #define elf_backend_check_relocs ppc_elf_check_relocs +#define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook #define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index d9859b8..e8d94af 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -51,6 +51,9 @@ static asection *elf_s390_gc_mark_hook static bfd_boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +struct elf_s390_link_hash_entry; +static void elf_s390_adjust_gotplt + PARAMS ((struct elf_s390_link_hash_entry *)); static bfd_boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean allocate_dynrelocs @@ -69,10 +72,22 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf_s390_mkobject + PARAMS ((bfd *)); static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); static bfd_boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); +static int elf_s390_tls_transition + PARAMS ((struct bfd_link_info *, int, int)); +static bfd_reloc_status_type s390_tls_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); +static void invalid_tls_insn + PARAMS ((bfd *, asection *, Elf_Internal_Rela *)); #include "elf/s390.h" @@ -94,28 +109,105 @@ static reloc_howto_type elf_howto_table[] = 0, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), - HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), - HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), - HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), - HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_GOTOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), - HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), + HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,0xffffffff, TRUE), + EMPTY_HOWTO (R_390_64), /* Empty entry for R_390_64. */ + EMPTY_HOWTO (R_390_PC64), /* Empty entry for R_390_PC64. */ + EMPTY_HOWTO (R_390_GOT64), /* Empty entry for R_390_GOT64. */ + EMPTY_HOWTO (R_390_PLT64), /* Empty entry for R_390_PLT64. */ + HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE), + EMPTY_HOWTO (R_390_GOTOFF64), /* Empty entry for R_390_GOTOFF64. */ + HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE), + EMPTY_HOWTO (R_390_GOTPLT64), /* Empty entry for R_390_GOTPLT64. */ + HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE), + EMPTY_HOWTO (R_390_PLTOFF64), /* Empty entry for R_390_PLTOFF64. */ + HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LOAD", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_GDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_LDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GD32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GD32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_GD64), /* Empty entry for R_390_TLS_GD64. */ + HOWTO(R_390_TLS_GOTIE12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE12", FALSE, 0, 0x00000fff, FALSE), + HOWTO(R_390_TLS_GOTIE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_GOTIE64), /* Empty entry for R_390_TLS_GOTIE64. */ + HOWTO(R_390_TLS_LDM32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDM32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LDM64), /* Empty entry for R_390_TLS_LDM64. */ + HOWTO(R_390_TLS_IE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_IE64), /* Empty entry for R_390_TLS_IE64. */ + HOWTO(R_390_TLS_IEENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IEENT", FALSE, 0, 0xffffffff, TRUE), + HOWTO(R_390_TLS_LE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LE64), /* Empty entry for R_390_TLS_LE64. */ + HOWTO(R_390_TLS_LDO32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDO32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LDO64), /* Empty entry for R_390_TLS_LDO64. */ + HOWTO(R_390_TLS_DTPMOD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPMOD", FALSE, 0, 0xffffffff, FALSE), + HOWTO(R_390_TLS_DTPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, 0xffffffff, FALSE), + HOWTO(R_390_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, 0xffffffff, FALSE), }; /* GNU extension to record C++ vtable hierarchy. */ @@ -160,7 +252,7 @@ elf_s390_reloc_type_lookup (abfd, code) case BFD_RELOC_390_RELATIVE: return &elf_howto_table[(int) R_390_RELATIVE]; case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; + return &elf_howto_table[(int) R_390_GOTOFF32]; case BFD_RELOC_390_GOTPC: return &elf_howto_table[(int) R_390_GOTPC]; case BFD_RELOC_390_GOT16: @@ -179,6 +271,48 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_GOTPCDBL]; case BFD_RELOC_390_GOTENT: return &elf_howto_table[(int) R_390_GOTENT]; + case BFD_RELOC_16_GOTOFF: + return &elf_howto_table[(int) R_390_GOTOFF16]; + case BFD_RELOC_390_GOTPLT12: + return &elf_howto_table[(int) R_390_GOTPLT12]; + case BFD_RELOC_390_GOTPLT16: + return &elf_howto_table[(int) R_390_GOTPLT16]; + case BFD_RELOC_390_GOTPLT32: + return &elf_howto_table[(int) R_390_GOTPLT32]; + case BFD_RELOC_390_GOTPLTENT: + return &elf_howto_table[(int) R_390_GOTPLTENT]; + case BFD_RELOC_390_PLTOFF16: + return &elf_howto_table[(int) R_390_PLTOFF16]; + case BFD_RELOC_390_PLTOFF32: + return &elf_howto_table[(int) R_390_PLTOFF32]; + case BFD_RELOC_390_TLS_LOAD: + return &elf_howto_table[(int) R_390_TLS_LOAD]; + case BFD_RELOC_390_TLS_GDCALL: + return &elf_howto_table[(int) R_390_TLS_GDCALL]; + case BFD_RELOC_390_TLS_LDCALL: + return &elf_howto_table[(int) R_390_TLS_LDCALL]; + case BFD_RELOC_390_TLS_GD32: + return &elf_howto_table[(int) R_390_TLS_GD32]; + case BFD_RELOC_390_TLS_GOTIE12: + return &elf_howto_table[(int) R_390_TLS_GOTIE12]; + case BFD_RELOC_390_TLS_GOTIE32: + return &elf_howto_table[(int) R_390_TLS_GOTIE32]; + case BFD_RELOC_390_TLS_LDM32: + return &elf_howto_table[(int) R_390_TLS_LDM32]; + case BFD_RELOC_390_TLS_IE32: + return &elf_howto_table[(int) R_390_TLS_IE32]; + case BFD_RELOC_390_TLS_IEENT: + return &elf_howto_table[(int) R_390_TLS_IEENT]; + case BFD_RELOC_390_TLS_LE32: + return &elf_howto_table[(int) R_390_TLS_LE32]; + case BFD_RELOC_390_TLS_LDO32: + return &elf_howto_table[(int) R_390_TLS_LDO32]; + case BFD_RELOC_390_TLS_DTPMOD: + return &elf_howto_table[(int) R_390_TLS_DTPMOD]; + case BFD_RELOC_390_TLS_DTPOFF: + return &elf_howto_table[(int) R_390_TLS_DTPOFF]; + case BFD_RELOC_390_TLS_TPOFF: + return &elf_howto_table[(int) R_390_TLS_TPOFF]; case BFD_RELOC_VTABLE_INHERIT: return &elf32_s390_vtinherit_howto; case BFD_RELOC_VTABLE_ENTRY: @@ -214,6 +348,23 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) } } +/* A relocation function which doesn't do anything. */ +static bfd_reloc_status_type +s390_tls_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) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + static bfd_boolean elf_s390_is_local_label_name (abfd, name) bfd *abfd; @@ -413,8 +564,62 @@ struct elf_s390_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_s390_dyn_relocs *dyn_relocs; + + /* Number of GOTPLT references for a function. */ + bfd_signed_vma gotplt_refcount; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 +#define GOT_TLS_IE_NLT 4 + unsigned char tls_type; +}; + +#define elf_s390_hash_entry(ent) \ + ((struct elf_s390_link_hash_entry *)(ent)) + +struct elf_s390_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; }; +#define elf_s390_tdata(abfd) \ + ((struct elf_s390_obj_tdata *) (abfd)->tdata.any) + +#define elf_s390_local_got_tls_type(abfd) \ + (elf_s390_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf_s390_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +static bfd_boolean +elf_s390_object_p (abfd) + bfd *abfd; +{ + /* Allocate our special target data. */ + struct elf_s390_obj_tdata *new_tdata; + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + new_tdata = bfd_zalloc (abfd, amt); + if (new_tdata == NULL) + return FALSE; + new_tdata->root = *abfd->tdata.elf_obj_data; + abfd->tdata.any = new_tdata; + /* Set the right machine number for an s390 elf32 file. */ + return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); +} + /* s390 ELF linker hash table. */ struct elf_s390_link_hash_table @@ -430,6 +635,11 @@ struct elf_s390_link_hash_table asection *sdynbss; asection *srelbss; + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -465,6 +675,8 @@ link_hash_newfunc (entry, table, string) eh = (struct elf_s390_link_hash_entry *) entry; eh->dyn_relocs = NULL; + eh->gotplt_refcount = 0; + eh->tls_type = GOT_UNKNOWN; } return entry; @@ -496,6 +708,7 @@ elf_s390_link_hash_table_create (abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; ret->sym_sec.abfd = NULL; return &ret->elf.root; @@ -608,9 +821,43 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } +static int +elf_s390_tls_transition (info, r_type, is_local) + struct bfd_link_info *info; + int r_type; + int is_local; +{ + if (info->shared) + return r_type; + + switch (r_type) + { + case R_390_TLS_GD32: + case R_390_TLS_IE32: + if (is_local) + return R_390_TLS_LE32; + return R_390_TLS_IE32; + case R_390_TLS_GOTIE32: + if (is_local) + return R_390_TLS_LE32; + return R_390_TLS_GOTIE32; + case R_390_TLS_LDM32: + return R_390_TLS_LE32; + } + + return r_type; +} + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ @@ -628,6 +875,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_signed_vma *local_got_refcounts; + int tls_type, old_tls_type; if (info->relocateable) return TRUE; @@ -635,12 +884,14 @@ elf_s390_check_relocs (abfd, info, sec, relocs) htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -659,40 +910,45 @@ elf_s390_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - switch (ELF32_R_TYPE (rel->r_info)) + /* Create got section and local_got_refcounts array if they + are needed. */ + r_type = elf_s390_tls_transition (info, + ELF32_R_TYPE (rel->r_info), + h == NULL); + switch (r_type) { case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: case R_390_GOT32: case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + case R_390_TLS_GD32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + case R_390_TLS_IE32: + case R_390_TLS_LDM32: + if (h == NULL + && local_got_refcounts == NULL) { - bfd_signed_vma *local_got_refcounts; - - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); + bfd_size_type size; + + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return FALSE; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf_s390_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); } - /* Fall through */ - - case R_390_GOTOFF: + /* Fall through. */ + case R_390_GOTOFF16: + case R_390_GOTOFF32: case R_390_GOTPC: case R_390_GOTPCDBL: if (htab->sgot == NULL) @@ -702,11 +958,22 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (!create_got_section (htab->elf.dynobj, info)) return FALSE; } + } + + switch (r_type) + { + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Got is created, nothing to be done. */ break; case R_390_PLT16DBL: case R_390_PLT32DBL: case R_390_PLT32: + case R_390_PLTOFF16: + case R_390_PLTOFF32: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code which is @@ -716,13 +983,118 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* If this is a local symbol, we resolve it directly without creating a procedure linkage table entry. */ - if (h == NULL) - continue; + if (h != NULL) + { + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + break; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + /* This symbol requires either a procedure linkage table entry + or an entry in the local got. We actually build the entry + in adjust_dynamic_symbol because whether this is really a + global reference can change and with it the fact if we have + to create a plt entry or a local got entry. To be able to + make a once global symbol a local one we have to keep track + of the number of gotplt references that exist for this + symbol. */ + if (h != NULL) + { + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + else + local_got_refcounts[r_symndx] += 1; break; + case R_390_TLS_LDM32: + htab->tls_ldm_got.refcount += 1; + break; + + case R_390_TLS_IE32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOTENT: + case R_390_TLS_GD32: + /* This symbol requires a global offset table entry. */ + switch (r_type) + { + default: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOTENT: + tls_type = GOT_NORMAL; + break; + case R_390_TLS_GD32: + tls_type = GOT_TLS_GD; + break; + case R_390_TLS_IE32: + case R_390_TLS_GOTIE32: + tls_type = GOT_TLS_IE; + break; + case R_390_TLS_GOTIE12: + case R_390_TLS_IEENT: + tls_type = GOT_TLS_IE_NLT; + break; + } + + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf_s390_hash_entry(h)->tls_type; + } + else + { + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf_s390_local_got_tls_type (abfd) [r_symndx]; + } + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN) + { + if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), h->root.root.string); + return FALSE; + } + if (old_tls_type > tls_type) + tls_type = old_tls_type; + } + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf_s390_hash_entry (h)->tls_type = tls_type; + else + elf_s390_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + + if (r_type != R_390_TLS_IE32) + break; + /* Fall through */ + + case R_390_TLS_LE32: + if (!info->shared) + break; + info->flags |= DF_STATIC_TLS; + /* Fall through */ + case R_390_8: case R_390_16: case R_390_32: @@ -955,6 +1327,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; unsigned long r_symndx; + int r_type; struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -965,86 +1338,153 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - 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; + { + r_symndx = ELF32_R_SYM (rel->r_info); - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_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_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + r_type = elf_s390_tls_transition (info, + ELF32_R_TYPE (rel->r_info), + r_symndx >= symtab_hdr->sh_info); + switch (r_type) + { + case R_390_TLS_LDM32: + if (elf_s390_hash_table (info)->tls_ldm_got.refcount > 0) + elf_s390_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_390_TLS_GD32: + case R_390_TLS_IE32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTPC: + case R_390_GOTPCDBL: + case R_390_GOTENT: + if (h != NULL) + { + 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; + } + if (r_type != R_390_TLS_IE32) + break; + /* Fall through */ + + case R_390_TLS_LE32: + if (!info->shared) + break; + /* Fall through */ + + case R_390_8: + case R_390_12: + case R_390_16: + case R_390_32: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32DBL: + case R_390_PC32: + if (h != NULL) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; + + if (!info->shared && h->plt.refcount > 0) + h->plt.refcount -= 1; + + eh = (struct elf_s390_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_390_PC16 + || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL + || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL + || ELF32_R_TYPE (rel->r_info) == R_390_PC32) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_390_PLT16DBL: + case R_390_PLT32DBL: + case R_390_PLT32: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + if (h != NULL) + { + if (h->plt.refcount > 0) { - if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 - || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount--; + h->plt.refcount -= 1; } - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_PLT32: - 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; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } +/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT + entry but we found we will not create any. Called when we find we will + not have any PLT for this symbol, by for example + elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, + or elf_s390_size_dynamic_sections if no dynamic sections will be + created (we're only linking static objects). */ + +static void +elf_s390_adjust_gotplt (h) + struct elf_s390_link_hash_entry *h; +{ + if (h->elf.root.type == bfd_link_hash_warning) + h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link; + + if (h->gotplt_refcount <= 0) + return; + + /* We simply add the number of gotplt references to the number + * of got references for this symbol. */ + h->elf.got.refcount += h->gotplt_refcount; + h->gotplt_refcount = -1; +} + /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the dynamic object, but we're not including those sections. We have to @@ -1082,6 +1522,7 @@ elf_s390_adjust_dynamic_symbol (info, h) linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } return TRUE; @@ -1218,6 +1659,9 @@ allocate_dynrelocs (h, inf) 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; @@ -1272,18 +1716,41 @@ allocate_dynrelocs (h, inf) { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } } else { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - if (h->got.refcount > 0) + /* If R_390_TLS_{IE32,GOTIE32,GOTIE12,IEENT} symbol is now local to + the binary, we can optimize a bit. IE32 and GOTIE32 get converted + to R_390_TLS_LE32 requiring no TLS entry. For GOTIE12 and IEENT + we can save the dynamic TLS relocation. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE) { + if (elf_s390_hash_entry(h)->tls_type == GOT_TLS_IE_NLT) + /* For the GOTIE access without a literal pool entry the offset has + to be stored somewhere. The immediate value in the instruction + is not bit enough so the value is stored in the got. */ + { + h->got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += GOT_ENTRY_SIZE; + } + else + h->got.offset = (bfd_vma) -1; + } + else if (h->got.refcount > 0) + { asection *s; bfd_boolean dyn; + int tls_type = elf_s390_hash_entry(h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -1297,8 +1764,18 @@ allocate_dynrelocs (h, inf) s = htab->sgot; h->got.offset = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + /* R_390_TLS_GD32 needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + /* R_390_TLS_IE32 needs one dynamic relocation, + R_390_TLS_GD32 needs one if local symbol and two if global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type >= GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else @@ -1444,6 +1921,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; + char *local_tls_type; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srela; @@ -1485,14 +1963,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = elf_s390_local_got_tls_type (ibfd); s = htab->sgot; srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + for (; local_got < end_local_got; ++local_got, ++local_tls_type) { if (*local_got > 0) { *local_got = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; if (info->shared) srela->_raw_size += sizeof (Elf32_External_Rela); } @@ -1501,6 +1982,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) } } + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM32 + relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE; + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + } + else + htab->tls_ldm_got.offset = -1; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); @@ -1611,6 +2103,58 @@ elf_s390_size_dynamic_sections (output_bfd, info) return TRUE; } +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; +{ + /* If tls_segment is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_segment == NULL) + return 0; + return elf_hash_table (info)->tls_segment->start; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_tls_segment *tls_segment + = elf_hash_table (info)->tls_segment; + + /* If tls_segment is NULL, we should have signalled an error already. */ + if (tls_segment == NULL) + return 0; + return (align_power (tls_segment->size, tls_segment->align) + + tls_segment->start - address); +} + +/* Complain if TLS instruction relocation is against an invalid + instruction. */ + +static void +invalid_tls_insn (input_bfd, input_section, rel) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rel; +{ + reloc_howto_type *howto; + + howto = elf_howto_table + ELF32_R_TYPE (rel->r_info); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name); +} + /* Relocate a 390 ELF section. */ static bfd_boolean @@ -1644,7 +2188,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + unsigned int r_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1654,12 +2198,13 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_reloc_status_type r; + int tls_type; r_type = ELF32_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT || r_type == (int) R_390_GNU_VTENTRY) continue; - if (r_type < 0 || r_type >= (int) R_390_max) + if (r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1667,6 +2212,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF32_R_SYM (rel->r_info); + + /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -1723,6 +2270,39 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, switch (r_type) { + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + /* There are three cases for a GOTPLT relocation. 1) The + relocation is against the jump slot entry of a plt that + will get emitted to the output file. 2) The relocation + is against the jump slot of a plt entry that has been + removed. elf_s390_adjust_gotplt has created a GOT entry + as replacement. 3) The relocation is against a local symbol. + Cases 2) and 3) are the same as the GOT relocation code + so we just have to test for case 1 and fall through for + the other two. */ + if (h != NULL && h->plt.offset != (bfd_vma) -1) + { + bfd_vma plt_index; + + /* Calc. index no. + Current offset - size first entry / entry size. */ + plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / + PLT_ENTRY_SIZE; + + /* Offset in GOT is PLT index plus GOT headers(3) times 4, + addr & GOT addr. */ + relocation = (plt_index + 3) * GOT_ENTRY_SIZE; + unresolved_reloc = FALSE; + + if (r_type == R_390_GOTPLTENT) + relocation += htab->sgot->output_section->vma; + break; + } + /* Fall through. */ + case R_390_GOT12: case R_390_GOT16: case R_390_GOT32: @@ -1821,12 +2401,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, * between the start of the GOT and the symbols entry. We * add the vma of the GOT to get the correct value. */ - if (r_type == R_390_GOTENT) + if ( r_type == R_390_GOTENT + || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; break; - case R_390_GOTOFF: + case R_390_GOTOFF16: + case R_390_GOTOFF32: /* Relocation is relative to the start of the global offset table. */ @@ -1871,6 +2453,28 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc = FALSE; break; + case R_390_PLTOFF16: + case R_390_PLTOFF32: + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ + + /* For local symbols or if we didn't make a PLT entry for + this symbol resolve the symbol directly. */ + if ( h == NULL + || h->plt.offset == (bfd_vma) -1 + || htab->splt == NULL) + { + relocation -= htab->sgot->output_section->vma; + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + - htab->sgot->output_section->vma); + unresolved_reloc = FALSE; + break; + case R_390_8: case R_390_16: case R_390_32: @@ -1969,6 +2573,330 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, } break; + /* Relocations for tls literal pool entries. */ + case R_390_TLS_IE32: + if (info->shared) + { + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); + } + /* Fall through */ + + case R_390_TLS_GD32: + case R_390_TLS_GOTIE32: + r_type = elf_s390_tls_transition (info, r_type, h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf_s390_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_LE32; + } + if (r_type == R_390_TLS_GD32 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_IE32; + + if (r_type == R_390_TLS_LE32) + { + /* This relocation gets optimized away by the local exec + access optimization. */ + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + continue; + } + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + off = h->got.offset; + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + } + + emit_tls_relocs: + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_390_TLS_GD32) + dr_type = R_390_TLS_DTPMOD; + else + dr_type = R_390_TLS_TPOFF; + if (dr_type == R_390_TLS_TPOFF && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, dr_type); + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + + if (r_type == R_390_TLS_GD32) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + GOT_ENTRY_SIZE); + } + else + { + outrel.r_info = ELF32_R_INFO (indx, R_390_TLS_DTPOFF); + outrel.r_offset += GOT_ENTRY_SIZE; + outrel.r_addend = 0; + htab->srelgot->reloc_count++; + loc += sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if (off >= (bfd_vma) -2) + abort (); + if (r_type == ELF32_R_TYPE (rel->r_info)) + { + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IE32 || r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + } + else + { + bfd_put_32 (output_bfd, htab->sgot->output_offset + off, + contents + rel->r_offset); + continue; + } + break; + + case R_390_TLS_GOTIE12: + case R_390_TLS_IEENT: + if (h == NULL) + { + if (local_got_offsets == NULL) + abort(); + off = local_got_offsets[r_symndx]; + if (info->shared) + goto emit_tls_relocs; + } + else + { + off = h->got.offset; + tls_type = elf_s390_hash_entry(h)->tls_type; + if (info->shared || h->dynindx != -1 || tls_type < GOT_TLS_IE) + goto emit_tls_relocs; + } + + if (htab->sgot == NULL) + abort (); + + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + htab->sgot->contents + off); + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LDM32: + if (! info->shared) + /* The literal pool entry this relocation refers to gets ignored + by the optimized code of the local exec model. Do nothing + and the value will turn out zero. */ + continue; + + if (htab->sgot == NULL) + abort (); + + off = htab->tls_ldm_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF32_R_INFO (0, R_390_TLS_DTPMOD); + outrel.r_addend = 0; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ldm_got.offset |= 1; + } + relocation = htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LE32: + if (info->shared) + { + /* Linking a shared library with non-fpic code requires + a R_390_TLS_TPOFF relocation. */ + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + int indx; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + if (h != NULL && h->dynindx != -1) + indx = h->dynindx; + else + indx = 0; + outrel.r_info = ELF32_R_INFO (indx, R_390_TLS_TPOFF); + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + } + continue; + + case R_390_TLS_LDO32: + if (info->shared || (input_section->flags & SEC_CODE) == 0) + relocation -= dtpoff_base (info); + else + /* When converting LDO to LE, we must negate. */ + relocation = -tpoff (info, relocation); + break; + + /* Relocations for tls instructions. */ + case R_390_TLS_LOAD: + case R_390_TLS_GDCALL: + case R_390_TLS_LDCALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf_s390_hash_entry(h)->tls_type; + + if (tls_type == GOT_TLS_GD) + continue; + + if (r_type == R_390_TLS_LOAD) + { + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* IE->LE transition. Four valid cases: + l %rx,0(0,%ry) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%ry,0) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%ry,%r12) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%r12,%ry) -> lr %rx,%ry + bcr 0,0 */ + unsigned int insn, ry; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + ry = 0; + if ((insn & 0xff00f000) == 0x58000000) + /* l %rx,0(%ry,0) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x000f0000); + else if ((insn & 0xff0f0000) == 0x58000000) + /* l %rx,0(0,%ry) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x0000f000) << 4; + else if ((insn & 0xff00f000) == 0x5800c000) + /* l %rx,0(%ry,%r12) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x000f0000); + else if ((insn & 0xff0f0000) == 0x580c0000) + /* l %rx,0(%r12,%ry) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x0000f000) << 4; + else + invalid_tls_insn (input_bfd, input_section, rel); + insn = 0x18000700 | (insn & 0x00f00000) | ry; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + } + else if (r_type == R_390_TLS_GDCALL) + { + unsigned int insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 0xff000fff) != 0x4d000000) + invalid_tls_insn (input_bfd, input_section, rel); + if (!info->shared && (h == NULL || h->dynindx == -1)) + /* GD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + else + /* GD->IE transition. + bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ + insn = 0x5822c000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + else if (r_type == R_390_TLS_LDCALL) + { + if (!info->shared) + { + unsigned int insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 0xff000fff) != 0x4d000000) + invalid_tls_insn (input_bfd, input_section, rel); + /* LD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + } + continue; + default: break; } @@ -2183,7 +3111,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_GD + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE_NLT) { Elf_Internal_Rela rela; bfd_byte *loc; @@ -2400,13 +3331,6 @@ elf_s390_finish_dynamic_sections (output_bfd, info) } static bfd_boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); -} - -static bfd_boolean elf_s390_grok_prstatus (abfd, note) bfd * abfd; Elf_Internal_Note * note; @@ -2473,6 +3397,7 @@ elf_s390_grok_prstatus (abfd, note) #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus +#define bfd_elf32_mkobject elf_s390_mkobject #define elf_backend_object_p elf_s390_object_p #include "elf32-target.h" diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 96cd778..f0e0177 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1,23 +1,23 @@ /* Hitachi SH specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, 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. */ #include "bfd.h" #include "sysdep.h" @@ -62,9 +62,9 @@ static void sh_elf_copy_indirect_symbol static int sh_elf_optimized_tls_reloc PARAMS ((struct bfd_link_info *, int, int)); static bfd_boolean sh_elf_mkobject - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean sh_elf_object_p - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean sh_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -85,7 +85,7 @@ static bfd_reloc_status_type sh_elf_reloc_loop PARAMS ((int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, bfd_vma, bfd_vma)); static bfd_boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean sh_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static bfd_vma dtpoff_base @@ -6724,6 +6724,9 @@ sh_elf_set_mach_from_flags (abfd) case EF_SH2: bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh2); break; + case EF_SH2E: + bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh2e); + break; case EF_SH_DSP: bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh_dsp); break; @@ -7328,7 +7331,7 @@ sh_elf_reloc_type_class (rela) } } -/* Support for Linux core dump NOTE sections */ +/* Support for Linux core dump NOTE sections. */ static bfd_boolean elf32_shlin_grok_prstatus (abfd, note) bfd *abfd; @@ -7462,12 +7465,11 @@ elf32_shlin_grok_psinfo (abfd, note) #define ELF_MAXPAGESIZE 0x10000 #undef elf_symbol_leading_char #define elf_symbol_leading_char 0 - +#undef elf32_bed #define elf32_bed elf32_sh_nbsd_bed #include "elf32-target.h" -#undef elf32_bed /* Linux support. */ #undef TARGET_BIG_SYM @@ -7483,13 +7485,9 @@ elf32_shlin_grok_psinfo (abfd, note) #define elf_backend_grok_prstatus elf32_shlin_grok_prstatus #undef elf_backend_grok_psinfo #define elf_backend_grok_psinfo elf32_shlin_grok_psinfo - +#undef elf32_bed #define elf32_bed elf32_sh_lin_bed #include "elf32-target.h" -#undef elf_backend_grok_prstatus -#undef elf_backend_grok_psinfo -#undef elf32_bed - #endif /* INCLUDE_SHMEDIA */ diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c index d89d7c7..107e504 100644 --- a/bfd/elf32-sh64-com.c +++ b/bfd/elf32-sh64-com.c @@ -1,5 +1,5 @@ /* Hitachi SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -24,6 +24,7 @@ #include "libbfd.h" #include "elf-bfd.h" #include "elf/sh.h" +#include "elf32-sh64.h" #include "../opcodes/sh64-opc.h" static bfd_boolean sh64_address_in_cranges diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index a6638e9..13953e6 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -1,5 +1,5 @@ /* Hitachi SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -23,6 +23,7 @@ #include "sysdep.h" #include "elf-bfd.h" #include "../opcodes/sh64-opc.h" +#include "elf32-sh64.h" /* Add a suffix for datalabel indirection symbols. It must not match any other symbols; user symbols with or without version or other @@ -37,6 +38,8 @@ struct sh64_find_section_vma_data bfd_vma addr; }; +static bfd_boolean sh64_elf_new_section_hook + PARAMS ((bfd *, asection *)); static bfd_boolean sh64_elf_copy_private_data PARAMS ((bfd *, bfd *)); static bfd_boolean sh64_elf_merge_private_data @@ -85,6 +88,8 @@ static void sh64_find_section_for_address #define elf_backend_final_write_processing sh64_elf_final_write_processing #define elf_backend_section_from_shdr sh64_backend_section_from_shdr +#define bfd_elf32_new_section_hook sh64_elf_new_section_hook + /* For objcopy, we need to set up sh64_elf_section_data (asection *) from incoming section flags. This is otherwise done in sh64elf.em when linking or tc-sh64.c when assembling. */ @@ -100,6 +105,24 @@ static void sh64_find_section_for_address #define INCLUDE_SHMEDIA #include "elf32-sh.c" +/* Tack some extra info on struct bfd_elf_section_data. */ + +static bfd_boolean +sh64_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct _sh64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct _sh64_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} + /* Set the SHF_SH5_ISA32 flag for ISA SHmedia code sections, and pass through SHT_SH5_CR_SORTED on a sorted .cranges section. */ @@ -109,9 +132,9 @@ sh64_elf_fake_sections (output_bfd, elf_section_hdr, asect) Elf_Internal_Shdr *elf_section_hdr; asection *asect; { - if (sh64_elf_section_data (asect) != NULL) + if (sh64_elf_section_data (asect)->sh64_info != NULL) elf_section_hdr->sh_flags - |= sh64_elf_section_data (asect)->contents_flags; + |= sh64_elf_section_data (asect)->sh64_info->contents_flags; /* If this section has the SEC_SORT_ENTRIES flag set, it is a sorted .cranges section passing through objcopy. */ @@ -300,7 +323,7 @@ sh64_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) if (! _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)) return FALSE; - sh64_sec_data = sh64_elf_section_data (isec); + sh64_sec_data = sh64_elf_section_data (isec)->sh64_info; if (sh64_sec_data == NULL) { sh64_sec_data = bfd_zmalloc (sizeof (struct sh64_section_data)); @@ -312,7 +335,7 @@ sh64_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) = (elf_section_data (isec)->this_hdr.sh_flags & (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED)); - sh64_elf_section_data (osec) = sh64_sec_data; + sh64_elf_section_data (osec)->sh64_info = sh64_sec_data; } return TRUE; @@ -656,7 +679,7 @@ sh64_elf_final_write_processing (abfd, linker) && cranges != NULL && elf_elfheader (abfd)->e_type != ET_EXEC && (ld_generated_cranges_size - = sh64_elf_section_data (cranges)->cranges_growth) != 0) + = sh64_elf_section_data (cranges)->sh64_info->cranges_growth) != 0) { bfd_vma incoming_cranges_size = ((cranges->_cooked_size != 0 @@ -765,13 +788,11 @@ sh64_elf_final_write_processing (abfd, linker) #define ELF_MAXPAGESIZE 0x10000 #undef elf_symbol_leading_char #define elf_symbol_leading_char 0 - +#undef elf32_bed #define elf32_bed elf32_sh64_nbsd_bed #include "elf32-target.h" -#undef elf32_bed - /* Linux support. */ #undef TARGET_BIG_SYM #define TARGET_BIG_SYM bfd_elf32_sh64blin_vec @@ -781,9 +802,8 @@ sh64_elf_final_write_processing (abfd, linker) #define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-sh64-linux" - +#undef elf32_bed #define elf32_bed elf32_sh64_lin_bed #include "elf32-target.h" -#undef elf32_bed diff --git a/bfd/elf32-sh64.h b/bfd/elf32-sh64.h new file mode 100644 index 0000000..87af05b --- /dev/null +++ b/bfd/elf32-sh64.h @@ -0,0 +1,83 @@ +/* SH ELF support for BFD. + Copyright 2003 Free Software Foundation, Inc. + + 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 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 ELF32_SH64_H +#define ELF32_SH64_H + +#define SH64_CRANGES_SECTION_NAME ".cranges" +enum sh64_elf_cr_type { + CRT_NONE = 0, + CRT_DATA = 1, + CRT_SH5_ISA16 = 2, + CRT_SH5_ISA32 = 3 +}; + +/* The official definition is this: + + typedef struct { + Elf32_Addr cr_addr; + Elf32_Word cr_size; + Elf32_Half cr_type; + } Elf32_CRange; + + but we have no use for that exact type. Instead we use this struct for + the internal representation. */ +typedef struct { + bfd_vma cr_addr; + bfd_size_type cr_size; + enum sh64_elf_cr_type cr_type; +} sh64_elf_crange; + +#define SH64_CRANGE_SIZE (4 + 4 + 2) +#define SH64_CRANGE_CR_ADDR_OFFSET 0 +#define SH64_CRANGE_CR_SIZE_OFFSET 4 +#define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4) + +/* Get the contents type of an arbitrary address, or return CRT_NONE. */ +extern enum sh64_elf_cr_type sh64_get_contents_type + PARAMS ((asection *, bfd_vma, sh64_elf_crange *)); + +/* Simpler interface. + FIXME: This seems redundant now that we export the interface above. */ +extern bfd_boolean sh64_address_is_shmedia PARAMS ((asection *, bfd_vma)); + +extern int _bfd_sh64_crange_qsort_cmpb PARAMS ((const void *, const void *)); +extern int _bfd_sh64_crange_qsort_cmpl PARAMS ((const void *, const void *)); +extern int _bfd_sh64_crange_bsearch_cmpb PARAMS ((const void *, const void *)); +extern int _bfd_sh64_crange_bsearch_cmpl PARAMS ((const void *, const void *)); + +struct sh64_section_data +{ + flagword contents_flags; + + /* Only used in the cranges section, but we don't have an official + backend-specific bfd field. */ + bfd_size_type cranges_growth; +}; + +struct _sh64_elf_section_data +{ + struct bfd_elf_section_data elf; + struct sh64_section_data *sh64_info; +}; + +#define sh64_elf_section_data(sec) \ + ((struct _sh64_elf_section_data *) elf_section_data (sec)) + +#endif /* ELF32_SH64_H */ diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 07137ba..dcdce31 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -35,10 +35,20 @@ static bfd_boolean elf32_sparc_check_relocs const Elf_Internal_Rela *)); static bfd_boolean elf32_sparc_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static bfd_boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static bfd_boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); static bfd_boolean elf32_sparc_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf32_sparc_new_section_hook + PARAMS ((bfd *, asection *)); static bfd_boolean elf32_sparc_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); static bfd_boolean elf32_sparc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -49,6 +59,22 @@ static bfd_boolean elf32_sparc_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf32_sparc_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static struct bfd_hash_entry *link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static struct bfd_link_hash_table *elf32_sparc_link_hash_table_create + PARAMS ((bfd *)); +static bfd_boolean create_got_section PARAMS ((bfd *, + struct bfd_link_info *)); +static bfd_boolean elf32_sparc_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static void elf32_sparc_copy_indirect_symbol + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); +static int elf32_sparc_tls_transition + PARAMS ((struct bfd_link_info *, bfd *, int, int)); + +static bfd_boolean elf32_sparc_mkobject + PARAMS ((bfd *)); static bfd_boolean elf32_sparc_object_p PARAMS ((bfd *)); static void elf32_sparc_final_write_processing @@ -68,6 +94,10 @@ static bfd_reloc_status_type sparc_elf_notsupported_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type sparc_elf_wdisp16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type sparc_elf_hix22_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type sparc_elf_lox10_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); reloc_howto_type _bfd_sparc_elf_howto_table[] = { @@ -131,12 +161,37 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), HOWTO(R_SPARC_UA64, 0,0, 0,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_UA64", FALSE,0,0x00000000,TRUE), HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE), - HOWTO(R_SPARC_REV32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_TLS_GD_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_GD_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_GD_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_GD_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_LDM_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LDM_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDO_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_TLS_LDO_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LDO_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LDO_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_LDO_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDO_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_IE_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_IE_LD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_LDX,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LDX",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LE_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_TLS_LE_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LE_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LE_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_DTPMOD32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPMOD64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF32,0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF32",FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPOFF64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF64",FALSE,0,0x00000000,TRUE) }; static reloc_howto_type elf32_sparc_vtinherit_howto = HOWTO (R_SPARC_GNU_VTINHERIT, 0,2,0,FALSE,0,complain_overflow_dont, NULL, "R_SPARC_GNU_VTINHERIT", FALSE,0, 0, FALSE); static reloc_howto_type elf32_sparc_vtentry_howto = HOWTO (R_SPARC_GNU_VTENTRY, 0,2,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_SPARC_GNU_VTENTRY", FALSE,0,0, FALSE); +static reloc_howto_type elf32_sparc_rev32_howto = + HOWTO(R_SPARC_REV32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", FALSE,0,0xffffffff,TRUE); struct elf_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; @@ -188,9 +243,33 @@ static const struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_7, R_SPARC_7 }, { BFD_RELOC_SPARC_5, R_SPARC_5 }, { BFD_RELOC_SPARC_6, R_SPARC_6 }, - { BFD_RELOC_SPARC_REV32, R_SPARC_REV32 }, + { BFD_RELOC_SPARC_TLS_GD_HI22, R_SPARC_TLS_GD_HI22 }, + { BFD_RELOC_SPARC_TLS_GD_LO10, R_SPARC_TLS_GD_LO10 }, + { BFD_RELOC_SPARC_TLS_GD_ADD, R_SPARC_TLS_GD_ADD }, + { BFD_RELOC_SPARC_TLS_GD_CALL, R_SPARC_TLS_GD_CALL }, + { BFD_RELOC_SPARC_TLS_LDM_HI22, R_SPARC_TLS_LDM_HI22 }, + { BFD_RELOC_SPARC_TLS_LDM_LO10, R_SPARC_TLS_LDM_LO10 }, + { BFD_RELOC_SPARC_TLS_LDM_ADD, R_SPARC_TLS_LDM_ADD }, + { BFD_RELOC_SPARC_TLS_LDM_CALL, R_SPARC_TLS_LDM_CALL }, + { BFD_RELOC_SPARC_TLS_LDO_HIX22, R_SPARC_TLS_LDO_HIX22 }, + { BFD_RELOC_SPARC_TLS_LDO_LOX10, R_SPARC_TLS_LDO_LOX10 }, + { BFD_RELOC_SPARC_TLS_LDO_ADD, R_SPARC_TLS_LDO_ADD }, + { BFD_RELOC_SPARC_TLS_IE_HI22, R_SPARC_TLS_IE_HI22 }, + { BFD_RELOC_SPARC_TLS_IE_LO10, R_SPARC_TLS_IE_LO10 }, + { BFD_RELOC_SPARC_TLS_IE_LD, R_SPARC_TLS_IE_LD }, + { BFD_RELOC_SPARC_TLS_IE_LDX, R_SPARC_TLS_IE_LDX }, + { BFD_RELOC_SPARC_TLS_IE_ADD, R_SPARC_TLS_IE_ADD }, + { BFD_RELOC_SPARC_TLS_LE_HIX22, R_SPARC_TLS_LE_HIX22 }, + { BFD_RELOC_SPARC_TLS_LE_LOX10, R_SPARC_TLS_LE_LOX10 }, + { BFD_RELOC_SPARC_TLS_DTPMOD32, R_SPARC_TLS_DTPMOD32 }, + { BFD_RELOC_SPARC_TLS_DTPMOD64, R_SPARC_TLS_DTPMOD64 }, + { BFD_RELOC_SPARC_TLS_DTPOFF32, R_SPARC_TLS_DTPOFF32 }, + { BFD_RELOC_SPARC_TLS_DTPOFF64, R_SPARC_TLS_DTPOFF64 }, + { BFD_RELOC_SPARC_TLS_TPOFF32, R_SPARC_TLS_TPOFF32 }, + { BFD_RELOC_SPARC_TLS_TPOFF64, R_SPARC_TLS_TPOFF64 }, { BFD_RELOC_VTABLE_INHERIT, R_SPARC_GNU_VTINHERIT }, { BFD_RELOC_VTABLE_ENTRY, R_SPARC_GNU_VTENTRY }, + { BFD_RELOC_SPARC_REV32, R_SPARC_REV32 } }; static reloc_howto_type * @@ -208,6 +287,9 @@ elf32_sparc_reloc_type_lookup (abfd, code) case BFD_RELOC_VTABLE_ENTRY: return &elf32_sparc_vtentry_howto; + case BFD_RELOC_SPARC_REV32: + return &elf32_sparc_rev32_howto; + default: for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++) { @@ -238,6 +320,10 @@ elf32_sparc_info_to_howto (abfd, cache_ptr, dst) cache_ptr->howto = &elf32_sparc_vtentry_howto; break; + case R_SPARC_REV32: + cache_ptr->howto = &elf32_sparc_rev32_howto; + break; + default: BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max_std); cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)]; @@ -320,6 +406,98 @@ sparc_elf_wdisp16_reloc (abfd, else return bfd_reloc_ok; } + +/* Handle the HIX22 reloc. */ + +static bfd_reloc_status_type +sparc_elf_hix22_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; +{ + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 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; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + insn = (insn &~ (bfd_vma) 0x3fffff) | (((~relocation) >> 10) & 0x3fffff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + return bfd_reloc_ok; +} + +/* Handle the LOX10 reloc. */ + +static bfd_reloc_status_type +sparc_elf_lox10_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; +{ + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 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; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + insn = (insn &~ (bfd_vma) 0x1fff) | 0x1c00 | (relocation & 0x3ff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + return bfd_reloc_ok; +} /* Functions for the SPARC ELF linker. */ @@ -348,6 +526,319 @@ sparc_elf_wdisp16_reloc (abfd, /* nop. */ #define PLT_ENTRY_WORD2 SPARC_NOP +/* The SPARC linker needs to keep track of the number of relocs that it + 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 elf32_sparc_dyn_relocs +{ + struct elf32_sparc_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; +}; + +/* SPARC ELF linker hash entry. */ + +struct elf32_sparc_link_hash_entry +{ + struct elf_link_hash_entry elf; + + /* Track dynamic relocs copied for this symbol. */ + struct elf32_sparc_dyn_relocs *dyn_relocs; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 + unsigned char tls_type; +}; + +#define elf32_sparc_hash_entry(ent) ((struct elf32_sparc_link_hash_entry *)(ent)) + +struct elf32_sparc_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; + + /* TRUE if TLS GD relocs has been seen for this object. */ + bfd_boolean has_tlsgd; +}; + +#define elf32_sparc_tdata(abfd) \ + ((struct elf32_sparc_obj_tdata *) (abfd)->tdata.any) + +#define elf32_sparc_local_got_tls_type(abfd) \ + (elf32_sparc_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf32_sparc_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf32_sparc_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +/* SPARC ELF linker hash table. */ + +struct elf32_sparc_link_hash_table +{ + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; + + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; + +/* Get the SPARC ELF linker hash table from a link_info structure. */ + +#define elf32_sparc_hash_table(p) \ + ((struct elf32_sparc_link_hash_table *) ((p)->hash)) + +/* Create an entry in an i386 ELF linker hash table. */ + +static struct bfd_hash_entry * +link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct elf32_sparc_link_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct elf32_sparc_link_hash_entry *eh; + + eh = (struct elf32_sparc_link_hash_entry *) entry; + eh->dyn_relocs = NULL; + eh->tls_type = GOT_UNKNOWN; + } + + return entry; +} + +/* Create a SPARC ELF linker hash table. */ + +static struct bfd_link_hash_table * +elf32_sparc_link_hash_table_create (abfd) + bfd *abfd; +{ + struct elf32_sparc_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf32_sparc_link_hash_table); + + ret = (struct elf32_sparc_link_hash_table *) bfd_malloc (amt); + if (ret == NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) + { + free (ret); + return NULL; + } + + ret->sgot = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; + ret->sym_sec.abfd = NULL; + + return &ret->elf.root; +} + +/* Create .got and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static bfd_boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_sparc_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return FALSE; + + htab = elf32_sparc_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + if (!htab->sgot) + 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 .plt, .rela.plt, .got, .rela.got, .dynbss, and + .rela.bss sections in DYNOBJ, and set up shortcuts to them in our + hash table. */ + +static bfd_boolean +elf32_sparc_create_dynamic_sections (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_sparc_link_hash_table *htab; + + htab = elf32_sparc_hash_table (info); + if (!htab->sgot && !create_got_section (dynobj, info)) + return FALSE; + + if (!_bfd_elf_create_dynamic_sections (dynobj, info)) + return FALSE; + + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) + htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); + + if (!htab->splt || !htab->srelplt || !htab->sdynbss + || (!info->shared && !htab->srelbss)) + abort (); + + return TRUE; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +elf32_sparc_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; + struct elf_link_hash_entry *dir, *ind; +{ + struct elf32_sparc_link_hash_entry *edir, *eind; + + edir = (struct elf32_sparc_link_hash_entry *) dir; + eind = (struct elf32_sparc_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* 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 elf32_sparc_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; + } + + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +static int +elf32_sparc_tls_transition (info, abfd, r_type, is_local) + struct bfd_link_info *info; + bfd *abfd; + int r_type; + int is_local; +{ + if (r_type == R_SPARC_TLS_GD_HI22 + && ! elf32_sparc_tdata (abfd)->has_tlsgd) + r_type = R_SPARC_REV32; + + if (info->shared) + return r_type; + + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + if (is_local) + return R_SPARC_TLS_LE_HIX22; + return R_SPARC_TLS_IE_HI22; + case R_SPARC_TLS_GD_LO10: + if (is_local) + return R_SPARC_TLS_LE_LOX10; + return R_SPARC_TLS_IE_LO10; + case R_SPARC_TLS_IE_HI22: + if (is_local) + return R_SPARC_TLS_LE_HIX22; + return r_type; + case R_SPARC_TLS_IE_LO10: + if (is_local) + return R_SPARC_TLS_LE_LOX10; + return r_type; + case R_SPARC_TLS_LDM_HI22: + return R_SPARC_TLS_LE_HIX22; + case R_SPARC_TLS_LDM_LO10: + return R_SPARC_TLS_LE_LOX10; + } + + return r_type; +} + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ @@ -359,143 +850,201 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) asection *sec; const Elf_Internal_Rela *relocs; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - asection *sgot; - asection *srelgot; asection *sreloc; + bfd_boolean checked_tlsgd = FALSE; if (info->relocateable) return TRUE; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_offsets = elf_local_got_offsets (abfd); - sgot = NULL; - srelgot = NULL; sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) + { + (*_bfd_error_handler) (_("%s: bad symbol index: %d"), + bfd_archive_filename (abfd), + r_symndx); + return FALSE; + } + 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)) + /* Compatibility with old R_SPARC_REV32 reloc conflicting + with R_SPARC_TLS_GD_HI22. */ + if (! checked_tlsgd) + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + { + const Elf_Internal_Rela *relt; + + for (relt = rel + 1; relt < rel_end; relt++) + if (ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_LO10 + || ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_ADD + || ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_CALL) + break; + checked_tlsgd = TRUE; + elf32_sparc_tdata (abfd)->has_tlsgd = relt < rel_end; + } + break; + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_GD_ADD: + case R_SPARC_TLS_GD_CALL: + checked_tlsgd = TRUE; + elf32_sparc_tdata (abfd)->has_tlsgd = TRUE; + break; + } + + r_type = elf32_sparc_tls_transition (info, abfd, r_type, h == NULL); + switch (r_type) { + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + htab->tls_ldm_got.refcount += 1; + break; + + case R_SPARC_TLS_LE_HIX22: + case R_SPARC_TLS_LE_LOX10: + if (info->shared) + goto r_sparc_plt32; + break; + + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + case R_SPARC_GOT10: case R_SPARC_GOT13: case R_SPARC_GOT22: + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: /* This symbol requires a global offset table entry. */ + { + int tls_type, old_tls_type; - if (dynobj == NULL) - { - /* Create the .got section. */ - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! _bfd_elf_create_got_section (dynobj, info)) - return FALSE; - } + switch (r_type) + { + default: + case R_SPARC_GOT10: + case R_SPARC_GOT13: + case R_SPARC_GOT22: + tls_type = GOT_NORMAL; + break; + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: + tls_type = GOT_TLS_GD; + break; + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + tls_type = GOT_TLS_IE; + break; + } - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf32_sparc_hash_entry(h)->tls_type; + } + else + { + bfd_signed_vma *local_got_refcounts; - 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; - } - } + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) + { + bfd_size_type size; - if (h != NULL) - { - if (h->got.offset != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf32_sparc_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); + } + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf32_sparc_local_got_tls_type (abfd) [r_symndx]; + } - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN + && (old_tls_type != GOT_TLS_GD + || tls_type != GOT_TLS_IE)) + { + if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD) + tls_type = old_tls_type; + else + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), + h ? h->root.root.string : ""); return FALSE; - } + } + } - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - else - { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) - { - bfd_size_type size; - register unsigned int i; + if (old_tls_type != tls_type) + { + if (h != NULL) + elf32_sparc_hash_entry (h)->tls_type = tls_type; + else + elf32_sparc_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + } - size = symtab_hdr->sh_info; - size *= sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == 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; - } - 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; + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!create_got_section (htab->elf.dynobj, info)) + return FALSE; + break; - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_SPARC_RELATIVE reloc so that the - dynamic linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } + case R_SPARC_TLS_GD_CALL: + case R_SPARC_TLS_LDM_CALL: + if (info->shared) + { + /* These are basically R_SPARC_TLS_WPLT30 relocs against + __tls_get_addr. */ + struct bfd_link_hash_entry *bh = NULL; + if (! _bfd_generic_link_add_one_symbol (info, abfd, + "__tls_get_addr", 0, + bfd_und_section_ptr, 0, + NULL, FALSE, FALSE, + &bh)) + return FALSE; + h = (struct elf_link_hash_entry *) bh; } - - sgot->_raw_size += 4; - - /* If the .got section is more than 0x1000 bytes, we add - 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13 - bit relocations have a greater chance of working. */ - if (sgot->_raw_size >= 0x1000 - && elf_hash_table (info)->hgot->root.u.def.value == 0) - elf_hash_table (info)->hgot->root.u.def.value = 0x1000; - - break; + else + break; + /* Fall through */ case R_SPARC_PLT32: case R_SPARC_WPLT30: @@ -511,22 +1060,16 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) reloc for a local symbol if you assemble a call from one section to another when using -K pic. We treat it as WDISP30. */ - if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) goto r_sparc_plt32; break; } - /* 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; - if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) goto r_sparc_plt32; + h->plt.refcount += 1; break; case R_SPARC_PC10: @@ -538,6 +1081,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) break; /* Fall through. */ + case R_SPARC_DISP8: case R_SPARC_DISP16: case R_SPARC_DISP32: @@ -545,23 +1089,6 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) case R_SPARC_WDISP22: case R_SPARC_WDISP19: case R_SPARC_WDISP16: - if (h != NULL) - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; - - /* If we are linking with -Bsymbolic, we do not need to copy - a PC relative reloc against a global symbol which is - defined in an object we are including in the link (i.e., - DEF_REGULAR is set). FIXME: At this point we have not - seen all the input files, so it is possible that - DEF_REGULAR is not set now but will be set later (it is - never cleared). This needs to be handled as in - elf32-i386.c. */ - if (h == NULL - || (info->symbolic - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - break; - /* Fall through. */ case R_SPARC_8: case R_SPARC_16: case R_SPARC_32: @@ -575,14 +1102,59 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; r_sparc_plt32: - if (info->shared && (sec->flags & SEC_ALLOC)) + if (h != NULL && !info->shared) { + /* We may need a .plt entry if the function this reloc + refers to is in a shared lib. */ + 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 + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the relocs_copied 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 + && (! _bfd_sparc_elf_howto_table[r_type].pc_relative + || (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 elf32_sparc_dyn_relocs *p; + struct elf32_sparc_dyn_relocs **head; + /* When creating a shared object, we must copy these relocs into the output file. We create a reloc section in dynobj and make room for the reloc. */ if (sreloc == NULL) { const char *name; + bfd *dynobj; name = (bfd_elf_string_from_elf_section (abfd, @@ -595,6 +1167,10 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + dynobj = htab->elf.dynobj; + sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) { @@ -610,11 +1186,47 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) return FALSE; } - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; + elf_section_data (sec)->sreloc = sreloc; } - sreloc->_raw_size += sizeof (Elf32_External_Rela); + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + head = &((struct elf32_sparc_link_hash_entry *) h)->dyn_relocs; + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return FALSE; + + head = ((struct elf32_sparc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + } + + p = *head; + if (p == NULL || p->sec != sec) + { + bfd_size_type amt = sizeof *p; + p = ((struct elf32_sparc_dyn_relocs *) + bfd_alloc (htab->elf.dynobj, amt)); + if (p == NULL) + return FALSE; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; + } + + p->count += 1; + if (_bfd_sparc_elf_howto_table[r_type].pc_relative) + p->pc_count += 1; } break; @@ -688,6 +1300,7 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; unsigned long r_symndx; + int r_type; struct elf_link_hash_entry *h; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -696,8 +1309,80 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) + switch ((r_type = elf32_sparc_tls_transition (info, abfd, + ELF32_R_TYPE (rel->r_info), + ELF32_R_SYM (rel->r_info) + >= symtab_hdr->sh_info))) { + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0) + elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_SPARC_TLS_LE_HIX22: + case R_SPARC_TLS_LE_LOX10: + if (info->shared) + goto r_sparc_plt32; + break; + + case R_SPARC_PC10: + case R_SPARC_PC22: + if ((r_symndx = ELF32_R_SYM (rel->r_info)) >= symtab_hdr->sh_info + && strcmp (sym_hashes[r_symndx + - symtab_hdr->sh_info]->root.root.string, + "_GLOBAL_OFFSET_TABLE_") == 0) + break; + /* Fall through. */ + + case R_SPARC_DISP8: + case R_SPARC_DISP16: + case R_SPARC_DISP32: + case R_SPARC_WDISP30: + case R_SPARC_WDISP22: + case R_SPARC_WDISP19: + case R_SPARC_WDISP16: + case R_SPARC_8: + case R_SPARC_16: + case R_SPARC_32: + case R_SPARC_HI22: + case R_SPARC_22: + case R_SPARC_13: + case R_SPARC_LO10: + case R_SPARC_UA16: + case R_SPARC_UA32: + r_sparc_plt32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + if (! info->shared) + --h->plt.refcount; + + eh = (struct elf32_sparc_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + if (_bfd_sparc_elf_howto_table[r_type].pc_relative) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: case R_SPARC_GOT10: case R_SPARC_GOT13: case R_SPARC_GOT22: @@ -727,6 +1412,8 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) if (h->plt.refcount > 0) h->plt.refcount--; } + if (r_type == R_SPARC_PLT32) + goto r_sparc_plt32; break; default: @@ -747,14 +1434,16 @@ elf32_sparc_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; + struct elf32_sparc_link_hash_entry * eh; + struct elf32_sparc_dyn_relocs *p; asection *s; unsigned int power_of_two; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL + BFD_ASSERT (htab->elf.dynobj != NULL && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) || h->weakdef != NULL || ((h->elf_link_hash_flags @@ -778,64 +1467,26 @@ elf32_sparc_adjust_dynamic_symbol (info, h) || h->root.type == bfd_link_hash_defweak) && (h->root.u.def.section->flags & SEC_CODE) != 0)) { - if (! elf_hash_table (info)->dynamic_sections_created - || ((!info->shared || info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 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 WPLT30 reloc in an input - file, but none of the input files were dynamic objects. - Or, when linking the main application or a -Bsymbolic - shared library against PIC code. Or when a global symbol - has been made private, e.g. via versioning. - - In these cases we know what value the symbol will resolve - to, so we don't actually need to build a procedure linkage - table, and we can just do a WDISP30 reloc instead. */ - + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In + such a case, we don't actually need to build a procedure + linkage table, and we can just do a WDISP30 reloc instead. */ + h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return TRUE; } - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* The first four entries in .plt are reserved. */ - if (s->_raw_size == 0) - s->_raw_size = 4 * PLT_ENTRY_SIZE; - - /* The procedure linkage table has a maximum size. */ - if (s->_raw_size >= 0x400000) - { - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - - /* 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 += PLT_ENTRY_SIZE; - - /* 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 @@ -864,6 +1515,22 @@ elf32_sparc_adjust_dynamic_symbol (info, h) if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) return TRUE; + eh = (struct elf32_sparc_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) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, 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 @@ -874,45 +1541,280 @@ elf32_sparc_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"); - BFD_ASSERT (s != NULL); + /* We must generate a R_SPARC_COPY reloc to tell the dynamic linker + to copy the initial value out of the dynamic object and into the + runtime process image. We need to remember the offset into the + .rel.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { + htab->srelbss->_raw_size += sizeof (Elf32_External_Rela); + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; + } + + /* We need to figure out the alignment required for this symbol. I + have no idea how ELF linkers handle this. */ + power_of_two = bfd_log2 (h->size); + if (power_of_two > 3) + power_of_two = 3; + + /* Apply the required alignment. */ + s = htab->sdynbss; + 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)) + return FALSE; + } + + /* Define the symbol as being at this point in the section. */ + h->root.u.def.section = s; + h->root.u.def.value = s->_raw_size; + + /* Increment the section size to make room for the symbol. */ + s->_raw_size += h->size; + + return TRUE; +} + +/* This is the condition under which 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 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 bfd_boolean +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct elf32_sparc_link_hash_table *htab; + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_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 = elf32_sparc_hash_table (info); + + if (htab->elf.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; + + /* The first four entries in .plt are reserved. */ + if (s->_raw_size == 0) + s->_raw_size = 4 * PLT_ENTRY_SIZE; + + /* The procedure linkage table has a maximum size. */ + if (s->_raw_size >= 0x400000) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + 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 .rela.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 R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary, + make it a R_SPARC_TLS_LE_{HI22,LO10} requiring no TLS entry. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf32_sparc_hash_entry(h)->tls_type == GOT_TLS_IE) + h->got.offset = (bfd_vma) -1; + else if (h->got.refcount > 0) + { + asection *s; + bfd_boolean dyn; + int tls_type = elf32_sparc_hash_entry(h)->tls_type; + + /* 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; + h->got.offset = s->_raw_size; + s->_raw_size += 4; + /* R_SPARC_TLS_GD_HI{22,LO10} needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += 4; + dyn = htab->elf.dynamic_sections_created; + /* R_SPARC_TLS_IE_{HI22,LO10} needs one dynamic relocation, + R_SPARC_TLS_GD_{HI22,LO10} needs one if local symbol and two if + global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type == GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); + else 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 elf32_sparc_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 elf32_sparc_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->elf.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; +} - /* We must generate a R_SPARC_COPY reloc to tell the dynamic linker - to copy the initial value out of the dynamic object and into the - runtime process image. We need to remember the offset into the - .rel.bss section we are going to use. */ - if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) - { - asection *srel; +/* Find any dynamic relocs that apply to read-only sections. */ - srel = bfd_get_section_by_name (dynobj, ".rela.bss"); - BFD_ASSERT (srel != NULL); - srel->_raw_size += sizeof (Elf32_External_Rela); - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; - } +static bfd_boolean +readonly_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs *p; - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; - /* Apply the required alignment. */ - 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)) + eh = (struct elf32_sparc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } + asection *s = p->sec->output_section; - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; - /* Increment the section size to make room for the symbol. */ - s->_raw_size += h->size; + info->flags |= DF_TEXTREL; + /* Not an error, just cut short the traversal. */ + return FALSE; + } + } return TRUE; } @@ -923,11 +1825,13 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { + struct elf32_sparc_link_hash_table *htab; bfd *dynobj; asection *s; - bfd_boolean relplt; + bfd *ibfd; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.dynobj; BFD_ASSERT (dynobj != NULL); if (elf_hash_table (info)->dynamic_sections_created) @@ -940,33 +1844,113 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } + } - /* Make space for the trailing nop in .plt. */ - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - if (s->_raw_size > 0) - s->_raw_size += 4; + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + char *local_tls_type; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct elf32_sparc_dyn_relocs *p; + + for (p = *((struct elf32_sparc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + 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; + } + } + } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + local_tls_type = elf32_sparc_local_got_tls_type (ibfd); + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) + { + *local_got = s->_raw_size; + s->_raw_size += 4; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += 4; + if (info->shared + || *local_tls_type == GOT_TLS_GD + || *local_tls_type == GOT_TLS_IE) + srel->_raw_size += sizeof (Elf32_External_Rela); + } + else + *local_got = (bfd_vma) -1; + } + } + + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for + R_SPARC_TLS_LDM_{HI22,LO10} relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 8; + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else + htab->tls_ldm_got.offset = -1; + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + + if (elf_hash_table (info)->dynamic_sections_created) { - /* 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; + /* Make space for the trailing nop in .plt. */ + if (htab->splt->_raw_size > 0) + htab->splt->_raw_size += 4; + + /* If the .got section is more than 0x1000 bytes, we add + 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13 + bit relocations have a greater chance of working. */ + if (htab->sgot->_raw_size >= 0x1000 + && elf_hash_table (info)->hgot->root.u.def.value == 0) + elf_hash_table (info)->hgot->root.u.def.value = 0x1000; } /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relplt = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; - bfd_boolean strip; + bfd_boolean strip = FALSE; if ((s->flags & SEC_LINKER_CREATED) == 0) continue; @@ -975,8 +1959,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - strip = FALSE; - if (strncmp (name, ".rela", 5) == 0) { if (s->_raw_size == 0) @@ -994,16 +1976,12 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) } else { - if (strcmp (name, ".rela.plt") == 0) - relplt = 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 if (strcmp (name, ".plt") != 0 - && strcmp (name, ".got") != 0) + else if (s != htab->splt && s != htab->sgot) { /* It's not one of our sections, so don't allocate space. */ continue; @@ -1042,7 +2020,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) return FALSE; } - if (relplt) + if (htab->srelplt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) @@ -1056,6 +2034,12 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) 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->elf, readonly_dynrelocs, + (PTR) info); + if (info->flags & DF_TEXTREL) { if (!add_dynamic_entry (DT_TEXTREL, 0)) @@ -1067,8 +2051,30 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) return TRUE; } -#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) -#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) +struct elf32_sparc_section_data +{ + struct bfd_elf_section_data elf; + unsigned int do_relax; +}; + +#define sec_do_relax(sec) \ + ((struct elf32_sparc_section_data *) (sec)->used_by_bfd)->do_relax + +static bfd_boolean +elf32_sparc_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct elf32_sparc_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct elf32_sparc_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} static bfd_boolean elf32_sparc_relax_section (abfd, section, link_info, again) @@ -1078,20 +2084,41 @@ elf32_sparc_relax_section (abfd, section, link_info, again) bfd_boolean *again; { *again = FALSE; - SET_SEC_DO_RELAX (section); + sec_do_relax (section) = 1; return TRUE; } -/* This is the condition under which 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 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)) +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; +{ + /* If tls_segment is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_segment == NULL) + return 0; + return elf_hash_table (info)->tls_segment->start; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_tls_segment *tls_segment + = elf_hash_table (info)->tls_segment; + + /* If tls_segment is NULL, we should have signalled an error already. */ + if (tls_segment == NULL) + return 0; + return -(align_power (tls_segment->size, tls_segment->align) + + tls_segment->start - address); +} /* Relocate a SPARC ELF section. */ @@ -1107,13 +2134,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *local_syms; asection **local_sections; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; bfd_vma got_base; - asection *sgot; - asection *splt; asection *sreloc; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; @@ -1121,7 +2146,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (info->relocateable) return TRUE; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); @@ -1131,15 +2156,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, else got_base = elf_hash_table (info)->hgot->root.u.def.value; - sgot = NULL; - splt = NULL; - sreloc = NULL; + sreloc = elf_section_data (input_section)->sreloc; rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + int r_type, tls_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1223,11 +2246,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_GOT22: /* 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); - } + if (htab->sgot == NULL) + abort (); if (h != NULL) { @@ -1261,7 +2281,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, else { bfd_put_32 (output_bfd, relocation, - sgot->contents + off); + htab->sgot->contents + off); h->got.offset |= 1; } } @@ -1291,11 +2311,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ - s = bfd_get_section_by_name (dynobj, ".rela.got"); + s = htab->srelgot; BFD_ASSERT (s != NULL); - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); outrel.r_info = ELF32_R_INFO (0, R_SPARC_RELATIVE); outrel.r_addend = relocation; @@ -1305,11 +2325,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); } - bfd_put_32 (output_bfd, relocation, sgot->contents + off); + bfd_put_32 (output_bfd, relocation, + htab->sgot->contents + off); local_got_offsets[r_symndx] |= 1; } } - relocation = sgot->output_offset + off - got_base; + relocation = htab->sgot->output_offset + off - got_base; break; case R_SPARC_PLT32: @@ -1320,6 +2341,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } /* Fall through. */ case R_SPARC_WPLT30: + r_sparc_wplt30: /* Relocation is to the entry for this symbol in the procedure linkage table. */ @@ -1338,14 +2360,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } + if (htab->splt == NULL) + abort (); - relocation = (splt->output_section->vma - + splt->output_offset + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + h->plt.offset); unresolved_reloc = FALSE; if (r_type == R_SPARC_PLT32) @@ -1369,12 +2388,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_WDISP22: case R_SPARC_WDISP19: case R_SPARC_WDISP16: - if (h == NULL - || (info->symbolic - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - break; - /* Fall through. */ case R_SPARC_8: case R_SPARC_16: case R_SPARC_32: @@ -1385,9 +2398,30 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_UA16: case R_SPARC_UA32: r_sparc_plt32: - if (info->shared - && r_symndx != 0 - && (input_section->flags & SEC_ALLOC)) + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) + break; + + if ((info->shared + && (! howto->pc_relative + || (h != NULL + && h->dynindx != -1 + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && h != NULL + && h->dynindx != -1 + && (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) + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined))) { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -1397,25 +2431,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, are copied into the output file to be resolved at run time. */ - if (sreloc == NULL) - { - const char *name; - - name = (bfd_elf_string_from_elf_section - (input_bfd, - elf_elfheader (input_bfd)->e_shstrndx, - elf_section_data (input_section)->rel_hdr.sh_name)); - if (name == NULL) - return FALSE; - - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 - && strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 5) == 0); - - sreloc = bfd_get_section_by_name (dynobj, name); - BFD_ASSERT (sreloc != NULL); - } + BFD_ASSERT (sreloc != NULL); skip = FALSE; @@ -1487,7 +2503,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, long indx; if (is_plt) - sec = splt; + sec = htab->splt; else if (h == NULL) sec = local_sections[r_symndx]; else @@ -1540,6 +2556,330 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } break; + case R_SPARC_TLS_GD_HI22: + if (! elf32_sparc_tdata (input_bfd)->has_tlsgd) + { + /* R_SPARC_REV32 used the same reloc number as + R_SPARC_TLS_GD_HI22. */ + r_type = R_SPARC_REV32; + break; + } + /* Fall through */ + + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + r_type = elf32_sparc_tls_transition (info, input_bfd, r_type, + h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type == GOT_TLS_IE) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_IE_HI22: + r_type = R_SPARC_TLS_LE_HIX22; + break; + default: + r_type = R_SPARC_TLS_LE_LOX10; + break; + } + } + if (tls_type == GOT_TLS_IE) + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + r_type = R_SPARC_TLS_IE_HI22; + break; + case R_SPARC_TLS_GD_LO10: + r_type = R_SPARC_TLS_IE_LO10; + break; + } + + if (r_type == R_SPARC_TLS_LE_HIX22) + { + relocation = tpoff (info, relocation); + break; + } + if (r_type == R_SPARC_TLS_LE_LOX10) + { + /* Change add into xor. */ + relocation = tpoff (info, relocation); + bfd_put_32 (output_bfd, (bfd_get_32 (input_bfd, + contents + rel->r_offset) + | 0x80182000), contents + rel->r_offset); + break; + } + + if (h != NULL) + { + off = h->got.offset; + h->got.offset |= 1; + } + else + { + BFD_ASSERT (local_got_offsets != NULL); + off = local_got_offsets[r_symndx]; + local_got_offsets[r_symndx] |= 1; + } + + r_sparc_tlsldm: + if (htab->sgot == NULL) + abort (); + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + Elf32_External_Rela *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_SPARC_TLS_IE_HI22 + || r_type == R_SPARC_TLS_IE_LO10) + dr_type = R_SPARC_TLS_TPOFF32; + else + dr_type = R_SPARC_TLS_DTPMOD32; + if (dr_type == R_SPARC_TLS_TPOFF32 && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, dr_type); + loc = (Elf32_External_Rela *) htab->srelgot->contents; + loc += htab->srelgot->reloc_count++; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) loc); + + if (r_type == R_SPARC_TLS_GD_HI22 + || r_type == R_SPARC_TLS_GD_LO10) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + 4); + } + else + { + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + 4); + outrel.r_info = ELF32_R_INFO (indx, + R_SPARC_TLS_DTPOFF32); + outrel.r_offset += 4; + htab->srelgot->reloc_count++; + loc++; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) loc); + } + } + else if (dr_type == R_SPARC_TLS_DTPMOD32) + { + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + 4); + } + } + + if (off >= (bfd_vma) -2) + abort (); + + relocation = htab->sgot->output_offset + off - got_base; + unresolved_reloc = FALSE; + howto = _bfd_sparc_elf_howto_table + r_type; + break; + + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + if (! info->shared) + { + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + } + off = htab->tls_ldm_got.offset; + htab->tls_ldm_got.offset |= 1; + goto r_sparc_tlsldm; + + case R_SPARC_TLS_LDO_HIX22: + case R_SPARC_TLS_LDO_LOX10: + if (info->shared) + relocation -= dtpoff_base (info); + else + relocation = tpoff (info, relocation); + break; + + case R_SPARC_TLS_LE_HIX22: + case R_SPARC_TLS_LE_LOX10: + if (info->shared) + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate = FALSE; + + BFD_ASSERT (sreloc != NULL); + skip = FALSE; + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = TRUE; + else if (outrel.r_offset == (bfd_vma) -2) + skip = TRUE, relocate = TRUE; + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); + if (skip) + memset (&outrel, 0, sizeof outrel); + else + { + outrel.r_info = ELF32_R_INFO (0, r_type); + outrel.r_addend = relocation - dtpoff_base (info) + + rel->r_addend; + } + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) (((Elf32_External_Rela *) + sreloc->contents) + + sreloc->reloc_count)); + ++sreloc->reloc_count; + continue; + } + relocation = tpoff (info, relocation); + break; + + case R_SPARC_TLS_LDM_CALL: + if (! info->shared) + { + /* mov %g0, %o0 */ + bfd_put_32 (output_bfd, 0x90100000, contents + rel->r_offset); + continue; + } + /* Fall through */ + + case R_SPARC_TLS_GD_CALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (! info->shared + || (r_type == R_SPARC_TLS_GD_CALL && tls_type == GOT_TLS_IE)) + { + bfd_vma insn; + + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* GD -> LE */ + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + } + + /* GD -> IE */ + if (rel + 1 < relend + && ELF32_R_TYPE (rel[1].r_info) == R_SPARC_TLS_GD_ADD + && rel[1].r_offset == rel->r_offset + 4 + && ELF32_R_SYM (rel[1].r_info) == r_symndx + && (((insn = bfd_get_32 (input_bfd, + contents + rel[1].r_offset)) + >> 25) & 0x1f) == 8) + { + /* We have + call __tls_get_addr, %tgd_call(foo) + add %reg1, %reg2, %o0, %tgd_add(foo) + and change it into IE: + ld [%reg1 + %reg2], %o0, %tie_ld(foo) + add %g7, %o0, %o0, %tie_add(foo). + add is 0x80000000 | (rd << 25) | (rs1 << 14) | rs2, + ld is 0xc0000000 | (rd << 25) | (rs1 << 14) | rs2. */ + bfd_put_32 (output_bfd, insn | 0xc0000000, + contents + rel->r_offset); + bfd_put_32 (output_bfd, 0x9001c008, + contents + rel->r_offset + 4); + rel++; + continue; + } + + bfd_put_32 (output_bfd, 0x9001c008, contents + rel->r_offset); + continue; + } + + h = (struct elf_link_hash_entry *) + bfd_link_hash_lookup (info->hash, "__tls_get_addr", FALSE, + FALSE, TRUE); + BFD_ASSERT (h != NULL); + r_type = R_SPARC_WPLT30; + howto = _bfd_sparc_elf_howto_table + r_type; + goto r_sparc_wplt30; + + case R_SPARC_TLS_GD_ADD: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (! info->shared || tls_type == GOT_TLS_IE) + { + /* add %reg1, %reg2, %reg3, %tgd_add(foo) + changed into IE: + ld [%reg1 + %reg2], %reg3, %tie_ld(foo) + or LE: + add %g7, %reg2, %reg3. */ + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((h != NULL && h->dynindx != -1) || info->shared) + relocation = insn | 0xc0000000; + else + relocation = (insn & ~0x7c000) | 0x1c000; + bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_LDM_ADD: + if (! info->shared) + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + + case R_SPARC_TLS_LDO_ADD: + if (! info->shared) + { + /* Change rs1 into %g7. */ + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn = (insn & ~0x7c000) | 0x1c000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_IE_LD: + case R_SPARC_TLS_IE_LDX: + if (! info->shared && (h == NULL || h->dynindx == -1)) + { + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + int rs2 = insn & 0x1f; + int rd = (insn >> 25) & 0x1f; + + if (rs2 == rd) + relocation = SPARC_NOP; + else + relocation = 0x80100000 | (insn & 0x3e00001f); + bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_IE_ADD: + /* Totally useless relocation. */ + continue; + + case R_SPARC_TLS_DTPOFF32: + relocation -= dtpoff_base (info); + break; + default: break; } @@ -1589,8 +2929,35 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_putl32 (/*input_bfd,*/ x, contents + rel->r_offset); r = bfd_reloc_ok; } + else if (r_type == R_SPARC_TLS_LDO_HIX22 + || r_type == R_SPARC_TLS_LE_HIX22) + { + bfd_vma x; + + relocation += rel->r_addend; + relocation = relocation ^ 0xffffffff; + + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + x = (x & ~(bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff); + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + } + else if (r_type == R_SPARC_TLS_LDO_LOX10 + || r_type == R_SPARC_TLS_LE_LOX10) + { + bfd_vma x; + + relocation += rel->r_addend; + relocation = (relocation & 0x3ff) | 0x1c00; + + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + x = (x & ~(bfd_vma) 0x1fff) | relocation; + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + + r = bfd_reloc_ok; + } else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30) - && SEC_DO_RELAX (input_section) + && sec_do_relax (input_section) && rel->r_offset + 4 < input_section->_raw_size) { #define G0 0 @@ -1731,8 +3098,10 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) Elf_Internal_Sym *sym; { bfd *dynobj; - - dynobj = elf_hash_table (info)->dynobj; + struct elf32_sparc_link_hash_table *htab; + + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.dynobj; if (h->plt.offset != (bfd_vma) -1) { @@ -1746,8 +3115,8 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); - splt = bfd_get_section_by_name (dynobj, ".plt"); - srela = bfd_get_section_by_name (dynobj, ".rela.plt"); + splt = htab->splt; + srela = htab->srelplt; BFD_ASSERT (splt != NULL && srela != NULL); /* Fill in the entry in the procedure linkage table. */ @@ -1786,7 +3155,9 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf32_sparc_hash_entry(h)->tls_type != GOT_TLS_GD + && elf32_sparc_hash_entry(h)->tls_type != GOT_TLS_IE) { asection *sgot; asection *srela; @@ -1796,8 +3167,8 @@ elf32_sparc_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"); - srela = bfd_get_section_by_name (dynobj, ".rela.got"); + sgot = htab->sgot; + srela = htab->srelgot; BFD_ASSERT (sgot != NULL && srela != NULL); rela.r_offset = (sgot->output_section->vma @@ -1873,9 +3244,10 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) { bfd *dynobj; asection *sdyn; - asection *sgot; - - dynobj = elf_hash_table (info)->dynobj; + struct elf32_sparc_link_hash_table *htab; + + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.dynobj; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); @@ -1943,19 +3315,18 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) /* Set the first entry in the global offset table to the address of the dynamic section. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - if (sgot->_raw_size > 0) + if (htab->sgot && htab->sgot->_raw_size > 0) { if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, - sgot->contents); + htab->sgot->contents); } - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + if (htab->sgot) + elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 4; return TRUE; } @@ -2024,6 +3395,15 @@ static bfd_boolean elf32_sparc_object_p (abfd) bfd *abfd; { + /* Allocate our special target data. */ + struct elf32_sparc_obj_tdata *new_tdata; + bfd_size_type amt = sizeof (struct elf32_sparc_obj_tdata); + new_tdata = bfd_zalloc (abfd, amt); + if (new_tdata == NULL) + return FALSE; + new_tdata->root = *abfd->tdata.elf_obj_data; + abfd->tdata.any = new_tdata; + if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS) { if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) @@ -2108,10 +3488,15 @@ elf32_sparc_reloc_type_class (rela) #define ELF_MAXPAGESIZE 0x10000 #define bfd_elf32_bfd_reloc_type_lookup elf32_sparc_reloc_type_lookup +#define bfd_elf32_bfd_link_hash_table_create \ + elf32_sparc_link_hash_table_create #define bfd_elf32_bfd_relax_section elf32_sparc_relax_section +#define bfd_elf32_new_section_hook elf32_sparc_new_section_hook #define elf_info_to_howto elf32_sparc_info_to_howto +#define elf_backend_copy_indirect_symbol \ + elf32_sparc_copy_indirect_symbol #define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections + elf32_sparc_create_dynamic_sections #define elf_backend_check_relocs elf32_sparc_check_relocs #define elf_backend_adjust_dynamic_symbol \ elf32_sparc_adjust_dynamic_symbol @@ -2124,6 +3509,7 @@ elf32_sparc_reloc_type_class (rela) elf32_sparc_finish_dynamic_sections #define bfd_elf32_bfd_merge_private_bfd_data \ elf32_sparc_merge_private_bfd_data +#define bfd_elf32_mkobject elf32_sparc_mkobject #define elf_backend_object_p elf32_sparc_object_p #define elf_backend_final_write_processing \ elf32_sparc_final_write_processing @@ -2132,6 +3518,7 @@ elf32_sparc_reloc_type_class (rela) #define elf_backend_reloc_type_class elf32_sparc_reloc_type_class #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index bce2668..9569b38 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1,23 +1,23 @@ /* Alpha specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Richard Henderson . -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. */ /* We need a published ABI spec for this. Until one comes out, don't assume this'll remain unchanged forever. */ @@ -48,60 +48,60 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ecoffswap.h" static int alpha_elf_dynamic_symbol_p - PARAMS((struct elf_link_hash_entry *, struct bfd_link_info *)); + PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc - PARAMS((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table * elf64_alpha_bfd_link_hash_table_create - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_reloc_status_type elf64_alpha_reloc_nil - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type elf64_alpha_reloc_bad - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type elf64_alpha_do_reloc_gpdisp - PARAMS((bfd *, bfd_vma, bfd_byte *, bfd_byte *)); + PARAMS ((bfd *, bfd_vma, bfd_byte *, bfd_byte *)); static bfd_reloc_status_type elf64_alpha_reloc_gpdisp - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup - PARAMS((bfd *, bfd_reloc_code_real_type)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf64_alpha_info_to_howto - PARAMS((bfd *, arelent *, Elf_Internal_Rela *)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static bfd_boolean elf64_alpha_mkobject - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean elf64_alpha_object_p - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_boolean elf64_alpha_section_from_shdr - PARAMS((bfd *, Elf_Internal_Shdr *, const char *)); + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); static bfd_boolean elf64_alpha_section_flags - PARAMS((flagword *, Elf_Internal_Shdr *)); + PARAMS ((flagword *, Elf_Internal_Shdr *)); static bfd_boolean elf64_alpha_fake_sections - PARAMS((bfd *, Elf_Internal_Shdr *, asection *)); + PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); static bfd_boolean elf64_alpha_create_got_section - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf64_alpha_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf64_alpha_read_ecoff_info - PARAMS((bfd *, asection *, struct ecoff_debug_info *)); + PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); static bfd_boolean elf64_alpha_is_local_label_name - PARAMS((bfd *, const char *)); + PARAMS ((bfd *, const char *)); static bfd_boolean elf64_alpha_find_nearest_line - PARAMS((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); #if defined(__STDC__) || defined(ALMOST_STDC) struct alpha_elf_link_hash_entry; #endif static bfd_boolean elf64_alpha_output_extsym - PARAMS((struct alpha_elf_link_hash_entry *, PTR)); + PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static bfd_boolean elf64_alpha_can_merge_gots - PARAMS((bfd *, bfd *)); + PARAMS ((bfd *, bfd *)); static void elf64_alpha_merge_gots - PARAMS((bfd *, bfd *)); + PARAMS ((bfd *, bfd *)); static bfd_boolean elf64_alpha_calc_got_offsets_for_symbol PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static void elf64_alpha_calc_got_offsets @@ -129,27 +129,30 @@ static struct alpha_elf_got_entry *get_got_entry PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long, unsigned long, bfd_vma)); static bfd_boolean elf64_alpha_check_relocs - PARAMS((bfd *, struct bfd_link_info *, asection *sec, + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); static bfd_boolean elf64_alpha_adjust_dynamic_symbol - PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean elf64_alpha_size_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); +static void elf64_alpha_emit_dynrel + PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, + bfd_vma, long, long, bfd_vma)); static bfd_boolean elf64_alpha_relocate_section_r - PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static bfd_boolean elf64_alpha_relocate_section - PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static bfd_boolean elf64_alpha_finish_dynamic_symbol - PARAMS((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); static bfd_boolean elf64_alpha_finish_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf64_alpha_final_link - PARAMS((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf64_alpha_merge_ind_symbols - PARAMS((struct alpha_elf_link_hash_entry *, PTR)); + PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); static enum elf_reloc_type_class elf64_alpha_reloc_type_class @@ -174,19 +177,24 @@ struct alpha_elf_link_hash_entry #define ALPHA_ELF_LINK_HASH_LU_TLSLDM 0x20 #define ALPHA_ELF_LINK_HASH_LU_FUNC 0x38 #define ALPHA_ELF_LINK_HASH_TLS_IE 0x40 +#define ALPHA_ELF_LINK_HASH_PLT_LOC 0x80 + + /* Used to undo the localization of a plt symbol. */ + asection *plt_old_section; + bfd_vma plt_old_value; /* Used to implement multiple .got subsections. */ struct alpha_elf_got_entry { struct alpha_elf_got_entry *next; - /* which .got subsection? */ + /* Which .got subsection? */ bfd *gotobj; - /* the addend in effect for this entry. */ + /* The addend in effect for this entry. */ bfd_vma addend; - /* the .got offset for this entry. */ + /* The .got offset for this entry. */ int got_offset; /* How many references to this entry? */ @@ -205,22 +213,22 @@ struct alpha_elf_link_hash_entry unsigned char reloc_xlated; } *got_entries; - /* used to count non-got, non-plt relocations for delayed sizing + /* Used to count non-got, non-plt relocations for delayed sizing of relocation sections. */ struct alpha_elf_reloc_entry { struct alpha_elf_reloc_entry *next; - /* which .reloc section? */ + /* Which .reloc section? */ asection *srel; - /* what kind of relocation? */ + /* What kind of relocation? */ unsigned int rtype; - /* is this against read-only section? */ + /* Is this against read-only section? */ unsigned int reltext : 1; - /* how many did we find? */ + /* How many did we find? */ unsigned long count; } *reloc_entries; }; @@ -1638,6 +1646,17 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); info->changed_contents = TRUE; + /* Reduce the use count on this got entry by one, possibly + eliminating it. */ + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (r_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } + + /* Smash the existing GOT relocation for its 16-bit immediate pair. */ switch (r_type) { case R_ALPHA_LITERAL: @@ -1657,16 +1676,6 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), r_type); info->changed_relocs = TRUE; - /* Reduce the use count on this got entry by one, possibly - eliminating it. */ - if (--info->gotent->use_count == 0) - { - int sz = alpha_got_entry_size (r_type); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - if (!info->h) - alpha_elf_tdata (info->gotobj)->local_got_size -= sz; - } - /* ??? Search forward through this basic block looking for insns that use the target register. Stop after an insn modifying the register is seen, or after a branch or call. @@ -1748,15 +1757,11 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_byte *pos[5]; unsigned int insn; Elf_Internal_Rela *gpdisp, *hint; - bfd_boolean dynamic, use_gottprel; + bfd_boolean dynamic, use_gottprel, pos1_unusable; + unsigned long new_symndx; dynamic = alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info); - /* ??? For LD relaxation, we need a symbol referencing the beginning - of the TLS segment. */ - if (!is_gd) - return TRUE; - /* If a TLS symbol is accessed using IE at least once, there is no point to use dynamic model for it. */ if (is_gd && info->h && (info->h->flags & ALPHA_ELF_LINK_HASH_TLS_IE)) @@ -1793,15 +1798,20 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) pos[2] = info->contents + irel[2].r_offset; pos[3] = info->contents + gpdisp->r_offset; pos[4] = pos[3] + gpdisp->r_addend; + pos1_unusable = FALSE; - /* Only positions 0 and 1 are allowed to be out of order. */ - if (pos[1] < pos[0]) + /* Generally, the positions are not allowed to be out of order, lest the + modified insn sequence have different register lifetimes. We can make + an exception when pos 1 is adjacent to pos 0. */ + if (pos[1] + 4 == pos[0]) { bfd_byte *tmp = pos[0]; pos[0] = pos[1]; pos[1] = tmp; } - if (pos[1] >= pos[2] || pos[2] >= pos[3] || pos[3] >= pos[4]) + else if (pos[1] < pos[0]) + pos1_unusable = TRUE; + if (pos[1] >= pos[2] || pos[2] >= pos[3]) return TRUE; /* Reduce the use count on the LITERAL relocation. Do this before we @@ -1857,6 +1867,7 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) as appropriate. */ use_gottprel = FALSE; + new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : 0; switch (!dynamic && !info->link_info->shared) { case 1: @@ -1875,13 +1886,13 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPREL16); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPREL16); irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); break; } else if (disp >= -(bfd_signed_vma) 0x80000000 - && disp < (bfd_signed_vma) 0x7fff8000) + && disp < (bfd_signed_vma) 0x7fff8000 + && !pos1_unusable) { insn = (OP_LDAH << 26) | (16 << 21) | (31 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); @@ -1889,11 +1900,9 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_put_32 (info->abfd, (bfd_vma) insn, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPRELHI); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELHI); irel[1].r_offset = pos[1] - info->contents; - irel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPRELLO); + irel[1].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELLO); break; } } @@ -1907,8 +1916,7 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GOTTPREL); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL); irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); break; } @@ -2111,6 +2119,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) bfd_vma symval; struct alpha_elf_got_entry *gotent; unsigned long r_type = ELF64_R_TYPE (irel->r_info); + unsigned long r_symndx = ELF64_R_SYM (irel->r_info); /* Early exit for unhandled or unrelaxable relocations. */ switch (r_type) @@ -2121,14 +2130,20 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) case R_ALPHA_GOTDTPREL: case R_ALPHA_GOTTPREL: case R_ALPHA_TLSGD: + break; + case R_ALPHA_TLSLDM: + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; break; + default: continue; } /* Get the value of the symbol referred to by the reloc. */ - if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) + if (r_symndx < symtab_hdr->sh_info) { /* A local symbol. */ Elf_Internal_Sym *isym; @@ -2145,27 +2160,38 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) goto error_return; } - isym = isymbuf + ELF64_R_SYM (irel->r_info); - if (isym->st_shndx == SHN_UNDEF) - continue; - else if (isym->st_shndx == SHN_ABS) - info.tsec = bfd_abs_section_ptr; - else if (isym->st_shndx == SHN_COMMON) - info.tsec = bfd_com_section_ptr; + isym = isymbuf + r_symndx; + + /* Given the symbol for a TLSLDM reloc is ignored, this also + means forcing the symbol value to the tp base. */ + if (r_type == R_ALPHA_TLSLDM) + { + info.tsec = bfd_abs_section_ptr; + symval = alpha_get_tprel_base (info.tls_segment); + } else - info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + { + symval = isym->st_value; + if (isym->st_shndx == SHN_UNDEF) + continue; + else if (isym->st_shndx == SHN_ABS) + info.tsec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + info.tsec = bfd_com_section_ptr; + else + info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + } info.h = NULL; info.other = isym->st_other; - info.first_gotent = &local_got_entries[ELF64_R_SYM(irel->r_info)]; - symval = isym->st_value; + info.first_gotent = &local_got_entries[r_symndx]; } else { unsigned long indx; struct alpha_elf_link_hash_entry *h; - indx = ELF64_R_SYM (irel->r_info) - symtab_hdr->sh_info; + indx = r_symndx - symtab_hdr->sh_info; h = alpha_elf_sym_hashes (abfd)[indx]; BFD_ASSERT (h != NULL); @@ -2181,13 +2207,23 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* If the symbol isn't defined in the current module, again we can't do anything. */ if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - continue; + { + /* Except for TLSGD relocs, which can sometimes be + relaxed to GOTTPREL relocs. */ + if (r_type != R_ALPHA_TLSGD) + continue; + info.tsec = bfd_abs_section_ptr; + symval = 0; + } + else + { + info.tsec = h->root.root.u.def.section; + symval = h->root.root.u.def.value; + } info.h = h; - info.tsec = h->root.root.u.def.section; info.other = h->root.other; info.first_gotent = &h->got_entries; - symval = h->root.root.u.def.value; } /* Search for the got entry to be used by this relocation. */ @@ -3105,8 +3141,15 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) need = NEED_DYNREL; break; - case R_ALPHA_TLSGD: case R_ALPHA_TLSLDM: + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; + h = 0; + maybe_dynamic = FALSE; + /* FALLTHRU */ + + case R_ALPHA_TLSGD: case R_ALPHA_GOTDTPREL: need = NEED_GOT | NEED_GOT_ENTRY; break; @@ -3308,6 +3351,9 @@ elf64_alpha_adjust_dynamic_symbol (info, h) if (! info->shared && h->root.type != bfd_link_hash_defweak) { + ah->plt_old_section = h->root.u.def.section; + ah->plt_old_value = h->root.u.def.value; + ah->flags |= ALPHA_ELF_LINK_HASH_PLT_LOC; h->root.u.def.section = s; h->root.u.def.value = h->plt.offset; } @@ -3789,6 +3835,14 @@ elf64_alpha_size_plt_section_1 (h, data) { h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; h->root.plt.offset = -1; + + /* Undo the definition frobbing begun in adjust_dynamic_symbol. */ + if (h->flags & ALPHA_ELF_LINK_HASH_PLT_LOC) + { + h->root.root.u.def.section = h->plt_old_section; + h->root.root.u.def.value = h->plt_old_value; + h->flags &= ~ALPHA_ELF_LINK_HASH_PLT_LOC; + } } return TRUE; @@ -3842,18 +3896,16 @@ alpha_dynamic_entries_for_reloc (r_type, dynamic, shared) case R_ALPHA_TLSLDM: return shared; case R_ALPHA_LITERAL: + case R_ALPHA_GOTTPREL: return dynamic || shared; case R_ALPHA_GOTDTPREL: - case R_ALPHA_GOTTPREL: return dynamic; /* May appear in data sections. */ case R_ALPHA_REFLONG: case R_ALPHA_REFQUAD: - return dynamic || shared; - case R_ALPHA_SREL64: case R_ALPHA_TPREL64: - return dynamic; + return dynamic || shared; /* Everything else is illegal. We'll issue an error during relocate_section. */ @@ -4147,6 +4199,38 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) return TRUE; } +/* Emit a dynamic relocation for (DYNINDX, RTYPE, ADDEND) at (SEC, OFFSET) + into the next available slot in SREL. */ + +static void +elf64_alpha_emit_dynrel (abfd, info, sec, srel, offset, dynindx, rtype, addend) + bfd *abfd; + struct bfd_link_info *info; + asection *sec, *srel; + bfd_vma offset, addend; + long dynindx, rtype; +{ + Elf_Internal_Rela outrel; + bfd_byte *loc; + + BFD_ASSERT (srel != NULL); + + outrel.r_info = ELF64_R_INFO (dynindx, rtype); + outrel.r_addend = addend; + + offset = _bfd_elf_section_offset (abfd, info, sec, offset); + if ((offset | 1) != (bfd_vma) -1) + outrel.r_offset = sec->output_section->vma + sec->output_offset + offset; + else + memset (&outrel, 0, sizeof (outrel)); + + loc = srel->contents; + loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (abfd, &outrel, loc); + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count + <= srel->_cooked_size); +} + /* Relocate an Alpha ELF section for a relocatable link. We don't have to change anything unless the reloc is against a section @@ -4322,12 +4406,29 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf64_alpha_howto_table + r_type; r_symndx = ELF64_R_SYM(rel->r_info); + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + if (r_type == R_ALPHA_TLSLDM) + r_symndx = 0; + if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + /* If this is a tp-relative relocation against sym 0, + this is hackery from relax_section. Force the value to + be the tls base. */ + if (r_symndx == 0 + && (r_type == R_ALPHA_TLSLDM + || r_type == R_ALPHA_GOTTPREL + || r_type == R_ALPHA_TPREL64 + || r_type == R_ALPHA_TPRELHI + || r_type == R_ALPHA_TPRELLO + || r_type == R_ALPHA_TPREL16)) + value = tp_base; + if (local_got_entries) gotent = local_got_entries[r_symndx]; else @@ -4464,25 +4565,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, RELATIVE reloc, otherwise it will be handled in finish_dynamic_symbol. */ if (info->shared && !dynamic_symbol_p) - { - Elf_Internal_Rela outrel; - bfd_byte *loc; - - BFD_ASSERT(srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); - outrel.r_addend = value; - - loc = srelgot->contents; - loc += srelgot->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - BFD_ASSERT (sizeof (Elf64_External_Rela) - * srelgot->reloc_count - <= srelgot->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_RELATIVE, value); } value = (sgot->output_section->vma @@ -4607,8 +4692,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, case R_ALPHA_DTPREL64: case R_ALPHA_TPREL64: { - Elf_Internal_Rela outrel; - bfd_byte *loc; + long dynindx, dyntype = r_type; + bfd_vma dynaddend; /* Careful here to remember RELATIVE relocations for global variables for symbolic shared objects. */ @@ -4616,8 +4701,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (dynamic_symbol_p) { BFD_ASSERT(h->root.dynindx != -1); - outrel.r_info = ELF64_R_INFO (h->root.dynindx, r_type); - outrel.r_addend = addend; + dynindx = h->root.dynindx; + dynaddend = addend; addend = 0, value = 0; } else if (r_type == R_ALPHA_DTPREL64) @@ -4629,8 +4714,13 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, else if (r_type == R_ALPHA_TPREL64) { BFD_ASSERT(tls_segment != NULL); - value -= dtp_base; - goto default_reloc; + if (!info->shared) + { + value -= tp_base; + goto default_reloc; + } + dynindx = 0; + dynaddend = value - dtp_base; } else if (info->shared && r_symndx != 0 @@ -4644,28 +4734,16 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, h->root.root.root.string); ret_val = FALSE; } - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); - outrel.r_addend = value; + dynindx = 0; + dyntype = R_ALPHA_RELATIVE; + dynaddend = value; } else goto default_reloc; - BFD_ASSERT(srel != NULL); - - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if ((outrel.r_offset | 1) != (bfd_vma) -1) - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - else - memset (&outrel, 0, sizeof outrel); - - loc = srel->contents; - loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); + elf64_alpha_emit_dynrel (output_bfd, info, input_section, + srel, rel->r_offset, dynindx, + dyntype, dynaddend); } goto default_reloc; @@ -4707,26 +4785,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, DTPMOD64 reloc, otherwise it will be handled in finish_dynamic_symbol. */ if (info->shared && !dynamic_symbol_p) - { - Elf_Internal_Rela outrel; - bfd_byte *loc; - - BFD_ASSERT(srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - /* ??? Proper dynindx here. */ - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_DTPMOD64); - outrel.r_addend = 0; - - loc = srelgot->contents; - loc += srelgot->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - BFD_ASSERT (sizeof (Elf64_External_Rela) - * srelgot->reloc_count - <= srelgot->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_DTPMOD64, 0); if (dynamic_symbol_p || r_type == R_ALPHA_TLSLDM) value = 0; @@ -4800,7 +4861,18 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, else { BFD_ASSERT(tls_segment != NULL); - value -= (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); + if (r_type == R_ALPHA_GOTDTPREL) + value -= dtp_base; + else if (!info->shared) + value -= tp_base; + else + { + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_TPREL64, + value - dtp_base); + value = 0; + } } bfd_put_64 (output_bfd, value, sgot->contents + gotent->got_offset); @@ -4957,19 +5029,9 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) sgot->contents + gotent->got_offset); if (info->shared) - { - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = plt_addr; - - loc = srel->contents; - loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset, 0, + R_ALPHA_RELATIVE, plt_addr); gotent = gotent->next; } @@ -4980,8 +5042,6 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) { /* Fill in the dynamic relocations for this symbol's .got entries. */ asection *srel; - Elf_Internal_Rela outrel; - bfd_byte *loc; struct alpha_elf_got_entry *gotent; srel = bfd_get_section_by_name (dynobj, ".rela.got"); @@ -4992,15 +5052,12 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) gotent = gotent->next) { asection *sgot; - int r_type; + long r_type; if (gotent->use_count == 0) continue; sgot = alpha_elf_tdata (gotent->gotobj)->got; - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); r_type = gotent->reloc_type; switch (r_type) @@ -5022,25 +5079,14 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); } - outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); - outrel.r_addend = gotent->addend; - - loc = srel->contents; - loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset, h->dynindx, + r_type, gotent->addend); if (gotent->reloc_type == R_ALPHA_TLSGD) - { - outrel.r_offset += 8; - outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_DTPREL64); - - loc = srel->contents; - loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - } - - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset + 8, h->dynindx, + R_ALPHA_DTPREL64, gotent->addend); } } @@ -5616,6 +5662,7 @@ elf64_alpha_fbsd_post_process_headers (abfd, link_info) #define elf_backend_post_process_headers \ elf64_alpha_fbsd_post_process_headers +#undef elf64_bed #define elf64_bed elf64_alpha_fbsd_bed #include "elf64-target.h" diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 50fcfba..d29f286 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -2746,6 +2746,7 @@ const struct elf_size_info mips_elf64_size_info = MIPS-specific function only applies to IRIX5, which had no 64-bit ABI. */ #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf64_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf64_bfd_get_relocated_section_contents \ _bfd_elf_mips_get_relocated_section_contents diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 3cca228..a7b2806 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,5 +1,5 @@ /* MMIX-specific support for 64-bit ELF. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson This file is part of BFD, the Binary File Descriptor library. @@ -41,8 +41,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ _bfd_abort (__FILE__, __LINE__, \ "bad case for " #x) +struct _mmix_elf_section_data +{ + struct bfd_elf_section_data elf; + union + { + struct bpo_reloc_section_info *reloc; + struct bpo_greg_section_info *greg; + } bpo; +}; + +#define mmix_elf_section_data(sec) \ + ((struct _mmix_elf_section_data *) (sec)->used_by_bfd) + /* For each section containing a base-plus-offset (BPO) reloc, we attach - this struct as elf_section_data (section)->tdata, which is otherwise + this struct as mmix_elf_section_data (section)->bpo, which is otherwise NULL. */ struct bpo_reloc_section_info { @@ -83,7 +96,7 @@ struct bpo_reloc_request bfd_boolean valid; }; -/* We attach this as elf_section_data (sec)->tdata in the linker-allocated +/* We attach this as mmix_elf_section_data (sec)->bpo in the linker-allocated greg contents section (MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME), which is linked into the register contents section (MMIX_REG_CONTENTS_SECTION_NAME). This section is created by the @@ -135,6 +148,9 @@ static void mmix_info_to_howto_rela static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR)); +static bfd_boolean mmix_elf_new_section_hook + PARAMS ((bfd *, asection *)); + static bfd_boolean mmix_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -795,6 +811,22 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) return NULL; } +static bfd_boolean +mmix_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct _mmix_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct _mmix_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} + /* This function performs the actual bitfiddling and sanity check for a final relocation. Each relocation gets its *worst*-case expansion @@ -983,13 +1015,11 @@ mmix_elf_perform_relocation (isec, howto, datap, addr, value) case R_MMIX_BASE_PLUS_OFFSET: { struct bpo_reloc_section_info *bpodata - = (struct bpo_reloc_section_info *) - elf_section_data (isec)->tdata; + = mmix_elf_section_data (isec)->bpo.reloc; asection *bpo_greg_section = bpodata->bpo_greg_section; struct bpo_greg_section_info *gregdata - = (struct bpo_greg_section_info *) - elf_section_data (bpo_greg_section)->tdata; + = mmix_elf_section_data (bpo_greg_section)->bpo.greg; size_t bpo_index = gregdata->bpo_reloc_indexes[bpodata->bpo_index++]; @@ -1573,8 +1603,7 @@ mmix_elf_gc_sweep_hook (abfd, info, sec, relocs) const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; { struct bpo_reloc_section_info *bpodata - = (struct bpo_reloc_section_info *) - elf_section_data (sec)->tdata; + = mmix_elf_section_data (sec)->bpo.reloc; asection *allocated_gregs_section; /* If no bpodata here, we have nothing to do. */ @@ -1583,9 +1612,7 @@ mmix_elf_gc_sweep_hook (abfd, info, sec, relocs) allocated_gregs_section = bpodata->bpo_greg_section; - ((struct bpo_greg_section_info *) - elf_section_data (allocated_gregs_section)->tdata) - ->n_bpo_relocs + mmix_elf_section_data (allocated_gregs_section)->bpo.greg->n_bpo_relocs -= bpodata->n_bpo_relocs_this_section; return TRUE; @@ -1698,10 +1725,12 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs) bfd_zalloc (bpo_greg_owner, sizeof (struct bpo_greg_section_info)); if (gregdata == NULL) return FALSE; - elf_section_data (allocated_gregs_section)->tdata = gregdata; + mmix_elf_section_data (allocated_gregs_section)->bpo.greg + = gregdata; } else if (gregdata == NULL) - gregdata = elf_section_data (allocated_gregs_section)->tdata; + gregdata + = mmix_elf_section_data (allocated_gregs_section)->bpo.greg; /* Get ourselves some auxiliary info for the BPO-relocs. */ if (bpodata == NULL) @@ -1714,7 +1743,7 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs) * (sec->reloc_count + 1)); if (bpodata == NULL) return FALSE; - elf_section_data (sec)->tdata = bpodata; + mmix_elf_section_data (sec)->bpo.reloc = bpodata; bpodata->first_base_plus_offset_reloc = bpodata->bpo_index = gregdata->n_max_bpo_relocs; @@ -2084,8 +2113,7 @@ _bfd_mmix_prepare_linker_allocated_gregs (abfd, info) return TRUE; /* We use the target-data handle in the ELF section data. */ - gregdata = (struct bpo_greg_section_info *) - elf_section_data (bpo_gregs_section)->tdata; + gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return FALSE; @@ -2163,8 +2191,7 @@ _bfd_mmix_finalize_linker_allocated_gregs (abfd, link_info) /* We use the target-data handle in the ELF section data. */ - gregdata = (struct bpo_greg_section_info *) - elf_section_data (bpo_gregs_section)->tdata; + gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return FALSE; @@ -2260,8 +2287,7 @@ mmix_dump_bpo_gregs (link_info, pf) if (bpo_gregs_section == NULL) return; - gregdata = (struct bpo_greg_section_info *) - elf_section_data (bpo_gregs_section)->tdata; + gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return; @@ -2313,8 +2339,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again) asection *bpo_gregs_section = NULL; struct bpo_greg_section_info *gregdata; struct bpo_reloc_section_info *bpodata - = (struct bpo_reloc_section_info *) - elf_section_data (sec)->tdata; + = mmix_elf_section_data (sec)->bpo.reloc; size_t bpono; bfd *bpo_greg_owner; Elf_Internal_Sym *isymbuf = NULL; @@ -2343,8 +2368,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again) bpo_greg_owner = (bfd *) link_info->base_file; bpo_gregs_section = bpodata->bpo_greg_section; - gregdata = (struct bpo_greg_section_info *) - elf_section_data (bpo_gregs_section)->tdata; + gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; bpono = bpodata->first_base_plus_offset_reloc; @@ -2560,6 +2584,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again) #define elf_backend_section_from_bfd_section \ mmix_elf_section_from_bfd_section +#define bfd_elf64_new_section_hook mmix_elf_new_section_hook #define bfd_elf64_bfd_final_link mmix_elf_final_link #define bfd_elf64_bfd_relax_section mmix_elf_relax_section diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 5791883..2ca139d 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Linus Nordberg, Swox AB , based on elf32-ppc.c by Ian Lance Taylor. @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" -#include "elf/ppc.h" +#include "elf/ppc64.h" #include "elf64-ppc.h" static void ppc_howto_init @@ -56,6 +56,8 @@ static bfd_boolean ppc64_elf_object_p PARAMS ((bfd *)); static bfd_boolean ppc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static bfd_boolean ppc64_elf_new_section_hook + PARAMS ((bfd *, asection *)); /* The name of the dynamic interpreter. This is put in the .interp @@ -126,7 +128,7 @@ static bfd_boolean ppc64_elf_merge_private_bfd_data #define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1) /* Relocation HOWTO's. */ -static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max]; +static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC64_max]; static reloc_howto_type ppc64_elf_howto_raw[] = { /* This reloc does nothing. */ @@ -667,9 +669,8 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* Like R_PPC64_REL24 without touching the two least significant - bits. Should have been named R_PPC64_REL30! */ - HOWTO (R_PPC64_ADDR30, /* type */ + /* Like R_PPC64_REL24 without touching the two least significant bits. */ + HOWTO (R_PPC64_REL30, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 30, /* bitsize */ @@ -677,7 +678,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_PPC64_ADDR30", /* name */ + "R_PPC64_REL30", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffffffc, /* dst_mask */ @@ -1207,7 +1208,7 @@ ppc64_elf_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { - enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + enum elf_ppc64_reloc_type ppc_reloc = R_PPC64_NONE; if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) /* Initialize howto table if needed. */ @@ -1365,7 +1366,7 @@ ppc64_elf_info_to_howto (abfd, cache_ptr, dst) cache_ptr->howto = ppc64_elf_howto_table[type]; } -/* Handle the R_PPC_ADDR16_HA and similar relocs. */ +/* Handle the R_PPC64_ADDR16_HA and similar relocs. */ static bfd_reloc_status_type ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data, @@ -1404,7 +1405,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, char **error_message; { long insn; - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; bfd_size_type octets; /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ bfd_boolean is_power4 = FALSE; @@ -1419,7 +1420,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, octets = reloc_entry->address * bfd_octets_per_byte (abfd); insn = bfd_get_32 (abfd, (bfd_byte *) data + octets); insn &= ~(0x01 << 21); - r_type = (enum elf_ppc_reloc_type) reloc_entry->howto->type; + r_type = (enum elf_ppc64_reloc_type) reloc_entry->howto->type; if (r_type == R_PPC64_ADDR14_BRTAKEN || r_type == R_PPC64_REL14_BRTAKEN) insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ @@ -1676,6 +1677,35 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) return TRUE; } + +struct _ppc64_elf_section_data +{ + struct bfd_elf_section_data elf; + union + { + asection **func_sec; + long *adjust; + } opd; +}; + +#define ppc64_elf_section_data(sec) \ + ((struct _ppc64_elf_section_data *) (sec)->used_by_bfd) + +static bfd_boolean +ppc64_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct _ppc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct _ppc64_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} /* The following functions are specific to the ELF linker, while functions above are used generally. Those named ppc64_elf_* are @@ -1771,7 +1801,7 @@ struct ppc_dyn_relocs #define IS_ABSOLUTE_RELOC(RTYPE) \ ((RTYPE) != R_PPC64_REL32 \ && (RTYPE) != R_PPC64_REL64 \ - && (RTYPE) != R_PPC64_ADDR30) + && (RTYPE) != R_PPC64_REL30) /* Section name for stubs is the associated section name plus this string. */ @@ -2565,7 +2595,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) opd_sym_map = (asection **) bfd_zalloc (abfd, amt); if (opd_sym_map == NULL) return FALSE; - elf_section_data (sec)->tdata = opd_sym_map; + ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map; } if (htab->elf.dynobj == NULL) @@ -2579,7 +2609,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) { unsigned long r_symndx; struct elf_link_hash_entry *h; - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -2587,7 +2617,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); switch (r_type) { /* GOT16 relocations */ @@ -2723,7 +2753,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (opd_sym_map != NULL && h == NULL && rel + 1 < rel_end - && ((enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info) + && ((enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info) == R_PPC64_TOC)) { asection *s; @@ -2737,8 +2767,9 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) } /* Fall through. */ - case R_PPC64_REL64: + case R_PPC64_REL30: case R_PPC64_REL32: + case R_PPC64_REL64: case R_PPC64_ADDR14: case R_PPC64_ADDR14_BRNTAKEN: case R_PPC64_ADDR14_BRTAKEN: @@ -2753,7 +2784,6 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_ADDR16_LO: case R_PPC64_ADDR16_LO_DS: case R_PPC64_ADDR24: - case R_PPC64_ADDR30: case R_PPC64_ADDR32: case R_PPC64_UADDR16: case R_PPC64_UADDR32: @@ -2912,10 +2942,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) if (h != NULL) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; struct ppc_link_hash_entry *fdh; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GNU_VTINHERIT: @@ -2940,7 +2970,7 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) sections, as all functions are referenced in .opd. */ else if ((fdh->oh != NULL && ((struct ppc_link_hash_entry *) fdh->oh)->is_entry) - || elf_section_data (sec)->tdata == NULL) + || ppc64_elf_section_data (sec)->opd.func_sec == NULL) rsec = h->root.u.def.section; break; @@ -2958,10 +2988,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) asection **opd_sym_section; rsec = bfd_section_from_elf_index (sec->owner, sym->st_shndx); - opd_sym_section = (asection **) elf_section_data (rsec)->tdata; + opd_sym_section = ppc64_elf_section_data (rsec)->opd.func_sec; if (opd_sym_section != NULL) rsec = opd_sym_section[sym->st_value / 24]; - else if (elf_section_data (sec)->tdata != NULL) + else if (ppc64_elf_section_data (sec)->opd.func_sec != NULL) rsec = NULL; } @@ -2993,11 +3023,11 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) for (rel = relocs; rel < relend; rel++) { unsigned long r_symndx; - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; struct elf_link_hash_entry *h; r_symndx = ELF64_R_SYM (rel->r_info); - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GOT16: @@ -3044,6 +3074,7 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) } break; + case R_PPC64_REL30: case R_PPC64_REL32: case R_PPC64_REL64: if (r_symndx >= symtab_hdr->sh_info) @@ -3081,7 +3112,6 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_PPC64_ADDR16_LO: case R_PPC64_ADDR16_LO_DS: case R_PPC64_ADDR24: - case R_PPC64_ADDR30: case R_PPC64_ADDR32: case R_PPC64_ADDR64: case R_PPC64_UADDR16: @@ -3443,8 +3473,8 @@ ppc64_elf_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to - copy the initial value out of the dynamic object and into the + /* We must generate a R_PPC64_COPY reloc to tell the dynamic linker + to copy the initial value out of the dynamic object and into the runtime process image. We need to remember the offset into the .rela.bss section we are going to use. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) @@ -3564,13 +3594,13 @@ ppc64_elf_edit_opd (obfd, info) continue; amt = sec->_raw_size * sizeof (long) / 24; - adjust = (long *) elf_section_data (sec)->tdata; + adjust = ppc64_elf_section_data (sec)->opd.adjust; if (adjust == NULL) { /* Must be a ld -r link. ie. check_relocs hasn't been called. */ adjust = (long *) bfd_zalloc (obfd, amt); - elf_section_data (sec)->tdata = adjust; + ppc64_elf_section_data (sec)->opd.adjust = adjust; } memset (adjust, 0, (size_t) amt); @@ -3599,7 +3629,7 @@ ppc64_elf_edit_opd (obfd, info) relend = relstart + sec->reloc_count; for (rel = relstart; rel < relend; rel++) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; unsigned long r_symndx; asection *sym_sec; struct elf_link_hash_entry *h; @@ -3608,7 +3638,7 @@ ppc64_elf_edit_opd (obfd, info) /* .opd contains a regular array of 24 byte entries. We're only interested in the reloc pointing to a function entry point. */ - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); if (r_type == R_PPC64_TOC) continue; @@ -3623,7 +3653,7 @@ ppc64_elf_edit_opd (obfd, info) if (rel + 1 >= relend) continue; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info); if (r_type != R_PPC64_TOC) continue; @@ -4914,7 +4944,7 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, r_type = ELF64_R_TYPE (irela->r_info); r_indx = ELF64_R_SYM (irela->r_info); - if (r_type >= (unsigned int) R_PPC_max) + if (r_type >= (unsigned int) R_PPC64_max) { bfd_set_error (bfd_error_bad_value); goto error_ret_free_internal; @@ -5306,13 +5336,13 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, TOCstart = elf_gp (output_bfd); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - is_opd = elf_section_data (input_section)->tdata != NULL; + is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL; rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; bfd_vma offset; bfd_vma addend; bfd_reloc_status_type r; @@ -5330,7 +5360,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma max_br_offset; bfd_vma from; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); r_symndx = ELF64_R_SYM (rel->r_info); offset = rel->r_offset; addend = rel->r_addend; @@ -5362,7 +5392,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { long *opd_sym_adjust; - opd_sym_adjust = (long *) elf_section_data (sec)->tdata; + opd_sym_adjust = ppc64_elf_section_data (sec)->opd.adjust; if (opd_sym_adjust != NULL && sym->st_value % 24 == 0) relocation += opd_sym_adjust[sym->st_value / 24]; } @@ -5537,8 +5567,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; case R_PPC64_NONE: - case R_PPC_GNU_VTINHERIT: - case R_PPC_GNU_VTENTRY: + case R_PPC64_GNU_VTINHERIT: + case R_PPC64_GNU_VTENTRY: continue; /* GOT16 relocations. Like an ADDR16 using the symbol's @@ -5707,6 +5737,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocations that may need to be propagated if this is a dynamic object. */ + case R_PPC64_REL30: case R_PPC64_REL32: case R_PPC64_REL64: case R_PPC64_ADDR14: @@ -5723,7 +5754,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_ADDR16_LO: case R_PPC64_ADDR16_LO_DS: case R_PPC64_ADDR24: - case R_PPC64_ADDR30: case R_PPC64_ADDR32: case R_PPC64_ADDR64: case R_PPC64_UADDR16: @@ -5903,6 +5933,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_ADDR16_HA: case R_PPC64_ADDR16_HIGHERA: case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_GOT16_HA: + case R_PPC64_PLTGOT16_HA: case R_PPC64_PLT16_HA: case R_PPC64_TOC16_HA: case R_PPC64_SECTOFF_HA: @@ -6174,9 +6206,9 @@ static enum elf_reloc_type_class ppc64_elf_reloc_type_class (rela) const Elf_Internal_Rela *rela; { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rela->r_info); + r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rela->r_info); switch (r_type) { case R_PPC64_RELATIVE: @@ -6337,6 +6369,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) #define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup #define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data +#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook #define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create #define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index db5237f..1c81edf 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -51,6 +51,9 @@ static asection *elf_s390_gc_mark_hook static bfd_boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +struct elf_s390_link_hash_entry; +static void elf_s390_adjust_gotplt + PARAMS ((struct elf_s390_link_hash_entry *)); static bfd_boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean allocate_dynrelocs @@ -69,7 +72,20 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); +static bfd_boolean elf_s390_mkobject + PARAMS ((bfd *)); +static bfd_boolean elf_s390_object_p + PARAMS ((bfd *)); +static int elf_s390_tls_transition + PARAMS ((struct bfd_link_info *, int, int)); +static bfd_reloc_status_type s390_tls_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); +static void invalid_tls_insn + PARAMS ((bfd *, asection *, Elf_Internal_Rela *)); #include "elf/s390.h" @@ -94,32 +110,112 @@ static reloc_howto_type elf_howto_table[] = 0, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), - HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), - HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), - HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), - HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), - HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_COPY, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_GLOB_DAT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_JMP_SLOT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_RELATIVE, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_GOTOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_GOTPC, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,MINUS_ONE, TRUE), - HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), - HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), - HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,MINUS_ONE, TRUE), - HOWTO(R_390_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_64", FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_PC64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC64", FALSE, 0,MINUS_ONE, TRUE), - HOWTO(R_390_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT64", FALSE, 0,MINUS_ONE, FALSE), - HOWTO(R_390_PLT64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT64", FALSE, 0,MINUS_ONE, TRUE), - HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), + HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_COPY, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GLOB_DAT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_JMP_SLOT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_RELATIVE, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPC, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_PC64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC64", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_PLT64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT64", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTPLT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LOAD", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_GDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_LDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LDCALL", FALSE, 0, 0, FALSE), + EMPTY_HOWTO (R_390_TLS_GD32), /* Empty entry for R_390_TLS_GD32. */ + HOWTO(R_390_TLS_GD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GD64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_GOTIE12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE12", FALSE, 0, 0x00000fff, FALSE), + EMPTY_HOWTO (R_390_TLS_GOTIE32), /* Empty entry for R_390_TLS_GOTIE32. */ + HOWTO(R_390_TLS_GOTIE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_LDM32), /* Empty entry for R_390_TLS_LDM32. */ + HOWTO(R_390_TLS_LDM64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDM64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_IE32), /* Empty entry for R_390_TLS_IE32. */ + HOWTO(R_390_TLS_IE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IE64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_IEENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IEENT", FALSE, 0, MINUS_ONE, TRUE), + EMPTY_HOWTO (R_390_TLS_LE32), /* Empty entry for R_390_TLS_LE32. */ + HOWTO(R_390_TLS_LE64, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LE64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_LDO32), /* Empty entry for R_390_TLS_LDO32. */ + HOWTO(R_390_TLS_LDO64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDO64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_DTPMOD, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPMOD", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_DTPOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_TPOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, MINUS_ONE, FALSE), }; /* GNU extension to record C++ vtable hierarchy. */ @@ -164,7 +260,7 @@ elf_s390_reloc_type_lookup (abfd, code) case BFD_RELOC_390_RELATIVE: return &elf_howto_table[(int) R_390_RELATIVE]; case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; + return &elf_howto_table[(int) R_390_GOTOFF32]; case BFD_RELOC_390_GOTPC: return &elf_howto_table[(int) R_390_GOTPC]; case BFD_RELOC_390_GOT16: @@ -175,10 +271,6 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_PC16DBL]; case BFD_RELOC_390_PLT16DBL: return &elf_howto_table[(int) R_390_PLT16DBL]; - case BFD_RELOC_VTABLE_INHERIT: - return &elf64_s390_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf64_s390_vtentry_howto; case BFD_RELOC_390_PC32DBL: return &elf_howto_table[(int) R_390_PC32DBL]; case BFD_RELOC_390_PLT32DBL: @@ -195,6 +287,58 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_PLT64]; case BFD_RELOC_390_GOTENT: return &elf_howto_table[(int) R_390_GOTENT]; + case BFD_RELOC_16_GOTOFF: + return &elf_howto_table[(int) R_390_GOTOFF16]; + case BFD_RELOC_390_GOTOFF64: + return &elf_howto_table[(int) R_390_GOTOFF64]; + case BFD_RELOC_390_GOTPLT12: + return &elf_howto_table[(int) R_390_GOTPLT12]; + case BFD_RELOC_390_GOTPLT16: + return &elf_howto_table[(int) R_390_GOTPLT16]; + case BFD_RELOC_390_GOTPLT32: + return &elf_howto_table[(int) R_390_GOTPLT32]; + case BFD_RELOC_390_GOTPLT64: + return &elf_howto_table[(int) R_390_GOTPLT64]; + case BFD_RELOC_390_GOTPLTENT: + return &elf_howto_table[(int) R_390_GOTPLTENT]; + case BFD_RELOC_390_PLTOFF16: + return &elf_howto_table[(int) R_390_PLTOFF16]; + case BFD_RELOC_390_PLTOFF32: + return &elf_howto_table[(int) R_390_PLTOFF32]; + case BFD_RELOC_390_PLTOFF64: + return &elf_howto_table[(int) R_390_PLTOFF64]; + case BFD_RELOC_390_TLS_LOAD: + return &elf_howto_table[(int) R_390_TLS_LOAD]; + case BFD_RELOC_390_TLS_GDCALL: + return &elf_howto_table[(int) R_390_TLS_GDCALL]; + case BFD_RELOC_390_TLS_LDCALL: + return &elf_howto_table[(int) R_390_TLS_LDCALL]; + case BFD_RELOC_390_TLS_GD64: + return &elf_howto_table[(int) R_390_TLS_GD64]; + case BFD_RELOC_390_TLS_GOTIE12: + return &elf_howto_table[(int) R_390_TLS_GOTIE12]; + case BFD_RELOC_390_TLS_GOTIE64: + return &elf_howto_table[(int) R_390_TLS_GOTIE64]; + case BFD_RELOC_390_TLS_LDM64: + return &elf_howto_table[(int) R_390_TLS_LDM64]; + case BFD_RELOC_390_TLS_IE64: + return &elf_howto_table[(int) R_390_TLS_IE64]; + case BFD_RELOC_390_TLS_IEENT: + return &elf_howto_table[(int) R_390_TLS_IEENT]; + case BFD_RELOC_390_TLS_LE64: + return &elf_howto_table[(int) R_390_TLS_LE64]; + case BFD_RELOC_390_TLS_LDO64: + return &elf_howto_table[(int) R_390_TLS_LDO64]; + case BFD_RELOC_390_TLS_DTPMOD: + return &elf_howto_table[(int) R_390_TLS_DTPMOD]; + case BFD_RELOC_390_TLS_DTPOFF: + return &elf_howto_table[(int) R_390_TLS_DTPOFF]; + case BFD_RELOC_390_TLS_TPOFF: + return &elf_howto_table[(int) R_390_TLS_TPOFF]; + case BFD_RELOC_VTABLE_INHERIT: + return &elf64_s390_vtinherit_howto; + case BFD_RELOC_VTABLE_ENTRY: + return &elf64_s390_vtentry_howto; default: break; } @@ -226,6 +370,23 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) } } +/* A relocation function which doesn't do anything. */ +static bfd_reloc_status_type +s390_tls_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) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + static bfd_boolean elf_s390_is_local_label_name (abfd, name) bfd *abfd; @@ -357,8 +518,62 @@ struct elf_s390_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_s390_dyn_relocs *dyn_relocs; + + /* Number of GOTPLT references for a function. */ + bfd_signed_vma gotplt_refcount; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 +#define GOT_TLS_IE_NLT 3 + unsigned char tls_type; }; +#define elf_s390_hash_entry(ent) \ + ((struct elf_s390_link_hash_entry *)(ent)) + +struct elf_s390_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; +}; + +#define elf_s390_tdata(abfd) \ + ((struct elf_s390_obj_tdata *) (abfd)->tdata.any) + +#define elf_s390_local_got_tls_type(abfd) \ + (elf_s390_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf_s390_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +static bfd_boolean +elf_s390_object_p (abfd) + bfd *abfd; +{ + /* Allocate our special target data. */ + struct elf_s390_obj_tdata *new_tdata; + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + new_tdata = bfd_zalloc (abfd, amt); + if (new_tdata == NULL) + return FALSE; + new_tdata->root = *abfd->tdata.elf_obj_data; + abfd->tdata.any = new_tdata; + /* Set the right machine number for an s390 elf32 file. */ + return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); +} + /* s390 ELF linker hash table. */ struct elf_s390_link_hash_table @@ -374,6 +589,11 @@ struct elf_s390_link_hash_table asection *sdynbss; asection *srelbss; + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -409,6 +629,8 @@ link_hash_newfunc (entry, table, string) eh = (struct elf_s390_link_hash_entry *) entry; eh->dyn_relocs = NULL; + eh->gotplt_refcount = 0; + eh->tls_type = GOT_UNKNOWN; } return entry; @@ -440,6 +662,7 @@ elf_s390_link_hash_table_create (abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; ret->sym_sec.abfd = NULL; return &ret->elf.root; @@ -552,9 +775,43 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } +static int +elf_s390_tls_transition (info, r_type, is_local) + struct bfd_link_info *info; + int r_type; + int is_local; +{ + if (info->shared) + return r_type; + + switch (r_type) + { + case R_390_TLS_GD64: + case R_390_TLS_IE64: + if (is_local) + return R_390_TLS_LE64; + return R_390_TLS_IE64; + case R_390_TLS_GOTIE64: + if (is_local) + return R_390_TLS_LE64; + return R_390_TLS_GOTIE64; + case R_390_TLS_LDM64: + return R_390_TLS_LE64; + } + + return r_type; +} + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ @@ -572,6 +829,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_signed_vma *local_got_refcounts; + int tls_type, old_tls_type; if (info->relocateable) return TRUE; @@ -579,12 +838,14 @@ elf_s390_check_relocs (abfd, info, sec, relocs) htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -603,41 +864,48 @@ elf_s390_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - switch (ELF64_R_TYPE (rel->r_info)) + /* Create got section and local_got_refcounts array if they + are needed. */ + r_type = elf_s390_tls_transition (info, + ELF64_R_TYPE (rel->r_info), + h == NULL); + switch (r_type) { case R_390_GOT12: case R_390_GOT16: case R_390_GOT32: case R_390_GOT64: case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + case R_390_TLS_GD64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + case R_390_TLS_IE64: + case R_390_TLS_LDM64: + if (h == NULL + && local_got_refcounts == NULL) { - bfd_signed_vma *local_got_refcounts; + bfd_size_type size; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return FALSE; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf_s390_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); } - /* Fall through */ - - case R_390_GOTOFF: + /* Fall through. */ + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: case R_390_GOTPC: case R_390_GOTPCDBL: if (htab->sgot == NULL) @@ -647,12 +915,25 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (!create_got_section (htab->elf.dynobj, info)) return FALSE; } + } + + switch (r_type) + { + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Got is created, nothing to be done. */ break; case R_390_PLT16DBL: case R_390_PLT32: case R_390_PLT32DBL: case R_390_PLT64: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code which is @@ -662,13 +943,120 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* If this is a local symbol, we resolve it directly without creating a procedure linkage table entry. */ - if (h == NULL) - continue; + if (h != NULL) + { + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + break; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + /* This symbol requires either a procedure linkage table entry + or an entry in the local got. We actually build the entry + in adjust_dynamic_symbol because whether this is really a + global reference can change and with it the fact if we have + to create a plt entry or a local got entry. To be able to + make a once global symbol a local one we have to keep track + of the number of gotplt references that exist for this + symbol. */ + if (h != NULL) + { + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + else + local_got_refcounts[r_symndx] += 1; + break; + + case R_390_TLS_LDM64: + htab->tls_ldm_got.refcount += 1; break; + case R_390_TLS_IE64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTENT: + case R_390_TLS_GD64: + /* This symbol requires a global offset table entry. */ + switch (r_type) + { + default: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOTENT: + tls_type = GOT_NORMAL; + break; + case R_390_TLS_GD64: + tls_type = GOT_TLS_GD; + break; + case R_390_TLS_IE64: + case R_390_TLS_GOTIE64: + tls_type = GOT_TLS_IE; + break; + case R_390_TLS_GOTIE12: + case R_390_TLS_IEENT: + tls_type = GOT_TLS_IE_NLT; + break; + } + + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf_s390_hash_entry(h)->tls_type; + } + else + { + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf_s390_local_got_tls_type (abfd) [r_symndx]; + } + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN) + { + if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), h->root.root.string); + return FALSE; + } + if (old_tls_type > tls_type) + tls_type = old_tls_type; + } + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf_s390_hash_entry (h)->tls_type = tls_type; + else + elf_s390_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + + if (r_type != R_390_TLS_IE64) + break; + /* Fall through */ + + case R_390_TLS_LE64: + if (!info->shared) + break; + info->flags |= DF_STATIC_TLS; + /* Fall through */ + case R_390_8: case R_390_16: case R_390_32: @@ -905,6 +1293,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; unsigned long r_symndx; + int r_type; struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -915,89 +1304,161 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - r_symndx = ELF64_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; + { + r_symndx = ELF64_R_SYM (rel->r_info); - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: - case R_390_PC32DBL: - case R_390_PC64: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_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_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + r_type = elf_s390_tls_transition (info, + ELF64_R_TYPE (rel->r_info), + r_symndx >= symtab_hdr->sh_info); + switch (r_type) + { + case R_390_TLS_LDM64: + if (elf_s390_hash_table (info)->tls_ldm_got.refcount > 0) + elf_s390_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_390_TLS_GD64: + case R_390_TLS_IE64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: + case R_390_GOTPC: + case R_390_GOTPCDBL: + case R_390_GOTENT: + if (h != NULL) + { + 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; + } + if (r_type != R_390_TLS_IE64) + break; + /* Fall through */ + + case R_390_TLS_LE64: + if (!info->shared) + break; + /* Fall through */ + + case R_390_8: + case R_390_12: + case R_390_16: + case R_390_32: + case R_390_64: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32: + case R_390_PC32DBL: + case R_390_PC64: + if (h != NULL) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; + + if (!info->shared && h->plt.refcount > 0) + h->plt.refcount -= 1; + + eh = (struct elf_s390_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 + || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL + || ELF64_R_TYPE (rel->r_info) == R_390_PC32 + || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL + || ELF64_R_TYPE (rel->r_info) == R_390_PC64) + p->pc_count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + break; + + case R_390_PLT16DBL: + case R_390_PLT32: + case R_390_PLT32DBL: + case R_390_PLT64: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + if (h != NULL) + { + if (h->plt.refcount > 0) { - if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 - || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount--; + h->plt.refcount -= 1; } - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - r_symndx = ELF64_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; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } +/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT + entry but we found we will not create any. Called when we find we will + not have any PLT for this symbol, by for example + elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, + or elf_s390_size_dynamic_sections if no dynamic sections will be + created (we're only linking static objects). */ + +static void +elf_s390_adjust_gotplt (h) + struct elf_s390_link_hash_entry *h; +{ + if (h->elf.root.type == bfd_link_hash_warning) + h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link; + + if (h->gotplt_refcount <= 0) + return; + + /* We simply add the number of gotplt references to the number + * of got references for this symbol. */ + h->elf.got.refcount += h->gotplt_refcount; + h->gotplt_refcount = -1; +} + /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the dynamic object, but we're not including those sections. We have to @@ -1035,6 +1496,7 @@ elf_s390_adjust_dynamic_symbol (info, h) linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } return TRUE; @@ -1171,6 +1633,9 @@ allocate_dynrelocs (h, inf) 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; @@ -1225,18 +1690,41 @@ allocate_dynrelocs (h, inf) { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } } else { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - if (h->got.refcount > 0) + /* If R_390_TLS_{IE64,GOTIE64,GOTIE12,IEENT} symbol is now local to + the binary, we can optimize a bit. IE64 and GOTIE64 get converted + to R_390_TLS_LE64 requiring no TLS entry. For GOTIE12 and IEENT + we can save the dynamic TLS relocation. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE) + { + if (elf_s390_hash_entry(h)->tls_type == GOT_TLS_IE_NLT) + /* For the GOTIE access without a literal pool entry the offset has + to be stored somewhere. The immediate value in the instruction + is not bit enough so the value is stored in the got. */ + { + h->got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += GOT_ENTRY_SIZE; + } + else + h->got.offset = (bfd_vma) -1; + } + else if (h->got.refcount > 0) { asection *s; bfd_boolean dyn; + int tls_type = elf_s390_hash_entry(h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -1250,8 +1738,18 @@ allocate_dynrelocs (h, inf) s = htab->sgot; h->got.offset = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + /* R_390_TLS_GD64 needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + /* R_390_TLS_IE64 needs one dynamic relocation, + R_390_TLS_GD64 needs one if local symbol and two if global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type >= GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1397,6 +1895,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; + char *local_tls_type; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srela; @@ -1438,14 +1937,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = elf_s390_local_got_tls_type (ibfd); s = htab->sgot; srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + for (; local_got < end_local_got; ++local_got, ++local_tls_type) { if (*local_got > 0) { *local_got = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; if (info->shared) srela->_raw_size += sizeof (Elf64_External_Rela); } @@ -1454,6 +1956,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) } } + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM64 + relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE; + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + else + htab->tls_ldm_got.offset = -1; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); @@ -1564,6 +2077,58 @@ elf_s390_size_dynamic_sections (output_bfd, info) return TRUE; } +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; +{ + /* If tls_segment is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_segment == NULL) + return 0; + return elf_hash_table (info)->tls_segment->start; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_tls_segment *tls_segment + = elf_hash_table (info)->tls_segment; + + /* If tls_segment is NULL, we should have signalled an error already. */ + if (tls_segment == NULL) + return 0; + return (align_power (tls_segment->size, tls_segment->align) + + tls_segment->start - address); +} + +/* Complain if TLS instruction relocation is against an invalid + instruction. */ + +static void +invalid_tls_insn (input_bfd, input_section, rel) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rel; +{ + reloc_howto_type *howto; + + howto = elf_howto_table + ELF64_R_TYPE (rel->r_info); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name); +} + /* Relocate a 390 ELF section. */ static bfd_boolean @@ -1597,7 +2162,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + unsigned int r_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1607,12 +2172,13 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_reloc_status_type r; + int tls_type; r_type = ELF64_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT || r_type == (int) R_390_GNU_VTENTRY) continue; - if (r_type < 0 || r_type >= (int) R_390_max) + if (r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1620,6 +2186,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF64_R_SYM (rel->r_info); + + /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -1676,6 +2244,40 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, switch (r_type) { + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + /* There are three cases for a GOTPLT relocation. 1) The + relocation is against the jump slot entry of a plt that + will get emitted to the output file. 2) The relocation + is against the jump slot of a plt entry that has been + removed. elf_s390_adjust_gotplt has created a GOT entry + as replacement. 3) The relocation is against a local symbol. + Cases 2) and 3) are the same as the GOT relocation code + so we just have to test for case 1 and fall through for + the other two. */ + if (h != NULL && h->plt.offset != (bfd_vma) -1) + { + bfd_vma plt_index; + + /* Calc. index no. + Current offset - size first entry / entry size. */ + plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / + PLT_ENTRY_SIZE; + + /* Offset in GOT is PLT index plus GOT headers(3) times 4, + addr & GOT addr. */ + relocation = (plt_index + 3) * GOT_ENTRY_SIZE; + unresolved_reloc = FALSE; + + if (r_type == R_390_GOTPLTENT) + relocation += htab->sgot->output_section->vma; + break; + } + /* Fall through. */ + case R_390_GOT12: case R_390_GOT16: case R_390_GOT32: @@ -1775,12 +2377,15 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, * between the start of the GOT and the symbols entry. We * add the vma of the GOT to get the correct value. */ - if (r_type == R_390_GOTENT) + if ( r_type == R_390_GOTENT + || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; break; - case R_390_GOTOFF: + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: /* Relocation is relative to the start of the global offset table. */ @@ -1790,7 +2395,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, permitted by the ABI, we might have to change this calculation. */ relocation -= htab->sgot->output_section->vma; - break; case R_390_GOTPC: @@ -1825,6 +2429,29 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, + htab->splt->output_offset + h->plt.offset); unresolved_reloc = FALSE; + break; + + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ + + /* For local symbols or if we didn't make a PLT entry for + this symbol resolve the symbol directly. */ + if ( h == NULL + || h->plt.offset == (bfd_vma) -1 + || htab->splt == NULL) + { + relocation -= htab->sgot->output_section->vma; + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + - htab->sgot->output_section->vma); + unresolved_reloc = FALSE; break; case R_390_8: @@ -1931,6 +2558,346 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; + /* Relocations for tls literal pool entries. */ + case R_390_TLS_IE64: + if (info->shared) + { + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloc_out (output_bfd, &outrel, loc); + } + /* Fall through */ + + case R_390_TLS_GD64: + case R_390_TLS_GOTIE64: + r_type = elf_s390_tls_transition (info, r_type, h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf_s390_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_LE64; + } + if (r_type == R_390_TLS_GD64 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_IE64; + + if (r_type == R_390_TLS_LE64) + { + /* This relocation gets optimized away by the local exec + access optimization. */ + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + continue; + } + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + off = h->got.offset; + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + } + + emit_tls_relocs: + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_390_TLS_GD64) + dr_type = R_390_TLS_DTPMOD; + else + dr_type = R_390_TLS_TPOFF; + if (dr_type == R_390_TLS_TPOFF && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF64_R_INFO (indx, dr_type); + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + if (r_type == R_390_TLS_GD64) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + GOT_ENTRY_SIZE); + } + else + { + outrel.r_info = ELF64_R_INFO (indx, R_390_TLS_DTPOFF); + outrel.r_offset += GOT_ENTRY_SIZE; + outrel.r_addend = 0; + htab->srelgot->reloc_count++; + loc += sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } + } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if (off >= (bfd_vma) -2) + abort (); + if (r_type == ELF64_R_TYPE (rel->r_info)) + { + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IE64 || r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + } + else + { + bfd_put_64 (output_bfd, htab->sgot->output_offset + off, + contents + rel->r_offset); + continue; + } + break; + + case R_390_TLS_GOTIE12: + case R_390_TLS_IEENT: + if (h == NULL) + { + if (local_got_offsets == NULL) + abort(); + off = local_got_offsets[r_symndx]; + if (info->shared) + goto emit_tls_relocs; + } + else + { + off = h->got.offset; + tls_type = elf_s390_hash_entry(h)->tls_type; + if (info->shared || h->dynindx != -1 || tls_type < GOT_TLS_IE) + goto emit_tls_relocs; + } + + if (htab->sgot == NULL) + abort (); + + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + htab->sgot->contents + off); + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LDM64: + if (! info->shared) + /* The literal pool entry this relocation refers to gets ignored + by the optimized code of the local exec model. Do nothing + and the value will turn out zero. */ + continue; + + if (htab->sgot == NULL) + abort (); + + off = htab->tls_ldm_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + bfd_put_64 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF64_R_INFO (0, R_390_TLS_DTPMOD); + outrel.r_addend = 0; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ldm_got.offset |= 1; + } + relocation = htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LE64: + if (info->shared) + { + /* Linking a shared library with non-fpic code requires + a R_390_TLS_TPOFF relocation. */ + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + int indx; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + if (h != NULL && h->dynindx != -1) + indx = h->dynindx; + else + indx = 0; + outrel.r_info = ELF64_R_INFO (indx, R_390_TLS_TPOFF); + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + } + continue; + + case R_390_TLS_LDO64: + if (info->shared || (input_section->flags & SEC_CODE) == 0) + relocation -= dtpoff_base (info); + else + /* When converting LDO to LE, we must negate. */ + relocation = -tpoff (info, relocation); + break; + + /* Relocations for tls instructions. */ + case R_390_TLS_LOAD: + case R_390_TLS_GDCALL: + case R_390_TLS_LDCALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf_s390_hash_entry(h)->tls_type; + + if (tls_type == GOT_TLS_GD) + continue; + + if (r_type == R_390_TLS_LOAD) + { + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* IE->LE transition. Four valid cases: + lg %rx,(0,%ry) -> sllg %rx,%ry,0 + lg %rx,(%ry,0) -> sllg %rx,%ry,0 + lg %rx,(%ry,%r12) -> sllg %rx,%ry,0 + lg %rx,(%r12,%ry) -> sllg %rx,%ry,0 */ + unsigned int insn0, insn1, ry; + + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if (insn1 != 0x0004) + invalid_tls_insn (input_bfd, input_section, rel); + ry = 0; + if ((insn0 & 0xff00f000) == 0xe3000000) + /* lg %rx,0(%ry,0) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x000f0000); + else if ((insn0 & 0xff0f0000) == 0xe3000000) + /* lg %rx,0(0,%ry) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x0000f000) << 4; + else if ((insn0 & 0xff00f000) == 0xe300c000) + /* lg %rx,0(%ry,%r12) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x000f0000); + else if ((insn0 & 0xff0f0000) == 0xe30c0000) + /* lg %rx,0(%r12,%ry) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x0000f000) << 4; + else + invalid_tls_insn (input_bfd, input_section, rel); + insn0 = 0xeb000000 | (insn0 & 0x00f00000) | ry; + insn1 = 0x000d; + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + } + else if (r_type == R_390_TLS_GDCALL) + { + unsigned int insn0, insn1; + + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if ((insn0 & 0xffff0000) != 0xc0e50000) + invalid_tls_insn (input_bfd, input_section, rel); + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* GD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn0 = 0xc0040000; + insn1 = 0x0000; + } + else + { + /* GD->IE transition. + brasl %r14,__tls_get_addr@plt -> lg %r2,0(%r2,%r12) */ + insn0 = 0xe322c000; + insn1 = 0x0004; + } + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + else if (r_type == R_390_TLS_LDCALL) + { + if (!info->shared) + { + unsigned int insn0, insn1; + + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if ((insn0 & 0xffff0000) != 0xc0e50000) + invalid_tls_insn (input_bfd, input_section, rel); + /* LD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn0 = 0xc0040000; + insn1 = 0x0000; + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + } + continue; + default: break; } @@ -2090,7 +3057,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_GD + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE_NLT) { Elf_Internal_Rela rela; bfd_byte *loc; @@ -2308,13 +3278,6 @@ elf_s390_finish_dynamic_sections (output_bfd, info) return TRUE; } -static bfd_boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); -} - /* * Why was the hash table entry size definition changed from * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and @@ -2388,6 +3351,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_reloc_type_class elf_s390_reloc_type_class -#define elf_backend_object_p elf_s390_object_p +#define bfd_elf64_mkobject elf_s390_mkobject +#define elf_backend_object_p elf_s390_object_p #include "elf64-target.h" diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index c3a3f05..7164be2 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 64-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -77,6 +77,8 @@ static bfd_boolean sparc64_elf_fake_sections static const char *sparc64_elf_print_symbol_all PARAMS ((bfd *, PTR, asymbol *)); +static bfd_boolean sparc64_elf_new_section_hook + PARAMS ((bfd *, asection *)); static bfd_boolean sparc64_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); static bfd_boolean sparc64_elf_relocate_section @@ -171,7 +173,31 @@ static reloc_howto_type sparc64_elf_howto_table[] = HOWTO(R_SPARC_L44, 0,2,13,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_L44", FALSE,0,0x00000fff,FALSE), HOWTO(R_SPARC_REGISTER, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_REGISTER",FALSE,0,MINUS_ONE, FALSE), HOWTO(R_SPARC_UA64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", FALSE,0,MINUS_ONE, TRUE), - HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE) + HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_TLS_GD_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_GD_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_GD_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_GD_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_LDM_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LDM_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDO_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_TLS_LDO_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LDO_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LDO_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_LDO_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDO_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_IE_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_IE_LD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_LDX,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LDX",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LE_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_TLS_LE_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LE_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LE_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_DTPMOD32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPMOD64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF32,0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF32",FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF64,0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF64",FALSE,0,MINUS_ONE,TRUE), + HOWTO(R_SPARC_TLS_TPOFF32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF64",FALSE,0,0x00000000,TRUE) }; struct elf_reloc_map { @@ -225,6 +251,30 @@ static const struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_5, R_SPARC_5 }, { BFD_RELOC_SPARC_6, R_SPARC_6 }, { BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64 }, + { BFD_RELOC_SPARC_TLS_GD_HI22, R_SPARC_TLS_GD_HI22 }, + { BFD_RELOC_SPARC_TLS_GD_LO10, R_SPARC_TLS_GD_LO10 }, + { BFD_RELOC_SPARC_TLS_GD_ADD, R_SPARC_TLS_GD_ADD }, + { BFD_RELOC_SPARC_TLS_GD_CALL, R_SPARC_TLS_GD_CALL }, + { BFD_RELOC_SPARC_TLS_LDM_HI22, R_SPARC_TLS_LDM_HI22 }, + { BFD_RELOC_SPARC_TLS_LDM_LO10, R_SPARC_TLS_LDM_LO10 }, + { BFD_RELOC_SPARC_TLS_LDM_ADD, R_SPARC_TLS_LDM_ADD }, + { BFD_RELOC_SPARC_TLS_LDM_CALL, R_SPARC_TLS_LDM_CALL }, + { BFD_RELOC_SPARC_TLS_LDO_HIX22, R_SPARC_TLS_LDO_HIX22 }, + { BFD_RELOC_SPARC_TLS_LDO_LOX10, R_SPARC_TLS_LDO_LOX10 }, + { BFD_RELOC_SPARC_TLS_LDO_ADD, R_SPARC_TLS_LDO_ADD }, + { BFD_RELOC_SPARC_TLS_IE_HI22, R_SPARC_TLS_IE_HI22 }, + { BFD_RELOC_SPARC_TLS_IE_LO10, R_SPARC_TLS_IE_LO10 }, + { BFD_RELOC_SPARC_TLS_IE_LD, R_SPARC_TLS_IE_LD }, + { BFD_RELOC_SPARC_TLS_IE_LDX, R_SPARC_TLS_IE_LDX }, + { BFD_RELOC_SPARC_TLS_IE_ADD, R_SPARC_TLS_IE_ADD }, + { BFD_RELOC_SPARC_TLS_LE_HIX22, R_SPARC_TLS_LE_HIX22 }, + { BFD_RELOC_SPARC_TLS_LE_LOX10, R_SPARC_TLS_LE_LOX10 }, + { BFD_RELOC_SPARC_TLS_DTPMOD32, R_SPARC_TLS_DTPMOD32 }, + { BFD_RELOC_SPARC_TLS_DTPMOD64, R_SPARC_TLS_DTPMOD64 }, + { BFD_RELOC_SPARC_TLS_DTPOFF32, R_SPARC_TLS_DTPOFF32 }, + { BFD_RELOC_SPARC_TLS_DTPOFF64, R_SPARC_TLS_DTPOFF64 }, + { BFD_RELOC_SPARC_TLS_TPOFF32, R_SPARC_TLS_TPOFF32 }, + { BFD_RELOC_SPARC_TLS_TPOFF64, R_SPARC_TLS_TPOFF64 }, #ifndef SPARC64_OLD_RELOCS { BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 }, #endif @@ -1868,8 +1918,30 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) return TRUE; } -#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) -#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) +struct sparc64_elf_section_data +{ + struct bfd_elf_section_data elf; + unsigned int do_relax; +}; + +#define sec_do_relax(sec) \ + ((struct sparc64_elf_section_data *) (sec)->used_by_bfd)->do_relax + +static bfd_boolean +sparc64_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct sparc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct sparc64_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} static bfd_boolean sparc64_elf_relax_section (abfd, section, link_info, again) @@ -1879,7 +1951,7 @@ sparc64_elf_relax_section (abfd, section, link_info, again) bfd_boolean *again; { *again = FALSE; - SET_SEC_DO_RELAX (section); + sec_do_relax (section) = 1; return TRUE; } @@ -2456,7 +2528,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_WDISP30: do_wplt30: - if (SEC_DO_RELAX (input_section) + if (sec_do_relax (input_section) && rel->r_offset + 4 < input_section->_raw_size) { #define G0 0 @@ -3116,6 +3188,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_reloc_type_lookup #define bfd_elf64_bfd_relax_section \ sparc64_elf_relax_section +#define bfd_elf64_new_section_hook \ + sparc64_elf_new_section_hook #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 269c98c..00a0e88 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -2199,6 +2199,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_mips_irix_compat elf_n32_mips_irix_compat #define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf32_bfd_get_relocated_section_contents \ _bfd_elf_mips_get_relocated_section_contents diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index aa4c5ad..7097de0 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -1,5 +1,5 @@ /* IA-64 support for 64-bit ELF - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -148,6 +148,8 @@ struct elfNN_ia64_link_hash_table bfd_size_type minplt_entries; /* number of minplt entries */ unsigned reltext : 1; /* are there relocs against readonly sections? */ + unsigned self_dtpmod_done : 1;/* has self DTPMOD entry been finished? */ + bfd_vma self_dtpmod_offset; /* .got offset to self DTPMOD entry */ struct elfNN_ia64_local_hash_table loc_hash_table; }; @@ -2416,8 +2418,23 @@ allocate_global_data_got (dyn_i, data) } if (dyn_i->want_dtpmod) { - dyn_i->dtpmod_offset = x->ofs; - x->ofs += 8; + if (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->dtpmod_offset = x->ofs; + x->ofs += 8; + } + else + { + struct elfNN_ia64_link_hash_table *ia64_info; + + ia64_info = elfNN_ia64_hash_table (x->info); + if (ia64_info->self_dtpmod_offset == (bfd_vma) -1) + { + ia64_info->self_dtpmod_offset = x->ofs; + x->ofs += 8; + } + dyn_i->dtpmod_offset = ia64_info->self_dtpmod_offset; + } } if (dyn_i->want_dtprel) { @@ -2687,7 +2704,7 @@ allocate_dynrel_entries (dyn_i, data) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); if ((dynamic_symbol || shared) && dyn_i->want_tprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); - if ((dynamic_symbol || shared) && dyn_i->want_dtpmod) + if (dynamic_symbol && dyn_i->want_dtpmod) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); if (dynamic_symbol && dyn_i->want_dtprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); @@ -2753,6 +2770,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) dynobj = elf_hash_table(info)->dynobj; ia64_info = elfNN_ia64_hash_table (info); + ia64_info->self_dtpmod_offset = (bfd_vma) -1; BFD_ASSERT(dynobj != NULL); data.info = info; @@ -2831,6 +2849,8 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) /* Allocate space for the dynamic relocations that turned out to be required. */ + if (info->shared && ia64_info->self_dtpmod_offset != (bfd_vma) -1) + ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data); } @@ -3264,8 +3284,17 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) got_offset = dyn_i->tprel_offset; break; case R_IA64_DTPMOD64LSB: - done = dyn_i->dtpmod_done; - dyn_i->dtpmod_done = TRUE; + if (dyn_i->dtpmod_offset != ia64_info->self_dtpmod_offset) + { + done = dyn_i->dtpmod_done; + dyn_i->dtpmod_done = TRUE; + } + else + { + done = ia64_info->self_dtpmod_done; + ia64_info->self_dtpmod_done = TRUE; + dynindx = 0; + } got_offset = dyn_i->dtpmod_offset; break; case R_IA64_DTPREL64LSB: @@ -4224,6 +4253,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_DTPREL14: case R_IA64_DTPREL22: case R_IA64_DTPREL64I: + case R_IA64_DTPREL64LSB: + case R_IA64_DTPREL64MSB: value -= elfNN_ia64_dtprel_base (info); r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); break; @@ -4233,13 +4264,23 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_LTOFF_DTPREL22: { int got_r_type; + long dynindx = h ? h->dynindx : -1; + bfd_vma r_addend = rel->r_addend; switch (r_type) { default: case R_IA64_LTOFF_TPREL22: - if (!dynamic_symbol_p && !info->shared) - value -= elfNN_ia64_tprel_base (info); + if (!dynamic_symbol_p) + { + if (!info->shared) + value -= elfNN_ia64_tprel_base (info); + else + { + r_addend += value - elfNN_ia64_dtprel_base (info); + dynindx = 0; + } + } got_r_type = R_IA64_TPREL64LSB; break; case R_IA64_LTOFF_DTPMOD22: @@ -4254,8 +4295,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, break; } dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE); - value = set_got_entry (input_bfd, info, dyn_i, - (h ? h->dynindx : -1), rel->r_addend, + value = set_got_entry (input_bfd, info, dyn_i, dynindx, r_addend, value, got_r_type); value -= gp_val; r = elfNN_ia64_install_value (output_bfd, hit_addr, value, diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 3164a2e..22cc8a2 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -49,20 +49,28 @@ struct mips_got_entry { /* The input bfd in which the symbol is defined. */ bfd *abfd; - /* The index of the symbol, as stored in the relocation r_info. If - it's -1, the addend is a complete address into the - executable/shared library. */ - unsigned long symndx; - /* The addend of the relocation that should be added to the symbol - value. */ - bfd_vma addend; + /* The index of the symbol, as stored in the relocation r_info, if + we have a local symbol; -1 otherwise. */ + long symndx; + union + { + /* If abfd == NULL, an address that must be stored in the got. */ + bfd_vma address; + /* If abfd != NULL && symndx != -1, the addend of the relocation + that should be added to the symbol value. */ + bfd_vma addend; + /* If abfd != NULL && symndx == -1, the hash table entry + corresponding to a global symbol in the got (or, local, if + h->forced_local). */ + struct mips_elf_link_hash_entry *h; + } d; /* The offset from the beginning of the .got section to the entry - corresponding to this symbol+addend. */ - unsigned long gotidx; + corresponding to this symbol+addend. If it's a global symbol + whose offset is yet to be decided, it's going to be -1. */ + long gotidx; }; -/* This structure is used to hold .got information when linking. It - is stored in the tdata field of the bfd_elf_section_data structure. */ +/* This structure is used to hold .got information when linking. */ struct mips_got_info { @@ -77,8 +85,71 @@ struct mips_got_info unsigned int assigned_gotno; /* A hash table holding members of the got. */ struct htab *got_entries; + /* A hash table mapping input bfds to other mips_got_info. NULL + unless multi-got was necessary. */ + struct htab *bfd2got; + /* In multi-got links, a pointer to the next got (err, rather, most + of the time, it points to the previous got). */ + struct mips_got_info *next; +}; + +/* Map an input bfd to a got in a multi-got link. */ + +struct mips_elf_bfd2got_hash { + bfd *bfd; + struct mips_got_info *g; +}; + +/* Structure passed when traversing the bfd2got hash table, used to + create and merge bfd's gots. */ + +struct mips_elf_got_per_bfd_arg +{ + /* A hashtable that maps bfds to gots. */ + htab_t bfd2got; + /* The output bfd. */ + bfd *obfd; + /* The link information. */ + struct bfd_link_info *info; + /* A pointer to the primary got, i.e., the one that's going to get + the implicit relocations from DT_MIPS_LOCAL_GOTNO and + DT_MIPS_GOTSYM. */ + struct mips_got_info *primary; + /* A non-primary got we're trying to merge with other input bfd's + gots. */ + struct mips_got_info *current; + /* The maximum number of got entries that can be addressed with a + 16-bit offset. */ + unsigned int max_count; + /* The number of local and global entries in the primary got. */ + unsigned int primary_count; + /* The number of local and global entries in the current got. */ + unsigned int current_count; +}; + +/* Another structure used to pass arguments for got entries traversal. */ + +struct mips_elf_set_global_got_offset_arg +{ + struct mips_got_info *g; + int value; + unsigned int needed_relocs; + struct bfd_link_info *info; }; +struct _mips_elf_section_data +{ + struct bfd_elf_section_data elf; + union + { + struct mips_got_info *got_info; + bfd_byte *tdata; + } u; +}; + +#define mips_elf_section_data(sec) \ + ((struct _mips_elf_section_data *) (sec)->used_by_bfd) + /* This structure is passed to mips_elf_sort_hash_table_f when sorting the dynamic symbols. */ @@ -90,6 +161,11 @@ struct mips_elf_hash_sort_data /* The least dynamic symbol table index corresponding to a symbol with a GOT entry. */ long min_got_dynindx; + /* The greatest dynamic symbol table index corresponding to a symbol + with a GOT entry that is not referenced (e.g., a dynamic symbol + with dynamic relocations pointing to it from non-primary + GOTs). */ + long max_unref_got_dynindx; /* The greatest dynamic symbol table index not corresponding to a symbol without a GOT entry. */ long max_non_got_dynindx; @@ -323,30 +399,35 @@ static void bfd_mips_elf_swap_msym_out PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *)); static int sort_dynamic_relocs PARAMS ((const void *, const void *)); +static int sort_dynamic_relocs_64 + PARAMS ((const void *, const void *)); static bfd_boolean mips_elf_output_extsym PARAMS ((struct mips_elf_link_hash_entry *, PTR)); static int gptab_compare PARAMS ((const void *, const void *)); -static asection * mips_elf_got_section PARAMS ((bfd *)); +static asection * mips_elf_rel_dyn_section PARAMS ((bfd *, bfd_boolean)); +static asection * mips_elf_got_section PARAMS ((bfd *, bfd_boolean)); static struct mips_got_info *mips_elf_got_info PARAMS ((bfd *, asection **)); static bfd_vma mips_elf_local_got_index - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma)); + PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_vma)); static bfd_vma mips_elf_global_got_index - PARAMS ((bfd *, struct elf_link_hash_entry *)); + PARAMS ((bfd *, bfd *, struct elf_link_hash_entry *)); static bfd_vma mips_elf_got_page - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *)); + PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *)); static bfd_vma mips_elf_got16_entry - PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_boolean)); + PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_vma, bfd_boolean)); static bfd_vma mips_elf_got_offset_from_index - PARAMS ((bfd *, bfd *, bfd_vma)); + PARAMS ((bfd *, bfd *, bfd *, bfd_vma)); static struct mips_got_entry *mips_elf_create_local_got_entry - PARAMS ((bfd *, struct mips_got_info *, asection *, bfd_vma)); + PARAMS ((bfd *, bfd *, struct mips_got_info *, asection *, bfd_vma)); static bfd_boolean mips_elf_sort_hash_table PARAMS ((struct bfd_link_info *, unsigned long)); static bfd_boolean mips_elf_sort_hash_table_f PARAMS ((struct mips_elf_link_hash_entry *, PTR)); +static bfd_boolean mips_elf_record_local_got_symbol + PARAMS ((bfd *, long, bfd_vma, struct mips_got_info *)); static bfd_boolean mips_elf_record_global_got_symbol - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, + PARAMS ((struct elf_link_hash_entry *, bfd *, struct bfd_link_info *, struct mips_got_info *)); static const Elf_Internal_Rela *mips_elf_next_relocation PARAMS ((bfd *, unsigned int, const Elf_Internal_Rela *, @@ -361,7 +442,7 @@ static bfd_vma mips_elf_highest PARAMS ((bfd_vma)); static bfd_boolean mips_elf_create_compact_rel_section PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean mips_elf_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean)); static asection *mips_elf_create_msym_section PARAMS ((bfd *)); static bfd_reloc_status_type mips_elf_calculate_relocation @@ -389,9 +470,28 @@ static void mips_elf_irix6_finish_dynamic_symbol PARAMS ((bfd *, const char *, Elf_Internal_Sym *)); static bfd_boolean mips_mach_extends_p PARAMS ((unsigned long, unsigned long)); static bfd_boolean mips_32bit_flags_p PARAMS ((flagword)); +static INLINE hashval_t mips_elf_hash_bfd_vma PARAMS ((bfd_vma)); static hashval_t mips_elf_got_entry_hash PARAMS ((const PTR)); static int mips_elf_got_entry_eq PARAMS ((const PTR, const PTR)); +static bfd_boolean mips_elf_multi_got + PARAMS ((bfd *, struct bfd_link_info *, struct mips_got_info *, + asection *, bfd_size_type)); +static hashval_t mips_elf_multi_got_entry_hash PARAMS ((const PTR)); +static int mips_elf_multi_got_entry_eq PARAMS ((const PTR, const PTR)); +static hashval_t mips_elf_bfd2got_entry_hash PARAMS ((const PTR)); +static int mips_elf_bfd2got_entry_eq PARAMS ((const PTR, const PTR)); +static int mips_elf_make_got_per_bfd PARAMS ((void **, void *)); +static int mips_elf_merge_gots PARAMS ((void **, void *)); +static int mips_elf_set_global_got_offset PARAMS ((void**, void *)); +static int mips_elf_resolve_final_got_entry PARAMS ((void**, void *)); +static void mips_elf_resolve_final_got_entries + PARAMS ((struct mips_got_info *)); +static bfd_vma mips_elf_adjust_gp + PARAMS ((bfd *, struct mips_got_info *, bfd *)); +static struct mips_got_info *mips_elf_got_for_ibfd + PARAMS ((struct mips_got_info *, bfd *)); + /* This will be used when we sort the dynamic relocation records. */ static bfd *reldyn_sorting_bfd; @@ -493,15 +593,19 @@ static bfd *reldyn_sorting_bfd; /* The number of local .got entries we reserve. */ #define MIPS_RESERVED_GOTNO (2) +/* The offset of $gp from the beginning of the .got section. */ +#define ELF_MIPS_GP_OFFSET(abfd) (0x7ff0) + +/* The maximum size of the GOT for it to be addressable using 16-bit + offsets from $gp. */ +#define MIPS_ELF_GOT_MAX_SIZE(abfd) (ELF_MIPS_GP_OFFSET(abfd) + 0x7fff) + /* Instructions which appear in a stub. For some reason the stub is slightly different on an SGI system. */ -#define ELF_MIPS_GP_OFFSET(abfd) (SGI_COMPAT (abfd) ? 0x7ff0 : 0x8000) #define STUB_LW(abfd) \ - (SGI_COMPAT (abfd) \ - ? (ABI_64_P (abfd) \ - ? 0xdf998010 /* ld t9,0x8010(gp) */ \ - : 0x8f998010) /* lw t9,0x8010(gp) */ \ - : 0x8f998010) /* lw t9,0x8000(gp) */ + ((ABI_64_P (abfd) \ + ? 0xdf998010 /* ld t9,0x8010(gp) */ \ + : 0x8f998010)) /* lw t9,0x8010(gp) */ #define STUB_MOVE(abfd) \ (SGI_COMPAT (abfd) ? 0x03e07825 : 0x03e07821) /* move t7,ra */ #define STUB_JALR 0x0320f809 /* jal t9 */ @@ -638,6 +742,22 @@ mips_elf_link_hash_newfunc (entry, table, string) return (struct bfd_hash_entry *) ret; } + +bfd_boolean +_bfd_mips_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct _mips_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct _mips_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} /* Read ECOFF debugging information from a .mdebug section into a ecoff_debug_info structure. */ @@ -1211,6 +1331,26 @@ sort_dynamic_relocs (arg1, arg2) return ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info); } +/* Like sort_dynamic_relocs, but used for elf64 relocations. */ + +static int +sort_dynamic_relocs_64 (arg1, arg2) + const PTR arg1; + const PTR arg2; +{ + Elf_Internal_Rela int_reloc1[3]; + Elf_Internal_Rela int_reloc2[3]; + + (*get_elf_backend_data (reldyn_sorting_bfd)->s->swap_reloc_in) + (reldyn_sorting_bfd, arg1, int_reloc1); + (*get_elf_backend_data (reldyn_sorting_bfd)->s->swap_reloc_in) + (reldyn_sorting_bfd, arg2, int_reloc2); + + return (ELF64_R_SYM (int_reloc1[0].r_info) + - ELF64_R_SYM (int_reloc2[0].r_info)); +} + + /* This routine is used to write out ECOFF debugging external symbol information. It is called via mips_elf_link_hash_traverse. The ECOFF external symbol information must match the ELF external @@ -1419,17 +1559,36 @@ gptab_compare (p1, p2) } /* Functions to manage the got entry hash table. */ + +/* Use all 64 bits of a bfd_vma for the computation of a 32-bit + hash number. */ + +static INLINE hashval_t +mips_elf_hash_bfd_vma (addr) + bfd_vma addr; +{ +#ifdef BFD64 + return addr + (addr >> 32); +#else + return addr; +#endif +} + +/* got_entries only match if they're identical, except for gotidx, so + use all fields to compute the hash, and compare the appropriate + union members. */ + static hashval_t mips_elf_got_entry_hash (entry_) const PTR entry_; { const struct mips_got_entry *entry = (struct mips_got_entry *)entry_; - return htab_hash_pointer (entry->abfd) + entry->symndx -#ifdef BFD64 - + (entry->addend >> 32) -#endif - + entry->addend; + return entry->symndx + + (! entry->abfd ? mips_elf_hash_bfd_vma (entry->d.address) + : entry->abfd->id + + (entry->symndx >= 0 ? mips_elf_hash_bfd_vma (entry->d.addend) + : entry->d.h->root.root.root.hash)); } static int @@ -1441,16 +1600,87 @@ mips_elf_got_entry_eq (entry1, entry2) const struct mips_got_entry *e2 = (struct mips_got_entry *)entry2; return e1->abfd == e2->abfd && e1->symndx == e2->symndx - && e1->addend == e2->addend; + && (! e1->abfd ? e1->d.address == e2->d.address + : e1->symndx >= 0 ? e1->d.addend == e2->d.addend + : e1->d.h == e2->d.h); +} + +/* multi_got_entries are still a match in the case of global objects, + even if the input bfd in which they're referenced differs, so the + hash computation and compare functions are adjusted + accordingly. */ + +static hashval_t +mips_elf_multi_got_entry_hash (entry_) + const PTR entry_; +{ + const struct mips_got_entry *entry = (struct mips_got_entry *)entry_; + + return entry->symndx + + (! entry->abfd + ? mips_elf_hash_bfd_vma (entry->d.address) + : entry->symndx >= 0 + ? (entry->abfd->id + + mips_elf_hash_bfd_vma (entry->d.addend)) + : entry->d.h->root.root.root.hash); +} + +static int +mips_elf_multi_got_entry_eq (entry1, entry2) + const PTR entry1; + const PTR entry2; +{ + const struct mips_got_entry *e1 = (struct mips_got_entry *)entry1; + const struct mips_got_entry *e2 = (struct mips_got_entry *)entry2; + + return e1->symndx == e2->symndx + && (e1->symndx >= 0 ? e1->abfd == e2->abfd && e1->d.addend == e2->d.addend + : e1->abfd == NULL || e2->abfd == NULL + ? e1->abfd == e2->abfd && e1->d.address == e2->d.address + : e1->d.h == e2->d.h); } +/* Returns the dynamic relocation section for DYNOBJ. */ + +static asection * +mips_elf_rel_dyn_section (dynobj, create_p) + bfd *dynobj; + bfd_boolean create_p; +{ + static const char dname[] = ".rel.dyn"; + asection *sreloc; + + sreloc = bfd_get_section_by_name (dynobj, dname); + if (sreloc == NULL && create_p) + { + sreloc = bfd_make_section (dynobj, dname); + if (sreloc == NULL + || ! bfd_set_section_flags (dynobj, sreloc, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, sreloc, + 4)) + return NULL; + } + return sreloc; +} + /* Returns the GOT section for ABFD. */ static asection * -mips_elf_got_section (abfd) +mips_elf_got_section (abfd, maybe_excluded) bfd *abfd; + bfd_boolean maybe_excluded; { - return bfd_get_section_by_name (abfd, ".got"); + asection *sgot = bfd_get_section_by_name (abfd, ".got"); + if (sgot == NULL + || (! maybe_excluded && (sgot->flags & SEC_EXCLUDE) != 0)) + return NULL; + return sgot; } /* Returns the GOT information associated with the link indicated by @@ -1465,14 +1695,15 @@ mips_elf_got_info (abfd, sgotp) asection *sgot; struct mips_got_info *g; - sgot = mips_elf_got_section (abfd); + sgot = mips_elf_got_section (abfd, TRUE); BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; + BFD_ASSERT (mips_elf_section_data (sgot) != NULL); + g = mips_elf_section_data (sgot)->u.got_info; BFD_ASSERT (g != NULL); if (sgotp) - *sgotp = sgot; + *sgotp = (sgot->flags & SEC_EXCLUDE) == 0 ? sgot : NULL; + return g; } @@ -1481,8 +1712,8 @@ mips_elf_got_info (abfd, sgotp) -1 if no satisfactory GOT offset can be found. */ static bfd_vma -mips_elf_local_got_index (abfd, info, value) - bfd *abfd; +mips_elf_local_got_index (abfd, ibfd, info, value) + bfd *abfd, *ibfd; struct bfd_link_info *info; bfd_vma value; { @@ -1492,7 +1723,7 @@ mips_elf_local_got_index (abfd, info, value) g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - entry = mips_elf_create_local_got_entry (abfd, g, sgot, value); + entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value); if (entry) return entry->gotidx; else @@ -1502,18 +1733,38 @@ mips_elf_local_got_index (abfd, info, value) /* Returns the GOT index for the global symbol indicated by H. */ static bfd_vma -mips_elf_global_got_index (abfd, h) - bfd *abfd; +mips_elf_global_got_index (abfd, ibfd, h) + bfd *abfd, *ibfd; struct elf_link_hash_entry *h; { bfd_vma index; asection *sgot; - struct mips_got_info *g; + struct mips_got_info *g, *gg; long global_got_dynindx = 0; - g = mips_elf_got_info (abfd, &sgot); - if (g->global_gotsym != NULL) - global_got_dynindx = g->global_gotsym->dynindx; + gg = g = mips_elf_got_info (abfd, &sgot); + if (g->bfd2got && ibfd) + { + struct mips_got_entry e, *p; + + BFD_ASSERT (h->dynindx >= 0); + + g = mips_elf_got_for_ibfd (g, ibfd); + if (g->next != gg) + { + e.abfd = ibfd; + e.symndx = -1; + e.d.h = (struct mips_elf_link_hash_entry *)h; + + p = (struct mips_got_entry *) htab_find (g->got_entries, &e); + + BFD_ASSERT (p->gotidx > 0); + return p->gotidx; + } + } + + if (gg->global_gotsym != NULL) + global_got_dynindx = gg->global_gotsym->dynindx; /* Once we determine the global GOT entry with the lowest dynamic symbol table index, we must put all dynamic symbols with greater @@ -1534,8 +1785,8 @@ mips_elf_global_got_index (abfd, h) OFFSETP, if it is non-NULL. */ static bfd_vma -mips_elf_got_page (abfd, info, value, offsetp) - bfd *abfd; +mips_elf_got_page (abfd, ibfd, info, value, offsetp) + bfd *abfd, *ibfd; struct bfd_link_info *info; bfd_vma value; bfd_vma *offsetp; @@ -1547,7 +1798,7 @@ mips_elf_got_page (abfd, info, value, offsetp) g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - entry = mips_elf_create_local_got_entry (abfd, g, sgot, + entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, (value + 0x8000) & (~(bfd_vma)0xffff)); @@ -1557,7 +1808,7 @@ mips_elf_got_page (abfd, info, value, offsetp) index = entry->gotidx; if (offsetp) - *offsetp = value - entry->addend; + *offsetp = value - entry->d.address; return index; } @@ -1566,8 +1817,8 @@ mips_elf_got_page (abfd, info, value, offsetp) for value. Return the index into the GOT for this entry. */ static bfd_vma -mips_elf_got16_entry (abfd, info, value, external) - bfd *abfd; +mips_elf_got16_entry (abfd, ibfd, info, value, external) + bfd *abfd, *ibfd; struct bfd_link_info *info; bfd_vma value; bfd_boolean external; @@ -1587,7 +1838,7 @@ mips_elf_got16_entry (abfd, info, value, external) g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - entry = mips_elf_create_local_got_entry (abfd, g, sgot, value); + entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value); if (entry) return entry->gotidx; else @@ -1598,35 +1849,46 @@ mips_elf_got16_entry (abfd, info, value, external) in the GOT. */ static bfd_vma -mips_elf_got_offset_from_index (dynobj, output_bfd, index) +mips_elf_got_offset_from_index (dynobj, output_bfd, input_bfd, index) bfd *dynobj; bfd *output_bfd; + bfd *input_bfd; bfd_vma index; { asection *sgot; bfd_vma gp; + struct mips_got_info *g; - sgot = mips_elf_got_section (dynobj); - gp = _bfd_get_gp_value (output_bfd); - return (sgot->output_section->vma + sgot->output_offset + index - - gp); + g = mips_elf_got_info (dynobj, &sgot); + gp = _bfd_get_gp_value (output_bfd) + + mips_elf_adjust_gp (output_bfd, g, input_bfd); + + return sgot->output_section->vma + sgot->output_offset + index - gp; } /* Create a local GOT entry for VALUE. Return the index of the entry, or -1 if it could not be created. */ static struct mips_got_entry * -mips_elf_create_local_got_entry (abfd, g, sgot, value) - bfd *abfd; - struct mips_got_info *g; +mips_elf_create_local_got_entry (abfd, ibfd, gg, sgot, value) + bfd *abfd, *ibfd; + struct mips_got_info *gg; asection *sgot; bfd_vma value; { struct mips_got_entry entry, **loc; + struct mips_got_info *g; - entry.abfd = abfd; - entry.symndx = (unsigned long)-1; - entry.addend = value; + entry.abfd = NULL; + entry.symndx = -1; + entry.d.address = value; + + g = mips_elf_got_for_ibfd (gg, ibfd); + if (g == NULL) + { + g = mips_elf_got_for_ibfd (gg, abfd); + BFD_ASSERT (g != NULL); + } loc = (struct mips_got_entry **) htab_find_slot (g->got_entries, &entry, INSERT); @@ -1644,7 +1906,7 @@ mips_elf_create_local_got_entry (abfd, g, sgot, value) if (g->assigned_gotno >= g->local_gotno) { - (*loc)->gotidx = (unsigned long)-1; + (*loc)->gotidx = -1; /* We didn't allocate enough space in the GOT. */ (*_bfd_error_handler) (_("not enough GOT space for local GOT entries")); @@ -1676,8 +1938,19 @@ mips_elf_sort_hash_table (info, max_local) dynobj = elf_hash_table (info)->dynobj; + g = mips_elf_got_info (dynobj, NULL); + hsd.low = NULL; - hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount; + hsd.max_unref_got_dynindx = + hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount + /* In the multi-got case, assigned_gotno of the master got_info + indicate the number of entries that aren't referenced in the + primary GOT, but that must have entries because there are + dynamic relocations that reference it. Since they aren't + referenced, we move them to the end of the GOT, so that they + don't prevent other entries that are referenced from getting + too large offsets. */ + - (g->next ? g->assigned_gotno : 0); hsd.max_non_got_dynindx = max_local; mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *) elf_hash_table (info)), @@ -1687,10 +1960,11 @@ mips_elf_sort_hash_table (info, max_local) /* There should have been enough room in the symbol table to accommodate both the GOT and non-GOT symbols. */ BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); + BFD_ASSERT ((unsigned long)hsd.max_unref_got_dynindx + <= elf_hash_table (info)->dynsymcount); /* Now we know which dynamic symbol has the lowest dynamic symbol table index in the GOT. */ - g = mips_elf_got_info (dynobj, NULL); g->global_gotsym = hsd.low; return TRUE; @@ -1716,7 +1990,17 @@ mips_elf_sort_hash_table_f (h, data) if (h->root.dynindx == -1) return TRUE; - if (h->root.got.offset != 1) + /* Global symbols that need GOT entries that are not explicitly + referenced are marked with got offset 2. Those that are + referenced get a 1, and those that don't need GOT entries get + -1. */ + if (h->root.got.offset == 2) + { + if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx) + hsd->low = (struct elf_link_hash_entry *) h; + h->root.dynindx = hsd->max_unref_got_dynindx++; + } + else if (h->root.got.offset != 1) h->root.dynindx = hsd->max_non_got_dynindx++; else { @@ -1732,11 +2016,14 @@ mips_elf_sort_hash_table_f (h, data) posterity. */ static bfd_boolean -mips_elf_record_global_got_symbol (h, info, g) +mips_elf_record_global_got_symbol (h, abfd, info, g) struct elf_link_hash_entry *h; + bfd *abfd; struct bfd_link_info *info; - struct mips_got_info *g ATTRIBUTE_UNUSED; + struct mips_got_info *g; { + struct mips_got_entry entry, **loc; + /* A global symbol in the GOT must also be in the dynamic symbol table. */ if (h->dynindx == -1) @@ -1752,8 +2039,26 @@ mips_elf_record_global_got_symbol (h, info, g) return FALSE; } + entry.abfd = abfd; + entry.symndx = -1; + entry.d.h = (struct mips_elf_link_hash_entry *) h; + + loc = (struct mips_got_entry **) htab_find_slot (g->got_entries, &entry, + INSERT); + /* If we've already marked this entry as needing GOT space, we don't need to do it again. */ + if (*loc) + return TRUE; + + *loc = (struct mips_got_entry *)bfd_alloc (abfd, sizeof entry); + + if (! *loc) + return FALSE; + + entry.gotidx = -1; + memcpy (*loc, &entry, sizeof entry); + if (h->got.offset != MINUS_ONE) return TRUE; @@ -1764,6 +2069,582 @@ mips_elf_record_global_got_symbol (h, info, g) return TRUE; } + +/* Reserve space in G for a GOT entry containing the value of symbol + SYMNDX in input bfd ABDF, plus ADDEND. */ + +static bfd_boolean +mips_elf_record_local_got_symbol (abfd, symndx, addend, g) + bfd *abfd; + long symndx; + bfd_vma addend; + struct mips_got_info *g; +{ + struct mips_got_entry entry, **loc; + + entry.abfd = abfd; + entry.symndx = symndx; + entry.d.addend = addend; + loc = (struct mips_got_entry **) + htab_find_slot (g->got_entries, &entry, INSERT); + + if (*loc) + return TRUE; + + entry.gotidx = g->local_gotno++; + + *loc = (struct mips_got_entry *)bfd_alloc (abfd, sizeof entry); + + if (! *loc) + return FALSE; + + memcpy (*loc, &entry, sizeof entry); + + return TRUE; +} + +/* Compute the hash value of the bfd in a bfd2got hash entry. */ + +static hashval_t +mips_elf_bfd2got_entry_hash (entry_) + const PTR entry_; +{ + const struct mips_elf_bfd2got_hash *entry + = (struct mips_elf_bfd2got_hash *)entry_; + + return entry->bfd->id; +} + +/* Check whether two hash entries have the same bfd. */ + +static int +mips_elf_bfd2got_entry_eq (entry1, entry2) + const PTR entry1; + const PTR entry2; +{ + const struct mips_elf_bfd2got_hash *e1 + = (const struct mips_elf_bfd2got_hash *)entry1; + const struct mips_elf_bfd2got_hash *e2 + = (const struct mips_elf_bfd2got_hash *)entry2; + + return e1->bfd == e2->bfd; +} + +/* In a multi-got link, determine the GOT to be used for IBDF. G must + be the master GOT data. */ + +static struct mips_got_info * +mips_elf_got_for_ibfd (g, ibfd) + struct mips_got_info *g; + bfd *ibfd; +{ + struct mips_elf_bfd2got_hash e, *p; + + if (! g->bfd2got) + return g; + + e.bfd = ibfd; + p = (struct mips_elf_bfd2got_hash *) htab_find (g->bfd2got, &e); + return p ? p->g : NULL; +} + +/* Create one separate got for each bfd that has entries in the global + got, such that we can tell how many local and global entries each + bfd requires. */ + +static int +mips_elf_make_got_per_bfd (entryp, p) + void **entryp; + void *p; +{ + struct mips_got_entry *entry = (struct mips_got_entry *)*entryp; + struct mips_elf_got_per_bfd_arg *arg = (struct mips_elf_got_per_bfd_arg *)p; + htab_t bfd2got = arg->bfd2got; + struct mips_got_info *g; + struct mips_elf_bfd2got_hash bfdgot_entry, *bfdgot; + void **bfdgotp; + + /* Find the got_info for this GOT entry's input bfd. Create one if + none exists. */ + bfdgot_entry.bfd = entry->abfd; + bfdgotp = htab_find_slot (bfd2got, &bfdgot_entry, INSERT); + bfdgot = (struct mips_elf_bfd2got_hash *)*bfdgotp; + + if (bfdgot != NULL) + g = bfdgot->g; + else + { + bfdgot = (struct mips_elf_bfd2got_hash *)bfd_alloc + (arg->obfd, sizeof (struct mips_elf_bfd2got_hash)); + + if (bfdgot == NULL) + { + arg->obfd = 0; + return 0; + } + + *bfdgotp = bfdgot; + + bfdgot->bfd = entry->abfd; + bfdgot->g = g = (struct mips_got_info *) + bfd_alloc (arg->obfd, sizeof (struct mips_got_info)); + if (g == NULL) + { + arg->obfd = 0; + return 0; + } + + g->global_gotsym = NULL; + g->global_gotno = 0; + g->local_gotno = 0; + g->assigned_gotno = -1; + g->got_entries = htab_try_create (1, mips_elf_multi_got_entry_hash, + mips_elf_multi_got_entry_eq, + (htab_del) NULL); + if (g->got_entries == NULL) + { + arg->obfd = 0; + return 0; + } + + g->bfd2got = NULL; + g->next = NULL; + } + + /* Insert the GOT entry in the bfd's got entry hash table. */ + entryp = htab_find_slot (g->got_entries, entry, INSERT); + if (*entryp != NULL) + return 1; + + *entryp = entry; + + if (entry->symndx >= 0 || entry->d.h->forced_local) + ++g->local_gotno; + else + ++g->global_gotno; + + return 1; +} + +/* Attempt to merge gots of different input bfds. Try to use as much + as possible of the primary got, since it doesn't require explicit + dynamic relocations, but don't use bfds that would reference global + symbols out of the addressable range. Failing the primary got, + attempt to merge with the current got, or finish the current got + and then make make the new got current. */ + +static int +mips_elf_merge_gots (bfd2got_, p) + void **bfd2got_; + void *p; +{ + struct mips_elf_bfd2got_hash *bfd2got + = (struct mips_elf_bfd2got_hash *)*bfd2got_; + struct mips_elf_got_per_bfd_arg *arg = (struct mips_elf_got_per_bfd_arg *)p; + unsigned int lcount = bfd2got->g->local_gotno; + unsigned int gcount = bfd2got->g->global_gotno; + unsigned int maxcnt = arg->max_count; + + /* If we don't have a primary GOT and this is not too big, use it as + a starting point for the primary GOT. */ + if (! arg->primary && lcount + gcount <= maxcnt) + { + arg->primary = bfd2got->g; + arg->primary_count = lcount + gcount; + } + /* If it looks like we can merge this bfd's entries with those of + the primary, merge them. The heuristics is conservative, but we + don't have to squeeze it too hard. */ + else if (arg->primary + && (arg->primary_count + lcount + gcount) <= maxcnt) + { + struct mips_got_info *g = bfd2got->g; + int old_lcount = arg->primary->local_gotno; + int old_gcount = arg->primary->global_gotno; + + bfd2got->g = arg->primary; + + htab_traverse (g->got_entries, + mips_elf_make_got_per_bfd, + arg); + if (arg->obfd == NULL) + return 0; + + htab_delete (g->got_entries); + /* We don't have to worry about releasing memory of the actual + got entries, since they're all in the master got_entries hash + table anyway. */ + + BFD_ASSERT (old_lcount + lcount == arg->primary->local_gotno); + BFD_ASSERT (old_gcount + gcount >= arg->primary->global_gotno); + + arg->primary_count = arg->primary->local_gotno + + arg->primary->global_gotno; + } + /* If we can merge with the last-created got, do it. */ + else if (arg->current + && arg->current_count + lcount + gcount <= maxcnt) + { + struct mips_got_info *g = bfd2got->g; + int old_lcount = arg->current->local_gotno; + int old_gcount = arg->current->global_gotno; + + bfd2got->g = arg->current; + + htab_traverse (g->got_entries, + mips_elf_make_got_per_bfd, + arg); + if (arg->obfd == NULL) + return 0; + + htab_delete (g->got_entries); + + BFD_ASSERT (old_lcount + lcount == arg->current->local_gotno); + BFD_ASSERT (old_gcount + gcount >= arg->current->global_gotno); + + arg->current_count = arg->current->local_gotno + + arg->current->global_gotno; + } + /* Well, we couldn't merge, so create a new GOT. Don't check if it + fits; if it turns out that it doesn't, we'll get relocation + overflows anyway. */ + else + { + bfd2got->g->next = arg->current; + arg->current = bfd2got->g; + + arg->current_count = lcount + gcount; + } + + return 1; +} + +/* If passed a NULL mips_got_info in the argument, set the marker used + to tell whether a global symbol needs a got entry (in the primary + got) to the given VALUE. + + If passed a pointer G to a mips_got_info in the argument (it must + not be the primary GOT), compute the offset from the beginning of + the (primary) GOT section to the entry in G corresponding to the + global symbol. G's assigned_gotno must contain the index of the + first available global GOT entry in G. VALUE must contain the size + of a GOT entry in bytes. For each global GOT entry that requires a + dynamic relocation, NEEDED_RELOCS is incremented, and the symbol is + marked as not elligible for lazy resolution through a function + stub. */ +static int +mips_elf_set_global_got_offset (entryp, p) + void **entryp; + void *p; +{ + struct mips_got_entry *entry = (struct mips_got_entry *)*entryp; + struct mips_elf_set_global_got_offset_arg *arg + = (struct mips_elf_set_global_got_offset_arg *)p; + struct mips_got_info *g = arg->g; + + if (entry->abfd != NULL && entry->symndx == -1 + && entry->d.h->root.dynindx != -1) + { + if (g) + { + BFD_ASSERT (g->global_gotsym == NULL); + + entry->gotidx = arg->value * (long) g->assigned_gotno++; + /* We can't do lazy update of GOT entries for + non-primary GOTs since the PLT entries don't use the + right offsets, so punt at it for now. */ + entry->d.h->no_fn_stub = TRUE; + if (arg->info->shared + || (elf_hash_table (arg->info)->dynamic_sections_created + && ((entry->d.h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + && ((entry->d.h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) + ++arg->needed_relocs; + } + else + entry->d.h->root.got.offset = arg->value; + } + + return 1; +} + +/* Follow indirect and warning hash entries so that each got entry + points to the final symbol definition. P must point to a pointer + to the hash table we're traversing. Since this traversal may + modify the hash table, we set this pointer to NULL to indicate + we've made a potentially-destructive change to the hash table, so + the traversal must be restarted. */ +static int +mips_elf_resolve_final_got_entry (entryp, p) + void **entryp; + void *p; +{ + struct mips_got_entry *entry = (struct mips_got_entry *)*entryp; + htab_t got_entries = *(htab_t *)p; + + if (entry->abfd != NULL && entry->symndx == -1) + { + struct mips_elf_link_hash_entry *h = entry->d.h; + + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; + + if (entry->d.h == h) + return 1; + + entry->d.h = h; + + /* If we can't find this entry with the new bfd hash, re-insert + it, and get the traversal restarted. */ + if (! htab_find (got_entries, entry)) + { + htab_clear_slot (got_entries, entryp); + entryp = htab_find_slot (got_entries, entry, INSERT); + if (! *entryp) + *entryp = entry; + /* Abort the traversal, since the whole table may have + moved, and leave it up to the parent to restart the + process. */ + *(htab_t *)p = NULL; + return 0; + } + /* We might want to decrement the global_gotno count, but it's + either too early or too late for that at this point. */ + } + + return 1; +} + +/* Turn indirect got entries in a got_entries table into their final + locations. */ +static void +mips_elf_resolve_final_got_entries (g) + struct mips_got_info *g; +{ + htab_t got_entries; + + do + { + got_entries = g->got_entries; + + htab_traverse (got_entries, + mips_elf_resolve_final_got_entry, + &got_entries); + } + while (got_entries == NULL); +} + +/* Return the offset of an input bfd IBFD's GOT from the beginning of + the primary GOT. */ +static bfd_vma +mips_elf_adjust_gp (abfd, g, ibfd) + bfd *abfd; + struct mips_got_info *g; + bfd *ibfd; +{ + if (g->bfd2got == NULL) + return 0; + + g = mips_elf_got_for_ibfd (g, ibfd); + if (! g) + return 0; + + BFD_ASSERT (g->next); + + g = g->next; + + return (g->local_gotno + g->global_gotno) * MIPS_ELF_GOT_SIZE (abfd); +} + +/* Turn a single GOT that is too big for 16-bit addressing into + a sequence of GOTs, each one 16-bit addressable. */ + +static bfd_boolean +mips_elf_multi_got (abfd, info, g, got, pages) + bfd *abfd; + struct bfd_link_info *info; + struct mips_got_info *g; + asection *got; + bfd_size_type pages; +{ + struct mips_elf_got_per_bfd_arg got_per_bfd_arg; + struct mips_elf_set_global_got_offset_arg set_got_offset_arg; + struct mips_got_info *gg; + unsigned int assign; + + g->bfd2got = htab_try_create (1, mips_elf_bfd2got_entry_hash, + mips_elf_bfd2got_entry_eq, + (htab_del) NULL); + if (g->bfd2got == NULL) + return FALSE; + + got_per_bfd_arg.bfd2got = g->bfd2got; + got_per_bfd_arg.obfd = abfd; + got_per_bfd_arg.info = info; + + /* Count how many GOT entries each input bfd requires, creating a + map from bfd to got info while at that. */ + mips_elf_resolve_final_got_entries (g); + htab_traverse (g->got_entries, mips_elf_make_got_per_bfd, &got_per_bfd_arg); + if (got_per_bfd_arg.obfd == NULL) + return FALSE; + + got_per_bfd_arg.current = NULL; + got_per_bfd_arg.primary = NULL; + /* Taking out PAGES entries is a worst-case estimate. We could + compute the maximum number of pages that each separate input bfd + uses, but it's probably not worth it. */ + got_per_bfd_arg.max_count = ((MIPS_ELF_GOT_MAX_SIZE (abfd) + / MIPS_ELF_GOT_SIZE (abfd)) + - MIPS_RESERVED_GOTNO - pages); + + /* Try to merge the GOTs of input bfds together, as long as they + don't seem to exceed the maximum GOT size, choosing one of them + to be the primary GOT. */ + htab_traverse (g->bfd2got, mips_elf_merge_gots, &got_per_bfd_arg); + if (got_per_bfd_arg.obfd == NULL) + return FALSE; + + /* If we find any suitable primary GOT, create an empty one. */ + if (got_per_bfd_arg.primary == NULL) + { + g->next = (struct mips_got_info *) + bfd_alloc (abfd, sizeof (struct mips_got_info)); + if (g->next == NULL) + return FALSE; + + g->next->global_gotsym = NULL; + g->next->global_gotno = 0; + g->next->local_gotno = 0; + g->next->assigned_gotno = 0; + g->next->got_entries = htab_try_create (1, mips_elf_multi_got_entry_hash, + mips_elf_multi_got_entry_eq, + (htab_del) NULL); + if (g->next->got_entries == NULL) + return FALSE; + g->next->bfd2got = NULL; + } + else + g->next = got_per_bfd_arg.primary; + g->next->next = got_per_bfd_arg.current; + + /* GG is now the master GOT, and G is the primary GOT. */ + gg = g; + g = g->next; + + /* Map the output bfd to the primary got. That's what we're going + to use for bfds that use GOT16 or GOT_PAGE relocations that we + didn't mark in check_relocs, and we want a quick way to find it. + We can't just use gg->next because we're going to reverse the + list. */ + { + struct mips_elf_bfd2got_hash *bfdgot; + void **bfdgotp; + + bfdgot = (struct mips_elf_bfd2got_hash *)bfd_alloc + (abfd, sizeof (struct mips_elf_bfd2got_hash)); + + if (bfdgot == NULL) + return FALSE; + + bfdgot->bfd = abfd; + bfdgot->g = g; + bfdgotp = htab_find_slot (gg->bfd2got, bfdgot, INSERT); + + BFD_ASSERT (*bfdgotp == NULL); + *bfdgotp = bfdgot; + } + + /* The IRIX dynamic linker requires every symbol that is referenced + in a dynamic relocation to be present in the primary GOT, so + arrange for them to appear after those that are actually + referenced. + + GNU/Linux could very well do without it, but it would slow down + the dynamic linker, since it would have to resolve every dynamic + symbol referenced in other GOTs more than once, without help from + the cache. Also, knowing that every external symbol has a GOT + helps speed up the resolution of local symbols too, so GNU/Linux + follows IRIX's practice. + + The number 2 is used by mips_elf_sort_hash_table_f to count + global GOT symbols that are unreferenced in the primary GOT, with + an initial dynamic index computed from gg->assigned_gotno, where + the number of unreferenced global entries in the primary GOT is + preserved. */ + if (1) + { + gg->assigned_gotno = gg->global_gotno - g->global_gotno; + g->global_gotno = gg->global_gotno; + set_got_offset_arg.value = 2; + } + else + { + /* This could be used for dynamic linkers that don't optimize + symbol resolution while applying relocations so as to use + primary GOT entries or assuming the symbol is locally-defined. + With this code, we assign lower dynamic indices to global + symbols that are not referenced in the primary GOT, so that + their entries can be omitted. */ + gg->assigned_gotno = 0; + set_got_offset_arg.value = -1; + } + + /* Reorder dynamic symbols as described above (which behavior + depends on the setting of VALUE). */ + set_got_offset_arg.g = NULL; + htab_traverse (gg->got_entries, mips_elf_set_global_got_offset, + &set_got_offset_arg); + set_got_offset_arg.value = 1; + htab_traverse (g->got_entries, mips_elf_set_global_got_offset, + &set_got_offset_arg); + if (! mips_elf_sort_hash_table (info, 1)) + return FALSE; + + /* Now go through the GOTs assigning them offset ranges. + [assigned_gotno, local_gotno[ will be set to the range of local + entries in each GOT. We can then compute the end of a GOT by + adding local_gotno to global_gotno. We reverse the list and make + it circular since then we'll be able to quickly compute the + beginning of a GOT, by computing the end of its predecessor. To + avoid special cases for the primary GOT, while still preserving + assertions that are valid for both single- and multi-got links, + we arrange for the main got struct to have the right number of + global entries, but set its local_gotno such that the initial + offset of the primary GOT is zero. Remember that the primary GOT + will become the last item in the circular linked list, so it + points back to the master GOT. */ + gg->local_gotno = -g->global_gotno; + gg->global_gotno = g->global_gotno; + assign = 0; + gg->next = gg; + + do + { + struct mips_got_info *gn; + + assign += MIPS_RESERVED_GOTNO; + g->assigned_gotno = assign; + g->local_gotno += assign + pages; + assign = g->local_gotno + g->global_gotno; + + /* Take g out of the direct list, and push it onto the reversed + list that gg points to. */ + gn = g->next; + g->next = gg->next; + gg->next = g; + g = gn; + } + while (g); + + got->_raw_size = (gg->next->local_gotno + + gg->next->global_gotno) * MIPS_ELF_GOT_SIZE (abfd); + + return TRUE; +} + /* Returns the first relocation of type r_type found, beginning with RELOCATION. RELEND is one-past-the-end of the relocation table. */ @@ -1939,9 +2820,10 @@ mips_elf_create_compact_rel_section (abfd, info) /* Create the .got section to hold the global offset table. */ static bfd_boolean -mips_elf_create_got_section (abfd, info) +mips_elf_create_got_section (abfd, info, maybe_exclude) bfd *abfd; struct bfd_link_info *info; + bfd_boolean maybe_exclude; { flagword flags; register asection *s; @@ -1951,12 +2833,20 @@ mips_elf_create_got_section (abfd, info) bfd_size_type amt; /* This function may be called more than once. */ - if (mips_elf_got_section (abfd)) - return TRUE; + s = mips_elf_got_section (abfd, TRUE); + if (s) + { + if (! maybe_exclude) + s->flags &= ~SEC_EXCLUDE; + return TRUE; + } flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + if (maybe_exclude) + flags |= SEC_EXCLUDE; + s = bfd_make_section (abfd, ".got"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) @@ -1982,9 +2872,6 @@ mips_elf_create_got_section (abfd, info) && ! bfd_elf32_link_record_dynamic_symbol (info, h)) return FALSE; - /* The first several global offset table entries are reserved. */ - s->_raw_size = MIPS_RESERVED_GOTNO * MIPS_ELF_GOT_SIZE (abfd); - amt = sizeof (struct mips_got_info); g = (struct mips_got_info *) bfd_alloc (abfd, amt); if (g == NULL) @@ -1992,20 +2879,15 @@ mips_elf_create_got_section (abfd, info) g->global_gotsym = NULL; g->local_gotno = MIPS_RESERVED_GOTNO; g->assigned_gotno = MIPS_RESERVED_GOTNO; + g->bfd2got = NULL; + g->next = NULL; g->got_entries = htab_try_create (1, mips_elf_got_entry_hash, mips_elf_got_entry_eq, (htab_del) NULL); if (g->got_entries == NULL) return FALSE; - if (elf_section_data (s) == NULL) - { - amt = sizeof (struct bfd_elf_section_data); - s->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); - if (elf_section_data (s) == NULL) - return FALSE; - } - elf_section_data (s)->tdata = (PTR) g; - elf_section_data (s)->this_hdr.sh_flags + mips_elf_section_data (s)->u.got_info = g; + mips_elf_section_data (s)->elf.this_hdr.sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; return TRUE; @@ -2327,6 +3209,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, { BFD_ASSERT (addend == 0); g = mips_elf_global_got_index (elf_hash_table (info)->dynobj, + input_bfd, (struct elf_link_hash_entry *) h); if (! elf_hash_table(info)->dynamic_sections_created || (info->shared @@ -2337,7 +3220,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, symbol is defined locally, or was forced to be local. We must initialize this entry in the GOT. */ bfd *tmpbfd = elf_hash_table (info)->dynobj; - asection *sgot = mips_elf_got_section(tmpbfd); + asection *sgot = mips_elf_got_section (tmpbfd, FALSE); MIPS_ELF_PUT_WORD (tmpbfd, symbol + addend, sgot->contents + g); } } @@ -2347,14 +3230,15 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, break; else { - g = mips_elf_local_got_index (abfd, info, symbol + addend); + g = mips_elf_local_got_index (abfd, input_bfd, + info, symbol + addend); if (g == MINUS_ONE) return bfd_reloc_outofrange; } /* Convert GOT indices to actual offsets. */ g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, g); + abfd, input_bfd, g); break; case R_MIPS_HI16: @@ -2365,6 +3249,11 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, case R_MIPS_LITERAL: gp0 = _bfd_get_gp_value (input_bfd); gp = _bfd_get_gp_value (abfd); + if (elf_hash_table (info)->dynobj) + gp += mips_elf_adjust_gp (abfd, + mips_elf_got_info + (elf_hash_table (info)->dynobj, NULL), + input_bfd); break; default: @@ -2537,12 +3426,13 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, follows. */ forced = ! mips_elf_local_relocation_p (input_bfd, relocation, local_sections, FALSE); - value = mips_elf_got16_entry (abfd, info, symbol + addend, forced); + value = mips_elf_got16_entry (abfd, input_bfd, info, + symbol + addend, forced); if (value == MINUS_ONE) return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, value); + abfd, input_bfd, value); overflowed_p = mips_elf_overflow_p (value, 16); break; } @@ -2581,16 +3471,16 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, break; case R_MIPS_GOT_PAGE: - value = mips_elf_got_page (abfd, info, symbol + addend, NULL); + value = mips_elf_got_page (abfd, input_bfd, info, symbol + addend, NULL); if (value == MINUS_ONE) return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, value); + abfd, input_bfd, value); overflowed_p = mips_elf_overflow_p (value, 16); break; case R_MIPS_GOT_OFST: - mips_elf_got_page (abfd, info, symbol + addend, &value); + mips_elf_got_page (abfd, input_bfd, info, symbol + addend, &value); overflowed_p = mips_elf_overflow_p (value, 16); break; @@ -2861,7 +3751,7 @@ mips_elf_allocate_dynamic_relocations (abfd, n) { asection *s; - s = bfd_get_section_by_name (abfd, ".rel.dyn"); + s = mips_elf_rel_dyn_section (abfd, FALSE); BFD_ASSERT (s != NULL); if (s->_raw_size == 0) @@ -2898,7 +3788,7 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, r_type = ELF_R_TYPE (output_bfd, rel->r_info); dynobj = elf_hash_table (info)->dynobj; - sreloc = bfd_get_section_by_name (dynobj, ".rel.dyn"); + sreloc = mips_elf_rel_dyn_section (dynobj, FALSE); BFD_ASSERT (sreloc != NULL); BFD_ASSERT (sreloc->contents != NULL); BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd) @@ -2936,11 +3826,9 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, } #endif - if (outrel[0].r_offset == (bfd_vma) -1) + if (outrel[0].r_offset == (bfd_vma) -1 + || outrel[0].r_offset == (bfd_vma) -2) skip = TRUE; - /* FIXME: For -2 runtime relocation needs to be skipped, but - properly resolved statically and installed. */ - BFD_ASSERT (outrel[0].r_offset != (bfd_vma) -2); /* If we've decided to skip this relocation, just output an empty record. Note that R_MIPS_NONE == 0, so that this call to memset @@ -3310,19 +4198,19 @@ _bfd_mips_elf_section_processing (abfd, hdr) if (hdr->sh_type == SHT_MIPS_OPTIONS && hdr->bfd_section != NULL - && elf_section_data (hdr->bfd_section) != NULL - && elf_section_data (hdr->bfd_section)->tdata != NULL) + && mips_elf_section_data (hdr->bfd_section) != NULL + && mips_elf_section_data (hdr->bfd_section)->u.tdata != NULL) { bfd_byte *contents, *l, *lend; - /* We stored the section contents in the elf_section_data tdata - field in the set_section_contents routine. We save the - section contents so that we don't have to read them again. + /* We stored the section contents in the tdata field in the + set_section_contents routine. We save the section contents + so that we don't have to read them again. At this point we know that elf_gp is set, so we can look through the section contents to see if there is an ODK_REGINFO structure. */ - contents = (bfd_byte *) elf_section_data (hdr->bfd_section)->tdata; + contents = mips_elf_section_data (hdr->bfd_section)->u.tdata; l = contents; lend = contents + hdr->sh_size; while (l + sizeof (Elf_External_Options) <= lend) @@ -3955,7 +4843,10 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info) } /* We need to create .got section. */ - if (! mips_elf_create_got_section (abfd, info)) + if (! mips_elf_create_got_section (abfd, info, FALSE)) + return FALSE; + + if (! mips_elf_rel_dyn_section (elf_hash_table (info)->dynobj, TRUE)) return FALSE; /* Create the .msym section on IRIX6. It is used by the dynamic @@ -4284,13 +5175,13 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) } else { - sgot = mips_elf_got_section (dynobj); + sgot = mips_elf_got_section (dynobj, FALSE); if (sgot == NULL) g = NULL; else { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; + BFD_ASSERT (mips_elf_section_data (sgot) != NULL); + g = mips_elf_section_data (sgot)->u.got_info; BFD_ASSERT (g != NULL); } } @@ -4345,7 +5236,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) case R_MIPS_GOT_DISP: if (dynobj == NULL) elf_hash_table (info)->dynobj = dynobj = abfd; - if (! mips_elf_create_got_section (dynobj, info)) + if (! mips_elf_create_got_section (dynobj, info, FALSE)) return FALSE; g = mips_elf_got_info (dynobj, &sgot); break; @@ -4368,8 +5259,6 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) || r_type == R_MIPS_GOT_LO16 || r_type == R_MIPS_GOT_DISP)) { - struct mips_got_entry entry, **loc; - /* We may need a local GOT entry for this relocation. We don't count R_MIPS_GOT_PAGE because we can estimate the maximum number of pages needed by looking at the size of @@ -4377,26 +5266,9 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) R_MIPS_CALL16. We don't count R_MIPS_GOT_HI16, or R_MIPS_CALL_HI16 because these are always followed by an R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16. */ - - entry.abfd = abfd; - entry.symndx = r_symndx; - entry.addend = rel->r_addend; - loc = (struct mips_got_entry **) - htab_find_slot (g->got_entries, &entry, INSERT); - - if (*loc == NULL) - { - entry.gotidx = g->local_gotno++; - - *loc = (struct mips_got_entry *)bfd_alloc (abfd, sizeof entry); - - if (! *loc) - return FALSE; - - memcpy (*loc, &entry, sizeof entry); - - sgot->_raw_size += MIPS_ELF_GOT_SIZE (dynobj); - } + if (! mips_elf_record_local_got_symbol (abfd, r_symndx, + rel->r_addend, g)) + return FALSE; } switch (r_type) @@ -4417,7 +5289,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) if (h != NULL) { /* This symbol requires a global offset table entry. */ - if (! mips_elf_record_global_got_symbol (h, info, g)) + if (! mips_elf_record_global_got_symbol (h, abfd, info, g)) return FALSE; /* We need a stub, not a plt entry for the undefined @@ -4433,7 +5305,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) case R_MIPS_GOT_LO16: case R_MIPS_GOT_DISP: /* This symbol requires a global offset table entry. */ - if (h && ! mips_elf_record_global_got_symbol (h, info, g)) + if (h && ! mips_elf_record_global_got_symbol (h, abfd, info, g)) return FALSE; break; @@ -4445,24 +5317,9 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) { if (sreloc == NULL) { - const char *dname = ".rel.dyn"; - - sreloc = bfd_get_section_by_name (dynobj, dname); + sreloc = mips_elf_rel_dyn_section (dynobj, TRUE); if (sreloc == NULL) - { - sreloc = bfd_make_section (dynobj, dname); - if (sreloc == NULL - || ! bfd_set_section_flags (dynobj, sreloc, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, sreloc, - 4)) - return FALSE; - } + return FALSE; } #define MIPS_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY) if (info->shared) @@ -4497,9 +5354,16 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) this symbol, a symbol must have a dynamic symbol table index greater that DT_MIPS_GOTSYM if there are dynamic relocations against it. */ - if (h != NULL - && ! mips_elf_record_global_got_symbol (h, info, g)) - return FALSE; + if (h != NULL) + { + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (! mips_elf_create_got_section (dynobj, info, TRUE)) + return FALSE; + g = mips_elf_got_info (dynobj, &sgot); + if (! mips_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + } } if (SGI_COMPAT (abfd)) @@ -4691,19 +5555,86 @@ _bfd_mips_elf_always_size_sections (output_bfd, info) { asection *ri; + bfd *dynobj; + asection *s; + struct mips_got_info *g; + int i; + bfd_size_type loadable_size = 0; + bfd_size_type local_gotno; + bfd *sub; + /* The .reginfo section has a fixed size. */ ri = bfd_get_section_by_name (output_bfd, ".reginfo"); if (ri != NULL) bfd_set_section_size (output_bfd, ri, (bfd_size_type) sizeof (Elf32_External_RegInfo)); - if (info->relocateable - || ! mips_elf_hash_table (info)->mips16_stubs_seen) + if (! (info->relocateable + || ! mips_elf_hash_table (info)->mips16_stubs_seen)) + mips_elf_link_hash_traverse (mips_elf_hash_table (info), + mips_elf_check_mips16_stubs, + (PTR) NULL); + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj == NULL) + /* Relocatable links don't have it. */ + return TRUE; + + g = mips_elf_got_info (dynobj, &s); + if (s == NULL) return TRUE; - mips_elf_link_hash_traverse (mips_elf_hash_table (info), - mips_elf_check_mips16_stubs, - (PTR) NULL); + /* Calculate the total loadable size of the output. That + will give us the maximum number of GOT_PAGE entries + required. */ + for (sub = info->input_bfds; sub; sub = sub->link_next) + { + asection *subsection; + + for (subsection = sub->sections; + subsection; + subsection = subsection->next) + { + if ((subsection->flags & SEC_ALLOC) == 0) + continue; + loadable_size += ((subsection->_raw_size + 0xf) + &~ (bfd_size_type) 0xf); + } + } + + /* There has to be a global GOT entry for every symbol with + a dynamic symbol table index of DT_MIPS_GOTSYM or + higher. Therefore, it make sense to put those symbols + that need GOT entries at the end of the symbol table. We + do that here. */ + if (! mips_elf_sort_hash_table (info, 1)) + return FALSE; + + if (g->global_gotsym != NULL) + i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; + else + /* If there are no global symbols, or none requiring + relocations, then GLOBAL_GOTSYM will be NULL. */ + i = 0; + + /* In the worst case, we'll get one stub per dynamic symbol, plus + one to account for the dummy entry at the end required by IRIX + rld. */ + loadable_size += MIPS_FUNCTION_STUB_SIZE * (i + 1); + + /* Assume there are two loadable segments consisting of + contiguous sections. Is 5 enough? */ + local_gotno = (loadable_size >> 16) + 5; + + g->local_gotno += local_gotno; + s->_raw_size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd); + + g->global_gotno = i; + s->_raw_size += i * MIPS_ELF_GOT_SIZE (output_bfd); + + if (s->_raw_size > MIPS_ELF_GOT_MAX_SIZE (output_bfd) + && ! mips_elf_multi_got (output_bfd, info, g, s, local_gotno)) + return FALSE; return TRUE; } @@ -4718,7 +5649,6 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) bfd *dynobj; asection *s; bfd_boolean reltext; - struct mips_got_info *g = NULL; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -4794,61 +5724,64 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) to copy relocs into the output file. */ if (strcmp (name, ".rel.dyn") != 0) s->reloc_count = 0; + + /* If combreloc is enabled, elf_link_sort_relocs() will + sort relocations, but in a different way than we do, + and before we're done creating relocations. Also, it + will move them around between input sections' + relocation's contents, so our sorting would be + broken, so don't let it run. */ + info->combreloc = 0; } } else if (strncmp (name, ".got", 4) == 0) { - int i; - bfd_size_type loadable_size = 0; - bfd_size_type local_gotno; - bfd *sub; - - BFD_ASSERT (elf_section_data (s) != NULL); - g = (struct mips_got_info *) elf_section_data (s)->tdata; - BFD_ASSERT (g != NULL); - - /* Calculate the total loadable size of the output. That - will give us the maximum number of GOT_PAGE entries - required. */ - for (sub = info->input_bfds; sub; sub = sub->link_next) + /* _bfd_mips_elf_always_size_sections() has already done + most of the work, but some symbols may have been mapped + to versions that we must now resolve in the got_entries + hash tables. */ + struct mips_got_info *gg = mips_elf_got_info (dynobj, NULL); + struct mips_got_info *g = gg; + struct mips_elf_set_global_got_offset_arg set_got_offset_arg; + unsigned int needed_relocs = 0; + + if (gg->next) { - asection *subsection; + set_got_offset_arg.value = MIPS_ELF_GOT_SIZE (output_bfd); + set_got_offset_arg.info = info; - for (subsection = sub->sections; - subsection; - subsection = subsection->next) + mips_elf_resolve_final_got_entries (gg); + for (g = gg->next; g && g->next != gg; g = g->next) { - if ((subsection->flags & SEC_ALLOC) == 0) - continue; - loadable_size += ((subsection->_raw_size + 0xf) - &~ (bfd_size_type) 0xf); + unsigned int save_assign; + + mips_elf_resolve_final_got_entries (g); + + /* Assign offsets to global GOT entries. */ + save_assign = g->assigned_gotno; + g->assigned_gotno = g->local_gotno; + set_got_offset_arg.g = g; + set_got_offset_arg.needed_relocs = 0; + htab_traverse (g->got_entries, + mips_elf_set_global_got_offset, + &set_got_offset_arg); + needed_relocs += set_got_offset_arg.needed_relocs; + BFD_ASSERT (g->assigned_gotno - g->local_gotno + <= g->global_gotno); + + g->assigned_gotno = save_assign; + if (info->shared) + { + needed_relocs += g->local_gotno - g->assigned_gotno; + BFD_ASSERT (g->assigned_gotno == g->next->local_gotno + + g->next->global_gotno + + MIPS_RESERVED_GOTNO); + } } - } - loadable_size += MIPS_FUNCTION_STUB_SIZE; - - /* Assume there are two loadable segments consisting of - contiguous sections. Is 5 enough? */ - local_gotno = (loadable_size >> 16) + 5; - - g->local_gotno += local_gotno; - s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj); - - /* There has to be a global GOT entry for every symbol with - a dynamic symbol table index of DT_MIPS_GOTSYM or - higher. Therefore, it make sense to put those symbols - that need GOT entries at the end of the symbol table. We - do that here. */ - if (! mips_elf_sort_hash_table (info, 1)) - return FALSE; - if (g->global_gotsym != NULL) - i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; - else - /* If there are no global symbols, or none requiring - relocations, then GLOBAL_GOTSYM will be NULL. */ - i = 0; - g->global_gotno = i; - s->_raw_size += i * MIPS_ELF_GOT_SIZE (dynobj); + if (needed_relocs) + mips_elf_allocate_dynamic_relocations (dynobj, needed_relocs); + } } else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0) { @@ -4933,7 +5866,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0)) return FALSE; - if (bfd_get_section_by_name (dynobj, ".rel.dyn")) + if (mips_elf_rel_dyn_section (dynobj, FALSE)) { if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0)) return FALSE; @@ -5476,7 +6409,7 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma gval; asection *sgot; asection *smsym; - struct mips_got_info *g; + struct mips_got_info *g, *gg; const char *name; struct mips_elf_link_hash_entry *mh; @@ -5524,10 +6457,10 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0); - sgot = mips_elf_got_section (dynobj); + sgot = mips_elf_got_section (dynobj, FALSE); BFD_ASSERT (sgot != NULL); - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; + BFD_ASSERT (mips_elf_section_data (sgot) != NULL); + g = mips_elf_section_data (sgot)->u.got_info; BFD_ASSERT (g != NULL); /* Run through the global symbol table, creating GOT entries for all @@ -5548,15 +6481,69 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym) That's because such the functions are now no longer defined in a shared object.) */ - if (info->shared && h->root.type == bfd_link_hash_undefined) + if ((info->shared && h->root.type == bfd_link_hash_undefined) + || h->root.type == bfd_link_hash_undefweak) value = 0; else value = h->root.u.def.value; } - offset = mips_elf_global_got_index (dynobj, h); + offset = mips_elf_global_got_index (dynobj, output_bfd, h); MIPS_ELF_PUT_WORD (output_bfd, value, sgot->contents + offset); } + if (g->next && h->dynindx != -1) + { + struct mips_got_entry e, *p; + bfd_vma offset; + bfd_vma value; + Elf_Internal_Rela rel[3]; + bfd_vma addend = 0; + + gg = g; + + e.abfd = output_bfd; + e.symndx = -1; + e.d.h = (struct mips_elf_link_hash_entry *)h; + + if (info->shared + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + value = 0; + else if (sym->st_value) + value = sym->st_value; + else + value = h->root.u.def.value; + + memset (rel, 0, sizeof (rel)); + rel[0].r_info = ELF_R_INFO (output_bfd, 0, R_MIPS_REL32); + + for (g = g->next; g->next != gg; g = g->next) + { + if (g->got_entries + && (p = (struct mips_got_entry *) htab_find (g->got_entries, + &e))) + { + offset = p->gotidx; + rel[0].r_offset = rel[1].r_offset = rel[2].r_offset = offset; + + MIPS_ELF_PUT_WORD (output_bfd, value, sgot->contents + offset); + + if ((info->shared + || (elf_hash_table (info)->dynamic_sections_created + && p->d.h != NULL + && ((p->d.h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + && ((p->d.h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) + && ! (mips_elf_create_dynamic_relocation + (output_bfd, info, rel, + e.d.h, NULL, value, &addend, sgot))) + return FALSE; + BFD_ASSERT (addend == 0); + } + } + } + /* Create a .msym entry, if appropriate. */ smsym = bfd_get_section_by_name (dynobj, ".msym"); if (smsym) @@ -5663,19 +6650,21 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info) bfd *dynobj; asection *sdyn; asection *sgot; - struct mips_got_info *g; + struct mips_got_info *gg, *g; dynobj = elf_hash_table (info)->dynobj; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - sgot = bfd_get_section_by_name (dynobj, ".got"); + sgot = mips_elf_got_section (dynobj, FALSE); if (sgot == NULL) - g = NULL; + gg = g = NULL; else { - BFD_ASSERT (elf_section_data (sgot) != NULL); - g = (struct mips_got_info *) elf_section_data (sgot)->tdata; + BFD_ASSERT (mips_elf_section_data (sgot) != NULL); + gg = mips_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (gg != NULL); + g = mips_elf_got_for_ibfd (gg, output_bfd); BFD_ASSERT (g != NULL); } @@ -5705,7 +6694,7 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info) switch (dyn.d_tag) { case DT_RELENT: - s = (bfd_get_section_by_name (dynobj, ".rel.dyn")); + s = mips_elf_rel_dyn_section (dynobj, FALSE); BFD_ASSERT (s != NULL); dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj); break; @@ -5791,9 +6780,9 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info) break; case DT_MIPS_GOTSYM: - if (g->global_gotsym) + if (gg->global_gotsym) { - dyn.d_un.d_val = g->global_gotsym->dynindx; + dyn.d_un.d_val = gg->global_gotsym->dynindx; break; } /* In case if we don't have global got symbols we default @@ -5856,6 +6845,41 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info) elf_section_data (sgot->output_section)->this_hdr.sh_entsize = MIPS_ELF_GOT_SIZE (output_bfd); + /* Generate dynamic relocations for the non-primary gots. */ + if (gg != NULL && gg->next) + { + Elf_Internal_Rela rel[3]; + bfd_vma addend = 0; + + memset (rel, 0, sizeof (rel)); + rel[0].r_info = ELF_R_INFO (output_bfd, 0, R_MIPS_REL32); + + for (g = gg->next; g->next != gg; g = g->next) + { + bfd_vma index = g->next->local_gotno + g->next->global_gotno; + + MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents + + index++ * MIPS_ELF_GOT_SIZE (output_bfd)); + MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000, sgot->contents + + index++ * MIPS_ELF_GOT_SIZE (output_bfd)); + + if (! info->shared) + continue; + + while (index < g->assigned_gotno) + { + rel[0].r_offset = rel[1].r_offset = rel[2].r_offset + = index++ * MIPS_ELF_GOT_SIZE (output_bfd); + if (!(mips_elf_create_dynamic_relocation + (output_bfd, info, rel, NULL, + bfd_abs_section_ptr, + 0, &addend, sgot))) + return FALSE; + BFD_ASSERT (addend == 0); + } + } + } + { asection *smsym; asection *s; @@ -5918,24 +6942,22 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info) /* We need to sort the entries of the dynamic relocation section. */ - if (!ABI_64_P (output_bfd)) + s = mips_elf_rel_dyn_section (dynobj, FALSE); + + if (s != NULL + && s->_raw_size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd)) { - asection *reldyn; + reldyn_sorting_bfd = output_bfd; - reldyn = bfd_get_section_by_name (dynobj, ".rel.dyn"); - if (reldyn != NULL && reldyn->reloc_count > 2) - { - reldyn_sorting_bfd = output_bfd; - qsort ((Elf32_External_Rel *) reldyn->contents + 1, - (size_t) reldyn->reloc_count - 1, - sizeof (Elf32_External_Rel), sort_dynamic_relocs); - } + if (ABI_64_P (output_bfd)) + qsort ((Elf64_External_Rel *) s->contents + 1, + (size_t) s->reloc_count - 1, + sizeof (Elf64_Mips_External_Rel), sort_dynamic_relocs_64); + else + qsort ((Elf32_External_Rel *) s->contents + 1, + (size_t) s->reloc_count - 1, + sizeof (Elf32_External_Rel), sort_dynamic_relocs); } - - /* Clean up a first relocation in .rel.dyn. */ - s = bfd_get_section_by_name (dynobj, ".rel.dyn"); - if (s != NULL && s->_raw_size > 0) - memset (s->contents, 0, MIPS_ELF_REL_SIZE (dynobj)); } return TRUE; @@ -6503,14 +7525,57 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local) h->forced_local = TRUE; dynobj = elf_hash_table (info)->dynobj; - got = bfd_get_section_by_name (dynobj, ".got"); - g = (struct mips_got_info *) elf_section_data (got)->tdata; + got = mips_elf_got_section (dynobj, FALSE); + g = mips_elf_section_data (got)->u.got_info; - _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); + if (g->next) + { + struct mips_got_entry e; + struct mips_got_info *gg = g; + + /* Since we're turning what used to be a global symbol into a + local one, bump up the number of local entries of each GOT + that had an entry for it. This will automatically decrease + the number of global entries, since global_gotno is actually + the upper limit of global entries. */ + e.abfd = dynobj; + e.symndx = -1; + e.d.h = h; + + for (g = g->next; g != gg; g = g->next) + if (htab_find (g->got_entries, &e)) + { + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } + + /* If this was a global symbol forced into the primary GOT, we + no longer need an entry for it. We can't release the entry + at this point, but we must at least stop counting it as one + of the symbols that required a forced got entry. */ + if (h->root.got.offset == 2) + { + BFD_ASSERT (gg->assigned_gotno > 0); + gg->assigned_gotno--; + } + } + else if (g->global_gotno == 0 && g->global_gotsym == NULL) + /* If we haven't got through GOT allocation yet, just bump up the + number of local entries, as this symbol won't be counted as + global. */ + g->local_gotno++; + else if (h->root.got.offset == 1) + { + /* If we're past non-multi-GOT allocation and this symbol had + been marked for a global got entry, give it a local entry + instead. */ + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } - /* FIXME: Do we allocate too much GOT space here? */ - g->local_gotno++; - got->_raw_size += MIPS_ELF_GOT_SIZE (dynobj); + _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); } #define PDR_SIZE 32 @@ -6565,7 +7630,7 @@ _bfd_mips_elf_discard_info (abfd, cookie, info) if (skip != 0) { - elf_section_data (o)->tdata = tdata; + mips_elf_section_data (o)->u.tdata = tdata; o->_cooked_size = o->_raw_size - skip * PDR_SIZE; ret = TRUE; } @@ -6599,7 +7664,7 @@ _bfd_mips_elf_write_section (output_bfd, sec, contents) if (strcmp (sec->name, ".pdr") != 0) return FALSE; - if (elf_section_data (sec)->tdata == NULL) + if (mips_elf_section_data (sec)->u.tdata == NULL) return FALSE; to = contents; @@ -6608,7 +7673,7 @@ _bfd_mips_elf_write_section (output_bfd, sec, contents) from < end; from += PDR_SIZE, i++) { - if (((unsigned char *) elf_section_data (sec)->tdata)[i] == 1) + if ((mips_elf_section_data (sec)->u.tdata)[i] == 1) continue; if (to != from) memcpy (to, from, PDR_SIZE); @@ -6758,7 +7823,7 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count) if (elf_section_data (section) == NULL) return FALSE; } - c = (bfd_byte *) elf_section_data (section)->tdata; + c = mips_elf_section_data (section)->u.tdata; if (c == NULL) { bfd_size_type size; @@ -6770,7 +7835,7 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count) c = (bfd_byte *) bfd_zalloc (abfd, size); if (c == NULL) return FALSE; - elf_section_data (section)->tdata = (PTR) c; + mips_elf_section_data (section)->u.tdata = c; } memcpy (c + offset, location, (size_t) count); @@ -7069,8 +8134,8 @@ _bfd_mips_elf_final_link (abfd, info) /* Make sure we didn't grow the global .got region. */ dynobj = elf_hash_table (info)->dynobj; - got = bfd_get_section_by_name (dynobj, ".got"); - g = (struct mips_got_info *) elf_section_data (got)->tdata; + got = mips_elf_got_section (dynobj, FALSE); + g = mips_elf_section_data (got)->u.got_info; if (g->global_gotsym != NULL) BFD_ASSERT ((elf_hash_table (info)->dynsymcount @@ -7861,6 +8926,11 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) new_flags &= ~EF_MIPS_NOREORDER; old_flags &= ~EF_MIPS_NOREORDER; + /* Some IRIX 6 BSD-compatibility objects have this bit set. It + doesn't seem to matter. */ + new_flags &= ~EF_MIPS_XGOT; + old_flags &= ~EF_MIPS_XGOT; + if (new_flags == old_flags) return TRUE; diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 9b935c6..3f77943 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -1,5 +1,5 @@ /* MIPS ELF specific backend routines. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/common.h" #include "elf/internal.h" +extern bfd_boolean _bfd_mips_elf_new_section_hook + PARAMS ((bfd *, asection *)); extern void _bfd_mips_elf_symbol_processing PARAMS ((bfd *, asymbol *)); extern bfd_boolean _bfd_mips_elf_section_processing diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index c3ff104..69e3782 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -1,6 +1,6 @@ /* Target definitions for NN-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -53,7 +53,9 @@ #define bfd_elfNN_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol #endif #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol +#ifndef bfd_elfNN_new_section_hook #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook +#endif #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach #ifndef bfd_elfNN_set_section_contents #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 98f06a8..4ee9d87 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -793,6 +793,30 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_L44", "BFD_RELOC_SPARC_REGISTER", "BFD_RELOC_SPARC_REV32", + "BFD_RELOC_SPARC_TLS_GD_HI22", + "BFD_RELOC_SPARC_TLS_GD_LO10", + "BFD_RELOC_SPARC_TLS_GD_ADD", + "BFD_RELOC_SPARC_TLS_GD_CALL", + "BFD_RELOC_SPARC_TLS_LDM_HI22", + "BFD_RELOC_SPARC_TLS_LDM_LO10", + "BFD_RELOC_SPARC_TLS_LDM_ADD", + "BFD_RELOC_SPARC_TLS_LDM_CALL", + "BFD_RELOC_SPARC_TLS_LDO_HIX22", + "BFD_RELOC_SPARC_TLS_LDO_LOX10", + "BFD_RELOC_SPARC_TLS_LDO_ADD", + "BFD_RELOC_SPARC_TLS_IE_HI22", + "BFD_RELOC_SPARC_TLS_IE_LO10", + "BFD_RELOC_SPARC_TLS_IE_LD", + "BFD_RELOC_SPARC_TLS_IE_LDX", + "BFD_RELOC_SPARC_TLS_IE_ADD", + "BFD_RELOC_SPARC_TLS_LE_HIX22", + "BFD_RELOC_SPARC_TLS_LE_LOX10", + "BFD_RELOC_SPARC_TLS_DTPMOD32", + "BFD_RELOC_SPARC_TLS_DTPMOD64", + "BFD_RELOC_SPARC_TLS_DTPOFF32", + "BFD_RELOC_SPARC_TLS_DTPOFF64", + "BFD_RELOC_SPARC_TLS_TPOFF32", + "BFD_RELOC_SPARC_TLS_TPOFF64", "BFD_RELOC_ALPHA_GPDISP_HI16", "BFD_RELOC_ALPHA_GPDISP_LO16", "BFD_RELOC_ALPHA_GPDISP", @@ -1208,6 +1232,35 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_390_GOT64", "BFD_RELOC_390_PLT64", "BFD_RELOC_390_GOTENT", + "BFD_RELOC_390_GOTOFF64", + "BFD_RELOC_390_GOTPLT12", + "BFD_RELOC_390_GOTPLT16", + "BFD_RELOC_390_GOTPLT32", + "BFD_RELOC_390_GOTPLT64", + "BFD_RELOC_390_GOTPLTENT", + "BFD_RELOC_390_PLTOFF16", + "BFD_RELOC_390_PLTOFF32", + "BFD_RELOC_390_PLTOFF64", + "BFD_RELOC_390_TLS_LOAD", + "BFD_RELOC_390_TLS_GDCALL", + "BFD_RELOC_390_TLS_LDCALL", + "BFD_RELOC_390_TLS_GD32", + "BFD_RELOC_390_TLS_GD64", + "BFD_RELOC_390_TLS_GOTIE12", + "BFD_RELOC_390_TLS_GOTIE32", + "BFD_RELOC_390_TLS_GOTIE64", + "BFD_RELOC_390_TLS_LDM32", + "BFD_RELOC_390_TLS_LDM64", + "BFD_RELOC_390_TLS_IE32", + "BFD_RELOC_390_TLS_IE64", + "BFD_RELOC_390_TLS_IEENT", + "BFD_RELOC_390_TLS_LE32", + "BFD_RELOC_390_TLS_LE64", + "BFD_RELOC_390_TLS_LDO32", + "BFD_RELOC_390_TLS_LDO64", + "BFD_RELOC_390_TLS_DTPMOD", + "BFD_RELOC_390_TLS_DTPOFF", + "BFD_RELOC_390_TLS_TPOFF", "BFD_RELOC_IP2K_FR9", "BFD_RELOC_IP2K_BANK", "BFD_RELOC_IP2K_ADDR16CJP", diff --git a/bfd/opncls.c b/bfd/opncls.c index 32d223e..81bd2c8 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -1,6 +1,6 @@ /* opncls.c -- open and close a BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -25,6 +25,7 @@ #include "sysdep.h" #include "objalloc.h" #include "libbfd.h" +#include "libiberty.h" #ifndef S_IXUSR #define S_IXUSR 0100 /* Execute by owner. */ @@ -36,6 +37,10 @@ #define S_IXOTH 0001 /* Execute by others. */ #endif +/* Counter used to initialize the bfd identifier. */ + +static unsigned int _bfd_id_counter = 0; + /* fdopen is a loser -- we should use stdio exclusively. Unfortunately if we do that we can't use fcntl. */ @@ -50,6 +55,8 @@ _bfd_new_bfd () if (nbfd == NULL) return NULL; + nbfd->id = _bfd_id_counter++; + nbfd->memory = (PTR) objalloc_create (); if (nbfd->memory == NULL) { @@ -693,3 +700,335 @@ bfd_release (abfd, block) { objalloc_free_block ((struct objalloc *) abfd->memory, block); } + + +/* + GNU Extension: separate debug-info files + + The idea here is that a special section called .gnu_debuglink might be + embedded in a binary file, which indicates that some *other* file + contains the real debugging information. This special section contains a + filename and CRC32 checksum, which we read and resolve to another file, + if it exists. + + This facilitates "optional" provision of debugging information, without + having to provide two complete copies of every binary object (with and + without debug symbols). +*/ + +static unsigned long calc_crc32 PARAMS ((unsigned long, const unsigned char *, size_t)); +static char * get_debug_link_info PARAMS ((bfd *, unsigned long *)); +static bfd_boolean separate_debug_file_exists PARAMS ((const char *, const unsigned long)); +static char * find_separate_debug_file PARAMS ((bfd *, const char *)); + +/* +INTERNAL_FUNCTION + calc_crc32 + +SYNOPSIS + unsigned long calc_crc32 (unsigned long crc, const unsigned char *buf, size_t len); + +DESCRIPTION + Advance the CRC32 given by @var{crc} through @var{len} + bytes of @var{buf}. Return the updated CRC32 value. +*/ + +static unsigned long +calc_crc32 (crc, buf, len) + unsigned long crc; + const unsigned char *buf; + size_t len; +{ + static const unsigned long crc32_table[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }; + const unsigned char *end; + + crc = ~crc & 0xffffffff; + for (end = buf + len; buf < end; ++ buf) + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); + return ~crc & 0xffffffff;; +} + + +/* +INTERNAL_FUNCTION + get_debug_link_info + +SYNOPSIS + char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out) + +DESCRIPTION + fetch the filename and CRC32 value for any separate debuginfo + associated with @var{abfd}. Return NULL if no such info found, + otherwise return filename and update @var{crc32_out}. +*/ + +static char * +get_debug_link_info (abfd, crc32_out) + bfd *abfd; + unsigned long *crc32_out; +{ + asection * sect; + bfd_size_type debuglink_size; + unsigned long crc32; + char * contents; + int crc_offset; + bfd_boolean ret; + + BFD_ASSERT (abfd); + BFD_ASSERT (crc32_out); + + sect = bfd_get_section_by_name (abfd, ".gnu_debuglink"); + + if (sect == NULL) + return NULL; + + debuglink_size = bfd_section_size (abfd, sect); + + contents = xmalloc (debuglink_size); + ret = bfd_get_section_contents (abfd, sect, contents, + (file_ptr)0, debuglink_size); + if (! ret) + { + free (contents); + return NULL; + } + + /* Crc value is stored after the filename, aligned up to 4 bytes. */ + crc_offset = strlen (contents) + 1; + crc_offset = (crc_offset + 3) & ~3; + + crc32 = bfd_get_32 (abfd, (bfd_byte *) (contents + crc_offset)); + + *crc32_out = crc32; + return contents; +} + +/* +INTERNAL_FUNCTION + separate_debug_file_exists + +SYNOPSIS + bfd_boolean separate_debug_file_exists (char * name, unsigned long crc32) + +DESCRIPTION + Checks to see if @var{name} is a file and if its contents + match @var{crc32}. +*/ + +static bfd_boolean +separate_debug_file_exists (name, crc) + const char *name; + const unsigned long crc; +{ + static char buffer [8 * 1024]; + unsigned long file_crc = 0; + int fd; + int count; + + BFD_ASSERT (name); + + fd = open (name, O_RDONLY); + if (fd < 0) + return FALSE; + + while ((count = read (fd, buffer, sizeof (buffer))) > 0) + file_crc = calc_crc32 (file_crc, buffer, count); + + close (fd); + + return crc == file_crc; +} + + +/* +INTERNAL_FUNCTION + find_separate_debug_file + +SYNOPSIS + char * find_separate_debug_file (bfd *abfd) + +DESCRIPTION + Searches @var{abfd} for a reference to separate debugging + information, scans various locations in the filesystem, including + the file tree rooted at @var{debug_file_directory}, and returns a + filename of such debugging information if the file is found and has + matching CRC32. Returns NULL if no reference to debugging file + exists, or file cannot be found. +*/ + +static char * +find_separate_debug_file (abfd, debug_file_directory) + bfd *abfd; + const char *debug_file_directory; +{ + char *basename; + char *dir; + char *debugfile; + unsigned long crc32; + int i; + + BFD_ASSERT (abfd); + if (debug_file_directory == NULL) + debug_file_directory = "."; + + /* BFD may have been opened from a stream. */ + if (! abfd->filename) + return NULL; + + basename = get_debug_link_info (abfd, & crc32); + + if (basename == NULL || strlen (basename) < 1) + return NULL; + + dir = xstrdup (abfd->filename); + BFD_ASSERT (strlen (dir) != 0); + + /* Strip off filename part. */ + for (i = strlen (dir) - 1; i >= 0; i--) + if (IS_DIR_SEPARATOR (dir[i])) + break; + + dir[i + 1] = '\0'; + BFD_ASSERT (dir[i] == '/' || dir[0] == '\0') + + debugfile = xmalloc (strlen (debug_file_directory) + 1 + + strlen (dir) + + strlen (".debug/") + + strlen (basename) + + 1); + + /* First try in the same directory as the original file: */ + strcpy (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + /* Then try in a subdirectory called .debug. */ + strcpy (debugfile, dir); + strcat (debugfile, ".debug/"); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + /* Then try in the global debugfile directory. */ + strcpy (debugfile, debug_file_directory); + i = strlen (debug_file_directory) - 1; + if (i > 0 + && debug_file_directory[i] != '/' + && dir[0] != '/') + strcat (debugfile, "/"); + strcat (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + free (debugfile); + free (basename); + free (dir); + return NULL; +} + + +/* +FUNCTION + bfd_follow_gnu_debuglink + +SYNOPSIS + char * bfd_follow_gnu_debuglink(bfd *abfd, const char *dir); + +DESCRIPTION + + Takes a BFD and searches it for a .gnu_debuglink section. If this + section is found, examines the section for the name and checksum of + a '.debug' file containing auxiliary debugging + information. Searches filesystem for .debug file in some standard + locations, including the directory tree rooted at @var{dir}, and if + found returns the full filename. If @var{dir} is NULL, will search + default path configured into libbfd at build time. + +RETURNS + <> on any errors or failure to locate the .debug file, + otherwise a pointer to a heap-allocated string containing the + filename. The caller is responsible for freeing this string. +*/ + +char * +bfd_follow_gnu_debuglink (abfd, dir) + bfd *abfd; + const char * dir; +{ +#if 0 /* Disabled until DEBUGDIR can be defined by configure.in */ + if (dir == NULL) + dir = DEBUGDIR; +#endif + return find_separate_debug_file (abfd, dir); +} diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 54a0c25..24d4a48 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -80,6 +80,7 @@ cpu-i860.c cpu-i960.c cpu-ia64.c cpu-ip2k.c +cpu-iq2000.c cpu-m10200.c cpu-m10300.c cpu-m32r.c @@ -90,6 +91,7 @@ cpu-m88k.c cpu-mcore.c cpu-mips.c cpu-mmix.c +cpu-msp430.c cpu-ns32k.c cpu-openrisc.c cpu-or32.c @@ -143,6 +145,7 @@ elf32-i386.c elf32-i860.c elf32-i960.c elf32-ip2k.c +elf32-iq2000.c elf32-m32r.c elf32-m68hc11.c elf32-m68hc12.c @@ -150,6 +153,7 @@ elf32-m68k.c elf32-m88k.c elf32-mcore.c elf32-mips.c +elf32-msp430.c elf32-openrisc.c elf32-or32.c elf32-pj.c diff --git a/bfd/reloc.c b/bfd/reloc.c index 661ac4a..147b746 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -1872,6 +1872,56 @@ ENUM BFD_RELOC_SPARC_REV32 ENUMDOC SPARC little endian relocation +ENUM + BFD_RELOC_SPARC_TLS_GD_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_GD_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_GD_ADD +ENUMX + BFD_RELOC_SPARC_TLS_GD_CALL +ENUMX + BFD_RELOC_SPARC_TLS_LDM_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_LDM_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_LDM_ADD +ENUMX + BFD_RELOC_SPARC_TLS_LDM_CALL +ENUMX + BFD_RELOC_SPARC_TLS_LDO_HIX22 +ENUMX + BFD_RELOC_SPARC_TLS_LDO_LOX10 +ENUMX + BFD_RELOC_SPARC_TLS_LDO_ADD +ENUMX + BFD_RELOC_SPARC_TLS_IE_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_IE_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_IE_LD +ENUMX + BFD_RELOC_SPARC_TLS_IE_LDX +ENUMX + BFD_RELOC_SPARC_TLS_IE_ADD +ENUMX + BFD_RELOC_SPARC_TLS_LE_HIX22 +ENUMX + BFD_RELOC_SPARC_TLS_LE_LOX10 +ENUMX + BFD_RELOC_SPARC_TLS_DTPMOD32 +ENUMX + BFD_RELOC_SPARC_TLS_DTPMOD64 +ENUMX + BFD_RELOC_SPARC_TLS_DTPOFF32 +ENUMX + BFD_RELOC_SPARC_TLS_DTPOFF64 +ENUMX + BFD_RELOC_SPARC_TLS_TPOFF32 +ENUMX + BFD_RELOC_SPARC_TLS_TPOFF64 +ENUMDOC + SPARC TLS relocations ENUM BFD_RELOC_ALPHA_GPDISP_HI16 @@ -3169,6 +3219,85 @@ ENUM BFD_RELOC_390_GOTENT ENUMDOC 32 bit rel. offset to GOT entry. +ENUM + BFD_RELOC_390_GOTOFF64 +ENUMDOC + 64 bit offset to GOT. +ENUM + BFD_RELOC_390_GOTPLT12 +ENUMDOC + 12-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT16 +ENUMDOC + 16-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT32 +ENUMDOC + 32-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT64 +ENUMDOC + 64-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLTENT +ENUMDOC + 32-bit rel. offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_PLTOFF16 +ENUMDOC + 16-bit rel. offset from the GOT to a PLT entry. +ENUM + BFD_RELOC_390_PLTOFF32 +ENUMDOC + 32-bit rel. offset from the GOT to a PLT entry. +ENUM + BFD_RELOC_390_PLTOFF64 +ENUMDOC + 64-bit rel. offset from the GOT to a PLT entry. + +ENUM + BFD_RELOC_390_TLS_LOAD +ENUMX + BFD_RELOC_390_TLS_GDCALL +ENUMX + BFD_RELOC_390_TLS_LDCALL +ENUMX + BFD_RELOC_390_TLS_GD32 +ENUMX + BFD_RELOC_390_TLS_GD64 +ENUMX + BFD_RELOC_390_TLS_GOTIE12 +ENUMX + BFD_RELOC_390_TLS_GOTIE32 +ENUMX + BFD_RELOC_390_TLS_GOTIE64 +ENUMX + BFD_RELOC_390_TLS_LDM32 +ENUMX + BFD_RELOC_390_TLS_LDM64 +ENUMX + BFD_RELOC_390_TLS_IE32 +ENUMX + BFD_RELOC_390_TLS_IE64 +ENUMX + BFD_RELOC_390_TLS_IEENT +ENUMX + BFD_RELOC_390_TLS_LE32 +ENUMX + BFD_RELOC_390_TLS_LE64 +ENUMX + BFD_RELOC_390_TLS_LDO32 +ENUMX + BFD_RELOC_390_TLS_LDO64 +ENUMX + BFD_RELOC_390_TLS_DTPMOD +ENUMX + BFD_RELOC_390_TLS_DTPOFF +ENUMX + BFD_RELOC_390_TLS_TPOFF +ENUMDOC + s390 tls relocations. ENUM BFD_RELOC_IP2K_FR9 diff --git a/bfd/version.h b/bfd/version.h index 1da7b80..727b55b 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030109 +#define BFD_VERSION_DATE 20030203 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/config.if b/config.if index 3958928..c38b59c 100644 --- a/config.if +++ b/config.if @@ -2,9 +2,8 @@ # Don't call it directly. This shell script fragment is called to # determine: # -# 1. libstcxx_interface: the interface name for libstdc++. -# 2. cxx_interface: the interface name for c++. -# 3. libc_interface: the interface name for libc. +# 1. libstcxx_incdir: the interface name for libstdc++. +# 2. libc_interface: the interface name for libc. # # Get the top level src dir. @@ -21,25 +20,21 @@ else if_topsrcdir=${top_srcdir} fi -if [ "${enable_libstdcxx_v3}" = "yes" ] ; then - libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3 -else - libstdcxx_srcdir=${if_topsrcdir}/libstdc++ -fi - -if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then -# We check libstdc++ for libstdcxx_interface. -libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -libstdcxx_interface= -fi - -if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then -# We check gcc/cp for cxx_interface. -cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -cxx_interface= +# Set libstdcxx_incdir. +# This is the same as gcc/configure.in and libstdc++-v3/acinclude.m4. +if test -z "$gcc_version"; then + if test -z "${gcc_version_trigger}" \ + && test -f ${if_topsrcdir}/gcc/version.c; then + gcc_version_trigger=${if_topsrcdir}/gcc/version.c + fi + if test -f "${gcc_version_trigger}"; then + gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` + else + gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` + fi + gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` fi +libstdcxx_incdir=c++/${gcc_version} # The trickiest part is libc_interface. if [ -z "${libc_interface}" ] @@ -82,8 +77,8 @@ EOF exit 1 fi else - # Cross compiling. Assume glibc 2.2. - libc_interface=-libc6.2- + # Cross compiling. Assume glibc 2.1. + libc_interface=-libc6.1- fi ;; *) diff --git a/configure b/configure index f85cbce..a6fc0f0 100755 --- a/configure +++ b/configure @@ -740,7 +740,7 @@ if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi # Export original configure arguments for use by sub-configures. TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@" -export TOPLEVEL_CONFIGURE_ARGUMENTS + moveifchange=${srcdir}/move-if-change @@ -818,7 +818,7 @@ target_libs="target-libiberty \ target-newlib \ ${libstdcxx_version} \ target-libf2c \ - ${libgcj} + ${libgcj} \ target-libobjc" # these tools are built using the target libs, and are intended to run only @@ -1297,12 +1297,11 @@ case "${target}" in noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}" ;; mips*-*-irix6*) - # The GNU assembler does not support IRIX 6. # Linking libjava exceeds command-line length limits on at least # IRIX 6.2, but not on IRIX 6.5. # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham # - noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" @@ -2453,11 +2452,16 @@ serialization_dependencies=serdep.tmp # down to subconfigures. baseargs=`echo " ${ac_configure_args} " | \ sed -e 's/ --no[^ ]* / /' \ - -e 's/ --cache[a-z-]*=[^ ]* / /' \ - -e 's/ --sr[a-z-]*=[^ ]* / /' \ - -e 's/ --ho[a-z-]*=[^ ]* / /' \ - -e 's/ --bu[a-z-]*=[^ ]* / /' \ - -e 's/ --ta[a-z-]*=[^ ]* / /' \ + -e 's/ --c[a-z-]*[= ][^ ]* / /' \ + -e 's/ --sr[a-z-]*[= ][^ ]* / /' \ + -e 's/ --ho[a-z-]*[= ][^ ]* / /' \ + -e 's/ --bu[a-z-]*[= ][^ ]* / /' \ + -e 's/ --t[a-z-]*[= ][^ ]* / /' \ + -e 's/ -cache-file[= ][^ ]* / /' \ + -e 's/ -srcdir[= ][^ ]* / /' \ + -e 's/ -host[= ][^ ]* / /' \ + -e 's/ -build[= ][^ ]* / /' \ + -e 's/ -target[= ][^ ]* / /' \ -e 's/ [^ -][^ ]* / /' \ -e 's/^ *//;s/ *$//'` @@ -2733,7 +2737,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2737: checking for $ac_word" >&5 +echo "configure:2741: 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 @@ -2766,7 +2770,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2770: checking for $ac_word" >&5 +echo "configure:2774: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2805,7 +2809,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2809: checking for $ac_word" >&5 +echo "configure:2813: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2838,7 +2842,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2842: checking for $ac_word" >&5 +echo "configure:2846: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2877,7 +2881,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2881: checking for $ac_word" >&5 +echo "configure:2885: 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 @@ -2910,7 +2914,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2914: checking for $ac_word" >&5 +echo "configure:2918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2949,7 +2953,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2953: checking for $ac_word" >&5 +echo "configure:2957: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2982,7 +2986,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2986: checking for $ac_word" >&5 +echo "configure:2990: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3021,7 +3025,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3025: checking for $ac_word" >&5 +echo "configure:3029: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3054,7 +3058,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3058: checking for $ac_word" >&5 +echo "configure:3062: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3093,7 +3097,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3097: checking for $ac_word" >&5 +echo "configure:3101: 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 @@ -3126,7 +3130,7 @@ if test -z "$ac_cv_prog_RANLIB" ; 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:3130: checking for $ac_word" >&5 +echo "configure:3134: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3165,7 +3169,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3169: checking for $ac_word" >&5 +echo "configure:3173: 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 @@ -3198,7 +3202,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3202: checking for $ac_word" >&5 +echo "configure:3206: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3237,7 +3241,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3241: checking for $ac_word" >&5 +echo "configure:3245: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3270,7 +3274,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3274: checking for $ac_word" >&5 +echo "configure:3278: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3309,7 +3313,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3313: checking for $ac_word" >&5 +echo "configure:3317: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3342,7 +3346,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3346: checking for $ac_word" >&5 +echo "configure:3350: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3390,7 +3394,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3394: checking for $ac_word" >&5 +echo "configure:3398: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3423,7 +3427,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3427: checking for $ac_word" >&5 +echo "configure:3431: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3462,7 +3466,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3466: checking for $ac_word" >&5 +echo "configure:3470: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3495,7 +3499,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3499: checking for $ac_word" >&5 +echo "configure:3503: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3534,7 +3538,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3538: checking for $ac_word" >&5 +echo "configure:3542: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3567,7 +3571,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3571: checking for $ac_word" >&5 +echo "configure:3575: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3606,7 +3610,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3610: checking for $ac_word" >&5 +echo "configure:3614: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3639,7 +3643,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3643: checking for $ac_word" >&5 +echo "configure:3647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3678,7 +3682,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3682: checking for $ac_word" >&5 +echo "configure:3686: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3711,7 +3715,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3715: checking for $ac_word" >&5 +echo "configure:3719: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3750,7 +3754,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3754: checking for $ac_word" >&5 +echo "configure:3758: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3783,7 +3787,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; 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:3787: checking for $ac_word" >&5 +echo "configure:3791: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3822,7 +3826,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3826: checking for $ac_word" >&5 +echo "configure:3830: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3855,7 +3859,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3859: checking for $ac_word" >&5 +echo "configure:3863: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4099,6 +4103,7 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g +s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g /@maybe_dependencies@/r $maybe_dependencies s%@maybe_dependencies@%%g /@serialization_dependencies@/r $serialization_dependencies diff --git a/configure.in b/configure.in index 88150ed..4fd42ed 100644 --- a/configure.in +++ b/configure.in @@ -83,7 +83,7 @@ if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi # Export original configure arguments for use by sub-configures. TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@" -export TOPLEVEL_CONFIGURE_ARGUMENTS +AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) moveifchange=${srcdir}/move-if-change @@ -161,7 +161,7 @@ target_libs="target-libiberty \ target-newlib \ ${libstdcxx_version} \ target-libf2c \ - ${libgcj} + ${libgcj} \ target-libobjc" # these tools are built using the target libs, and are intended to run only @@ -640,12 +640,11 @@ case "${target}" in noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}" ;; mips*-*-irix6*) - # The GNU assembler does not support IRIX 6. # Linking libjava exceeds command-line length limits on at least # IRIX 6.2, but not on IRIX 6.5. # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham # - noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" @@ -1795,11 +1794,16 @@ AC_SUBST_FILE(serialization_dependencies) # down to subconfigures. baseargs=`echo " ${ac_configure_args} " | \ sed -e 's/ --no[[^ ]]* / /' \ - -e 's/ --cache[[a-z-]]*=[[^ ]]* / /' \ - -e 's/ --sr[[a-z-]]*=[[^ ]]* / /' \ - -e 's/ --ho[[a-z-]]*=[[^ ]]* / /' \ - -e 's/ --bu[[a-z-]]*=[[^ ]]* / /' \ - -e 's/ --ta[[a-z-]]*=[[^ ]]* / /' \ + -e 's/ --c[[a-z-]]*[[= ]][[^ ]]* / /' \ + -e 's/ --sr[[a-z-]]*[[= ]][[^ ]]* / /' \ + -e 's/ --ho[[a-z-]]*[[= ]][[^ ]]* / /' \ + -e 's/ --bu[[a-z-]]*[[= ]][[^ ]]* / /' \ + -e 's/ --t[[a-z-]]*[[= ]][[^ ]]* / /' \ + -e 's/ -cache-file[[= ]][[^ ]]* / /' \ + -e 's/ -srcdir[[= ]][[^ ]]* / /' \ + -e 's/ -host[[= ]][[^ ]]* / /' \ + -e 's/ -build[[= ]][[^ ]]* / /' \ + -e 's/ -target[[= ]][[^ ]]* / /' \ -e 's/ [[^ -][^ ]*] / /' \ -e 's/^ *//;s/ *$//'` diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 11ca878..ab8db86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,845 @@ +2003-02-02 Andrew Cagney + + * frame.c (frame_unwind_register): New function. + (frame_unwind_unsigned_register): Use. + (frame_unwind_signed_register): Use. + (frame_read_register): New function. + * frame.h (frame_unwind_register): Declare. + (frame_read_register): Declare. + + * d10v-tdep.c (d10v_frame_pop): Rewrite. Use regcache_cooked_write + and frame_unwind_register instead of read_memory, write_register + and deprecated_write_register_bytes. + +2003-02-02 Andrew Cagney + + * frame.h: Note that namelen can be negative. + * frame.c (frame_map_name_to_regnum): When LEN is negative, use + NAME's length. + + * NEWS: Mention that the d10v's `regs' command is deprecated. + * d10v-tdep.c (d10v_gdbarch_init): Set print_registers_info. + (d10v_print_registers_info): New function. + (show_regs): Call d10v_print_registers_info. + (_initialize_d10v_tdep): Mark "show regs" command as deprecated. + +2003-02-02 Mark Kettenis + + * stack.c (print_frame_info): Restore call to annotate_frame_begin + lost in the previous patch. + +2003-02-01 Andrew Cagney + + From 2002-11-09 Jason Molenda (jason-cl@molenda.com) + * stack.c (print_frame_info_base): Output complete FRAME tuple + for synthesized frames. + +2003-02-02 Andrew Cagney + + * mips-nat.c (zerobuf): Delete. + (fetch_inferior_registers): Alloc local zerobuf. + (fetch_core_registers): Alloc local zerobuf. + * d10v-tdep.c (show_regs): Don't allocate a dynamic array using + MAX_REGISTER_RAW_SIZE or MAX_REGISTER_VIRTUAL_SIZE. + * thread-db.c (thread_db_store_registers): Ditto. + * sh-tdep.c (sh_do_register): Ditto. + * rom68k-rom.c (rom68k_supply_one_register): Ditto. + * remote-sim.c (gdbsim_store_register): Ditto. + * remote-mips.c (mips_wait, mips_fetch_registers): Ditto. + * remote-e7000.c (fetch_regs_from_dump): Ditto. + * monitor.c (monitor_supply_register): Ditto. + * mipsv4-nat.c (supply_gregset, supply_fpregset): Ditto. + * mips-nat.c (fetch_inferior_registers): Ditto. + * m68klinux-nat.c (fetch_register): Ditto. + * lynx-nat.c (fetch_inferior_registers): Ditto. + (fetch_inferior_registers): Ditto. + * irix4-nat.c (supply_gregset, supply_fpregset): Ditto. + * hpux-thread.c (hpux_thread_fetch_registers): Ditto. + (hpux_thread_store_registers): Ditto. + * hppah-nat.c (fetch_register): Ditto. + * hppab-nat.c (fetch_register): Ditto. + * hppa-tdep.c (pa_register_look_aside): Ditto. + (pa_print_fp_reg, pa_strcat_fp_reg): Ditto. + * dve3900-rom.c (fetch_bitmapped_register): Ditto. + +2003-02-01 Andrew Cagney + + * gdbarch.sh: Explictly specify all method levels. When a + variable with an empty level, provide a non-multi-arch default. + (BELIEVE_PCC_PROMOTION_TYPE): Set level to empty. + * gdbarch.h: Re-generate. + * stabsread.c (BELIEVE_PCC_PROMOTION_TYPE): Delete. Always defined. + * config/m68k/tm-sun3.h (BELIEVE_PCC_PROMOTION_TYPE): Define as 1 + +2003-02-01 Andrew Cagney + + * defs.h (host_pointer_to_address): Delete declaration. + (address_to_host_pointer): Delete declaration. + * utils.c (host_pointer_to_address): Delete function. + (address_to_host_pointer): Delete function. + * procfs.c (procfs_address_to_host_pointer): New function. + * procfs.c (proc_set_watchpoint): Use. + (procfs_can_use_hw_breakpoint): Update comments. + * somsolib.c (hpux_address_to_host_pointer_hack): New function. + (som_solib_add): Use. + * hppa-tdep.c (hppa_pointer_to_address_hack): New function. + * hppa-tdep.c (unwind_command): Use. + +2003-02-01 Andrew Cagney + + * gdb_dirent.h: Mark up valid uses of , d_namelen and + strlen d_name. + + * main.c (captured_main): Delete #ifdef ADDITIONAL_OPTIONS, + ADDITIONAL_OPTION_CASES, and ADDITIONAL_OPTION_HANDLER code. + (print_gdb_help): Delete #ifdef ADDITIONAL_OPTION_HELP code. + * stabsread.c (DBX_PARM_SYMBOL_CLASS): Delete macro. + (define_symbol): Update. + * symfile.c (generic_load): Remove references to nindy. + * symtab.c: Remove references to nindy. + +2003-02-01 Andrew Cagney + + * infcmd.c (print_float_info): Delete code conditional on + FLOAT_INFO. + * config/nm-lynx.h: Delete #undef FLOAT_INFO. Update copyright. + * config/m68k/nm-apollo68b.h: Ditto. + * config/i386/tm-ptx.h (FLOAT_INFO): Delete. Update copyright. + * config/ns32k/nm-nbsd.h (FLOAT_INFO): Ditto. + * config/i386/tm-symmetry.h (FLOAT_INFO): Ditto. + +2003-02-01 Mark Kettenis + + * config/i386/tm-i386os9k.h: Removed. + + * configure.host (i[3456]86-*-isc*): Set gdb_host to i386v. + Remove i[3456]86-*-sysv3.2* and i[3456]86-*-sysv32* entries since + they're identical to i[3456]86-*-sysv* now. + * config/i386/i386v32.mh: Removed. + * config/i386/xm-i386v32.h: Removed. + * config/i386/xm-i386sco.h (U_FPSTATE): Remove macro. + + * config/i386/i386mk.mt, config/i386/i386mk.mh: Removed. + + * config/i386/i386dgux.mh: Removed. + * configure.host (i[3456]86-*-dgux): Set gdb_host to i386v4. + + * configure.in: Fix typo. + * configure: Regenerated. + +2003-01-31 David Carlton + + * dwarf2read.c (dwarf2_locate_sections): Set + dwarf_ranges_section. + +2003-01-31 Andrew Cagney + + * objc-exp.y, c-exp.y, f-exp.y: Remove PTR casts. + * utils.c: Update comments documenting legitimate uses of PTR. + + * utils.c: Re-indent. + + * config/djgpp/fnchange.lst: Delete nindy files. + * nindy-share/ttyflush.c, nindy-share/stop.h: Delete files. + * nindy-share/nindy.c, nindy-share/env.h: Delete files. + * nindy-share/coff.h, nindy-share/block_io.h: Delete files. + * nindy-share/b.out.h, nindy-share/VERSION: Delete files. + * nindy-share/README, nindy-share/Onindy.c: Delete files. + * nindy-tdep.c, nindy-share/Makefile: Delete files. + * Makefile.in (init.c): Remove nindy references. + (saber_gdb): Delete rule. + (ALLDEPFILES): Delete hp300ux-nat.c, nindy-tdep.c, + nindy-share/Onindy.c, nindy-share/nindy.c, nindy-share/ttyflush.c, + and a68v-nat.c. + (hp300ux-nat.o, a68v-nat.o, ptx4-nat.o): Delete rules. + (Onindy.o, nindy.o, ttyflush.o, nindy-tdep.o): Delete rules. + (HFILES_NO_SRCDIR): Delete nindy-share/b.out.h, + nindy-share/block_io.h, nindy-share/coff.h, nindy-share/env.h, and + nindy-share/stop.h. + * hp300ux-nat.c, a68v-nat.c, ptx4-nat.c: Delete files. + * saber.suppress: Delete file. + +2003-01-31 Daniel Jacobowitz + + * dbxread.c (stabs_data): New static variable. + (fill_symbuf): Support an in-memory buffer for stabs data. + (stabs_seek): New function. + (dbx_psymtab_to_symtab): Relocate the stabs data if necessary. + (read_ofile_symtab): Use stabs_seek. + (elfstab_build_psymtabs): Take an asection* instead of + an offset and size. Relocate the stabs data if necessary. + Save the section* for dbx_psymtab_to_symtab. + * dwarf2read.c: Add section variables for each debug section. + (dwarf2_locate_sections): Fill them in. + (dwarf2_read_section): Take an asection* argument. + Relocate the section contents if necessary. + (dwarf2_build_psymtabs, dwarf2_build_psymtabs_easy): Update callers. + * dwarf2cfi.c (parse_frame_info): Take a section argument and pass + it to dwarf2_read_section. + (dwarf2_build_frame_info): Update callers. + * elfread.c (elf_symfile_read): Update call to + elfstab_build_psymtabs. + * gdb-stabs.h (struct dbx_symfile_info): Add stab_section. + (DBX_STAB_SECTION): New macro. + * stabsread.h (elfstab_build_psymtabs): Update prototype. + * symfile.c (symfile_dummy_outputs): New function. + (symfile_relocate_debug_section): New function. + * symfile.h (symfile_relocate_debug_section): Add prototype. + +2003-01-31 Richard Henderson + + * alpha-nat.c (REGISTER_PTRACE_ADDR): Merge into ... + (register_addr): ... here. Support ALPHA_UNIQUE_REGNUM. + (fetch_elf_core_registers): Support ALPHA_UNIQUE_REGNUM. + * alpha-tdep.c (alpha_register_name): Add "unique". + * alpha-tdep.h (ALPHA_NUM_REGS): Increment. + (ALPHA_UNIQUE_REGNUM): New. + * config/alpha/nm-linux.h (ALPHA_UNIQUE_PTRACE_ADDR): New. + +2003-01-31 Andrew Cagney + + * README: Remove reference to Ericsson 1800 monitor. + * Makefile.in (remote-es.o): Delete rule. + (ALLDEPFILES): Delete remote-es.c. + * remote-es.c: Delete file. + * config/m68k/es1800.mt: Delete file. + * config/djgpp/fnchange.lst: Update. + * configure.tgt: Delete m68*-ericsson-* target. + +2003-01-31 Adam Fedor + + * infrun.c (handle_inferior_event): Rename 'tmp' to real_stop_pc. + Remove duplicate/shadowing variable of same name. + +2003-01-30 Jim Blandy + + * symfile.c (find_separate_debug_file): Assert that the objfile's + directory name we compute ends with a slash, and then assume that + that's so everywhere we use it. + +2003-01-30 Daniel Jacobowitz + + * valops.c (value_assign): Flush frame cache after stores to memory + also. + +2003-01-30 Andrew Cagney + + * Makefile.in (mon960-rom.o): Delete rule. + * mon960-rom.c: Delete file. + +2003-01-30 Andrew Cagney + + * d10v-tdep.c: Include "frame-unwind.h". + (d10v_gdbarch_init): Append d10v_frame_p to the unwind predicate + list. + (next_addr, uses_frame): Delete. + (struct d10v_unwind_cache): Define. + (prologue_find_regs): Add struct d10v_unwind_cache info parameter. + Use info instead of next_addr and uses_frame globals. + (d10v_frame_init_saved_regs): Delete function. + (d10v_init_extra_frame_info): Delete function. + (d10v_gdbarch_init): Do not initialize init_extra_frame_info, + frame_init_saved_regs or pop_frame, frame_chain, frame_chain_valid, + init_frame_pc or frame_saved_pc. + (d10v_pop_frame): Delete function. + (do_d10v_pop_frame): Delete function. + (d10v_frame_chain): Delete function. + (d10v_frame_chain_valid): Delete function. + (d10v_frame_pc_unwind): New function. + (d10v_frame_id_unwind): New function. + (saved_regs_unwinder): New function. + (d10v_frame_register_unwind): New function. + (d10v_frame_pop): New function. + (d10v_frame_unwind): New variable. + (d10v_frame_p): New function. + (d10v_frame_saved_pc): Delete function. + * Makefile.in (d10v-tdep.o): Update dependencies. + +2003-01-30 J. Brobecker + + * config/pa/tm-hppa64.h (CALL_DUMMY_LOCATION): Remove #undef + causing some regressions due to a change in the default value + for this macro. + +2003-01-29 Richard Henderson + Elena Zannoni + Daniel Jacobowitz + + Fix PR gdb/961. + * dwarf2read.c (dwarf_ranges_offset, dwarf_ranges_size): New + variables. + (RANGES_SECTION): New. + (dwarf_ranges_buffer): New variable. + (struct comp_unit_head): Add member "die". + (struct dwarf2_pinfo): Add dwarf_ranges_buffer, dwarf_ranges_size. + (DWARF_RANGES_BUFFER, DWARF_RANGES_SIZE): New. + (dwarf2_has_info): Init dwarf_ranges_offset and dwarf_ranges_size. + (dwarf2_locate_sections): Likewise. + (dwarf2_build_psymtabs): Read .debug_ranges. + (dwarf2_build_psymtabs_hard): Swap dwarf_ranges out. + (psymtab_to_symtab_1): Swap dwarf_ranges in. Set cu_header.die. + (dwarf2_get_pc_bounds): New cu_header argument; adjust all callers. + Look for DW_AT_ranges and return the bounding box. + +2003-01-29 Brian Ford + + * win32-nat.c (cygwin_pid): Removed as unused. + (child_attach): Try fall back to Cygwin pid. + +2003-01-29 Jim Blandy + + * objfiles.h (struct objfile): Doc fix. + +2003-01-29 Andrew Cagney + + * frame.c (frame_saved_regs_id_unwind): Assert FRAME_CHAIN_P. + (legacy_get_prev_frame): Assert FRAME_CHAIN_P. + (get_prev_frame): When FRAME_CHAIN_P, call legacy_get_prev_frame. + (frame_saved_regs_pc_unwind): Assert FRAME_SAVED_PC_P. + * gdbarch.sh (FRAME_CHAIN): Change to a function with predicate. + (FRAME_SAVED_PC): Change to a function with predicate. + * gdbarch.h, gdbarch.c: Re-generate. + +2003-01-28 Andrew Cagney + + * hppah-nat.c (child_pid_to_exec_file): Don't use boolean. + + * complaints.c (complain): Delete function. + * complaints.h (struct deprecated_complaint): Delete definition. + (complain): Delete declaration. + +2003-01-28 Kevin Buettner + + * mips-tdep.c (mips_init_extra_frame_info): Return early for + dummy frames. + +2003-01-27 Andrew Cagney + + * sentinel-frame.h, sentinel-frame.c: New files. + * Makefile.in (frame.o): Update dependencies. + (SFILES): Add sentinel-frame.c. + (sentinel_frame_h): Define. + (COMMON_OBS): Add sentinel-frame.o. + (sentinel-frame.o): Specify dependencies. + * frame.c: Include "sentinel-frame.h". + (frame_register_unwind): Rewrite assuming that there is always a a + ->next frame. + (frame_register, generic_unwind_get_saved_register): Ditto. + (frame_read_unsigned_register, frame_read_signed_register): Ditto. + (create_sentinel_frame, unwind_to_current_frame): New functions. + (get_current_frame): Rewrite using create_sentinel_frame and + unwind_to_current_frame. When possible, always create a frame. + (create_new_frame): Set next to the sentinel frame. + (get_next_frame): Rewrite. Don't go below the level 0 frame. + (deprecated_update_frame_pc_hack): Update the next frame's PC and + ID cache when necessary. + (frame_saved_regs_id_unwind): Use frame_relative_level. + (deprecated_generic_get_saved_register): Use frame_relative_level, + get_frame_saved_regs, get_frame_pc, get_frame_base and + get_next_frame. + (frame_saved_regs_register_unwind): Use get_frame_saved_regs and + frame_register. + +2003-01-27 Daniel Jacobowitz + + * gdb_indent.sh: Add -T bfd and -T asection to the indent arguments. + +2003-01-27 Daniel Jacobowitz + + * maint.c [! (HAVE_MONSTARTUP && HAVE__MCLEANUP)] + (maintenance_set_profile_cmd): Use error () instead of warning (). + +2003-01-27 Daniel Jacobowitz + + * configure.in: Check that -pg works if using --enable-profiling. + Check for monstartup and _mcleanup regardless of --enable-profiling. + * maint.c: Check for monstartup and _mcleanup before using them. + * config.in: Regenerated. + * configure: Regenerated. + +2003-01-23 Jim Blandy + + * symfile.c (syms_from_objfile): Don't print the "(no debugging + symbols found)" message here; we haven't checked for a separate + debug info file yet, so we don't know yet. + (symbol_file_add_with_addrs_or_offsets): Print it here, after + we've looked everywhere. Also, there's no need to print a special + message when we're loading the separate debug info file: the one + symbol_file_add prints is fine. + +2003-01-23 Alexander Larsson + Jim Blandy + + Add support for executables whose debug info has been separated + out into a separate file, leaving only a link behind. + * objfiles.h (struct objfile): New fields: separate_debug_objfile + and separate_debug_objfile_backlink. + (put_objfile_before): New declaration. + * symfile.c: #include "filenames.h". + (symbol_file_add_with_addrs_or_offsets): If this objfile has its + debug info in a separate file, read that, too. Save the addrs + argument, so we can use it again to read the separated debug info; + syms_from_objfile modifies the table we pass it. + (reread_symbols): After re-reading an objfile, call + reread_separate_symbols to refresh its separate debug info + objfile, if it has one. + (reread_separate_symbols, find_separate_debug_file, + get_debug_link_info, separate_debug_file_exists): New functions. + (debug_file_directory): New global var. + (_initialize_symfile): Initialize debug_file_directory, and + provide the new `set debug-file-directory' command to let the user + change it. + * objfiles.c (free_objfile): If this objfile has its debug info in + a separate objfile, free that one too. If this is itself a + separate debug info objfile, clear our parent's backlink. + (put_objfile_before): New function. + * utils.c (gnu_debuglink_crc32): New function. + * defs.h (gnu_debuglink_crc32): New declaration. + * Makefile.in (symfile.o): Note dependency on "filenames.h". + * configure.in: Handle --with-separate-debug-dir config option. + * acinclude.m4 (AC_DEFINE_DIR): New macro. + * acconfig.h (DEBUGDIR): New macro. + * configure, aclocal.m4, config.in: Regenerated. + +2003-01-22 Jim Blandy + + * symfile.c (symbol_file_add_with_addrs_or_offsets): New function, + like the old symbol_file_add, but taking new arguments: you can + now pass in either a `struct section_addr_info' list to say where + each section is loaded, or a `struct section_offsets' table. Pass + these new arguments through to syms_from_objfile as appropriate. + (symbol_file_add): Just call symbol_file_add_with_addrs_or_offsets, + with the appropriate quiescent values for the new arguments. + + * symfile.c: #include "gdb_assert.h". + (syms_from_objfile): Add the ability to pass in a section offset + table directly, as an alternative to the section_addr_info table. + Document arguments better. + (symbol_file_add): Pass extra arguments to syms_from_objfile. + * symfile.h (syms_from_objfile): Update declaration. + * rs6000-nat.c (objfile_symbol_add): Pass new arguments to + syms_from_objfile. + * Makefile.in (symfile.o): List dependency on $(gdb_assert_h). + +2003-01-22 Daniel Jacobowitz + + Original patch by Tom Tromey and + Jason Molenda . + * Makefile.in (PROFILE_CFLAGS): Substitute from configure. + (INTERNAL_LDFLAGS): Don't include PROFILE_CFLAGS. + * NEWS: Mention profiling. + * configure.in (--enable-gdbtk): Fix typo. + (--enable-profiling): New. Set PROFILE_CFLAGS. + * maint.c (maintenance_set_profile_cmd): Remove NOTYET. + Fill in function. + (profiling_state): New variable. + (mcleanup_wrapper): New function. + (_initialize_maint): Remove NOTYET, fix call to + add_setshow_boolean_cmd for "maint set profile". + * configure: Regenerated. + +2003-01-21 Martin M. Hunt + + * Makefile.in (install-gdbtk): Install PNG images too. + +2003-01-21 Andrew Cagney + + * exec.c (text_start): Delete global variable. + (exec_file_attach): Make text_start local to the function. + * inferior.h (BEFORE_TEXT_END, AFTER_TEXT_END): Delete macros. + * valops.c (hand_function_call): Delete code that handles + BEFORE_TEXT_END and AFTER_TEXT_END. + * gdbarch.sh (CALL_DUMMY_LENGTH): Test call_dummy_length instead + of CALL_DUMMY_LOCATION. + * gdbarch.c: Regenerate. + * inferior.h (deprecated_pc_in_call_dummy_before_text_end) + (deprecated_pc_in_call_dummy_after_text_end): Delete declaration. + * blockframe.c (deprecated_pc_in_call_dummy_before_text_end) + (deprecated_pc_in_call_dummy_after_text_end): Delete functions. + (text_end): Delete extern declaration. + +2003-01-21 Andrew Cagney + + * frame.h (FRAME_OBSTACK_ZALLOC): Define. + * blockframe.c (backtrace_below_main): Move to "frame.c". + (frame_chain_valid): Delete check for backtrace_below_main. + (_initialize_blockframe): Delete initialization, move ``set + backtrace-below-main'' command to "frame.c". + (do_flush_frames_sfunc): Delete function. + * frame.c: Include "command.h" and "gdbcmd.h". + (frame_type_from_pc): New function. + (create_new_frame): Use frame_type_from_pc. + (legacy_get_prev_frame): New function. + (get_prev_frame): Rewrite. When an old style frame, call + legacy_get_prev_frame. Otherwize, unwind the PC first. + (_initialize_frame): Add ``set backtrace-below-main'' command. + * Makefile.in (frame.o): Update dependencies. + +2003-01-19 Andrew Cagney + + * config/pa/tm-hppa.h (DEPRECATED_DO_REGISTERS_INFO): Rename + DEPRECATED_REGISTERS_INFO. + +2003-01-19 Andrew Cagney + + * MAINTAINERS: Replace `Blanket Write Privs' with `Global + Maintainers'. Update `Various Maintainers'. + +2003-01-19 Andrew Cagney + + * frame.c (frame_saved_regs_pop): Assert POP_FRAME_P. + * gdbarch.sh (POP_FRAME): Change to function with predicate. + Suppress actual parameters when `-'. + * gdbarch.h, gdbarch.c: Regenerate. + +2003-01-19 Andrew Cagney + + * d10v-tdep.c (d10v_frame_saved_pc, d10v_frame_chain): Restore + code handling dummy frames. + +2003-01-19 Andrew Cagney + + * frame-unwind.h (frame_unwind_pop_ftype): Declare. + (struct frame_unwind): Add field pop. + * frame.h (frame_pop): Declare. + * frame.c (frame_saved_regs_pop): New function. + (trad_frame_unwinder): Add frame_saved_regs_pop. + (frame_pop): New function. + * dummy-frame.c (dummy_frame_pop): New function. + (discard_innermost_dummy): New function. + (generic_pop_dummy_frame): Use discard_innermost_dummy. + (dummy_frame_unwind): Add dummy_frame_pop. + * infrun.c (normal_stop): Call frame_pop instead of POP_FRAME. + * valops.c (hand_function_call): Ditto. + * stack.c (return_command): Ditto. + +2003-01-18 Andrew Cagney + + * cris-tdep.c: Fix function declaration indentation. + * dwarfread.c, gdbcore.h, gdbtypes.h, i386v-nat.c: Ditto. + * mips-tdep.c, monitor.h, parse.c, proc-utils.h: Ditto. + * rs6000-nat.c, ser-go32.c, somread.c, stabsread.c: Ditto. + * symfile.h, symtab.h, target.c, target.h, value.h: Ditto. + * xcoffread.c, config/pa/tm-hppa.h: Ditto. + * config/sparc/tm-sp64.h, config/sparc/tm-sparc.h: Ditto. + +2003-01-18 Michael Chastain + + * README (Unpacking and Installation -- quick overview): + Warn against ".../gdb-5.3/gdb/configure". + +2003-01-18 Andrew Cagney + + * dummy-frame.h (dummy_frame_id_unwind): Delete declaration. + (dummy_frame_pc_unwind, dummy_frame_register_unwind): Ditto. + (struct frame_unwind): Declare opaque. + (dummy_frame_p): Declare function. + * dummy-frame.c (dummy_frame_id_unwind): Make static. + (dummy_frame_pc_unwind, dummy_frame_register_unwind): Ditto. + * dummy-frame.c: Include "frame-unwind.h". + (dummy_frame_p): New function. + (dummy_frame_unwind): New variable. + * frame.c: Include "frame-unwind.h". + (frame_pc_unwind, frame_id_unwind, frame_register_unwind): Update + to use the new unwind field. + (set_unwind_by_pc): Delete function. + (create_new_frame, get_prev_frame): Set unwind field using + frame_unwind_find_by_pc. + (trad_frame_unwind, trad_frame_unwinder): New variables. + * frame.h (trad_frame_unwind): Declare variable. + (frame_id_unwind_ftype): Delete declaration. + (frame_pc_unwind_ftype, frame_register_unwind_ftype): Ditto. + (struct frame_unwind): Declare opaque. + (struct frame_info): Replace the fields id_unwind, pc_unwind and + register_unwind with a single unwind pointer. + * frame-unwind.h, frame-unwind.c: New files. + * Makefile.in (SFILES): Add frame-unwind.c. + (frame_unwind_h): Define. + (COMMON_OBS): Add frame-unwind.o. + (frame-unwind.o): Specify dependencies. + (frame.o, dummy-frame.o): Update dependencies. + +2003-01-18 Andrew Cagney + + * ada-valprint.c: Eliminate PTR. + * breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto. + * defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto. + * exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto. + * objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto. + * remote-mips.c, remote-sds.c, remote-vx.c: Ditto. + * solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto. + * symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto. + +2003-01-17 Andrew Cagney + + * main.c (captured_main): Don't use PTR. + * cp-valprint.c (cp_print_class_method): Replace STREQ with strcmp. + * gdbtypes.c (lookup_primitive_typename): Ditto. + (lookup_struct_elt_type): Ditto. + * f-valprint.c (info_common_command): Ditto. + (list_all_visible_commons): Ditto. + * jv-typeprint.c (java_type_print_base): Ditto. + + * config/djgpp/fnchange.lst: Rename mi1-var-block.exp, + mi1-var-child.exp, mi1-var-cmd.exp and mi1-var-display.exp. + Rename opcodes/iq2000-desc.c and opcodes/iq2000-dis.c. Rename + i386-interix-nat.c and i386-interix-tdep.c. Rename + m68klinux-nat.c and m68klinux-tdep.c. Rename + config/mips/tm-linux.h and config/mips/tm-linux64.h. Rename + bfd/po/.cvsignore and opcodes/po/.cvsignore. Rename + gdb/objc-exp.tab.c and gdb/ada-exp.tab.c + * main.c (captured_main): Use xfree, not free. + +2003-01-16 Andrew Cagney + + * frame.h (frame_id_unwind_ftype): Change type so that the frame's + ID back using a parameter. + * frame.c (frame_id_unwind): Update call. + (frame_saved_regs_id_unwind): Update. + * dummy-frame.c (dummy_frame_id_unwind): Update function. + * dummy-frame.h (struct frame_id): Add opaque declaration. + (dummy_frame_id_unwind): Update declaration. + +2003-01-15 Andrew Cagney + + * sparc-tdep.c: Delete reference to PRINT_REGISTER_HOOK. + +2003-01-15 Stephen P. Smith + + * MAINTAINERS (Stephen P. Smith): Updated email address. + +2003-01-14 Elena Zannoni + + * breakpoint.c (until_break_command): Add new argument. Use it to + decide whether to stop only at the current frame or not. + * breakpoint.h (until_break_command): Update prototype. + * infcmd.c (until_command): Add new argument to until_break_command + call. + (advance_command): New function. + (_initialize_infcmd): Update help string for 'until' command. + Add new 'advance' command. + +2003-01-14 David Carlton + + * linespec.c (decode_line_1): Normalize comments. + (set_flags): Ditto. + (locate_first_half): Ditto. + (decode_compound): Ditto. + (symtab_from_filename): Ditto. + (decode_all_digits): Ditto. + (decode_dollar): Ditto. + (find_methods): Ditto. + (find_toplevel_char): Ditto. + +2003-01-13 Andrew Cagney + + * ax-gdb.c, c-valprint.c, charset.c, corefile.c: Update copyright. + * demangle.c, disasm.c, dwarf2cfi.c, dwarfread.c: Update copyright. + * elfread.c, eval.c, expprint.c, expression.h: Update copyright. + * f-typeprint.c, findvar.c, gcore.c, gdb_mbuild.sh: Update copyright. + * gdbtypes.h, gnu-v2-abi.c, inferior.h, inftarg.c: Update copyright. + * language.c, language.h, m32r-tdep.c: Update copyright. + * mn10200-tdep.c, scm-lang.c, scm-lang.h: Update copyright. + * somsolib.c, somsolib.h, symfile.c, symtab.h: Update copyright. + * thread-db.c, typeprint.c, utils.c, valarith.c: Update copyright. + * values.c, win32-nat.c, x86-64-linux-nat.c: Update copyright. + * x86-64-linux-tdep.c, z8k-tdep.c: Update copyright. + * cli/cli-decode.h, config/h8500/tm-h8500.h: Update copyright. + +2003-01-13 Elena Zannoni + + * stabsread.h (process_later, resolve_cfront_continuation): + Obsolete. + Update copyright years. + * buildsym.c (start_subfile): Obsolete comment pertinent to Cfront. + Update copyright year. + * dbxread.c(struct cont_elem): Obsolete. + (process_later, process_now): Obsolete functions. + (read_dbx_symtab, read_ofile_symtab): Obsolete cfront support. + Update copyright year. + * gdbtypes.c (INIT_EXTRA, ADD_EXTRA): Obsolete macros. + (add_name, add_mangled_type, cfront_mangle_name): Obsolete functions. + * mdebugread.c (parse_type): Obsolete comment pertinent to Cfront. + (parse_partial_symbols): Obsolete cfront support. + * stabsread.c + (CFRONT_VISIBILITY_PRIVATE,CFRONT_VISIBILITY_PUBLIC): Obsolete + macros. + (get_substring, get_cfront_method_physname, msg_unknown_complaint, + read_cfront_baseclasses, read_cfront_member_functions, + resolve_cfront_continuation,read_cfront_static_fields, + copy_cfront_struct_fields): Obsolete functions. + (define_symbol, read_one_struct_field): Obsolete cfront support. + * xcoffread.c (scan_xcoff_symtab): Obsolete CFront support. + Update Copyright year. + +2003-01-13 Elena Zannoni + + * stack.c (print_frame_info, print_stack_frame_base_stub, + print_stack_frame_base, show_and_print_stack_frame_stub, + show_and_print_stack_frame, print_only_stack_frame_stub, + print_only_stack_frame): Delete functions. + (print_stack_frame_stub): Call print_frame_info instead of + print_frame_info_base. + (print_frame_info_base): Rename to print_frame_info. + (backtrace_command_1): Call print_frame_info, instead of + print_frame_info_base. + (current_frame_command): Call print_stack_frame, instead of + print_only_stack_frame. + (frame_command): Call print_stack_frame, instead of + show_and_print_stack_frame. + (up_command): Ditto. + (down_command): Ditto. + * frame.h (print_only_stack_frame): Delete prototype. + * infrun.c (normal_stop): Call print_stack_frame, instead of + show_and_print_stack_frame. + * thread.c (info_threads_command): Call print_stack_frame, instead + of print_only_stack_frame. + +2003-01-13 Andrew Cagney + + * README (Graphical interface to GDB): Update URL. Point at + gdb/links/. + + * gdb_indent.sh: Update to version 2.2.9. Warn when not exact + version match. + +2003-01-13 Daniel Jacobowitz + + * symtab.c (find_pc_sect_line): Don't consider end-of-function + lines. + +2003-01-13 Daniel Jacobowitz + + * thread-db.c (attach_thread): Prototype. + (struct private_thread_info): Remove lwpid. Add thread handle (th), + thread information (ti), and valid flags (th_valid, ti_valid). + (attach_thread): Move target_pid_to_str call to after the thread + is added to GDB's list. Initialize the cache. + (thread_get_info_callback, thread_db_map_id2thr) + (thread_db_get_info): New functions. + (thread_from_lwp, lwp_from_thread, thread_db_fetch_registers) + (thread_db_store_registers, thread_db_thread_alive) + (thread_db_get_thread_local_address): Use them. + (thread_db_pid_to_str): Likewise. Return "Missing" instead + of calling error() for threads in unknown state. + + (clear_lwpid_callback): New function. + (thread_db_resume): Use it to clear the cache. + +2003-01-13 Daniel Jacobowitz + + * lin-lwp.c (struct private_thread_info, find_lwp_callback): Remove. + (resume_callback): Remove dead code. + +2003-01-13 Andrew Cagney + + * gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with + predicate. + * gdbarch.h, gdbarch.c: Regenerate. + * stack.c (frame_info): Only initialize the saved registers when + FRAME_INIT_SAVED_REGS_P. + * frame.c (frame_saved_regs_register_unwind): Assert + FRAME_INIT_SAVED_REGS_P. + (deprecated_generic_get_saved_register): Ditto. + +2003-01-13 Daniel Jacobowitz + + * source.c (openp): Squelch warning about "filename". + +2003-01-13 Daniel Jacobowitz + + * source.c (openp): If the file does not exist don't necessarily + search the path. + +2003-01-13 Daniel Jacobowitz + + Fix PR gdb/872. + * gdbtypes.c (init_type): Mark "char" as TYPE_FLAG_NOSIGN. + (integer_types_same_name_p): New function. + (rank_one_type): Use it. + * stabsread.c (read_range_type): Mark "char" as TYPE_FLAG_NOSIGN. + +2003-01-13 Daniel Jacobowitz + + * Makefile.in (TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_DEFINE): New + variables. + (main.o): Custom rule which uses $(TARGET_SYSTEM_ROOT_DEFINE). + * configure.in: Add --with-sysroot. + * configure: Regenerated. + * main.c (gdb_sysroot): New variable. + (captured_main): Initialize gdb_sysroot. + * defs.h (gdb_sysroot): New extern declaration. + * solib.c (_initialize_solib): Initialize solib_absolute_prefix. + +2003-01-12 Michael Chastain + + * config/djgpp/fnchange.lst: add gdb/ChangeLog-2002. + +2003-01-12 Michael Chastain + + * top.c (print_gdb_version): Bump copyright year to 2003. + +2003-01-12 David Carlton + + * linespec.c (symtab_from_filename): Rename variable 's' to + 'file_symtab'. + +2003-01-12 Andrew Cagney + + * d10v-tdep.c (d10v_init_extra_frame_info): Remove checks for a + dummy frame. + (d10v_frame_saved_pc, d10v_frame_chain): Ditto. + +2003-01-12 Andrew Cagney + + * d10v-tdep.c: Include "gdb_assert.h". + (d10v_store_return_value): Rewrite to match current interface. + (d10v_extract_struct_value_address): Ditto. + (d10v_extract_return_value): Ditto. + (d10v_gdbarch_init): Set store_restore_value, + extract_struct_value_address and extract_return_value. + +2003-01-12 J. Brobecker + + * hpread.c (set_namestring): New procedure replacing the + SET_NAMESTRING macro. + (hpread_build_psymtabs): Replace calls to SET_NAMESTRING + by calls to set_namestring. + +2003-01-11 J. Brobecker + + * hpread.c (SET_NAMESTRING): Remove an incorrect cast to fix + a compilation warning. + (hpread_process_one_debug_symbol): Likewise. + +2003-01-10 David Carlton + + * linespec.c (decode_line_1): Rename variable 's' to + 'file_symtab'. + (decode_all_digits): Rename argument 's' to 'file_symtab'. + (decode_dollar): Ditto. + (decode_variable): Ditto. + (symbol_found): Ditto. + +2003-01-09 Michael Chastain + + * config/djgpp/fnchange.lst: update file list for testsuite/gdb.c++. + +2003-01-07 Corinna Vinschen + + * win32-nat.c (set_process_privilege): New function. + (child_attach): Call set_process_privilege() to enable the + SE_DEBUG_NAME user privilege if available in process token. + +2003-01-10 J. Brobecker + + * hpread.c (hpread_process_one_debug_symbol): Fix a small + compilation error in the previous revision. + +2003-01-09 David Carlton + + * linespec.c: Update copyright. + 2003-01-09 Daniel Jacobowitz * lin-lwp.c (child_wait): Ignore exit statuses for processes other @@ -710,15043 +1552,7 @@ AC_SEARCH_LIBS to see whether we need libsocket. * configure: Regenerated. -2002-12-31 Mark Kettenis - - * configure.in: Remove bzero and bcopy from call to AC_CHECK_FUNCS. - * config.in, configure: Regenerated. - -2002-12-31 Mark Kettenis - - * gdb_dirent.h: Cleanup and update code to match the example in - the Autoconf manual. - * configure.in: Call AC_HEADER_DIRENT. Remove dirent.h, - sys/ndir.h, sys/dir.h and ndir.h from call to AC_CHECK_HEADERS. - * configure: Regenerated. - -2002-12-30 Adam Fedor - - * objc-exp.y (parse_number): Cast sscanf arguments to proper type. - (yylex): Initialize c to avoid uninitialized warning. - -2002-12-29 Kazu Hirata - - * doc/fdl.texi: Revert the last change. - -2002-12-29 Mark Kettenis - - * tracepoint.c (ISATTY): Removed. - -2002-12-26 J. Brobecker - - Continuing work to convert the hppa targets to multiarch partil. - - * hppa-tdep.c: Add some missing forward declarations. - (frameless_function_invocation): Prefix the function name - by "hppa_" to avoid polluting the namespace. Update all calls - to use the new function name. - (saved_pc_after_call): Ditto. - (init_extra_frame_info): Ditto. - (frame_chain): Ditto. - (push_dummy_frame): Ditto. - (target_read_pc): Ditto. - (target_write_pc): Ditto. - (in_solib_call_trampoline): Ditto. - (in_solib_return_trampoline): Ditto. - (skip_trampoline_code): Ditto. - (hppa_read_fp): New function, renamed from target_read_fp. - (hppa_target_read_fp): New function, using hppa_read_fp. - This function conforms to the function profile for the - READ_FP gdbarch method. - (hppa_extract_struct_value_address): New function, extracted - from the definition of the DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS - macro. - (hppa_frame_num_args): New function. - (hppa_gdbarch_init): Setup the gdbarch vector for the hppa target. - - * config/pa/tm-hppa.h: Wrap around all gdbarch-eligible macros - inside "#if !GDB_MULTI_ARCH ... #endif" conditional, in preparation - for the switch to multiarch partial. - Update some of the macros definitions to match some changes - described above in the name of the function they are calling. - (PUSH_DUMMY_FRAME): Add a FIXME explaining why this macro will - not be straightforward to convert. Do now wrap it inside - "#if !... #endif" to remember that this macro has still not - been taken care of. - (FIX_CALL_DUMMY): Likewise. - -2002-12-26 J. Brobecker - - Continuing work to convert the hppa targets to multiarch partial. - - * hppa-tdep.c (hppa_register_raw_size): New function replacing - the body of macro REGISTER_RAW_SIZE. - * hppa-hpux-tdep.c: Add new functions replacing macro bodies from - config/pa/tm-hppah.h. These functions will be used to initialize - the gdbarch structure. - (hppa_hpux_pc_in_sigtramp): New function. - (hppa_hpux_frame_saved_pc_in_sigtramp): New function. - (hppa_hpux_frame_base_before_sigtramp): New function. - (hppa_hpux_frame_find_saved_regs_in_sigtramp): New function. - Add gdbcore.h #include. - * config/pa/tm-hppa.h (REGISTER_RAW_SIZE): Change the definition - of this gdbarch-eligible macro to a call to the new associated - function. - * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Likewise. - (FRAME_SAVED_PC_IN_SIGTRAMP): Change the definition of this macro - into a call to the new associated function. - (FRAME_BASE_BEFORE_SIGTRAMP): Likewise. - (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP): Likewise. - * Makefile.in (hppa-hpux-tdep.o): Add dependency on gdbcore.h. - -2002-12-24 David Carlton - - * config/sparc/tm-sparc.h: Delete duplicate definition of - DEPRECATED_PC_IN_CALL_DUMMY. - -2002-12-24 Kevin Buettner - - * Makefile.in (mips-linux-tdep.o): Add $(mips_tdep_h) and - $(gdb_assert_h). - * configure.tgt: Recognize mips64*-*-linux*. - * mips-linux-tdep.c (mips-tdep.h, gdb_assert.h): Include. - (supply_32_bit_reg): New function. - (supply_gregset): Call supply_32bit_reg() instead of supply_register(). - (fill_gregset): Use regcache_collect() instead of - deprecated_registers[]. - (register_addr): Change name to mips_linux_register_addr(). - (MIPS64_ELF_NGREG, MIPS64_ELF_NFPREG, MIPS64_FPR_BASE, MIPS64_PC) - (MIPS64_CAUSE, MIPS64_BADVADDR, MIPS64_MMHI, MIPS64_MMLO) - (MIPS64_FPC_CSR, MIPS64_FPC_EIR, MIPS64_EF_REG0, MIPS64_EF_REG31) - (MIPS64_EF_LO, MIPS64_EF_HI, MIPS64_EF_CP0_EPC, MIPS64_EF_CP0_BADVADDR) - (MIPS64_EF_CP0_STATUS, MIPS64_EF_CP0_CAUSE, MIPS64_EF_SIZE) - (MIPS64_LINUX_JB_PC): New defines. - (mips64_elf_greg_t, mips64_elf_gregset_t, mips64_elf_fpreg_t) - (mips64_elf_fpregset_t): New typedefs. - (mips64_linux_get_longhmp_target, mips64_supply_gregset) - (mips64_fill_gregset, mips64_supply_fpregset, mips64_fill_fpregset) - (mips64_linux_register_addr, set_mips_linux_register_addr) - (register_addr, mips64_linux_svr4_fetch_link_map_offsets): - (init_register_addr_data) - New functions. - (fetch_core_registers): Add support for core file formats with 64-bit - registers. - (mips_linux_init_abi): Distinguish o32, n32, and n64 ABIs. - (register_addr_data): New static global variable. - (_initialize_mips_linux_tdep): Initialize register_addr_data. Invoke - gdbarch_register_osabi() for each MIPS machine. - * config/mips/linux64.mt: New file. - * config/mips/tm-linux64.h: New file. - -2002-12-23 Adam Fedor - - * maint.c (maintenance_demangle): Add switch to demangle - ObjC language symbols as well. - -2002-12-23 Adam Fedor - - * objc-lang.c (lookup_objc_class, lookup_child_selector): Remove - last argument from complaint function call. - -2002-12-23 Kevin Buettner - - * exec.c (print_section_info): Add FIXME comments regarding format - string choices. - -2002-12-23 Daniel Jacobowitz - - * config/pa/nm-hppab.h: Delete duplicate CANNOT_STORE_REGISTER decl. - * config/pa/nm-hppao.h: Delete duplicate CANNOT_STORE_REGISTER decl. - -2002-12-23 Rodney Brown - - * config/pa/nm-hppah.h: Delete duplicate CANNOT_STORE_REGISTER decl. - -2002-12-23 David Carlton - - * symtab.c (lookup_symbol_aux): Delete 'force_return' variable. - (lookup_symbol_aux_minsyms): Delete 'force_return' argument. - (search_symbols): Call lookup_symbol_aux_minsyms to find debugging - information associated to a minsym, not lookup_symbol. - -2002-12-21 Mark Kettenis - - * x86-64-tdep.h (x86_64_init_abi): New prototype. - * x86-64-tdep.c (i386_fp_regnum_p): Remove function. - (x86_64_init_abi): Make non-static. Set number of pseudo - registers to 0. - (x86_64_gdbarch_init): Remove function. - (_initialize_x86_64_tdep): Renove register_gdbarch_init call. - Remove code dealing with dissambly. - * x86-64-linux-tdep.c (x86_64_linux_init_abi): New function. - (_initialize_x86_64_linux_tdep): New function. - * config/i386/x86-64linux.mt (TDEPFILES): Add i386-tdep.o and - i386-tdep.o. - -2002-12-14 Mark Kettenis - - * osabi.c: Include "gdb_assert.h" and "gdb_string.h". - (struct gdb_osabi_handler): Remove member `arch'. Add member - `arch_info'. - (gdbarch_register_osabi): Add new argument `machine'. Use ot to - construct a `struct bfd_arch_info' and store it in the `struct - gdb_osabi_handler' that is created. - (gdbarch_init_osabi): Check for compatibility based on machine - type and architecture. - * osabi.h (gdbarch_register_osabi): Adjust prototype and update - comment. - * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as - second argument in call to gdbarch_register_osabi. - * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. - * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. - * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. - * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. - * arm-tdep.c (_initialize_arm_tdep): Likewise. - * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. - * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. - * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. - * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. - * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. - * i386-tdep.c (_initialize_i386_tdep): Likewise. - * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. - * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. - * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from - _initialize_i386bsd_tdep and updated likewise. - * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. - * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. - * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. - * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. - * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. - * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. - * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. - * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. - * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. - * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise. - -2002-12-20 Kevin Buettner - - * solib-svr4.c (elf_locate_base): Fix sizeof() related bug. Add - DT_MIPS_RLD_MAP case for 64-bit targets. - -2002-12-20 Kevin Buettner - - * mips-tdep.c (heuristic_proc_desc): Clear memory associated with - ``temp_saved_regs'', not the pointer or other storage contiguous - to this pointer. - -2002-12-20 Kevin Buettner - - * Makefile.in (mips-linux-tdep.o): Add $(osabi_h) and $(gdb_string_h). - * config/mips/tm-linux.h (mips_linux_svr4_fetch_link_map_offsets) - (mips_linux_get_longjmp_target): Delete declarations. - (SVR4_FETCH_LINK_MAP_OFFSETS, GET_LONGJMP_TARGET) - (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Delete definitions. - * mips-linux-tdep.c (osabi.h, gdb_string.h): Include. - (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Define. - (mips_linux_get_longjmp_target) - (mips_linux_svr4_fetch_link_map_offsets): Make static. - (mips_linux_init_abi): New function. - (_initialize_mips_linux_tdep): Register mips_linux_init_abi(). - -2002-12-19 Keith Seitz - - patch committed by Elena Zannoni - * thread.c (do_captured_list_thread_ids): Call prune_threads and - target_find_new_threads. Fix for PR mi/669. - -2002-12-19 David Carlton - - * linespec.c (decode_line_1): Move code into decode_all_digits. - (decode_all_digits): New function. - -2002-12-19 Kevin Buettner - - * exec.c (print_section_info): Select a format string to use with - local_hex_string_custom() based upon the value of TARGET_ADDR_BIT. - -2002-12-18 Andrew Cagney - - * frame.c (deprecated_update_current_frame_pc_hack): Replace - deprecated_update_current_frame_pc_hack. - (deprecated_update_frame_base_hack): New function. - * frame.h (deprecated_update_frame_pc_hack): Replace - (deprecated_update_frame_base_hack): Declare. - * infrun.c (normal_stop): Update. - -2002-12-18 Andrew Cagney - - * rs6000-tdep.c (rs6000_init_extra_frame_info): Use - frame_extra_info_zalloc. - (rs6000_frame_args_address): Use get_frame_extra_info. - (frame_get_saved_regs): Use get_frame_saved_regs. - (frame_initial_stack_address): Use get_frame_saved_regs and - get_frame_extra_info. - (frame_initial_stack_address): Use get_frame_extra_info. - -2002-12-17 Kevin Buettner - - * dve3900-rom.c (r3900_regnames): Don't use NUM_REGS to determine - array size. - (fetch_bitmapped_register, store_bitmapped_register): Add bounds - checks for r3900_regnames[]. - -2002-12-17 Richard Earnshaw - - * armnbsd-tdep.c (ARM_NBSD_JB_PC): Renamed from JB_PC. - All uses changed - (ARM_NBSD_JB_ELELMENT_SIZE): Similarly. - -2002-12-17 David Carlton - - * symtab.c (lookup_partial_symbol): Don't search past the end of - the partial symbols. - -2002-12-17 Andrew Cagney - - * stack.c (frame_info): Use get_frame_saved_regs. - * breakpoint.c (until_break_command): Use get_frame_pc. - -2002-12-16 Kevin Buettner - - * buildsym.c (block_end_complaint, anon_block_end_complaint) - (innerblock_complaint, innerblock_anon_complaint) - (blockvector_complaint): Delete deprecated complaint structs. - (finish_block, make_blockvector, end_symtab): Replace calls - to complain() with calls to complaint(). - * coffread.c (ef_complaint, ef_stack_complaint, eb_stack_complaint) - (bf_no_aux_complaint, ef_no_aux_complaint, lineno_complaint) - (unexpected_type_complaint, bad_sclass_complaint) - (misordered_blocks_complaint, tagndx_bad_complaint, eb_complaint): - Delete deprecated complaint structs. - (coff_symtab_read, enter_linenos, decode_type, decode_base_type): - Replace calls to complain() with calls to complaint(). - * dbxread.c (lbrac_complaint, string_table_offset_complaint) - (unknown_symtype_complaint, unknown_symchar_complaint) - (lbrac_rbrac_complaint, lbrac_unmatched_complaint) - (lbrac_mismatch_complaint, repeated_header_complaint) - (unclaimed_bincl_complaint, discarding_local_symbols_complaint): - Delete deprecated complaint structs. - (unknown_symtype_complaint, lbrac_mismatch_complaint) - (repeated_header_complaint) - (function_outside_compiliation_unit_complaint): New functions. - (add_old_header_file, find_corresponding_bincl_psymtab) - (set_namestring, find_stab_function_addr, read_dbx_symtab) - (process_one_symbol): Replace calls to complain() with, possibly - indirect, calls to complaint(). - * dwarfread.c (no_bfd_get_N, malformed_die, bad_die_ref) - (unknown_attribute_form, unknown_attribute_length) - (unexpected_fund_type, unknown_type_modifier, volatile_ignored) - (const_ignored, botched_modified_type, op_deref2, op_deref4) - (basereg_not_handled, dup_user_type_allocation) - (dup_user_type_definition, missing_tag, bad_array_element_type) - (subscript_data_items, unhandled_array_subscript_format) - (unknown_array_subscript_format, not_row_major) - (missing_at_name): Delete deprecated complaint structs. - (bad_die_ref_complaint, unknown_attribute_form_complaint) - (dup_user_type_definition_complaint) - (bad_array_element_type_complaint): New functions. - (lookup_utype, alloc_utype, struct_type, decode_array_element_type) - (decode_subscript_data_item, dwarf_read_array_type) - (read_tag_string_type, read_subroutine_type, read_func_scope) - (locval, scan_partial_symbols, decode_modified_type) - (decode_func_type, basicdieinfo, completeddieinfo, target_to_host) - (attribute_size): Replace calls to complain() with, possibly - indirect, calls to complaint(). - * elfread.c (section_info_complaint, section_info_dup_complaint) - (stab_info_mismatch_complaint, stab_info_questionable_complaint): - Delete deprecated complaint structs. - (elf_symtab_read, elfstab_offset_sections): Replace calls to - complain() with calls to complaint(). - * gdbtypes.c (stub_noname_complaint): Delete deprecated complaint - struct. - (stub_noname_complaint): New function. - (check_typedef, add_mangled_type): Replace calls to complain() - with calls to complaint(). - * hpread.c (string_table_offset_complaint, lbrac_unmatched_complaint) - (lbrac_mismatch_complaint, hpread_unhandled_end_common_complaint) - (hpread_unhandled_type_complaint, hpread_struct_complaint) - (hpread_array_complaint, hpread_type_lookup_complaint) - (hpread_unexpected_end_complaint, hpread_tagdef_complaint) - (hpread_unhandled_common_complaint) - (hpread_unhandled_blockdata_complaint): Delete deprecated complaint - struct definitions and declarations. - (lbrac_unmatched_complaint, lbrac_mismatch_complaint): New functions. - (SET_NAMESTRING, hpread_type_lookup, hpread_process_one_debug_symbol): - Replace calls to complain() with, possibly indirect, calls to - complaint(). - * macrotab.c (macro_include, check_for_redefinition, macro_undef): - Likewise. - * mdebugread.c (bad_file_number_complaint, index_complaint) - (aux_index_complaint, block_index_complaint) - (unknown_ext_complaint, unknown_sym_complaint) - (unknown_st_complaint, block_overflow_complaint) - (basic_type_complaint, unknown_type_qual_complaint) - (array_index_type_complaint, bad_tag_guess_complaint) - (block_member_complaint, stEnd_complaint) - (unknown_mdebug_symtype_complaint, stab_unknown_complaint) - (pdr_for_nonsymbol_complaint, pdr_static_symbol_complaint) - (bad_setjmp_pdr_complaint, bad_fbitfield_complaint) - (bad_continued_complaint, bad_rfd_entry_complaint) - (unexpected_type_code_complaint, unable_to_cross_ref_complaint) - (bad_indirect_xref_complaint, illegal_forward_tq0_complaint) - (illegal_forward_bt_complaint, bad_linetable_guess_complaint) - (bad_ext_ifd_complaint, bad_ext_iss_complaint): Delete deprecated - complaint structs. - (index_complaint, unknown_ext_complaint, basic_type_complaint) - (bad_tag_guess_complaint, bad_rfd_entry_complaint) - (unexpected_type_code_complaint) - (function_outside_compilation_unit_complaint): New functions. - (parse_symbol, parse_type, upgrade_type, parse_procedure) - (parse_partial_symbols, psymtab_to_symtab_1, cross_ref, add_symbol): - Replace calls to complain() with, possibly indirect calls to - complaint(). - * objc-lang.c (noclass_lookup_complaint, nosel_lookup_complaint): - Delete deprecated complaint structs. - (lookup__objc_class, lookup_child_selector): Replace complain() - with complaint(). - * remote-vx.c (cant_contact_target): Delete deprecated complaint - struct. - (vx_lookup_symbol): Replace complain() with complaint(). - * stabsread.c (invalid_cpp_abbrev_complaint) - (invalid_cpp_type_complaint, member_fn_complaint) - (const_vol_complaint, error_type_complaint) - (invalid_member_complaint, range_type_base_complaint) - (reg_value_complaint, vtbl_notfound_complaint) - (unrecognized_cplus_name_complaint, rs6000_builtin_complaint) - (unresolved_sym_chain_complaint, stabs_general_complaint) - (lrs_general_complaint, multiply_defined_struct): Delete - deprecated complaint structs. - (invalid_cpp_abbrev_complaint, ref_value_complaint) - (stabs_general_complaint, lrs_general_complaint) - (msg_unknown_complaint): New functions. - (dbx_lookup_type, read_cfront_baseclasses) - (read_cfront_member_functions, resolve_symbol_reference) - (define_symbol, resolve_live_range, add_live_range, read_type) - (rs6000_builtin_type, read_member_functions, read_cpp_abbrev) - (read_one_struct_field, read_baseclasses, read_tilde_fields) - (read_cfront_static_fields, attach_fields_to_type) - (complain_about_struct_wipeout, read_range_type) - (common_block_start, common_block_end, cleanup_undefined_types) - (scan_file_globals): Replace complain() with complaint(). - * stabsread.h (unknown_symtype_complaint, unknown_symchar_complaint): - Delete deprecated complaint struct declarations. - * xcoffread.c (storclass_complaint, bf_notfound_complaint) - (ef_complaint, eb_complaint): Delete deprecated complaint structs. - (bf_not_found_complaint, ef_complaint, eb_complaint) - (function_outside_compilation_unit_complaint): New functions. - (record_include_begin, record_include_end, enter_line_range) - (xcoff_next_symbol_text, read_xcoff_symtab, process_xcoff_symbol) - (read_symbol, read_symbol_lineno, scan_xcoff_symtab) Replace - complain() with complaint(). - -2002-12-16 Andrew Cagney - - * config/arc/arc.mt, config/arc/tm-arc.h: Delete. - * config/d30v/d30v.mt, config/d30v/tm-d30v.h: Delete. - * config/fr30/fr30.mt, config/fr30/tm-fr30.h: Delete. - * config/i386/i386aix.mh, config/i386/i386aix.mt: Delete. - * config/i386/i386m3.mh, config/i386/i386m3.mt: Delete. - * config/i386/i386mach.mh, config/i386/i386os9k.mt: Delete. - * config/i386/nm-i386aix.h, config/i386/nm-i386mach.h: Delete. - * config/i386/nm-m3.h, config/i386/tm-i386aix.h: Delete. - * config/i386/tm-i386m3.h, config/i386/tm-i386mk.h: Delete. - * config/i386/xm-i386aix.h, config/i386/xm-i386m3.h: Delete. - * config/i386/xm-i386mach.h, config/i386/xm-i386mk.h: Delete. - * config/i960/mon960.mt, config/i960/nindy960.mt: Delete. - * config/i960/tm-i960.h, config/i960/tm-mon960.h: Delete. - * config/i960/tm-nindy960.h, config/i960/tm-vx960.h: Delete. - * config/i960/vxworks960.mt, config/m68k/apollo68b.mh: Delete. - * config/m68k/apollo68b.mt, config/m68k/apollo68v.mh: Delete. - * config/m68k/hp300bsd.mh, config/m68k/hp300bsd.mt: Delete. - * config/m68k/hp300hpux.mh, config/m68k/hp300hpux.mt: Delete. - * config/m88k/delta88.mh, config/m88k/delta88.mt: Delete. - * config/m88k/delta88v4.mh, config/m88k/delta88v4.mt: Delete. - * config/m88k/m88k.mh, config/m88k/m88k.mt: Delete. - * config/m88k/nm-delta88v4.h, config/m88k/nm-m88k.h: Delete. - * config/m88k/tm-delta88.h, config/m88k/tm-delta88v4.h: Delete. - * config/m88k/tm-m88k.h, config/m88k/xm-delta88.h: Delete. - * config/m88k/xm-dgux.h: Delete. - * fr30-tdep.c, i386aix-nat.c, i386m3-nat.c: Delete. - * i386mach-nat.c, i960-tdep.c, m88k-nat.c: Delete. - * os9kread.c, remote-bug.c, remote-nindy.c: Delete. - * remote-nrom.c, remote-os9k.c, remote-vx960.c: Delete. - * d30v-tdep.c, arc-tdep.c, cxux-nat.c, dst.h, dstread.c: Delete. - * ch-exp.c, ch-lang.c, ch-lang.h, ch-typeprint.c: Delete. - * ch-valprint.c: Delete. - -2002-12-15 Daniel Jacobowitz - - * infrun.c (handle_inferior_event): Rearrange code to resume if - no catchpoint triggers for an event. - -2002-12-15 Daniel Jacobowitz - - * infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED - and TARGET_WAITKIND_VFORKED cases. - -2002-12-15 Daniel Jacobowitz - - * infrun.c (handle_inferior_event): Assume that catchpoints - are not affected by DECR_PC_AFTER_BREAK. - -2002-12-15 Daniel Jacobowitz - - * target.c (update_current_target): Don't inherit DONT_USE. - * target.h (struct target_ops): Remove DONT_USE. - (target_next): Remove macro. - -2002-12-15 Mark Kettenis - - * ui-out.c (MAX_UI_OUT_LEVELS): Raise to 6. Fixes PR cli/654. - -2002-12-14 Richard Earnshaw - - * arm-tdep.c (convert_from_extended): New argument to hold the - type of floating point result we want to convert to. Make input - argument const. Fix all callers. - (convert_to_extended): Similarly. - (arm_extract_return_value): Now takes a regcache argument. Change - code to use regcache accessor functions. Correctly extract - smaller-than-word results on big-endian machines. - (arm_store_return_value): Now takes a regcache argument. Change - code to use regcache accessor functions. Correctly zero/sign extend - smaller than word results before storing into r0. - (arm_gdbarch_init): Register new-style extract_return_value and - store_return_value functions. - -2002-12-13 Michael Snyder - - * thread-db.c (thread_from_lwp): Uniquify error msg. - (lwp_from_thread): Ditto. - (check_event): Ditto. - (find_new_threads_callback): Ditto. - (thread_db_pid_to_str): Ditto. - -2002-12-13 Andrew Cagney - - * frame.h (get_frame_saved_regs): Declare. - (frame_saved_regs_zalloc): Change return type to CORE_ADDR - pointer. - * frame.c (get_frame_saved_regs): New function. - (frame_saved_regs_zalloc): Return the allocated saved_regs. - -2002-12-13 Andrew Cagney - - * frame.c (deprecated_update_current_frame_pc_hack): New - function. - * frame.h (deprecated_update_current_frame_pc_hack): Declare. - * infrun.c (normal_stop): Use said function instead of directly - modifying the frame's PC. - -2002-12-13 Alexandre Oliva - - * frame.h (frame_id_unwind_ftype): Fix typo in return type. - -2002-12-13 Kevin Buettner - - * config/mips/tm-mips.h, config/mips/tm-irix3.h, - config/mips/tm-irix6.h (NUM_REGS): Delete. - * mips-tdep.c (mips_gdbarch_init): Call set_gdbarch_num_regs(). - (temp_saved_regs): Declare as a pointer rather than an array. - (mips32_heuristic_proc_desc, heuristic_proc_desc): Make sure - that ``temp_saved_regs'' has storage allocated to it and that - it's the correct size. - -2002-12-13 Jeff Johnston - - * defs.h (init_last_source_visited): New prototype. - (add_path): Ditto. - * source.c (add_path): New function that adds to a specified path. - (mod_path): Change to call add_path. - (init_last_source_visited): New function to allow interfaces to - initialize static variable: last_source_visited. Part of fix - for PR gdb/741. - * Makefile.in: Add support for mi/mi-cmd-env.c. - -2002-12-13 Andrew Cagney - - * frame.h (frame_id_unwind): Declare. - (struct frame_info): Add fields id_unwind, id_unwind_cache_p and - id_unwind_cache. - (frame_id_unwind_ftype): Declare. - * frame.c (frame_id_unwind): New function. - (set_unwind_by_pc): Add unwind_id parameter. Initialized. - (create_new_frame, get_prev_frame): Pass id_unwind to - set_unwind_by_pc. - (frame_saved_regs_id_unwind): New function. - (frame_saved_regs_id_unwind): New function. - * dummy-frame.c (dummy_frame_id_unwind): New function. - (struct dummy_frame): Add field id. - (generic_push_dummy_frame): Initialize `id'. - * dummy-frame.h (dummy_frame_id_unwind): Declare. - -2002-12-13 Andrew Cagney - - * infcmd.c (run_stack_dummy): Create a frame ID directly and then - pass that to set_momentary_breakpoint. Move comments to where they - belong. - * frame.h (set_current_frame): Delete declaration. - * frame.c (set_current_frame): Delete function. - -2002-12-13 Andrew Cagney - - * frame.c (frame_extra_info_zalloc): New function. - * frame.h (frame_extra_info_zalloc): Declare. - -2002-12-13 Joel Brobecker - - * hppa-tdep.c (hppa_pop_frame): Fix a compilation error introduced - in the previous prototype change to set_momentary_breakpoint. - -2002-12-12 Daniel Jacobowitz - - * infrun.c (pending_follow): Remove saw_parent_fork, saw_child_fork, - and saw_child_exec. - (follow_fork, init_wait_for_inferior, handle_inferior_event): Remove - references to saw_parent_fork, saw_child_fork, and saw_child_exec. - (stop_stepping): Remove outdated check for child vfork events. - -2002-12-12 Andrew Cagney - - * GDB 5.3 released from gdb_5_3-branch. - -2002-12-11 Daniel Jacobowitz - - * corelow.c (init_core_ops): Delete references to to_require_attach - and to_require_detach. - * exec.c (init_exec_ops): Likewise. - * hppah-nat.c (child_follow_fork): Call hppa_require_attach and - hppa_require_detach directly. - * inferior.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. - * inftarg.c (child_detach): Remove. - (child_detach_from_process): Rename to child_detach, remove - after_fork argument. - (child_attach): Remove. - (child_attach_to_process): Rename to child_attach, remove after_fork - argument. - (init_child_ops): Delete references to to_require_attach - and to_require_detach. - * infttrace.c (hppa_require_attach): Update comment. - * target.c (cleanup_target, update_current_target) - (init_dummy_target, setup_target_debug): Delete references to - to_require_attach and to_require_detach. - (find_default_require_detach, find_default_require_attach) - (debug_to_require_attach, debug_to_require_detach): Remove - functions. - * target.h (struct target_ops): Remove to_require_attach - and to_require_detach. - (target_require_attach, target_require_detach): Delete macros. - (find_default_require_detach, find_default_require_attach): Delete - prototypes. - * config/pa/nm-hppah.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. - -2002-12-11 Andrew Cagney - - * frame.c (get_frame_extra_info): New function. - * frame.h (get_frame_extra_info): Declare. - -2002-12-11 Andrew Cagney - - * breakpoint.h (struct breakpoint): Replace frame with frame_id. - (set_momentary_breaokpoint): Replace `struct frame_info' parameter - with `struct frame_id'. - (set_longjmp_resume_breakpoint): Ditto. - * infrun.c (handle_inferior_event): Update. - * breakpoint.c (watch_command_1, until_break_command): Update. - * infrun.c (handle_inferior_event, check_sigtramp2): Update. - (handle_inferior_event, step_over_function): Update. - * breakpoint.c (bpstat_stop_status, print_one_breakpoint): Update. - (set_raw_breakpoint, set_longjmp_resume_breakpoint): Update. - (set_momentary_breakpoint, deprecated_frame_in_dummy): Update. - * infcmd.c (finish_command, run_stack_dummy): Update. - -2002-12-11 Kevin Buettner - - * dwarf2read.c (dwarf2_const_ignored, dwarf2_volatile_ignored) - (dwarf2_non_const_array_bound_ignored) - (dwarf2_missing_line_number_section) - (dwarf2_statement_list_fits_in_line_number_section) - (dwarf2_mangled_line_number_section, dwarf2_unsupported_die_ref_attr) - (dwarf2_unsupported_stack_op, dwarf2_complex_location_expr) - (dwarf2_unsupported_tag, dwarf2_unsupported_at_encoding) - (dwarf2_unsupported_at_frame_base, dwarf2_unexpected_tag) - (dwarf2_missing_at_frame_base, dwarf2_bad_static_member_name) - (dwarf2_unsupported_accessibility, dwarf2_bad_member_name_complaint) - (dwarf2_missing_member_fn_type_complaint) - (dwarf2_vtbl_not_found_complaint, dwarf2_absolute_sibling_complaint) - (dwarf2_const_value_length_mismatch) - (dwarf2_unsupported_const_value_attr, dwarf2_misplaced_line_number) - (dwarf2_line_header_too_long, dwarf2_missing_macinfo_section) - (dwarf2_macros_too_long, dwarf2_macros_not_terminated) - (dwarf2_macro_outside_file, dwarf2_macro_unmatched_end_file) - (dwarf2_macro_malformed_definition, dwarf2_macro_spaces_in_definition) - (dwarf2_invalid_attrib_class, dwarf2_invalid_pointer_size): Delete - complaints using deprecated struct.. - (dwarf2_non_const_array_bound_ignored_complaint) - (dwarf2_complex_location_expr_complaint) - (dwarf2_unsupported_at_frame_base_complaint) - (dwarf2_const_value_length_mismatch_complaint) - (dwarf2_macros_too_long_complaint) - (dwarf2_macro_malformed_definition_complaint) - (dwarf2_invalid_attrib_class_complaint): New functions. - (read_func_scope, dwarf2_attach_fields_to_type, dwarf2_add_member_fn) - (read_structure_scope, read_array_type, read_common_block) - (read_tag_pointer_type, read_base_type, read_partial_die) - (dwarf_decode_line_header, check_cu_functions, dwarf_decode_lines) - (new_symbol, dwarf2_const_value, read_type_die) - (dwarf2_get_ref_die_offset, decode_locdesc, consume_improper_spaces) - (parse_macro_definition, dwarf_decode_macros): Replace calls to - complain() with, possibly indirect, calls to complaint(). - -2002-12-11 Andrew Cagney - - * frame.c (deprecated_get_frame_saved_regs): Rename - get_frame_saved_regs. - * frame.h (deprecated_get_frame_saved_regs): Update declaration. - * sparc-tdep.c: Update. - * hppa-tdep.c: Update. - * h8500-tdep.c: Update. - -2002-12-11 Kevin Buettner - - * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME) - (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of - ``char *'' for return and parameter types. - * gdbarch.h, gdbarch.c: Regenerate. - * gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change - return type from ``char *'' to ``const char *''. - * c-typeprint.c (c_type_print_modifier): Make ``address_space_id'' - const. - -2002-12-11 Mark Kettenis - - * i386-tdep.c: Include "dummy-frame.h". - (i386_frame_chain, i386_frame_saved_pc): Replace - DEPRECATED_PC_IN_CALL_DUMMY with call to pc_in_dummy_frame. - (i386_gdbarch_init): Don't set deprecated_pc_in_call_dummy. - -2002-12-10 Andrew Cagney - - * gdbarch.sh (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. - Change to a function with predicate. - * gdbarch.h, gdbarch.c: Re-generate. - * frame.c (get_prev_frame): Update. Test - DEPRECATED_INIT_FRAME_PC_P. - * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC): Update. - * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC): Update. - * config/mn10200/tm-mn10200.h (DEPRECATED_INIT_FRAME_PC): Update. - * alpha-tdep.c (alpha_gdbarch_init): Update. - * mn10300-tdep.c (mn10300_gdbarch_init): Update. - * mips-tdep.c (mips_gdbarch_init): Update. - * i386-interix-tdep.c (i386_interix_init_abi): Update. - * arm-tdep.c: Update comments. - * h8300-tdep.c (h8300_gdbarch_init): Explicitly set init_frame_pc. - * config/m32r/tm-m32r.h (DEPRECATED_INIT_FRAME_PC): Ditto. - * frv-tdep.c (frv_gdbarch_init): Ditto. - * x86-64-tdep.c (x86_64_init_abi): Ditto. - * ia64-tdep.c (ia64_gdbarch_init): Ditto. - * s390-tdep.c (s390_gdbarch_init): Ditto. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * vax-tdep.c (vax_gdbarch_init): Ditto. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - * mcore-tdep.c (mcore_gdbarch_init): Ditto. - * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. - * i386-tdep.c (i386_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * cris-tdep.c (cris_gdbarch_init): Ditto. - * avr-tdep.c (avr_gdbarch_init): Ditto. - * arm-tdep.c (arm_gdbarch_init): Ditto. - * config/z8k/tm-z8k.h (INIT_FRAME_PC_FIRST): Delete macro. - (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. - -2002-12-10 Daniel Jacobowitz - - * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_VFORK): Change to - CHILD_FOLLOW_FORK. - * hppah-nat.c (saved_vfork_pid): Add. - (child_post_follow_vfork): Remove. - (child_follow_fork): New function. - (child_wait): Call detach_breakpoints after receiving the child vfork. - Call child_resume directly instead of going through resume (). - Make sure we have the exec before reporting the vfork. - * inferior.h (follow_inferior_reset_breakpoints): Add prototype. - * infrun.c (follow_fork, follow_vfork, follow_inferior_fork): Remove. - (follow_fork): New function. Call target_follow_fork. - (follow_inferior_reset_breakpoints): New function broken out from - old follow_inferior_fork. - (resume): Remove hack to follow exec after vfork. - * inftarg.c (child_post_follow_vfork): Remove. - (child_follow_fork): New function. - (init_child_ops): Replace to_post_follow_vfork with to_follow_fork. - * target.c (cleanup_target): Replace to_post_follow_vfork with - to_follow_fork. - (update_current_target): Likewise. - (setup_target_debug): Likewise. - (debug_to_post_follow_vfork): Remove. - (debug_to_follow_fork): New function. - * target.h (struct target_ops): Replace to_post_folow_vfork with - to_follow_fork. - (child_post_follow_vfork): Remove prototype. - (child_follow_fork): Add prototype. - (target_post_follow_vfork): Remove macro. - (target_follow_fork): Add macro. - -2002-12-10 Daniel Jacobowitz - - * hppah-nat.c (saved_child_execd_pathname, saved_vfork_state): New. - (child_post_follow_vfork): Cancel pending exec event if we follow - the parent. - (child_wait): Only return TARGET_WAITKIND_VFORKED when all necessary - events have been processed. Return a fake TARGET_WAITKIND_EXECD - event at the following wait call if necessary. - * infrun.c (follow_vfork): Don't follow_exec here. - (handle_inferior_event): Add comment to TARGET_WAITKIND_EXECD - case about HP/UX 10.20. Remove code pushed down to - hppah-nat.c:child_wait. - * infttrace.c (child_resume): Use TT_PROC_CONTINUE if - vfork_in_flight is set. - -2002-12-10 Daniel Jacobowitz - - * hppah-nat.c (child_wait): Return TARGET_WAITKIND_IGNORE - for the parent's fork event. - * infrun.c (handle_inferior_event): Only expect one fork event. - Call prepare_to_wait for TARGET_WAITKIND_IGNORE. Update comment. - * target.h: Update comment for TARGET_WAITKIND_IGNORE. - -2002-12-10 Andrew Cagney - - * PROBLEMS: Delete reference to PR gdb/725. - - * MAINTAINERS (gdb.c++): Add David Carlton. - -2002-12-09 David Carlton - - * cli/cli-setshow.c: #include after defs.h. - * cli/cli-cmds.c: Ditto. - -2002-12-09 Andrew Cagney - - * gdbarch.sh (gdbarch_dump): Print NAME_OF_MALLOC using %s. Wrap - function address in <>. - * gdbarch.c: Re-generate. - -2002-12-09 David Carlton - - * p-exp.y: Rename TRUE and FALSE to TRUEKEYWORD and FALSEKEYWORD. - -2002-12-09 David Carlton - - * linespec.c (symtab_from_filename): New function. - (decode_line_1): Move code into symtab_from_filename. - -2002-12-09 Kevin Buettner - - * lin-lwp.c (strsignal): Make extern declaration match that of glibc. - -2002-12-07 Andrew Cagney - - * f-valprint.c (info_common_command): Use get_frame_pc. - * std-regs.c (value_of_builtin_frame_pc_reg): Ditto. - * ax-gdb.c (agent_command): Ditto. - * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. - (rs6000_pop_frame): Ditto. - (rs6000_frameless_function_invocation): Ditto. - (rs6000_frame_saved_pc, frame_get_saved_regs): Ditto. - (frame_initial_stack_address, rs6000_frame_chain): Ditto. - * macroscope.c (default_macro_scope): Ditto. - * stack.c (print_frame_info_base): Ditto. - (print_frame, frame_info, print_frame_label_vars): Ditto. - (return_command, func_command, get_frame_language): Ditto. - * infcmd.c (finish_command): Ditto. - * dummy-frame.c (cached_find_dummy_frame): Ditto. - * breakpoint.c (deprecated_frame_in_dummy): Ditto. - (break_at_finish_at_depth_command_1): Ditto. - (break_at_finish_command_1): Ditto. - (until_break_command, get_catch_sals): Ditto. - * blockframe.c (func_frame_chain_valid): Ditto. - (frameless_look_for_prologue): Ditto. - (frame_address_in_block, generic_func_frame_chain_valid): Ditto. - -2002-12-08 Andrew Cagney - - * config/rs6000/tm-rs6000.h (init_frame_pc_noop): Add declaration. - * dwarf2cfi.c (cfi_init_frame_pc): Cast the PC to a pointer. - -2002-12-08 Andrew Cagney - - * gdbarch.sh (INIT_FRAME_PC_FIRST, INIT_FRAME_PC_DEFAULT): Convert - to pure functions. - * gdbarch.h, gdbarch.c: Re-generate. - * frame.c (get_prev_frame): Explictly assign prev's pc with value - returned by INIT_FRAME_PC_FIRST and INIT_EXTRA_FRAME_INFO. - - * arch-utils.h (init_frame_pc_default, init_frame_pc_noop): Change - declaration to a function returning a CORE_ADDR. - * x86-64-tdep.h (x86_64_init_frame_pc): Ditto. - * arch-utils.c (init_frame_pc_noop): Return the PC value. - (init_frame_pc_default): Ditto. - * x86-64-linux-tdep.c (x86_64_init_frame_pc): Ditto. - * s390-tdep.c (s390_init_frame_pc_first): Ditto. - * mips-tdep.c (mips_init_frame_pc_first): Ditto. - * dwarf2cfi.h (cfi_init_frame_pc): Ditto. - * dwarf2cfi.c (cfi_init_frame_pc): Ditto. - * alpha-tdep.c (alpha_init_frame_pc_first): Ditto. - - * i386-interix-tdep.c (i386_interix_init_abi): Set init_frame_pc - to init_frame_pc_noop. - (i386_interix_init_frame_pc): Delete function. - * z8k-tdep.c (init_frame_pc): Delete function. - * config/z8k/tm-z8k.h (INIT_FRAME_PC): Define as init_frame_pc_noop. - (INIT_FRAME_PC_FIRST): Ditto. - * config/mn10200/tm-mn10200.h (INIT_FRAME_PC): Ditto. - (INIT_FRAME_PC_FIRST): Ditto. - * config/sparc/tm-sparc.h (INIT_FRAME_PC): Ditto. - * config/rs6000/tm-rs6000.h (INIT_FRAME_PC): Redefine as - init_frame_pc_noop. - (INIT_FRAME_PC_FIRST): Convert to an expression. - * config/sparc/tm-sparc.h (INIT_FRAME_PC_FIRST): Ditto. - -2002-12-08 Andrew Cagney - - * blockframe.c: Use get_frame_base instead of directly accessing - the `struct frame_info' member frame. - * f-valprint.c, std-regs.c, rs6000-tdep.c: Ditto. - * stack.c, dummy-frame.c, breakpoint.c: Ditto. - -2002-12-08 Elena Zannoni - - * Makefile.in (readline_h): Define. - (completer.o): Depend on readline_h. - (corelow.o): Ditto. - (event-top.o): Ditto. - (exec.o): Ditto. - (solib.o): Ditto. - (source.o): Ditto. - (symfile.o): Ditto. - (symmisc.o): Ditto. - (top.o): Ditto. - (tracepoint.o): Ditto. - (utils.o): Ditto. - (cli-dump.o): Ditto. - (tui-hooks.o): Ditto. - (tuiWin.o): Ditto. - -2002-12-08 Elena Zannoni - - More cleanup from import of readline 4.3. - * completer.h (complete_line, readline_line_completion_function): - Update prototypes. - (line_completion_function): Removed, not used outside of completer.c. - * completer.c (readline_line_completion_function, - complete_function, line_completion_function): Use const for first - parameter. - (line_completion_function): Make static. - (filename_completer): filename_completion_function is now called - rl_filename_completion_function - * corelow.c: Include . - * exec.c: Ditto. - * solib.c: Ditto. - * source.c: Ditto. - * symfile.c: Ditto. - * symmisc.c: Ditto. - * top.c (init_main): No need to coerce - readline_line_completion_function anymore. - * cli/cli-dump.c: Include . - -2002-12-08 Andrew Cagney - - * stack.c (frame_info): Use get_prev_frame. - * blockframe.c (frame_address_in_block): Ditto. - * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. - (rs6000_frameless_function_invocation): Ditto. - (rs6000_frame_saved_pc): Ditto. - (rs6000_frame_chain): Ditto. - * arch-utils.c (init_frame_pc_default): Ditto. - -2002-12-08 Andrew Cagney - - * config/mn10200/tm-mn10200.h (DEPRECATED_PC_IN_CALL_DUMMY): - Delete redundant definition. - -2002-12-08 Elena Zannoni - - Import of readline 4.3: - * cli/cli-cmds.c: Include readline/tilde.h. - * cli/cli-setshow.c: Ditto. - * defs.h: Don't declare tilde_expand anymore, since readline - exports it. - -2002-12-08 Elena Zannoni - - * Makefile.in (thread-db.o): Add explicit rule to ignore the use of - -Werror on this file. - -2002-12-07 Andrew Cagney - - * gdbarch.sh (TARGET_FLOAT_FORMAT): Use the macro when printing - the format name. - (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. - * gdbarch.c: Regenerate. - -2002-12-06 Andrew Cagney - - * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename - INIT_FRAME_PC_FIRST. Change to a function with predicate. Do not - provide a default value. - * gdbarch.h, gdbarch.c: Regenerate. - * frame.c (get_prev_frame): Update. Check - DEPRECATED_INIT_FRAME_PC_FIRST_P. - * s390-tdep.c (s390_gdbarch_init): Update. - * mips-tdep.c (mips_gdbarch_init): Update. - * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. - * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. - * alpha-tdep.c (alpha_gdbarch_init): Update. - -2002-12-06 Elena Zannoni - - * ia64-linux-nat.c: Include gdb_string.h. - * alpha-nat.c: Ditto. - * ppc-linux-nat.c: Ditto. - * Makefile.in (ia64-linux-nat.o, alpha-nat.o, ppc-linux-nat.o): - Update dependencies. - -2002-12-05 Andrew Cagney - - * gdbthread.h: Include "frame.h". - (struct thread_info): Replace step_frame_address with - step_frame_id. - * inferior.h: Include "frame.h". - (step_frame_id): Replace external variable step_frame_address. - * gdbthread.h (save_infrun_state): Replace step_frame_address - parameter with step_frame_id parameter. - (load_infrun_state): Ditto. - * Makefile.in (gdbthread_h, inferior_h): Add $(frame_h). - * infcmd.c (step_frame_id, step_1, step_once): Update. - * thread.c (load_infrun_state, save_infrun_state): Update. - * infrun.c (clear_proceed_status, save_inferior_status): Update. - (handle_inferior_event, step_over_function): Update. - (normal_stop, context_switch, restore_inferior_status): Update. - (struct inferior_status): Replace step_frame_address with - step_frame_id. - -2002-12-05 David Carlton - - * dwarf2read.c (dwarf2_add_field): Treat a field that is a - DW_TAG_member as well as a declaration as being a C++ static data - member. - (read_structure_scope): Combine tests for DW_TAG_member and - DW_TAG_variable. - -2002-12-05 David Carlton - - * linespec.c (decode_compound): New function. - (decode_line_1): Move code into decode_compound. - -2002-12-05 David Carlton - - * symtab.c (lookup_symbol_aux_local): Add 'static_block' - argument. - (lookup_symbol_aux): Do the 'field_of_this' check before checking - the static block. See PR gdb/804. - -2002-12-05 David Carlton - - * symtab.c (lookup_symbol_aux_block): New function. - (lookup_symbol_aux_local): Move code into lookup_symbol_aux_block. - -2002-12-05 Andrew Cagney - - * gdbarch.sh: Dump the predicate function and macro values. - (read): Print error on standard error. - * gdbarch.c: Regenerate. - -2002-12-04 Kevin Buettner - - * Makefile.in (mips_tdep_h): Define. - (mips-tdep.o): Add mips_tdep_h to dependency list. - * mips-tdep.h: New file. - * mips-tdep.c (mips-tdep.h): Include. - (enum mips_abi): Move to mips-tdep.h. - (mips_abi): New function. - -2002-12-04 David Carlton - - * Makefile.in (f-exp.tab.c): Don't depend on c-exp.tab.c. - -2002-12-04 David Carlton - - * symtab.c (lookup_symbol_aux): Move minsym code into a separate - function. - (lookup_symbol_aux_minsyms): New function. - -2002-12-04 J. Brobecker - - * pa64solib.c: s/boolean/int/. Fixes a build failure on hppa64-hpux. - -2002-12-04 J. Brobecker - - * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Renamed from IN_SIGTRAMP, - which is an obsolete macro name. - -2002-12-04 Daniel Jacobowitz - - * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int. - * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee. - -2002-12-03 H.J. Lu (hjl@gnu.org) - - * breakpoint.c (create_thread_event_breakpoint): Use xasprintf. - (create_breakpoints): Make sure the addr_string field is not - NULL. - -2002-12-03 Andrew Cagney - - * sparc-nat.c (fetch_inferior_registers) - (store_inferior_registers): Add comment on problem of LWP vs - threads. - - From 2002-11-21 Daniel Jacobowitz - * lin-lwp.c (lin_lwp_fetch_registers): Remove. - (lin_lwp_store_registers): Remove. - (init_lin_lwp_ops): Use fetch_inferior_registers - and store_inferior_registers directly. - * sparc-nat.c (fetch_inferior_registers): Honor LWP ID. - (store_inferior_registers): Likewise. - Fix PR gdb/725. - -2002-12-03 Andrew Cagney - - * frame.h (get_frame_id): Convert to a function. - (null_frame_id, frame_id_p): Declare. - (frame_id_eq, frame_id_inner): Declare. - (frame_id_build): New function. - * frame.c (get_frame_id): Update. Use null_frame_id. - (frame_find_by_id): Rewrite using frame_id_p, frame_id_eq and - frame_id_inner. - (null_frame_id, frame_id_p): Define. - (frame_id_eq, frame_id_inner): Define. - (frame_id_build): New function. - * varobj.c (varobj_create): Update. - (varobj_update): Update. - * valops.c (value_assign): Update. - (new_root_variable): Update. - * infrun.c (save_inferior_status): Update. - * breakpoint.c (watch_command_1): Update. - -2002-12-03 J. Brobecker - - * config/pa/tm-hppah.h (SNAP1): Remove unused macro. - (SNAP2): Likewise. - -2002-12-03 Andrew Cagney - - * NEWS: Mention Daniel Jacobowitz's multi-threaded shared library - patch. - - * PROBLEMS: Mention PR gdb/725. - -2002-12-03 Andreas Schwab - - * infcmd.c (construct_inferior_arguments): Handle empty arguments. - -2002-12-02 Adam Fedor - Klee Dienes - - * objc-lang.c (objc_printstr): Add width arg to match - printstr prototype. - (compare_selectors): Add 'const' to arg types. - (compare_classes): Likewise. - (find_imps): Cast msym pointer to avoid compiler warning. - (print_object_command): Validate the address before - passing it to the print routine. - (find_objc_msgcall_submethod): Change function argument to - return an int. - * objc-lang.h: Add 'extern' to all function declarations. - (value_nsstring): Add declaration. - -2002-12-02 J. Brobecker - - * somsolib.c (dld_cache): Replace boolean by int for field is_valid. - Fixes a build failure on HP/UX. - - * hpread.c (told_objfile): Replace boolean type by int. Fixes a build - failure on HP/UX. - (hpread_has_name): Advance declaration to avoid a compilation warning. - (pst_syms_count): Add missing variable type. By change, the compiler - was defaulting to int, which seems a good choice. Fixes a compilation - warning. - (pst_syms_size): Likewise. - -2002-12-02 J. Brobecker - - * hppa-tdep.c: Add #include "osabi.h" (for hppa_gdbarch_init). - (hppa_gdbarch_init): Detect osabi from objfile. Will be needed - later to set the proper gdbarch methods depending on the osabi. - * Makefile.in (hppa-tdep.o): Add dependency on osabi.h. - -2002-12-02 J. Brobecker - - * osabi.h (gdb_osabi): Add two new enum values for HPUX ELF and SOM. - * osabi.c (gdb_osabi_name): Add strings images for the two new - enum values. - (generic_elf_osabi_sniffer): Handle HPUX objfiles. - -2002-12-02 Andrew Cagney - - * MAINTAINERS (Java): Global maintainers are responible for Java. - (Past Maintainers): Mention both Anthony Green and Per Bothner as - part Java maintainers. - -2002-12-02 J. Brobecker - - * xcoffread.c (read_symbol_lineno): Replace boolean by int. - Fixes a compilation failure on AiX. - -2002-12-02 J. Brobecker - - * config/powerpc/aix432.mh (NATDEPFILES): Add a comment explaining - why aix-thread.o is not listed. - -2002-12-01 Andrew Cagney - - * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename - PC_IN_CALL_DUMMY. Change to predicate. Always allow call. - * gdbarch.h, gdbarch.c: Re-generate. - * config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update. - * config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update. - * config/pa/tm-hppa.h, frame.h: Update. - * x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update. - * s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update. - * m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update. - * cris-tdep.c, alpha-tdep.c: Update. - * frame.c (set_unwind_by_pc, create_new_frame): Use either - DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame. - (get_prev_frame): Ditto. - -2002-11-30 Andrew Cagney - - * exec.c (xfer_memory): Replace boolean with int. - * p-exp.y: Use 0 instead of false. - * corelow.c (gdb_check_format): Change return type to int from - boolean. - * utils.c: Don't include or first. - -2002-11-29 Stephane Carrez - - * m68hc11-tdep.c (m68hc11_register_raw_size): Remove. - (m68hc11_register_byte): Remove. - (m68hc11_gdbarch_init): Don't set the above. - -2002-11-29 Andrew Cagney - - * remote-mips.c (mips_initialize): Force a selected frame rebuild - by calling get_selected_frame. - * ocd.c (ocd_start_remote): Use get_selected frame instead of - set_current_frame, create_new_frame, select_frame and - get_current_frame. - * remote-e7000.c (e7000_start_remote): Ditto. - * remote-mips.c (common_open): Ditto - * remote-rdp.c (remote_rdp_open): Ditto. - -2002-11-29 Andreas Schwab - - * m68k-tdep.c (m68k_frame_chain, m68k_frame_saved_pc) - (altos_skip_prologue, delta68_frame_saved_pc, isi_frame_num_args) - (delta68_frame_num_args, news_frame_num_args, m68k_skip_prologue) - (m68k_frame_init_saved_regs, m68k_saved_pc_after_call): Use - read_memory_unsigned_integer instead of read_memory_integer when - dealing with addresses and instruction opcodes. - * m68klinux-tdep.c (m68k_linux_sigtramp_saved_pc) - (m68k_linux_frame_saved_pc): Likewise. - -2002-11-29 Andrew Cagney - - * stack.c (selected_frame, select_frame): Move from here ... - * frame.c (selected_frame, select_frame): ... to here. Include - "language.h". - * Makefile.in (frame.o): Update dependencies. - * frame.c (get_selected_frame): New function. - * frame.h (get_selected_frame): Declare. - (deprecated_selected_frame): Rename selected_frame. - * ada-lang.c, ada-tasks.c, breakpoint.c, corelow.c: Update. - * eval.c, f-valprint.c, findvar.c, frame.c, frame.h: Update. - * h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, infcmd.c: Update. - * inflow.c, infrun.c, macroscope.c, mips-tdep.c: Update. - * mn10300-tdep.c, ocd.c, regcache.h, remote-e7000.c: Update. - * remote-mips.c, remote-rdp.c, sh-tdep.c, sparc-tdep.c: Update. - * stack.c, thread.c, tracepoint.c, valops.c, varobj.c: Update. - * z8k-tdep.c, cli/cli-cmds.c: Update. - -2002-11-29 Andrew Cagney - - * frame.h (get_selected_block): Add comments. - -2002-11-28 Andrew Cagney - - * frame.c (pc_notcurrent): New function. - (find_frame_sal): New function. - * frame.h (find_frame_sal): Declare. - (struct symtab_and_line): Add opaque declaration. - * stack.c (print_frame_info_base): Use find_frame_sal instead of - find_pc_line. - (frame_info): Ditto. - * ada-lang.c (find_printable_frame): Ditto. - -2002-11-28 J. Brobecker - - * configure.in: Check that the pthdebug library is recent enough - before enabling thread support on native AiX. - * configure: Regenerate. - - * config/powerpc/aix432.mh (NATDEPFILES): Remove aix-thread.o - from the list of object files as it is now appended by configure - if thread support is enabled. - (NAT_CLIBS): Removed as -lpthdebug is also appended by configure - if thread support is enabled. - -2002-11-28 Andrew Cagney - - * stack.c (get_selected_block): In-line get_current_block. - * frame.h (get_current_block): Delete declaration. - * blockframe.c (get_current_block): Delete function. - -2002-11-28 Andrew Cagney - - * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Rename - USE_GENERIC_DUMMY_FRAMES. - * gdbarch.h, gdbarch.c: Regenerate. - * valops.c, frame.c: Update. - * config/z8k/tm-z8k.h, config/mn10200/tm-mn10200.h: Update. - * config/m32r/tm-m32r.h, config/h8500/tm-h8500.h: Update. - * config/pa/tm-hppa.h, blockframe.c: Update. - * vax-tdep.c, sparc-tdep.c, ns32k-tdep.c: Ditto. - * m68k-tdep.c, alpha-tdep.c: Ditto. - - * arm-tdep.c: Eliminate USE_GENERIC_DUMMY_FRAMES as always 1. - * mips-tdep.c: Ditto. - -2002-11-27 Andrew Cagney - - * gdbarch.sh (CALL_DUMMY_LOCATION): Default to AT_ENTRY_POINT. - (USE_GENERIC_DUMMY_FRAMES): Default to true. - (PC_IN_CALL_DUMMY): Default to generic_pc_in_call_dummy. - * gdbarch.c, gdbarch.h: Re-generate. - * inferior.h (USE_GENERIC_DUMMY_FRAMES): Delete macro definition. - (CALL_DUMMY_LOCATION): Delete macro definition. - (PC_IN_CALL_DUMMY): Delete macro definitions. - - * arm-tdep.c (arm_gdbarch_init): Do not set pc_in_call_dummy, - default is already generic_pc_in_call_dummy. - * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. - * mips-tdep.c (mips_gdbarch_init): Ditto. - * mcore-tdep.c (mcore_gdbarch_init): Ditto. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - * ia64-tdep.c (ia64_gdbarch_init): Ditto. - * h8300-tdep.c (h8300_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * avr-tdep.c (avr_gdbarch_init): Ditto. - - * arm-tdep.c (arm_gdbarch_init): Do not set - use_generic_dummy_frames, default is already 1. - * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. - * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * s390-tdep.c (s390_gdbarch_init): Ditto. - * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. - * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. - * mips-tdep.c (mips_gdbarch_init): Ditto. - * mcore-tdep.c (mcore_gdbarch_init): Ditto. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - * ia64-tdep.c (ia64_gdbarch_init): Ditto. - * i386-tdep.c (i386_gdbarch_init): Ditto. - * h8300-tdep.c (h8300_gdbarch_init): Ditto. - * frv-tdep.c (frv_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * cris-tdep.c (cris_gdbarch_init): Ditto. - * avr-tdep.c (avr_gdbarch_init): Ditto. - - * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set - call_dummy_location, default is already AT_ENTRY_POINT. - * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * sparc-tdep.c (sparc_gdbarch_init): Ditto. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * s390-tdep.c (s390_gdbarch_init): Ditto. - * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. - * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. - * mips-tdep.c (mips_gdbarch_init): Ditto. - * mcore-tdep.c (mcore_gdbarch_init): Ditto. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - * ia64-tdep.c (ia64_gdbarch_init): Ditto. - * i386-tdep.c (i386_gdbarch_init): Ditto. - * h8300-tdep.c (h8300_gdbarch_init): Ditto. - * frv-tdep.c (frv_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * cris-tdep.c (cris_gdbarch_init): Ditto. - * avr-tdep.c (avr_gdbarch_init): Ditto. - * arm-tdep.c (arm_gdbarch_init): Ditto. - * alpha-tdep.c (alpha_gdbarch_init): Ditto. - -2002-11-28 Andrew Cagney - - * frame.h: Update comments on set_current_frame, create_new_frame, - flush_cached_frames, reinit_frame_cache, select_frame and - selected_frame. - -2002-11-27 Andrew Cagney - - * config/z8k/tm-z8k.h (PC_IN_CALL_DUMMY): Update definition to use - deprecated pc_in_call_dummy function. - * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Ditto. - * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Ditto. - * config/pa/tm-hppa.h (PC_IN_CALL_DUMMY): Ditto. - * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Ditto. - * config/h8500/tm-h8500.h (PC_IN_CALL_DUMMY): Ditto. - -2002-11-26 Martin M. Hunt - - * Makefile.in: Remove Tix dependencies. - * acinclude.m4: Ditto. - * aclocal.m4: Ditto. - * configure.in: Ditto. - * configure: Regenerated. - -2002-11-26 Andrew Cagney - - * gdbarch.sh (TARGET_FLOAT_FORMAT): Print the float format name. - (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. - * gdbarch.c: Re-generate. - -2002-11-26 Andrew Cagney - - * config/h8500/tm-h8500.h (CALL_DUMMY_LOCATION): Define as ON_STACK. - (USE_GENERIC_DUMMY_FRAMES): Define as zero. - (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. - * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Define as - pc_in_call_dummy_at_entry_point. - * config/pa/tm-hppa.h (CALL_DUMMY_LOCATION): Define as ON_STACK. - (USE_GENERIC_DUMMY_FRAMES): Define as zero. - (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. - * config/pa/tm-hppa64.h (CALL_DUMMY_LOCATION): Delete undefine. - * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Define as - pc_in_call_dummy_on_stack. - * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Redefine as - pc_in_call_dummy_at_entry_point and pc_in_call_dummy_on_stack. - * config/z8k/tm-z8k.h (CALL_DUMMY_LOCATION): Define as ON_STACK. - (USE_GENERIC_DUMMY_FRAMES): Define as zero. - (PC_IN_CALL_DUMMY): Defile as pc_in_call_dummy_on_stack. - -2002-11-26 Andrew Cagney - - * inferior.h (deprecated_pc_in_call_dummy_before_text_end): Rename - pc_in_call_dummy_before_text_end - (deprecated_pc_in_call_dummy_after_text_end): Rename - pc_in_call_dummy_after_text_end. - (deprecated_pc_in_call_dummy_on_stack): Rename - pc_in_call_dummy_on_stack. - (deprecated_pc_in_call_dummy_at_entry_point): Rename - pc_in_call_dummy_at_entry_point. - * m68k-tdep.c (m68k_gdbarch_init): Update. - * s390-tdep.c (s390_gdbarch_init): Update. - * x86-64-tdep.c (x86_64_gdbarch_init): Update. - * vax-tdep.c (vax_gdbarch_init): Update. - * sparc-tdep.c (sparc_gdbarch_init): Update. - * ns32k-tdep.c (ns32k_gdbarch_init): Update. - * mn10300-tdep.c (mn10300_gdbarch_init): Update. - * i386-tdep.c (i386_gdbarch_init): Update. - * frv-tdep.c (frv_gdbarch_init): Update. - * cris-tdep.c (cris_gdbarch_init): Update. - * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Update. - * blockframe.c (deprecated_pc_in_call_dummy_before_text_end) - (deprecated_pc_in_call_dummy_after_text_end) - (deprecated_pc_in_call_dummy_on_stack) - (deprecated_pc_in_call_dummy_at_entry_point): Update. - * alpha-tdep.c (alpha_gdbarch_init): Update. - -2002-11-25 Daniel Jacobowitz - - * acconfig.h (HAVE_PREAD64): Add. - * configure.in: Check for pread64. - * config.in: Regenerated. - * configure: Regenerated. - * lin-lwp.c (lin_lwp_xfer_memory): Call linux_proc_xfer_memory. - * linux-proc.c (linux_proc_xfer_memory): New function. - * config/nm-linux.h (linux_proc_xfer_memory): Add prototype. - -2002-11-25 David Carlton - - * dwarf2read.c (scan_partial_symbols): Descend into namespace - pdi's with no name. - -2002-11-25 Andrew Cagney - - * MAINTAINERS: Mark h8500 as broken. Breakage occured Fri Nov 5 - 16:32:04 1999 Andrew Cagney . - -2002-11-25 Jim Blandy - - * symfile.c (init_objfile_sect_indices): New function. - (default_symfile_offsets): Move the section-index-initializing - stuff into init_objfile_sect_indices, and call that. - - * symtab.h (SIZEOF_N_SECTION_OFFSETS): New macro. - (SIZEOF_SECTION_OFFSETS): Use SIZEOF_N_SECTION_OFFSETS. - - * symfile.c (syms_from_objfile): Adjust indentation. - - * symfile.c (symbol_file_add): Flush gdb_stdout even if from_tty - || info_verbose isn't true. - -2002-11-24 Andrew Cagney - - * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Change - default to get_frame_base. - * gdbarch.h, gdbarch.c: Regenerate. - * arch-utils.c (default_frame_address): Delete function. - * arch-utils.h (default_frame_address): Delete declaration - -2002-11-24 Pierre Muller - - * varobj.c (find_frame_addr_in_frame_chain): - Use get_frame_base instead of FRAME_FP, - obvious fix. - -2002-11-19 Andrew Cagney - - * frame.h (FRAME_FP): Delete macro. - (get_frame_base): New function declaration. - * frame.c (get_frame_base): New function. - (get_frame_id): Use ->frame. - (frame_find_by_id): Rewrite to use get_frame_id. - * blockframe.c: Use get_frame_base instead of FRAME_FP. - * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto. - * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto. - * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto. - * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto. - * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto. - * v850-tdep.c, valops.c, z8k-tdep.c: Ditto. - -2002-11-24 Andrew Cagney - - * arm-tdep.c (arm_gdbarch_init): Do not set get_saved_register. - -2002-11-24 Andrew Cagney - - * frame.c (set_unwind_by_pc): Revert change below, use - PC_IN_CALL_DUMMY. - (get_prev_frame): Ditto. - -2002-11-24 Andrew Cagney - - * dummy-frame.c (pc_in_dummy_frame): New function. - (generic_pc_in_call_dummy): Call pc_in_dummy_frame. - (find_dummy_frame): Update comment. - (generic_pop_current_frame): Use get_frame_type. - * dummy-frame.h (pc_in_dummy_frame): Declare. - * frame.c (set_unwind_by_pc): Use pc_in_dummy_frame. - (create_new_frame): Use pc_in_dummy_frame. - (get_prev_frame): Use pc_in_dummy_frame. - (frame_saved_regs_register_unwind): Use get_prev_frame. - (deprecated_generic_get_saved_register): Use get_prev_frame. - -2002-11-23 Andrew Cagney - - * blockframe.c (find_frame_addr_in_frame_chain): Move function - from here ... - * varobj.c (find_frame_addr_in_frame_chain): ... to here. - (varobj_create): Note that frame ID should be used. - * frame.h (find_frame_addr_in_frame_chain): Delete declaration. - -2002-11-23 Andrew Cagney - - * breakpoint.c: Include "gdb_assert.h". - (deprecated_frame_in_dummy): Assert that generic dummy frames are - not being used. - * Makefile.in (breakpoint.o): Update dependencies. - * ada-lang.c (find_printable_frame): Use get_frame_type instead of - deprecated_frame_in_dummy. - * stack.c (print_frame_info_base): Ditto. - (frame_info): Ditto. - (print_frame_info_base): Ditto. Delete dead code. - -2002-11-23 Andreas Schwab - - * Makefile.in (m68k_tdep_h): Define. - (abug-rom.o, cpu32bug-rom.o, dbug-rom.o, m68k-tdep.o, m68klinux-nat.o) - (remote-est.o, rom68k-rom.o): Add $(m68k_tdep_h). - * m68k-tdep.c: Move register number enum ... - * m68k-tdep.h: ... to this new file and rename the constants from - E_* to M68K_*. All uses changed. - * config/m68k/tm-m68k.h (D0_REGNUM, A0_REGNUM): Remove definitions. - * abug-rom.c: Include "m68k-tdep.h". Use - M68K_D0_REGNUM/M68K_A0_REGNUM instead of D0_REGNUM/A0_REGNUM. - * cpu32bug-rom.c: Likewise. - * dbug-rom.c: Likewise. - * m68k-tdep.c: Likewise. - * m68klinux-nat.c: Likewise. - * remote-est.c: Likewise. - * rom68k-rom.c: Likewise. - * config/m68k/tm-linux.h: Likewise. - -2002-11-23 Andrew Cagney - - * arm-tdep.c (arm_gdbarch_init): Remove old style non-generic - dummy frame initialization code. - * mips-tdep.c (mips_gdbarch_init): Ditto. - -2002-11-22 Christopher Faylor - - * win32-nat.c (child_attach): Reset saw_create counter or subsequent - attach will hang. - -2002-11-22 Andrew Cagney - - * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Default - to default_frame_address. - * gdbarch.h, gdbarch.c: Re-generate. - - * d10v-tdep.c (d10v_gdbarch_init): Do not set frame_args_address - or frame_locals_address to default_frame_address. - * m68k-tdep.c (m68k_gdbarch_init): Update. - * i386-tdep.c (i386_gdbarch_init): Update. - * frv-tdep.c (frv_gdbarch_init): Update. - * sh-tdep.c (sh_gdbarch_init): Update. - * v850-tdep.c (v850_gdbarch_init): Update. - * sparc-tdep.c (sparc_gdbarch_init): Update. - * mips-tdep.c (mips_gdbarch_init): Update. - * mn10300-tdep.c (mn10300_gdbarch_init): Update. - * x86-64-tdep.c (x86_64_gdbarch_init): Update. - * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. - - * cris-tdep.c (cris_frame_args_address): Delete function. - (cris_frame_locals_address): Delete function. - (cris_gdbarch_init): Do not set frame_args_address or - frame_locals_address. - -2002-11-22 Michael Snyder - - * thread-db.c (thread_db_load): Tell the user what's going on - if dlopen fails on libthread_db. - -2002-11-23 Andreas Schwab - - * m68k-tdep.c (m68k_register_virtual_type): Use architecture - invariant return values. - -2002-11-22 Andreas Schwab - - * valops.c (value_slice): Move declaration of `offset' to avoid - warning. - -2002-11-22 Christopher Faylor - - * win32-nat.c (psapi_get_dll_name): Fix a compiler warning. - (struct so_stuff): Add end_addr field. - (register_loaded_dll): Calculate and store end address of loaded dll. - (solib_address): New function. - (child_solib_loaded_library_pathname): Pass carefully constructed - section info to safe_symbol_file_add rather than ignoring it. - (get_child_debug_event): Call re_enable_breakpoints_in_shlibs when a - DLL is loaded. - (do_initial_child_stuff): Call disable_breakpoints_in_shlibs. - (child_create_inferior): Fix a compiler warning. - * config/i386/tm-cygwin.h (PC_SOLIB): Define new macro. - (solib_address): Declare new function. - -2002-11-22 Andreas Schwab - - * m68k-tdep.c (m68k_register_virtual_type): Return int for SR, FPC - and FPS registers. - -2002-11-21 Daniel Jacobowitz - - * maint.c (_initialize_maint_cmds): Fix typo. From - Francesco Potorti` . - -2002-11-21 Andrew Cagney - - * mips-tdep.c (mips_dump_tdep): Delete references to - GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. - * config/mips/tm-mips.h (GDB_TARGET_MASK_DISAS_PC): Delete macro. - (GDB_TARGET_UNMASK_DISAS_PC): Delete macro. - * printcmd.c (build_address_symbolic): Delete calls to - GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. - (address_info): Ditto. - Fix PR gdb/773. - -2002-11-19 Klee Dienes - Adam Fedor - - * completer.c (skip_quoted_chars): Renamed from skip_chars. Add - the ability to explicitly specify the quote characters and word - break characters; if NULL is specified for either, use the old - behavior of using the characters used by the completer. - (skip_chars): New function. Convenience wrapper around - skip_quoted_chars to provide the original skip_chars behavior. - * completer.h (skip_quoted_chars): Add prototype. - -2002-11-19 Andrew Cagney - - Problems reported by Paul Eggert. - * gdbarch.sh: Use `sort -k 3`. Fix PR gdb/527. - -2002-11-19 Andreas Schwab - - * m68klinux-nat.c (IS_SIGTRAMP, IS_RT_SIGTRAMP) - (m68k_linux_in_sigtramp, SIGCONTEXT_PC_OFFSET) - (UCONTEXT_PC_OFFSET, m68k_linux_sigtramp_saved_pc) - (m68k_linux_frame_saved_pc): Move to ... - * m68klinux-tdep.c: ... here. New file. - * Makefile.in (m68klinux-tdep.o): Add dependencies. - * config/m68k/linux.mt (TDEPFILES): Add m68klinux-tdep.o. - -2002-11-19 Adam Fedor - - * objc-exp.y: Revert to old skip_quoted usage. - -2002-11-19 Adam Fedor - - * Makefile.in (SFILES): Add objc-exp.y objc-lang.c. - (objc_lang_h): Define. - (YYFILES): Add objc-exp.tab.c. - (local-maintainer-clean): Remove objc-exp.tab.c. - (objc-exp.tab.c, objc-exp.tab.o, objc-lang.o): New target. - -2002-11-19 Pierre Muller - - * p-exp.y (typecast rule): Add automatic dereference of - pascal classes if needed. - (THIS): Set current_type. - Automatically dereference pascal classes. - (typebase rule): Add ^typebase recognition. - -2002-11-18 Adam Fedor - - * expprint.c (print_subexp): Handle OP_OBJC_NSSTRING, - OP_OBJC_MSGCALL, and OP_OBJC_SELF. - (op_name): Handle OP_OBJC_SELF. - * Makefile.in (expprint.o): Add additional depends. - -2002-11-18 Adam Fedor - - * expression.h: Rename ObjC ops to OP_OBJC_MSGCALL, - OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF. - * parse.c (length_of_subexp, prefixify_subexp): Likewise. - * objc-exp.y: Likewise. - -2002-11-18 Adam Fedor - - * gdb/parser-defs.h: (struct objc_class_str): New structure - for parsing ObjC classes. - -2002-11-18 Andrew Cagney - - * stack.c (frame_relative_level): Copy function from here ... - * frame.c (frame_relative_level): ...to here. - -2002-11-18 Andrew Cagney - - * frame.h (enum frame_type): Define. - (get_frame_type): Declare. - (struct frame_info): Add field `type'. Delete field - signal_handler_caller. - (deprecated_set_frame_signal_handler_caller): Declare. - * frame.c (get_frame_type): New function. - (deprecated_set_frame_type): New function. - (create_new_frame): Set the frame's type. - (get_prev_frame): Similar. - * sparc-tdep.c: Use get_frame_type instead of signal_handler_caller. - * s390-tdep.c: Ditto. - * m68klinux-nat.c: Ditto. - * ns32k-tdep.c: Ditto. - * x86-64-linux-tdep.c: Ditto. - * vax-tdep.c: Ditto. - * rs6000-tdep.c: Ditto. - * ppc-linux-tdep.c: Ditto. - * i386-interix-tdep.c: Ditto. - * mips-tdep.c: Ditto. - * m68k-tdep.c: Ditto. - * hppa-tdep.c: Ditto. - * ia64-tdep.c: Ditto. - * cris-tdep.c: Ditto. - * arm-tdep.c: Ditto. - * alpha-tdep.c: Ditto. - * i386-tdep.c: Ditto. - * stack.c: Ditto. - * ada-lang.c: Ditto. - * blockframe.c: Update. - * i386-interix-tdep.c (i386_interix_back_one_frame): Use - deprecated_set_frame_type instead of signal_handler_caller. - * ppc-linux-tdep.c (ppc_linux_init_extra_frame_info): Ditto. - * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. - * breakpoint.h: Delete FIXME suggesting get_frame_type. - -2002-11-18 Klee Dienes - - * Makefile.in (buildsym.o): Add dependency for gdb_assert.h. - -2002-11-18 Klee Dienes - - * buildsym.c (pop_context): Add comment. - -2002-11-18 Klee Dienes - - * buildsym.h (pop_context): Convert to function, defined in - buildsym.c. - * buildsym.c: Include gdb_assert.h. - (pop_context): Implement as C function. Add check for stack - underflow. - * dbxread.c (process_one_symbol): Complain and stop processing - that symbol if we are already at the top of the context stack for - a function-end N_FUN (this would imply an umatched RBRAC). Ditto - when processing N_RBRAC. - -2002-11-16 Daniel Jacobowitz - - * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_INFERIOR_BY_CLONE): Don't - define. - (struct target_waitstatus): Add opaque definition. - * corelow.c (init_core_ops): Don't set to_clone_and_follow_inferior. - * exec.c (init_exec_ops): Likewise. - * fork-child.c (clone_and_follow_inferior): Remove. - * hppah-nat.c (child_post_follow_inferior_by_clone): Remove. - * inferior.h (clone_and_follow_inferior): Remove prototype. - * infrun.c (follow_fork_mode_both): Remove. - (follow_fork_mode_kind_names): Remove commented out "both". - (follow_inferior_fork): Remove follow_fork_mode_both support. - * inftarg.c (child_clone_and_follow_inferior): Remove. - (child_post_follow_inferior_by_clone): Remove. - (init_child_ops): Don't set to_clone_and_follow_inferior - or to_post_follow_inferior_by_clone. - * target.c (default_clone_and_follow_inferior): Remove. - (cleanup_target): Don't set to_clone_and_follow_inferior - or to_post_follow_inferior_by_clone. - (find_default_clone_and_follow_inferior): Remove. - (init_dummy_target): Don't set to_clone_and_follow_inferior. - (debug_to_clone_and_follow_inferior): Remove. - (debug_to_post_follow_inferior_by_clone): Remove. - (setup_target_debug): Don't set to_clone_and_follow_inferior - or to_post_follow_inferior_by_clone. - * target.h (struct target_ops): Remove to_clone_and_follow_inferior - and to_post_follow_inferior_by_clone. - (child_clone_and_follow_inferior): Remove prototype. - (child_post_follow_inferior_by_clone): Remove prototype. - (target_clone_and_follow_inferior): Remove macro. - (target_post_follow_inferior_by_clone): Remove macro. - (find_default_clone_and_follow_inferior): Remove prototype. - -2002-11-16 Daniel Jacobowitz - - * breakpoint.c (bpstat_stop_status): Call inferior_has_forked, - inferior_has_vforked, and inferior_has_execd instead of - target_has_forked, target_has_vforked, and target_has_execd. - * config/pa/nm-hppah.h (CHILD_HAS_FORKED, CHILD_HAS_VFORKED) - (CHILD_HAS_EXECD, CHILD_HAS_SYSCALL_EVENT): Don't define. - (CHILD_WAIT): Define. - (child_wait): Add prototype. - * hppah-nat.c (hpux_has_forked): Rename from child_has_forked. - Add prototype. - (hpux_has_vforked): Likewise, from child_has_vforked. - (hpux_has_execd): Likewise, from child_has_execd. - (hpux_has_syscall_event): Likewise, from child_has_syscall_event. - (not_same_real_pid, child_wait): New, copied from inftarg.c. - Call hpux_has_forked, hpux_has_vforked, hpux_has_execd, - and hpux_has_syscall_event instead of the target hooks. - * infrun.c (inferior_has_forked, inferior_has_vforked) - (inferior_has_execd): New functions. - * inftarg.c (not_same_real_pid): Remove. - (child_wait): Remove references to not_same_real_pid, - target_has_forked, target_has_vforked, target_has_execd, - and target_has_syscall_event. - (child_has_forked, child_has_vforked, child_has_execd) - (child_has_syscall_event): Remove. - (init_child_ops): Remove references to child_has_forked, - child_has_vforked, child_has_execd, and child_has_syscall_event. - * infttrace.c (hpux_has_forked): Rename from child_has_forked. - (hpux_has_vforked): Likewise, from child_has_vforked. - (hpux_has_execd): Likewise, from child_has_execd. - (hpux_has_syscall_event): Likewise, from child_has_syscall_event. - * target.c (cleanup_target): Remove references to - to_has_forked, to_has_vforked, to_has_execd, and - to_has_syscall_event. - (update_current_target): Likewise. - (setup_target_debug): Likewise. - (debug_to_has_forked): Remove. - (debug_to_has_vforked): Remove. - (debug_to_has_execd): Remove. - (debug_to_has_syscall_event): Remove. - * target.h (struct target_ops): Remove to_has_forked. - to_has_vforked, to_has_execd, and to_has_syscall_event. - (child_has_forked, child_has_vforked, child_has_execd) - (child_has_syscall_event): Remove prototypes. - (inferior_has_forked, inferior_has_vforked, inferior_has_execd): Add - prototypes. - (target_has_forked, target_has_vforked, target_has_execd) - (target_has_syscall_event): Remove macros. - -2002-11-16 Daniel Jacobowitz - - * hppah-nat.c (child_can_follow_vfork_prior_to_exec): Remove. - * inftarg.c (child_can_follow_vfork_prior_to_exec): Remove. - (init_child_ops): Don't initialize to_can_follow_vfork_prior_to_exec. - * infttrace.c (child_can_follow_vfork_prior_to_exec): Remove. - * target.c (cleanup_target): Remove reference to - to_can_follow_vfork_prior_to_exec. - (update_current_target): Likewise. - (debug_to_can_follow_vfork_prior_to_exec): Remove. - (setup_target_debug): Remove reference to - to_can_follow_vfork_prior_to_exec. - * target.h (struct target_ops): Remove - to_can_follow_vfork_prior_to_exec. - (child_can_follow_vfork_prior_to_exec): Remove prototype. - (target_can_follow_vfork_prior_to_exec): Remove definition. - * config/pa/nm-hppah.h (CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC): Don't - define. - * infrun.c (follow_vfork_when_exec): Remove. - (follow_inferior_fork): Remove references to follow_vfork_when_exec. - (follow_exec): Likewise. - (handle_inferior_event): Likewise. - (keep_going): Likewise. - -2002-11-15 Andrew Cagney - - * frame.c (generic_unwind_get_saved_register): Make static. - * frame.h (generic_unwind_get_saved_register): Delete declaration. - * avr-tdep.c (avr_gdbarch_init): Do not set get_saved_register, - defaults to generic_unwind_get_saved_register. - * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. - * h8300-tdep.c (h8300_gdbarch_init): Ditto. - * frv-tdep.c (frv_gdbarch_init): Ditto. - * i386-tdep.c (i386_gdbarch_init): Ditto. - * s390-tdep.c (s390_gdbarch_init): Ditto. - * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * mcore-tdep.c (mcore_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Delete macro. - -2002-11-15 Andrew Cagney - - * x86-64-linux-nat.c (i386_sse_regnum_p): New function. Copy from - i386-tdep.c. - -2002-11-15 Andrew Cagney - - * frame.h (sigtramp_saved_pc): Delete declaration. - * blockframe.c (sigtramp_saved_pc): Delete function. - * ns32k-tdep.c (ns32k_sigtramp_saved_pc): New function. - (ns32k_frame_saved_pc): Call ns32k_sigtramp_saved_pc. - * vax-tdep.c (vax_sigtramp_saved_pc): New function. - (vax_frame_saved_pc): Call vax_sigtramp_saved_pc. - -2002-11-15 Andrew Cagney - - * frame.c (frame_pc_unwind): New function. - (frame_saved_regs_pc_unwind): New function. - (frame_register_unwind): Pass unwind_cache instead of - register_unwind_cache. - (set_unwind_by_pc): Add unwind_pc parameter, set. - (create_new_frame): Pass frame->pc_unwind to set_unwind_by_pc. - (get_prev_frame): Ditto. - * frame.h (frame_pc_unwind_ftype): Declare. - (struct frame_info): Add pc_unwind, pc_unwind_cache_p and - pc_unwind_cache. Rename register_unwind_cache to unwind_cache. - (frame_pc_unwind): Declare. - * dummy-frame.c (dummy_frame_pc_unwind): New function. - (struct dummy_frame): Add comment mentioning that values are for - previous frame. - * dummy-frame.h (dummy_frame_pc_unwind): Declare. - * blockframe.c (file_frame_chain_valid): Use frame_pc_unwind. - (generic_file_frame_chain_valid): Ditto. - * stack.c (frame_info): Ditto. - -2002-11-15 David Carlton - - * linespec.c (locate_first_half): New function. - (decode_line_1): Move code into locate_first_half. - -2002-11-15 Andrew Cagney - - * complaints.h: Add comment explaining how to eliminate a - deprecated_complain call. - * complaints.h: Fix spelling errors. - -2002-11-15 David Carlton - - * printcmd.c: Remove #include "disasm.h". - -2002-11-14 Andrew Cagney - - * frame.h: Move the most relevant interface functions to the start - of the file. - -2002-11-14 Andrew Cagney - - * regcache.h (deprecated_registers): Rename registers. - * a68v-nat.c, alpha-nat.c, arch-utils.c, core-sol2.c: Update. - * hp300ux-nat.c, hppab-nat.c, hppah-nat.c: Update. - * hppam3-nat.c, hpux-thread.c, i386gnu-nat.c: Update. - * ia64-aix-nat.c, ia64-linux-nat.c, ia64-tdep.c: Update. - * irix4-nat.c, irix5-nat.c, lynx-nat.c, m68k-tdep.c: Update. - * m68knbsd-nat.c, mips-linux-tdep.c, mipsm3-nat.c: Update. - * mipsv4-nat.c, ns32knbsd-nat.c, ppc-bdm.c: Update. - * ppc-sysv-tdep.c, ptx4-nat.c, regcache.c, remote-es.c: Update. - * remote-sds.c, remote-vx68.c, remote-vxmips.c: Update. - * remote-vxsparc.c, rs6000-tdep.c, sol-thread.c: Update. - * sparc-nat.c, sparc-tdep.c, sun3-nat.c, symm-nat.c: Update. - * v850ice.c: Update. - -Wed Nov 13 19:51:05 2002 Andrew Cagney - - * utils.c (gdb_realpath): Add comment mentioning realpath with a - NULL buffer. - -2002-11-13 Andrew Cagney - - * regcache.h (deprecated_read_register_bytes): Rename - read_register_bytes. - (deprecated_write_register_bytes): Rename write_register_bytes. - * alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update. - * dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update. - * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update. - * ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update. - * remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update. - * sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update. - * xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update. - * config/nm-m3.h, config/h8500/tm-h8500.h: Update. - * config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update. - * config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update. - * config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update. - * config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update. - * config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update. - * config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update. - -2002-11-13 Jim Blandy - - * findvar.c (read_var_value): Doc fix. - -2002-11-13 Andrew Cagney - - * regcache.c (struct regcache): Replace passthough_p with - readonly_p. - (regcache_xmalloc): Initialize readonly_p. - (build_regcache): Initialize readonly_p. - (regcache_save): New function. - (regcache_restore): New function. - (regcache_cpy): Re-implement using regcache_save and - regcache_restore. - (regcache_raw_read): Update. - (regcache_cooked_read): When a read-only cache, checked for cached - pseudo register values. - (regcache_raw_write): Assert that the cache is not read-only. - Remove code handling a non-passthrough cache. - * regcache.h (regcache_save): Declare. - (regcache_restore): Declare. - -2002-11-13 Andrew Cagney - - * regcache.c (struct regcache_descr): Add fields - sizeof_cooked_registers and sizeof_cooked_register_valid_p. - (init_legacy_regcache_descr): Compute the size of a cooked - register cache and then assign that to sizeof_raw_registers. Set - sizeof_raw_register_valid_p to sizeof_cooked_register_valid_p - (init_legacy_regcache_descr): Ditto. - -2002-11-13 Andrew Cagney - - * regcache.c (register_buffer): Move to near start of file, update - description. - (regcache_raw_read): Use. - (regcache_raw_write): Use. - (struct regcache): Rename raw_registers to registers and - raw_register_valid_p to register_valid_p. - (regcache_xmalloc): Update. - (regcache_xfree): Update. - (register_buffer): Update. - (regcache_cpy): Update. - (regcache_cpy_no_passthrough): Update. - (regcache_valid_p): Update. - (deprecated_grub_regcache_for_registers): Update. - (deprecated_grub_regcache_for_register_valid): Update. - (set_register_cached): Update. - (regcache_raw_write): Update. - -2002-11-13 Pierre Muller - - * p-exp.y (name_not_typename): Use copy_name to - set current_type variable for fields of THIS. - -2002-11-12 Daniel Jacobowitz - - * gnu-nat.c (init_gnu_ops): Remove NULL initializations. - * monitor.c (init_base_monitor_ops): Likewise. - * ppc-bdm.c (init_bdm_ppc_ops): Likewise. - * remote-array.c (init_array_ops): Likewise. - * remote-e7000.c (init_e7000_ops): Likewise. - * remote-es.c (init_es1800_ops): Likewise. - (init_es1800_child_ops): Likewise. - * remote-rdp.c (init_remote_rdp_ops): Likewise. - * remote-sim.c (init_gdbsim_ops): Likewise. - * remote-st.c (init_st2000_ops): Likewise. - * sol-thread.c (init_sol_core_ops): Likewise. - (init_sol_thread_ops): Likewise. - * v850ice.c (init_850ice_ops): Likewise. - * win32-nat.c (init_child_ops): Likewise. - * wince.c (init_child_ops): Likewise. - -2002-11-12 Andrew Cagney - - * utils.c (gdb_realpath): Make rp a constant pointer. - -2002-11-12 Andrew Cagney - - * utils.c (gdb_realpath): Rewrite. Try, in order: realpath() with - a constant buffer; cannonicalize_file_name(); realpath() with a - pathconf() defined buffer, xstrdup(). - -2002-11-12 Andrew Cagney - - * config/djgpp/fnchange.lst: Fix typo, hang1.c to hang1.C; hang2.c - to hang2.C; hang3.c to hang3.C. - -2002-11-11 Elena Zannoni - - * findvar.c (read_var_value): Reenable TLS code. - -2002-11-11 Elena Zannoni - Jim Blandy - - * gdb_thread_db.h (enum): Add TD_NOTALLOC. - * target.c (update_current_target): Add - to_get_thread_local_address. - * target.h (to_get_thread_local_address): Export. - (target_get_thread_local_address): Define. - (target_get_thread_local_address_p): Define. - * thread-db.c: Include solib-svr4.h. - (td_thr_tls_get_addr_p): Define. - (thread_db_load): Get a pointer to td_thr_tls_get_addr. - (thread_db_get_thread_local_address): New function. - (init_thread_db_ops): Initialize to_get_thread_local_address. - * configure.in: Add test for TD_NOTALLOC in thread_db.h. - * configure: Regenerate. - * config.in: Regenerate. - -2002-11-11 David Carlton - - * linespec.c (set_flags): New function. - (decode_line_1): Move code into set_flags. - -2002-11-11 David Carlton - - * linespec.c (decode_line_1): Move chunks of code to separate - functions. - (initialize_defaults): New function. - (decode_indirect): New function. - -2002-11-11 Andrew Cagney - - * blockframe.c (sigtramp_saved_pc): Fix tipo. void_func_ptr - instead of void_code_ptr. - (sigtramp_saved_pc): Ditto. - - * x86-64-tdep.c (i386_fp_regnum_p): Copy i386-tdep.c's - i386_fp_regnum_p. - -2002-11-10 Daniel Jacobowitz - - * gdbtypes.h (struct main_type): Move artificial flag out of - loc. New member of ``struct field'' named static_kind. Reduce - overloaded meaning of bitsize. - (FIELD_ARTIFICIAL, SET_FIELD_PHYSNAME, SET_FIELD_PHYSADDR) - (TYPE_FIELD_STATIC, TYPE_FIELD_STATIC_HAS_ADDR): Likewise. - (FIELD_STATIC_KIND, TYPE_FIELD_STATIC_KIND): New macros. - - * ada-lang.c (fill_in_ada_prototype): Initialize static_kind for - new fields. - (template_to_fixed_record_type, template_to_static_fixed_type) - (to_record_with_fixed_variant_part): Likewise. - * coffread.c (coff_read_struct_type, coff_read_enum_type): Likewise. - * dwarf2read.c (dwarf2_add_field, read_enumeration): Likewise. - * dwarfread.c (struct_type, enum_type): Likewise. - * hpread.c (hpread_read_enum_type) - (hpread_read_function_type, hpread_read_doc_function_type) - (hpread_read_struct_type): Likewise. - * mdebugread.c (parse_symbol): Likewise. - -2002-11-10 Andrew Cagney - - * breakpoint.h (deprecated_frame_in_dummy): Rename frame_in_dummy. - * stack.c (print_frame_info_base): Update. - (print_frame_info_base, frame_info): Update. - * sparc-tdep.c (sparc_init_extra_frame_info): Update. - (sparc_frame_saved_pc): Update. - * ada-lang.c (find_printable_frame): Update. - * breakpoint.c (deprecated_frame_in_dummy): Update. - -2002-11-09 Mark Kettenis - - * i386-linux-nat.c (ORIG_EAX): Define to -1 if not already - defined. - (regmap): Extend to cover all registers. - (PT_READ_U, PT_WRITE_U, PTRACE_XFER_TYPE, - OLD_CANNOT_FETCH_REGISTERS, OLD_CANNOT_STORE_REGISTERS): Remove - definitions. - (fetch_register, sore_register): Simplify. - (old_fetch_inferior_registers, old_store_inferior_registers): - Remove functions. - (cannot_fetch_register, cannot_store_register): Change - implementation to use regmap array to decide which registers - cannot be fetched/stored. This removes $orig_eax from the - registers that cannot be fetched/stored. - (fetch_inferior_registers): Call fetch_register directly instead - of calling old_fetch_inferior_registers. - (store_inferior_registers): Call store_register directly instead - of calling old_store_inferior_registers. - (i386_linux_dr_get): Replace PT_READ_U with PTRACE_PEEKUSER. - (i386_linux_dr_set): Replace PT_WRITE_U with PTRACE_POKEUSER. - * config/i386/nm-linux.h (U_REGS_OFFSET): Remove definition. - -2002-11-09 Klee Dienes - - * i387-tdep.c (i387_supply_register): When called with NULL as a - buffer, mark the register as not provided (to mirror the behavior - of supply_register). - (i387_supply_fxsave): Ditto. - (i387_supply_fsave): Ditto (inherits the behavior from - i387_supply_register). - -2002-11-09 Klee Dienes - - * blockframe.c (sigtramp_saved_pc): Use - builtin_type_void_code_ptr, not builtin_type_void_data_ptr (we are - extracting the PC). Use TYPE_LENGTH (builtin_type_void_code_ptr) - instead of (TARGET_PTR_BIT / TARGET_CHAR_BIT). - -2002-11-09 Andrew Cagney - - * frame.c (get_prev_frame): Test prev_p to identify a previously - unwound frame. Initialize prev_p. - * frame.h (struct frame_info): Add field prev_p. Expand prev/next - comment. - -2002-11-09 Andrew Cagney - - * frame.c (get_prev_frame): Cleanups. Eliminate redundant tests - for a NULL NEXT_FRAME. Simplify fromleaf initialization. Add - more comments. Zap dead code. - -2002-11-09 Mark Kettenis - - * infcmd.c (print_vector_info, print_float_info): Move code that - checks whether the target has any registers and whether there is a - selected frame up, such that it is also used if a target provides - multi-arch definitions of these functions. - -2002-11-08 Andrew Cagney - - * Makefile.in (DESTDIR): Define. - (install-only, install-gdbtk, uninstall-gdbtk): Add $(DESTDIR) - prefix. - - * config/djgpp/fnchange.lst: 8.3 proof i386obsd-nat.c and - i386obsd-tdep.c. Rename to "gdb.cxx", paths containing "gdb.c++". - -2002-11-08 Andrew Cagney - - * i386-linux-tdep.c: Include "reggroups.h". - (i386_linux_register_reggroup_p): New function. - (i386_linux_init_abi): Set register_reggroup_p to - i386_linux_register_reggroup_p. - * i386-tdep.h (i386_register_reggroup_p): Declare. - * i386-tdep.c: Include "reggroups.h". - (i386_init_reggroups): New function. - (i386_add_reggroups): New function. - (i386_register_reggroup_p): New function. - (i386_sse_reggroup, i386_mmx_reggroup): New variables. - (_initialize_i386_tdep): Call i386_init_reggroups. - (i386_gdbarch_init): Set register_reggroup_p and add in the i386 - specific reggroups. - -2002-11-09 Mark Kettenis - - * infptrace.c (child_xfer_memory): Make use of the new PT_IO - request that's available in *BSD. - - * i386-tdep.h (IS_FPU_CTRL_REGNUM): Remove. - - * i387-tdep.c (i387_fill_fxsave): Use FOOFF_REGNUM instead of - FDOFF_REGNUM. - -2002-11-08 Andrew Cagney - - * frame.c (set_unwind_by_pc): Use dummy_frame_register_unwind. - * dummy-frame.c (find_dummy_frame): Rename - generic_find_dummy_frame, make static. Return the dummy frame - instead of the regcache. - (generic_find_dummy_frame): Re-implement using find_dummy_frame, - (cached_find_dummy_frame): New function. Use find_dummy_frame. - (dummy_frame_register_unwind): Rename - generic_call_dummy_register_unwind. Use cached_find_dummy_frame. - * dummy-frame.h (dummy_frame_register_unwind): Rename - generic_call_dummy_register_unwind. - -2002-11-08 Mark Kettenis - - * config/i386/tm-i386v42mp.h: Remove file. Move its contents, - except the inclusion of "i386/tm-i386.h", to... - * config/i386/nm-i386v42mp.h: ...here. - * config/i386/i386v42mp.mt (TM_FILE): Set to tm-i386.h. - -2002-11-08 Andrew Cagney - - * Makefile.in (frame.o): Update dependencies. - * blockframe.c (current_frame, frame_obstack_alloc) - (frame_saved_regs_zalloc, get_current_frame) - (set_current_frame, create_new_frame) - (set_unwind_by_pc, get_next_frame) - (flush_cached_frames, reinit_frame_cache) - (frame_saved_regs_register_unwind) - (deprecated_generic_get_saved_register) - (get_prev_frame, get_frame_pc, get_frame_saved_regs) - (_initialize_blockframe): Move frame code from here... - * frame.c: ...to here. Include "gdb_obstack.h", "gdbcore.h", - "annotate.h" and "dummy-frame.h". - (_initialize_frame): New function. - -2002-11-08 Jim Blandy - - * dwarf2read.c (read_func_scope): Restore list_in_scope properly - when we finish a function a context. - * buildsym.h (outermost_context_p): New macro. - (Bug analyzed by David Edelsohn.) - -2002-11-08 Andrew Cagney - - * blockframe.c: Include "dummy-frame.h". - (struct dummy_frame, dummy_frame_stack) - (generic_find_dummy_frame, deprecated_generic_find_dummy_frame) - (generic_pc_in_call_dummy, deprecated_read_register_dummy) - (generic_push_dummy_frame, generic_save_dummy_frame_tos) - (generic_save_call_dummy_addr, generic_pop_current_frame) - (generic_pop_dummy_frame, generic_fix_call_dummy) - (generic_fix_call_dummy, generic_call_dummy_register_unwind): Move - dummy frame code from here... - * dummy-frame.c: ...to here. New file. - * dummy-frame.h: New file. - (generic_call_dummy_register_unwind): Declare. - (generic_find_dummy_frame): Declare. - * Makefile.in (SFILES): Add dummy-frame.c. - (dummy-frame.o): Specify dependencies. - (dummy_frame_h): Define. - (COMMON_OBS): Add dummy-frame.o. - (blockframe.o): Update dependencies. - -2002-11-08 Jim Blandy - - * dwarf2read.c (read_func_scope): Restore local_symbols and - param_symbols after we finish the function context. (Based on a - patch from David Edelsohn.) - -2002-11-08 David Carlton - - * linespec.c (symbol_found): New function. - (minsym_found): New function. - (decode_line_1): Separate out some code into separate functions. - -2002-11-08 Joel Brobecker - - * i386-tdep.c (i386_frameless_signal_p): Make non static for - the benefit of the interix target. - * i386-tdep.h (i386_frameless_signal_p): Declare. - -2002-11-08 Andrew Cagney - - * i386-tdep.h (i386_linux_orig_eax_regnum_p): Delete stray - declaration that snuck in from change below. - -2002-11-06 Andrew Cagney - - * i386-tdep.c (i386_mmx_regnum_p): Rename mmx_regnum_p. Update - all callers. - (i386_fp_regnum_p): New function. Use instead of FP_REGNUM_P. - (i386_fpc_regnum_p): New function. Use instead of FPC_REGNUM_P. - (i386_sse_regnum_p): New function. Use instead of SSE_REGNUM_P. - (i386_mxcsr_regnum_p): new function. Use instead of - MXCSR_REGNUM_P. - * i386-tdep.h (SSE_REGNUM_P): Delete macro. - (i386_sse_regnum_p): Declare. - (i386_mxcsr_regnum_p): Declare. - (FP_REGNUM_P, FPC_REGNUM_P): Delete macros. - (i386_fp_regnum_p, i386_fpc_regnum_p): Declare. - (IS_FP_REGNUM): Update definition. - (IS_FPU_CTRL_REGNUM): Update definition.. - (IS_SSE_REGNUM): Update definition.. - * i386v-nat.c (register_u_addr): Update. - * go32-nat.c (fetch_register): Update. - (store_register): Update. - -2002-11-07 Joel Brobecker - - Preparation work to convert the hppa targets to multiarch partial. - - * hppa-tdep.c: Add new functions replacing macro bodies from - config/pa/tm-hppa.h. These function will be used to initialize - the gdbarch structure. Import some comments from tm-hppa.h, - and place them where appropriate, to avoid loosing them when - we cleanup this file. - (hppa_reg_struct_has_addr): New function. - (hppa_inner_than): New function. - (hppa_stack_align): New function. - (hppa_pc_requires_run_before_use): New function. - (hppa_instruction_nullified): New function. - (hppa_register_byte): New function. - (hppa_register_virtual_type): New function. - (hppa_store_struct_return): New function. - (hppa_cannot_store_register): New function. - (hppa_frame_args_address): New function. - (hppa_frame_locals_address): New function. - (hppa_smash_text_address): New function. - (hppa_coerce_float_to_double): New function. Requires the inclusion - of "language.h". - - * Makefile.in (hppa-tdep.o): Add dependency on language.h. - - * tm-hppa.h (REG_STRUCT_HAS_ADDR): Change the definition of this - gdbarch-eligible macro to a call to the new associated function - created in hppa-tdep.c. - (INNER_THAN): Likewise. - (STACK_ALIGN): Likewise. - (PC_REQUIRES_RUN_BEFORE_USE): Likewise. - (INSTRUCTION_NULLIFIED): Likewise. - (REGISTER_BYTE): Likewise. - (REGISTER_VIRTUAL_TYPE): Likewise. - (STORE_STRUCT_RETURN): Likewise. - (CANNOT_STORE_REGISTER): Likewise. - (FRAME_ARGS_ADDRESS): Likewise. - (FRAME_LOCALS_ADDRESS): Likewise. - (SMASH_TEXT_ADDRESS): Likewise. - (COERCE_FLOAT_TO_DOUBLE): Likewise. - (ABOUT_TO_RETURN): Delete, as no longer used. - -2002-11-07 Fernando Nasser - - * printcmd.c (disassemble_command): Remove obsolete function. - (_initialize_printcmd): Do not create disassemble command here. - * cli/cli-cmds.c (disassemble_command): New function. Implements - disassemble command. - (init_cli_cmds): Create disassemble command here instead. - -2002-11-07 Andrew Cagney - - * MAINTAINERS: Add Daniel Jacobowitz to global maintainers list. - -2002-11-07 Andrew Cagney - - * regcache.h (regcache_cooked_read_using_offset_hack) - (regcache_cooked_write_using_offset_hack): Delete declarations. - (register_changed): Delete declaration. - * regcache.c (regcache_cooked_read_using_offset_hack) - (regcache_cooked_write_using_offset_hack): Delete functions. - (cooked_xfer_using_offset_hack): Delete function. - (register_changed): Delete function. - -2002-11-07 Jim Blandy - - * macroscope.c: #include "complaints.h". - (sal_macro_scope): Cope with filenames that appear in the symtabs, - but not in the macro table. - * Makefile.in (macroscope.o): Record dependency. - -2002-11-07 Joel Brobecker - - * PROBLEMS: Document gdb/816 (unable to read core file on alpha-osf). - -2002-11-07 Andrew Cagney - - * regcache.c (deprecated_registers_fetched): Update. - * regcache.h (deprecated_registers_fetched): Rename - registers_fetched. - * remote-vxsparc.c (vx_read_register): Update. - * remote-vxmips.c (vx_read_register): Update. - * remote-vx68.c (vx_read_register): Update. - * irix5-nat.c (fetch_core_registers): Update. - * mipsm3-nat.c (fetch_inferior_registers): Update. - * sun3-nat.c (fetch_inferior_registers): Update. - * symm-nat.c (fetch_inferior_registers): Update. - * ns32knbsd-nat.c (fetch_inferior_registers): Update. - (fetch_core_registers): Update. - (fetch_kcore_registers): Update. - * mips-nat.c (fetch_inferior_registers): Update. - * corelow.c (get_core_registers): Update. - * a68v-nat.c (fetch_inferior_registers): Update. - -2002-11-06 Joel Brobecker - - Put in place the framework necessary for multiarching the hppa targets. - * hppa-tdep.c (hppa_gdbarch_init): New function. - (hppa_dump_tdep): New function. - (_initialize_hppa_tdep): Register the hppa gdbarch init function and - tdep structure dumper. - * config/pa/tm-hppa.h (GDB_MULTI_ARCH): New macro, defined to 0 - until the multi-arching conversion has partially been completed. - -2002-11-06 Andrew Cagney - - * valops.c (value_assign): Merge lval_register case into - lval_reg_frame_relative. Use frame_register and - regcache_cooked_write instead of get_saved_register and - write_register_bytes. After flushing the register cache, try to - re-select the selected frame. - -2002-11-06 Andrew Cagney - - * regcache.h (deprecated_register_valid): Rename register_valid. - * regcache.c: Update. - * ia64-aix-nat.c: Update. - * i386gnu-nat.c: Update. - * alpha-nat.c: Update. - * sparc-nat.c: Update. - * lynx-nat.c: Update. - * remote-mips.c: Update. - -2002-11-06 Joel Brobecker - - * hppa-tdep.c (_initialize_hppa_tdep): Move function body - to end of file, to be more consistent with the pratice followed - by other targets. - -2002-11-06 Andrew Cagney - - * infcmd.c: Include "reggroups.h" and . - (print_float_info): Print registers in float_reggroup. - (print_vector_info): Print registers in vector_reggroup. - (default_print_registers_info): When all, print registers in - all_reggroup. Otherwize, print registers in general_reggroup. - (registers_info): Rewrite. Add support for register groups. - Eliminate a goto. - -2002-11-06 Elena Zannoni - - * symtab.c (methods_info): Delete. It has been ifdeffed out for - ages. - (symtab_symbol_info): Remove eons old ifdeffed out code. - (_initialize_symtab): Remove prehistoric disabled 'info methods' - command. - -2002-11-06 Theodore A. Roth - - * c-exp.y: Add missing semi-colons. - * f-exp.y: Add missing semi-colons. - * m2-exp.y: Add missing semi-colons. - * p-exp.y: Add missing semi-colons. - Add empty action to start rule to avoid a type clash error when - building with bison >= 1.50. - -2002-11-06 Jim Blandy - - * macrotab.h (struct macro_source_file): Doc fix. - -2002-11-05 Jeff Johnston - - * varobj.c (child_exists, cplus_number_of_children): Change - STREQ macro references to strcmp. - (cplus_name_of_child): Change code to handle the fact that - fields are not necessarily contiguous with regards to their - access control. This is a fix for PR gdb/792. - -2002-11-05 Andrew Cagney - - * gdbarch.sh (GET_SAVED_REGISTER): Change to a predicate function. - * gdbarch.h, gdbarch.c: Regnerate. - * frame.h (frame_register): Declare. - * frame.c (frame_register): New function. - (get_saved_register): Test GET_SAVED_REGISTER_P before calling - GET_SAVED_REGISTER, otherwize call - generic_unwind_get_saved_register. - (frame_register_read): Use frame_register instead of - get_saved_register. - -2002-11-05 Elena Zannoni - - From Jim Ingham : - * event-top.c (gdb_disable_readline): New function. - (_initialize_event_loop): Move comment. - -2002-11-05 Elena Zannoni - - * event-loop.c (start_event_loop): Add comment. - Update copyright. - -2002-11-05 Andrew Cagney - - * infcmd.c (default_print_registers_info): Do not call - PRINT_REGISTER_HOOK. - -2002-11-05 Andrew Cagney - - * sparc-tdep.c (sparc_print_register_hook): Make static. - (sparc_print_registers_info): New function. - (sparc_do_registers_info): New function. - (sparclet_print_registers_info): New function. - (sparclet_do_registers_info): New function. - (do_sparc_print_registers_info): New function. - (sparc_print_registers): New static function, clone of infcmd.c's - default_print_registers_info. - * config/sparc/tm-sparclet.h (PRINT_REGISTER_HOOK): Delete macro. - (sparclet_do_registers_info): Declare. - (DEPRECATED_DO_REGISTERS_INFO): Re-define. - * config/sparc/tm-sparc.h (DEPRECATED_DO_REGISTERS_INFO): - Re-define. - (sparc_do_registers_info): Declare. - (PRINT_REGISTER_HOOK): Delete macro. - (sparc_print_register_hook): Delete declaration. - -2002-11-05 David Carlton - - * symtab.c (lookup_symbol_aux): Move chunks of code into separate - functions. - (lookup_symbol_aux_local): New function. - (lookup_symbol_aux_symtabs): New function. - (lookup_symbol_aux_psymtabs): New function. - -2002-11-05 David Carlton - - * symtab.c (lookup_symbol_aux): In minsym sections, don't use the - previous values of 'objfile' and 'block'. - -2002-11-05 Pierre Muller - - * values.c (value_change_enclosing_type): Set - enclosing_type field correctly also for the case where - more memory needs to be allocated. - -2002-11-03 Mark Kettenis - - * i387-tdep.c (i387_print_float_info): Call fputs_filtered instead - of puts_filtered. - - * i387-tdep.c (i387_print_float_info): Replace calls to - register_read and deprecated_read_register_gen with calls to - frame_register_read, and make the necessary adjustments to the - surrounding code. - -2002-11-02 Andrew Cagney - - * gdbarch.sh (register_reggroup_p): Allow default value. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-11-02 Andrew Cagney - - * regcache.h: Add coment indicating replacements for deprecated - functions. - -2002-11-02 Andrew Cagney - - * reggroups.h, reggroups.c: New files. - * regcache.c: Include "reggroups.h". - (enum regcache_dump_what): Add `regcache_dump_groups'. - (regcache_dump): Contract size of the "Type" column. When - specified, dump the register's groups. - (maintenance_print_register_groups): New function. - (_initialize_regcache): Add command `maint print register-groups'. - * Makefile.in (COMMON_OBS): Add reggroups.o - (SFILES): Add reggroups.c. - (reggroups_h): Define. - (regcache.o, gdbarch.o): Update dependencies. - (reggroups.o): Specify dependencies. - * gdbarch.sh (register_reggroup_p): Add pure multi-arch method. - Add opaque declaration for `struct reggroup' in generated .h file. - Include "reggroups.h" in generated .c file. - gdbarch.h, gdbarch.c: Re-generate. - -2002-11-02 Andrew Cagney - - * regcache.h (deprecated_read_register_gen): Rename - read_register_gen. - (deprecated_write_register_gen): Rename write_register_gen. - * i387-tdep.c: Update. - * x86-64-linux-nat.c: Update - * wince.c: Update. - * thread-db.c: Update. - * win32-nat.c: Update. - * mips-tdep.c: Update. - * d10v-tdep.c: Update. - * cris-tdep.c: Update. - * remote-sim.c: Update. - * remote-rdi.c: Update. - * remote-rdp.c: Update. - * frame.c: Update. - * target.c: Update. - * blockframe.c: Update. - * x86-64-tdep.c: Update. - * xstormy16-tdep.c: Update. - * sh-tdep.c: Update. - * s390-tdep.c: Update. - * rs6000-tdep.c: Update. - * sparc-tdep.c: Update. - * i386-tdep.c: Update. - * dwarf2cfi.c: Update. - * regcache.c: Update. - -2002-11-01 Joel Brobecker - - New interix-specific files: - * config/i386/nm-interix.h: New file. - * config/i386/interix.mh: New file. - * config/i386/interix.mt: New file. - * i386-interix-nat.c: New file. - * i386-interix-tdep.c: New file. - -2002-11-01 Andrew Cagney - - * frame.h (deprecated_generic_get_saved_register): Rename - generic_get_saved_register. - * blockframe.c (deprecated_generic_get_saved_register): Update. - * xstormy16-tdep.c (xstormy16_get_saved_register): Update. - (xstormy16_frame_saved_register): Update. - * sh-tdep.c (sh_gdbarch_init): Update. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. - * ia64-tdep.c (ia64_get_saved_register): Update. - * cris-tdep.c (cris_gdbarch_init): Update. - * config/m32r/tm-m32r.h (GET_SAVED_REGISTER): Update. - * arm-tdep.c (arm_gdbarch_init): Update. - -2002-10-31 Daniel Jacobowitz - - * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step. - -2002-10-31 Daniel Jacobowitz - - * i386-linux-tdep.c (i386_linux_pc_in_sigtramp): Check for - trampolines in sigaction. - -2002-10-31 Andrew Cagney - - * h8300-tdep.c: Include "gdb_assert.h". - (h8300_print_register): Add gdbarch, file and frame parameters. - Use frame_read_unsigned_register to read the register's value. - Use fprintf_filtered to display output. - (h8300_print_registers_info): Replace h8300_do_registers_info. - (h8300_gdbarch_init): Set print_registers_info. - -2002-10-31 Andrew Cagney - - * frame.c (frame_read_unsigned_register): New function. - (frame_read_signed_register): New function. - * frame.h (frame_read_unsigned_register): Declare. - (frame_read_signed_register): Declare. - -2002-10-31 Andrew Cagney - - * h8500-tdep.c (h8500_print_registers_info): New static function, - clone of infcmd.c's default_print_registers_info. - (h8500_do_registers_info): New funtion. - (h8500_print_register_hook): Rename print_register_hook, make - static. - - * config/h8500/tm-h8500.h: Update copyright. - (DEPRECATED_DO_REGISTERS_INFO): Define. - (h8500_do_registers_info: Declare. - (PRINT_REGISTER_HOOK): Delete macro. - (print_register_hook): Delete function. - -2002-10-31 Andrew Cagney - - * z8k-tdep.c (z8k_print_register_hook): Make static. - (z8k_print_registers_info): New static function, clone of - infcmd.c's default_print_registers_info. - (z8k_do_registers_info): New function. Wrap - z8k_print_registers_info. - * config/z8k/tm-z8k.h: Update copyright. - (PRINT_REGISTER_HOOK): Delete macro. - (z8k_print_register_hook): Delete declaration. - (DEPRECATED_DO_REGISTERS_INFO): Define. - (z8k_do_registers_info): Declare. - -2002-10-30 Joel Brobecker - - * hppa-tdep.c (find_function_in_inferior): Remove this extern, - as this is already provided by value.h, and was actually causing - a compilation error because of a conflict in parameter type - declaration due to a missing const keyword. - (low_text_segment_addres): Fix a compilation warning. - -2002-10-29 Daniel Jacobowitz - - * mips-linux-nat.c (mips_linux_cannot_fetch_register): Don't fetch - registers without a name. - (mips_linux_cannot_store_register): Don't store registers without - a name. - -2002-10-28 David Carlton - - * symtab.c (find_addr_symbol): Delete. (It was already commented - out.) - * symtab.h: Delete prototype for find_addr_symbol. - -2002-10-26 Andrew Cagney - - * gdbarch.sh (DEPRECATED_DO_REGISTERS_INFO): Rename - DO_REGISTERS_INFO. - gdbarch.h, gdbarch.c: Re-generate. - * infcmd.c (default_print_registers_info): Update reference. - * mips-tdep.c (mips_gdbarch_init): Set deprecated_do_registers_info. - (mips_dump_tdep): Do not print DO_REGISTERS_INFO. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. - * h8300-tdep.c (h8300_gdbarch_init): Ditto. - -2002-10-26 Mark Kettenis - - * x86-64-tdep.c (x86_64_init_abi): Set init_extra_frame_info to - cfi_init_extra_frame_info. - * x86-64-tdep.h (x86_64_init_extra_frame_info): Remove prototype. - * x86-64-linux-tdep.c (x86_64_init_extra_frame_info): Remove function. - - * x86-64-tdep.c (x86_64_init_abi): Add calls to override the i386 - target where necessary. Add more comments and remove the ones - that don't provide any useful information. - - * i386-tdep.c (i386_frame_saved_pc): Replace call to - deprecated_read_register_dummy with - frame_unwind_unsigned_register. - - * i386-tdep.c (i386_extract_struct_value_address): Use - regcache_raw_read_unsigned instead of - regcache_cooked_read_unsigned since we know that the register - we're reading isn't a pseudo register. Rename variable 'val' into - the more descriptive 'addr'. - - * x86-64-tdep.c: Fix some formatting problems, mostly in comments. - (x86_64_push_return_address): Add comment. - (x86_64_pop_frame): Make static. - (examine_argument): Clarify comment. - (x86_64_skip_prologue): Make prolog_expact variable static. - - * dwarf2cfi.c: Fix some formatting problems. - (context_cpy, read_encoded_pointer): Clarify comments. - - * x86-64-tdep.c (x86_64_breakpoint_from_pc): Constify. - (x86_64_init_abi): Move set_gdbarch_* calls that overlap with the - i386 target back into x86_64_gdbarch_init. Add some comments and - remove meaningless ones. - -2002-10-25 Andrew Cagney - - * complaints.h (struct deprecated_complaint): Rename `struct - complaint'. - * complaints.c (complain): Update. - * remote-vx68.c, remote-vxmips.c, remote-vxsparc.c: Delete - incorrect comment indicating that "symfile.h" was being included - for the `struct complaint' definition. - * remote-vx.c: Update. - * objc-lang.c: Update. - * xcoffread.c: Update. - * hpread.c: Update. - * mdebugread.c: Update. - * stabsread.c: Update. - * dwarf2read.c: Update. - * dwarfread.c: Update. - * elfread.c: Update. - * coffread.c: Update. - * stabsread.h: Update. - * dbxread.c: Update. - * buildsym.c: Update. - * gdbtypes.c: Update. - * macrotab.c: Update. - -2002-10-25 Mark Kettenis - - * x86-64-tdep.c (x86_64_gdbarch_init): Make a bit more similar to - the version in i386-tdep.c. Move set_gdbarch_* calls out into... - (x86_64_init_abi): ...new function. - - * Makefile.in (i386v-nat.o): Add $(i386_tdep_h). - * i386v-nat.c: Include "i386-tdep.h". - -2002-10-25 Andrew Cagney - - * gdbtypes.c (address_space_name_to_int): Update. - (address_space_int_to_name): Update. - * gdbarch.sh (address_class_type_flags_to_name): Change to a pure - multi-arch predicate. - (address_class_name_to_type_flags): Ditto. - * gdbarch.h, gdbarch.c: Re-generate. - - * MAINTAINERS: Check all warnings when h8300hms and alpha-elf. - -2002-10-24 Martin M. Hunt - - * utils.c (string_to_core_addr): Revert patch from 11 Oct. - -2002-10-24 Elena Zannoni - - * symtab.h (INIT_SAL): Delete macro. - (init_sal): Export. - * symtab.c (init_sal): New function. - - * ada-lang.c (ada_finish_decode_line_1): Change INIT_SAL macro - to init_sal function call. - (find_sal_from_funcs_and_line): Ditto. - (all_sals_for_line): Ditto. - * breakpoint.c (create_internal_breakpoint): Ditto. - (create_fork_vfork_event_catchpoint): Ditto. - (create_exec_event_catchpoint): Ditto. - (parse_breakpoint_sals): Ditto. - (watch_command_1): Ditto. - (handle_gnu_4_16_catch_command): Ditto. - (clear_command): Ditto. - * hppa-tdep.c (child_enable_exception_callback): Ditto. - * infcmd.c (run_stack_dummy): Ditto. - * infrun.c (process_event_stop_test): Ditto. - (check_sigtramp2): Ditto. - (step_over_function): Ditto. - * linespec.c (decode_line_2): Ditto. - (decode_line_1): Ditto. - * source.c (line_info): Ditto. - * symtab.c (find_pc_sect_line): Ditto. - -2002-10-24 Michal Ludvig - - * dwarf2cfi.c (struct context) - (struct context_reg): Moved to dwarf2cfi.h - (context_alloc, frame_state_alloc, context_cpy): - Made extern instead of static, removed prototypes. - * dwarf2cfi.h (struct context) - (struct context_reg): New, moved from dwarf2cfi.c - (context_alloc, frame_state_alloc, context_cpy): - New prototypes. - * x86-64-linux-tdep.c (x86_64_linux_sigtramp_saved_pc): - Changed from static to extern. - (LINUX_SIGINFO_SIZE, LINUX_SIGCONTEXT_PC_OFFSET) - (LINUX_SIGCONTEXT_FP_OFFSET) - (LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Adjusted. - (x86_64_linux_in_sigtramp, x86_64_linux_frame_chain) - (x86_64_init_frame_pc, x86_64_init_extra_frame_info): New. - * x86-64-tdep.c (x86_64_gdbarch_init): Several - set_gdbarch_*() calls now use x86-64 specific functions - instead of DWARF2 CFI ones. - * x86-64-tdep.h (x86_64_linux_in_sigtramp) - (x86_64_linux_frame_chain, x86_64_init_frame_pc) - (x86_64_init_extra_frame_info): New prototypes. - -2002-10-23 David Carlton - - * linespec.c: #include "parser-defs.h". - Delete prototype for find_template_name_end. - * Makefile.in (linespec.o): Depend on $(parser_defs_h). - -2002-10-23 Jeff Johnston - - * NEWS: add recent mi fixes. - * varobj.c (struct varobj): Add new "updated" flag. - (new_variable): Default "updated" flag to 0. - (varobj_set_value): Set "updated" flag to 1 if value - changes. - (varobj_update): Check varobj "updated" flag before - comparing old and refreshed values. Fix for - PR gdb/702. - -2002-10-23 David Carlton - - * parse.c (parse_exp_1): Use BLOCK_START. - * x86-64-tdep.c (x86_64_skip_prologue): Use BLOCK_END, - SYMBOL_BLOCK_VALUE. - * objc-lang.c (find_methods): Use BLOCK_START, BLOCK_END. - -2002-10-23 David Carlton - - * symtab.c: Delete cplusplus_hint. - Delete prototype for find_template_name_end. - -2002-10-23 Elena Zannoni - - * symtab.h: Update comment. - -2002-10-23 Michael Snyder - - * printcmd.c (address_info): Restore quotes in output. - * valops.c (value_of_local): Restore quotes in error message. - -2002-10-23 Elena Zannoni - - * symtab.c (symbol_demangled_name): New function. - * symtab.h (SYMBOL_DEMANGLED_NAME): Simplify macro, by - turning most of it into a function. - (symbol_demangled_name): Export. - -2002-10-23 Michael Snyder - - * valops.c (value_of_local): Restore quotes in error message. - -2002-10-23 Elena Zannoni - - * symtab.c (symbol_init_language_specific): New function. - * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by - turning most of it into a function. - (symbol_init_language_specific): Export. - -2002-10-23 David Carlton - - * dwarf2read.c (dwarf_tag_name): Add DWARF 3 names. - (dwarf_attr_name): Ditto. - (dwarf_type_encoding_name): Ditto. - (scan_partial_symbols): Descend into DW_TAG_namespace entries. - (process_die): Handle DW_TAG_namespace, - DW_TAG_imported_declaration, DW_TAG_imported_module. - (read_namespace): New function. - -2002-10-22 Joel Brobecker - - * configure.in: Define NEW_PROC_API on Interix too. - * configure: Regenerate. - -2002-10-21 Joel Brobecker - - * configure: Regenerate using the proper version of autoconf. - -2002-10-21 Elena Zannoni - - * findvar.c (read_var_value): Temporarily disable TLS code, until - complete TLS support is added. - -2002-10-21 Jim Blandy - Elena Zannoni - - * symtab.h (address_class): Re-add LOC_THREAD_LOCAL_STATIC - for thread local storage locations. - (struct symbol): Add objfile field. - (SYMBOL_OBJFILE): Define. - * dwarf2read.c (is_thread_local): New static variable. - (new_symbol): If variable is in thread local fill in address class - and objfile appropriately. - (decode_locdesc): Recognize and handle DW_OP_GNU_push_tls_address - stack operation. - * printcmd.c (address_info): Print the information for thread - local storage variable. - * findvar.c (read_var_value): In case of thread local variable, - defer to the target vector code to compute address. - -2002-10-21 Elena Zannoni - - * solib-svr4.c (svr4_fetch_objfile_link_map): New function. - * solib-svr4.h (svr4_fetch_objfile_link_map): Export. - -2002-10-21 Elena Zannoni - - * symtab.h (address_class): Rename - LOC_THREAD_LOCAL_STATIC to LOC_HP_THREAD_LOCAL_STATIC. - * hpread.c (hpread_process_one_debug_symbol): Ditto. - * printcmd.c (address_info): Ditto. - * findvar.c (symbol_read_needs_frame, read_var_value): Ditto. - -2002-10-20 Mark Kettenis - - * i386bsd-nat.c (i386bsd_dr_set, i386bsd_dr_get_status): Use - DBREG_DRX macro to acces debug registers. - - * Makefile.in (i386obsd-tdep.o): New target. - - * solib-sunos.c: Include "bcache.h" and "regcache.h". - * Makefile.in (solib-sunos.o): Add $(bcache_h) and $(regcache_h). - - * configure.tgt (i[3456]86-*-openbsd*): Set gdb_target to obds. - * config/i386/obsd.mt: New file. - * i386bsd-nat.c (_initialize_i386bsd_nat): Introduce - i386obsd_sc_pc_offset and i386obsd_sc_sp_offset; - * i386obsd-nat.c (_initialize_i386obsd_nat): Set - i386obsd_sigtramp_start and i386obsd_sigtramp_end instead of - i386nbsd_sigtramp_start and i386nbsd_sigtramp_end. - * i386obsd-tdep.c: New file. - -2002-10-19 Adam Fedor - - * objc-exp.y (name_not_typename): Fix invalid comment. - -2002-10-20 Mark Kettenis - - * solib-sunos.c (allocate_rt_common_objfile): Use bcache_xmalloc - to allocate partial syms and macro byte caches. - -2002-10-18 David Carlton - - * symtab.h: Delete 'struct source' and 'struct sourcevector'. - -2002-10-18 Adam Fedor - - * stabsread.c (find_name_end): New function. - (define_symbol): Use it. - -2002-10-18 Daniel Jacobowitz - - * config/alpha/nm-fbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1. - * config/alpha/nm-linux.h (CANNOT_STEP_BREAKPOINT): Define to 1. - * config/alpha/nm-nbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1. - * config/alpha/nm-osf.h (CANNOT_STEP_BREAKPOINT): Define to 1. - -2002-10-17 David Carlton - - * symfile.h: Add opaque declaration for struct obstack. - Declare obsavestring to take a const char *. - * symfile.c (obsavestring): Make first argument a const char *. - -2002-10-16 Adam Fedor - - * breakpoint.c (parse_breakpoint_sals): Ignore ObjC method - names when matching breakpoints in current file. - -2002-10-16 Kevin Buettner - - * dwarf2read.c (dwarf2_invalid_pointer_size): New complaint. - (read_tag_pointer_type): Add address class support. - * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS) - (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME, ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): - New methods. - * gdbarch.h, gdbarch.c: Regenerate. - * gdbtypes.c (address_space_name_to_int, address_space_int_to_name) - (make_type_with_address_space, recursive_type_dump): Add address - class support. - * gdbtypes.h (TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2) - (TYPE_FLAG_ADDRESS_CLASS_ALL, TYPE_ADDRESS_CLASS_1) - (TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): New defines - -2002-10-16 Klee Dienes - - * stabsread.c (read_tilde_fields): Use name[sizeof(vptr_name)-2] - to get the last character of a char[] buffer, not - name[sizeof(vptr_name)-1]. - -2002-10-14 Adam Fedor - - * symtab.h: New objc_specific struct. - (SYMBOL_INIT_LANGUAGE_SPECIFIC): Handle ObjC. - (SYMBOL_DEMANGLED_NAME): Likewise. - -2002-10-14 Adam Fedor - - * symfile.c (init_filename_language_table): Add ObjC file extension. - -2002-10-14 Adam Fedor - - * utils.c (puts_filtered_tabular): New function. - (fprintf_symbol_filtered): Get ObjC demangled name. - * defs.h (puts_filtered_tabular): Declared. - -2002-10-14 Kevin Buettner - - * c-lang.h (c_type_print_varspec_prefix): Delete. - * c-typeprint.c (c_type_print_varspec_prefix): Make static. Add - ``need_post_space'' parameter. Adjust all callers. - -2002-10-14 Daniel Jacobowitz - - * config/mips/nm-irix4.h (HAVE_NONSTEPPABLE_WATCHPOINT): Define to 1. - * config/mips/nm-irix5.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. - * config/mips/tm-embed.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. - * config/pa/nm-hppah.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. - -2002-10-13 Adam Fedor - - * source.c (print_source_lines): Update comments. - -2002-10-13 Adam Fedor - - * valops.c (value_of_local): New function. - (value_of_this): Use it. - * value.h (value_of_local): Declared. - -2002-10-13 Adam Fedor - - * parse.c: (length_of_subexp, prefixify_subexp): Handle - OP_MSGCALL, OP_SELECTOR, OP_NSSTRING, and OP_SELF. - -2002-10-12 Adam Fedor - - * language.c (binop_result_type): Add language_objc to case. - (integral_type): Likewise. - (character_type): Likewise. - (string_type): Likewise. - (boolean_type): Likewise. - (structured_type): Likewise. - (binop_type_check): Likewise. - -2002-10-11 Adam Fedor - - * printcmd.c (address_info): Print 'self' for ObjC. - -2002-10-11 Adam Fedor - - * expression.h: New ops OP_NSSTRING, OP_SELECTOR, OP_MSGCALL, and - OP_SELF. - -2002-10-11 Adam Fedor - - * language.h (CAST_IS_CONVERSION): Add language_objc. - -2002-10-11 Adam Fedor - - * defs.h (enum language): Add language_objc. - -2002-10-11 Klee Dienes - - * corefile.c (read_memory_typed_address): New function. - * gdbcore.h (read_memory_typed_address): Add prototype. - * blockframe.c (sigtramp_saved_pc): Use read_memory_typed_address - to read a value destined for a CORE_ADDR, not read_memory_integer. - * f-valprint.c (f77_get_dynamic_upperbound): Ditto. - (f77_get_dynamic_lowerbound): Ditto. - -2002-10-11 Martin M. Hunt - - * utils.c (string_to_core_addr): After turning string into - a number, convert to a CORE_ADDR using INTEGER_TO_ADDRESS - which will do necessary sign-extension, etc. - -2002-10-11 Daniel Jacobowitz - - * c-exp.y (THIS): Delete token and grammar rule. - (yylex): Don't return THIS. - * cp-valprint.c (vtbl_ptr_name_old): Delete. - (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old. - * demangle.c (cplus_markers): Update comment. Put '$' - first. Remove CPLUS_MARKER. - (_initialize_demangler): Don't call set_cplus_marker_for_demangling. - * jv-exp.y (THIS): Delete token and grammar rule. - (yylex): Don't return THIS. - * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER. - * objc-exp.y (THIS): Delete token and grammar rule. - (yylex): Don't return THIS. - * p-exp.y (yylex): Remove reference to CPLUS_MARKER. - * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'. - (read_member_functions): Likewise for opname. - (read_tilde_fields): Use is_cplus_marker. - - * defs.h (CPLUS_MARKER): Don't define. - * config/tm-sysv4.h (CPLUS_MARKER): Likewise. - * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise. - * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise. - * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise. - * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise. - - * config/i386/tm-i386v4.h: Delete file. - * config/djgpp/fnchange.lst: Delete tm-i386v4.h. - * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead. - * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead. - * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead. - * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h. - * config/i386/i386sco5.mt (TM_FILE): Likewise. - * config/i386/i386v4.mt (TM_FILE): Likewise. - * config/i386/ncr3000.mt (TM_FILE): Likewise. - -2002-10-10 Marko Mlinar - - * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C, - accidentially not commited 2002-10-09 - * gdbarch.h, gdbarch.c: Re-generate. - -2002-10-09 Marko Mlinar - - * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C. - * gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Add. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-10-08 Petr Sorfa - - Revised and re-submitted by John Wolfe - - Move the Dwarf 2 abbrev table to a per-compilation-unit structure, - so we can work on more than one compilation unit at a time. This - helps prepare GDB to handle inter-CU die references. - * dwarf2read.c (ABBREV_HASH_SIZE): moved definition forward in - the code to be defined before struct comp_unit_head. - (comp_unit_head): Added new members - offset, cu_head, - begin_die, next and dwarf2_abbrevs. - (dwarf2_abbrevs): Removed single static var; now member of - struct comp_unit_head. - dwarf2_build_psymtabs_hard): Complete new struct comp_unit_head - members. - (psymtab_to_symtab_1): Changed to work with the new - struct comp_unit_head. - (dwarf2_read_abbrevs): Now accepts a cu_header parameter and - constructs the dwarf2_abbrevs[] inside the cu_header. - (dwarf2_empty_abbrev_table): Now expects a ptr to a - dwarf2_abbrev table to clean up. - (dwarf2_lookup_abbrev): Now accepts a cu_header parameter and - handling of dwarf2_abbrevs inside the cu_header. - (read_partial_die): Now supports the call to the new - dwarf2_lookup_abbrev. - (read_full_die): Now supports the call to the new - dwarf2_lookup_abbrev. - -2002-10-06 Christopher Faylor - - * Makefile.in (install-gdbtk): Add missing continuation backslash to - insure that shell variables, such as "transformed_name" are propagated - to later shell statements in rule. - -2002-10-06 Mark Kettenis - - * config/i386/nm-i386sco.h: Add protection against - multiple-inclusion. Include "i386/nm-i386v.h". - (REGISTER_U_ADDR): Remove define. - (i386_register_u_addr): Remove prototype. - -2002-10-04 Michael Snyder - - * m32r-stub.c (handle_exception): Make sure exception is "trap" - before treating it as a single-step event. - -2002-10-03 Adam Fedor - - * objc-lang.c: ARI fixes. Change string.h to gdb_string.h. - (objc_demangle): Remove assignment in if statements, Replace - free with xfree. - (add_msglist): Likewise. - (end_msglist): Likewise. - (complare_selectors): Likewise. - (selectors_info): Likewise. - (compare_classes): Likewise. - (classes_info): Likewise. - (print_object_command): Likewise. - (find_objc_msgcall_submethod): Replace PTR with void *. - * objc-lang.h: Remove check for __STDC__. - -2002-10-03 Jeff Johnston - - * ui-out.h (ui_out_field_fmt_int): New prototype. - * ui-out.c (ui_out_field_fmt_int): New function allowing specification - of field width and alignment. - * stack.c (print_frame_info_base): When printing frame level, use - ui_out_field_fmt_int with a width of 2 and left alignment. Fix for - PR gdb/192 - -2002-10-03 Jeff Johnston - - * MAINTAINERS: Add self to Write After Approval list. - -2002-10-02 Elena Zannoni - - * infcmd.c (interrupt_target_command_wrapper): Delete. - (interrupt_target_command): Make non static. - (nofp_registers_info): Make static. - * stack.c (return_command_wrapper): Delete. - (return_command): Make non static. - -2002-10-02 Elena Zannoni - - * event-top.c (gdb_setup_readline): New function. Code moved from - _initialize_event_loop(). - (_initialize_event_loop): Call gdb_setup_readline(). - -2002-10-02 Andrew Cagney - - * infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C. - * gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-10-02 Daniel Jacobowitz - - Fix PR gdb/778 - * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef - before recursing. - * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value - of fill_in_vptr_fieldno. - -2002-10-02 Elena Zannoni - - * inferior.h (registers_info, stepi_command, nexti_command, - continue_command, interrupt_target_command): Export from infcmd.c. - * frame.h (args_info, selected_frame_level_changed_hook, - return_command): Export from stack.c. - * v850ice.c (stepi_command, nexti_command, continue_command): use - prototypes from inferior.h. - * tracepoint.c (registers_info, args_info, locals_info): Use - prototypes from frame.h and inferior.h. - * Makefile.in (mi-main.o): Add dependency on frame.h. - -2002-10-02 Andrew Cagney - - * rs6000-tdep.c (rs6000_store_struct_return): Store struct_return - value in register 3 adjusted by ppc_gp0_regnum. - - * rs6000-tdep.c (skip_prologue): Bias alloca_reg by ppc_gp0_regnum. - -2002-10-02 Marko Mlinar - - * MAINTAINERS: Add myself to the Write After Approval list. - -2002-10-01 Alexandre Oliva - - * mips-tdep.c (mips_find_abi_section): .mdebug.abi64 is the name - of the section for the N64 ABI, fixed. - - * config/mips/tm-irix6.h: Include solib.h. - -2002-10-01 Elena Zannoni - - * dwarf2read.c (dwarf_stack_op_name): Recognize more dwarf3 and - GNU operators. - -2002-10-01 Andrew Cagney - - * NEWS: Mention that MI syntax, selected by "mi" changed to "mi2" - and that "mi0" syntax has been removed. - -2002-09-30 David Carlton - - * Makefile.in (ppc-sysv-tdep.o): Depend on gdb_string_h. - * ppc-sysv-tdep.c: #include "gdb_string.h". - * remote-sds.c (getmessage): Add semicolon after 'retry' label to - pacify GCC. - -2002-10-01 Andrew Cagney - - * rs6000-tdep.c (rs6000_gdbarch_init): For powerpc:7400, fix - "vrsave"'s register number. - -2002-09-30 Andrew Cagney - - * mips-tdep.c (mips_frame_saved_pc): When a generic dummy frame, - use frame_unwind_signed_register to obtain the PC. - (mips_frame_chain): Handle a generic dummy frame. - (mips_init_extra_frame_info): When a generic dummy frame, don't - re-compute the frame base. - (mips_pop_frame): Handle generic dummy frames. - (mips_gdbarch_init): When generic dummy frames, set - use_generic_dummy_frames, push_dummy_frame to - generic_push_dummy_frame, pc_in_call_dummy to - generic_pc_in_call_dummy, and save_dummy_frame_top_of_stack to - generic_save_dummy_frame_tos. - -2002-09-30 Andrew Cagney - - * blockframe.c (generic_find_dummy_frame): Rewrite. Only test - against TOP when TOP was explictly set. - (generic_push_dummy_frame): Set TOP to zero. - -2002-09-30 Elena Zannoni - - * event-loop.c (start_event_loop): Rename variable 'result' to - 'gdb_result', to avoid conflicts with upcoming intepreters changes. - -2002-09-30 Keith Seitz - - * gdb-events.sh (selected_thread_changed): New event. - * gdb-events.c: Regenerated. - * gdb-events.h: Regenerated. - -2002-09-30 Hans-Peter Nilsson - - * MAINTAINERS: Add self to Write After Approval list. - -2002-09-30 Fernando Nasser - - * disasm.c: New file. - * disasm.h: New file. - * mi/mi-cmd-disas.c (gdb_dis_asm_read_memory): Moved to disasm.c. - (compare_lines): Ditto. - (dump_insns): Ditto. - (do_mixed_source_and_assembly): Moved to disasm.c. Added uiout - argument. - (do_assembly_only): Ditto. - (do_disassembly): Renamed to gdb_disassembly and moved to - disasm.c. Sdded uiout argument. - * Makefile.in: Add new files. Reorder SFILES list. Update - dependencies. Include libgdb.a later in the insight executable. - -2002-09-29 Andrew Cagney - - * config/djgpp/fnchange.lst: Rename bfd/elf64-alpha.c and - bfd/elf64-alpha-fbsd.c. - -2002-09-29 Andrew Cagney - - * config/djgpp/fnchange.lst: Rename i386gnu-nat.c and - i386gnu-tdep.c. - -2002-09-29 Andrew Cagney - - * gnu-nat.h (debug): Use __FILE__ and __LINE__ instead of - __FUNCTION__. - * gnu-nat.c (do_mach_notify_no_senders): Replace __FUNCTION__ with - function name. - (do_mach_notify_port_deleted, do_mach_notify_msg_accepted): Ditto. - (do_mach_notify_port_destroyed, do_mach_notify_send_once): Ditto. - (S_proc_setmsgport_reply, S_proc_getmsgport_reply): Ditto. - (S_msg_sig_post_reply): Ditto. - -2002-09-28 Corinna Vinschen - - * sh-tdep.c (sh_use_struct_convention): Use definition according - to ABI. - (sh_push_arguments): Store in register with correct endianess. - (sh_default_store_return_value): Ditto. - (sh_gdbarch_init): Set sizeof long double to 8. - -2002-09-27 Mark Kettenis - - * defs.h: Move inclusion of "ansidecl.h" before "gdb_locale.h". - Fix some whitespace problems. - -2002-09-27 David Carlton - - * Makefile.in (cris-tdep.o): Depend on gdb_string_h. - (mcore-tdep.o): Ditto. - (ns32k-tdep.o): Ditto. - (ns32knbsd-tdep.o): Ditto. - (sh3-rom.o): Ditto. - (vax-tdep.o): Ditto. - * cris-tdep.c: #include "gdb_string.h" - * mcore-tdep.c: Ditto. - * ns32k-tdep.c: Ditto. - * ns32knbsd-tdep.c: Ditto. - * sh3-rom.c: Ditto. - * vax-tdep.c: Ditto. - -2002-09-27 David Carlton - - * config/djgpp/fnchange.lst: Add entries for - gdb/testsuite/gdb.c++/m-static files. - -2002-09-27 Jim Wilson - - * MAINTAINERS: Add myself to the Write After Approval list. - -2002-09-26 Martin M. Hunt - - * mips-tdep.c (find_proc_desc): Initialize startaddr. - - -2002-09-26 Andrew Cagney - - * rs6000-tdep.c (rs6000_frame_chain): Don't chain past the dummy - frame. - -2002-09-26 Andrew Cagney - - * rs6000-tdep.c (rs6000_extract_struct_value_address): Return 0. - (rs6000_struct_return_address): Delete variable. - (rs6000_store_struct_return): Update. - (rs6000_gdbarch_init): Set extract_struct_value_address instead of - deprecated_extract_struct_value_address. - (rs6000_frame_align): New function. - (rs6000_gdbarch_init): Set frame_align. - -2002-09-26 Andrew Cagney - - From Grace Sainsbury : - * Makefile.in (gdbtk-main.o): New target. - (gdb.o): New target. - (main_h): Define. - (main.o): Update dependencies. - (gdb$(EXEEXT)): Add gdb.o. - (SUBDIR_GDBTK_SRCS): Add gdbtk-main.c. - (SUBDIR_GDBTK_ALL, SUBDIR_GDBTK_UNINSTALL): Set. - (SUBDIR_GDBTK_CLEAN): Set. - (install-gdbtk): Install the insight binary. - (uninstall-gdbtk): New target. - (all-gdbtk, clean-gdbtk): New rule. - * top.c (use_windows): Default to zero. - * main.c: Include "main.h". - (main): Delete. - (struct captured_main_args): Delete. - (gdb_main): New function. - * main.h: New file. - * gdb.c: New File. - -2002-09-25 Andrew Cagney - - * frame.c: Include "gdb_string.h" and "builtin-regs.h". - (frame_map_regnum_to_name): New function. - (frame_map_name_to_regnum): New function. - * frame.h (frame_map_name_to_regnum): Declare. - (frame_map_regnum_to_name): Declare. - * builtin-regs.c (builtin_reg_map_regnum_to_name): New function. - * builtin-regs.h (builtin_reg_map_regnum_to_name): Declare. - * parse.c: Do not include "builtin-regs.h". - (target_map_name_to_register): Delete function. - (write_dollar_variable): Use frame_map_name_to_regnum. - * parser-defs.h (target_map_name_to_register): Delete declaration. - * expprint.c: Include "frame.h". - (print_subexp): Use frame_map_regnum_to_name. - * eval.c (evaluate_subexp_standard): Use frame_map_regnum_to_name. - * infcmd.c (registers_info): Use frame_map_name_to_regnum. - -2002-09-25 Andrew Cagney - - * rs6000-tdep.c (rs6000_frame_saved_pc): If the link register - wasn't saved, and the next innermost frame is a dummy, return the - dummy frame's link register. - -2002-09-24 Jim Blandy - - Fix from Paul Breed: - * main.c (captured_main): Add a `break' after the case for 'b'. - -2002-09-24 Keith Seitz - - * varobj.c (c_type_of_child): Use get_target_type instead - of TYPE_TARGET_TYPE. - -2002-09-22 Fernando Nasser - - * source.c (get_current_or_default_source_symtab_and_line): Remove - function. - (set_default_source_symtab_and_line): New function. Attempts to - determine a source file to list lines from if one is not currently - defined. - (get_current_source_symtab_and_line): Initialize sal.pc and - sal.end fields. - (set_current_source_symtab_and_line): Mark argument as const. - * source.h: Update declarations and comments. - * linespec.c (decode_line_1): Replace call to removed routine above. - * stack.c (print_frame_info_base): Ditto. - * cli/cli-cmds.c (edit_command): Ditto. - (list_command): Ditto. - -2002-09-22 Fernando Nasser - - * source.c (get_current_or_default_source_symtab_and_line): Initialize - sal.pc and sal.end fields. - (get_current_or_default_source_symtab_and_line): Ditto. - * breakpoint.c (parse_breakpoint_sals): Use correct accessor function - so we do not cause a new source symtab to be searched for (reverting an - unintentional change from the 2002-09-20 patch). - * scm-lang.c (scm_unpac): Ditto. - -2002-09-21 Andrew Cagney - - * complaints.c (symfile_explanations): Remove new-line from - ``isolated_message''. - (vcomplaint): When ISOLATED_MESSAGE, force a line break. - (clear_complaints): When a SUBSEQUENT_MESSAGE, force a line break. - -2002-09-20 Nick Clifton - - * NEWS: Announce that V850EA ISA is no longer supported. - * v850-tdep.c: Remove reference to bfd_mach_v850ea. - -2002-09-20 David Carlton - - * Makefile.in (c-lang.o): Correct dependencies. - (utils.o): Gather dependencies. - (charset.o): Move. - * c-lang.c: #include "gdb_string.h" - -2002-09-20 Fernando Nasser - - From 2002-07-02 George Helffrich - * cli/cli-cmds.c (list_command): New function. Implements the new - cli edit command. - (_init_cli_cmds): Add new command definition. - * gdb.1: Document edit command. - * doc/gdb.texinfo: Document edit command. - -2002-09-20 Fernando Nasser - - * source.c: Make global variables current_source_symtab and - current_source_line static. - (list_command): Moved to cli/cli-cmds.c. - (ambiguous_line_spec): Moved to cli/cli-cmds.c. - (get_first_line_listed): New accessor function. - (get_lines_to_list): New accessor function. - (get_current_source_symtab_and_line): New function. Retrieves the - position in the source code that we consider current. - (get_current_or_default_source_symtab_and_line): New function. - Like the above but attempts to determine a default position if one - is not currently defined. - (set_current_source_symtab_and_line): New function. Sets the source - code position considered current and returns the previously set one. - (clear_current_source_symtab_and_line): Reset stored information about - a current source line. - (_initialize_source): Remove registration for the "list" command and - its alias. - * source.h: Add declarations for the new functions above. - * symtab.h: Remove declarations for the global variables mentioned - above. - * breakpoint.c (parse_breakpoint_sals): Use accessor functions to - obtain current source line. - * linespec.c (decode_line_1): Ditto. - * macroscope.c (default_macro_scope): Ditto. - * scm-lang.c (scm_unpac): Ditto. - * stack.c (print_frame_info_base): Ditto. - * symfile.c (clear_symtab_users): Ditto. - * symtab.c (decode_line_spec): Ditto. - * cli/cli-cmds.c (list_command): Moved here from source.c. - (ambiguous_line_spec): Moved here from source.c. - (_init_cli_cmds): Add definition for "list" and its alias. - * Makefile.in: Update dependencies. - -2002-09-20 Corinna Vinschen - - * h8300-tdep.c (h8300_examine_prologue): Match saved regs location - with what gcc thinks is correct. - -2002-09-20 Corinna Vinschen - - * h8300-tdep.c (h8300_examine_prologue): Fix loop for saved regs in - multiple register push instruction. - -2002-09-19 Jim Blandy - - Add support for distinct host and target character sets. - * charset.c, charset.h: New files. - * c-exp.y: #include "charset.h". - (yylex): Convert character and string literals to the target - character set, before returning them as the semantic value of the - token. - * c-lang.c: #include "charset.h". - (c_emit_char): Use charset-specific methods to recognize - characters with backslash escape forms, to decide which characters - to print literally and which to print using numeric escape - sequences, and to convert target characters to host characters - before printing. - * utils.c: #include "charset.h". - (no_control_char_error): New function. - (parse_escape): Use charset-specific methods to recognize - backslash escapes, parse `control character' notation, and convert - characters from the host character set to the target character set. - * configure.in: Set the default host character set. - Check where to find iconv, and what its argument types might be. - * acinclude.m4 (AM_ICONV): New macro, borrowed from GCC. - * Makefile.in (SFILES): List charset.c. - (COMMON_OBS): List charset.o. - (charset.o): New rule. - (charset_h): New header dependency variable. - (c-lang.o, utils.o, c-exp.tab.o): Note dependency on $(charset_h). - (LIBICONV): New variable, set by configure. - (CLIBS): Include $(LIBICONV) here. - * aclocal.m4, config.in, configure: Regenerated. - -2002-09-19 Joel Brobecker - - * ada-exp.y: Add missing semicolons to end rules. Fixes a - bison 1.35 warning. - -2002-09-19 Richard Earnshaw - - * gdb_mbuild.sh: New file. - -2002-09-19 Andrew Cagney - - * objc-exp.y, objc-lang.h, objc-lang.c: Fix copyright notice. - -2002-09-18 Andrew Cagney - - * breakpoint.c, c-exp.y, defs.h, elfread.c, expression.h, - jv-exp.y, language.c, language.h, p-exp.y, parse.c, parser-defs.h, - printcmd.c, source.c, stabsread.c, symfile.c, symtab.h, utils.c, - valops.c, value.h: Revert previous change. - -2002-09-18 Michael Snyder - - Preliminary support for Objective-C: - * defs.h (language_objc): New enum value. - (puts_filtered_tabular): Declaration only, exported from utils.c. - (skip_quoted): Delete, declared in completer.h. - * c-exp.y: Include completer.h. - * p-exp.y: Ditto. - * jv-exp.y: Ditto. - * expression.h (OP_MSGCALL, OP_SELECTOR, OP_SELF, OP_NSSTRING): - New operator enum values. - * language.h (CAST_IS_CONVERSION): Test for language_objc. - * language.c (binop_result_type): Handle language_objc case. - (integral_type, character_type, string_type, boolean_type, - structured_type, binop_type_check): Ditto. - * symtab.h (SYMBOL_OBJC_DEMANGLED_NAME): Define. - (struct objc_specific): Add to general_symbol_info. - (SYMBOL_INIT_LANGUAGE_SPECIFIC): Add objc initialization. - (SYMBOL_DEMANGLED_NAME): Handle objc case. - * parser-defs.h (struct objc_class_str): New struct type. - (start_msglist, end_msglist, add_msglist): Declaration only, - exported from objc-lang.c. - * value.h (value_of_local, value_nsstring, - call_function_by_hand_expecting_type): Exported from valops.c. - * valops.c (find_function_addr): Export. - (call_function_by_hand_expecting_type): New function. - (value_of_local): New function. - * symfile.c (init_filename_language_table): Add ".m" extension - for Objective-C. - * utils.c (puts_filtered_tabular): New function. - (fprintf_symbol_filtered): Add objc demangling support (disabled). - (set/show demangle): Extend help-string to refer to ObjC. - * elfread.c (elf_symtab_read): Skip Objective-C special symbols. - * stabsread.c (symbol_reference_defined): Objective-C symbols - may contain colons: make allowances when scanning stabs strings - for colons. - (objc_find_colon): New function. - * printcmd.c (address_info): If language == objc then print - "self" instead of "this". - * parse.c (length_of_subexp): Handle new operators OP_MSGCALL, - OP_NSSTRING, and OP_SELF. - (prefixify_subexp): Ditto. - * source.c (print_source_lines): Mention objc in comment. - * breakpoint.c (parse_breakpoint_sals): Recognize Objective-C - method names. - -2002-09-18 Andrew Cagney - - * complaints.h: Update copyright. - (struct complaints): Declare. - (struct complaint): Make `message' constant. - (internal_complaint): Declare. - (complaint): Declare. - (complaint_root): Delete declaration. - (symfile_complaints): Delete declaration. - (struct complaints): Add opaque declaration. - (clear_complaints): Add a complaints parameter. - * complaints.c: Update copyright. - (enum complaint_series): Define. - (complaint_root): Delete. - (struct complaints): Define. - (complaint_sentinel, symfile_complaint_book): New variables. - (symfile_explanations, symfile_complaints): New variables. - New variables. - (get_complaints): New function. - (vcomplaint): New function. - (complaint): New function. - (internal_complaint): New function. - (complain): Call vcomplain with symfile_complaint. - (clear_complaints): Rewrite. - (_initialize_complaints): Use add_setshow_command. - * Makefile.in (complaints.o): Update dependencies. - * symfile.c (syms_from_objfile): Add symfile_complaints parameter - to call to clear_complaints. - (new_symfile_objfile, reread_symbols): Ditto. - (oldsyms_complaint): Delete. - (empty_symtab_complaint, unknown_option_complaint): Delete. - (free_named_symtabs): Use complaint instead of complain. - -2002-09-18 Michael Snyder - - Contributed by Apple Computer, Inc. Merged with current sources - by Adam Fedor [cagney]. - - * objc-lang.c: First clean-up round: comments, indentation. - * objc-lang.h: Ditto. - * objc-lang.y: Ditto. - -2002-09-18 Andrew Cagney - - * maint.c (maintenance_internal_error): Print the parameter as the - error message. - (maintenance_internal_warning): New function. - (_initialize_maint_cmds): Add command `maint internal-warning'. - - * defs.h (internal_warning, internal_vwarning): Declare. - * utils.c (struct internal_problem): Define. - (internal_vproblem): New function. - (internal_warning): New function. - (internal_vwarning): New function. - (internal_warning_problem, internal_error_problem): New variables. - (internal_verror): Just call internal_vproblem. - -2002-09-18 Michael Snyder - - * objc-lang.c: New file, support for Objective-C. - Preliminary check-in, not yet integrated into gdb. - * objc-lang.h: New file. - * objc-exp.y: New file. - -2002-09-18 Andrew Cagney - - * infrun.c (signal_stop_update): Convert definition to ISO C. - (signal_print_update): Ditto. - (signal_pass_update): Ditto. - * inflow.c (terminal_save_ours): Ditto. - - * h8300-tdep.c (h8300_gdbarch_init): Use C instead of C++ - comments. - - * config/djgpp/fnchange.lst: Handle name clashes between - bfd/coff-tic30.c, bfd/coff-tic4x.c, bfd/coff-tic54x.c and - bfd/coff-tic80.c. - - * i386-linux-tdep.h: Fix tipo. - -2002-09-18 Adam Fedor - - * MAINTAINERS: Add myself to the Write After Approval list. - -2002-09-18 Jim Blandy - - * dbxread.c, mdebugread.c: Revert my change of 2001-10-23. Moving - texthigh and textlow to reader-specific structs caused - objfile_relocate to miss them. This is fixable, but the work that - the change was supposed to prepare GDB for never got done anyway. - -2002-09-18 David Carlton - - * MAINTAINERS: Alphabetize Write After Approval list. - -2002-09-18 Daniel Jacobowitz - - Fix PR gdb/709 - * values.c (value_static_field): Call read_var_value. - -2002-09-18 Andrew Cagney - - * valops.c (hand_function_call): Align the initial stack pointer - and STRUCT_ADDR using frame_align. When STRUCT_RETURN and - FRAME_ALIGN_P, use STRUCT_ADDR to obtain the called function's - return value. - * mips-tdep.c (mips_frame_align): New function. - (mips_gdbarch_init): Set frame_align. - * gdbarch.sh (FRAME_ALIGN): New method. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-09-18 Michal Ludvig - - * x86-64-linux-nat.c (x86_64_regmap): Added CS and SS - registers. - -2002-09-17 Andrew Cagney - - * NEWS: Mention that MIPS $fp behavior changed. - * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register): Delete - reference to FP_REGNUM. - (mipsnbsd_cannot_store_register): Ditto. - * mips-linux-nat.c: Update copyright. - (mips_linux_cannot_fetch_register): Delete reference to FP_REGNUM. - (mips_linux_cannot_store_register): Ditto. - * mips-linux-tdep.c (supply_gregset): Ditto. Update copyright. - * config/mips/tm-mips.h: Update copyright. - (FP_REGNUM): Delete macro. - (MIPS_REGISTER_NAMES): Replace "fp" with "". - * config/mips/tm-irix6.h (FP_REGNUM): Delete macro. - * mips-tdep.c (mips_gdbarch_init): Set read_fp to mips_read_sp. - (mips_r3041_reg_names, mips_r3051_reg_names) - (mips_r3081_reg_names): Replace "fp" with "". - Fix PR gdb/480. - -2002-09-17 Theodore A. Roth - - * gdb/avr-tdep.c(avr_scan_prologue): Fix bad call to - generic_read_register_dummy() (PR gdb/703). - (avr_push_return_address): #if 0 out unused vars. - (avr_gdbarch_init): Enable use of avr_push_return_address(). - -2002-09-17 Michael Snyder - - * m32r-stub.c (restore_and_return): Postpone restoring of PSW. - RTE will take care of it. - -2002-09-17 Andrew Cagney - - * arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is - invalid, return SP_REGNUM. - -2002-09-17 Michael Snyder - - * mips-tdep.c (mips_pop_frame): Read saved values of floating - point registers without sign extension. - -2002-09-17 Andrew Cagney - - * blockframe.c (deprecated_read_register_dummy): Rename - generic_read_register_dummy. - * frame.c (frame_unwind_signed_register): New function. - (frame_unwind_unsigned_register): New function. - * frame.h (frame_unwind_signed_register): Declare. - (frame_unwind_unsigned_register): Declare. - (deprecated_read_register_dummy): Rename - generic_read_register_dummy. - - * h8300-tdep.c (h8300_frame_chain): Update. - (h8300_frame_saved_pc): Update. - * xstormy16-tdep.c (xstormy16_frame_saved_pc): Update. - * rs6000-tdep.c (rs6000_frame_saved_pc): Update. - * s390-tdep.c (s390_frame_saved_pc_nofix): Update. - (s390_frame_chain): Update. - * v850-tdep.c (v850_find_callers_reg): Update. - (v850_frame_saved_pc): Update. - * m32r-tdep.c (m32r_init_extra_frame_info): Update. - (m32r_find_callers_reg): Update. - (m32r_frame_saved_pc): Update. - * sh-tdep.c (sh_find_callers_reg): Update. - (sh64_get_saved_pr): Update. - (sh_init_extra_frame_info): Update. - (sh_init_extra_frame_info): Update. - (sh64_init_extra_frame_info): Update. - (sh64_init_extra_frame_info): Update. - * mcore-tdep.c (mcore_find_callers_reg): Update. - (mcore_frame_saved_pc): Update. - (mcore_init_extra_frame_info): Update. - * i386-tdep.c (i386_frame_saved_pc): Update. - * ia64-tdep.c (ia64_frame_saved_pc): Update. - (ia64_init_extra_frame_info): Update. - (ia64_init_extra_frame_info): Update. - * d10v-tdep.c (d10v_frame_saved_pc): Update. - * cris-tdep.c (cris_init_extra_frame_info): Update. - * avr-tdep.c (avr_frame_chain): Update. - (avr_init_extra_frame_info): Update. - (avr_frame_saved_pc): Update. - * arm-tdep.c (arm_find_callers_reg): Update. - (arm_init_extra_frame_info): Update. - (arm_frame_saved_pc): Update. - -2002-09-17 Tom Tromey - - * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter - is "'". - -2002-09-17 Corinna Vinschen - - * MAINTAINERS: Remove "non multi-arched" text from h8300. - * h8300-tdep.c (h8300_next_prologue_insn) Renamed from - NEXT_PROLOGUE_INSN. - (h8300_examine_prologue): Call h8300_next_prologue_insn instead of - NEXT_PROLOGUE_INSN. - -2002-09-16 Joel Brobecker - - * osfsolib.c: Remove file, replaced by solib-osf.c. - * Makefile.in: Remove compilation rules for osfsolib.c. - -2002-09-16 David Carlton - - * cp-valprint.c (cp_print_class_method): Correct args to - check_stub_method_group. - -2002-09-16 Corinna Vinschen - - * h8300-tdep.c: Multiarch. Drop `set machine' command in favor of - `set architecture'. Unify naming convention of functions. - (h8300_skip_prologue): Improve prologue analysis. - (h8300_push_arguments): Rewritten to more closely match GCC's - bizarre argument-passing behavior, along with the comment describing - said behavior. - * remote-hms.c (hms_regnames): Don't use NUM_REGS in definition. - * config/h8300/tm-h8300.h: Multiarch. Just keep stuff needed by - sim, remote-e7000.c, remote-hms.c and remote.c - -2002-09-15 Mark Kettenis - - * i386-tdep.c (gdb_print_insn_i386): Removed. - (i386_print_insn): New function. - (i386_gdbarch_init): Set print_insn to i386_print_insns. - (_initialize_i386_tdep): Don't initialize tm_print_insn and - tm_print_insn_info. - -2002-09-14 Mark Kettenis - - * gdbtypes.c (check_stub_method_group): Initialize found_stub to - zero. - -2002-09-14 Corinna Vinschen - - * arch-utils.c (legacy_pc_in_sigtramp): Move preprocessor expression - for IN_SIGTRAMP to here. Use IN_SIGTRAMP only if it's defined. - Guard usage of SIGTRAMP_START() by using SIGTRAMP_START_P. - -2002-09-13 Christopher Faylor - - * win32-nat.c (child_create_inferior): Honor 'tty' command. - -2002-09-13 Daniel Jacobowitz - - * gdbtypes.c (check_stub_method): Make static. - (check_stub_method_group): New function. - * gdbtypes.h: Update prototypes. - * cp-support.c: New file. - * cp-support.h: New file. - - * stabsread.c: Include "cp-abi.h" and "cp-support.h". - (update_method_name_from_physname): New function. - (read_member_functions): Correct method names for operators - and v3 constructors/destructors. Separate v2 constructors and - destructors. - * Makefile.in (stabsread.o): Update dependencies. - (SFILES): Add cp-support.c. - (COMMON_OBS): Add cp-support.o. - (cp_support_h, cp-support.o): Add. - - * cp-valprint.c (cp_print_class_method): Call - check_stub_method_group instead of check_stub_method. Remove - extraneous QUITs. - * p-valprint.c (pascal_object_print_class_method): Likewise. - * valops.c (search_struct_method): Likewise. - (find_method_list, value_struct_elt_for_reference): Likewise. - -2002-09-13 Andrew Cagney - - * gdbarch.sh (SIGTRAMP_END): Change to a predicate function. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-09-13 Andrew Cagney - - * frame.c (find_saved_register): Delete function. - * frame.h (find_saved_register): Delete declaration. - Fix PR gdb/631. - -Fri Sep 13 14:59:55 2002 Andrew Cagney - - * mips-tdep.c (read_next_frame_reg): Re-hack using - frame_register_unwind. - -Fri Sep 13 07:42:09 2002 Andrew Cagney - - * mips-tdep.c (mips_get_saved_register): Re-hack using - frame_register_unwind. - -2002-09-12 Joel Brobecker - - * gdbarch.sh (NAME_OF_MALLOC): New variable in the architecture - vector. Will be useful for Interix. - * gdbarch.h, gdbarch.c: Regenerate. - - * valops.c (value_allocate_space_in_inferior): Replace hard-coded - name of the malloc function by NAME_OF_MALLOC. - -2002-09-12 Joel Brobecker - - * value.h (find_function_in_inferior): Add const keyword to - one of the parameters. Allows us to invoke this function with - a const char *. - * valops.c (find_function_in_inferior): Likewise. - -2002-09-12 Joel Brobecker - - * exec.c (xfer_memory): Fix compilation warning with old versions - of GCC. - * tracepoint.c (trace_find_tracepoint_command): Likewise. - -2002-09-12 David Carlton - - * symtab.h: Run through gdb_indent.h. - Add 2002 to Copyright year list. - -2002-09-12 Alan Modra - - * x86-64-tdep.c (_initialize_x86_64_tdep): Don't use hard-coded - mach constants. - * MAINTAINERS: Add myself to write after approval list. - -2002-09-11 J. Brobecker - - * osabi.c (gdb_osabi_name): Add entry for GDB_OSABI_INTERIX. - -2002-09-11 J. Brobecker - - * osabi.h (gdb_osabi): Add new GDB_OSABI_INTERIX enum value for - Interix. - -2002-06-05 Paul N. Hilfinger - - * procfs.c (do_detach): Clear current signal, not just fault. - Corrects problem with breakpoint trap signal leaking to detached - process on Tru64. - -2002-09-10 Michael Snyder - - * buildsym.c (finish_block): Protect against null pointer. - -2002-09-10 Andrew Cagney - - * infcmd.c (default_print_registers_info): Send all output to - ``file'' instead of ``gdb_stdout''. - -2002-09-10 Michael Snyder - - * mips-tdep.c (mips_extract_struct_value_address): Make val a - LONGEST, and use signed register read (addresses are sign- - extended for mips). - -2002-09-10 Stephane Carrez - - * event-loop.c (gdb_do_one_event): Make public. - * event-loop.h (gdb_do_one_event): Declare. - -2002-09-10 Jeff Law - - * infttrace.c (child_resume): Simplify and rework to avoid - TT_PROC_CONTINUE. - -2002-09-09 Fred Fish - - * printcmd.c (print_scalar_formatted): "len" is the number of - target bytes, NOT the number of target bits. - -2002-09-09 Elena Zannoni - - From: Emmanuel Thome' - * top.c (init_main): Set rl_terminal_name. - -2002-09-08 Aidan Skinner - - * ada-lang.c (ada_array_bound, ada_type_match, - _initialize_ada_language): Fix K&R definitions. - * ada-tasks.c (get_current_task): Fix K&R definitions. - * ada-valprint.c (adjust_type_signedness): Fix K&R definitions. - -2002-09-07 Christopher Faylor - - * MAINTAINERS: Remove CE from list of maintainership responsibilities. - Add XP. - -2002-09-06 Mark Kettenis - - * i386-tdep.c (i386_register_virtual_type, - i386_register_convertible, i386_register_convert_to_virtual, - i386_register_comvert_to_raw): Use FP_REGNUM_P and SSE_REGNUM_P - instead of IS_FP_REGNUM and IS_SSE_REGNUM. - (i386_gdbarch_init): Fix comment. Add comments on calls that set - sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum. - Don't set push_arguments twice. - - * i386bsd-tdep.c (i386bsd_init_abi): Set sigtramp_start and - sigtramp_end to i386bsd_sigtramp_start and i386bsd_sigtramp_end. - * i386nbsd-tdep.c (i386nbsd_init_abi): Set sigtramp_start and - sigtramp_end to NULL. - * config/i386/tm-fbsd.h (SIGTRAMP_START, SIGTRAMP_END): Remove - defines. - (i386bsd_sigtramp_start, i386_sigtramp_end): Remove prototypes. - - * i386nbsd-tdep.c (i386nbsd_pc_in_sigtramp): Remove spurious - whitespace. - - * gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): New methods. - * gdbarch.h, gdbarch.c: Re-generate. - * blockframe.c (find_pc_sect_partial_function): Convert to use - SIGTRAMP_START_P predicate. - -2002-09-05 Michael Snyder - - * arm-tdep.c (arm_init_extra_frame_info): Distinguish between - generic_dummy_frame method and old method. Also distinguish - between ARM_FP_REGNUM and THUMB_FP_REGNUM. - (arm_extract_return_value): Use new regcache method. - - * mips-tdep.c (mips_n32n64_push_arguments): Remove alignment - adjustment that doesn't conform to the ABI. - (mips_extract_struct_value_address): Retrieve V0_REGNUM from - saved regcache, not from current regcache. - -2002-09-05 Andrew Cagney - - * NEWS: Update for 5.3. Add new section ``Changes since 5.3''. - * README: Update. - -2002-09-04 Jason Thorpe - - * arm-tdep.c (arm_addr_bits_remove): Don't check for Thumb mode - if arm_apcs_32 is false. - -2002-09-04 Andrew Cagney - - GDB 5.3 branch created. - -2002-09-03 Theodore A. Roth - - * gdb/avr-tdep.c (avr_gdbarch_init): Use - generic_unwind_get_saved_register. - -2002-09-03 David Carlton - - * dwarf2read.c (dwarf2_add_member_fn): Add the 'type' - argument (PR gdb/653). Update call to smash_to_method_type. - (read_structure_scope): Update call to dwarf2_add_member_fn. - -2002-09-03 Michal Ludvig - - * x86-64-linux-tdep.c: Include gdb_string.h - * x86-64-linux-nat.c: Ditto. - -2002-09-02 Jason Thorpe - - * ada-exp.y (yyname, yyrule): Remap global variables that appear - when YYDEBUG is set to 1. - * c-exp.y: Likewise. - * f-exp.y: Likewise. - * jv-exp.y: Likewise. - * m2-exp.y: Likewise. - * p-exp.y: Likewise. - -2002-09-02 Jason Thorpe - - * Makefile.in (i386nbsd-tdep.o): Add $(solib_svr4_h) to - dependency list. - * i386nbsd-tdep.c (i386nbsdelf_init_abi): Set - solib_svr4_fetch_link_map_offsets to - nbsd_ilp32_solib_svr4_fetch_link_map_offsets. - * config/i386/nbsd.mt (TDEPFILES): Add solib.o and solib-svr4.o. - * config/i386/nbsdaout.mh (NATDEPFILES): Remove solib.o. - * config/i386/nbsdelf.mh (NATDEPFILES): Remove solib.o, - solib-svr4.o, and solib-legacy.o. - * config/i386/tm-nbsd.h: Include solib.h. - -2002-09-02 Jason Thorpe - - * configure.tgt (i[3456]86-*-netbsdelf*): Merge with... - (i[3456]86-*-netbsd*): ...this. Set gdb_target to nbsd. - (i[3456]86-*-openbsd*): Make this a separate entry. Add a - comment noting that this needs its own target configuration. - * config/i386/nbsd.mt: New file. - * config/i386/nbsdaout.mt: Remove. - * config/i386/nbsdelf.mt: Ditto. - * config/i386/tm-nbsdaout.h: Ditto. - -2002-09-02 Jason Thorpe - - * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): New function. - (i386nbsd_pc_in_sigtramp): Rewrite to use i386nbsd_sigtramp_offset. - (i386nbsd_init_abi): Don't initialize tdep->sigtramp_start or - tdep->sigtramp_end. - (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): Remove. - * config/i386/tm-nbsd.h (SIGTRAMP_START, SIGTRAMP_END) - (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove. - -2002-09-02 Jason Thorpe - - * Makefile.in (i386nbsd-tdep.o): Add $(arch_utils_h), - $(i386_tdep_h), and $(nbsd_tdep_h) to dependency list. - * i386-tdep.h (i386bsd_init_abi): New prototype. - * i386bsd-tdep.c (i386bsd_init_abi): Remove "static" from - function declaration. - (_initialize_i386bsd_tdep): Don't register OS ABI handlers - for NetBSD-a.out or NetBSD-ELF. - (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end) - (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset) - (i386nbsd_init_abi, i386nbsdelf_init_abi): Move to... - * i386nbsd-tdep.c: ...here. Include arch-utils.h, i386-tdep.h, - and nbsd-tdep.h. - (i386nbsd_pc_in_sigtramp): New function. - (i386nbsd_init_abi): Set gdbarch_pc_in_sigtramp to - i386nbsd_pc_in_sigtramp. - (_initialize_i386nbsd_tdep): Register i386nbsd_init_abi - and i386nbsdelf_init_abi OS ABI handlers. - * config/i386/nbsdaout.mt (TDEPFILES): Add nbsd-tdep.o. - * config/i386/nbsdelf.mt (TDEPFILES): Likewise. - -2002-09-02 Mark Kettenis - - * i386-linux-nat.c (dummy_sse_values): Only try to fill in the SSE - registers if the target really has them. - -2002-08-31 Jason Thorpe - - * Makefile.in (mipsnbsd-tdep.o): Use $(nbsd_tdep_h) rather - than nbsd-tdep.h. - -2002-08-31 Jason Thorpe - - * Makefile.in (alphanbsd-tdep.o): Add $(frame_h) to dependency - list. - * alphanbsd-tdep.c (alphanbsd_sigcontext_addr) - (alphanbsd_skip_sigtramp_frame): New functions. - (alphanbsd_init_abi): Set tdep->skip_sigtramp_frame to - alphanbsd_skip_sigtramp_frame. Set tdep->sigcontext_addr - to alphanbsd_sigcontext_addr. - -2002-08-31 Jason Thorpe - - * Makefile.in (mipsnbsd-tdep.o): Add nbsd-tdep.h to dependency - list. - (nbsd-tdep.o): Add $(gdb_string_h) to dependency list. - * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): Use - nbsd_pc_in_sigtramp. - * mipsnbsd-tdep.c: Include nbsd-tdep.h. - (mipsnbsd_pc_in_sigtramp): Use nbsd_pc_in_sigtramp. - * nbsd-tdep.c: Include gdb_string.h. - (nbsd_pc_in_sigtramp): New function. - * nbsd-tdep.h (nbsd_pc_in_sigtramp): New prototype. - * ppcnbsd-tdep.c (ppcnbsd_pc_in_sigtramp): New function. - (ppcnbsd_init_abi): Set gdbarch_pc_in_sigtramp to - ppcnbsd_pc_in_sigtramp. - * shnbsd-tdep.c (shnbsd_pc_in_sigtramp): New function. - (shnbsd_init_abi): Set gdbarch_pc_in_sigtramp to - shnbsd_pc_in_sigtramp. - * sparcnbsd-tdep.c (sparcnbsd_init_abi_elf): Set - gdbarch_pc_in_sigtramp to nbsd_pc_in_sigtramp. - * config/mips/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. - -2002-08-30 Pierre Muller - - * breakpoint.c (breakpoint_init_inferior): Reset the val field of - watchpoints to NULL. - (insert_breakpoints): set val field of watchpoints if NULL. - - -2002-08-29 Jim Blandy - - * symtab.c (lookup_symbol_aux): In the cases where we find a - minimal symbol of an appropriate name and use its address to - select a symtab to read and search, use `name' (as passed to us) - as the demangled name when searching the symtab's global and - static blocks, not the minsym's name. - -2002-08-29 Keith Seitz - - * 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 Michael Snyder - - * breakpoint.c (insert_breakpoints): Protect all references - to 'process_warning'. Shorten long lines. - -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 - T-packets; the 'a' is not taken as a register number. - (remote_check_watch_resources, remote_stopped_by_watchpoint) - (remote_stopped_data_address): New functions; add to target - vector. - (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Change - prototypes to match other implementations of this - function. replace integer argument with pointer -- the length - field in the Z-packet is the length of what is pointed to or 1 if - pointer is null. Add to target vector. - (remote_insert_watchpoint, remote_remove_watchpoint): Add to - target vector. - - From Mark Salter: - * remote.c (remote_wait): Add support to extract optional - watchpoint information from T-packet. Ignore unrecognized - optional info in T-packet. - (remote_async_wait): Ditto. - -2002-08-09 Corinna Vinschen - - * cli/cli-dump.c: Change fopen modes to use binary open modes - as defined in include/fopen-bin.h throughout. - -2002-08-08 Michael Snyder - - * mips-tdep.c: Minor whitespace and indentation clean-ups. - -2002-08-08 Kevin Buettner - - * doublest.c (store_floating): Avoid floatformat_from_doublest() - assertion failure by returning early after a warning. - -2002-08-08 Kevin Buettner - - * mips-tdep.c (mips_find_saved_regs): Make static. - (mips_frame_init_saved_regs): New function. - (mips_gdbarch_init): Setup FRAME_INIT_SAVED_REGS method. - * config/mips/tm-mips.h (FRAME_INIT_SAVED_REGS): Delete macro. - (mips_find_saved_regs): Delete declaration. - -2002-08-08 Grace Sainsbury - - * remote.c (remote_wait, remote_async_wait): Change - thread_num from int to ULONGEST. - (unpack_varlen_hex): Change result parameter from - int * to ULONGEST *. - -2002-08-08 Andrew Cagney - - * configure.tgt: Replace powerpc-*-sysv*, powerpc-*-elf*, - powerpcle-*-eabi*, powerpcle-*-sysv* and powerpcle-*-elf* with - powerpc*-*-*. - * MAINTAINERS: Remove redundant rs6000-ibm-aix4.1 target. - -2002-08-08 Andrew Cagney - - * gcore.c (override_derive_stack_segment): Delete variable. - (preempt_derive_stack_segment): Delete function. - (derive_stack_segment): Delete function. - (default_derive_stack_segment): Renamed to derive_stack_segment. - (override_derive_heap_segment): Delete variable. - (preempt_derive_heap_segment): Delete function. - (derive_heap_segment): Delete function. - (default_derive_heap_segment): Rename to derive_heap_segment. - -2002-08-06 Michael Snyder - - * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION. - * mips-tdep.c (mips_EABI_use_struct_convention, - mips_OABI_use_struct_convention, mips_NABI_use_struct_convention): - New functions. (mips_use_struct_convention): Delete. - (mips_gdbarch_init): set use_gdbarch_convention. - -2002-08-06 Michael Snyder - - * mips-tdep.c: gdbarch-ify reg_struct_has_addr. - (mips_eabi_reg_struct_has_addr, mips_n32n64_reg_struct_has_addr, - mips_o32_reg_struct_has_addr): New functions. - (mips_gdbarch_init): Set gdbarch reg_struct_has_addr. - -2002-08-07 Andrew Cagney - - * regcache.c (pseudo_register): Delete function. - (fetch_register): Delete function. - (store_register): Delete function. - (regcache_raw_read, legacy_read_register_gen): Use - target_fetch_registers instead of fetch_register. - (legacy_write_register_gen, regcache_raw_write): Use - target_store_register instead of store_register. - (write_register_bytes): Ditto. - - * gdbarch.sh (FETCH_PSEUDO_REGISTER): Delete. - (STORE_PSEUDO_REGISTER): Delete. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-08-06 Corinna Vinschen - - * cli/cli-dump.c (add_dump_command): Explicitely use "b" flag to - write dump file binary. - -2002-08-05 Michael Snyder - - * mips-tdep.c (mips_find_saved_regs): Adjust stack according - to MIPS_SAVED_REGSIZE, not GDB_TARGET_IS_MIPS64. Enhance comment. - (mips_gdbarch_init): Set N32 target to be mips64. - -2002-08-06 Kevin Buettner - - * frame.c (find_saved_register): Break out of loop once saved - register address is found. Don't mention sparc in loop comment - anymore. - -2002-08-06 Kevin Buettner - - * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set - mips_default_saved_regsize to 8. - -2002-08-06 Andrew Cagney - - * gcore.c: Do not include . - * Makefile.in (gcore.o): Update dependencies. - -2002-08-06 Andrew Cagney - - * configure.tgt: Make arc-*-* obsolete. - * NEWS: Mention that arc-*-* has been identifed as obsolete. - * MAINTAINERS: Make arc-elf obsolete. - * arc-tdep.c: Make file obsolete. - * config/arc/arc.mt: Ditto. - * config/arc/tm-arc.h: Ditto. - -2002-08-05 Theodore A. Roth - - * avr-tdep.c (avr_skip_prologue): Fix to return the correct pc. - -2002-08-05 Andrew Cagney - - * mcore-tdep.c (mcore_gdbarch_init): Use - generic_unwind_get_saved_register instead of - generic_get_saved_register. - * v850-tdep.c (v850_gdbarch_init): Ditto. - * frv-tdep.c (frv_gdbarch_init): Ditto. - * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. - * s390-tdep.c (s390_gdbarch_init): Ditto. - * d10v-tdep.c (d10v_gdbarch_init): Ditto. - * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Ditto. - * config/h8300/tm-h8300.h (GET_SAVED_REGISTER): Ditto. - -2002-08-05 Joel Brobecker - - * objfiles.h: Add missing #include "symfile.h" - - * Makefile.in (objfiles_h): Add dependency on symfile.h and dependents. - -2002-08-04 Andrew Cagney - - From 2002-08-01 david carlton : - * hpread.c (hpread_read_struct_type): Deleted superfluous setting - of FIELD_BITSIZE. - -2002-08-04 Daniel Jacobowitz - - * NEWS: Cleanup and nitpick. - -2002-08-03 Andrew Cagney - - * NEWS: Cleanup. Use *-linux*-gnu*. Only use `*' for headings. - -2002-08-03 Andrew Cagney - - * Makefile.in (gdbtk-bp.o): Update dependencies. - (gdbtk-register.o): Ditto. - (gdbtk-varobj.o): Ditto. - -2002-08-03 Andrew Cagney - - * m68hc11-tdep.c (m68hc11_pseudo_register_read): Replace - m68hc11_fetch_pseudo_register. - (m68hc11_pseudo_register_write): Replace - m68hc11_store_pseudo_register. - (m68hc11_gdbarch_init): Update. - -Fri Aug 2 15:53:50 2002 Andrew Cagney - - * gdbarch.sh: Include "gdb_string.h". - * gdbarch.c: Regenerate. - - * regcache.c: Include "gdb_string.h". - * ax-general.c: Ditto. - * varobj.c: Ditto. - * std-regs.c: Ditto. - * fbsd-proc.c: Ditto. - * thread.c: Ditto. - - * Makefile.in (regcache.o): Update dependencies. - (thread.o, gdbarch.o): Ditto. - (ax-general.o, gdbarch.o): Ditto. - (varobj.o, std-regs.o): Ditto. - (fbsd-proc.o): Specify dependencies. - -2002-08-02 Andrew Cagney - - * regcache.c (regcache_cooked_read): Rename rawnum parameter to - regnum. - (regcache_cooked_write): Ditto. - -2002-08-02 Andrew Cagney - - * regcache.c (regcache_cooked_read): New function. - (regcache_cooked_write): New function. - (read_register_gen): Rewrite using regcache_cooked_read. - (write_register_gen): Rewrite using regcache_cooked_write. - - * regcache.h (regcache_cooked_read, regcache_cooked_write): - Declare. - -2002-08-02 Andrew Cagney - - * gdbarch.sh (pseudo_register_read, pseudo_register_write): - Replace the architecture methods register_read and register_write. - * gdbarch.h, gdbarch.c: Regenerate. - * regcache.c (init_regcache_descr): Update. - (read_register_gen): Update. - (write_register_gen): Update. - (supply_register): Update comment. - - * sh-tdep.c (sh_gdbarch_init): Update. - (sh_pseudo_register_read, sh64_pseudo_register_read): Add - `regcache' and `gdbarch' parameters. Make `buffer' a void - pointer. Update code. - (sh_pseudo_register_write, sh64_pseudo_register_write): Add - `regcache' and `gdbarch' parameters. Make `buffer' a constant - void pointer. Update code. - (sh64_register_write): Delete. - (sh4_register_read): Delete. - (sh64_register_read): Delete. - (sh4_register_write): Delete. - (sh_sh4_register_convert_to_raw): Make `from' parameter a constant - void pointer, `to' parameter a void pointer. - (sh_sh64_register_convert_to_raw): Ditto. - -2002-08-01 Kevin Buettner - - * mips-tdep.c (mips_register_virtual_type): Use architecture - invariant return values. - -2002-08-01 Andrew Cagney - - * linux-proc.c: Include "gdb_string.h". - * Makefile.in (linux-proc.o): Update dependency list. - -2002-08-01 Kevin Buettner - - * mips-tdep.c (mips_gdbarch_init): Add comments. Fix typo in - comment. - -2002-08-01 Grace Sainsbury - - * target.h: Add to_insert_hw_breakpoint, to_remove_hw_breakpoint, - to_insert_watchpoint, to_remove_watchpoint, - to_stopped_by_watchpoint, to_stopped_data_address, - to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint to - target vecctor. Define their corresponding macros so they call - them. - - * target.c: Add default and debug versions of for - to_insert_hw_breakpoint, to_remove_hw_breakpoint, - to_insert_watchpoint, to_remove_watchpoint, - to_stopped_by_watchpoint, to_stopped_data_address, - to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint. - -2002-08-01 Kevin Buettner - - * mips-tdep.c (mips_register_virtual_type): New function. - (mips_gdbarch_init): Register mips_register_virtual_type() - with gdbarch machinery. - * config/mips/tm-irix6.h (mips/tm-bigmips64.h): Include - this file instead of tm-bigmips.h. - (MIPS_REGSIZE): Delete this macro. - (REGISTER_VIRTUAL_TYPE): Delete macro. Undef macro so that - multiarch version in mips-tdep.c will be found. - -2002-08-01 Andrew Cagney - - * NEWS: Menion that CHILL has been made obsolete. - - * gdbtypes.c (chill_varying_type): Make chill references obsolete. - * stabsread.c (read_range_type): Ditto. - * gdbtypes.h: Ditto. - * language.c (binop_type_check): Ditto. - (binop_result_type): Ditto. - (integral_type): Ditto. - (character_type): Ditto. - (string_type): Ditto. - (boolean_type): Ditto. - (structured_type): Ditto. - (lang_bool_type): Ditto. - (binop_type_check): Ditto. - * language.h (_LANG_chill): Ditto. - * dwarfread.c (set_cu_language): Ditto. - * dwarfread.c (CHILL_PRODUCER): Ditto. - * dwarfread.c (handle_producer): Ditto. - * expression.h (enum exp_opcode): Ditto. - * eval.c: Ditto for comments. - * typeprint.c (typedef_print) [_LANG_chill]: Ditto. - * expprint.c (print_subexp): Ditto. - (print_subexp): Ditto. - * valops.c (value_cast): Ditto. - (search_struct_field): Ditto. - * value.h (COERCE_VARYING_ARRAY): Ditto. - * symfile.c (init_filename_language_table): Ditto. - (add_psymbol_with_dem_name_to_list): Ditto. - * valarith.c (value_binop): Ditto. - (value_neg): Ditto. - * valops.c (value_slice): Ditto. - * symtab.h (union language_specific): Ditto. - (SYMBOL_INIT_LANGUAGE_SPECIFIC): Ditto. - (SYMBOL_DEMANGLED_NAME): Ditto. - (SYMBOL_CHILL_DEMANGLED_NAME): Ditto. - * defs.h (enum language): Ditto. - * symtab.c (got_symtab): Ditto. - * utils.c (fprintf_symbol_filtered): Ditto. - - * ch-typeprint.c: Make file obsolete. - * ch-valprint.c: Make file obsolete. - * ch-lang.h: Make file obsolete. - * ch-exp.c: Make file obsolete. - * ch-lang.c: Make file obsolete. - - * Makefile.in (FLAGS_TO_PASS): Do not pass CHILL or CHILLFLAGS or - CHILL_LIB. - (TARGET_FLAGS_TO_PASS): Ditto. - (CHILLFLAGS): Obsolete. - (CHILL): Obsolete. - (CHILL_FOR_TARGET): Obsolete. - (CHILL_LIB): Obsolete. - (SFILES): Remove ch-exp.c, ch-lang.c, ch-typeprint.c and - ch-valprint.c. - (HFILES_NO_SRCDIR): Remove ch-lang.h. - (COMMON_OBS): Remove ch-valprint.o, ch-typeprint.o, ch-exp.o and - ch-lang.o. - (ch-exp.o, ch-lang.o, ch-typeprint.o, ch-valprint.o): Delete - targets. - -2002-07-31 Joel Brobecker - - * dwarf2read.c (set_cu_language): Add handler for LANG_Ada95. - This does not change anything at the moment, but will be helpful - later when full Ada support is integrated. - -2002-07-31 Kevin Buettner - - * mips-tdep.c (_initialize_mips_tdep): Add "n64" to "set mips abi" - help message. - -2002-07-31 Kevin Buettner - - * mips-tdep.c (mips_push_arguments): Fetch gdbarch_tdep struct - and save it in a local variable. Use variable in later test. - -2002-07-31 Kevin Buettner - - * mips-tdep.c (mips_find_abi_section): Add N64 ABI recognition - test. (Thanks to Daniel Jacobowitz.) - -2002-07-31 Kevin Buettner - - * mips-tdep.c (enum mips_abi): Add MIPS_ABI_N64. - (mips_abi_strings): Add "n64". - (mips_gdbarch_init): Add test for n64 abi. Add MIPS_ABI_N64 case. - -2002-07-31 Kevin Buettner - - * config/mips/tm-irix6.h (MIPS_REGSIZE): Define to be 8. - (REGISTER_VIRTUAL_TYPE): Some registers are now 64 bits wide. - -2002-07-31 Kevin Buettner - - * utils.c (host_pointer_to_address, address_to_host_pointer): - Use gdb_assert() instead of explicit call to internal_error(). - -2002-07-30 Kevin Buettner - - * Makefile.in (rs6000-nat.o): Update dependencies. - - From Nicholas Duffek: - * Makefile.in (ALLDEPFILES): Add aix-thread.c. - (aix-thread.o): New rule. - * configure.host (gdb_host): Set to aix432 on AIX 4.3.2+. - * config/powerpc/aix432.mh: New file. - -2002-07-30 Daniel Jacobowitz - - * ppc-linux-tdep.c (ELF_NGREG, ELF_NFPREG, ELF_NVRREG) - (ELF_FPREGSET_SIZE, ELF_GREGSET_SIZE): New enums. - (fetch_core_registers, ppc_linux_supply_gregset) - (ppc_linux_supply_fpregset): New functions. - (ppc_linux_regset_core_fns): New. - (_initialize_ppc_linux_tdep): Call add_core_fns. - * ppc-tdep.h: Add prototypes for ppc_linux_supply_fpregset - and ppc_linux_supply_gregset. - * ppc-linux-nat.c (supply_gregset): Call ppc_linux_supply_gregset. - (supply_fpregset): Call ppc_linux_supply_fpregset. - * config/powerpc/linux.mh (NATDEPFILES): Remove core-regset.o and - corelow.o. - * config/powerpc/linux.mt (TDEPFILES): Add corelow.o. - -2002-07-30 Daniel Jacobowitz - - * symtab.c (lookup_symbol): Demangle before lowercasing. - -2002-07-30 Andrew Cagney - - * symtab.h: Replace #include "gdb_obstack.h" with opaque - declaration. - * cli/cli-cmds.c, cli/cli-script.c: Include "gdb_string.h". - * gnu-v3-abi.c, arc-tdep.c, cli/cli-decode.c: Ditto. - * avr-tdep.c, mon960-rom.c, i960-tdep.c: Ditto. - * arch-utils.c, cli/cli-setshow.c: Unconditionally include - "gdb_string.h". - * Makefile.in (cli-script.o, cli-cmds.o): Update dependencies. - (gnu-v3-abi.o, cli-setshow.o, i960-tdep.o): Ditto. - (cli-decode.o, mi-cmd-var.o, mi-cmd-disas.o): Ditto. - (avr-tdep.o, mon960-rom.o): Ditto. - (aout_stabs_gnu_h): Define. - (symtab_h): Remove $(gdb_obstack_h). - -2002-07-30 Jim Blandy - - Patch from David Carlton : - * gdbinit.in: Move the `dir' commands that add GDB's own source - directory to the search path to the end, so that the `gdb' source - directory will be searched first. - -2002-07-29 Andrew Cagney - - * gdb_obstack.h: New file. - * symtab.h: Include "gdb_obstack.h" instead of "obstack.h". - (obstack_chunk_alloc, obstack_chunk_free): Delete macros. - * objfiles.h: Include "gdb_obstack.h". - * Makefile.in (gdb_obstack_h): Define. - (symtab_h): Add $(gdb_obstack_h). - (objfiles_h): Add $(gdb_obstack_h). - - * objfiles.c: Include "gdb_obstack.h" instead of "obstack.h". - * macrotab.c, cp-valprint.c, dbxread.c: Ditto. - * ch-typeprint.c, ch-valprint.c, dstread.c: Ditto. - * macroexp.c, p-typeprint.c, stabsread.c: Ditto. - * symtab.c, f-typeprint.c, mdebugread.c: Ditto. - * p-valprint.c, symmisc.c, typeprint.c: Ditto. - * symfile.c, coffread.c, c-typeprint.c: Ditto. - * buildsym.c, bcache.c, ada-typeprint.c: Ditto. - - * Makefile.in (bcache.o): Update dependencies. - (buildsym.o, c-typeprint.o, ch-typeprint.o): Ditto. - (ch-valprint.o, coffread.o, cp-valprint.o): Ditto. - (dbxread.o, dstread.o, f-typeprint.o): Ditto. - (objfiles.o, p-typeprint.o, p-valprint.o): Ditto. - (stabsread.o, symfile.o, symmisc.o): Ditto. - (symtab.o, typeprint.o, macroexp.o): Ditto. - (macrotab.o, mdebugread.o): Ditto. - (f_lang_h, coff_sym_h, coff_symconst_h): Define. - (coff_ecoff_h, aout_aout64_h): Define. - (aout_stabs_gnu_h, libaout_h): Define. - -2002-07-29 Andrew Cagney - - * regcache.c (struct regcache_descr): Rename nr_registers to - nr_cooked_registers. Revise comments describing the structure - member fields. - (init_regcache_descr): Update. - (init_legacy_regcache_descr): Update. - (read_register_gen, write_register_gen): When a cooked register in - the raw register range, directly access the value from the raw - register cache. - -2002-07-29 Andrew Cagney - - * z8k-tdep.c: Do not include "obstack.h". - * h8300-tdep.c, h8500-tdep.c: Ditto. - * m68hc11-tdep.c, sh-tdep.c: Ditto. - * valprint.c, v850-tdep.c: Ditto. - * d10v-tdep.c, mn10300-tdep.c: Ditto. - * mn10200-tdep.c: Ditto. - - * Makefile.in (z8k-tdep.o): Update dependencies. - (m68hc11-tdep.o, valprint.o): Ditto. - (v850-tdep.o, d10v-tdep.o): Ditto. - (mn10300-tdep.o, sparc-tdep.o): Ditto. - (sh-tdep.o, h8500-tdep.o, h8300-tdep.o): Ditto. - (m32r-tdep.o, mn10200-tdep.o): Specify dependencies. - (sh_opc_h, gdb_sim_sh_h): Define. - (elf_sh_h, elf_bfd_h): Define. - (opcode_m68hc11_h): Define. - (OPCODES_SRC, OPCODES_DIR): define. - (OPCODES): Use $(OPCODES_DIR). - (gdb_sim_d10v_h): Rename sim_d10v_h. - (gdb_sim_arm_h): Rename sim_arm_h. - -2002-07-26 Kevin Buettner - - * utils.c (host_pointer_to_address, address_to_host_pointer): - Change internal_error() message to indicate function responsible - for the error. - -2002-07-26 Kevin Buettner - - * ui-out.c (ui_out_field_core_addr): Remove unnecessary cast in - calls to local_hex_string_custom(). - -2002-07-26 Kevin Buettner - - * irix5-nat.c: Move IRIX shared library support from here... - * solib-irix.c: ...to here. Revised substantially to work with - generic solib framework. - - * osabi.h (gdb_osabi): Add new enum constant GDB_OSABI_IRIX. - * osabi.c (gdb_osabi_names): Add corresponding string for Irix. - * mips-irix-tdep.c: New file. - - * Makefile.in (ALLDEPFILES): Add mips-irix-tdep.c and solib-irix.c. - (mips-irix-tdep.o, solib-irix.o): New rules. - * config/mips/irix5.mt (TDEPFILES): Add mips-irix-tdep.o, solib.o, - solib-irix.o. - * config/mips/irix6.mt (TDEPFILES): Likewise. - * config/mips/irix6.mh (NATDEPFILES): Remove solib.o. - -2002-07-26 Kevin Buettner - - * aix-thread.c (coff/internal.h, bfd/libcoff.h, pthread.h): Remove - disabled (via ``#if 0'') includes. - -2002-07-26 Kevin Buettner - - * aix-thread.c (special_register_p, supply_sprs64, supply_sprs32) - (fetch_regs_user_thread, fetch_regs_kernel_thread, fill_sprs64) - (fill_sprs32, store_regs_user_thread, store_regs_kernel_thread): - Add support for the fpscr register. - * rs6000-nat.c (regmap, fetch_inferior_registers) - (store_inferior_registers, fetch_core_registers): Likewise. - -2002-07-26 Kevin Buettner - - * rs6000-nat.c (language.h): Include. - (special_regs): Delete this array. - (regmap): New function. - (fetch_register, store_register): Use regmap() to map gdb - register numbers to ptrace register numbers. Also, use - outputs from regmap() to make decisions regarding type of - ptrace() call to make. In particular, don't compare against - FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. - (fetch_inferior_registers, store_inferior_registers): Where - possible, obtain register numbers from tdep struct. Don't - refer to FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. - * config/rs6000/tm-rs6000.h (FIRST_UISA_SP_REGNUM) - (LAST_UISA_SP_REGNUM): Delete. - -2002-07-25 Kevin Buettner - - * rs6000-nat.c (ppc-tdep.h): Include. - (fetch_registers, store_register, fetch_core_registers): Don't - access registers[] directly. Instead, use supply_register() or - regcache_collect() as appropriate. - (find_toc_address): Format hex address with local_hex_string(). - -2002-07-25 Andrew Cagney - - * config/djgpp/fnchange.lst: Rename bfd/elf32-fr30.c and - bfd/elf32-frv.c. - -2002-07-24 Tom Tromey - - * jv-exp.y: Marked all strings with _(). - (ClassInstanceCreationExpression, ArrayCreationExpression): Use - internal_error. - (MethodInvocation, CastExpression, parse_number, yyerror, - java_type_from_name, push_expression_name, yylex): Typo fixes. - -2002-07-24 Daniel Jacobowitz - - * ui-file.c (struct tee_file, tee_file_new, tee_file_delete) - (tee_file_flush, tee_file_write, tee_file_fputs) - (tee_file_isatty): New. - * ui-file.h (tee_file_new): Add prototype. - -2002-07-24 Aidan Skinner - - * ada-lang.c: Change k&r style function definitions to prototyped - form. - * ada-typeprint.c: Change k&r style function definitions to prototyped - form. - * ada-valprint.c: Change k&r style function definitions to prototyped - form. - -2002-07-24 Andrew Cagney - - * README: Remove reference to remote-bug. - * Makefile.in (ALLDEPFILES): Remove m88k-nat.c, m88k-tdep.c and - remote-bug.c. - (m88k-nat.o): Delete rule. - (m88k-tdep.o): Delete rule. - (remote-bug.o): Delete rule. - * MAINTAINERS: Mark as obsolete. - * elfread.c (elf_symtab_read): Mention that m88k is obsolete. - * m88k-tdep.c: Make file obsolete. - * config/m88k/m88k.mh: Ditto. - * config/m88k/delta88v4.mh: Ditto. - * config/m88k/delta88v4.mt: Ditto. - * config/m88k/delta88.mt: Ditto. - * config/m88k/delta88.mh: Ditto. - * remote-bug.c: Ditto. - * config/m88k/tm-delta88.h: Ditto. - * config/m88k/nm-delta88v4.h: Ditto. - * config/m88k/xm-delta88.h: Ditto. - * config/m88k/xm-dgux.h: Ditto. - * config/m88k/tm-m88k.h: Ditto. - * config/m88k/nm-m88k.h: Ditto. - * config/m88k/tm-delta88v4.h: Ditto. - * m88k-nat.c: Ditto. - * cxux-nat.c: Ditto. - * configure.host: Make m88*-motorola-sysv4*, m88*-motorola-sysv* - and m88*-*-* obsolete. - * configure.tgt: Make m88*-motorola-sysv4*, m88*-motorola-* and - m88*-*-* obsolete. - -2002-07-24 Andrew Cagney - - * findvar.c (extract_unsigned_integer): Make `addr' parameter - constant. Same for local pointer variables. - (extract_signed_integer): Ditto. - * defs.h (extract_unsigned_integer): Update. - (extract_signed_integer): Update. - -2002-07-24 Andrew Cagney - - * regcache.c (regcache_raw_write): Change buf parameter to a - constant void pointer. - (regcache_raw_read): Change buf parameter to a void pointer. - (legacy_write_register_gen): Change myaddr parameter a constant - void pointer. - (supply_register): Change val parameter to a const void pointer. - * regcache.h (regcache_raw_write): Update declaration. - (regcache_raw_read): Update declaration. - (supply_register): Update declaration. - -2002-07-24 Tom Tromey - - * defs.h (gdb_readline_wrapper): Declare. - * utils.c (prompt_for_continue): Use gdb_readline_wrapper. - * tracepoint.c (read_actions): Use gdb_readline_wrapper. - * top.c (gdb_readline_wrapper): New function. - (command_line_input): Use it. - -2002-07-24 Andrew Cagney - - * regcache.h (regcache_raw_read, regcache_raw_write): Replace - regcache_read and regcache_write. - (regcache_raw_read_as_address): Replace regcache_read_as_address. - * regcache.c: Update. - * sh-tdep.c (sh64_push_arguments): Update comment. - (sh_pseudo_register_read): Update. - (sh_pseudo_register_write): Update. - (sh4_register_read): Update. - (sh4_register_write): Update. - (sh64_pseudo_register_read): Update. - (sh64_pseudo_register_write): Update. - (sh64_register_read): Update. - (sh64_register_write): Update. - * i386-tdep.c (i386_extract_return_value): Update. - (i386_extract_struct_value_address): Update. - (i386_extract_return_value): Update. - * blockframe.c (generic_read_register_dummy): Update. - (generic_call_dummy_register_unwind): Update - * infrun.c (write_inferior_status_register): Update. - -2002-07-23 Jim Blandy - - * parser-defs.h (expression_context_pc): Make this extern. - (Thanks to Michael Snyder.) - -2002-07-23 Andrew Cagney - - GDB 5.2.1 released from 5.2 branch. - * NEWS: Mention changes in 5.2.1 including addition of AVR target. - * README: Update to mention 5.2.1. - -2002-07-23 Mark Salter - - * remote.c (remote_read_bytes): Fix check for error. - -2002-07-22 Kevin Buettner - - * aix-thread.c (language.h): Include. - (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) - (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc): - Print newlines at end of debug messages. - (pdc_symbol_addrs, pdc_read_regs, pdc_write_regs, pdc_read_data) - (pdc_write_data): Use local_hex_string() instead of %llx formats. - -2002-07-22 Kevin Buettner - - * aix-thread.c (ppc-tdep.h): Include. - (special_register_p): New function. - (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32) - (store_regs_user_thread): Use register number information from - gdbarch_tdep struct instead of hardcoded offsets relative to - FIRST_UISA_SP_REGNUM. - (fetch_regs_kernel_thread, store_regs_kernel_thread): Call - special_register_p() instead of using FPLAST_REGNUM and - LAST_UISA_SP_REGNUM as lower and upper bounds on the special - register numbers. Also, don't assume that LAST_UISA_SP_REGNUM - will be MQ's register number. - -2002-07-22 Michael Snyder - - * aix-thread.c (ops): Rename to aix_thread_ops. - (base_ops): Rename to base_target. - (ops_attach): Rename to aix_thread_attach. - (ops_detach): Rename to aix_thread_detach. - (ops_resume): Rename to aix_thread_detach. - (ops_wait): Rename to aix_thread_wait. - (ops_kill): Rename to aix_thread_kill. - (init_ops): Rename to init_aix_thread_ops. - (ops_fetch_register): Rename to aix_thread_fetch_register. - (ops_store_register): Rename to aix_thread_store_register. - (ops_mourn_inferior): Rename to aix_thread_mourn_inferior. - (ops_thread_alive): Rename to aix_thread_thread_alive. - (ops_extra_thread_info: Rename to aix_thread_extra_thread_info. - (ops_pid_to_str): Rename to aix_thread_pid_to_str. - (ops_xfer_memory): Rename to aix_thread_xfer_memory. - (fetch_regs_lib): Rename to fetch_regs_user_thread. - (fetch_regs_kern): Rename to fetch_regs_kernel_thread. - (store_regs_lib): Rename to store_regs_user_thread. - (store_regs_kern): Rename to store_regs_kernel_thread. - -2002-07-22 Michael Snyder - - * aix-thread.c (ops_prepare_to_store): Eliminate. - (init_ops): Don't initialize ops.prepare_to_store. - (store_regs_kern): Pre-fetch register buffers from child, - because some registers may not be in the cache. Copy - regs from register cache only if they are cached. - (store_regs_lib): Copy regs from register cache only - if they are cached. - (fill_sprs32, (fill_sprs64, fill_fprs, fill_gprs32, - fill_gprs64): Ditto. - -2002-07-22 Kevin Buettner - - * aix-thread.c (gdb_assert.h): Include. - (fill_sprs64, fill_sprs32): Add selected asserts to make sure that - register sizes (from register cache) match size of buffer holding - register data. - (fill_sprs32): Change parameter types to match those in the ptrace() - buffer. - (store_regs_lib): Likewise, but for 32-bit temporary variables. - (ops_prepare_to_store): Rename loop variable ``i'' to ``regno''. - -2002-07-22 Michael Snyder - - * aix-thread.c (supply_sprs64): Cosmetic change. - (supply_sprs32): Cosmetic change. - (fill_gprs64, fill_gprs32, fill_fprs, fill_sprs32): New funcs. - (fill_sprs64): Use regcache_collect instead of read_register. - (store_regs_lib): Use regcache_collect instead of - read_register. Use fill_sprs32 instead of fill_sprs64, - if debugging a 32-bit architecture. - (store_regs_kern): Use fill_gprs64 etc. to pull the values - out of the register cache, instead of passing a pointer into - the register cache directly to ptrace. Use regcache_collect - insteaad of read_register. - (ops_prepare_to_store): Use target_read_registers instead - of read_register_bytes. - -2002-07-20 Aidan Skinner - - * MAINTAINERS: Add self under write after approval. - -2002-07-20 Aidan Skinner - - * ada-tasks.c: Change k&r style function definitions to prototyped - form. - -2002-07-19 Andrew Cagney - - * Makefile.in (x86-64-tdep.o): Add $(objfiles_h). - * x86-64-tdep.c: Include "objfiles.h". - (x86_64_gdbarch_init): Set in_solib_call_trampoline to - in_plt_section. From 2002-07-18 Michal Ludvig . - -2002-07-17 Michal Ludvig - - * dwarf2cfi.c (execute_stack_op): Complain on unknown DW_OP_ value. - (update_context): Initialise cfa variable. - -2002-07-17 Michael Snyder - - * aix-thread.c: Shorten some long lines. - Bring comments into line with code spec. - -2002-07-18 Joel Brobecker - - * infrun.c: Re-indent using gdb_indent.sh. - -2002-07-18 Joel Brobecker - - * infrun.c (handle_inferior_event): Remove unneeded extra brace. - Leave the indentation temporarily untouched, to minimize the diffs. - -2002-07-18 Elena Zannoni - - * stabsread.c: Make os9k sections of the code obsolete, - for real this time. - * stabsread.h: Make os9k sections of the code obsolete. - -2002-07-18 Michal Ludvig - - * linux-low.c (regsets_store_inferior_registers): Add free() - at the end of a loop to prevent memory leak. - * linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers. - (X86_64_NUM_GREGS): Count it from the size of x86_64_regmap. - * config/sparc/tm-sp64linux.h: Make the rest of #endif - line a comment. - * Makefile.in (x86-64-linux-nat.o): Remove dependency on i387-tdep.h - -2002-07-17 Jim Blandy - - * macrocmd.c (info_macro_command): Remove newline from error - message. - -2002-07-17 J"orn Rennecke - - * sh-tdep.c (sh_dsp_register_sim_regno): New function. - (sh_gdbarch_init): Use it for sh-dsp. - -2002-07-16 Kevin Buettner - - * dwarf2read.c (read_initial_length): Handle older, non-standard, - 64-bit DWARF2 format. - -2002-07-16 Joel Brobecker - - * proc-api.c: use HAVE_SYS_PROC_H macro to avoid including - when not available. - -2002-07-16 Andrew Cagney - - * NEWS: Mention that the i[34]86-*-os9k has been made obsolete. - * stabsread.c: Make os9k sections of the code obsolete. - * configure.tgt: Make i[3456]86-*-os9k target obsolete. - * config/i386/i386os9k.mt: Make file obsolete. - * Makefile.in (ALLDEPFILES): Remove remote-os9k.c. - (COMMON_OBS): Remove os9kread.o - (SFILES): Remove os9kread.c. - (os9kread.o, remote-os9k.o): Make target obsolete. - * remote-os9k.c: Make file obsolete. - * os9kread.c: Make file obsolete. - * Makefile.in - -2002-07-16 Andrew Cagney - - * NEWS: Mention that the FR30 has been made obsolete. - * fr30-tdep.c: Make file obsolete. - * config/fr30/tm-fr30.h: Ditto. - * config/fr30/fr30.mt: Ditto. - * configure.tgt: Make fr30-*-elf obsolete. - * MAINTAINERS: Make fr30-elf obsolete. - -2002-07-16 Pierre Muller - - * blockframe.c (get_pc_function_start): return 0 if the minimal symbol - found is not inside a section. - -2002-07-15 Kevin Buettner - - * aix-thread.c (ptrace_check): Use safe_strerror() instead of - strerror(). - (pdc_realloc): Use xrealloc() instead of realloc(). - -2002-07-15 Kevin Buettner - - * aix-thread.c (PD_ERROR, CALL_BASE): Delete. - (ops_resume, ops_wait, fetch_regs_lib, store_regs_lib) - (ops_xfer_memory, ops_kill): Don't use PD_ERROR or CALL_BASE - macros. - -2002-07-15 Kevin Buettner - - * aix-thread.c (ptrace_check): Eliminate goto. - (sync_threadlists): Eliminate gotos. Also, fix array overrun - problem. - -2002-07-15 Kevin Buettner - - * aix-thread.c (gdbcmd.h): Include. - (DEBUG, DBG, DBG2, dbg): Eliminate. - (debug_aix_thread): New static global. - (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) - (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc) - (fetch_regs_lib, store_regs_lib, store_regs_kern): Rewrite - invocations to DBG and DBG2 macros to test against - ``debug_aix_thread'' and call fprintf_unfiltered(). - (_initialize_aix_thread): Add new command "set debug aix-thread". - -2002-07-15 Andrew Cagney - - From Gerhard Tonn : - * s390-nat.c (fill_fpregset, fill_gregset): Use regcache_collect - instead of supply_register. - -2002-07-15 Andrew Cagney - - * dwarf2cfi.c: Include "gdb_assert.h". - (frame_state_for): Use gdb_assert to check that fde->cie_ptr is - non-NULL. - (update_context): Do not use __func__. Add missing ``break''. - (update_context): Do not use __func__. - -2002-07-15 Elena Zannoni - - * rs6000-tdep.c (rs6000_gdbarch_init): Remove variable print_insn - and its setting. Set gdbarch instruction printing functions - directly. For non-rs6000 case use new function - gdb_print_insn_powerpc. - (gdb_print_insn_powerpc): New function. - -2002-07-13 Andrew Cagney - - * NEWS: Mention that the d30v has been marked obsolete. - * MAINTAINERS: Note that d30v / d30v-elf has been made obsolete. - * configure.tgt: Mark d30v-*-* as obsolete. - * d30v-tdep.c: Mark file as obsolete. - * config/d30v/d30v.mt: Ditto. - * config/d30v/tm-d30v.h: Ditto. - -2002-07-13 Aidan Skinner - - * ada-tasks.c (add_task_entry): replace calls to - malloc() with xmalloc - * ada-tasks.c (init_task_list): replace calls to free with xfree() - - * ada-lang.c (replace_operator_with_call, fill_in_ada_prototype, - ada_finish_decode_line_1, all_sals_for_line - ada_breakpoint_rewrite): replace calls to free() with xfree() - -2002-07-12 Kevin Buettner - - From Nicholas Duffek (with minor changes by Martin Hunt, - Louis Hamilton, and Kevin Buettner): - * aix-thread.c: New file. - -2002-07-12 Petr Sorfa - - * dwarf2read.c (dwarf2_invalid_attrib_class): New - complaint for invalid attribute class or form. - (read_func_scope): DW_AT_frame_base - better handling of DW_AT_block*. - (dwarf2_add_member_fn): DW_AT_vtable_elem_location - better handling of DW_AT_block*. - (read_common_block): DW_AT_location - better handling of DW_AT_block*. - (read_partial_die): DW_AT_location better handling - of DW_AT_block*. - (new_symbol): DW_AT_external better handling of - DW_AT_block*. Proper initialization of variable - "addr". - (attr_form_is_block): New function that returns true - if the attribute's form is of DW_FORM_block*. - -2002-07-12 Peter Schauer - - * valops.c (find_method_list): Remove comment about - removed STATIC_MEMFUNCP argument. - (value_find_oload_method_list): Likewise. - -2002-07-12 Kevin Buettner - - From Nicholas Duffek: - * rs6000-nat.c (vmap_ldinfo, xcoff_relocate_core): Call - target_new_objfile_hook. - -2002-07-12 Kevin Buettner - - From Nicholas Duffek: - * xcoffread.c (scan_xcoff_symtab): Recognize XMC_TD as a data storage - csect. - -2002-07-12 Andrew Cagney - - * MAINTAINERS: Mention --enable-sim-build-warnings. - (m68hc11-elf): Disable sim build warnings. - (m32r-elf): Mark as broken obsolete candidate. - (x86_64-linux-gnu): Mark as buildable with -Werror. - (arm-elf): Change -w to ``,'' which enables warnings but not - -Werror. - -2002-07-12 Andrew Cagney - - * bcache.h: Update copyright. - (struct bstring, struct bcache): Move definition to "bcache.c". - Replaced by opaque declaration. - (bcache_xfree): Replace free_bcache. - (bcache_xmalloc, bcache_memory_used): Declare. - - * bcache.c: Update copyright. - (struct bstring, struct bcache): Moved to here from "bcache.h". - Update comments. - (bcache_xmalloc, bcache_memory_used): New functions. - (bcache_xfree): Replace function free_bcache. - - * Makefile.in (objfiles.o): Add $(bcache_h). - (objfiles_h): Remove $(bcache_h). - (symfile.o): Add $(bcache_h). - - * symmisc.c: Update copyright. - (print_symbol_bcache_statistics): Pass psymbol_cache by value. - (print_objfile_statistics): Use bcache_memory_used. - - * symfile.c: Include "bcache.h". - (reread_symbols): Use bcache_xfree. - (reread_symbols): Use bcache_xmalloc and bcache_xfree. - (add_psymbol_to_list): Pass psymbol_cache by value. - (add_psymbol_with_dem_name_to_list): Ditto. - - * objfiles.h: Update copyright. - (struct bcache): Declare opaque. Do not include "bcache.h". - (struct objfile): Change psymbol_cache and macro_cache to ``struct - bcache'' pointers. - * dwarf2read.c (macro_start_file): Pass macro_cache by value. - - * objfiles.c: Include "bcache.h". Update copyright. - (allocate_objfile): Use bcache_xmalloc to create psymbol_cache and - macro_cache. - (free_objfile): Use bcache_xfree. - -2002-07-11 Grace Sainsbury - - * monitor.c (monitor_fetch_register): Make name a constant. - (monitor_store_register): Same. - -2002-07-11 Daniel Jacobowitz - - Based on patch from Daniel Berlin . - * buildsym.c: Include "demangle.h" for SYMBOL_INIT_DEMANGLED_NAME. - (finish_block) For non-function blocks, hash the symbol table. For - function blocks, mark the symbol table as unhashed. - * minsyms.c (msymbol_hash): Return hash value without taking modulus. - (msymbol_hash_iw): Likewise. - (add_minsym_to_hash_table): Take modulus of msymbol_hash's return - value. - (add_minsym_to_demangled_hash_table): Likewise for msymbol_hash_iw. - (lookup_minimal_symbol): Likewise for both. - * symtab.h (struct block): Add `hashtable' flag. Comment the - hashtable. - (BLOCK_HASHTABLE, BLOCK_BUCKETS, BLOCK_BUCKET): New macro. - (ALL_BLOCK_SYMBOLS): Update. - (BLOCK_SHOULD_SORT): Do not sort hashed blocks. - (struct symbol): Add `hash_next' pointer. - * symtab.c (lookup_block_symbol): Search using the hash table when - possible. - (find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS. - (search_symbols, find_addr_symbol): Likewise. - - * dstread.c (process_dst_block): Clear hashtable bit for new block. - (read_dst_symtab): Likewise. - * jv-lang.c (get_java_class_symtab): Likewise. - * mdebugread.c: Include "gdb_assert.h". - (shrink_block): Assert that the block being modified is not hashed. - * coffread.c (patch_opaque_types): Use ALL_BLOCK_SYMBOLS. - * symmisc.c (free_symtab_block): Walk the hash table when freeing - symbols. - (dump_symtab): Recognize hashed blocks. - * printcmd.c (print_frame_args): Assert that function blocks do not - have hashed symbol tables. - * ada-lang.c (symtab_for_sym): Use ALL_BLOCK_SYMBOLS. - (fill_in_ada_prototype, debug_print_block): Likewise. - (ada_add_block_symbols): Use ALL_BLOCK_SYMBOLS. Handle hash tables. - -2002-07-11 Corinna Vinschen - - * stack.c (print_frame): Use result of frame_address_in_block() - instead of fi->pc when evaluating symbols. - (backtrace_command_1): Ditto. - -2002-07-11 Andrew Cagney - - * cris-tdep.c (cris_saved_pc_after_call): Fix parameter type. - Make static. - - * arm-tdep.c (arm_register_name): Make return type constant. - -2002-07-10 Andrew Cagney - - * win32-nat.c (has_detach_ability): Convert to strict ISO C - prototype. - * top.c (gdb_rl_operate_and_get_next_completion): Ditto. - * s390-tdep.c (s390_fp_regnum): Ditto. - (s390_read_fp): Ditto. - (s390_pop_frame): Ditto. - (_initialize_s390_tdep): Ditto. - * remote.c (get_remote_state): Ditto. - * procfs.c (mappingflags): Ditto. - * memattr.c (_initialize_mem): Ditto. - * mcore-tdep.c (mcore_pop_frame): Ditto. - * m68klinux-nat.c (_initialize_m68k_linux_nat): Ditto. - * m68k-tdep.c (m68k_register_bytes_ok): Ditto. - * language.c (set_case_str): Ditto. - * gnu-v3-abi.c (vtable_address_point_offset): Ditto. - * frv-tdep.c (new_variant): Ditto. - (frv_stopped_data_address): Ditto. - * dwarf2cfi.c (fde_chunks_need_space): Ditto. - (context_alloc): Ditto. - (frame_state_alloc): Ditto. - (unwind_tmp_obstack_init): Ditto. - (unwind_tmp_obstack_free): Ditto. - (cfi_read_fp): Ditto. - * cris-tdep.c (cris_saved_pc_after_call): Ditto. - (cris_pop_frame): Ditto. - * c-lang.c (scanning_macro_expansion): Ditto. - (finished_macro_expansion): Ditto. - (c_preprocess_and_parse): Ditto. - * gdbarch.sh: Ditto. - * gdbarch.h, gdbarch.c: Regenerate. - * config/mn10200/tm-mn10200.h: Adjust indentation. - * target.c: Adjust indentation. - * symtab.h: Adjust indentation. - * stabsread.h: Adjust indentation. - * remote-es.c: Adjust indentation. - * os9kread.c: Adjust indentation. - -2002-07-10 Andrew Cagney - - * wince.c (_initialize_wince): Rename _initialize_inftarg. - * win32-nat.c (_initialize_win32_nat): Rename _initialize_inftarg. - -2002-07-10 Grace Sainsbury - - * NEWS: Mention m68k, mcore multi-arching. - * MAINTAINERS: Change status of m68k, mcore to reflect - multi-arching. - -2002-07-10 Daniel Jacobowitz - - * valops.c (find_overload_match): Free oload_syms. - -2002-07-09 Joel Brobecker - - Define HAVE_SYS_PROC_H if sys/proc.h exists - * configure.in: Add check for sys/proc.h - * config.in: Regenerate. - * configure: Regenerate. - -2002-07-09 Grace Sainsbury - - * config/m68k/tm-m68k.h: Remove macros wrapped in - #if !GDB_MULTI_ARCH. - -2002-07-08 Andrew Cagney - - * config.in, configure: Regenerate. - -2002-07-08 Mark Kettenis - - * dwarf2cfi.c: Include "gcore.h". - (execute_stack_op): Fix implementation of the - DW_OP_deref and DW_OP_deref_size operators by letting do their - lookup in the target. - -2002-07-07 Mark Kettenis - - From Peter Schauer : - * i386-sol2-tdep.c (i386_sol2_init_abi): Correct value for - tdep->sc_sp_offset. - -2002-07-05 Daniel Jacobowitz - - Fix PR gdb/595, gdb/602 - * gnu-v3-abi.c (gnuv3_baseclass_offset): Remove unused variables. - Don't call value_cast, just read the vtable pointer; update comments - to match. - -2002-07-05 Grace Sainsbury - - * config/mcore/tm-mcore.h: Remove file. - * config/mcore/mcore.mt: Remove definition of TM_FILE - * configure.tgt: Set gdb_multi_arch to yes for the mcore target. - -2002-07-05 Mark Kettenis - - * i386bsd-tdep.c: Include "gdb_string.h". - -2002-07-04 Grace Sainsbury - - * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2. - (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG,RETVAL_REGNUM): Move to - mcore-tdep. - (REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER) - (TARGET_VIRTUAL_FRAME_POINTER, BELIEVE_PCC_PROMOTION): Remove. - * mcore-tdep.c (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG) - (RETVAL_REGNUM): Move macros from tm-mcore.h - (mcore_reg_struct_has_addr): New function. - (mcore_gdbarch_init): Added initializations for the macros removed - from tm-mcore.h. - -2002-07-04 Mark Kettenis - - * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's - traditonal string branding within the ELF header. - -2002-07-04 Daniel Jacobowitz - - * symtab.c (remove_params): New function. - (make_symbol_overload_list): Use it instead of cplus_demangle. - (overload_list_add_symbol): Likewise. Reorder. Fix memory leak. - -2002-07-04 Mark Kettenis - - * i386obsd-nat.c (_initialize_i386obsd_nat): Fix typo in prototype. - - * i386bsd-tdep.c (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): - New variables. - (i386nbsd_init_abi): Use these to initialize tdep->sigtramp_start - and tdep->sigtramp_end. - * i386obsd-nat.c: New file. - * config/i386/obsd.mh (NATDEPFILES): Add i386obsd-nat.o. - - * dwarf2cfi.c (cfi_pop_frame): Use alloca() for regbuf. - Don't call get_current_frame(). - -2002-07-04 Pierre Muller - - * i386-nat.c (child_post_startup_inferior): New function - calling i386_cleanup_dregs if - I386_USE_GENERIC_WATCHPOINTS is defined. - * config/i386/nm-i386.h: define CHILD_POST_STARTUP_INFERIOR - conditional to acknowledge that i386-nat.c has its - own child_post_startup_inferior function. - -2002-07-04 Mark Kettenis - - * i386-tdep.h (I386_MAX_REGISTER_SIZE): New define. - * i386-tdep.c (i386_do_pop_frame): Use I386_MAX_REGISTER_SIZE - instead of MAX_REGISTER_RAW_SIZE. - (i386_extract_return_value, i386_extract_struct_value_address): - Convert to use regcache. - (i386_gdbarch_init): Set max_register_raw_size and - max_register_virtual_size to I386_MAX_REGISTER_SIZE. - Set extract_return_value and extract_struct_value_address instead - of their deprecated variants. - - Convert i386 target to generic dummy frames. - * i386-tdep.c: Include "symfile.h". - (i386_frameless_signal_p): Consider a function to be frameless if - the pc points at the first instruction of the function. - (i386_frame_chain): Handle (generic) call dummies. - (i386_frame_saved_pc): Likewise. - (i386_frame_init_saved_regs): Remove code dealing with call - dummies on the stack. - (i386_push_dummy_frame): Removed. - (i386_call_dummy_words): Removed. - (i386_fix_call_dummy): Removed. - (i386_push_return_address): New function. - (i386_do_pop_frame): Renamed from i386_pop_frame. Add FRAME - parameter, and don't call get_current_frame. - (i386_pop_frame): New function. - (i386_gdbarch_init): Set use_generic_dummy_frames to 1, set - call_dummy_location to AT_ENTRY_POINT, set call_dummy_address to - entry_point_address, set call_dummy_breakpoint_offset to 0, set - call_dummy_length to 0, set call_dummy_words to NULL, set - sizeof_call_dummy_words to 0, set fix_call_dummy to - generic_fix_call_dummy, set pc_in_call_dummy to - pc_in_call_dummy_at_entry_point, set push_dummy_frame to - generic_push_dummy_frame, set push_return_address to - i386_push_return_address and set frame_chain_valid to - generic_file_frame_chain_valid. - -2002-07-03 Andrew Cagney - - * gdbarch.sh (struct regcache): Add opaque declaration. - (EXTRACT_RETURN_VALUE): New architecture method. - (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto. - * gdbarch.h, gdbarch.c: Regenerate. - * arch-utils.c (legacy_extract_return_value): New function. - * arch-utils.h (legacy_extract_return_value): Declare. - * values.c (value_being_returned): Re-enable code handling - EXTRACT_STRUCT_VALUE_ADDRESS. Move - deprecated_grub_regcache_for_registers call to block handling - DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. - (EXTRACT_RETURN_VALUE): Do not define. - -2002-07-03 Grace Sainsbury - - * config/mcore/tm-mcore.h (REGISTER_BYTES, NUM_REGS, PC_REGNUM) - (SP_REGNUM, FP_REGNUM, FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK) - (BREAKPOINT_FROM_PC, INNER_THAN, SAVED_PC_AFTER_CALL) - (INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS, INIT_FRAME_PC) - (FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC) - (STORE_RETURN_VALUE, DEPRECATED_EXTRACT_RETURN_VALUE) - (STORE_STRUCT_RETURN, DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) - (SKIP_PROLOGUE, FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS) - (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, POP_FRAME) - (PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, PUSH_ARGUMENTS): Remove. - * mcore-tdep.c (mcore_init_extra_frame_info): Add fromleaf - argument so the function fits the prototype in the architecture - vector. - (mcore_pop_frame): Remove argument so the function fits the - prototype. Use get_current_frame instead of the argument. - (mcore_push_arguments): Change type of struct_return so the - function can be used in the architecture vector. - (mcore_store_struct_return): Add. - (mcore_frame_init_saved_regs): Add. - (mcore_gdbarch_init): Add function calls to replace the macros - removed from tm-mcore.h - -2002-07-03 Andrew Cagney - - * infcmd.c (print_return_value): Remove compatibility code calling - deprecated_grub_regcache_for_registers. - - * values.c: Include "regcache.h". - (value_being_returned): Update. Use - deprecated_grub_regcache_for_registers to extract the register - buffer address. - * value.h (value_being_returned): Change ``retbuf'' parameter to a - ``struct regcache''. - * Makefile.in (values.o): Add dependency on $(regcache_h). - - * inferior.h (run_stack_dummy): Change type of second parameter to - a ``struct regcache''. - * valops.c (hand_function_call): Change type of retbuf to ``struct - regcache''. Allocate using regcache_xmalloc, clean using - make_cleanup_regcache_xfree. - * infcmd.c (run_stack_dummy): Update. Use - regcache_cpu_no_passthrough instead of memcpy to copy the buffer. - - * regcache.c (do_regcache_xfree): New function. - (make_cleanup_regcache_xfree): New function. - * regcache.h (make_cleanup_regcache_xfree): Declare. - -2002-07-03 Martin M. Hunt - - * event-top.c (command_line_handler): Don't read past - beginning of buffer. - -2002-07-03 Martin M. Hunt - - * varobj.c (struct varobj_root): Change frame from CORE_ADDR to - struct frame_id. - (varobj_create): Store frame_id for root. - (varobj_gen_name): Use xasprintf. - (varobj_update): Save and restore frame using get_frame_id() and - frame_find_by_id(). - (create_child): Use xasprintf. - (new_root_variable): Initialize frame_id. - (c_name_of_child): Use xasprintf. Call find_frame_by_id(). - (c_value_of_variable): Use xasprintf. Move mem_fileopen call - to prevent memory leak. - -2002-07-03 Andrew Cagney - - * valops.c (hand_function_call): Move declaration of retbuf to - start of function, allocate using malloc, add a cleanup but before - the inf_status cleanup, cleanup the buffer. Rename local variable - old_chain to inf_status_cleanup. - -2002-07-03 Martin M. Hunt - - * top.c (execute_command): Use cmd_func() and cmd_func_p(). - - * cli/cli-decode.c (cmd_func_p): New function. - (cmd_func): New function. - - * command.h: Add cmd_func() and cmd_func_p(). - -2002-07-03 Grace Sainsbury - - * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0. - (REGISTER_SIZE): Remove. - (MAX_REGISTER_RAW_SIZE): Remove. - (REGISTER_VIRTUAL_TYPE): Remove. - (MAX_REGISTER_VIRTUAL_SIZE): Remove. - (REGISTER_NAME): Remove. - (USE_GENERIC_DUMMY_FRAMES): Remove. - (CALL_DUMMY): Remove. - (CALL_DUMMY_START_OFFSET): Remove. - (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. - (CALL_DUMMY_LOCATION): Remove. - (FIX_CALL_DUMMY): Remove. - (CALL_DUMMY_ADDRESS): Remove. - (SIZEOF_CALL_DUMMY_WORDS): Remove. - (SAVE_DUMMY_FRAME_TOS): Remove. - * mcore-tdep.c (MCORE_REG_SIZE, MCORE_NUM_REGS): Add macros. - (mcore_register_virtual_type): New function. - (mcore_register_byte): New function. - (mcore_register_size): New function. - (mcore_register_name): New function. - (mcore_gdbarch_init): New function. Add set_gdbarch calls for - macros removed from tm-mcore.h. - (mcore_dump_tdep): Add. - (_initialize_mcore_tdep): Add gdbarch_register call. - -2002-07-03 Mark Kettenis - - * i386-tdep.c (i386_frameless_signal_p): Provide an argument in to - frameless_look_for_prologue, such that we actually call this - function. - -2002-07-02 Joel Brobecker - - * frame.h (frame_address_in_block): New function. - - * blockframe.c (frame_address_in_block): New function extracted - from get_frame_block(). - (get_frame_block): Use frame_address_in_block(). - (block_innermost_frame): Use frame_address_in_block() to match - the frame pc address against the block boundaries rather than - the frame pc directly. This prevents a failure when a frame pc - is actually a return-address pointing immediately after the end - of the given block. - -2002-07-02 Grace Sainsbury - - * MAINTAINERS: Add self under write after approval. - -2002-07-02 Grace Sainsbury - - * m68k-tdep.c (m68k_remote_breakpoint_from_pc): Add. Currently not - used in architecture vector. The default is - m68k_local_breakpoint_from_pc. - (m68k_local_breakpoint_from_pc): Add. - (enum): Add register numbers from tm-m68k.h. - (m68k_gdbarch_init): Add breakpoint_from_pc to architecture - vector. - * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Set to - GDB_MULTI_ARCH_PARTIAL. - (BPT_VECTOR, REGISTER_BYTES_FP, REGISTER_BYTES_NOFP) - (NUM_FREGS, SIG_PC_FP_OFFSET, SP_ARG0, REMOTE_BPT_VECTOR): Move to - m68k-tdep.c. - (BREAKPOINT, REMOTE_BREAKPOINT): Remove. - (A1_REGNUM, FP0_REGNUM, FPC_REGNUM, FPS_REGNUM, FPI_REGNUM): Move - to enum in m68k-tdep.c - -2002-07-02 Joel Brobecker - - * solib-osf.c (open_map): Compute the list of shared libraries - loaded by the inferior, rather than the list of libraries loaded - by GDB itself. Otherwise, GDB ends up reading the symbols from - the wrong shared libraries... - -2002-07-02 Mark Kettenis - - * i386-linux-tdep.c (i386_linux_sigcontext_addr): Make static. - (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONEXT_SP_OFFSET): Remove - macros. - (i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp): - Remove functions. - (FRAMELESS_SIGNAL): Remove function. - (i386_linux_frame_chain, i386_linux_frame_saved_pc, - i386_linux_saved_pc_after_call): Removed. - (i386_linux_init_abi): Initialize tdep->sigcontext_addr, - tdep->sc_pc_offset and tdep->sc_sp_offset. Don't override - frame_chain, frame_saved_pc and saved_pc_after_call any longer. - - * i386-tdep.c (i386_frameless_signal_p): New function. - (i386_frame_chain): Deal with frameless signals. - (i386_sigtramp_saved_sp): New function. - (i386_frame_saved_pc): Deal with frameless signals. - (i386_saved_pc_after_call): Make sure the correct value is - returned just after entry into a sigtramp. - * i386bsd-tdep.c (i386bsd_sc_sp_offset, i386nbsd_sc_sp_offset, - i386fbsd4_sc_sp_offset): New variables. - (i386bsd_init_abi, i386nbsd_init_abi, i386fbsd4_init_abi): Use - these variables to initialize tdep->sc_sp_offset. * i386bsd-nat.c - (_initialize_i386bsd_nat): Add sanity check for sc_sp_offset - similiar to what we already did for sc_pc_offset. - * i386-sol2-tdep.c (i386_sol2_init_abi): Initialize - tdep->sc_sp_offset. - - * i386nbsd-tdep.c (fetch_elfcore_registers): Wrap long line. - -2002-07-02 Michal Ludvig - - * config/i386/tm-x86-64linux.h: New. - * config/i386/x86-64linux.mt: Add GDB_MULTI_ARCH and TM_FILE - definitions. - * config/i386/nm-x86-64.h: Rename to ... - * config/i386/nm-x86-64linux.h: ... this one. - * config/i386/x86-64linux.mh: Reflect the above change. - -2002-07-01 Mark Kettenis - - * i386-tdep.h (struct gdbarch_tdep): Replace sigtramp_saved_pc - with sigcontext_addr. Add sc_sp_offset. - (i386bsd_sigtramp_saved_pc): Remove prototype. - (i386bsd_sicontext_addr): Add prototype. - * i386-tdep.c (i386_sigtramp_saved_pc): New function. - (i386_frame_saved_pc): Rewrite to call i386_sigtramp_saved_pc. - (i386_svr4_sigtramp_saved_pc): Removed. - (i386_svr4_sigcontext_addr): New function. - (i386_svr4_init_abi): Don't initialize tdep->sigtramp_saved_pc. - Initialize tdep->sigcontext_addr instead. Initialize - tdep->sc_pc_offset and tdep->sc_sp_offset. - (i386_gdbarch_init): Likewise. - * i386bsd-tdep.c (i386bsd_sigcontext_addr): Don't make it static - any more. - (i386bsd_sigtramp_saved_pc): Remove function. - (i386bsd_init_abi): Don't initialize tdep->sigtramp_saved_pc. - Initialize tdep->sigcontext_addr instead. Initialize - tdep->sc_pc_offset. - * i386-linux-tdep.c (i386_linux_init_abi): Remove initialization - of tdep->sigtramp_saved_pc. - * i386-sol2-tdep.c (i386_sol2_init_abi): Don't initialize - tdep->sigtramp_saved_pc. Initialize tdep->sigcontext_addr - instead. - - * i386-tdep.c (i386_frameless_function_invocation, - i386_frame_num_args, i386_frame_init_saved_regs, - i386_skip_prologue, i386_push_dummy_frame, i386_fix_call_dummy, - i386_pop_frame, i386_push_arguments, i386_store_struct_return, - i386_extract_return_value, i386_store_return_value, - i386_extract_struct_value_address, i386_register_virtual_type, - i386_register_convertible, i386_register_convert_to_virtual, - i386_register_convert_to_raw, i386_svr4_sigtramp_saved_pc, - i386_go32_init_abi, i386_nw_init_abi, i386_gdbarch_init): Make - static. - -2002-07-01 Mark Kettenis - - * i386bsd-tdep.c (i386bsd_frame_saved_pc): Removed. - - * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Removed. - * i386-sol2-tdep.c (i386_sol2_init_abi): Adjust for the removal of - this macro. Include "value.h". - -2002-06-30 Aidan Skinner - - * ada-exp.tab.c: remove as it's a generated file - * ada-lex.c: remove as it's a generated file - -2002-06-30 Mark Kettenis - - * config/i386/tm-i386.h (struct frame_info, struct - frame_saved_regs, struct value, struct type): Remove forward - declarations. - - * config/i386/tm-linux.h [HAVE_PTRACE_GETFPXREGS] - (FILL_FPXREGSET, HAVE_SSE_REGS): Remove define. - * config/i386/nm-linux.h [HAVE_PTRACE_GETFPXREGS] - (FILL_FPXREGSET): Define. - - * config/i386/tm-nbsd.h (HAVE_SSE_REGS): Remove define. - - * configure.tgt (i[3456]86-*-openbsd*): Fold into - i[3456]86-*-netbsd* case. - * config/i386/tm-obsd.h: Removed. - * config/i386/obsd.mt: Removed. - * config/i386/obsd.mh (NATDEPFILES): Remove corelow.o and - core-aout.o. - (MH_CFLAGS): Add -DYYDEBUG=0. - - * i386bsd-nat.c (_initialize_i386bsd_nat): Define SC_PC_OFFSET to - i386nbsd_sc_pc_offset on OpenBSD too. - - * config/i386/tm-fbsd.h [!SVR4_SHARED_LIBS] - (IN_SOLIB_CALL_TRAMPOLINE): Remove define. - * config/i386/tm-nbsdaout.h (IN_SOLIB_CALL_TRAMPOLINE): Remove - define. - * i386bsd-tdep.c: Include "arch-utils.h". - (i386bsd_aout_in_solib_call_trampoline): New function. - (i386bsd_init_abi): Set in_solib_call_trampoline to - i386bsd_aout_in_solib_call_trampoline. - (i386nbsdelf_init_abi, i386fbsd_init_abi): Set - in_solib_call_trampoline to generic_in_solib_call_trampoline. - -2002-06-28 Andrew Cagney - - * macrotab.h: Do not include "obstack.h" or "bcache.h". - (struct obstack, struct bcache): Add opaque declarations. - * Makefile.in (macrotab_h): Update - -2002-06-28 Andrew Cagney - - * blockframe.c (generic_find_dummy_frame): Change return type to - ``struct regcache''. - (struct dummy_frame): Replace field ``registers'' with regcache, a - struct regcache object. - (generic_find_dummy_frame): Update. - (generic_push_dummy_frame): Update. Use regcache_xfree, - regcache_xmalloc and regcache_cpy. - (generic_pop_dummy_frame): Update. Use regcache_cpy and - regcache_xfree. - (deprecated_generic_find_dummy_frame): Update. - (generic_read_register_dummy): Update. Use - regcache_read_as_address. - (generic_call_dummy_register_unwind): Update. Use regcache_read. - (generic_get_saved_register): Update. Use regcache_read. - -2002-06-28 Andrew Cagney - - * Makefile.in (objfiles_h): Add $(bcache_h). - * objfiles.h: Include "bcache.h". - - * Makefile.in (symtab_h): Remove $(bcache_h). - * symtab.h: Do not include "bcache.h". - -2002-06-28 Andrew Cagney - - * ppcnbsd-tdep.c (ppcnbsd_init_abi): Set frame_chain_valid to - generic_func_frame_chain_valid. - -2002-06-28 David O'Brien - - * config/i386/nm-fbsd.h: Include . - * config/i386/tm-fbsd.h: Likewise. - -2002-06-28 Andrew Cagney - - * rs6000-tdep.c (rs6000_gdbarch_init): Use - generic_unwind_get_saved_register. - -2002-06-27 Andrew Cagney - - From 2002-06-27 John David Anglin : - * regcache.c (supply_register): Add missing argument to - register_buffer call. - -2002-06-27 Andrew Cagney - - * Makefile.in (init.c): Drop -e option to grep. Not necessary and - Solaris /bin/grep does not not like it. From Peter Schauer. - -2002-06-26 Tom Tromey - - * command.h (add_setshow_cmd): Declare. - (add_setshow_cmd_full): Declare. - * cli/cli-decode.c (add_setshow_cmd): No longer static. Now - returns void. Use add_setshow_cmd_full. - (add_setshow_cmd_full): New function. - (add_setshow_auto_boolean_cmd): Use add_setshow_cmd_full. - (add_setshow_boolean_cmd): Likewise. - -2002-06-26 Jason Thorpe - - * config/vax/tm-vax.h: Protect from multiple inclusion. - (TARGET_UPAGES, TARGET_NBPG, STACK_END_ADDR) - (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Move to... - * config/vax/tm-vaxbsd.h: ...here. New file. - * config/vax/vax.mt (TM_FILE): Set to tm-vaxbsd.h. - -2002-06-26 Jason Thorpe - - * config/vax/tm-vax.h (BREAKPOINT): Remove. - (BELIEVE_PCC_PROMOTION): Remove. - (AP_REGNUM): Move to... - * config/vax/nm-vax.h: ...here. - * vax-tdep.c: Use VAX_AP_REGNUM instead of AP_REGNUM. - (vax_breakpoint_from_pc): New function. - (vax_gdbarch_init): Initialize gdbarch_breakpoint_from_pc - and gdbarch_believe_pcc_promotion. - -2002-06-26 Jason Thorpe - - * Makefile.in (vax_tdep_h): Define. - (vax-tdep.o): Use $(vax_tdep_h). - * vax-tdep.c (vax_gdbarch_init): Use generic OS ABI framework. - (vax_dump_tdep): New function. - (_initialize_vax_tdep): Register vax_dump_tdep. - * vax-tdep.h: Include osabi.h. - (struct gdbarch_tdep): New. - -2002-06-26 Andrew Cagney - - * frame.h (deprecated_generic_find_dummy_frame): Rename - generic_find_dummy_frame. - * blockframe.c (generic_find_dummy_frame): Make static. - (deprecated_generic_find_dummy_frame): New function. - * sh-tdep.c (sh_nofp_frame_init_saved_regs): Replace - generic_find_dummy_frame with deprecated_find_dummy_frame. - (sh64_nofp_frame_init_saved_regs): Ditto. - (sh_fp_frame_init_saved_regs): Ditto. - * s390-tdep.c (s390_frame_saved_pc_nofix): Ditto. - (s390_frame_chain): Ditto. - * cris-tdep.c (cris_frame_init_saved_regs): Ditto. - -2002-06-26 Grace Sainsbury - - * config/m68k/tm-m68k.h: Rearrange code so macros not in the - gdbarch vector are at the top. - (NUM_REGS): Remove. - (FP_REGNUM, SP_REGNUM, PS_REGNUM, PC_REGNUM, FP0_REGNUM): Remove. - (FRAME_ARGS_ADDRESS): Remove. - (FRAME_LOCALS_ADDRESS): Remove. - (FRAME_NUM_ARGS): Remove. - (FRAME_ARGS_SKIP): Remove. - * m68k-tdep.c (enum): Add eumeration of special register numbers. - (m68k_gdbarch_init): Add gdbarch initializations for macros - undefined in tm-m68k.h - -2002-06-26 Grace Sainsbury - - * monitor.h: Add the function regname to monitor_ops - structure. This way NUM_REGS does not have to be a constant. - * monitor.c (monitor_fetch_register): Added support for regname - function. The function is called if the array regnames is NULL. - (monitor_store_register): Same. - * cpu32bug-rom.c (cpu32bug_regname): Add function. Replaces - regnames array. - (init_cpu32bug_cmds): set cpu32bug_cmds.regnames to NULL, - cpu32bug_cmds.regname to point to new function. - * abug-rom.c (abug_regname): Same as above. - (init_abug_cmds): Same. - * dbug-rom.c (dbug_regname): Same as above. - (init_dbug_cmds): Same. - * remote-est.c (est_regname): Same. - (init_est_cmds): Same. - * rom68k-rom.c (rom68k_regname): Same. - (init_rom68k_cmds): Same. - -2002-06-25 Tom Tromey - - * breakpoint.c (delete_command): Don't repeat `delete' commands. - -2002-06-25 Andrew Cagney - - * infrun.c (stop_registers): Change variable's type to ``struct - regcache'''. - (xmalloc_inferior_status): Delete function. - (free_inferior_status): Delete function. - (normal_stop): Use regcache_cpy. - (struct inferior_status): Change type of fields ``stop_registers'' - and ``registers'' to ``struct regcache''. - (write_inferior_status_register): Use regcache_write. - (save_inferior_status): Instead of calling - xmalloc_inferior_status, allocate the inf_status buffer directly. - Use regcache_dup_no_passthrough and regcache_dup to save the - buffers. - (restore_inferior_status): Use regcache_xfree and regcache_cpy. - Replace the stop_registers regcache instead of overriding it. Use - regcache_xfree. Instead of calling free_inferior_status, xfree - the buffer directly. - (discard_inferior_status): Use regcache_xfree. Instead of calling - free_inferior_status, xfree the buffer directly. - (build_infrun): Use regcache_xmalloc. - (_initialize_infrun): Delete redundant call to build_infrun. - - * Makefile.in (infcmd.o): Add $(regcache_h). - - * infcmd.c: Include "regcache.h". - (run_stack_dummy): Use deprecated_grub_regcache_for_registers to - obtain the address of `stop_registers' register buffer. - (print_return_value): Ditto. - - * inferior.h (struct regcache): Add opaque declaration. - (stop_registers): Change variable's declared type to ``struct - regcache''. - -2002-06-24 Tom Tromey - - * cli/cli-decode.c (add_show_from_set): Fixed typo in comment. - * target.c (initialize_targets): Fixed typo in - trust-readonly-sections `show' documentation. - - * main.c: Marked all strings with _(). - -2002-06-24 Don Howard - - * memattr.c (create_mem_region): Treat hi == 0 as a special case - that means max CORE_ADDR+1. - (lookup_mem_region): Ditto. - (mem_info_command): Ditto. - -2002-06-24 Grace Sainsbury - - * config/m68k/tm-m68k.h (DECR_PC_AFTER_BREAK): Remove. - (REGISTER_BYTES_OK): Remove. - (REGISTER_BYTES): Remove. - (STORE_STRUCT_RETURN): Remove. - (DEPRECATED_EXTRACT_RETURN_VALUE): Remove. - (STORE_RETURN_VALUE): Remove. - (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. - (FRAME_CHAIN): Remove. - (FRAMELESS_FUNCTION_INVOCATION): Remove. - (FRAME_SAVED_PC): Remove. - * m68k-tdep.c (m68k_register_bytes_ok):Add. - (m68k_store_struct_return): Add. - (m68k_deprecated_extract_return_value): Add. - (m68k_deprecated_extract_struct_value_address): Add. - (m68k_store_return_value): Add. - (m68k_frame_chain): Add. - (m68k_frameless_function_invocation): Add. - (m68k_frame_saved_pc): Add. - (m68k_gdbarch_init): added set_gdbarch calls for new - functions and deleted macros. - -2002-06-23 Tom Tromey - - * Makefile.in (HFILES_NO_SRCDIR): Remove old files. - (ALLDEPFILES): Likewise. - (udiheaders): Removed. - (udip2soc.o): Likewise. - (udi2go32.o): Likewise. - (udr.o): Likewise. - (HFILES_WITH_SRCDIR): Don't mention udiheaders. - -2002-06-22 Andrew Cagney - - * infrun.c (_initialize_infrun): Delete unnecessary call to - build_infrun. - - * regcache.h: Update comments describing the regcache_cpy family - of functions. - (regcache_save, regcache_restore): Delete declaration. - (regcache_save_no_passthrough): Delete declaration. - (regcache_restore_no_passthrough): Delete declaration. - * regcache.c (regcache_save): Delete function. - (regcache_save_no_passthrough): Delete function. - (regcache_restore): Delete function. - (regcache_restore_no_passthrough): Delete function. - -2002-06-21 Andrew Cagney - - * config/m68k/tm-m68k.h: Fix typo. - (FRAME_INIT_SAVED_REGS): Define when non-multi-arch. - (m68k_frame_init_saved_regs): Declare. - -2002-06-21 Jim Blandy - - Remove some vestiges of Harris 88k support. - * dwarf2read.c (decode_locdesc): Remove `#if' block for Harris 88k - register numbering quirk. - * elfread.c (elf_symtab_read): Remove `#if' block for skipping - odd symbols occurring in Harris 88k ELF targets. - -2002-06-21 Tom Tromey - - * gdb_locale.h: New file. - * Makefile.in (GDB_CFLAGS): Define LOCALEDIR. - (defs_h): Added gdb_locale.h. - * configure, config.in: Rebuilt. - * configure.in (PACKAGE): Define. - * defs.h: Include gdb_locale.h. - * main.c (captured_main): Call setlocale, bindtextdomain, - textdomain. - -2002-06-21 Dave Brolley - - From Stan Shebs, Jim Blandy, Mark Salter, Kevin Buettner: - * config/frv/frv.mt: New file. - * config/frv/tm-frv.h: New file. - * configure.tgt: Support frv-*-*. - * Makefile.in (frv-tdep.o): New target. - * frv-tdep.c: New file. - * NEWS: Mention frv. - -2002-06-21 Dave Brolley - - * MAINTAINERS: Add self to "Write After Approval" list. - -2002-06-21 Grace Sainsbury - - * config/m68k/tm-m68k.h (REGISTER_BYTE, REGISTER_RAW_SIZE) - (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) - (REGISTER_VIRTUAL_TYPE, REGISTER_NAMES, TARGET_LONG_DOUBLE_FORMAT) - (FUNCTION_START_OFFSET, SKIP_PROLOGUE, SAVED_PC_AFTER_CALL) - (INNER_THAN, STACK_ALIGN, REGISTER_SIZE): Remove macros. - - * m68k-tdep.c: Include arch-utils.h - (m68k_register_raw_size): Add. - (m68k_register_virtual_size): Add. - (m68k_register_virtual_type): Add. - (m68k_register_name): Add. - (m68k_stack_align): Add. - (m68k_register_byte): Add. - (m68k_gdbarch_init): Add set_gdbarch calls for macros removed in - tm-m68k.h. - -2002-06-21 Grace Sainsbury - - * m68k-tdep.c (m68k_frame_init_saved_regs): Replace - m68k_find_saved_regs. - (m68k_pop_frame): Removed saved_regs structure, and replaced - references to it with frame->saved_regs. - (m68k_gdbarch_init): Added function calls to initialize the - gdbarch structure. - (m68k_fix_call_dummy): Add. - * config/m68k/tm-m68k.h: (FRAME_FIND_SAVED_REGS): Remove. - (CALL_DUMMY): Remove. - (CALL_DUMMY_LENGTH): Remove. - (CALL_DUMMY_START_OFFSET): Remove. - (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. - (FIX_CALL_DUMMY): Remove. - (PUSH_DUMMY_FRAME): Remove. - (POP_FRAME): Remove. - -2002-06-19 Pierre Muller - - * parse.c (parse_fprintf): New function used to avoid calls to - fprintf in bison parser generated debug code. - * parser-defs.h: Declaration of new parse_fprintf function. - * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y: - Set YYDEBUG to 1 by default. - Set YYFPRINTF as parse_fprintf. - -2002-06-21 Michal Ludvig - - * dwarf2cfi.c (read_encoded_pointer): Don't handle pointer - encoding anymore. - (pointer_encoding, enum ptr_encoding): New. - (execute_cfa_program): Take care about pointer encoding. - (dwarf2_build_frame_info): Only call parse_frame_info for - .debug_frame and .eh_frame. - (parse_frame_info): New, derived from former dwarf2_build_frame_info. - fixed augmentation handling, added relative addressing, - ignore duplicate FDEs. Added comments. - * dwarf2cfi.c: Reindented. - -2002-06-20 Elena Zannoni - - * event-top.c (command_handler): Don't use space_at_cmd_start - unless there is sbrk() on the host. Assign time and space data - to union fields of the appropriate length. - -2002-06-20 Michal Ludvig - - * x86-64-tdep.c (x86_64_register_nr2name): Rename to - x86_64_register_name. Return type changed to 'const char *'. - (x86_64_register_name2nr): Rename to x86_64_register_number. - (x86_64_gdbarch_init): Update to reflect the change. - * x86-64-tdep.h: Ditto. - * x86-64-linux-nat.c (x86_64_fxsave_offset) - (supply_fpregset): Ditto. - -2002-06-19 Andrew Cagney - - * regcache.h: Update copyright. - (struct regcache, struct gdbarch): Add opaque declarations. - (current_regcache): Declare global variable. - (regcache_read, regcache_write): Add gdbarch parameter. - (regcache_save, regcache_save_no_passthrough) - (regcache_restore, regcache_restore_no_passthrough) - (regcache_dup, regcache_dup_no_passthrough) - (regcache_cpy, regcache_cpy_no_passthrough) - (deprecated_grub_regcache_for_registers) - (deprecated_grub_regcache_for_register_valid) - (regcache_valid_p): Add function declarations. - - * regcache.c: Update copyright. - (regcache_descr_handle): New global variable. - (struct regcache_descr): Define. - (init_legacy_regcache_descr, init_regcache_descr): New functions. - (regcache_descr, xfree_regcache_descr): New functions. - (struct regcache): Define. - (regcache_xmalloc, regcache_xfree): New functions. - (regcache_cpy, regcache_cpy_no_passthrough): New functions. - (regcache_dup, regcache_dup_no_passthrough): New functions. - (regcache_valid_p, regcache_read_as_address): New functions. - (deprecated_grub_regcache_for_registers): New function. - (deprecated_grub_regcache_for_register_valid): New function. - (current_regcache): New global variable. - (register_buffer): Add regcache parameter. Update calls. - (regcache_read, regcache_write): Add regcache parameter. Rewrite. - (read_register_gen, write_register_gen): Update register_buffer - call. Test for legacy_p instead of gdbarch_register_read_p or - gdbarch_register_write_p. - (regcache_collect): Update register_buffer call. - (build_regcache): Rewrite. Use deprecated grub functions. - (regcache_save, regcache_save_no_passthrough): New functions. - (regcache_restore, regcache_restore_no_passthrough): New - functions. - (_initialize_regcache): Create the regcache_data_handle. Swap - current_regcache global variable. - - * sh-tdep.c (sh_pseudo_register_read): Add current_regcache - parameter to regcache_read and regcache_write calls. - (sh4_register_read): Ditto. - (sh64_pseudo_register_read): Ditto. - (sh64_register_read): Ditto. - (sh_pseudo_register_write): Ditto. - (sh4_register_write): Ditto. - (sh64_pseudo_register_write): Ditto. - (sh64_register_write): Ditto. - - * defs.h (XCALLOC): Define. - -2002-06-19 Grace Sainsbury - - * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Added (set to 0). - * m68k-tdep.c (m68k_gdbarch_init): Added. - (m68k_dump_tdep): Added. - -2002-06-19 Daniel Jacobowitz - - * ada-lang.c (fill_in_ada_prototype): Update comment. - -2002-06-19 Daniel Jacobowitz - - * mips-tdep.c (enum mips_abi): Explicitly start at 0. Add - MIPS_ABI_LAST. - (mips_abi_string, mips_abi_strings): New. - (struct gdbarch_tdep): Remove mips_abi_string, add found_abi. - (mips_gdbarch_init): Set tdep->found_abi. Don't set - tdep->mips_abi_string. Honor mips_abi_string. Default to - O32 if no ABI is found. - (mips_dump_tdep): Use mips_abi_strings. - (mips_abi_update): New function. - (_initialize_mips_tdep): Initialize mips_abi_string. Add - ``set mips abi'' and ``show mips abi''. Check the size of - mips_abi_strings. - -2002-06-19 Andrew Cagney - - * i386-linux-tdep.c (i386_linux_register_name): Make return type - constant. - -2002-06-18 Joel Brobecker - - * alpha-tdep.c (heuristic_proc_desc): Compute the size of the - current frame using only the first stack size adjustment. All - subsequent size adjustments are not considered to be part of - the "static" part of the current frame. - Compute the address of the saved registers relative to the - Frame Pointer ($fp) instead of the Stack Pointer if $fp is - in use in this frame. - -2002-06-18 Don Howard - - * valops.c (value_ind): Use value_at_lazy() when dereferencing - type int expressions. Thanks to Jim Blandy for - suggesting this solution. - -2002-06-18 Andrew Cagney - - * config/romp/xm-rtbsd.h: Delete file. - * config/romp/rtbsd.mh: Delete file. - -2002-06-18 Keith Seitz - - * breakpoint.c (condition_command): Post breakpoint_modify - when a condition is added to an existing breakpoint. - (commands_command): Likewise for commands. - (set_ignore_count): Likewise for ignore counts. - If no tty, do not simply return, still need to send event - notification. - (ignore_command): Only print a newline if the command came - from a tty. - Don't call breakpoints_changed, since this is now properly - handled by set_ignore_count. - -2002-06-18 Andrew Cagney - - * MAINTAINERS: Note that cris-elf target can be compiled with - -Werror. - * cris-tdep.c (cris_register_name): Make return type constant. - (cris_breakpoint_from_pc): Ditto. - -2002-06-18 Michal Ludvig - - * frame.h (struct frame_info): Change type of context to - 'struct context'. - -2002-06-17 Andrew Cagney - - * gdbarch.sh (REGISTER_NAME): Change return type a constant string - pointer. - * gdbarch.h, gdbarch.c: Regenerate. - * config/mips/tm-mips.h (mips_register_name): Update. - * i386-tdep.h (i386_register_name): Update. - * mips-tdep.c (mips_register_name): Update - * alpha-tdep.c (alpha_register_name): Update. - * arch-utils.c (legacy_register_name): Update. - * arch-utils.h (legacy_register_name): Update. - * avr-tdep.c (avr_register_name): Update. - * ia64-tdep.c (ia64_register_name): Update. - * i386-tdep.c (i386_register_name): Update. - * sparc-tdep.c (sparc32_register_name): Update. - (sparc64_register_name): Update. - (sparclite_register_name): Update. - (sparclet_register_name): Update. - * sh-tdep.c (sh_generic_register_name): Update. - (sh_sh_register_name): Update. - (sh_sh3_register_name): Update. - (sh_sh3e_register_name): Update. - (sh_sh_dsp_register_name): Update. - (sh_sh3_dsp_register_name): Update. - (sh_sh4_register_name): Update. - (sh_sh64_register_name): Update. - * s390-tdep.c (s390_register_name): Update. - * rs6000-tdep.c (rs6000_register_name): Update. - * ns32k-tdep.c (ns32k_register_name_32082): Update. - (ns32k_register_name_32382): Update. - * d10v-tdep.c (d10v_ts2_register_name): Update. - (d10v_ts3_register_name): Update. - * xstormy16-tdep.c (xstormy16_register_name): Update. - * vax-tdep.c (vax_register_name): Update. - * v850-tdep.c (v850_register_name): Update. - * m68hc11-tdep.c (m68hc11_register_name): Update. - * mn10300-tdep.c (mn10300_generic_register_name): Update. - (am33_register_name): Update. - -2002-06-17 Grace Sainsbury - - * m68k-tdep.c: Reindented. - -2002-06-17 Andrew Cagney - - * gdb_indent.sh: Add prgregset_t, fpregset_t, and gregset_t to the - list of predefined types. - -2002-06-16 Mark Kettenis - - * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE, - REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL, - REGISTER_CONVERT_TO_RAW): Remove defines. - (i386_register_virtual_type, i386_register_convertible, - i386_register_convert_to_virtual, i386_register_convert_to_raw): - Remove prototypes. - * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the - macros mentioned above. - - * config/i386/tm-i386lynx.h (SAVED_PC_AFTER_CALL): Remove define. - (i386lynx_saved_pc_after_call): Remove prototype. - * i386ly-tdep.c: Include "i386-tdep.h". - (i386lynx_saved_pc_after_call): Make static. Use - read_memory_nobpt instead of read_memory. Use - read_memory_unsigned_integer instead of read_memory_integer. - (i386lynx_init_abi): New function. - (i386lynx_coff_osabi_sniffer): New function. - (_initialize_i386bsd_tdep): New function. - - * config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY, - CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET, - CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Remove defines. - (i386_fix_call_dummy): Remove prototype. - * i386-tdep.c (i386_call_dummy_words): New variable. - (i386_gdbarch_init): Adjust for removal of the - macros mentioned above. - -2002-06-15 Andrew Cagney - - * command.h (add_setshow_auto_boolean_cmd): Replace - add_set_auto_boolean_cmd. - * cli/cli-decode.c (add_setshow_auto_boolean_cmd): Replace - add_set_auto_boolean_cmd. - * cli/cli-decode.h (add_set_auto_boolean_cmd): Delete declaration. - * mips-tdep.c (_initialize_mips_tdep): Update ``set mips - mask-address'' command. - (show_mask_address): Add cmd parameter. - * remote.c (add_packet_config_cmd): Update. Change type of - set_func and show_func to cmd_sfunc_ftype. - (_initialize_remote): Update `set remote Z-packet' - (show_remote_protocol_qSymbol_packet_cmd): Add cmd parameter. - (show_remote_protocol_e_packet_cmd): Ditto. - (show_remote_protocol_E_packet_cmd): Ditto. - (show_remote_protocol_P_packet_cmd): Ditto. - (show_remote_protocol_Z_software_bp_packet_cmd): Ditto. - (show_remote_protocol_Z_hardware_bp_packet_cmd): Ditto. - (show_remote_protocol_Z_write_wp_packet_cmd): Ditto. - (show_remote_protocol_Z_read_wp_packet_cmd): Ditto. - (show_remote_protocol_Z_access_wp_packet_cmd): Ditto. - (show_remote_protocol_Z_packet_cmd): Ditto. - (show_remote_protocol_binary_download_cmd): Ditto. - (show_remote_cmd): Pass NULL to all of above. - -2002-06-15 Mark Kettenis - - * config/i386/tm-i386.h (PUSH_ARGUMENTS, STORE_STRUCT_RETURN, - DEPRECATED_EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, - DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS, PUSH_DUMMY_FRAME, - POP_FRAME): Remove defines. - (i386_push_arguments, i386_store_struct_return, - i386_extract_return_value, i386_store_return_value, - i386_extract_struct_value_address, i386_push_dummy_frame, - i386_pop_frame): Renove prototypes. - * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the - macros mentioned above. - -2002-06-15 Andrew Cagney - - * cli/cli-decode.c (add_setshow_boolean_cmd): Replace - add_set_boolean_cmd. - (add_setshow_cmd): New function. - * command.h (add_setshow_boolean_cmd): Replace - add_set_boolean_cmd. - * remote-rdi.c (_initialize_remote_rdi): Update ``set rdiheartbeat'' - and ``set rdiromatzero''. - * maint.c (_initialize_maint_cmds): Update commented out code. - * cli/cli-decode.h (add_set_boolean_cmd): Delete declaration. - * target.c (initialize_targets): Update `set - trust-readonly-sections'. - * remote.c (_initialize_remote): Update `set remotebreak'. - -2002-06-15 Mark Kettenis - - * config/i386/tm-i386.h (FUNCTION_START_OFFSET, INNER_THAN, - BREAKPOINT, DECR_PC_AFTER_BREAK): Removed. - * i386-tdep.c (i386_skip_prologue): Adjust function signature to - fit into multi-arch framework. - (i386_breakpoint_from_pc): New function. - (i386_gdbarch_init): Adjust for removal of the macros mentioned - above. - - * config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION, - FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, - FRAME_ARGS_SKIP, FRAME_INIT_SAVED_REGS): Remove defines. - (i386_frameless_function_invocation, i386_frame_num_args, - i386_frame_init_saved_regs): Remove prototypes. - * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the - macros mentioned above. - -2002-06-15 Andrew Cagney - - * cli/cli-decode.c (set_cmd_cfunc): Update. - (set_cmd_sfunc): Update. - * command.h (cmd_cfunc_ftype, cmd_sfunc_ftype): Declare. - (set_cmd_sfunc, set_cmd_cfunc): Update. - * cli/cli-decode.h: Update. - -2002-06-15 Mark Kettenis - - * i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function. - (_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer. - -2002-06-15 Andrew Cagney - - * defs.h (auto_boolean): Declare enum. - * command.h (cmd_auto_boolean): Delete enum. - * mips-tdep.c (mask_address_var): Update. - (mips_mask_address_p): Update. - (show_mask_address): Update. - * remote.c (struct packet_config): Update. - (update_packet_config): Update. - (show_packet_config_cmd): Update. - (packet_ok): Update. - (add_packet_config_cmd): Update. - (_initialize_remote): - * command.h: Update. - * cli/cli-setshow.c (parse_auto_binary_operation): Update. - (do_setshow_command): Update. - * cli/cli-decode.c (add_set_auto_boolean_cmd): Update. - * cli/cli-decode.h: Update. - -2002-06-15 Mark Kettenis - - * config/i386/tm-cygwin.h, config/i386/tm-fbsd.h, - config/i386/tm-go32.h, config/i386/tm-i386gnu.h, - config/i386/tm-i386sol2.h, config/i386/tm-i386v4.h, - config/i386/tm-linux.h, config/i386/tm-nbsd.h, - config/i386/tm-obsd.h (HAVE_I387_REGS): Remove define. - * config/i386/tm-i386.h: Unconditionally define FLOAT_INFO. - - * i386-tdep.c (i386_coff_osabi_sniffer): Add "coff-go32" to the - list of DJGPP COFF targets. - - * config/i386/tm-i386.h (REGISTER_SIZE): Remove define. - (NUM_GREGS, NUM_FREGS, NUM_SSE_REGS): Remove defines. - (FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove defines. - (FP0_REGNUM): Remove define. - (MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE, - MAX_REGISTER_VIRTUAL_SIZE): Remove define. - (i386_register_virtual_size): Remove protoype. - * i386-tdep.c (i386_register_virtual_size): Removed. - (i386_extract_return_value, i386_store_return_value): Use - FP0_REGNUM instead of NUM_FREGS to determine whether the - floating-point registers are available. - (i386_gdbarch_init): Tweak FIXME about FPU registers. - Adjust for removal of macros mentioned above. - -2002-06-15 Mark Kettenis - - * i386v4-nat.c: Include "i386-tdep.h". Reformat and tweak various - comments. - (fill_gregset, supply_gregset, supply_fpregset, fill_fpregset): - Remove prototypes. - (supply_gregset, fill_gregset): Remove use of register keyword and - remove declaration for regmap. Use I386_NUM_GREGS instead of - NUM_REGS and NUM_FREGS. - (FPREGSET_FSAVE_OFFSET): Remove. - (supply_fpregset, fill_fpregset): Use FPO_REGNUM instead of - NUM_FREGS to determine whether the floating-point registers are - available. - - * i386gnu-nat.c (supply_gregset, gnu_fetch_registers, - gnu_store_registers): Replace usage of NUM_GREGS with - I386_NUM_GREGS. - - * i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER, - OLD_CANNOT_STORE_REGISTER, supply_gregset, fill_gregset): Replace - usage of NUM_GREGS with I386_NUM_GREGS. - - * i386-linux-nat.c (fill_gregset): Remove redundant parentheses. - - * i386bsd-nat.c: Include "i386-tdep.h". - (supply_gregset, fill_gregset): Replace usage of NUM_GREGS with - I386_NUM_GREGS. - - * i386v-nat.c: Remove copnditional inclusion of , - and associated comment. They no longer make any sense, since we - don't use this file anymore on Linux. - - * config/i386/tm-i386.h (MAX_NUM_REGS): Removed. - * i386-tdep.c (i386_register_offset, i386_register_size): Use - I386_SSE_NUM_REGS instead of MAX_NUM_REGS for the number of - elements in these arrays. - (_initialize_i386_tdep): Use I386_SSE_NUM_REGS instead of - MAX_NUM_REGS. - -2002-06-15 Mark Kettenis - - * osabi.h (gdb_osabi): Add GDB_OSABI_LYNXOS. - * osabi.c (gdb_osabi_names): Add entry for "LynxOS". - -2002-06-14 Andrew Cagney - - * gdbarch.sh (DEPRECATED_EXTRACT_RETURN_VALUE): Rename - EXTRACT_RETURN_VALUE. - (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Rename - EXTRACT_STRUCT_VALUE_ADDRESS. - * gdbarch.h, gdbarch.c: Regenerate. - - * values.c (value_being_returned): Handle - DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. - (EXTRACT_RETURN_VALUE): Define as DEPRECATED_EXTRACT_RETURN_VALUE. - - * arm-linux-tdep.c (arm_linux_init_abi): Update. - * arm-tdep.c (arm_gdbarch_init): Update. - * avr-tdep.c (avr_gdbarch_init): Update. - * cris-tdep.c (cris_gdbarch_init): Update. - * d10v-tdep.c (d10v_gdbarch_init): Update. - * ia64-tdep.c (ia64_gdbarch_init): Update. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. - * rs6000-tdep.c (rs6000_gdbarch_init): Update. - * s390-tdep.c (s390_gdbarch_init): Update. - * sh-tdep.c (sh_gdbarch_init): Update. - * s390-tdep.c (s390_gdbarch_init): Update. - * sparc-tdep.c (sparc_gdbarch_init): Update. - * ns32k-tdep.c (ns32k_gdbarch_init): Update. - * v850-tdep.c (v850_gdbarch_init): Update. - * vax-tdep.c (vax_gdbarch_init): Update. - * x86-64-tdep.c (x86_64_gdbarch_init): Update. - * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. - - * config/arc/tm-arc.h: Update. - * config/d30v/tm-d30v.h: Update. - * config/fr30/tm-fr30.h: Update. - * config/h8300/tm-h8300.h: Update. - * config/h8500/tm-h8500.h: Update. - * config/i386/tm-i386.h: Update. - * config/i386/tm-ptx.h: Update. - * config/i386/tm-symmetry.h: Update. - * config/i960/tm-i960.h: Update. - * config/m32r/tm-m32r.h: Update. - * config/m68k/tm-delta68.h: Update. - * config/m68k/tm-linux.h: Update. - * config/m68k/tm-m68k.h: Update. - * config/m88k/tm-m88k.h: Update. - * config/mcore/tm-mcore.h: Update. - * config/mips/tm-mips.h: Update. - * config/mn10200/tm-mn10200.h: Update. - * config/pa/tm-hppa.h: Update. - * config/pa/tm-hppa64.h: Update. - * config/sparc/tm-sp64.h: Update. - * config/sparc/tm-sparc.h: Update. - * config/sparc/tm-sparclet.h: Update. - * config/z8k/tm-z8k.h: Update. - -2002-06-14 Andrew Cagney - - * Makefile.in (i386_linux_tdep_h): Define. - (i386_tdep_h, i387_tdep_h): Define. - (i386-linux-nat.o): Add $(i386_linux_tdep_h), - $(i386_tdep_h) and $(i387_tdep_h). - * i386-linux-nat.c: Include "i386-linux-tdep.h". - -2002-06-14 Mark Kettenis - - * config/i386/tm-i386.h (START_INFERIOR_TRAPS_EXPECTED): Removed. - Already covered by the default. - - * config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT, - TARGET_LONG_DOUBLE_BIT): Remove. * i386-tdep.c - (i386_gdbarch_init): Initialize long_double_format and long_double - bit. - - * config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and - i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. - Move these to ... - * config/i386/i386sol2.mh: ... here. - * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. - (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. - (SIGCONTEXT_PC_OFFSET): Remove define. - (IN_SIGTRAMP): Remove define. - * i386-sol2-tdep.c: New file. - - * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. - * config/i386/tm-i386nw.h: Removed. - - * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, - USE_STRUCT_CONVENTION): Remove defines. - (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. - (get_longjmp_target): Remove prototype. - (IN_SIGTRAMP): Remove define. - (i386bsd_in_sigtramp): Remove prototype. - (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a - function. Update comment accordingly - (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. - (FRAME_SAVED_PC): Remove define. - (i386bsd_frame_saved_pc): Remove prototype. - * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, - GET_LONGJMP_TARGET): Remove defines. - (get_longjmp_target): Remove prototype. - (IN_SIGTRAMP): Remove define. - (i386bsd_in_sigtramp): Remove prototype. - (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a - function. Update comment accordingly - (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. - (FRAME_SAVED_PC): Remove define. - (i386bsd_frame_saved_pc): Remove prototype. - * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): - Remove prototype. - (USE_STRUCT_CONVENTION): Remove prototype. - * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove - declaration. - (_initialize_i386bsd_nat): Revise logic to determine some - constants at compile time when compiling a native GDB. Warn if - things don't match up with what we expect. - * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): - Remove variables. - (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite - to use date stored in `struct gdbarch_tdep'. - (i386bsd_sigcontext_offset): Remove varaible. - (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data - stored in `struct gdbarch_tdep'. - (i386bsd_frame_saved_pc): Make static. - (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. - (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, - i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, - i386fbsd4_sc_pc_offset): New variables. - (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, - i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New - functions. - (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New - functions. - * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. - Modify the value of i386fbsd_sigtramp_start and - i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and - i386fbsd_sigtramp_end. - * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove - function. - - * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move - define to i386-linux-tdep.h. - (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, - REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove - defines. - (i386_linux_register_name, i386_linux_register_byte, - i386_linux_register_raw_size): Remove prototypes. - (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. - (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. - (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, - TARGET_WRITE_PC): Remove defines. - (i386_linux_in_sigtramp, i386_linux_frame_chain, - i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, - i386_linux_write_pc): Remove prototypes. - (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. - (get_longjmp_target): Remove prototype. - * i386-linux-tdep.h: New file. - * i386-linux-nat.c: Include "i386-linux-tdep.h". - * i386-linux-tdep.c: Include "i386-tdep.h" and - "i386-linux-tdep.h". - (i386_linux_register_name, i386_linux_register_byte, - i386_linux_register_raw_size, i386_linux_in_sigtramp, - i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): - Make static. - (i386_linux_init_abi): New function. - (_initialize_i386_linux_tdep): New function. - - * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. - (i386_saved_pc_after_call): Remove prototype. - (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". - (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, - DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. - (i386_register_name, i386_stab_reg_to_regnum, - i386_dwarf_reg_to_regnum): Remove prototypes. - (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, - SIZEOF_SSE_REGS): Remove defines. - (REGISTER_BYTES): Remove define. - (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. - (i386_register_byte, i386_register_raw_size): Remove prototypes. - (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. - (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. - * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. - (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, - JB_EDX, GET_LONGJMP_TARGET): Remove defines. - (get_longjmp_target): Remove prototype. - (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. - (sigtramp_saved_pc): Remove define. - (i386v4_sigtramp_saved_pc): Remove prototype. - * config/i386/tm-go32.h (FRAME_CHAIN, - FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. - (i386go32_frame_saved_pc): Remove prototype. - (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. - (get_longjmp_target): Remove prototype. - * i386-tdep.h: Include "osabi.h". - (enum i386_abi): Removed. - (enum struct_return): New enum. - (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, - struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and - sc_pc_offset members. - (i386_gdbarch_register_os_abi): Remove prototype. - (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, - I386_SSE_NUM_REGS): New defines. - (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, - I386_SSE_SIZEOF_REGS): New defines. - (i386_register_name, i386_register_byte, i386_register_raw_size): - New prototypes. - (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. - (i386bsd_sigtramp_saved_pc): New prototype. - * i386-tdep.c: Don't include "elf-bfd.h". - (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, - i386_frame_chain, i386_saved_pc_after_call): Make static. - (i386_frame_saved_pc): Rewrite to call architecture dependent - function to deal with signal handlers. Make static. - (i386go32_frame_saved_pc): Removed. - [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): - Removed. - (i386_get_longjmp_target): New function. - (default_struct_convention, pcc_struct_convention, - reg_struct_convention, valid_conventions, struct_convention): New - variables. - (i386_use_struct_convention): New function. - (i386v4_sigtramp_saved_pc): Renamed to - i386_svr4_sigtramp_saved_pc. Made static. Moved. - (i386_pc_in_sigtramp): New function. - (i386_abi_names): Removed. - (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, - ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): - Removed. - (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, - i386_gdbarch_register_os_abi): Removed. - (struct i386_abi_handler): Removed. - (i386_abi_handler_list): Removed. - (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New - functions. - (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, - i386_nw_init_abi): New functions. - (i386_gdbarch_init): Rewritten to use generic OS ABI framework. - Use set_gdbarch_xxx() calls instead of relying on macros for a - number of calls. - (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. - (_initialize_i386_tdep): Add new 'struct-convcention' command. - Register the various architecture variants defined in this file. - -2002-06-14 Daniel Jacobowitz - - * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. - (struct main_type): Remove arg_types member. Update comments for - struct field. - (TYPE_ARG_TYPES): Remove. - (TYPE_FN_FIELD_ARGS): Update. - (smash_to_method_type): Update prototype. - - * c-typeprint.c (cp_type_print_method_args): Take method type - instead of argument list. Use new argument layout. Simplify. - (c_type_print_args): Use new argument layout. Simplify. - (c_type_print_base): Update call to cp_type_print_method_args. - * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type - argument; use die->type instead. Update call to - smash_to_method_type. - (read_structure_scope): Update call to dwarf2_add_member_fn. - * gdbtypes.c (allocate_stub_method): Update comment. - (smash_to_method_type): Take new NARGS and VARARGS arguments. - Use new argument layout. - (check_stub_method): Use new argument layout. Don't count - void as an argument. - (print_arg_types): Update comments. Use new argument layout. - (recursive_dump_type): Don't print arg_types member. - * hpread.c (hpread_read_struct_type): Use new argument layout. - (fixup_class_method_type): Likewise. - (hpread_type_lookup): Likewise. - * stabsread.c (read_type): Update calls to read_args and - smash_to_method_type. - (read_args): Use new argument layout. Simplify. - * valops.c (typecmp): Use new argument layout. Update parameters - and comments. Simplify. - (hand_function_call): Use new argument layout. - (search_struct_method): Update call to typecmp. - (find_overload_match): Use new argument layout. - -2002-06-13 Daniel Jacobowitz - - * NEWS: Mention multithreaded debug support for gdbserver. - -2002-06-13 Daniel Jacobowitz - - * MAINTAINERS: Mention NEWS. - -2002-06-13 Daniel Jacobowitz - - * mips-tdep.c (PROC_SYMBOL): Add warning comment. - (struct mips_objfile_private, compare_pdr_entries): New. - (non_heuristic_proc_desc): Read the ".pdr" section if it - is present. - -2002-06-12 Andrew Cagney - - * arm-tdep.c (arm_push_arguments): Rewrite using a two-pass loop. - (arm_debug): New static variable. - (_initialize_arm_tdep): Add ``set debug arm'' command. - -2002-06-12 Andrew Cagney - - * Makefile.in (sim_arm_h): Define. - (arm-tdep.o): Add $(sim_arm_h) and $(gdb_assert_h). - * arm-tdep.c: Include "gdb/sim-arm.h" and "gdb_assert.h". - (arm_register_sim_regno): New function, map an internal REGNUM - onto a simulator register number. - (arm_gdbarch_init): Set register_sim_regno. - -2002-06-09 Aldy Hernandez - - * MAINTAINERS: Add self. - -2002-06-11 Jim Blandy - - * source.c (source_info): Mention whether the symtab has - information about preprocessor macros. - - Call the command `info macro', not `show macro'. - * macrocmd.c (info_macro_command): Renamed from `show_macro_command'. - Fix error message. - (_initialize_macrocmd): Register `info_macro_command' in - `infolist', not `showlist'. - -2002-06-11 Daniel Jacobowitz - - * mips-tdep.c (MIPS_FPU_TYPE, FP_REGISTER_DOUBLE, MIPS_EABI) - (MIPS_LAST_FP_ARG_REGNUM, MIPS_LAST_ARG_REGNUM) - (MIPS_DEFAULT_SAVED_REGSIZE, MIPS_REGS_HAVE_HOME_P) - (MIPS_DEFAULT_STACK_ARGSIZE, GDB_TARGET_IS_MIPS64) - (MIPS_DEFAULT_MASK_ADDRESS_P): Remove obsolete definitions. Define - unconditionally. - (set_mipsfpu_single_command, set_mipsfpu_double_command) - (set_mipsfpu_none_command): Remove if (GDB_MULTI_ARCH). - (_initialize_mips_tdep): Remove dead code. - * config/mips/tm-irix5.h (MIPS_LAST_ARG_REGNUM) - (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. - * config/mips/tm-irix6.h (MIPS_LAST_ARG_REGNUM) - (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. - * config/mips/tm-mips.h (MIPS_EABI, MIPS_LAST_ARG_REGNUM, - MIPS_LAST_FP_ARG_REGNUM): Remove. - -2002-06-11 Michal Ludvig - - * dwarf2cfi.c (unwind_tmp_obstack_init): New. - (unwind_tmp_obstack_free, parse_frame_info) - (update_context, cfi_read_fp, cfi_write_fp) - (cfi_frame_chain, cfi_init_extra_frame_info) - (cfi_virtual_frame_pointer): Use the above function. - * dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c'). - -2002-06-11 Corinna Vinschen - - * v850-tdep.c (v850_type_is_scalar): New function. - (v850_use_struct_convention): Match current gcc implementation - as close as possible. - (v850_push_arguments): Fix stack_offset handling. Don't write - struct_addr into register. This is done by v850_store_struct_return. - (v850_extract_return_value): Care for structs. - (v850_store_return_value): Ditto. - (v850_store_struct_return): Actually write address. - -2002-06-11 Michal Ludvig - - * x86-64-tdep.c (x86_64_skip_prologue): Fix to work on functions - without debug information too. - -2002-06-10 Andrew Cagney - - * gdbarch.sh (PRINT_FLOAT_INFO): Add frame and ui_file parameters. - Make multi-arch pure. - * gdbarch.h, gdbarch.c: Re-generate. - * arm-tdep.c (arm_print_float_info): Update. - * arch-utils.h (default_print_float_info): Update. - * arch-utils.c (default_print_float_info): Update. - * infcmd.c (float_info): Update call. - -2002-06-10 Andrew Cagney - - * Makefile.in (init.c): Move the call to _initialize_gdbtypes to - the front of the initialize list. - -2002-06-10 Andrew Cagney - - * infrun.c (struct inferior_status): Replace fields - selected_frame_address and selected_level with field - selected_frame_id. - (save_inferior_status): Update. Use get_frame_id. - (struct restore_selected_frame_args): Delete. - (restore_selected_frame): Update. Use frame_find_by_id. - (restore_inferior_status): Update. - - * breakpoint.h (struct breakpoint): Change type of - watchpoint_frame to frame_id. - * breakpoint.c (insert_breakpoints): Use frame_find_by_id. Remove - call to get_current_frame. - (do_enable_breakpoint): Use frame_find_by_id. Remove call to - get_current_frame. - (watchpoint_check): Use frame_find_by_id. - - * frame.h (record_selected_frame): Delete declaration. - * stack.c (record_selected_frame): Delete function. - - * frame.h (struct frame_id): Define. - (get_frame_id): Declare. - (frame_find_by_id): Declare. - * frame.c (frame_find_by_id): New function. - (get_frame_id): New function. - -2002-06-10 Andrey Volkov - - * ser-e7kpc.c: Fix duplicated define and call of - _initialize_ser_e7000pc - -2002-06-09 Daniel Jacobowitz - - * signals/signals.c (target_signal_from_host): Fix #ifdef - SIGRTMIN case. - (do_target_signal_to_host): Likewise. - -2002-06-09 Daniel Jacobowitz - - * mips-tdep.c (mips_find_abi_section): New function. - (mips_gdbarch_init): Call it. - -2002-06-09 Mark Kettenis - - * solib-svr4.c (init_fetch_link_map_offsets): Simply return - legacy_fetch_link_map_offsets. Adjust comment to reflect reality - after Andrew's 2002-06-08 gdbarch change. - -2002-06-09 Mark Kettenis - - * i386-linux-nat.c (suppy_gregset): Don't supply - I386_LINUX_ORIG_EAX_REGNUM if there isn't room for it in GDB's - register cache. - (fill_gregset): Don't fetch it under the same circumstances. - -2002-06-09 Andrew Cagney - - * Makefile.in (callback_h): Define. - (remote_sim_h): Update path to remote-sim.h. - (remote-rdp.o): Add $(callback_h). - (remote-sim.o): Use $(callback_h). - * remote-sim.c: Include "gdb/callback.h" and "gdb/remote-sim.h". - * remote-rdp.c: Include "gdb/callback.h". - -2002-06-09 Mark Kettenis - - * osabi.h (gdb_osabi): Add GDB_OSABI_GO32 and GDB_OSABI_NETWARE. - * osabi.c (gdb_osabi_names): Add "DJGPP" and "NetWare". - -2002-06-08 Andrew Cagney - - * sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__. - * rdi-share/serpardr.c: Ditto. - * rdi-share/unixcomm.c: Ditto. - * rdi-share/serdrv.c: Ditto. - * rdi-share/hostchan.h: Ditto. - * rdi-share/hostchan.c: Ditto. - * rdi-share/host.h: Ditto. - * rdi-share/devsw.c: Ditto. - - * objfiles.h: Change type of obj_private to void pointer. - * pa64solib.c: Update copyright. Don't include "assert.h", use - strcmp instead of STREQ, use LONGEST, do not use PTR - * somsolib.c: Ditto. - - * config/djgpp/fnchange.lst: Fix problems with bfd/elf32-i386.c, - bfd/elf32-i386qnx.c, bfd/elf32-sh.c, bfd/elf32-sh64-nbsd.c, - bfd/elf64-sh64-nbsd.c bfd/elf64-sh64.c. - -2002-06-08 Andrew Cagney - - * frame.c (GET_SAVED_REGISTER): Delete macro definition. - (default_get_saved_register): Delete function. - * gdbarch.sh (GET_SAVED_REGISTER): Set default to - generic_unwind_get_saved_register. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-06-08 Andrew Cagney - - * gdbarch.sh (FRAME_CHAIN_VALID): Set default to - generic_func_frame_chain_valid. - * gdbarch.h, gdbarch.c: Re-generate. - * blockframe.c (generic_func_frame_chain_valid): Only check - PC_IN_CALL_DUMMY when generic dummy frames. Don't worry about - passing FP to PC_IN_CALL_DUMMY. - Fix PR gdb/360. - -2002-06-08 Andrew Cagney - - * gdbarch.sh (struct gdbarch_data): Add field init_p. - (register_gdbarch_data): Initialize init_p. - (gdbarch_data): Initialize data pointer using the init function. - (init_gdbarch_data): Delete function. - (gdbarch_update_p): Update. - (initialize_non_multiarch): Update. - (struct gdbarch): Add field initialized_p. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-06-07 Michal Ludvig - - * x86-64-linux-nat.c (x86_64_fxsave_offset): New. - (supply_fpregset, fill_fpregset): Don't call i387_*_fxsave, - better do the things actually here. - * x86-64-tdep.c (x86_64_register_name2nr): New. - (x86_64_register_name): Renamed to x86_64_register_nr2name. - (x86_64_gdbarch_init): Respect the above change. - * x86-64-tdep.h (x86_64_register_name2nr) - (x86_64_register_nr2name): Add prototypes. - * config/i386/x86-64linux.mt (TDEPFILES): Remove i387-tdep.o. - -2002-06-06 Michael Snyder - - * d10v-tdep.c (d10v_push_arguments): Handle struct_return. - Delete extra braces and re-indent. - (d10v_store_return_value): Char return values - must be shifted over by one byte in R0. - (d10v_extract_return_value): Delete extra braces, re-indent. - -2002-06-06 Elena Zannoni - - * d10v-tdep.c (d10v_read_sp, d10v_read_fp): Add prototype. - (d10v_register_virtual_type): Make $fp and $sp be pointer to data. - (d10v_integer_to_address): Rewrite. - (d10v_frame_init_saved_regs): When reading fp and sp registers use - the d10v specific functions which take care of converting to the - correct space. - -2002-06-06 Elena Zannoni - - * config/djgpp/fnchange.lst: Add testsuite files altivec-abi.c, - altivec-abi.exp, altivec-regs.c, altivec-regs.exp. - -2002-06-02 Andrew Cagney - - * config/alpha/nm-linux.h: Add "config/" prefix to tm, nm and xm - includes. - * config/tm-linux.h: Ditto. - * config/alpha/tm-alphalinux.h: Ditto. - * config/arm/nm-linux.h, config/arm/tm-linux.h: Ditto. - * config/arm/xm-nbsd.h, config/i386/nm-gnu.h: Ditto. - * config/i386/nm-i386lynx.h, config/i386/nm-i386sol2.h: Ditto. - * config/i386/nm-i386v4.h, config/i386/nm-i386v42mp.h: Ditto. - * config/i386/nm-linux.h, config/i386/nm-m3.h: Ditto. - * config/i386/nm-ptx4.h, config/i386/nm-x86-64.h: Ditto. - * config/i386/tm-i386gnu.h, config/i386/tm-i386lynx.h: Ditto. - * config/i386/tm-i386m3.h, config/i386/tm-i386sco5.h: Ditto. - * config/i386/tm-i386v4.h, config/i386/tm-linux.h: Ditto. - * config/i386/tm-ptx4.h, config/i386/tm-vxworks.h: Ditto. - * config/i386/xm-i386v4.h, config/i386/xm-nbsd.h: Ditto. - * config/i386/xm-ptx.h, config/i386/xm-ptx4.h: Ditto. - * config/i960/tm-vx960.h, config/ia64/nm-aix.h: Ditto. - * config/ia64/nm-linux.h, config/ia64/tm-aix.h: Ditto. - * config/ia64/tm-linux.h, config/ia64/xm-aix.h: Ditto. - * config/m68k/nm-linux.h, config/m68k/nm-m68klynx.h: Ditto. - * config/m68k/nm-sysv4.h, config/m68k/tm-linux.h: Ditto. - * config/m68k/tm-m68klynx.h, config/m68k/tm-m68kv4.h: Ditto. - * config/m68k/tm-sun2os4.h, config/m68k/tm-sun3os4.h: Ditto. - * config/m68k/tm-vx68.h, config/m68k/xm-m68kv4.h: Ditto. - * config/m68k/xm-nbsd.h, config/m88k/nm-delta88v4.h: Ditto. - * config/m88k/tm-delta88v4.h, config/m88k/xm-delta88v4.h: Ditto. - * config/mips/nm-irix5.h, config/mips/nm-linux.h: Ditto. - * config/mips/tm-linux.h, config/mips/tm-mips64.h: Ditto. - * config/mips/tm-mipsm3.h, config/mips/tm-mipsv4.h: Ditto. - * config/mips/tm-vxmips.h, config/mips/xm-irix5.h: Ditto. - * config/mips/xm-mipsv4.h, config/ns32k/xm-nbsd.h: Ditto. - * config/pa/nm-hppao.h, config/powerpc/nm-linux.h: Ditto. - * config/powerpc/tm-linux.h, config/powerpc/tm-vxworks.h: Ditto. - * config/powerpc/xm-aix.h, config/rs6000/nm-rs6000ly.h: Ditto. - * config/rs6000/tm-rs6000ly.h, config/rs6000/xm-aix4.h: Ditto. - * config/sh/tm-linux.h, config/sparc/nm-linux.h: Ditto. - * config/sparc/nm-sparclynx.h, config/sparc/nm-sun4sol2.h: Ditto. - * config/sparc/tm-linux.h, config/sparc/tm-sp64linux.h: Ditto. - * config/sparc/tm-sp64sim.h, config/sparc/tm-sparclynx.h: Ditto. - * config/sparc/tm-sun4os4.h, config/sparc/tm-sun4sol2.h: Ditto. - * config/sparc/tm-vxsparc.h, config/sparc/xm-sun4sol2.h: Ditto. - -2002-05-04 Aidan Skinner - - * ada-exp.tab.c: New file - * ada-exp.y: New file - * ada-lang.c: New file - * ada-lang.h: New file - * ada-lex.c: New file - * ada-lex.l: New file - * ada-tasks.c: New file - * ada-typeprint.c: New file - * ada-valprint.c: New file - -2002-06-02 Jason Thorpe - - * ppcnbsd-tdep.c (ppcnbsd_init_abi): Don't set - use_struct_convention to ppc_sysv_abi_broken_use_struct_convention. - -2002-06-02 Jason Thorpe - - * config/rs6000/aix4.mt (TDEPFILES): Use ppc-sysv-tdep.o - insetead of ppc-linux-tdep.o. - * config/rs6000/rs6000.mt (TDEPFILES): Likewise. - * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise. - -2002-06-02 Andrew Cagney - - 2002-05-07 Christian Groessler - * z8k-tdep.c (z8k_print_register_hook): Fix display of 32 and 64 - bit register contents for little endian hosts. - -2002-06-01 Andrew Cagney - - * MAINTAINERS: Mention that any `HP/UX reader' can be changed by - any maintainer. - -2002-06-01 Andrew Cagney - - * gdbarch.h: Regenerate. - -2002-06-01 Andrew Cagney - - * MAINTAINERS: Add everyone to write-after-approval list. - -2002-06-01 Andrew Cagney - - * stack.c (frame_info): Use frame_register_unwind instead of - saved_regs. Mention when the SP is on the stack or in a register. - - * frame.h (frame_register_unwind_ftype): Define. Document. - (struct frame_info): Add field register_unwind and - register_unwind_cache. - (frame_register_unwind): Declare. - (generic_unwind_get_saved_register): Declare. - - * frame.c (frame_register_unwind): New function. - (generic_unwind_get_saved_register): New function. - - * blockframe.c (generic_call_dummy_register_unwind): New function. - (frame_saved_regs_register_unwind): New function. - (set_unwind_by_pc): New function. - (create_new_frame): New function. - (get_prev_frame): New function. - -2002-05-30 Andrew Cagney - - * a29k-share/: Delete directory. - * remote-vx29k.c: Delete file. - -2002-05-30 Jason Thorpe - - * config/djgpp/fnchange.lst: Add ns32knbsd-nat.c, ns32knbsd-tdep.c, - ppcnbsd-nat.c, ppcnbsd-tdep.c, sparcnbsd-nat.c, and sparcnbsd-tdep.c. - -2002-05-30 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add sparc64nbsd-nat.c, - sparcnbsd-nat.c, and sparcnbsd-tdep.c. - (sparc64nbsd-nat.o) - (sparcnbsd-nat.o) - (sparcnbsd-tdep.o): New dependency lists. - * NEWS: Note new UltraSPARC NetBSD native configuration. - * configure.host (sparc64-*-netbsd*): New host. - * configure.tgt (sparc-*-netbsdelf*) - (sparc-*-netbsd*): Set gdb_target to nbsd. - (sparc64-*-netbsd*): New target. - * sparc64nbsd-nat.c: New file. - * sparcnbsd-nat.c: New file. - * sparcnbsd-tdep.c: New file. - * sparcnbsd-tdep.h: New file. - * config/sparc/nbsd.mt: New file. - * config/sparc/nbsd64.mh: New file. - * config/sparc/nbsd64.mt: New file. - * config/sparc/nbsdaout.mh (NATDEPFILES): Remove corelow.o, - sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. - (HOST_IPC): Remove. - * config/sparc/nbsdaout.mt: Remove. - * config/sparc/nbsdelf.mh (NATDEPFILES): Remove corelow.o, - sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. - (HOST_IPC): Remove. - * config/sparc/nbsdelf.mt: Remove. - * config/sparc/nm-nbsd.h: Update copyright years. Remove all - sparc-nat.c compatiblity defines. - * config/sparc/tm-nbsd.h: Update copyright years. Include solib.h. - (GDB_MULTI_ARCH): Set to GDB_MULTI_ARCH_PARTIAL. - * config/sparc/tm-nbsd64.h: New file. - * config/sparc/tm-nbsdaout.h: Remove. - * config/sparc/xm-nbsd.h: Remove. - -2002-05-30 Jason Thorpe - - * Makefile.in (sparc-tdep.o): Add osabi.h to dependency list. - * sparc-tdep.c: Include osabi.h. - (gdbarch_tdep): Add osabi member. - (_initialize_sparc_tdep): Use gdbarch_register. - (sparc_gdbarch_init): Use generic OS ABI framework. - (sparc_dump_tdep): New function. - -2002-05-30 Kevin Buettner - - * corefile.c (do_captured_read_memory_integer): Return non-zero - result. - (safe_read_memory_integer): Copy result of memory read when - status is non-zero. Also, add comments. - -2002-05-20 Jason Thorpe - - * Makefile.in (ppc_tdep_h): Define. - (ppc-linux-nat.o) - (ppc-linux-tdep.o) - (rs6000-tdep.o): Use $(ppc_tdep_h). - (ppc-sysv-tdep.o) - (ppcnbsd-nat.o) - (ppcnbsd-tdep.o): New dependency lists. - * ppc-tdep.h: Use generic OS ABI framework. - * ppc-linux-tdep.c (_initialize_ppc_linux_tdep) - (ppc_linux_init_abi): New functions. - (ppc_sysv_abi_broken_use_struct_convention) - (ppc_sysv_abi_use_struct_convention) - (ppc_sysv_abi_push_arguments): Move to... - * ppc-sysv-tdep.c: ...here. - * ppcnbsd-nat.c: Don't include gdbcore.h and regcache.h. - * rs6000-tdep.c (process_note_abi_tag_sections) - (get_elfosabi): Remove. - (rs6000_gdbarch_init): Use generic OS ABI framework. - (rs6000_dump_tdep): New function. - (_initialize_rs6000_tdep): Use gdbarch_register. - * config/powerpc/linux.mt (TDEPFILES): Add ppc-sysv-tdep.o. - * config/powerpc/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. - * config/powerpc/aix.mt (TDEPFILES): Use ppc-sysv-tdep.o instead - of ppc-linux-tdep.o. - * config/powerpc/nbsd.mt (TDEPFILES): Likewise. - * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise. - * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise. - * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise. - * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise. - * config/powerpc/vxworks.mt (TDEPFILES): Likewise. - -2002-05-29 Jim Blandy - - * macroscope.c (default_macro_scope): Put `void' in empty argument - list. - -2002-05-29 Andrew Cagney - - * Makefile.in (arch-utils.o): Add $(sim_regno_h). - * arch-utils.c: Include "sim-regno.h". - * gdbarch.sh: Don't include "sim-regno.h". - * gdbarch.h, gdbarch.c: Regenerate. - * sim-regno.h (legacy_register_sim_regno): Move declaration from - here. - * arch-utils.h (legacy_register_sim_regno): To here. - * remote-sim.c (legacy_register_sim_regno): Move function from - here. - * arch-utils.c (legacy_register_sim_regno): To here. - -2002-05-28 Andrew Cagney - - * sim-regno.h: New file. - * Makefile.in (sim_regno_h): Define. - (d10v-tdep.o, remote-sim.o): Add dependency on $(sim_regno_h). - * remote-sim.c: Include "sim-regno.h" and "gdb_assert.h". - (legacy_register_sim_regno): New function. - (one2one_register_sim_regno): New function. - (gdbsim_fetch_register): Rewrite. - (gdbsim_store_register): Only store a register when - REGISTER_SIM_REGNO is valid. - * d10v-tdep.c: Include "sim-regno.h". - (d10v_ts2_register_sim_regno): Add legacy_regiter_sim_regno check. - (d10v_ts3_register_sim_regno): Ditto. - * gdbarch.sh: Include "sim-regno.h". - (REGISTER_SIM_REGNO): Set default to legacy_register_sim_regno. - * gdbarch.h, gdbarch.c: Regenerate. - * arch-utils.h (default_register_sim_regno): Delete declaration. - * arch-utils.c (default_register_sim_regno): Delete function. - -2002-05-28 Jason Thorpe - - * ppcnbsd-nat.c: Rewrite. - * ppcnbsd-tdep.c: New file. - * ppcnbsd-tdep.h: New file. - * config/powerpc/nbsd.mh (NATDEPFILES): Remove corelow.o, - solib.o, and solib-svr4.o. - * config/powerpc/nbsd.mt (TDEPFILES): Add ppcnbsd-tdep.o, - nbsd-tdep.o, and corelow.o. - -2002-05-28 Andrew Cagney - - * MAINTAINERS (--enable-gdb-build-warnings): Rewrite script to use - `tr' and `sed'. Mention that `broken' targets are not expected to - build. - -2002-05-27 Michal Ludvig - - * x86-64-tdep.c (x86_64_skip_prologue): Remove obsolete note. - Let PC point right after the prologue before looking up symbols. - -2002-05-27 Martin M. Hunt - - * i386-tdep.c (i386_register_virtual_type): Return - builtin_type_vec128i for SSE registers. - - * gdbtypes.h (builtin_type_vec128i): Declare. - - * gdbtypes.c (build_builtin_type_vec128i): New function. - (builtin_type_v2_double, builtin_type_v4_int64): New types. - (builtin_type_vec128i): New type for SSE2 128-bit registers. - (build_gdbtypes): Initialize new builtin vector types. - (_initialize_gdbtypes): Register new vector types with gdbarch. - -2002-05-26 Jason Thorpe - - * MAINTAINERS: ns32k is not longer an obsolete candidate, - since it has been multi-arch'd. - * NEWS: Note that ns32k-*-* is now partial multi-arch. - Move Alpha and VAX multi-arch news entries to same section - as other multi-arch news. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c: include gdbtypes.h, inferior.h, regcache.h, - target.s, arch-utils.h, ns32k-tdep.h. Make many functions - static. Rename some register numbers to put them in ns32k-tdep - private namespace. - (ns32k_get_saved_register, ns32k_gdbarch_init_32082, - ns32k_gdbarch_init_32382, ns32k_gdbarch_init, ns32k_dump_tdep): New - functions. - (_initialize_ns32k_tdep): Use gdbarch_register. - * ns32k-tdep.h: New file. - * ns32knbsd-tdep.c: New file. - * config/ns32k/nbsdaout.mt (TDEPFILES): Add ns32knbsd-tdep.o. - * config/ns32k/tm-nbsd.h: Include "ns32k/tm-ns32k.h". - (IN_SOLIB_CALL_TRAMPOLINE, REGISTER_NAME, NUM_REGS, - REGISTER_BYTES, REGISTER_BYTE): Remove. - * config/ns32k/tm-ns32k.h: New file. - * config/ns32k/tm-umax.h: Remove. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c (ns32k_saved_pc_after_call, - ns32k_store_struct_return, ns32k_extract_return_value, - ns32k_store_return_value, ns32k_extract_struct_value_address): New - functions. - * config/ns32k/tm-umax.h (SAVED_PC_AFTER_CALL): Define as - ns32k_saved_pc_after_call. - (STORE_STRUCT_RETURN): Define as ns32k_store_struct_return. - (EXTRACT_RETURN_VALUE): Define as ns32k_extract_return_value. - (STORE_RETURN_VALUE): Define as ns32k_store_return_value. - (EXTRACT_STRUCT_VALUE_ADDRESS): Define as - ns32k_extract_struct_value_address. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c (ns32k_call_dummy_words, sizeof_ns32k_call_dummy_words, - ns32k_fix_call_dummy): New. - * config/ns32k/tm-umax.h (CALL_DUMMY_WORDS): Define as - ns32k_call_dummy_words. - (SIZEOF_CALL_DUMMY_WORDS): Define as sizeof_ns32k_call_dummy_words. - (CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_ADDR, - CALL_DUMMY_NARGS): Remove. - (FIX_CALL_DUMMY): Define as ns32k_fix_call_dummy. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c (ns32k_breakpoint_from_pc, ns32k_frame_chain, - ns32k_frame_saved_pc, ns32k_frame_args_address, - ns32k_frame_locals_address, ns32k_frame_init_saved_regs, - ns32k_push_dummy_frame, ns32k_pop_frame): New functions. - * config/ns32k/tm-nbsd.h (FRAME_SAVED_PC): Remove. - * config/ns32k/tm-umax.h (INNER_THAN): Define as core_addr_lessthan. - (BREAKPOINT_FROM_PC): Define as ns32k_breakpoint_from_pc. - (BREAKPOINT): Remove.. - (FRAME_CHAIN): Define as ns32k_frame_chain. - (FRAME_SAVED_PC): Define as ns32k_frame_saved_pc. - (FRAME_ARGS_ADDRESS): Define as ns32k_frame_args_address. - (FRAME_LOCALS_ADDRESS): Define as ns32k_frame_locals_address. - (FRAME_FIND_SAVED_REGS): Remove. - (FRAME_INIT_SAVED_REGS): Define as ns32k_frame_init_saved_regs. - (PUSH_DUMMY_FRAME): Define as ns32k_push_dummy_frame. - (POP_FRAME): Define as ns32k_pop_frame. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c (ns32k_register_byte_32082, - ns32k_register_byte_32382, ns32k_register_raw_size, - ns32k_register_virtual_size, ns32k_register_virtual_type): New - functions. - * config/ns32k/tm-nbsd.h (REGISTER_BYTE): Define as - ns32k_register_byte_32382. - * config/ns32k/tm-umax.h: Update copyright years. - (REGISTER_BYTE): Define as ns32k_register_byte_32082. - (REGISTER_RAW_SIZE): Define as ns32k_register_raw_size. - (REGISTER_VIRTUAL_SIZE): Define as ns32k_register_virtual_size. - (REGISTER_VIRTUAL_TYPE): Define as ns32k_register_virtual_type. - (ns32k_get_enter_addr): Fix prototype. - -2002-05-26 Jason Thorpe - - * ns32k-tdep.c: Update copyright years. - (ns32k_register_name_32082): New function. - (ns32k_register_name_32382): Ditto. - * config/ns32k/tm-nbsd.h (REGISTER_NAMES): Remove. - (REGISTER_NAME): Define as ns32k_register_name_32382. - * config/ns32k/tm-umax.h (REGISTER_NAMES): Remove. - (REGISTER_NAME): Define as ns32k_register_name_32082. - -2002-05-24 Jim Blandy - - * dwarf2read.c (free_line_header): Use xfree, not free. - -2002-05-24 Jason Thorpe - - * config/djgpp/fnchange.lst: Add alphabsd-nat.c, - alphabsd-tdep.c, mipsnbsd-nat.c, and mipsnbsd-tdep.c - -2002-05-23 Andrew Cagney - - * PROBLEMS: Mention s390 and FreeBSD 4.4 build problems. - -2002-05-23 Andrew Cagney - - From Ross Alexander at NEC Europe: - * config/pa/hpux11w.mh (NATDEPFILES): Add solib.o. - -2002-05-23 Michael Snyder - - * cli/cli-dump.c (restore_command): Use parse_and_eval_long - for input, rather than parse_and_eval_address. - -2002-05-23 Andrew Cagney - - * d10v-tdep.c: Include "gdb/sim-d10v.h" instead of "sim-d10v.h". - * Makefile.in (sim_d10v_h): Update definition. - -2002-05-24 Andrew Cagney - - * d10v-tdep.c (d10v_gdbarch_init): Revert old code included in - change `2002-05-22 Michael Snyder' below. - (d10v_push_arguments): Ditto. - (d10v_extract_return_value): Ditto. - -2002-05-23 Jim Blandy - - * macrotab.c (check_for_redefinition): Don't complain if the new - definition is the same as the previous one. Take more arguments - to allow the comparison. - (macro_define_object, macro_define_function): Pass more arguments - to check_for_redefinition. - -2002-05-22 Michael Snyder - - * d10v-tdep.c: Change a few macros to enums for ease of debugging. - (d10v_frame_chain_valid): Add PC_IN_CALL_DUMMY clause. - (d10v_frame_saved_pc): Add PC_IN_CALL_DUMMY clause. - (d10v_frame_chain): Bail immediately if PC_IN_CALL_DUMMY. - Don't bail if return_pc is PC_IN_CALL_DUMMY. - Add a temp variable to save a call (and a memory read). - (d10v_init_extra_frame_info): Get fi->pc from callee's return_pc - if possible (so that PC_IN_CALL_DUMMY will work). - -2002-05-22 Corinna Vinschen - - * MAINTAINERS: Remove status `OBSOLETE' from v850. - -2002-05-22 Michal Ludvig - - * dwarf2cfi.c (frame_state_for): Added safety check for a valid - fde->cie_ptr. - (dwarf2_build_frame_info): Corrected handling of eh_frame. - (dwarf2_build_frame_info): Add offset to fde->initial_location - so that frames of shared libraries are mapped correctly. - (execute_stack_op): Change type of 'result' from ULONGEST to - CORE_ADDR. - -2002-05-22 Jason Thorpe - - * config/alpha/tm-nbsd.h: Include solib.h. - -2002-05-22 Jason Thorpe - - * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Don't make - assumptions about the host's byte order. - -2002-05-22 Jason Thorpe - - * Makefile.in (alphanbsd-tdep.o, shnbsd-tdep.o): Add solib-svr4.h - to dependency list. - * alphanbsd-tdep.c: Include solib-svr4.h. - * shnbsd-tdep.c: Ditto. - -2002-05-22 Jason Thorpe - - * Makefile.in (armnbsd-tdep.o): Add solib-svr4.h and - nbsd-tdep.h to dependency list. - * configure.host (arm*-*-netbsdelf*, arm*-*-netbsd*, - i[3456]86-*-netbsdaout*, i[3456]86-*-netbsd*, m68*-*-netbsd*, - ns32k-*-netbsd*, sparc-*-netbsdaout*, sparc-*-netbsd*): Use - nbsdaout.mh and nbsdelf.mh consistently. - * configure.tgt (i[3456]86-*-netbsd*, m68*-*-netbsd*, - ns32k-*-netbsd*, sparc-*-netbsdelf*, sparc-*-netbsd*) Use - nbsdaout.mt and nbsdelf.mh consistently. - * armnbsd-tdep.c: Include nbsd-tdep.h and solib-svr4.h. - (arm_netbsd_elf_init_abi): Use set_solib_svr4_fetch_link_map_offsets - to set nbsd_ilp32_solib_svr4_fetch_link_map_offsets. - * config/nm-nbsd.h: Garbage-collect SVR4_SHARED_LIBS. Move - a.out shared library stuff from here... - * config/nm-nbsdaout.h: ...to here. - * config/tm-nbsd.h: Remove. - * config/alpha/nm-nbsd.h (SVR4_SHARED_LIBS): Remove. - * config/arm/nbsd.mh: Remove. - * config/arm/nbsd.mt (TDEPFILES): Remove solib-sunos.o, add - nbsd-tdep.o. - * config/arm/nbsdaout.mh: New file. - * config/arm/nbsdelf.mh: New file. - * config/arm/nm-nbsdaout.h: New file. - * config/i386/nbsd.mh: Remove. - * config/i386/nbsd.mt: Remove. - * config/i386/nbsdaout.mh: New file. - * config/i386/nbsdaout.mt: New file. - * config/i386/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. - * config/i386/nbsdelf.mt (TM_FILE): Use tm-nbsd.h. - * config/i386/nm-nbsd.h (REGISTER_U_ADDR, - i386_register_u_addr): Remove. - * config/i386/nm-nbsdaout.h: New file. - * config/i386/nm-nbsdelf.h: Remove. - * config/i386/tm-nbsd.h: Don't include config/tm-nbsd.h. - (USE_STRUCT_CONVENTION): Remove. - * config/i386/tm-nbsdaout.h: New file. - * config/i386/tm-nbsdelf.h: Remove. - * config/m68k/nbsd.mh: Remove. - * config/m68k/nbsd.mt: Remove. - * config/m68k/nbsdaout.mh: New file. - * config/m68k/nbsdaout.mt: New file. - * config/m68k/nm-nbsd.h: Use config/nm-nbsd.h. - * config/m68k/nm-nbsdaout.h: New file. - * config/m68k/tm-nbsd.h: Don't include config/tm-nbsd.h. - (IN_SOLIB_CALL_TRAMPOLINE): Define. - * config/ns32k/nbsd.mh: Remove. - * config/ns32k/nbsd.mt: Remove. - * config/ns32k/nbsdaout.mh: New file. - * config/ns32k/nbsdaout.mt: New file. - * config/ns32k/nm-nbsd.h: Include config/nm-nbsd.h. - * config/ns32k/nm-nbsdaout.h: New file. - * config/ns32k/tm-nbsd.h: Don't include config/tm-nbsd.h. - (IN_SOLIB_CALL_TRAMPOLINE): Define. - * config/powerpc/nm-nbsd.h: Include config/nm-nbsd.h. - (SVR4_SHARED_LIBS): Remove. - * config/powerpc/tm-nbsd.h: Dont' include config/tm-nbsd.h. - * config/sparc/nbsd.mh: Remove. - * config/sparc/nbsd.mt: Remove. - * config/sparc/nbsdaout.mh: New file. - * config/sparc/nbsdaout.mt: New file. - * config/sparc/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. - * config/sparc/nbsdelf.mt: New file. - * config/sparc/nm-nbsdaout.h: New file. - * config/sparc/nm-nbsdelf.h: Remove. - * config/sparc/tm-nbsd.h: Don't include config/tm-nbsd.h. - * config/sparc/tm-nbsdaout.h: New file. - -2002-05-21 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add mipsnbsd-nat.c and - mipsnbsd-tdep.c - (mipsnbsd-nat.o, mipsnbsd-tdep.o): New dependency lists. - -2002-05-21 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add shnbsd-tdep.c and - shnbsd-nat.c. - (shnbsd-tdep.o, shnbsd-nat.o): New dependency lists. - -2002-05-21 Jason Thorpe - - * NEWS: Note new MIPS NetBSD native configuration. - * configure.host (mips*-*-netbsd*): New host. - * configure.tgt (mips*-*-netbsd*): New target. - * mipsnbsd-nat.c: New file. - * mipsnbsd-tdep.c: New file. - * mipsnbsd-tdep.h: New file. - * config/mips/nbsd.mh: New file. - * config/mips/nbsd.mt: New file. - * config/mips/nm-nbsd.h: New file. - * config/mips/tm-nbsd.h: New file. - -2002-05-21 Jason Thorpe - - * Makefile.in (SFILES): Add osabi.c. - (COMMON_OBS): Add osabi.o. - (osabi.o): New dependency list. - * osabi.c: New file. - * osabi.h: New file. - * doc/gdbint.texinfo: Document new generic OS ABI framework. - - * Makefile.in (alpha_tdep_h): Define and use instead of - alpha-tdep.h. - * alpha-tdep.c (alpha_abi_names, process_note_abi_tag_sections, - get_elfosabi, alpha_abi_handler_list, alpha_gdbarch_register_os_abi): - Remove. - (alpha_gdbarch_init, alpha_dump_tdep): Use generic OS ABI framework. - * alpha-tdep.h: Include osabi.h. - (alpha_abi): Remove. - (gdbarch_tdep): Use generic OS ABI framework. - * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Use - gdbarch_register_osabi. - * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. - * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. - * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. - - * Makefile.in (sh_tdep_h): Add osabi.h. - * sh-tdep.h (sh_osabi): Remove. - (gdbarch_tdep): Use generic OS ABI framework. - * sh-tdep.c (sh_osabi_names, process_note_abi_tag_sections, - sh_osabi_handler_list, sh_gdbarch_register_os_abi): Remove. - (sh_gdbarch_init, sh_dump_tdep): Use generic OS ABI framework. - * shnbsd-tdep.c (_initialize_shnbsd_tdep): Use gdbarch_register_osabi. - - * Makefile.in (arm_tdep_h): Define and use instead of arm-tdep.h. - * arm-linux-tdep.c (_initialize_arm_linux_tdep): Use - gdbarch_register_osabi. - * arm-tdep.c (arm_abi_names, process_note_abi_tag_sections, - arm_abi_handler_list, arm_gdbarch_register_os_abi): Remove. - (get_elfosabi): Rename to... - (arm_elf_osabi_sniffer): ...this. Adjust to use generic OS - ABI framework support routines. - (arm_gdbarch_init): Use generic OS ABI framework. - (arm_dump_tdep): Likewise. - (_initialize_arm_tdep): Likewise. - * arm-tdep.h: Include osabi.h. - (arm_abi): Remove. - (gdbarch_tdep): Remove arm_abi and abi_name members. Add - osabi member. - (arm_gdbarch_register_os_abi): Remove prototype. - * armnbsd-tdep.c (arm_netbsd_aout_osabi_sniffer): New function. - (_initialize_arm_netbsd_tdep): Use gdbarch_register_osabi. - - * Makefile.in (mips-tdep.o): Add osabi.h to dependency list. - * mips-tdep.c: Include osabi.h. - (gdbarch_tdep, mips_gdbarch_init, mips_dump_tdep): Use generic - OS ABI framework. - -2002-05-20 Kazu Hirata - - * h8300-tdep.c: Fix formatting. - -2002-05-20 Elena Zannoni - - * rs6000-tdep.c (rs6000_do_registers_info): Simplify code for - printing vector registers. - -2002-05-19 Andrew Cagney - - From Fernando Nasser: - * remote.c (remote_async_open_1): Re-throw the exception when the - connection fails. - (remote_cisco_open): Ditto. - (remote_open_1): Ditto. - -2002-05-19 Andrew Cagney - - * remote.c (remote_start_remote_dummy): Add uiout parameter. - (remote_start_remote): Add uiout parameter. Pass through to - remote_start_remote_dummy. - (remote_open_1): Use catch_exception instead of catch_errors. - (remote_async_open_1): Ditto. - (remote_cisco_open): Ditto. - -2002-05-19 Andrew Cagney - - * remote.c (remote_start_remote): Replace PTR with void pointer. - (sigint_remote_twice_token, sigint_remote_token): Ditto. Make - static. - -2002-05-18 Andrew Cagney - - * gdb_indent.sh: Allow the script to be run in the sim directory. - -2002-05-18 Mark Kettenis - - * config/i386/nm-cygwin.h (NO_PTRACE_H): Remove define. - * config/i386/nm-go32.h (NO_PTRACE_H): Remove define. - - * corelow.c (core_open): Only call set_gdbarch_from_file if - exec_bfd is NULL. - -2002-05-17 Andrey Volkov - - * h8300-tdep.c: Add support of EXR register - * config/h8300/tm-h8300.h: Ditto. - -2002-05-17 Andrey Volkov - - * h8300-tdep.c: Add additional CCR flags (I,UI,H,U) - -2002-05-17 Andrey Volkov - - * h8300-tdep.c: Change literal regnums to REGNO. - -2002-05-17 Jim Blandy - - * NEWS: Note addition of macro support. - - Expand preprocessor macros in C expressions. - * c-lang.h: #include "macroexp.h", for macro_lookup_ftype. - (scan_macro_expansion, scanning_macro_expansion, - finished_macro_expansion): New function declarations. - (expression_macro_lookup_func, expression_macro_lookup_baton): New - variable declarations. - * parser-defs.h (expression_context_pc): New declaration. - * parse.c (expression_context_pc): New variable. - (parse_exp_1): Set expression_context_pc, as well as - expression_context_block. - * c-exp.y (yylex): If we're not already reading the result of a - macro expansion, try to macro-expand the next token. When we're - done scanning a macro expansion, switch back to the mainline text. - Commas and `if's in a macro's expansion don't terminate the input. - * c-lang.c: #include "macroscope.h" and "gdb_assert.h". - (macro_original_text, macro_expanded_text, - expression_macro_lookup_func, expression_macro_lookup_baton): New - variables. - (scan_macro_expansion, scanning_macro_expansion, - finished_macro_expansion, scan_macro_cleanup, null_macro_lookup, - c_preprocess_and_parse): New functions. - (c_language_defn, cplus_language_defn, asm_language_defn): Call - c_preprocess_and_parse, instead of c_parse. - * Makefile.in (c_lang_h): Note that this #includes macroexp.h. - (c-lang.o): Note dependency on macroscope.h and gdb_assert.h. - -Fri May 17 14:26:19 2002 J"orn Rennecke - - * sh-tdep.c (gdb_print_insn_sh64): Delete. - (gdb_print_insn_sh): Just set info->endian and use print_insn_sh. - (sh_gdbarch_init): Always use gdb_print_insn_sh. - -2002-05-17 Corinna Vinschen - - * NEWS: Add section for multi-arched targets. Add v850 to that section. - -2002-05-17 Jason Thorpe - - * Makefile.in (sh_tdep_h): Define and use. - * config/sh/tm-sh.h (sh_osabi, sh_abi, gdbarch_tdep, - register enum): Move to... - * * sh-tdep.h: ...here. - * sh-tdep.c: Include sh-tdep.h. - * sh3-rom.c: Likewise. - * shnbsd-tdep.c: Likewise. - -2002-05-16 Michael Snyder - - * arm-tdep.c: Spelling fix in comment. - -2002-05-16 Jim Blandy - - Add commands for manually expanding macros and showing their - definitions. - * macrocmd.c, macroscope.c, macroscope.h: New files. - * Makefile.in (SFILES): Add macrocmd.c, macroscope.c. - (macroscope_h): New variable. - (HFILES_NO_SRCDIR): Add macroscope.h. - (COMMON_OBS): Add macrocmd.o, macroscope.o. - (macroscope.o, macrocmd.o): New rules. - - Teach the Dwarf 2 reader to read macro information. - * dwarf2read.c: #include "macrotab.h". - (dwarf_macinfo_buffer): New variable. - (struct dwarf2_pinfo): New members: dwarf_macinfo_buffer, and - dwarf_macinfo_size. - (DWARF_MACINFO_BUFFER, DWARF_MACINFO_SIZE): New macros. - (dwarf2_missing_macinfo_section, dwarf2_macros_too_long, - dwarf2_macros_not_terminated, dwarf2_macro_outside_file, - dwarf2_macro_unmatched_end_file, dwarf2_macro_malformed_definition, - dwarf2_macro_spaces_in_definition): New complaints. - (dwarf2_has_info): Initialize dwarf_macinfo_offset. - (dwarf2_build_psymtabs): Read the .dwarf_macinfo section. - (dwarf2_build_psymtabs_hard): Record the buffer and its size in - the partial symbol table. - (psymtab_to_symtab_1): Set the macinfo buffer and size globals - from what's recorded in the partial symbol table. - (read_file_scope): If the compilation unit has a - `DW_AT_macro_info' attribute, read its macro information. - * Makefile.in (dwarf2read.o): Depend on macrotab.h. - -2002-05-16 Daniel Jacobowitz - - Fix PR gdb/546 - * ser-tcp.c: Don't include . - -2002-05-16 Stephane Carrez - - * MAINTAINERS: Update my email address. - -2002-05-16 Richard Earnshaw - - * config/arm/nm-nbsd.h: Use "config/nm-nbsd.h" to include generic - include file of the same name. - -2002-05-16 Corinna Vinschen - - * configure.tgt: Mark v850 as multi-arched. - * config/v850/tm-v850.h: Remove file. - * config/v850/v850.mt: Eliminate TM_FILE. - -2002-05-16 Corinna Vinschen - - * v850-tdep.c: Full multi-arch. - * config/v850/tm-v850.h: Eliminate or move to v850-tdep.c everything. - Define GDB_MULTI_ARCH to 2. - -2002-05-16 Pierre Muller - - * p-exp.y (current_type): New static variable. - Carries the type of the expression at the position that is parsed. - (push_current_type, pop_current_type): Two new functions. Used - to store/restore current_type in expression on specific tokens. - (search_field): New static variable. Set to one after parsing a point - as at that point only a FIELDNAME token should be searched. - (FIELDNAME): New token. After a point only a token belonging to - current_type type definition is allowed. - (all over token rules): reset and change current_type according - to rules. - (exp '[' rule): insert implicit array index field if - exp is a pascal string type. - -2002-05-16 Corinna Vinschen - - * v850-tdep.c: Fix comment for v850_scan_prologue. Remove extra - frame info. Use frame_info's saved_regs instead of matching member - in extra_frame_info throughout. - (v850_frame_init_saved_regs): New function. - (v850_init_extra_frame_info): Move most functionality into - v850_frame_init_saved_regs(). - * config/v850/tm-v850.h (EXTRA_FRAME_INFO): Remove definition. - (v850_frame_find_saved_regs): Remove declaration. - (FRAME_FIND_SAVED_REGS): Remove definition. - (v850_frame_init_saved_regs): Add declaration. - (FRAME_INIT_SAVED_REGS): Add definition. - -2002-05-16 Corinna Vinschen - - * v850-tdep.c: Begin multi-arch'ing v850. - (v850_target_architecture_hook): Remove function. - (v850_gdbarch_init): New function. Add code previously in - v850_target_architecture_hook(). - (_initialize_v850_tdep): Don't set target_architecture_hook. - Call register_gdbarch_init() instead. - -2002-05-16 Daniel Jacobowitz - - * gdbtypes.h (struct cplus_struct_type): Remove args field. - * hpread.c (hpread_read_struct_type): Remove assignments to args. - (fixup_class_method_type): Likewise. - -2002-05-15 Jim Blandy - - Add macro structures to GDB's symbol tables. Nobody puts anything - in them yet. - * symtab.h (struct symtab): New member: `macro_table'. - * buildsym.h (pending_macros): New global variable. - * buildsym.c: #include "macrotab.h". - (buildsym_init): Initialize `pending_macros'. - (end_symtab): If we found macro information while reading a CU's - debugging info, do build a symtab structure for it. Make the - symtab point to the macro information, and clear the - `pending_macros' pointer which held it while we were reading the - debug info. - (really_free_pendings): Free any pending macro table. - * objfiles.h (struct objfile): New member: `macro_cache'. - * objfiles.c (allocate_objfile): Set allocate and free functions - for the macro cache's objstack. - (free_objfile): Empty the macro cache's obstack. - * symfile.c (reread_symbols): Empty the macro cache's obstack, and - set new allocate and free functions for it. - * solib-sunos.c (allocate_rt_common_objfile): Set allocate and - free functions for the macro cache's objstack. (Why is this - function building its own objfile?) - * symmisc.c (print_objfile_statistics): Print statistics on the - macro bcache. - * Makefile.in: Note that buildsym.o depends on macrotab.h. - -2002-05-15 Richard Earnshaw - - * config/arm/nm-nbsd.h: Use <> for include of config/nm-nbsd.h. - (REGISTER_U_ADDR): Delete definition. - (arm_register_u_addr): Delete declaration. - -2002-05-15 Richard Earnshaw - - * arm-linux-tdep.c (ARM_LINUX_JB_PC): Renamed from JB_PC. - (ARM_LINUX_JB_ELEMENT_SIZE): Likewise. - -2002-05-14 Andrew Cagney - - * regcache.c (register_valid): Revise comments refering to "Not - available" and "unavailable". - * frame.c (frame_register_read): Ditto. - * findvar.c (value_of_register): Ditto. - -2002-05-15 Andrew Cagney - - * Makefile.in (remote_sim_h): Replace remote-sim_h. - (remote-sim.o): Update dependencies. - (d10v-tdep.o): Specify dependencies. - (sim_d10v_h): Define. - -2002-05-14 Jim Blandy - - * macroexp.c (init_buffer, gather_arguments, expand): Use NULL, not 0. - * macrotab.c (macro_lookup_inclusion, find_definition, - new_macro_table): Same. - - * macroexp.c (currently_rescanning, expand): Use `strcmp () == 0', - not `! strcmp ()'. This is a dubious improvement. - * macrotab.c (macro_lookup_inclusion, find_definition): Same. - - * macrotab.c (macro_lookup_inclusion): Initialize `best_depth', - although it's not necessary, to avoid a warning. - -2002-05-14 Daniel Jacobowitz - - * gdbtypes.h: Update accessor macros to use TYPE_MAIN_TYPE. - (TYPE_CONST, TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE): Use - TYPE_INSTANCE_FLAGS. - (struct main_type): New. - (struct type): Move most members to struct main_type. Change - cv_type and as_type to new type_chain member. Add instance_flags. - (TYPE_MAIN_TYPE, TYPE_CHAIN, TYPE_INSTANCE_FLAGS): New macros. - (TYPE_CV_TYPE, TYPE_AS_TYPE): Remove. - (finish_cv_type): Remove prototype. - * gdbtypes.c (alloc_type): Update comment. Allocate TYPE_MAIN_TYPE. - Set TYPE_CHAIN. - (alloc_type_instance): New function. - (smash_type): New function. - (make_pointer_type, make_reference_type, make_function_type) - (smash_to_member_type, smash_to_method_type): Call smash_type. - (make_qualified_type): New function. - (make_type_with_address_space): Call make_qualified_type. - (make_cv_type): Likewise. - (finish_cv_type): Remove unnecessary function. - (replace_type): Update comment. Copy TYPE_MAIN_TYPE. - (recursive_dump_type): Dump TYPE_CHAIN and TYPE_INSTANCE_FLAGS; - remove TYPE_CV_TYPE and TYPE_AS_TYPE. - * c-typeprint.c (c_type_print_modifier): Use TYPE_INSTANCE_FLAGS. - * dwarf2read.c (read_structure_scope): Don't call finish_cv_type. - * hpread.c (hpread_read_struct_type): Likewise. - * stabsread.c (read_struct_type): Likewise. - -2002-05-14 Elena Zannoni - - * configure.tgt: Add a catch all sh* target, for cases like - sh[2,3,4]-elf and sh-hms. - -2002-05-14 Keith Seitz - - * event-loop.c (create_file_handler): Don't do anything but - update data when we are given a fd which we are already - monitoring. - -2002-05-14 Michal Ludvig - - * dwarf2cfi.c (context_cpy): Copy registers correctly. - (update_context): Use __func__ in warnings. - -2002-05-14 Daniel Jacobowitz - - * ser-tcp.c: Include . Rename tcp_open - and tcp_close to net_open and net_close. - (net_open): Accept "udp:" and "tcp:" specifications. Connect - using UDP if requested. Don't try to disable Nagle on UDP - sockets. - * remote.c (remote_serial_open): New function. Warn about UDP. - (remote_open_1, remote_async_open_1, remote_cisco_open): Call it. - -2002-05-13 Elena Zannoni - - * MAINTAINERS: List sh-elf as buildable with ,-Werror. - -2002-05-13 Elena Zannoni - - * configure.tgt: Remove sh-hms target. - * MAINTAINERS: Don't list sh-hms as a separate target. - -2002-05-13 Jim Blandy - - Add first preprocessor macro-expansion files. - * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. - * Makefile.in (SFILES): Add macrotab.c, macroexp.c. - (splay_tree_h, macroexp_h, macrotab_h): New variable. - (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. - (COMMON_OBS): Add macrotab.o, macroexp.o. - (macroexp.o, macrotab.o): New rules. - -2002-05-13 Andrew Cagney - - * config/m88k/tm-m88k.h: Update copyright. - (m88k_target_write_pc): Declare - (TARGET_WRITE_PC): Redefine using m88k_target_write_pc. - (M88K_NNPC_REGNUM): Rename NNPC_REGNUM. - (SHIFT_INST_REGS): Update definition. - * m88k-tdep.c (m88k_target_write_pc): New function. Implement - using old definition of TARGET_WRITE_PC. - * regcache.c (generic_target_write_pc): Delete code handling - NNPC_REGNUM. - * gdbarch.sh (NNPC_REGNUM): Delete. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-05-13 Richard Earnshaw - - * builtin-regs.c (value_of_builtin_reg): Correctly calculate the - builtin reg number. - -2002-05-13 Daniel Jacobowitz - - * ax-gdb.c (gen_sign_extend, gen_fetch, gen_usual_unary) - (gen_cast, gen_scale, gen_add, gen_sub, gen_binop, gen_deref) - (gen_address_of, gen_struct_ref, gen_repeat): Use type - access macros. - * c-typeprint.c (cp_type_print_method_args): Likewise. - (c_type_print_args): Likewise. - * d10v-tdep.c (d10v_push_arguments): Likewise. - (d10v_extract_return_value): Likewise. - * expprint.c (print_subexp): Likewise. - * gdbtypes.c (lookup_primitive_typename): Likewise. - (lookup_template_type, add_mangled_type, print_arg_types): Likewise. - * gdbtypes.h (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB) - (TYPE_TARGET_STUB, TYPE_STATIC, TYPE_CONST, TYPE_VOLATILE) - (TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_CODE_SPACE, TYPE_VARARGS) - (TYPE_VECTOR): Likewise. - * hpread.c (hpread_read_struct_type) - (fix_static_member_physnames, fixup_class_method_type) - (hpread_type_lookup): Likewise. - * mdebugread.c (parse_symbol, parse_type): Likewise. - * p-lang.c (is_pascal_string_type): Likewise. - * valops.c (hand_function_call): Likewise. - * x86-64-tdep.c (classify_argument): Likewise. - - * hpread.c (hpread_read_function_type) - (hpread_read_doc_function_type): Call replace_type. - * dstread.c (create_new_type): Delete. - (decode_dst_structure, process_dst_function): Call alloc_type. - Use type access macros. - -2002-05-12 Mark Kettenis - - * i387-tdep.c (i387_supply_fxsave): Skip the SSE registers if - the're not supported by the current architecture. - (i387_fill_fxsave): Likewise. - -2002-05-12 Fred Fish - - * symfile.c (default_symfile_offsets): Arrange for uninitialized - sect_index_xxx members to index the first slot in section_offsets - if all of the section_offsets are zero. - -2002-05-12 Mark Kettenis - - * configure.tgt (sparc-*openbsd): Remove entry accidentially - checked in with last change. - -2002-05-12 Mark Kettenis - - * configure.tgt (i[3456]86-*-unixware*, i[3456]86-*-unixware2*): - Remove targets. These are canonicalized to i386-*-sysv4.2uw by - config.sub. - -2002-05-12 Daniel Jacobowitz - - * Makefile.in: Update dependencies. - -2002-05-11 Andrew Cagney - - * language.c (local_hex_string_custom): Simplify. Do not depend - on PRINTF_HAS_LONG_LONG or CC_HAS_LONG_LONG. - - * memattr.c (mem_info_command): Replace calls to - longest_local_hex_string and longest_local_hex_string_custom. - * buildsym.c (make_blockvector): Ditto. - * solib.c (info_sharedlibrary_command): Ditto. - * tracepoint.c (tracepoints_info): Ditto. - * symtab.c (print_msymbol_info): Ditto. - - * language.c (local_hex_string): Delete. - (local_hex_string_custom): Delete. - (longest_local_hex_string): Rename to local_hex_string. - (longest_local_hex_string_custom): Rename to - local_hex_string_custom. - * language.h (local_hex_string): Change parameter type to LONGEST. - (local_hex_string_custom): Ditto. - (longest_local_hex_string): Delete declaration. - (longest_local_hex_string_custom): Ditto. - - * solib.c: Update copyright. - * memattr.c: Update copyright. - -2002-05-11 Andrew Cagney - - * arch-utils.h (legacy_register_to_value): Declare. - (legacy_value_to_register): Declare. - (legacy_convert_register_p): Declare. - * arch-utils.c (legacy_register_to_value): New function. - (legacy_value_to_register): New function. - (legacy_convert_register_p): New function. - - * gdbarch.sh (REGISTER_TO_VALUE): Define. - (VALUE_TO_REGISTER): Define. - (CONVERT_REGISTER_P): Define. - * gdbarch.h, gdbarch.c: Regenerate. - - * valops.c (value_assign): Use CONVERT_REGISTER_P and - VALUE_TO_REGISTER. - * findvar.c (value_from_register): Use REGISTER_TO_VALUE and - CONVERT_REGISTER_P. - -2005-05-11 Daniel Jacobowitz - Peter Schauer - - * Makefile.in: Update dependencies for valops.c. - * valops.c: Include "gdb_assert.h". - (typecmp): Skip THIS parameter to methods. - (find_method_list): Remove static_memfuncp argument, - update callers. Check for stub methods. - (find_value_oload_method_list): Don't set *static_memfuncp. - (find_overload_match): Don't check for stub methods. Assert - that methods are not stubbed. Handle static methods. - (value_find_oload_method_list): Remove static_memfuncp argument. - * gdbtypes.c (check_stub_method): Do not add THIS pointer - to the argument list for static stub methods. - * value.h (value_find_oload_method_list): Update prototype. - -2002-05-11 Andrew Cagney - - * arch-utils.h (generic_register_size): Declare. - (generic_register_raw_size, generic_register_virtual_size): Delete - declarations. - * arch-utils.c (generic_register_raw_size): Delete. - (generic_register_size): New function. - (generic_register_virtual_size): Delete. - - * gdbarch.sh (REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE): Make - default generic_register_size. - * gdbarch.h, gdbarch.c: Re-generate. - - * d10v-tdep.c (d10v_gdbarch_init): Use generic_register_size for - register_virtual_size. - * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. - * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. - -2002-05-11 Andrew Cagney - - * gdbarch.sh (gdbarch_data): Add gdbarch parameter. - * gdbarch.h, gdbarch.c: Regenerate. - * gnu-v3-abi.c: Update copyright. - (vtable_address_point_offset): Update. - (gnuv3_rtti_type): Update. - (gnuv3_baseclass_offset): Update. - * solib-svr4.c (svr4_fetch_link_map_offsets): Update. - (init_fetch_link_map_offsets): Update. - * remote.c (get_remote_state): Update. - -2002-05-11 Daniel Jacobowitz - - * TODO: Remove value_headof/value_from_vtable_info comment. - * printcmd.c (print_command_1): Don't call value_from_vtable_info. - * values.c (value_headof, value_from_vtable_info): Delete. - * value.h (value_from_vtable_info): Delete prototype. - -2002-05-11 Andrew Cagney - - * Makefile.in: Replace gdb_assert.h with $(gdb_assert_h), - gdb_string.h with $(gdb_string_h) and gdb_regex.h with - $(gdb_regex_h). - (gdb_assert_h): Define. - (gdb_wait_h): Define. - (gdb_regex_h): Define. - -2002-05-11 Daniel Jacobowitz - - From Peter Schauer : - * linespec.c (find_methods): Handle GCC 3.x template constructors. - -2002-05-11 Jason Thorpe - - * nbsd-tdep.c: Fix comment. - -2002-05-11 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add nbsd-tdep.c. - (alphanbsd-tdep.o): Add nbsd-tdep.h to dependency list. - (nbsd-tdep.o): New dependency list. - * alphanbsd-tdep.c: Don't include solib-svr4.h. Include - nbsd-tdep.h. - (alphanbsd_solib_svr4_fetch_link_map_offsets): Remove. - (alphanbsd_init_abi): Use nbsd_lp64_solib_svr4_fetch_link_map_offsets. - * nbsd-tdep.c: New file. - * nbsd-tdep.h: New file. - * shnbsd-tdep.c: Don't include solib-svr4.h. Include - nbsd-tdep.h. - (shnbsd_solib_svr4_fetch_link_map_offsets): Remove. - (shnbsd_init_abi): Use nbsd_ilp32_solib_svr4_fetch_link_map_offsets. - * config/alpha/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. - * config/sh/nbsd.mt (TDEPFILES): Ditto. - -2002-05-11 Jason Thorpe - - * config/alpha/nbsd.mh (NATDEPFILES): Remove corelow.o. - * config/alpha/nbsd.mt (TDEPFILES): Add corelow.o. - * config/i386/nbsd.mh (NATDEPFILES): Remove corelow.o. - * config/i386/nbsd.mt (TDEPFILES): Add corelow.o. - * config/i386/nbsdelf.mh (NATDEPFILES): Remove corelow.o. - * config/i386/nbsdelf.mt (TDEPFILES): Add corelow.o. - -2002-05-11 Jason Thorpe - - * config/i386/nbsd.mh (NATDEPFILES): Use line continuations. - * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. - * config/m68k/nbsd.mh (NATDEPFILES): Likewise. - * config/ns32k/nbsd.mh (NATDEPFILES): Likewise. - * config/powerpc/nbsd.mh (NATDEPFILES): Likewise. - * config/sparc/nbsd.mh (NATDEPFILES): Likewise. - * config/sparc/nbsdelf.mh (NATDEPFILES): Likewise. - -2002-05-11 Jason Thorpe - - * i386nbsd-nat.c: Delete file. Move fetch_core_registers and - fetch_elfcore_registers to... - * i386nbsd-tdep.c: ...here. - (i386nbsd_use_struct_convention): Rename to... - (i386nbsd_aout_use_struct_convention): ...this. - (i386nbsd_supply_reg): New function. - (i386nbsd_fill_reg): New function. - (fetch_core_registers): Use i386nbsd_supply_reg. - (fetch_elfcore_registers): Likewise. - (_initialize_i386nbsd_tdep): New function. - * config/i386/nbsd.mh (NATDEPFILES): Remove i386nbsd-nat.o. - * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. - * config/i386/nbsdelf.mt (TDEPFILES): Add i386nbsd-tdep.o. - * config/i386/tm-nbsd.h (i386nbsd_use_struct_convention): Rename to... - (i386nbsd_aout_use_struct_convention): ...this. - -2002-05-11 Jason Thorpe - - * shnbsd-nat.c (fetch_inferior_registers): Use shnbsd_supply_reg. - (store_inferior_registers): Use shnbsd_fill_reg. - * shnbsd-tdep.c (sh_nbsd_supply_registers, - sh_nbsd_supply_register): Collapse into... - (shnbsd_supply_reg): ...this. - (sh_nbsd_fill_registers, sh_nbsd_fill_register): Collapse into... - (shnbsd_fill_reg): ...this. - (sh_nbsd_solib_svr4_fetch_link_map_offsets): Rename to... - (shnbsd_solib_svr4_fetch_link_map_offsets): ...this. - (fetch_core_registers): Use shnbsd_supply_reg. - (fetch_elfcore_registers): Use shnbsd_supply_reg. - (sh_nbsd_core_fns): Rename to... - (shnbsd_core_fns): ...this. - (sh_nbsd_elfcore_fns): Rename to... - (shnbsd_elfcore_fns): ...this. - (sh_nbsd_init_abi): Rename to... - (shnbsd_init_abi): ...this. - (_initialize_sh_nbsd_tdep): Rename to... - (_initialize_shnbsd_tdep): ...this. - * shnbsd-tdep.h (sh_nbsd_supply_registers, - sh_nbsd_supply_register, sh_nbsd_fill_registers, - sh_nbsd_fill_register): Remove prototypes. - (shnbsd_supply_reg, shnbsd_fill_reg): Add prototypes. - -2002-05-11 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Remove i387-nat.c. - (i387-nat.o): Delete dependency list. - (go32-nat.o): Change i387-nat.h to i387-tdep.h. - (x86-64-linux-nat.o): Likewise. - * i387-nat.c: Delete file, moving contents to... - * i387-tdep.c: ...here. - * i387-nat.h: Rename... - * i387-tdep.h: ...to this. - * go32-nat.c: Include i387-tdep.h instead of i387-nat.h. - * i386-linux-nat.c: Likewise. - * i386bsd-nat.c: Likewise. - * i386gnu-nat.c: Likewise. - * i386nbsd-nat.c: Likewise. - * i386v4-nat.c: Likewise. - * x86-64-linux-nat.c: Likewise. - * config/i386/fbsd.mh (NATDEPFILES): Remove i387-nat.o. - * config/i386/go32.mh (NATDEPFILES): Likewise. - * config/i386/i386gnu.mh (NATDEPFILES): Likewise. - * config/i386/i386sol2.mh (NATDEPFILES): Likewise. - * config/i386/i386v42mp.mh (NATDEPFILES): Likewise. - * config/i386/linux.mh (NATDEPFILES): Likewise. - * config/i386/nbsd.mh (NATDEPFILES): Likewise. - * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. - * config/i386/obsd.mh (NATDEPFILES): Likewise. - * config/i386/x86-64linux.mh (NATDEPFILES): Likewise. - -2002-05-11 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Remove alphanbsd-nat.c. - (alphanbsd-nat.o): Remove dependency list. - (alphanbsd-tdep.o): Add $(regcache_h) to dependency list. - * alphanbsd-nat.c: Delete. Contents moved to... - * alphanbsd-tdep.c: ...here. - (_initialize_alphanbsd_tdep): Register core functions. - * config/alpha/nbsd.mh (NATDEPFILES): Remove alphanbsd-nat.o. - -2002-05-11 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add alphabsd-tdep.c. - (alphabsd-nat.o): Depend on alphabsd-tdep.h. - (alphanbsd-nat.o): Likewise. - (alphabsd-tdep.o): New dependency list. - * alphabsd-nat.c (supply_gregset): Use alphabsd_supply_reg. - (fill_gregset): Use alphabsd_fill_reg. - (supply_fpregset): Use alphabsd_supply_fpreg. - (fill_fpregset): Use alphabsd_fill_fpreg. - (fetch_inferior_registers): Use struct reg and struct fpreg - rather than gregset_t and fpregset_t. Use alphabsd_supply_reg - and alphabsd_supply_fpreg. - (store_inferior_registers): Use struct reg and struct fpreg - rather than gregset_t and fpregset_t. Use alphabsd_fill_reg - and alphabsd_fill_fpreg. - * alphabsd-tdep.c: New file. - * alphabsd-tdep.h: New file. - * alphanbsd-nat.c (fetch_core_registers): Use alphabsd_supply_fpreg. - (fetch_elfcore_registers): Use alphabsd_supply_reg and - alphabsd_supply_fpreg. - * config/alpha/fbsd.mt (TDEPFILES): Add alphabsd-tdep.o. - * config/alpha/nbsd.mt (TDEPFILES): Likewise. - -2002-05-11 Eric Christopher - - * mips-tdep.c (mips_double_register_type): Fix thinko. - (mips_single_register_type): Ditto. - * MAINTAINERS: Add self. - -2002-05-11 Mark Kettenis - - * i387-nat.c (i387_supply_register, i387_fill_fsave, - i387_supply_fxsave, i387_fill_fxsave): Rewrite in order to do the - right thing on architectures with different endianness and/or - integer sizes. - -2002-05-10 Jason Thorpe - - From Christian Limpach - * configure.in: Change sed expression which comments out - NATDEPFILES to also comment out continuation lines. - * configure: Regenerate. - -2002-05-10 Elena Zannoni - - * sh-tdep.c: Clean up code erroneously reintroduced by previous - big patch. - -2002-05-10 Elena Zannoni - - * sh-tdep.c: Include correct file. - -2002-05-10 Elena Zannoni - - New support for sh64-elf (sh5) target. - - * configure.tgt: For sh64-elf target, default to sh-elf. - - * config/sh/tm-sh.h (enum sh-abi): Possible ABI's. - (struct gdbarch_tdep): Add new fields for new registers and ABI - info. - - * sh-tdep.c: Include elf-bfd.h, elf/sh.h, gdb/sim-sh.h. - (NUM_PSEUDO_REGS_SH_MEDIA, NUM_PSEUDO_REGS_SH_COMPACT, - MSYMBOL_IS_SPECIAL, IS_ISA32_ADDR, MAKE_ISA32_ADDR, - UNMAKE_ISA32_ADDR, IS_PTABSL_R18, IS_STS_R0, IS_STS_PR, - IS_MOV_TO_R15, IS_MOV_R14, IS_STQ_R18_R14, IS_STQ_R18_R15, - IS_STL_R18_R15, IS_STQ_R14_R15, IS_STL_R14_R15, IS_ADDIL_SP_MEDIA, - IS_ADDI_SP_MEDIA, IS_ADDL_SP_FP_MEDIA, IS_ADD_SP_FP_MEDIA, - IS_MOV_SP_FP_MEDIA, IS_MOV_R0, IS_MOVL_R0, IS_ADD_SP_R0, - IS_MOV_R14_R0, IS_MEDIA_IND_ARG_MOV, IS_MEDIA_ARG_MOV, - IS_MEDIA_MOV_TO_R14, IS_COMPACT_IND_ARG_MOV, IS_COMPACT_ARG_MOV, - IS_COMPACT_MOV_TO_R14, IS_JSR_R0, IS_NOP): New macros. - (sh_sh64_register_name, sh64_elf_make_msymbol_special, - pc_is_isa32, sh_sh64_breakpoint_from_pc, look_for_args_moves, - sh64_skip_prologue_hard_way, sh64_use_struct_convention, - gdb_print_insn_sh64, translate_insn_rn, sh64_frame_chain, - sh64_get_saved_pr, fpp_reg_base_num, is_media_pseudo, - sh64_get_gdb_regnum, sh64_media_reg_base_num, - sh64_compact_reg_base_num, translate_rn_to_arch_reg_num, - sign_extend, sh64_nofp_frame_init_saved_regs, - sh64_init_extra_frame_info, sh64_get_saved_register, - sh64_extract_struct_value_address, sh64_pop_frame, - sh64_push_arguments, sh64_extract_return_value, - sh64_store_return_value, sh64_show_media_regs, - sh64_show_compact_regs, sh64_show_regs, sh_sh64_register_byte, - sh_sh64_register_raw_size, sh_sh64_register_virtual_size, - sh_sh64_register_virtual_type, - sh_sh64_register_convert_to_virtual, - sh_sh64_register_convert_to_raw, sh64_pseudo_register_read, - sh64_register_read, sh64_pseudo_register_write, - sh64_register_write, do_fv_c_register_info, do_dr_c_register_info, - do_r_c_register_info, do_fpp_register_info, do_cr_c_register_info, - sh64_do_pseudo_register, sh_compact_do_registers_info, - sh64_do_registers_info, sh_gdbarch_init): New functions. - -2002-05-10 Elena Zannoni - - * sh-tdep.c (sh_breakpoint_from_pc): Add 'const' to return type. - -2002-05-10 Daniel Jacobowitz - - * linespec.c (decode_line_1): Check for a double quote after - a filename correctly. - -2002-05-10 Jim Blandy - - Properly track the size of the current objfile's .debug_line section. - * dwarf2read.c (struct dwarf2_pinfo): New member: dwarf_line_size. - (DWARF_LINE_SIZE): New macro. - (dwarf2_build_psymtabs_hard): Record the line section's size in - the partial symbol table. - (psymtab_to_symtab_1): Restore dwarf_line_size from the partial - symbol table. - -2002-05-10 Petr Sorfa - - * ia64-tdep.c: Handle breakpoints on L instruction type - in MLX instruction bundle by moving the breakpoint to - the third slot (X instruction type) as L holds only data. - -2002-05-10 Kevin Buettner - - * dbxread.c (discarding_local_symbols_complaint): New complaint. - (process_one_symbol): Complain about discarding local symbols - due to a misplaced N_LBRAC entry. - -2002-05-09 Elena Zannoni - - From Daniel Berlin - * linespec.c (find_toplevel_char): '<' and '>' also increase and - decrease the depth we are at, in the case of templates. - -2002-05-09 Daniel Jacobowitz - - * mips-tdep.c (mips_float_register_type): New function. - (mips_double_register_type): New function. - (mips_print_register): Use them. - (do_fp_register_row): Likewise. - -2002-05-09 Daniel Jacobowitz - - * signals/signals.c (signals): Remove conditional compilation around - Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. - (target_signal_from_name): Loop until TARGET_SIGNAL_LAST. - -2002-05-09 Michael Snyder - - * remote-rdp.c (remote_rdp_can_run): Remove. - -2002-05-09 Tom Tromey - - * jv-valprint.c (java_val_print): Handle `char' as a special case - of TYPE_CODE_INT. - -2002-05-09 Michael Snyder - - * arm-tdep.c (arm_scan_prologue): Accept strb r(0123),[r11,#-nn], - strh r(0123),[r11,#-nn], str r(0123),[r11,#-nn], as well as - strb r(0123),[sp,#nn], strh r(0123),[sp,#nn] and - str r(0123),[sp,#nn]. - (arm_skip_prologue): Ditto. Also make disassembly - order-independent by placing it in a loop. - -2002-05-06 Michael Snyder - - * stabsread.c (read_type): Add recognition for new attribute: - "@V;" means that an array type is actually a vector. - This is analogous to the vector flag that's been added to dwarf2. - -2002-05-09 Mark Kettenis - - * i386-tdep.h (i386_abi): New enum. - (struct gdbarch_tdep): Replace os_ident member with abi. - (i386_gdbarch_register_os_abi): New prototype. - * i386-tdep.c (i386_abi_names): New array. - (process_note_abi_tag_sections): Removed. - (process_note_sections): New function. - (i386_elf_abi_from_note, i386_elf_abi): New functions. - (struct i386_abi_handler): New struct. - (i386_abi_handler_list): New variable. - (i386_gdbarch_register_os_abi): New function. - (i386_gdbarch_init): Adapt for the changes given above. - -2002-05-08 Daniel Jacobowitz - - * gregset.h: Say "GNU/Linux". - -2002-05-08 Elena Zannoni - - * gdbtypes.c : Add new builtin type for 64 bit vectors. - (build_gdbtypes): Build builtin_type_v2_float. - (_initialize_gdbtypes): Register new builtin type. - -2002-05-08 Andrew Cagney - - * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. - (clear_gdbarch_swap): New function. - (initialize_non_multiarch): Call. - (gdbarch_update_p): Before calling init(), swap out and clear the - existing architecture. - * gdbarch.c: Regenerate. - -2002-05-08 Jason Thorpe - - * config/djgpp/fnchange.lst: Add alphanbsd-nat.c and - alphanbsd-tdep.c. - -2002-05-08 Jason Thorpe - - * sh-nbsd-nat.c: Rename to... - * shnbsd-nat.c: ...this. - * sh-nbsd-tdep.c: Rename to... - * shnbsd-tdep.c: ...this. - * sh-nbsd-tdep.h: Rename to... - * shnbsd-tdep.h: ...this. - * config/sh/nbsd.mh: Use shnbsd-nat.o. - * config/sh/nbsd.mt: Use shnbsd-tdep.o. - -2002-05-08 Richard Earnshaw - - * remote-rdi.c (_initializie_remote_rdi): Use ANSI-style string - concatenation for command help messages. - -2002-05-08 Jason Thorpe - - * NEWS: Note new sh*-*-netbsdelf* configuration. - * configure.host: Set gdb_host_cpu to sh for all sh*. - (sh*-*-netbsdelf*): New host. - * configure.tgt: Set gdb_target_cpu to sh for all sh*. - (sh*-*-netbsdelf*): New target. - * sh-nbsd-nat.c: New file. - * sh-nbsd-tdep.c: New file. - * sh-nbsd-tdep.h: New file. - * config/sh/nbsd.mh: New file. - * config/sh/nbsd.mt: New file. - * config/sh/nm-nbsd.h: New file. - * config/sh/tm-nbsd.h: New file. - -2002-05-08 Jason Thorpe - - * sh-tdep.c (sh_osabi_names): Declare. - (process_note_abi_tag_sections): New function. - (get_elfosabi): Ditto. - (sh_gdbarch_register_os_abi): Ditto. - (sh_dump_tdep): Ditto. - _initialize_sh_tdep): Use gdbarch_register to register - sh_gdbarch_init and sh_dump_tdep. - * config/sh/tm-sh.h (sh_osabi): Declare. - (gdbarch_tdep): Add sh_osabi and osabi_name members. - -2002-05-07 Andrew Cagney - - * arm-tdep.c (arm_skip_prologue): Handle generic dummy frames. - (thumb_scan_prologue): Ditto. - (arm_find_callers_reg): Ditto. - (arm_frame_chain): Ditto. - (arm_init_extra_frame_info): Ditto. - (arm_frame_saved_pc): Ditto. - (arm_pop_frame): Ditto. - (arm_push_return_address): New function. - (arm_gdbarch_init): Initialize use_generic_dummy_frames, - call_dummy_location, call_dummy_breakpoint_offset_p, - call_dummy_breakpoint_offset, call_dummy_p, - call_dummy_stack_adjust_p, call_dummy_words, - sizeof_call_dummy_words, call_dummy_start_offset, - call_dummy_length, fix_call_dummy, pc_in_call_dummy, - call_dummy_address, push_return_address and push_dummy_frame for - generic dummy frames. - -2002-05-07 Jason Thorpe - - * sh-tdep.c (sh_nofp_frame_init_saved_regs): Fix error in - size computation for alloca. - (sh_fp_frame_init_saved_regs): Likewise. - -2002-05-07 Richard Earnshaw - - * arm-tdep.h (ARM_MAX_REGISTER_RAW_SIZE): Define. - (ARM_MAX_REGISTER_VIRTUAL_SIZE): Define. - * arm-tdep.c (arm_store_return_value): Use them. - Use FP_REGISTER_RAW_SIZE when setting the FPA return value. - * remote-rdp.c (remote_rdp_fetch_register): Use - ARM_MAX_REGISTER_RAW_SIZE. - (remote_rdp_store_register): Likewise. - -2002-05-07 Michal Ludvig - - * dwarf2cfi.c: Code cleanup, removed unused variables, - added default labels to switch {} statements. - * x86-64-tdep.c: Ditto. - * x86-64-linux-nat.c: Ditto. - -2002-05-07 Jason Thorpe - - * solib.h: Protect against multiple inclusion. - -2002-05-06 Jim Blandy - - Add first preprocessor macro-expansion files. - * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. - * Makefile.in (SFILES): Add macrotab.c, macroexp.c. - (splay_tree_h, macroexp_h, macrotab_h): New variable. - (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. - (COMMON_OBS): Add macrotab.o, macroexp.o. - (macroexp.o, macrotab.o): New rules. - - Separate the job of reading the line number info statement program - header (...expialidocious) out into its own function. - * dwarf2read.c (struct line_head, struct filenames, struct - directories): Replace with... - (struct line_header): New structure, containing the full - contents of the statement program header, including the - include directory and file name tables. - (read_file_scope): If we have line number info, instead of just - calling dwarf_decode_lines to do all the work, call - dwarf_decode_line_header first to get a `struct line_header' - containing the data in the statement program header, and then - pass that to dwarf_decode_lines, which will pick up where that - left off. Be sure to clean up the `struct line_header' object. - (dwarf_decode_line_header, free_line_header, add_include_dir, - add_file_name): New functions. - (dwarf_decode_lines): Move all the code to read the statement - program header into dwarf_decode_line_header. Take the line - header it built as the first argument, instead of the offset to - the compilation unit's line number info. Use the new `struct - line_header' type instead of the old structures. No need to do - cleanups here now, since we don't allocate anything. - (dwarf2_statement_list_fits_in_line_number_section, - dwarf2_line_header_too_long): New complaints. - -2002-05-06 Elena Zannoni - - * gdbtypes.c (init_vector_type): New function. - (build_builtin_type_vec128): Simplify the representation of SIMD - registers. - (build_gdbtypes): Initialize new builtin vector types. - (_initialize_gdbtypes): Register new vector types with gdbarch. - (builtin_type_v4_float, builtin_type_v4_int32, - builtin_type_v8_int16, builtin_type_v16_int8, - builtin_type_v2_int32, builtin_type_v4_int16, - builtin_type_v8_int8): New (renamed) SIMD types. - -2002-05-06 Mark Kettenis - - * i387-nat.c (i387_fill_fsave): Use regcache_collect. - (i387_fill_fxsave): Likewise. - -2002-05-05 Alexandre Oliva - - * alpha-tdep.c (alpha_extract_return_value): Don't use - non-constant array size in prototype. - -2002-05-04 Andrew Cagney - - From Brian Taylor : - * ui-out.c (ui_out_field_core_addr): Use the function - longest_local_hex_string_custom'to format addresses > 32 bits - wide. - - * ui-out.c (ui_out_field_core_addr): Update comment. - -2002-05-04 Andrew Cagney - - * stack.c (select_and_print_frame): Make static. Delete the - parameter `level'. - (func_command): Update call. - (select_frame_command): Delete code computing the frame level. - * frame.h (select_and_print_frame): Delete declaration. - -2002-05-04 Andrew Cagney - - * sparc-tdep.c (sparc_get_saved_register): Comment why - get_prev_frame call is safe. - -2002-05-04 Andrew Cagney - - * frame.h (select_frame): Delete level parameter. - * stack.c (select_frame): Update. Use frame_relative_level to - obtain the frame's level. - (select_and_print_frame): Update call. - (select_frame_command): Ditto. - (up_silently_base): Ditto. - (down_silently_base): Ditto. - * ocd.c (ocd_start_remote): Ditto. - * remote-rdp.c (remote_rdp_open): Ditto. - * remote-mips.c (mips_initialize): Ditto. - (common_open): Ditto. - * remote-e7000.c (e7000_start_remote): Ditto. - * m3-nat.c (select_thread): Ditto. - * hppa-tdep.c (child_get_current_exception_event): Ditto. - (child_get_current_exception_event): Ditto. - * varobj.c (varobj_create): Ditto. - (varobj_update): Ditto. - (c_value_of_root): Ditto. - * tracepoint.c (finish_tfind_command): Ditto. - * corelow.c (core_open): Ditto. - * arch-utils.c (generic_prepare_to_proceed): Ditto. - * thread.c (info_threads_command): Ditto. - (switch_to_thread): Ditto. - * infrun.c (normal_stop): Ditto. - (restore_selected_frame): Ditto. - (restore_inferior_status): Ditto. - * breakpoint.c (insert_breakpoints): Ditto. - (watchpoint_check): Ditto. - (bpstat_stop_status): Ditto. - (do_enable_breakpoint): Ditto. - * blockframe.c (flush_cached_frames): Ditto. - (reinit_frame_cache): Ditto. - -2002-05-04 Andrew Cagney - - * MAINTAINERS (Host/Native): Add Jason Thorpe as NetBSD - maintainer. - -2002-05-04 Jim Blandy - - * gdbtypes.c (replace_type): Doc fix. - -2002-05-04 Andrew Cagney - - * valprint.c (strcat_longest): Delete commented out function. - Update copyright. - -2002-05-04 Andrew Cagney - - * MAINTAINERS: Mark a29k as deleted. - * NEWS: Mention that a29k was removed. Add OBSOLETE section. - Move new configurations to the top. - * configure.tgt: Remove a29k. - * config/a29k/tm-vx29k.h: Delete. - * config/a29k/vx29k.mt: Delete. - * config/a29k/tm-a29k.h: Delete. - * config/a29k/a29k-udi.mt: Delete. - * config/a29k/a29k.mt: Delete. - * a29k-tdep.c: Delete. - * remote-udi.c: Delete. - * remote-mm.c: Delete. - * remote-eb.c: Delete. - * remote-adapt.c: Delete. - * Makefile.in: Remove obsolete code. - * config/s390/s390x.mt: Ditto. - * config/s390/s390.mt: Ditto. - * config/sparc/sparclynx.mh: Ditto. - * config/sparc/linux.mh: Ditto. - * config/pa/hppaosf.mh: Ditto. - * config/pa/hppabsd.mh: Ditto. - * config/ns32k/nbsd.mt: Ditto. - * config/mips/vr5000.mt: Ditto. - * config/m68k/sun3os4.mh: Ditto. - * config/m68k/nbsd.mt: Ditto. - * config/m68k/m68klynx.mh: Ditto. - * config/m32r/m32r.mt: Ditto. - * config/i386/x86-64linux.mt: Ditto. - * config/i386/nbsdelf.mt: Ditto. - * config/i386/nbsd.mt: Ditto. - * config/i386/i386lynx.mh: Ditto. - -2002-05-04 Andrew Cagney - - * target.c (debug_print_register): New function. Handle oversize - registers. - (debug_to_fetch_registers): Call. - (debug_to_store_registers): Call. - -2002-05-03 Jim Blandy - - * stabsread.c (cleanup_undefined_types): Use replace_type, not memcpy. - (read_type): Doc fix. - * gdbtypes.c (replace_type): Doc fix. - - * stabsread.c (multiply_defined_struct): New complaint. - (read_struct_type): If the type we were passed isn't empty, or - incomplete, don't read the new struct type into it; complain, - and return the original type unchanged. Take a new `type_code' - argument, which is the type code for the new type. - (read_type): Rather than storing the type's type code here, pass - it as an argument to read_struct_type, and let that take care of - storing it. That way, we don't overwrite the original type code, - so read_struct_type can use it to decide whether we're overwriting - something we shouldn't. - (complain_about_struct_wipeout): New function. - -2002-05-03 Andrew Cagney - - * gdbarch.sh: Assert that gdbarch is non-NULL. - * gdbarch.c: Regenerate. - -2002-05-03 Jason Merrill - - * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn - and return NULL. - -2002-05-03 Michal Ludvig - - * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map), - (x86_64_dwarf2gdb_regno_map_length), - (x86_64_dwarf2_reg_to_regnum): Added. - (x86_64_gdbarch_init): Added registration of x86_64_dwarf2_reg_to_regnum. - (x86_64_gdbarch_init): Renamed from i386_gdbarch_init. - (_initialize_x86_64_tdep): Synced with the change above. - (x86_64_skip_prologue): Reformulated message. - -2002-05-03 Pierre Muller - - * f-exp.y: Also use new prev_lexptr variable - to improve error reporting. Based on Michael Snyder - 2002-04-24 dated patch to c-exp.y. - * jv-exp.y: Likewise. - * m2-exp.y: Likewise. - -2002-05-02 Elena Zannoni - - * valops.c (value_arg_coerce): Don't coerce arrays to pointers if - we are dealing with vectors. - -2002-05-02 Pierre Muller - - * config/m68k/tm-nbsd.h: Obvious fix, - correct machine name. - -2002-05-02 Pierre Muller - - * p-typeprint.c (pascal_type_print_base): Add support - for TYPE_CODE_STRING and TYPE_CODE_BITSTRING. - -2002-05-02 Pierre Muller - - * p-lang.c (pascal_create_fundamental_type): Use TYPE_CODE_CHAR - for fondamental pascal 'char' type. - -2002-05-02 Pierre Muller - - * p-lang.h (is_pascal_string_type): Declaration changed, - new sixth argument of type char ** added. - * p-lang.c (is_pascal_string_type): Implementation - changed. Args length_pos, length_size, string_pos, char_size - can now be NULL. New argument arrayname set to the field - name of the char array. Return value set to char array - field index plus one. - * p-valprint.c (pascal_val_print): Adapt to new declaration of - is_pascal_string_type function. - -2002-05-02 Andrew Cagney - - * gdbarch.sh (gdbarch_update_p): Revert 2002-05-02 Andrew Cagney - change. - * gdbarch.c: Regenerate. - -2002-05-02 Andrew Cagney - - * gdbarch.sh (gdbarch_update_p): Swap out the old architecture - before probing for a new one. Detect errorenous gdbarch_init - functions. - * gdbarch.c: Regenerate. - -2002-05-01 Andrew Cagney - - * config/mn10200/tm-mn10200.h: Include "symfile.h" and "symtab.h". - * config/mcore/tm-mcore.h: Ditto. Update copyright. - * config/v850/tm-v850.h: Ditto. Update copyright. - -2002-04-30 Andrew Cagney - - * cris-tdep.c (cris_gdbarch_init): Use arches instead of - current_gdbarch. - -2002-04-30 Michael Snyder - - * arm-tdep.c: Whitespace clean-ups. - (arm_skip_prologue): Fix thinko; two lines - should have been removed as part of 4/24 change. - -2002-04-30 Kevin Buettner - - * rs6000-tdep.c: Added comment describing how fpscr register - numbers were chosen. - -2002-04-30 Michael Snyder - - * gnu-nat.c (gnu_find_memory_regions): Fix merge botch. - -2002-04-29 Elena Zannoni - - * hpread.c (DNTT_TYPE_VECTOR): Rename from TYPE_VECTOR. - (DNTT_TYPE_VECTOR_LENGTH): Rename from TYPE_VECTOR_LENGTH. - (hpread_symfile_init, hpread_lookup_type): Substitute throughout. - -2002-04-29 Kevin Buettner - - From Louis Hamilton : - * rs6000-tdep.c (coff/xcoff.h, libxcoff.h): Include. - * xcoffread.c (coff/xcoff.h, libxcoff.h): Likewise. - * rs6000-tdep.c (rs6000_gdbarch_init): Use bfd_xcoff_is_xcoff64(), - not bfd-private xcoff data, to determine wordsize. - * xcoffread.c (read_xcoff_xymtab, read_symbol_lineno): Likewise. - -2002-04-29 Andrew Cagney - - GDB 5.2 released from 5.2 branch. - -2002-04-29 Michal Ludvig - - * x86-64-linux-nat.c (fill_gregset): Explicit cast to avoid warning. - * x86-64-tdep.c (i386_gdbarch_init): Ditto. - (x86_64_register_info_table): Added comments with register numbers. - -2002-04-29 Elena Zannoni - - * rs6000-tdep.c (rs6000_extract_return_value, - rs6000_store_return_value): Handle returning vectors. - (rs6000_gdbarch_init): Use - ppc_sysv_abi_broken_use_struct_convention for native sysv cases. - * ppc-linux-tdep.c (ppc_sysv_abi_broken_use_struct_convention): - New function. - (ppc_sysv_abi_use_struct_convention): Deal with functions returning - vectors. - (ppc_sysv_abi_push_arguments): Handle vector parameters. - * ppc-tdep.h (ppc_sysv_abi_broken_use_struct_convention): Export. - -2002-04-24 Pierre Muller - - * hpread.c (hpread_psymtab_to_symtab_1, - hpread_psymtab_to_symtab): Replace fprintf tab_to_s...) - with fprintf_unfiltered (gdb_stderr,...). - -2002-04-24 Pierre Muller - - * remote-array.c (printf_monitor, write_monitor, - array_insert_breakpoint, array_remove_breakpoint ): - Replace fprintf (stderr,... - with fprintf_unfiltered (gdb_stderr,.... - * remote-es.c: Likewise. - * remote-os9k.c: Likewise. - * remote-st.c: Likewise. - -2002-04-28 Andreas Schwab - - * config/s390/s390.mh (NATDEPFILES): Remove solib.o, add - linux-proc.o and gcore.o. - -2002-04-26 Michal Ludvig - - * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging - code without frame pointers. - -2002-04-26 Andrew Cagney - - * sparc-tdep.c (sparc_gdbarch_init): Add comment explaining why - ON_STACK is needed. - -2002-04-26 Ben Elliston - - * target.c (do_xfer_memory): Correct reference to the new option - "trust-readonly-sections". - -2002-04-26 Elena Zannoni - - * gdbtypes.h (TYPE_FLAG_VECTOR, TYPE_VECTOR): Define. - * gdbtypes.c (recursive_dump_type): Output the vector flag. - * dwarf2read.c (dwarf_attr_name): Handle new attribute for - vectors. - (read_array_type): Record the fact that this array type is really a - vector (i.e. are passed in by value). - -2002-04-26 Jason Thorpe - - * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member. - * alpha-tdep.c (alpha_sigcontext_addr): New function. - (alpha_find_saved_regs): Use alpha_sigcontext_addr. - (alpha_gdbarch_init): Initialize tdep->sigcontext_addr. - * alpha-linux-tdep.c: Include frame.h. - (alpha_linux_sigcontext_addr): New function. - (alpha_linux_init_abi): Set tdep->sigcontext_addr to - alpha_linux_sigcontext_addr. - * alpha-osf1-tdep.c: Include gdbcore.h. - (alpha_osf1_sigcontext_addr): New function. - (alpha_osf1_init_abi): Set tdep->sigcontext_addr to - alpha_osf1_sigcontext_addr. - * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove. - * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove. - -2002-04-26 Andrew Cagney - - * stack.c (selected_frame_level): - (select_frame): Do not set selected_frame_level. - * frame.h (selected_frame_level): Delete declaration. - -2002-04-26 Andrew Cagney - - * rs6000-tdep.c (rs6000_gdbarch_init): Only set - convert_from_func_ptr-addr when AIX / PowerOpen. - -2002-04-25 Andrew Cagney - - * valops.c (hand_function_call): Call - generic_save_call_dummy_addr. - * frame.h (generic_save_call_dummy_addr): Declare. - * blockframe.c (struct dummy_frame): Add fields call_lo and - call_hi. - (generic_find_dummy_frame): Check for PC in range call_lo to - call_hi instead of entry_point_address. - (generic_pc_in_call_dummy): Search the dummy frames for a PC in - the call_lo to call_hi range. Allow for DECR_PC_AFTER_BREAK. - (generic_save_call_dummy_addr): New function. - -2002-04-24 David S. Miller - - * sparc-tdep.c (sparc_gdbarch_skip_prologue): Kill, duplicates - sparc_skip_prologue. - (sparc_skip_prologue): Kill frameless_p arg, and use line number - information to find prologue when possible. - (sparc_prologue_frameless_p): Call examine_prologue directly. - (sparc_gdbarch_init): Update set_gdbarch_skip_prologue call. - * config/sparc/tm-sparc.h (sparc_skip_prologue): Update for killed - second argument. - (SKIP_PROLOGUE): Likewise. - -2002-04-25 Jason Thorpe - - * alpha-tdep.c (alpha_skip_prologue_internal): Remove - GDB_TARGET_HAS_SHARED_LIBS #ifdef and update comment to - indicate that the condition it was testing is always true. - * config/alpha/nm-linux.h (GDB_TARGET_HAS_SHARED_LIBS): Remove. - * config/alpha/nm-nbsd.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. - * config/alpha/nm-osf.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. - -2002-04-25 Jason Thorpe - - * alpha-tdep.h (gdbarch_tdep): Add jb_pc and jb_elt_size members. - * alpha-linux-tdep.c (alpha_linux_init_abi): Initialize - tdep->jb_pc and tdep->jb_elt_size. - * alpha-osf1-tdep.c (alpha_osf1_init_abi): Likewise. - * alphafbsd-tdep.c (alphafbsd_init_abi): Likewise. - * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise. - * alpha-nat.c (get_longjmp_target): Remove. - (JB_ELEMENT_SIZE): Ditto. - (JB_PC): Ditto. - * alpha-tdep.c (alpha_get_longjmp_target): New function. - (alpha_gdbarch_init): Default tdep->jb_pc to -1. If the - OS ABI sets jb_pc to a valid value, set gdbarch_get_longjmp_target - to alpha_get_longjmp_target. - (alpha_dump_tdep): Report tdep->jb_pc and tdep->jb_elt_size. - * config/alpha/nm-linux.h (GET_LONGJMP_TARGET): Remove. - * config/alpha/nm-osf.h (GET_LONGJMP_TARGET): Remove. - -2002-04-25 Andrew Cagney - - * README: Update to GDB 5.2. - -2002-04-25 Andrew Cagney - - * gdbarch.sh (LC_ALL): Set to `c'. - -2002-04-25 Theodore A. Roth - - * avr-tdep.c: Ran through gdb_indent.sh. - -2002-04-25 Theodore A. Roth - - * MAINTAINERS: Add myself as AVR maintainer. - * NEWS: Note new target avr. - -2002-04-25 Theodore A. Roth - - * Makefile.in: Add support for AVR target. - * configure.tgt: Add support for AVR target. - * avr-tdep.c: New file - * config/avr/avr.mt: New file. - -2002-04-25 Theodore A. Roth - - * MAINTAINERS: Add myself to write-after-approval. - -2002-04-24 Pierre Muller - - * f-lang.c (get_bf_for_fcn): Replace fprintf (stderr,... - with fprintf_unfiltered (gdb_stderr,.... - -2002-04-25 Pierre Muller - - Fix PR gdb/508. - * symfile.c (add_filename_language): Fix wrong xrealloc size argument. - -2002-04-25 Pierre Muller - - * p-exp.y: Also use new prev_lexptr variable - to improve error reporting. Based on Michael Snyder - 2002-04-24 dated patch to c-exp.y. - -2002-04-25 Jason Thorpe - - * alpha-tdep.c (alpha_breakpoint_from_pc): New function. - (alpha_gdbarch_init): Set gdbarch_breakpoint_from_pc to - alpha_breakpoint_from_pc. Set gdbarch_function_start_offset - to 0. - * config/alpha/tm-alpha.h: Remove forward decls of struct type - and struct value. - (FUNCTION_START_OFFSET): Remove. - (BREAKPOINT): Ditto. - -2002-04-25 Jason Thorpe - - * MAINTAINERS: Reflect that multi-arch is enabled for VAX. - * NEWS: Ditto. - -2002-04-24 Jason Thorpe - - * alpha-linux-tdep.c (alpha_linux_pc_in_sigtramp): New function. - (alpha_linux_init_abi): Set gdbarch_pc_in_sigtramp to - alpha_linux_pc_in_sigtramp. - * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): New function. - (alpha_osf1_init_abi): Set gdbarch_pc_in_sigtramp to - alpha_osf1_pc_in_sigtramp. - * alpha-tdep.c (alpha_osf_in_sigtramp): Remove. - * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): New function. - (alphafbsd_init_abi): Set gdbarch_pc_in_sigtramp to - alphafbsd_pc_in_sigtramp. - * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): New function. - (alphanbsd_init_abi): Set gdbarch_pc_in_sigtramp to - alphanbsd_pc_in_sigtramp. - * config/alpha/tm-alpha.h (IN_SIGTRAMP): Remove. - * config/alpha/tm-alphalinux.h (IN_SIGTRAMP): Remove. - -2002-04-24 Jason Thorpe - - * config/alpha/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. - -2002-04-24 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add alphanbsd-nat.c and - alphanbsd-tdep.c. - (alphanbsd-nat.o): New dependency list. - (alphanbsd-tdep.o): Ditto. - * NEWS: Note new native NetBSD/alpha configuration. - * alphanbsd-nat.c: New file. - * alphanbsd-tdep.c: Ditto. - * configure.host (alpha*-*-netbsd*): New host. - * configure.tgt (alpha*-*-netbsd*): New target. - * config/alpha/nbsd.mh: New file. - * config/alpha/nbsd.mt: Ditto. - * config/alpha/nm-nbsd.h: Ditto. - * config/alpha/tm-nbsd.h: Ditto. - -2002-04-24 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add alpha-osf1-tdep.c. - (alpha-osf1-tdep.o): New dependency list. - * alpha-tdep.h (gdbarch_tdep): Add dynamic_sigtramp_offset - and skip_sigtramp_frame members. - * alpha-linux-tdep.c: Include gdbcore.h. - (alpha_linux_sigtramp_offset): Change return type to LONGEST. - (alpha_linux_init_abi): Initialize tdep->dynamic_sigtramp_offset. - * alpha-osf1-tdep.c: New file. - * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Moved to - alpha-osf1-dep.c. - (alpha_frame_past_sigtramp_frame): New function. - (alpha_dynamic_sigtramp_offset): Ditto. - (alpha_proc_desc_is_dyn_sigtramp): Ditto. - (alpha_set_proc_desc_is_dyn_sigtramp): Ditto. - (ALPHA_PROC_SIGTRAMP_MAGIC): Define. - (push_sigtramp_desc): Use alpha_set_proc_desc_is_dyn_sigtramp. - (after_prologue): Use alpha_proc_desc_is_dyn_sigtramp. - (find_proc_desc): Use alpha_dynamic_sigtramp_offset. - (alpha_frame_chain): Use alpha_frame_past_sigtramp_frame. - (alpha_init_extra_frame_info): Use alpha_proc_desc_is_dyn_sigtramp. - (alpha_pop_frame): Use alpha_proc_desc_is_dyn_sigtramp. - (alpha_gdbarch_init): Initialize tdep->dynamic_sigtramp_offset - and tdep->skip_sigtramp_frame. Set gdbarch_skip_trampoline_code - to find_solib_trampoline_target. - * config/alpha/alpha-osf1.mt (TDEPFILES): Add alpha-osf1-tdep.o. - * config/alpha/tm-alpha.h: Remove inclusion of regcache.h. - (SKIP_TRAMPOLINE_CODE): Remove. - (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. - (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. - (DYNAMIC_SIGTRAMP_OFFSET): Ditto. - (FRAME_PAST_SIGTRAMP_FRAME): Ditto. - * config/alpha/tm-alphalinux.h (PROC_DESC_IS_DYN_SIGTRAMP): Remove. - (PROC_SIGTRAMP_MAGIC): Ditto. - (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. - (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. - (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. - (DYNAMIC_SIGTRAMP_OFFSET): Ditto. - (FRAME_PAST_SIGTRAMP_FRAME): Ditto. - -2002-04-24 Jason Thorpe - - * NEWS: Note that Alpha targets are now multi-arch. - -2002-04-24 Michael Snyder - - * parser-defs.h (prev_lexptr): New external variable. - * parse.c (parse_exp_1): Set prev_lexptr to null before - calling the language-specific parser. - * c-exp.y (yylex): Set prev_lexptr to start of current token. - (yyerror): Use prev_lexptr in error reporting. - -2002-04-24 Daniel Jacobowitz - - * config/i386/tm-linux.h: Define FILL_FPXREGSET. - * gregset.h: If FILL_FPXREGSET is defined, provide - gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset. - * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET - is defined, call fill_fpxregset. - -2002-04-24 Roland McGrath - - * config/i386/i386gnu.mh (NATDEPFILES): Add core-regset.o here. - * i386gnu-nat.c [HAVE_SYS_PROCFS_H] - (supply_gregset, supply_fpregset): New functions. - - * gnu-nat.c (gnu_find_memory_regions): New function. - (init_gnu_ops): Set `to_find_memory_regions' hook to that. - (gnu_xfer_memory): Add a cast. - -2002-04-24 Michael Snyder - - * arm-tdep.c (arm_scan_prologue): Move "mov ip, sp" into the - loop. Add handling for "str lr, [sp, #-4]!" and for saves - of argument regs ("str r(0123), [r11, #-nn"]). - (arm_skip_prologue): Better handling for frameless functions. - Treat "mov ip, sp" as optional. Recognize "str lr, [sp, #-4]". - (arm_skip_prologue): Recognize str r(0123), [r11, #-nn]. - -Wed Apr 24 14:22:21 2002 Andrew Cagney - - * arm-tdep.c (arm_gdbarch_init): Add comment that NUM_REGS nor - NUM_PSEUDO_REGS can be used. - -2002-04-24 Andrew Cagney - - * arch-utils.h: Update copyright. - - * gdbarch.sh (PC_IN_SIGTRAMP): Add. - * gdbarch.h, gdbarch.c: Re-generate. - - * inferior.h (IN_SIGTRAMP): Delete definition. - * arch-utils.c (legacy_pc_in_sigtramp): New function. - * arch-utils.h (legacy_pc_in_sigtramp): Declare. - - * mips-tdep.c (mips_init_extra_frame_info): Use PC_IN_SIGTRAMP. - (mips_dump_tdep): Do not print value of IN_SIGTRAMP. - * hppa-tdep.c (pc_in_interrupt_handler): Use PC_IN_SIGTRAMP. - (find_proc_framesize): Ditto. - * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Ditto. - (alpha_init_extra_frame_info): Ditto. - * infrun.c (handle_inferior_event): Ditto. - (handle_inferior_event): Ditto. - (check_sigtramp2): Ditto. - * blockframe.c (create_new_frame): Ditto. - (get_prev_frame): Ditto. - * ppc-linux-tdep.c: Update comments. - * i386-linux-tdep.c: Update comments. - * breakpoint.c (bpstat_what): Update comment. - -2002-04-24 David S. Miller - - * i960-tdep.c (register_in_window_p): New function. - (i960_find_saved_register): Use it instead of - REGISTER_IN_WINDOW_P. - * config/i960/tm-i960.h (REGISTER_IN_WINDOW): Delete. - - * symtab.h (find_stab_function_addr): Kill extern. - * minsyms.c (find_stab_function_addr): Remove from here... - * dbxread.c: ... to here, and mark it static. - -2002-04-20 David S. Miller - - * sparc-tdep.c (sparc_pop_frame): Only need to allocate - SPARC_INTREG_SIZE * 16 bytes for reg_temp. - -2002-04-21 David S. Miller - - * remote-vxsparc.c (vx_read_register): Fix typo, we want - REGISTER_RAW_SIZE of SP_REGNUM not CORE_ADDR. - (vx_write_register): Likewise. - -2002-04-23 J. Brobecker - - * source.c (is_regular_file): New function. - (openp): Check wether file to open is a regular file - to avoid opening directories. - -2002-04-22 Jason Thorpe - - * findvar.c (extract_signed_integer): Cast printf argument - to suppress format warning. - (extract_unsigned_integer): Likewise. - * infcmd.c (registers_info): Likewise. - * top.c (get_prompt_1): Likewise. - * valops.c (value_assign): Likewise. - * valprint.c (print_decimal): Likewise. - -2002-04-22 H.J. Lu (hjl@gnu.org) - - * c-exp.y (typebase): Support - - [long|long long|short] [signed|unsigned] [int|] - - and - - signed [long|long long|short] int - -2002-04-22 Jason Thorpe - - * Makefile.in (vax-tdep.o): Add $(arch_utils_h), $(inferior_h), - and vax-tdep.h. - * vax-tdep.h: New file. - * vax-tdep.c: Include inferior.h, arch-utils.h, and vax-tdep.h. - Make several routines static. - (vax_get_saved_register): New function. - (vax_gdbarch_init): New function. - (_initialize_vax_tdep): Register vax_gdbarch_init. - * config/vax/tm-vax.h: Set GDB_MULTI_ARCH to GDB_MULTI_ARCH_PARTIAL. - Remove macros now under the control of gdbarch. - -2002-04-22 Michael Snyder - - * arm-tdep.c (arm_skip_prologue): Recognize "sub sp, sp, #nn". - Some whitespace and coding standards tweaks. - -2002-04-22 Jason Thorpe - - * vax-tdep.c: Include regcache.h. - (vax_call_dummy_words): New. - (sizeof_vax_call_dummy_words): New. - (vax_fix_call_dummy): New function. - (vax_saved_pc_after_call): Ditto. - * config/vax/tm-vax.h: Don't include regcache.h. - (SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call. - (CALL_DUMMY): Remove. - (CALL_DUMMY_WORDS): Define. - (SIZEOF_CALL_DUMMY_WORDS): Define. - (FIX_CALL_DUMMY): Use vax_fix_call_dummy. - -2002-04-18 Michael Snyder - - * arm-tdep.h: Change regnum defines to enums for ease of debugging. - -2002-04-22 Jason Thorpe - - * vax-tdep.c (vax_frame_chain): New function. - (vax_push_dummy_frame): Ditto. - (vax_pop_frame): Ditto. - * config/vax/tm-vax.h (FRAME_CHAIN): vax_frame_chain. - (FRAMELESS_FUNCTION_INVOCATION): Use - generic_frameless_function_invocation_not. - (PUSH_DUMMY_FRAME): Use vax_push_dummy_frame. - (POP_FRAME): Use vax_pop_frame. - -2002-04-22 Jason Thorpe - - * vax-tdep.c (vax_store_struct_return): New function. - (vax_extract_return_value): Ditto. - (vax_store_return_value): Ditto. - (vax_extract_struct_value_address): Ditto. - * config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use - vax_store_struct_return. - (EXTRACT_RETURN_VALUE): Use vax_extract_return_value. - (STORE_RETURN_VALUE): Use vax_store_return_value. - (EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address. - -2002-04-22 Jason Thorpe - - * vax-tdep.c (vax_frame_saved_pc): New function. - (vax_frame_args_address_correct): Ditto. - (vax_frame_args_address): Ditto. - (vax_frame_locals_address): Ditto. - (vax_frame_num_args): Move code to be in proximity to - other frame-related functions. - * config/vax/tm-vax.h (INNER_THAN): Use core_addr_lessthan. - (FRAME_SAVED_PC): Use vax_frame_saved_pc. - (FRAME_ARGS_ADDRESS_CORRECT): Use vax_frame_args_address_correct. - (FRAME_ARGS_ADDRESS): Use vax_frame_args_address. - (FRAME_LOCALS_ADDRESS): Use vax_frame_locals_address. - -2002-04-22 H.J. Lu (hjl@gnu.org) - - * Makefile.in (FLAGS_TO_PASS): Add libdir, mandir, datadir and - includedir. - -2002-04-22 Jason Thorpe - - * vax-tdep.c (vax_frame_init_saved_regs): New function. - * config/vax/tm-vax.h (FRAME_FIND_SAVED_REGS): Remove. - (FRAME_INIT_SAVED_REGS): New macro. - -2002-04-22 Jason Thorpe - - * MAINTAINERS: Reflect that the Alpha target has been multi-arch'd. - -2002-04-22 Jason Thorpe - - * alpha-nat.c (get_longjmp_target): Use ALPHA_* constants - where needed. - (fetch_osf_core_registers): Likewise. - (supply_gregset): Likewise. - -2002-04-22 J. Brobecker - - * symfile.h (get_section_index): Define. - * symfile.c (get_section_index): New function. - * mdebugread.c (SC_IS_SBSS): New macro. - (SC_IS_BSS): Return true for the scBss storage class only, as - the scSBss storage class refers to the .sbss section. - (parse_partial_symbols): Discard the symbols which associated - section does not exist. - Make sure to use the .sbss section index for symbols which - storage class is scBss, rather than using the .bss section index. - -2002-04-22 Jason Thorpe - - * vax-tdep.c: Update copyright years. - (vax_register_name): New function. - (vax_register_byte): Ditto. - (vax_register_raw_size): Ditto. - (vax_register_virtual_size): Ditto. - (vax_register_virtual_type): Ditto. - * config/vax/tm-vax.h: Update copyright years. - (REGISTER_NAMES): Remove. - (REGISTER_NAME): Define. - (REGISTER_BYTE): Use vax_register_byte. - (REGISTER_RAW_SIZE): Use vax_register_raw_size. - (REGISTER_VIRTUAL_SIZE): Use vax_register_virtual_size. - (REGISTER_VIRTUAL_TYPE): Use vax_register_virtual_type. - -2002-04-21 Andrew Cagney - - * config/sparc/tm-sparc.h (sparc_skip_prologue): Restore - declaration - * arc-tdep.c (arc_prologue_frameless_p): Fix syntax error. - -2002-04-21 David S. Miller - - * arch-utils.c (generic_prologue_frameless_p): Kill - SKIP_PROLOGUE_FRAMELESS_P code. - * config/arc/tm-arc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete - references. - (PROLOGUE_FRAMELESS_P, arc_prologue_frameless_p): New. - * arc-tdep.c (arc_prologue_frameless_p): Implement. - * config/arc/tm-sparc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete - references. - (PROLOGUE_FRAMELESS_P, sparc_prologue_frameless_p): New. - * sparc-tdep.c (sparc_prologue_frameless_p): Implement. - (sparc_gdbarch_init): Pass it to - set_gdbarch_prologue_frameless_p. - -2002-04-21 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add alphabsd-nat.c. - (alphabsd-nat.o): New dependency list. - -2002-04-21 Jason Thorpe - - * Makefile.in (ALLDEPFILES): Add alpha-linux-tdep.c and - alphafbsd-tdep.c. - (alpha-linux-tdep.o): New dependency list. - (alphafbsd-tdep.o): Likewise. - -2002-04-21 Jason Thorpe - - * alpha-linux-tdep.c: New file. Move alpha_linux_sigtramp_offset - to here... - * alpha-tdep.c: ...from here. - * config/alpha/alpha-linux.mt (TDEPFILES): Add alpha-linux-tdep.o. - -2002-04-21 Jason Thorpe - - * config/alpha/tm-alpha.h: Move alpha_software_single_step - prototype from here... - * alpha-tdep.h: ...to here. - -2002-04-21 Andrew Cagney - - * frame.h (selected_frame_level): Document as deprecated. - (frame_relative_level): Declare. - * stack.c (frame_relative_level): New function. - (selected_frame_level): Document as deprecated. - (select_frame): Do not set the selected_frame_level. - - * stack.c (frame_info, record_selected_frame): Update. - (frame_command, current_frame_command): Update. - (up_silently_base, up_command, down_silently_base): Update. - (down_command): Update. - * inflow.c (kill_command): Update. - * tracepoint.c (finish_tfind_command): Update. - * corelow.c (core_open): Update. - * thread.c (info_threads_command): Update. - (do_captured_thread_select): Update. - * infcmd.c (finish_command): Update. - * breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update. - -2002-04-21 Jason Thorpe - - * config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Remove. - -2002-04-21 Andrew Cagney - - * arm-tdep.c (arm_breakpoint_from_pc): Make static. Make return - type const. - -2002-04-21 Jason Thorpe - - * alphafbsd-tdep.c: Update copyright years. Include - alpha-tdep.h. - (alphafbsd_use_struct_convention): Make static. - (alphafbsd_init_abi): New function. - (_initialize_alphafbsd_tdep): New function. - * config/alpha/tm-fbsd.h: Update copyright years. - (USE_STRUCT_CONVENTION): Remove. - -2002-04-21 Jason Thorpe - - * alpha-tdep.c (alpha_abi_handler): New structure to describe - an Alpha ABI variant. - (alpha_abi_handler_list): Declare. - (alpha_gdbarch_register_os_abi): New function. - (alpha_gdbarch_init): Give registered ABI variant handlers a - chance to tweak the gdbarch once we have set up defaults. - * alpha-tdep.h: Prototype alpha_gdbarch_register_os_abi. - -2002-04-21 Jason Thorpe - - * alpha-tdep.c (alpha_gdbarch_init): Set coerce_float_to_double - to standard_coerce_float_to_double. - * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Remove. - -2002-04-21 Jason Thorpe - - * alpha-tdep.h (gdbarch_tdep): Add vm_min_address member. - * alpha-tdep.c (heuristic_proc_start): Use vm_min_address - from gdbarch_tdep rather than a constant. - (alpha_gdbarch_init): Initialize tdep->vm_min_address to - the default text address for all Alpha Unix ABIs. - (alpha_dump_tdep): Report the value of tdep->vm_min_address. - * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete. - -2002-04-21 Jason Thorpe - - * alpha-tdep.h: New file. Includes several Alpha target constants - taken from... - * config/alpha/tm-alpha.h: ...here. Remove macros that we now - let gdbarch deal with. - (GDB_MULTI_ARCH): Define as GDB_MULTI_ARCH_PARTIAL. - * Makefile.in (alpha-nat.o): Add alpha-tdep.h and $(BFD_SRC)/elf-bfd - to dependency list. - * alpha-nat.c: Include alpha-tdep.h. Update for adjusted - Alpha target register names. - * alphabsd-nat.c: Likewise. - * alpha-tdep.c: Include alpha-tdep.h. Update for adjusted - Alpha target register names. Make serveral routines static. - (alpha_get_saved_register): New function. - (alpha_abi_names): New. - (process_note_abi_tag_sections): New function. - (get_elfosabi): New function. - (alpha_gdbarch_init): New function. - (alpha_dump_tdep): New function. - (_initialize_alpha_tdep): Register alpha_gdbarch_init. - -2002-04-21 Andrew Cagney - - * frame.c (find_saved_register): Delete #ifdef - HAVE_REGISTER_WINDOWS code. - * config/sparc/tm-sparc.h: Update comments. - * config/i960/tm-i960.h (HAVE_REGISTER_WINDOWS): Delete macro. - -2002-04-21 Andrew Cagney - - * i960-tdep.c (i960_find_saved_register): New function. - (i960_get_saved_register): New function. - * config/i960/tm-i960.h (GET_SAVED_REGISTER): Define. - (i960_get_saved_register): Declare. - * config/i960/tm-i960.h, i960-tdep.c: Update copyright. - -2002-04-20 David S. Miller - - * sparc-nat.c (store-inferior_registers): Fix ambiguous else. - -2002-04-20 Andrew Cagney - - * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs - instead of NUM_PSEUDO_REGS. - -2002-04-20 David S. Miller - - * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Define to - GDB_MULTI_ARCH_PARTIAL - * config/sparc/tm-sp64linux.h (GDB_MULTI_ARCH): Do not - define, let tm-sp64.h do it. - -2002-04-20 Jason Thorpe - - * frame.c (find_saved_register): Avoid a NULL pointer - dereference and actually walk the frame list. - -2002-04-20 Andrew Cagney - - * gdbarch.sh (gdbarch_update_p): Keep the list of architectures - sorted in most most-recent-used order. Document. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-04-19 Andrew Cagney - - * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame - instead of ->prev. - * z8k-tdep.c (z8k_frame_chain): Do not use ->prev. - * s390-tdep.c (s390_frame_chain): Do not use ->prev. - * rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain() - instead of ->prev. - -2002-04-19 Elena Zannoni - - Fix PR gdb/471. - * gdbtypes.c (init_simd_type): Rewrite using new functions. - (build_builtin_type_vec128): Ditto. - (append_composite_type_field): Fix calculation of type length in - union case. - -2002-04-19 Eli Zaretskii - - * config/djgpp/README: Update. - - * go32-nat.c (store_register): Cast &a_tss to `char *' to avoid a - compiler warnings. - -2002-04-19 Jason Thorpe - - * alpha-tdep.c (setup_arbitrary_frame): Rename... - (alpha_setup_arbitrary_frame): ...to this. - * config/alpha/tm-alpha.h (SETUP_ARBITRARY_FRAME): Update - for alpha_setup_arbitrary_frame. - -2002-04-18 Andrew Cagney - - * gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer. - * gdbarch.h, gdbarch.c: Regenerate. - - * defs.h (breakpoint_from_pc_fn): Delete type definition. - * target.h (memory_breakpoint_from_pc): Update declaration. - * config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto. - - * arch-utils.c (legacy_breakpoint_from_pc): Update return type. - * mcore-tdep.c (mcore_breakpoint_from_pc): Ditto. - * mem-break.c (memory_breakpoint_from_pc): Ditto. - * rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto. - * s390-tdep.c (s390_breakpoint_from_pc): Ditto - * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto. - * mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto. - * mips-tdep.c (mips_breakpoint_from_pc): Ditto. - * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto. - * ia64-tdep.c (ia64_breakpoint_from_pc): Ditto. - * d10v-tdep.c (d10v_breakpoint_from_pc): Ditto. - * arch-utils.c (legacy_breakpoint_from_pc): Ditto.. - - * mem-break.c (default_memory_insert_breakpoint): Make `bp' a - const pointer. - * monitor.c (monitor_insert_breakpoint): Ditto. - * rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'. - - * config/mcore/tm-mcore.h: Update copyright. - * mem-break.c: Ditto. - * xstormy16-tdep.c: Ditto. - -2002-04-18 Pierre Muller - - * p-exp.y: Add precedence rule for '^' token. - This removes the shift/reduce conflicts. - Remove the comment concerning these shift/reduce conflicts. - -2002-04-18 Elena Zannoni - - * rs6000-tdep.c (COMMON_UISA_NOFP_REGS): New macro. - (registers_powerpc_nofp): New register set for processors - without floating point unit. - -2002-04-18 David S. Miller - - * MAINTAINERS: Add myself to write-after-approval. - -2002-04-17 Michael Snyder - - * MAINTAINERS: Add myself as co-maintainer of testsuite/gdb.asm. - -2002-04-17 Andrew Cagney - - * rs6000-tdep.c (frame_initial_stack_address): Use - frame_register_read to read the alloca_reg. - -2002-04-17 Andrew Cagney - - * frame.c (find_saved_register): Find saved registers in the next - not prev frame. - Fix PR gdb/365. - -2002-04-17 Andrew Cagney - - * gdbarch.sh (LANG): Set to ``c''. - -2002-04-15 Andrew Cagney - - * PROBLEMS: Mention hppa2.0-hp-hpux10.20 compile problems. - -2002-04-15 Andrew Cagney - - * bcache.c: Include and after "defs.h". - Update copyright. - - * hpread.c (hpread_get_lntt): Add declaration. - Also fix PR gdb/391. - -2002-04-14 Andrew Cagney - - * acinclude.m4 (AM_PROG_CC_STDC): Import from automake 1.6. - * aclocal.m4, configure: Re-generate. - Fix PR gdb/391. - -2002-04-14 Elena Zannoni - - * mi/mi-cmd-disas.c (dump_insns): Use TARGET_PRINT_INSN - instead of tm_print_insn. - -2002-04-14 Elena Zannoni - - * ppc-bdm.c (bdm_ppc_fetch_registers): Fix typo. - -2002-04-14 Andrew Cagney - - * config/pa/tm-hppa.h (FRAME_CHAIN_COMBINE): Delete macro. - * blockframe.c (FRAME_CHAIN_COMBINE): Delete macro. - (get_prev_frame): Do not call FRAME_CHAIN_COMBINE. - -2002-04-12 Don Howard - - * cli/cli-cmds.c (init_cli_cmds): Add new user settable value: - max_user_call_depth. - (init_cmd_lists): Initialize the new value; - * cli/cli-script.c (execute_user_command): Limit the call depth of - user defined commands. This avoids a core-dump when user commands - are infinitly recursive. - -2002-04-12 Kevin Buettner - - * ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''. - * rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset'' - from tdep struct instead of DEFAULT_LR_SAVE. - (rs6000_gdbarch_init): Initialize ``lr_frame_offset''. - * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete. - * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete. - -2002-04-12 Michael Snyder - - * Remote.c: Spelling fix. - * gcore.c (default_derive_heap_segment): Use bfd_section_name. - If no symbol found for "sbrk", try "_sbrk". - (make_output_phdrs): Use bfd_section_name. - (gcore_copy_callback): Use bfd_section_name. - * eval.c: Indentation fix-ups. - * d10v-tdep.c (d10v_make_iaddr): Make it idempotent, - in case it gets applied to an address that is already - in the instruction space. - * cli/cli-decode.c (help_list): Allow long lines to wrap. - * symfile.c: Fix indentation, long lines. - * source.c: White space fix-up. - -2002-04-12 Andrew Cagney - - * defs.h (read_relative_register_raw_bytes): Delete declaration. - * frame.c (frame_register_read): New function. Return non-zero on - success. - (read_relative_register_raw_bytes_for_frame): Delete. - (read_relative_register_raw_bytes): Delete. - * frame.h (frame_register_read): Declare. - * d30v-tdep.c: Update Copyright. Use frame_register_read. - * sh-tdep.c: Ditto. - * infcmd.c (do_registers_info): Ditto. - * hppa-tdep.c: Ditto. - * rs6000-tdep.c: Ditto. - * h8500-tdep.c: Ditto. - * mips-tdep.c: Ditto. - * h8300-tdep.c: Ditto. - * z8k-tdep.c: Ditto. - -2002-04-12 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (rs6000_gdbarch_init): Use rs6000_* methods for - 64-bit SysV ABI. - -2002-04-12 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from - bfd info. - -2002-04-12 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (powerpc64, 630, rs64ii, rs64iii): Define - register sets for these processor variants. - -2002-04-11 Daniel Jacobowitz - - * regformats/reg-ppc.dat: Support FPSCR. - -2002-04-11 Kevin Buettner - - * ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''. - * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): - Add fpscr as an invalid/unfetchable register. - * ppc-linux-nat.c (ppc_register_u_addr, store_register) - (fetch_ppc_registers, store_ppc_registers, supply_fpregset) - (fill_fpregset): Add support for register fpscr. - (fetch_ppc_registers, store_ppc_registers, supply_gregset) - (fill_gregset): Account for the fact that register ``mq'' might - not exist. - * rs6000-tdep.c (PPC_UISA_SPRS): Use (unused) slot 70 for fpscr. - (registers_power): Add fpscr to register set at slot 71. - (rs6000_gdbarch_init): Account for the fact that ``mq'' doesn't - exist on most PPC architectures. Initialize ppc_fpscr_regnum. - -2002-04-11 Michael Snyder - - * configure.in: Autoconfiscate _SYSCALL32 define for solaris. - * configure: Regenerate. - * config.in: Regenerate. - * acconfig.h: Add define for _SYSCALL32. - * core-sol2.c: Remove #define _SYSCALL32. - * solib-legacy.c: Remove #define _SYSCALL32. - -2002-04-10 Andrew Cagney - - * stack.c (select_frame): Cleanup internal error message, do not - use %p. - -2002-04-10 Andrew Cagney - - * stack.c (select_frame): Check that selected_frame and the - specified level are as expected. - * blockframe.c (get_prev_frame): Set the `level' from next_frame. - Update copyright. - * frame.h (struct frame_info): Add field `level'. Update - copyright. - Work-in-progress PR gdb/464. - -2002-04-10 Andrew Cagney - - * maint.c (maint_print_section_info): Rename print_section_info. - (print_bfd_section_info, print_objfile_section_info): Update. - * inferior.h (struct gdbarch): Add opaque declaration. - * gdbarch.sh: Add include of "inferior.h" to gdbarch.sh. - * gdbarch.h: Regenerate. - -2002-04-10 Michal Ludvig - - * x86-64-linux-nat.c (child_resume, child_xfer_memory): Delete. - (PTRACE_XFER_TYPE): Moved to config/i386/nm-x86-64.h. - (kernel_u_size): Added. - * config/i386/nm-x86-64.h (CHILD_XFER_MEMORY, CHILD_RESUME): Delete. - (PTRACE_XFER_TYPE): Moved here from config/i386/nm-x86-64.h. - -2002-04-04 Jim Ingham - - * valarith.c (find_size_for_pointer_math): New function, either returns - the size for a pointer's target, returns 1 for void *, or errors for - incomplete types. - (value_add, value_sub): use find_size_for_pointer_math. - -2002-04-09 Daniel Jacobowitz - - * linux-low.c (linux_look_up_symbols): New hook. - (linux_target_ops): Add linux_look_up_symbols. - * remote-utils.c (decode_address): New function. - (look_up_one_symbol): New function. - * server.c (handle_query): Call target look_up_symbols hook. - * server.h (look_up_one_symbol): Add prototype. - * target.h (struct target_ops): Add look_up_symbols hook. - -2002-04-09 Andrew Cagney - - * frame.c (read_relative_register_raw_bytes_for_frame): Do not - override FP_REGNUM with frame->fp. Update copyright. - * parse.c (num_std_regs, std_regs): Delete. - (target_map_name_to_register): Do not search std_regs. Update - function description. - * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete - declarations. Update copyright. - Fix PR gdb/251. - -2002-04-09 Daniel Jacobowitz - - * symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer - after the last symbol in a block. - -2002-04-09 Pierre Muller - - * p-exp.y (yylex): Handle also the fact that is_a_field_of_this - is non zero as a found symbol. - -2002-04-08 Andrew Cagney - - * findvar.c: Include "builtin-regs.h". - (value_of_register): Call value_of_builtin_reg when applicable. - * parse.c: Include "builtin-regs.h" and "gdb_assert.h". - (target_map_name_to_register): Call - builtin_reg_map_name_to_regnum. - * Makefile.in (SFILES): Add builtin-regs.c and std-regs.c. - (COMMON_OBS): Add builtin-regs.o and std-regs.o. - (builtin_regs_h): Define. - (builtin-regs.o): New target. - (findvar.o): Add $(builtin_regs_h). - * builtin-regs.c, builtin-regs.h: New files. - * std-regs.c: New file. - Partial fix for PR gdb/251. - -2002-04-08 Kevin Buettner - - * rs6000-tdep.c (rs6000_gdbarch_init): Don't set tm_print_insn; - it's no longer required. - -2002-04-08 Andrew Cagney - - * Makefile.in (gdbtk-wrapper.o): Add missing dependencies. - -2002-04-08 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (rs6000_software_single_step): Use - rs6000_breakpoint_from_pc() to fetch breakpoint instruction - and size. Use target_insert_breakpoint() and - target_remove_breakpoint() to insert and remove breakpoints - instead of explicit memory reads and writes. - -2002-04-08 Kevin Buettner - - * config/powerpc/tm-ppc-eabi.h (ELF_OBJECT_FORMAT): Delete. - * rs6000-tdep.c (rs6000_push_arguments): Eliminate - ELF_OBJECT_FORMAT ifdef. - -2002-04-08 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_print_insn(). - -2002-04-08 Kevin Buettner - - From Jimi X : - * rs6000-tdep.c (rs6000_fix_call_dummy): Delete unused macro - definitions for TOC_ADDR_OFFSET and TARGET_ADDR_OFFSET. - -2002-04-07 Mark Kettenis - - * fbsd-proc.c (child_pid_to_exec_file, fbsd_find_memory_regions): - s/asprintf/xasprintf/. - (fbsd_make_corefile_notes): s/strdup/xstrdup/. - -2002-04-07 Andrew Cagney - - I believe Jeff Law denies responsability for this one: - * config/pa/hpux11w.mh (MH_CFLAGS): Add -Dvfork=fork. - * config/pa/hpux11.mh (MH_CFLAGS): Add -Dvfork=fork. - * config/pa/hpux1020.mh (MH_CFLAGS): Add -Dvfork=fork. - Work-around for PR gdb/366. - -2002-04-07 Elena Zannoni - - * remote-e7000.c (write_small, e7000_read_inferior_memory, - e7000_read_inferior_memory_large, e7000_insert_breakpoint, - e7000_remove_breakpoint): Use paddr_nz() to print addresses. - -2002-04-07 Elena Zannoni - - * sh-tdep.c (sh_fp_frame_init_saved_regs, - sh_nofp_frame_init_saved_regs): Use alloca() for 'where' - information. - -2002-04-07 Andrew Cagney - - * MAINTAINERS (Misc): List Daniel Jacobowitz as the GDBSERVER - maintainer. - -2002-04-07 Andrew Cagney - - * README (Reporting Bugs in GDB): Document the bug web page as the - prefered way of submitting bugs. - Fix PR gdb/402. - -2002-04-06 Andrew Cagney - - * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of - -1. Update comment. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-04-07 Andreas Schwab - - * m68klinux-nat.c (fill_fpregset): Properly pass address of - buffer to regcache_collect. - -2002-04-06 Andrew Cagney - - * gdbarch.sh (PS_REGNUM): Add. Document. Default to -1. - * gdbarch.c, gdbarch.h: Re-generate. - -2002-04-06 Andrew Cagney - - * symtab.c (lookup_symtab): Remove ``const'' from ``rp'' - declaration. Fix -Werror. - -2002-04-05 Daniel Jacobowitz - - * gdbarch.sh (initialize_non_multiarch): Call init_gdbarch_swap. - * gdbarch.c: Regenerate. - -2002-04-05 Michael Snyder - - * breakpoint.c (clear_command): Rewrite middle section to - combine two loops with identical control conditions. - Add a cleanup to eliminate a memory leak. - * cli/cli-dump.c (restore_section_callback): Use paddr_nz. - -2002-04-05 H.J. Lu (hjl@gnu.org) - - * solib-svr4.c (bkpt_names): Add "__start". - -2002-04-04 Andrew Cagney - - * sparc-tdep.c (sparc_push_dummy_frame): Use GDB_TARGET_IS_SPARC64 - as test for 64 bit target. - -2002-04-05 Andrew Cagney - - * h8500-tdep.c (h8500_write_fp): Delete function. - * dwarf2cfi.c (cfi_write_fp): Document as not used. - * mips-tdep.c (mips_gdbarch_init): Do not set write_fp. - * ia64-tdep.c (ia64_gdbarch_init): Do not set write_fp. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set write_fp. - * rs6000-tdep.c (rs6000_gdbarch_init): Do not set write_fp. - * s390-tdep.c (s390_gdbarch_init): Do not set write_fp. - (s390_write_fp): - * sh-tdep.c (sh_gdbarch_init): Do not set write_fp. - * x86-64-tdep.c (i386_gdbarch_init): Do not set write_fp. - * d10v-tdep.c (d10v_gdbarch_init): Do not set write_fp. - (d10v_write_fp): Delete function. - * inferior.h (write_fp, generic_target_write_fp): Delete - declarations. - * regcache.c (generic_target_write_fp): Delete function. - (write_fp): Delete function. - * gdbarch.sh (TARGET_WRITE_FP): Delete. - * gdbarch.h, gdbarch.c: Regenerate. - * config/v850/tm-v850.h (TARGET_WRITE_FP): Delete macro. - * config/sparc/tm-sp64.h (TARGET_WRITE_FP): Delete macro. - (sparc64_write_fp): Delete declaration. - * config/h8500/tm-h8500.h (TARGET_WRITE_FP): Delete macro. - (h8500_write_fp): Delete declaration. - -2002-04-04 Andrew Cagney - - * sparc-tdep.c (sparc64_write_fp): Delete. - (sparc_push_dummy_frame): Replace write_fp call with code to store - the FP directly. - (sparc_gdbarch_init): Do not initialize write_fp. - -2002-04-05 Kevin Buettner - - * rs6000-tdep.c (skip_prologue): Eliminate unused/unreachable - clause. - -2002-03-29 Jim Blandy - - * stack.c (get_selected_block): Add new argument `addr_in_block', - used to return the exact code address we used to select the block, - not just the block. - * blockframe.c (get_frame_block, get_current_block): Same. - * frame.h (get_frame_block, get_current_block, - get_selected_block): Update declarations. - * linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c, - linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed. - -2002-04-05 Michael Snyder - - * breakpoint.c (insert_breakpoints): Change 'hw' to 'hardware in - warning message. - -2002-04-05 J. Brobecker - - * utils.c (xfullpath): New function. - * defs.h (xfullpath): Add declaration. - * source.c (openp): Use xfullpath in place of gdb_realpath to - avoid resolving the basename part of filenames when the - associated file is a symbolic link. This fixes a potential - inconsistency between the filenames known to GDB and the - filenames it prints in the annotations. - * symtab.c (lookup_symtab): Use the new xfullpath function, in order - to be able to match a filename with either the real filename, or - the name of any symbolic link to this file. - (lookup_partial_symtab): Ditto. - -2002-04-04 Michael Snyder - - * breakpoint.c: Add support for hardware breakpoints in overlays. - (overlay_events_enabled): New state variable. - (insert_breakpoints): Use overlay_events_enabled to decide - whether to attempt to set a breakpoint at the overlay load addr. - Handle bp_hardware_breakpoint as well as bp_breakpoint. - (remove_breakpoint): Use overlay_events_enabled to decide - whether breakpoints need to be removed from overlay load addr. - Handle bp_hardware_breakpoint as well as bp_breakpoint. - (bpstat_stop_status): Handle bp_hardware_breakpoint in overlays. - (create_overlay_event_breakpoint, enable_overlay_breakpoints, - disable_overlay_breakpoints): Update overlay_events_enabled. - -2002-04-04 Daniel Jacobowitz - - * dwarf2read.c (struct function_range): New. - (cu_first_fn, cu_last_fn, cu_cached_fn): New. - (check_cu_functions): New. - (read_file_scope): Initialize global function lists. - Call dwarf_decode_line after processing children. - (read_func_scope): Add to global function list. - (dwarf_decode_lines): Call check_cu_functions everywhere - record_line is called. Call record_line with a linenumber - of 0 to mark sequence ends. - -2002-04-04 Michal Ludvig - - * x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI - change sync with glibc. - -2002-04-03 Jim Blandy - - * configure.in: Call AC_C_INLINE. - * configure: Regenerated. - -2002-04-01 Daniel Jacobowitz - - * rs6000-tdep.c: Change #include of "bfd/libcoff.h" - and "bfd/libbfd.h" to "libcoff.h" and "libbfd.h". - -2002-03-31 Mark Kettenis - - * NEWS: Mention gcore support on FreeBSD/i386. - - * fbsd-proc.c: New file. - * config/i386/nm-fbsd.h (CHILD_PID_TO_EXEC_FILE): Define. - * config/i386/fbsd.mh (NATDEPFILES): Add gcore.o and fbsd-proc.o. - - * lin-lwp.c (child_wait): Check SAVE_ERRNO instead of ERRNO in - while statement. - -2002-03-29 Jim Blandy - - * cli/cli-dump.c (_initialize_cli_dump): Older GCC's tolerate - unescaped newlines in string literals, but newer ones don't. So - escape them. - -2002-03-26 Michael Snyder - Andrew Cagney - - * cli/cli-dump.c: New file. Dump memory to file, - restore file to memory. - * cli/cli-dump.h: New file. - * Makefile.in: Add rules, dependencies for cli-dump.o. - * NEWS: Mention new commands. - -2002-03-28 Michael Snyder - - * symfile.c (symbol_file_add): Move test for null symbols to later. - -2002-03-27 Andrew Cagney - - From veksler at il.ibm.com: - * utils.c (gdb_realpath): If canonicalize_file_name fails, return - the xstrduped original path. - Fix PR gdb/417. - -2002-03-27 Michael Snyder - - * breakpoint.c (_initialize_breakpoint): Clean up help string. - * infcmd.c (_initialize_infcmd): Ditto. - * language.c (_initialize_language): Ditto. - * symfile.c (_initialize_symfile): Ditto. - * top.c (_init_main): Ditto. - * cli/cli-cmds.c (init_cli_cmds): Ditto. - -2002-03-27 Elena Zannoni - - * rs6000-tdep.c (struct rs6000_framedata): Add fields for AltiVec - vector registers handling. - (skip_prologue): Handle new AltiVec instructions. Fill in new - fields of frame data. - (frame_get_saved_regs): Fill in information for AltiVec registers. - -2002-03-27 Jim Blandy - - * symtab.h (SYMBOL_INIT_MANGLED_NAME): Turn this macro's body into - a function; leave this macro here to invoke that function. - (symbol_init_mangled_name): Declaration for that function. - * symtab.c (symbol_init_mangled_name): New function. - -2002-03-27 Andrew Cagney - - * valarith.c: Replace strerror with safe_strerror. - * tracepoint.c: Ditto. - * lin-lwp.c: Ditto. - * go32-nat.c: Ditto. - * inflow.c: Ditto. - * gnu-nat.c: Ditto. - -2002-03-27 Andreas Schwab - - * event-top.c (command_line_handler): Remove useless if. - -2002-03-27 Andreas Jaeger - - * dwarf2cfi.c: Give credit to Daniel Berlin, reformat copyright - comment. - -2002-03-27 Michal Ludvig - - * x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines. - (x86_64_num_regs, x86_64_num_gregs): Added extern variables. - * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS. - (x86_64_linux_dr_get_status, supply_gregset), - (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs. - * x86-64-tdep.c (x86_64_register_raw_size_table): Delete. - (x86_64_register_info_table): Add. - (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add. - (x86_64_register_raw_size, x86_64_register_virtual_type), - (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new - general x86_64_register_info_table. - (i386_gdbarch_init): gdbarch_register_bytes is now set - dynamicaly during initialization. - * regformats/reg-x86-64.dat: Synced with changes to registers above. - * gdbserver/linux-x86-64-low.c: Ditto. - -2002-03-27 Daniel Jacobowitz - - * gdbserver/server.c (main): Call target_signal_to_host_p - and target_signal_to_host on signals received from the remote. - * gdbserver/remote-utils.c (prepare_resume_reply): Call - target_signal_from_host on signals sent to the remote. - * gdbserver/server.h: Add prototypes. Include "gdb/signals.h". - * gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}. - -2002-03-27 Daniel Jacobowitz - - * signals/signals.c: Include "server.h" in gdbserver build. - (target_signal_from_name): Don't use STREQ. - (_initialize_signals): Likewise. Don't include function in - gdbserver build. - -2002-03-27 Daniel Jacobowitz - - * signals.c: Moved to... - * signals/signals.c: Here. - * Makefile (signals.o): Update. - -2002-03-26 Jeff Law (law@redhat.com) - - * somread.c (som_symtab_read): Remove some commented out code and - updated related comments. Do not set the minimal symbol table to - mst_solib_trampoline for ST_ENTRY symbols with SS_LOCAL scope - in a dynamic executable. - * hppa-tdep.c (find_proc_framesize): Sanely handle the case - where we are unable to find the minimal symbol for the given - PC value. - -2002-03-25 Jeff Law (law@redhat.com) - - * linux-proc.c (read_mapping): Scan up to end of line for filename. - -2002-03-25 Michal Ludvig - - * x86-64-tdep.c (x86_64_skip_prologue): Rewritten from scratch. - -2002-03-23 Andrew Cagney - - * command.h: Update copyright. - (struct cmd_list_element): Replace definition with opaque - declaration. - (enum cmd_types): Document that it will eventually be moved to - cli/cli-decode.h - (CMD_DEPRECATED, DEPRECATED_WARN_USER): Delete macros. - (MALLOCED_REPLACEMENT): Delete macro. - * Makefile.in (cli_decode_h): Add $(command_h). - (top.o, completer.o, maint.o): Add dependency on $(cli_decode_h). - * top.c: Include "cli/cli-decode.h". - * completer.c: Include "cli/cli-decode.h". - * maint.c: Include "cli/cli-decode.h". - * cli/cli-decode.h: Include "command.h". - (enum command_class): Delete. - (enum cmd_types): Comment out. - (enum cmd_auto_boolean): Delete. - (enum var_types): Delete. - -2002-03-23 Andrew Cagney - - * cli/cli-decode.c: Include "gdb_assert.h". - (add_set_or_show_cmd): New static function. - (add_set_cmd): Rewrite. Use add_set_or_show_cmd. - (add_show_from_set): Rewrite. Use add_set_or_show_cmd. Don't copy - all fields, such as func, from the set command. - -2002-03-23 Andrew Cagney - - * MAINTAINERS (sh-elf): Change warning flag to -w. - -2002-03-23 Andrew Cagney - - * defs.h (error): Add printf format attribute. - * thread-db.c (thread_from_lwp): Fix error format string. - * stack.c (parse_frame_specification): Ditto. - * cli/cli-decode.c (undef_cmd_error): Ditto. - * scm-lang.c (scm_lookup_name): Ditto. - * tracepoint.c (trace_error): Ditto. - * remote-utils.c (usage): Ditto. - * remote.c (compare_sections_command): Ditto. - Fix PR gdb/328. - -2002-03-22 Andrew Cagney - - * gdbtypes.c (append_composite_type_field): New function. - (init_composite_type): New function. - * gdbtypes.h (append_composite_type_field): Declare. - (init_composite_type): Ditto. - -2002-03-22 Elena Zannoni - - * ppc-linux-tdep.c (ppc_sysv_abi_use_struct_convention): New - function. - * ppc-tdep.h (ppc_sysv_abi_use_struct_convention): Export. - * rs6000-tdep.c (rs6000_gdbarch_init): Use different - structure returning convention for SYSV ABI case, but not - for GNU/Linux, FreeBSD, or NetBSD. - -2002-03-22 Daniel Jacobowitz - - * symtab.h (lookup_block_symbol): Add mangled_name argument - to prototype. - - * symmisc.c (maintenance_check_symtabs): Call lookup_block_symbol - with new mangled_name argument. - * linespec.c (decode_line_1): Likewise. - * valops (value_of_this): Likewise. - * symtab.c (lookup_transparent_type): Likewise. - (lookup_symbol_aux): Likewise. Accept new mangled_name argument. - (lookup_symbol): If we are given a mangled name, pass it down - to lookup_symbol_aux. - (lookup_block_symbol): If we are given a mangled name to check - against, only return symbols which match it. - -2002-03-22 Christopher Faylor - - * win32-nat.c (child_create_inferior): Check for proper shell to use - here, in case the user changes it on the fly. - (_initialize_inftarg): Remove shell path considerations. - -2002-03-21 Elena Zannoni - - * rs6000-tdep.c (rs6000_gdbarch_init): Use correct max size value - for gdbarch_max_register_raw_size and max_register_virtual_size. - Adjust copyright year. - -2002-03-21 Daniel Jacobowitz - - * dbxread.c (process_one_symbol): Extend the first N_SLINE - in a function to cover the entire beginning of the function - as well if it does not already. - -2002-03-21 Tom Rix - - * rs6000-nat.c (rs6000_ptrace32): Renamed from ptrace32. - (rs6000_ptrace64): Renamed from ptrace64. - -2002-03-20 Martin M. Hunt - - * gdbserver/remote-utils.c (remote_open): Don't call - getprotobyname, we're all using TCP here so just use - IPPROTO_TCP. - * gdbserver/gdbreplay.c (remote_open): Ditto. - -2002-03-20 Martin M. Hunt - - * regcache.c (_initialize_regcache): No need to call - build_regcache() at this time; it gets called whenever - the gdbarch changes. - -2002-03-20 David O'Brien - - * sparc-nat.c: Include sys/param.h where possible. - -2002-03-20 Daniel Jacobowitz - - Fix PR gdb/422. - * c-lang.c (c_create_fundamental_type): Handle FT_COMPLEX, - FT_DBL_PREC_COMPLEX, and FT_EXT_PREC_COMPLEX. - * dwarf2read.c (read_base_type): Set TYPE_TARGET_TYPE for - complex types. - * stabsread.c (rs6000_builtin_type): Likewise. - (read_sun_floating_type): Likewise. - -2002-03-19 Peter Schauer - - * stabsread.c (read_member_functions): Remove skip code for duplicate - constructor/destructor methods. Use standard parsing for these - methods and just do not chain them to the list of methods after - parsing. - -2002-03-19 Alexandre Oliva - - * coffread.c: Remove redundant static declarations. Replace - occurrences of `PTR' with `void *'. - * elfread.c, mdebugread.c, minsyms.c, mipsread.c: Likewise. - * top.h (quit_cover): Likewise. - * defs.h (catch_errors): Likewise. - -2002-03-18 Andrew Cagney - - * defs.h (XMALLOC): Define. - * gdb-events.sh (XMALLOC): Delete macro. - * gdb-events.c, gdb-events.h: Regenerate. - * gdbarch.sh (XMALLOC): Delete macro. - * gdbarch.c: Regenerate. - * serial.c (XMALLOC): Delete macro. - * ui-file.c (XMALLOC): Ditto. - * ser-unix.h (XMALLOC): Ditto. - * sh-tdep.c (XMALLOC): Ditto. - * ui-out.c (XMALLOC): Ditto. - * utils.c (XMALLOC): Ditto. - * i386-tdep.c (XMALLOC): Ditto. - * gdb-events.c (XMALLOC): Ditto. - * d10v-tdep.c (XMALLOC): Ditto. - * cli-out.c (XMALLOC): Ditto. - - * cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright. - * gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto. - * ui-file.c, ui-out.c: Ditto. - -2002-03-18 Andrew Cagney - - * command.h (struct cmd_list_element): Add field context. - (set_cmd_context, get_cmd_context): Declare. - * cli/cli-decode.h: Ditto. - * cli/cli-decode.c (get_cmd_context): New function. - (set_cmd_context): New function. - (add_cmd): Initialize context. - Part of fixing PR gdb/145 and PR gdb/146. - -2002-03-17 Andrew Cagney - - * cli/cli-decode.c (cmd_type): New function. - * command.h (cmd_type): Declare. - * infrun.c (set_schedlock_func): Call function cmd_type. - * kod.c (kod_set_os): Call cmd_type. - * cris-tdep.c (cris_version_update): Use function cmd_type. - (cris_mode_update, cris_abi_update): Ditto. - - * command.h: (execute_cmd_post_hook): Declare. - (execute_cmd_pre_hook): Declare. - * cli/cli-script.c (clear_hook_in_cleanup): New function. - (execute_cmd_post_hook, execute_cmd_pre_hook): New - functions. Execute pre/post hook while ensuring that afterwords - hook_in is cleared. - * top.c (execute_command): Use execute_cmd_post_hook, and - execute_cmd_pre_hook to execute pre/post commands. - * infrun.c (normal_stop): Pass stop_command and not pre_hook to - hook_stop_stub. - (hook_stop_stub): Call execute_cmd_pre_hook. - -2002-03-17 Andrew Cagney - - * kod.c (kod_set_os): Revert previous change. Is called by ``info - set'' and this leads to a core dump. Move xstrdup of - operating_system to after check that it is not NULL. - -2002-03-17 Andrew Cagney - - * kod.c (kod_set_os): Remove unnecessary check that - ``command->type'' is set_cmd. - - * valprint.c (set_input_radix): Use input_radix. - (set_output_radix): Use output_radix. - (set_input_radix_1, set_output_radix_1): Add FIXME - bad radix - isn't reverted. - -2002-03-16 Andrew Cagney - - * value.h (struct value): Delete field ``substring_addr''. Change - aligner fields to force_doublest_align, force_longest_align, - force_core_addr_align and force_pointer_aligh. - - * value.h (struct value): Fix typo in above change. - -2002-03-16 Peter Schauer - - * ia64-tdep.c (ia64_gdbarch_init): Call set_gdbarch_frame_args_skip, - to fix internal_error from ``maintenance print architecture''. - -2002-03-16 Peter Schauer - - * cp-valprint.c (cp_is_vtbl_ptr_type): Handle vtbl field type - for gcc versions after gcc-2.8.1. - -2002-03-16 Peter Schauer - - * eval.c (evaluate_subexp_standard): Fix setup of ``this'' pointer - for method resolution. Restore adjustment of ``this'' pointer after - calling value_struct_elt, which was accidentally removed during the - HP merge. - -2002-03-15 Andrew Cagney - - * eval.c (evaluate_subexp_standard): Pass ``selected_frame'' to - value_of_register. - * findvar.c (value_of_register): Add ``frame'' parameter. Pass to - get_saved_register. - * value.h (value_of_register): Update. - -2002-03-14 Richard Henderson - - * configure.in: Detect declaration for canonicalize_file_name. - * utils.c (canonicalize_file_name): Declare, if needed. - (gdb_realpath): Prefer realpath if available and usable. - * config.in, configure: Rebuild. - -2002-03-14 Richard Henderson - - * dwarf2read.c (read_array_type): Accept DW_FORM_data8 as - a constant array bound. - - * MAINTAINERS: Add myself to write-after-approval. - -2002-03-14 Michael Snyder - - * symfile.c (syms_from_objfile): Return immediately if no syms. - (symbol_file_add): Return immediately if no syms. - (find_sym_fns): Return immediately if no syms. - -2002-03-13 Michal Ludvig - - * gdbserver/remote-util.c (remote_open): Print remote-side's - IP address when remote debugging over the network. - -2002-03-12 David O'Brien - - * config/sparc/fbsd.mh: Fix copyright. - * config/sparc/fbsd.mt: Likewise. - -2002-03-11 Richard Earnshaw - - * MAINTAINERS: Fix typo in name of gdb warnings option. - (x86-64): Fix formating so that this can be parsed by awk. - -2002-03-10 Daniel Jacobowitz - - * Makefile.in (defs_h): Add $(INCLUDE_DIR)/gdb/signals.h. - * defs.h: Include "gdb/signals.h". - (enum target_signal): Move to $(INCLUDE_DIR)/gdb/signals.h. - -2002-03-10 Michal Ludvig - - * x86-64-tdep.h (sys/reg.h, x86_64_regmap): Moved to x86-64-linux-nat.c - * x86-64-linux-nat.c (sys/reg.h, x86_64_regmap): Moved here - from x86-64-tdep.h - -2002-03-10 Daniel Jacobowitz - Don Howard - - * mips-tdep.c (ST0_FR): Define. - (mips2_fp_compat): New function, temporarily disabled. - (mips_read_fp_register_single): New function. - (mips_read_fp_register_double): New function. - (mips_print_register): Use them. - (do_fp_register_row): Likewise. - -2002-03-09 Andrew Cagney - - * MAINTAINERS: Add Jim Ingham and Klee Dienes to ``write after - approval''. - -2002-03-08 Peter Schauer - - * stabsread.c (read_member_functions): Fix is_stub test for - static member functions, improve comment. - -2002-03-07 Richard Earnshaw - - * remote-rdi.c (myprint): Replace 'PTR' with 'void *'. - (mywrite, mywritec, mypause, myreadc, mygets): Likewise. - (_initialize_remote_rdi): Use add_set_boolean_cmd to register - commands that set boolean values. - (arm_rdi_remove_breakpoint): Rewrite to avoid uninitialized warning. - (arm_rdi_resume): Always initialize PC. - (arm_rdi_open): Don't use rslt as a boolean. - (arm_rdi_create_inferior, arm_rdi_close, arm_rdi_resume) - (arm_rdi_fetch_registers, arm_rdi_store_registers) - (arm_rdi_xfer_memory, arm_rdi_files_info, arm_rdi_kill) - (arm_rdi_insert_breakpoint, arm_rdi_remove_breakpoint): Likewise. - -2002-03-06 Alexandre Oliva - - * configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX. - * configure: Rebuilt. - -2002-03-06 Stephane Carrez - - * m68hc11-tdep.c (_initialize_m68hc11_tdep): Don't set tm_print_insn. - (m68hc11_gdbarch_init): But use set_gdbarch_print_insn instead. - -2002-03-06 Andrew Cagney - - * cli/cli-decode.c (set_cmd_completer): New function. - * command.h (set_cmd_completer): Declare. - * cli/cli-decode.h (set_cmd_completer): Ditto. - - * breakpoint.c (_initialize_breakpoint): Use set_cmd_completer. - * cli/cli-cmds.c (init_cli_cmds): Ditto. - * win32-nat.c (_initialize_inftarg): Ditto. - * remote-rdi.c (_initialize_remote_rdi): Ditto. - * proc-api.c (_initialize_proc_api): Ditto. - * hppa-tdep.c (_initialize_hppa_tdep): Ditto. - * source.c (_initialize_source): Ditto. - * exec.c (_initialize_exec): Ditto. - * solib.c (_initialize_solib): Ditto. - * top.c (init_main): Ditto. - * tracepoint.c (_initialize_tracepoint): Ditto. - * symfile.c (_initialize_symfile): Ditto. - * printcmd.c (_initialize_printcmd): Ditto. - * infcmd.c (_initialize_infcmd): Ditto. - * corefile.c (_initialize_core): Ditto. - -2002-03-05 Andrew Cagney - - * MAINTAINERS (Past Maintainers): Add Frank Ch. Eigler. - -2002-03-05 Andrew Cagney - - * MAINTAINERS: Fix Mac OS X and Objective-C/C++. - -2002-03-05 Andrew Cagney - - * NEWS: Update headings, 5.2 has branched. - -2002-03-04 Daniel Jacobowitz - - * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long. - (num_regs, regmap): Move inside HAVE_LINUX_USRREGS. - (register_addr, REGISTER_RAW_SIZE): Likewise. - (usr_store_inferior_registers): Use PTRACE_XFER_TYPE. - * gdbserver/linux-x86-64-low.c: Remove extra #endif. - -2002-03-03 Michal Ludvig - - * MAINTAINERS (x86-64): Add myself. - * x86-64-tdep.c (x86_64_push_arguments): Fixed typo naregs->nregs, - changed value_ptr -> struct value * - -2002-03-01 David O'Brien - - * configure.host (sparc64-*-freebsd): Add. - * configure.tgt: Likewise. - * config/sparc/fbsd.mh: New file. - * config/sparc/fbsd.mt: Likewise. - * config/sparc/nm-fbsd.h: Likewise. - * config/sparc/tm-fbsd.h: Likewise. - -2002-03-01 Daniel Jacobowitz - - * config/djgpp/fnchange.lst: Add regformats/reg-i386-linux.dat and - regformats/reg-s390x.dat. - -2002-03-01 Andrew Cagney - - * utils.c: Add FIXME explaining true/false problem. - -2002-02-28 Andrew Cagney - - * MAINTAINERS (Past Maintainers): Add J.T. Conklin. - -2002-02-28 Michael Chastain - - * MAINTAINERS: Fix typo: gdb.satbs -> gdb.stabs . - -2002-02-28 Daniel Jacobowitz - - * gdbserver/linux-s390-low.c: New file. - * regformats/reg-s390.dat: New file. - * regformats/reg-s390x.dat: New file. - * gdbserver/configure.srv: Add S/390. - * gdbserver/Makefile.in: Add S/390. - * configure.tgt: Enable gdbserver for S/390. - -2002-02-28 Eli Zaretskii - - * go32-nat.c (_initialize_go32_nat): Don't use periods in the - first line of the doc string for "info dos", except at the end of - the sentence, since the short help stops at the first period. - -2002-02-28 Jason Merrill - - * dwarf2read.c (dwarf_cfi_name): Add new codes. - -2002-02-27 Fred Fish - - * blockframe.c (generic_fix_call_dummy): Fix obvious typo in - comment (dumy -> dummy). - -2002-02-27 Peter Schauer - - * symtab.c (gdb_mangle_name): Handle fully mangled v3 abi physnames. - -2002-02-27 Rodney Brown - - * utils.c (gdb_realpath): Add pathconf fallback for sco3.2v5. - -2002-02-27 Daniel Jacobowitz - - * gdbserver/acconfig.h: New file. - * gdbserver/i387-fp.c: New file. - * gdbserver/i387-fp.h: New file. - * gdbserver/linux-x86-64.c: New file. - * regformats/reg-x86-64.dat: New file. - * configure.tgt: Add x86_64-*-linux* gdbserver support. - * gdbserver/configure.srv: Add x86_64-*-linux* and regset support. - * gdbserver/configure.in: Add support for regsets. - * gdbserver/config.in: Regenerate. - * gdbserver/configure: Regenerate. - * gdbserver/Makefile.in: Likewise. Add $(linux_low_h). - * gdbserver/linux-low.h: New file. - * gdbserver/linux-low.c: Include "linux-low.h". Add support - for regsets. - * gdbserver/linux-arm-low.c: Include "linux-low.h". - * gdbserver/linux-ia64-low.c: Include "linux-low.h". - * gdbserver/linux-m68k-low.c: Include "linux-low.h". - * gdbserver/linux-mips-low.c: Include "linux-low.h". - * gdbserver/linux-ppc-low.c: Include "linux-low.h". - * gdbserver/linux-sh-low.c: Include "linux-low.h". - * gdbserver/linux-i386-low.c: Include "linux-low.h". Include - "i387-fp.h". Add PTRACE_GETREGS and friends. - * gdbserver/regcache.c (supply_register): New function. - (supply_register_by_name): New function. - (collect_register): New function. - (collect_register_by_name): New function. - -2002-02-27 Daniel Jacobowitz - - * gdbserver/Makefile.in (INTERNAL_CFLAGS): Remove -DGDBSERVER. - (config.status): Add configure.srv dependency. - (server_h): Add config.h dependency. - -2002-02-27 Daniel Jacobowitz - - * regformats/reg-i386-linux.dat: New file, with $orig_eax. - * gdbserver/Makefile.in: Add rules for reg-i386-linux.o. - * gdbserver/configure.srv: Change i386-*-linux* to use - reg-i386-linux.o. - -2002-02-26 Andrew Cagney - - * x86-64-tdep.c: Re-indent. Update copyright date. - -2002-02-26 Andrew Cagney - - From Michal Ludvig : - * x86-64-tdep.c (value.h): Delete. - (gdb_assert.h): Include. - (x86_64_register_convert_to_virtual, - x86_64_register_convert_to_raw ): Add check which lets only - floating-point values to be converted. - (value_push): Delete. - (x86_64_push_arguments): Order of arguments pushed on stack fixed. - (i386_gdbarch_init): Number of register_bytes fixed. - -2002-02-26 Andrew Cagney - - * MAINTAINERS: Add x86-64 target. - -2002-02-26 Andrew Cagney - - * memattr.c (mem_command): Eliminate ``true'' and ``false''. - * osfsolib.c (solib_map_sections): Ditto. - * irix5-nat.c (solib_map_sections): Ditto. - * corelow.c (gdb_check_format): Ditto. - * symfile.c (symfile_bfd_open): Ditto. - * solib.c (solib_map_sections): Ditto. - Fix PR gdb/354. - -2002-02-26 Andrew Cagney - - * remote.c (_initialize_remote): By default, disable ``e'' and - ``E'' step out-of-range packets. - -2002-02-26 Andreas Schwab - - * config/m68k/tm-linux.h (FRAME_SAVED_PC): Define as - m68k_linux_frame_saved_pc. - (IN_SIGTRAMP): Define as m68k_linux_in_sigtramp instead of - in_sigtramp. - (SIGCONTEXT_PC_OFFSET): Remove. - * m68klinux-nat.c (m68k_linux_frame_saved_pc, - m68k_linux_sigtramp_saved_pc): New functions. - (IS_SIGTRAMP, IS_RT_SIGTRAMP): Define. - (SIGCONTEXT_PC_OFFSET): Moved here from config/m68k/tm-linux.h. - (UCONTEXT_PC_OFFSET): Define. - (m68k_linux_in_sigtramp): Renamed from in_sigtramp, handle both - non-RT and RT signal trampolines. - -2002-02-26 Richard Earnshaw - - * config/arm/tm-embed.h (TARGET_UPAGES): Delete. - (TARGET_NBPG, STACK_END_ADDR): Delete - (VARIABLES_INSIDE_BLOCK): Delete. - -2002-02-25 Andrew Cagney - - * utils.c (perror_with_name): Make string parameter constant. - (print_sys_errmsg): Ditto. - (query): Ditto. - * defs.h (perror_with_name): Update. - (print_sys_errmsg): Update. - (query): Update. - -2002-02-25 Daniel Jacobowitz - - From Eliot Dresselhaus : - * gdbserver/linux-mips-low.c (cannot_fetch_register): Fix typo. - -2002-02-25 Peter Schauer - - * rs6000-nat.c (set_host_arch): Do not switch to a new architecture - if it already matches the current architecture from the exec file. - Include arch-utils.h for gdbarch_info_init prototype. - * Makefile.in (rs6000-nat.o): Update dependencies. - -2002-02-25 Eli Zaretskii - - * config/djgpp/djconfig.sh: Set NM=nm and CFLAGS="-g -O2" in the - list of exported variables. - -2002-02-24 Daniel Jacobowitz - - * gdbserver/configure.srv: New file. - * gdbserver/configure.in: Use configure.srv instead - of the host/target makefile fragments. Set GDBSERVER_DEPFILES - from it. - * gdbserver/configure: Regenerated. - * gdbserver/terminal.h: New file. - * gdbserver/Makefile.in: Update for configure changes. Remove - more unneeded include paths. - -2002-02-24 Andrew Cagney - - From wiz at danbala: - * config/sparc/tm-sp64.h: Fix grammar and typos. - Fix PR gdb/287. - -2002-02-24 Andrew Cagney - - * lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux'' - with either ``GNU/Linux'' or ``Linux kernel''. Update copyright. - * m68klinux-nat.c, sparc-linux-nat.c, x86-64-linux-nat.c: Ditto. - * x86-64-linux-tdep.c, gregset.h, gdb_wait.h: Ditto. - * ia64-linux-nat.c, infrun.c, linux-proc.c: Ditto. - * proc-service.c, i386-linux-tdep.c, ppc-linux-tdep.c: Ditto. - * s390-tdep.c: Ditto. - * config/nm-linux.h, config/alpha/nm-linux.h: Ditto. - * config/alpha/tm-alpha.h, config/alpha/tm-alphalinux.h: - * config/alpha/xm-alphalinux.h, config/i386/nm-linux.h: Ditto. - * config/i386/nm-x86-64.h, config/i386/tm-linux.h: Ditto. - * config/m68k/tm-linux.h, config/mips/nm-linux.h: Ditto. - * config/mips/tm-linux.h, config/mips/xm-linux.h: Ditto. - * config/powerpc/tm-linux.h, config/s390/nm-linux.h: Ditto. - * config/s390/tm-linux.h, config/sh/tm-linux.h: Ditto. - * config/sparc/nm-linux.h, config/sparc/tm-linux.h: Ditto. - * config/sparc/tm-sp64linux.h, config/sparc/xm-linux.h: Ditto. - Fix PR gdb/378. - -2002-02-23 Andrew Cagney - - * lin-thread.c: Delete file. - * configure.in (gdb_cv_struct_reg_r_gs): Update comment to refer - to gdb_proc_service.h. - * configure: Re-generate. - - * ocd.c (ocd_open): Do not try to open the "ocd" device. - * serial.c (serial_open): Delete check for "ocd". - Fix PR gdb/349. - - * Makefile.in (linux-thread.o): Delete target. - * linux-thread.c: Delete file. - - * config/djgpp/fnchange.lst: Rename bfd/elf32-sh64.c. Tweak other - renamed SH files to be consistent. - - * symtab.c (sort_search_symbols): Use xfree. - -2002-02-23 Richard Earnshaw - - * arm-linux-tdep.c (arm_linux_init_abi): Register - IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE - * config/arm/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE): Replace old - definition with undef, since we don't want the sysvr4 definition. - (SKIP_TRAMPOLINE_CODE): Likewise. - -2002-02-23 Andrew Cagney - - From 2002-02-22 Alfred M. Szmidt : - - * configure.in: (AC_CHECK_FUNCS) Added test for - canonicalize_file_name Regenerated. - * config.in, configure: Regenerated. - * utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is - defined use canonicalize_file_name. - -2002-02-23 Michael Chastain - - * MAINTAINERS: Remove Michael Chastain from "paper trail" list. - -2002-02-23 Andrew Cagney - - * README: Remove references to cygnus.com. - * MAINTAINERS: Change Past Maintainer addresses to ``foo at bar - dot com'' form. Remove references to cygnus.com and sourceware. - -2002-02-23 Andrew Cagney - - From 2002-02-19 Paul Eggert : - * Makefile.in (VER): Change "head -1" to "sed q", since POSIX - 1003.1-2001 no longer allows "head -1". - * gdb/Makefile.in (version.c): Likewise. - * gdb/doc/Makefile.in (GDBvn.texi): Likewise. - * gdb/CONTRIBUTE: Change "diff -c3" to "diff -c", which is - equivalent. POSIX 1003.1-2001 no longer allows "diff -c3". - -2002-02-23 Andrew Cagney - - * cli/cli-decode.c (cmd_cfunc_eq): New function. - * command.h (cmd_cfunc_eq): Declare. - * cli/cli-decode.h (cmd_cfunc_eq): Ditto. - - * cli/cli-cmds.h (is_complete_command): Change parameter to a - ``struct cmd_list_element *''. - * cli/cli-cmds.c (is_complete_command): Update. Use - cmd_cfunc_eq. - * top.c (execute_command): Pass the command to - is_complete_command. - * tracepoint.c: Replace function.cfunc with cmd_cfunc_eq. - -2002-02-23 Andrew Cagney - - From 2002-02-20 Martin Schwidefsky : - * config/s390/tm-s390.h (GDB_TARGET_IS_ESAME): Use renamed - architecture defines. - * s390-tdep.c (s390_gdbarch_init): Likewise. - -2002-02-23 Richard Earnshaw - - * arm-linux-tdep.c (arm_linux_extract_return_value): Make static. - (arm_linux_push_arguments): Likewise. - (arm_linux_init_abi): Register them. Also register linux-specific - call_dummy_words. - (find_minsym_and_objfile): Use strcmp, not STREQ. - * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Delete. - (arm_linux_call_dummy_words): Delete declaration. - (EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS): Delete. - (arm_linux_extract_return_value, arm_linux_push_arguments): Delete - declarations. - (LOWEST_PC): Delete. - -2002-02-23 Peter Schauer - - * maint.c (print_section_info): Do not prepend `0x' to filepos - output, it will be handled by local_hex_string_custom. - -2002-02-23 Richard Earnshaw - - * arm-linux-nat.c (store_newfpe_single): Use regcache_collect. - (store_newfpe_double, store_newfpe_extended, store_fpregister) - (store_register, store_regs, fill_gregset, fill_fpregset): Likewise. - -2002-02-22 Jim Blandy - - Indicate that the bcache functions don't change the strings - they're passed. - * bcache.h (bcache, hash): Add `const' keywords to declarations. - * bcache.c (bcache, hash): Add `const' keywords to definitions. - -2002-02-22 Pierre Muller - - * win32-nat.c (child_create_inferior): Fix create flags setting bug. - -2002-02-21 Christopher Faylor - - * win32-nat.c (register_loaded_dll): Just use raw name when we can't - find the complete path to a loaded DLL. - -2002-02-21 Fred Fish - - * dbxread.c (process_one_symbol): When finding an N_FUN symbol - that marks the end of the range of a function, enter a line number - entry that has a line number of zero and a PC offset that matches - the end of the function. This starts a range of PC's for which no - line number information is known. - * symtab.c (find_pc_sect_line): If our best fit is in a range of - PC's for which no line number info is found (line number is zero) - then we didn't find any valid line information. - * symtab.h: Document use of zero line number entry. - -2002-02-21 Elena Zannoni - - * ppc-linux-nat.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Define. - (have_ptrace_getvrregs): Define for run time checks. - (gdb_vrregset_t): New type for Altivec register handling. - (fetch_register, store_register): Fetch/store altivec register - when needed. - (fetch_altivec_register, store_altivec_register): New functions. - (supply_vrregset, fill_vrregset): New functions. - (fetch_altivec_registers, store_altivec_registers): New functions. - (fetch_ppc_registers, store_ppc_registers): Fetch/store altivec - registers as well. - -2002-02-21 Jiri Smid - - * config/i386/x86-64linux.mh (NATDEPFILES): Remove x86-64-nat.o. - -2002-02-21 Richard Earnshaw - - * Makefile.in (armnbsd-nat.o): Update dependencies. - * armnbsd-nat.c (supply_gregset): New function. Common code to - supply the integer register set. - (supply_fparegset): New function. Similar for FPA registers. - (fetch_regs, fetch_fp_regs): Use them. - (fetch_core_registers): Likewise. - (fetch_elfcore_registers): New function. - (arm_netbsd_elfcore_fns): New core-file type specification. - (_initialize_arm_netbsd_nat): Register it. - -2002-02-21 Richard Earnshaw - - * armnbsd-nat.c: Include gdbcore.h. - (FETCH_INFERIOR_REGISTERS): Just error if this isn't defined. - (fetch_regs, fetch_fp_regs, store_regs, store_fp_regs): Add explicit - 'void' to declaration, to shut up ARI. - (fetch_core_registers): Make static. Rewrite using supply_register. - (arm_netbsd_core_fns): New core-file type specification. - (_initialize_arm_netbsd_nat): New function. - -2002-02-21 Christopher Faylor - - * win32-nat.c (register_loaded_dll): Correctly check for invalid handle - value. - -2002-02-20 Christopher Faylor - - * win32-nat.c (register_loaded_dll): Handle case where FindFirstFile - fails. - -2002-02-20 Daniel Jacobowitz - - * jv-exp.y (parse_number): Change type of implicit longs - to builtin_type_uint64. - -2002-02-20 Daniel Jacobowitz - - * gdbserver/linux-low.c (mywait): Change argument to waitpid - to be an integer instead of a `union wait'. - -2002-02-20 Daniel Jacobowitz - - * mips-linux-nat.c: Call the operating system GNU/Linux. - * mips-linux-tdep.c: Likewise. - * mips-tdep.c: Likewise. - -2002-02-20 Daniel Jacobowitz - - Fix PR gdb/265. - * jv-exp.y (parse_number): Handle 64-bit integers. - -2002-02-20 Daniel Jacobowitz - - * gdbserver/configure.in: Remove AM_PROC_CC_STDC. Change - AC_STDC_HEADERS to AC_HEADER_STDC. - * gdbserver/configure: Regenerated. - -2002-02-20 Richard Earnshaw - - * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC - is defined. - * sparc-tdep.c (get_longjmp_target): Likewise. - -2002-02-20 Richard Earnshaw - - * News: Add news about ARM and Multi-arch. Mention the new target - arm*-*-netbsd*. - -2002-02-19 Jim Blandy - - * stabsread.c (error_type_complaint): Improve error message. - -2002-02-19 Daniel Jacobowitz - - * gdbserver/README: Update documentation. - * gdbserver/configure.in: Update configury to match documentation. - * gdbserver/Makefile.in: Likewise. - * gdbserver/configure: Regenerated. - * gdbserver/aclocal.m4: New file, generated by aclocal. - * gdbserver/config.in: New file, generated by autoheader. - -2002-02-19 Richard Earnshaw - - * config/djgpp/fnchange.lst: Add change rules for armnbsd-tdep.c and - armnbsd-nat.c. - -2002-02-19 Richard Earnshaw - - * arm-tdep.h (enum arm_float_model): New enum. - (struct gdbarch_tdep): Add fp_model. - * arm-tdep.c (arm_gdbarch_init): Set fp_model in tdep. Defer setting - up floating-point conversions until we know the floating-point model - in use by the inferior. Don't complain about being unable to - determine the ABI of the inferior when we don't have one. - (arm_extract_return_value): Support different floating-point models. - (arm_store_return_value): Likewise. - * armnbsd-tdep.c (arm_netbsd_aout_init_abi): Set fp_model in tdep to - ARM_FLOAT_SOFT. - (arm_netbsd_elf_init_abi): Set fp_model to ARM_FLOAT_SOFT_VFP. - -2002-02-19 Peter Schauer - - * i386-tdep.c (i386_gdbarch_init): Eliminate incorrect use - of ``current_gdbarch''. - -2002-02-19 Richard Earnshaw - - * armnbsd-nat.c : ANSIfy all function declarations. - (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs): New. - (fetch_inferior_registers): Re-implement in terms of above. - (store_register, store_regs, store_fp_register, store_fp_regs): New. - (store_inferior_registers): Re-implement in terms of above. - -2002-02-19 Richard Earnshaw - - * arm-linux-nat.c: Linux -> GNU/Linux when not talking about the - kernel. - * arm-linux-tdep.c: Likewise. - * config/arm/tm-linux.h: Likewise. - -2002-02-19 Richard Earnshaw - - * configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch. - * config/arm/nbsd.mt (TM_FILE): Delete. - * config/arm/tm-nbsd.h: Delete. - -2002-02-19 Richard Earnshaw - - * arm-tdep.c (arm_gdbarch_init): Initialize TARGET_CHAR_SIGNED. - Initialize CALL_DUMMY_LENGTH. - -2002-02-19 Richard Earnshaw - - * armnbsd-tdep.c (arm_netbsd_aout_in_solib_call_trampoline): New - function. - (arm_netbsd_aout_init_abi): Initialize IN_SOLIB_CALL_TRAMPOLINE. - * config/arm/tm-nbsd.h: Don't include config/tm-nbsd.h, it only - defines one thing and that is incorrect for this port. - (IN_SOLIB_CALL_TRAMPOLINE): Delete. - -2002-02-18 Pierre Muller - - * go32-nat.c: add i386-tdep.h include to import FP_REGNUM_P macro. - -2002-02-18 Pierre Muller - - * win32-nat.c (display_selector): New function. Displays information - about the information returned by GetThreadSelectorEntry API function. - (display_selectors): New function. Displays the infomation of - the selector given as argument, or of CS, DS ans FS selectors - if no argument is given. - ( _initialize_inftarg): Add "w32" as info prefix command. - Add "info w32 selector" as command calling display_selectors. - -2002-02-19 Pierre Muller - - * i386-tdep.c (get_longjmp_target): Fix compilation failure - by setting dummy values to JB_PC and JB_ELEMENT_SIZE - if not defined. - -2002-02-18 Richard Earnshaw - - * config/arm/nbsd.mt (TDEPFILES): Add solib-sunos.o. - -2002-02-18 Richard Earnshaw - - * arm-tdep.c (arm_set_call_dummy_breakpoint_offset): New function. - (arm_fix_call_dummy): Call it. - (arm_call_dummy_breakpoint_offset): Delete. - (arm_gdbarch_init): Initialize call_dummy_breakpoint_offset. - * config/arm/tm-arm.h (CALL_DUMMY_BREAKPOINT_OFFSET): Delete. - -2002-02-18 Andrew Cagney - - * gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2. - Default to func_frame_chain_valid. - * gdbarch.h, gdbarch.c: Re-generate. - * frame.h (FRAME_CHAIN_VALID): Delete definition. - -2002-02-18 Elena Zannoni - - * ppc-linux-nat.c: Update copyright. - (fetch_register, store_register): Add tid parameter, don't compute - tid here. - (fetch_ppc_registers, store_ppc_registers): Add tid - parameter. Pass it along to callees. - (fetch_inferior_registers, store_inferior_registers): Compute tid - here, and pass it to calleed functions. - (fill_gregset, supply_fpregset): Clean up formatting. - -2002-02-18 Richard Earnshaw - - * arm-tdep.c (arm_gdbarch_init): Initialize coerce_float_to_double. - * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Delete. - -2002-02-18 Richard Earnshaw - - * gdbarch.sh (GET_LONGJMP_TARGET): Add rule. - * gdbarch.c gdbarch.h: Regenerate. - * breakpoint.c (create_longjmp_breakpoint): Always compile this - function. - (breakpoint_reset): Test GET_LONGJMP_TARGET_P(). - * infrun.c (GET_LONGJMP_TARGET): Delete default definition. - (handle_inferior_event): Test GET_LONGJMP_TARGET_P(). - - * arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields. - * arm-tdep.c (arm_get_longjmp_target): New function. - (arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes - this to a positive value register arm_get_longjmp_target as the - longjmp handler. - * arm-linux-tdep.c (arm_get_longjmp_target): Delete. - (arm_linux_init_abi): Set up longjmp description in tdep. - * armnbsd-nat.c (get_longjmp_target): Delete. - * armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp - description in tdep. - * config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete. - (get_longjmp_target): Delete declaration. - (GET_LONGJMP_TARGET): Delete. - * config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration. - (GET_LONGJMP_TARGET): Delete. - -2002-02-17 Kevin Buettner - - From Peter Schauer : - * ia64-tdep.c (ia64_gdbarch_init): Eliminate incorrect use - of ``current_gdbarch''. - -2002-02-17 Tom Tromey - - * cli/cli-cmds.c (compare_strings): New function. - (complete_command): Only print each unique item once. - * completer.h (complete_line): Declare. - * completer.c (complete_line): New function. - (line_completion_function): Use it. - -2002-02-16 Andrew Cagney - - * gdbarch.sh (TARGET_LONG_DOUBLE_BIT): Default to 64. - * gdbarch.h, gdbarch.c: Re-generate. - -2002-02-16 Daniel Jacobowitz - - * valarith.c (value_x_unop): Fix decrement; support post-decrement. - -2002-02-16 Daniel Jacobowitz - - From Peter Schauer : - * valops.c (value_arg_coerce): Don't take the address of a reference - to convert an argument to a reference. - -2002-02-15 Christopher Faylor - - * win32-nat.c (get_image_name): New function. - (handle_load_dll): Use get_image_name function. - (get_child_debug_event): Avoid registering debug events until possibly - execed process is started. - (child_create_inferior): Allow invocation via shell so that command - line redirection, etc. works ok. - (_initialize_inftarg): Add new command: "set shell" to control whether - a shell is used to start a process. - -2002-02-15 Daniel Jacobowitz - - * gdbserver/linux-mips-low.c (cannot_fetch_register): Use find_regno - instead of find_register_by_number. - (cannot_store_register): Likewise. - -2002-02-14 Pierre Muller - - * dwarf2read.c: Replace fprintf (stderr, ...) by - fprintf_unfiltered (gdb_stderr, ...). - -2002-02-15 Daniel Jacobowitz - - * gdbserver/gdbserver.1: Document --attach. - -2002-02-15 Richard Earnshaw - - * arm-tdep.h (struct gdbarch_tdep): Add fields for breakpoint - descriptions. - * arm-tdep.c (arm_default_arm_le_breakpoint) - (arm_default_arm_be_breakpoint, arm_default_thumb_le_breakpoint) - (arm_default_thumb_be_breakpoint): New. Initialize them from - traditional breakpoint defines. - (arm_breakpoint_from_pc): Use new gdbarch_tdep entries. - (arm_gdbarch_init): Initialize new breakpoint variables. - * arm-linux-tdep.c (arm_linux_arm_le_breakpoint): New. - (arm_linux_init_abi): Initialize linux-specific breakpoint. - * armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint): New. - (arm_netbsd_aout_init_abi, arm_netbsd_elf_init_abi): Split common - code out to ... - (arm_netbsd_init_abi_common): ... here; new function. - * config/arm/tm-arm.h (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT) - (THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Delete. - * config/arm/tm-linux.h (ARM_LE_BREAKPOINT): Delete. - * config/arm/tm-nbsd.h (ARM_LE_BREAKPOINT): Delete. - -2002-02-15 Richard Earnshaw - - * arm-tdep.h (enum arm_abi): New enum. - (struct gdbarch_tdep): New structure. - (LOWEST_PC): Provide a default. - (arm_gdbarch_register_os_abi): Declare new function. - * arm-tdep.c (arm_abi_names): New array. - (process_note_abi_tag_sections): New function. - (get_elfosabi): New function. - (arm_gdbarch_register_os_abi): New function. - (arm_gdbarch_init): Try to determine the ABI of the inferior. If - support for that ABI has been built in, then call the appropriate - configuration routine. Use gdbarch_num_regs() to get the number - of registers. - (arm_dump_tdep): New function. - (arm_init_abi_eabi_v1, arm_init_abi_eabi_v2, arm_init_abi_apcs): New - place-holder functions. - (_initialize_arm_tdep): Register them. - * config/arm/tm-arm.h (LOWEST_PC): Delete. - - * armnbsd-tdep.c: New file. - * Makefile.in (armnbsd-tdep.o): Add dependencies. - * config/arm/nbsd.mt (TDEPFILES): Add it. - * config/arm/tm-nbsd.h (LOWEST_PC): Delete. - - * armnbsd-nat.c: Include regcache.h. - * Makefile.in (armnbsd-nat.o): Update dependency list. - - * arm-tdep.c (arm_get_next_pc): Use printf_filtered for error message. - -2002-02-14 Daniel Jacobowitz - - * gdbserver/Makefile.in: Fix typos in target rules. - -2002-02-14 Daniel Jacobowitz - - Fix part of PR gdb/267. - * linespec.c (find_methods): Handle constructors specially for now. - -2002-02-14 Corinna Vinschen - - * arm-tdep.c (arm_push_arguments): Eliminate special float type - handling. - * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Define to call - standard_coerce_float_to_double(). - -2002-02-14 Christopher Faylor - - * config/i386/xm-cygwin.h: Revert inadvertent reinclusion of - GDBINIT_FILENAME. - -2002-02-14 Elena Zannoni - - * rs6000-tdep.c (rs6000_gdbarch_init): Don't call - find_variant_by_name, because it confuses the multiarch - framework. Return NULL if there isn't an architecture with the - user supplied name, instead of forcing a different one without - recording the change with the multiarch machinery. - (find_variant_by_name): Delete. - -2002-02-14 Peter Schauer - - * config/i386/i386sol2.mh (NATDEPFILES): Add i387-nat.o, needed by - i386v4-nat.o now. Add gcore.o, Solaris x86 supports gcore. - -2002-02-13 Martin M. Hunt - - * stack.c (print_frame_info_base): When calling - print_frame_info_listing_hook, set current_source_symtab. - -2002-02-14 Daniel Jacobowitz - - * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS, - and remove unused $(INCLUDE_DIR). - Add regcache.c to OBS. - Add generated register protocol files to clean target. - Update dependencies for new objects, obsolete old target code. - - * gdbserver/linux-low.c: Remove all platform-specific code to - new files. Remove various dead code. Update to use regcache - functionality. - * gdbserver/remote-utils.c (fromhex): Add return statement - to quiet warning. - (putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer - constant. - (input_interrupt): Add integer parameter to match prototype - of a signal handler. - (outreg): Use register_data (). - (prepare_resume_reply): Use gdbserver_expedite_regs. - * gdbserver/server.c (main): Dynamically allocate own_buf because - PBUFSIZ is no longer constant. Use registers_to_string () and - registers_from_string (). - * gdbserver/server.h: No longer include "defs.h". Add prototypes - for error (), fatal (), and warning (). Update definition of - PBUFSIZ to use regcache functionality. Add include guard. - * gdbserver/utils.c (fatal): Add missing ``const''. - (warning): New function. - - * regformats/regdat.sh: Include "regcache.h" in generated files. - Provide init_registers () function. - * regformats/regdef.h: Add prototype for set_register_cache (). - Add include guard. - - * gdbserver/linux-arm-low.c: New file. - * gdbserver/linux-i386-low.c: New file. - * gdbserver/linux-ia64-low.c: New file. - * gdbserver/linux-m68k-low.c: New file. - * gdbserver/linux-mips-low.c: New file. - * gdbserver/linux-ppc-low.c: New file. - * gdbserver/linux-sh-low.c: New file. - - * gdbserver/regcache.c: New file. - * gdbserver/regcache.h: New file. - - * gdbserver/low-linux.c: Removed obsolete file. - -2002-02-14 Daniel Jacobowitz - - * config/arm/linux.mt: Update GDBSERVER_DEPFILES. - * config/i386/linux.mt: Likewise. - * config/ia64/linux.mt: Likewise. - * config/m68k/linux.mh: Likewise. - * config/powerpc/linux.mh: Likewise. - * config/mips/linux.mt: Likewise. - - * config/sh/linux.mt: Add GDBSERVER_DEPFILES. - - * config/i386/i386lynx.mh: Mark gdbserver variables - as (currently) obsolete for this target. - * config/i386/nbsd.mt: Likewise. - * config/i386/nbsdelf.mt: Likewise. - * config/m32r/m32r.mt: Likewise. - * config/m68k/m68klynx.mh: Likewise. - * config/m68k/nbsd.mt: Likewise. - * config/m68k/sun3os4.mh: Likewise. - * config/mips/vr5000.mt: Likewise. - * config/ns32k/nbsd.mt: Likewise. - * config/pa/hppabsd.mh: Likewise. - * config/pa/hppaosf.mh: Likewise. - * config/powerpc/nbsd.mt: Likewise. - * config/rs6000/rs6000lynx.mh: Likewise. - * config/s390/s390.mt: Likewise. - * config/s390/s390x.mt: Likewise. - * config/sparc/sparclynx.mh: Likewise. - * config/sparc/sun4os4.mh: Likewise. - * config/i386/x86-64linux.mt: Likewise. - * config/sparc/linux.mh: Likewise. - -2002-02-14 Daniel Jacobowitz - - * configure.tgt: Configure gdbserver only for known working - targets. Set ${build_gdbserver} instead of modifying ${configdirs}. - * configure.in: Check ${build_gdbserver}. Put gdbserver/ into - SUBDIRS if it is configured. Update comment for ${nativefile}. - * configure: Regenerated. - -2002-02-13 Michael Snyder - - * config/i386/i386v42mp.mh: Add gcore.o to NATDEPFILES. - - * gcore.c (gcore_command): Use gcore_default_target instead of NULL. - (default_gcore_mach): Just return 0, work around a problem in bfd. - (default_gcore_target): OK to return NULL if exec_bfd is null. - (make_mem_sec): Use a cast, avoid a warning. - - * procfs.c (find_memory_regions_callback): Use a cast instead of - calling host_pointer_to_address (which complains if - sizeof (host pointer) != sizeof (target pointer)). - (procfs_make_note_section): Avoid overflow in psargs string. - - * procfs.c (procfs_make_note_section): Make the default - implementation return an error. - -2002-02-13 Rodney Brown - - * procfs.c (procfs_make_note_section): Provide a default definition - (for alpha-dec-osf4.0f). Fix typos. - -2002-02-13 Elena Zannoni - - * linux-proc.c: Add include of regcache.h. - * Makefile.in (linux-proc.o): Add dependency on regcache.h. - -2002-02-13 Andrew Cagney - - From 2002-01-18 Greg McGary : - * memattr.c (create_mem_region): Disallow useless empty region. - Regions are half-open intervals, so allow [A..B) [B..C) as - non-overlapping. - -2002-02-13 Michael Chastain - - * defs.h: Kill CONST_PTR. - * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const". - * c-lang.c (c_builtin_types): Likewise. - * ch-lang.c (ch_builtin_types): Likewise. - * f-lang.c (f_builtin_types): Likewise. - * language.c (unknown_builtin_types): Likewise. - * m2-lang.c (m2_builtin_types): Likewise. - * p-lang.c (pascal_builtin_types): Likewise. - * scm-lang.c (c_builtin_types): Likewise. - -2002-02-13 Keith Seitz - - * arm-tdep.h (arm_get_next_pc): Add declaration. - -2002-02-13 Richard Earnshaw - - * arm-tdep.c (arm_use_struct_convention): Make static. Move to be - with other related struct-returning functions. - (arm_extract_struct_value_address): New function. - (arm_gdbarch_init): Initialize the above in multi-arch vector. Also - initialize float_format, double_format and long_double_format as - appropriate to the endianness of the target. - * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Delete. - (arm_use_struct_convention): Delete declaration. - (USE_STRUCT_CONVENTION, EXTRACT_STRUCT_VALUE_ADDRESS): Delete. - -2002-02-13 Keith Seitz - - * defs.h (core_addr_to_string_nz): New function. - -2002-02-13 Mark Kettenis - - Apply missing bits of 2002-01-15 patch. - * i386v4-nat.c (supply_fpregset): Use i387_supply_fsave. - (fill_fpregset): Use i387_fill_fsave. - -2002-02-12 Keith Seitz - - * utils.c (core_addr_to_string): Use phex instead of phex_nz. - (core_addr_to_string_nz): New function. - -2002-02-11 Richard Earnshaw - - * arm-linux-nat.c: Really include arm-tdep.h. - * config/arm/tm-linux.h (struct type, struct value): Declare. - -2002-02-11 Michael Snyder - - * procfs.c: Include elf-bfd.h (for elfcore_write functions). - (gcore section): Ifdef for Solaris and Unixware only. - (procfs_do_thread_registers): Unixware needs one lwpstatus - per thread (not one prstatus or pstatus). - (procfs_make_note_section): Iterate only over kernel threads (lwps), - not over all gdb threads. For unixware, call elfcore_write_pstatus - once before iterating over threads. - -2002-02-11 Richard Earnshaw - - * arm-tdep.h: New file. - * arm-tdep.c: Include arm-tdep.h. - (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) - (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) - (arm_print_float_info, arm_register_type, convert_to_extended) - (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) - (arm_extract_return_value, arm_register_name): Make static. - (arm_software_single_step): Similarly. Fix types in declaration. - (arm_register_byte, arm_register_raw_size, arm_register_virtual_size) - (arm_store_return_value, arm_store_struct_return): New functions. - (arm_gdbarch_init): Register the above functions. Also register - call_dummy_start_offset, sizeof_call_dummy_words, - function_start_offset, inner_than, decr_pc_after_break, fp_regnum, - sp_regnum, pc_regnum, register_bytes, num_regs, max_register_raw_size, - max_register_virtual_size, register_size. Set up - prologue_cache.saved_regs here, rather than ... - (_initialize_arm_tdep): ... here. - * config/arm/tm-arm.h (struct type, struct value): Delete forward - declarations. - (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) - (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) - (arm_print_float_info, arm_register_type, convert_to_extended) - (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) - (arm_extract_return_value, arm_register_name): Delete declarations. - (SMASH_TEXT_ADDRESS, ADDR_BITS_REMOVE, FUNCTION_START_OFFSET) - (SKIP_PROLOGUE, SAVED_PC_AFTER_CALL, INNER_THAN, BREAKPOINT_FROM_PC) - (DECR_PC_AFTER_BREAK, PRINT_FLOAT_INFO, REGISTER_SIZE, NUM_REGS) - (REGISTER_NAME, REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE) - (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) - (MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN) - (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, CALL_DUMMY_WORDS) - (SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_START_OFFSET, FIX_CALL_DUMMY) - (SOFTWARE_SINGLE_STEP_P, SOFTWARE_SINGLE_STEP) - (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) Delete. - (arm_pc_is_thumb, arm_pc_is_thumb_dummy, thumb_get_next_pc) - (arm_get_next_pc): No-longer static -- these are needed by the RDI - interface. - * arm-linux-nat.c arm-linux-tdep.c armnbsd-nat.c: Include arm-tdep.h. - * remote-rdi.c remote-rdp.c: Likewise. - * Makefile.in (arm-linux-nat.o, arm-linux-tdep.o arm-tdep.o) - (armnbsd-nat.o, remote-rdi.o, remote_rdp.o): Update dependencies. - * config/arm/tm-nbsd.h (SOFTWARE_SINGLE_STEP_P): Delete bogus - definition. - - * arm-tdep.h (ARM_A1_REGNUM, ARM_A4_REGNUM, ARM_AP_REGNUM) - (ARM_SP_REGNUM, ARM_LR_REGNUM, ARM_PC_REGNUM, ARM_F0_REGNUM) - (ARM_F3_REGNUM, ARM_F7_REGNUM, ARM_FPS_REGNUM, ARM_PS_REGNUM): Renamed - from non-ARM_ prefixed definitions. - * arm-tdep.c armnbsd-nat.c arm-linux-nat.c arm-linux-tdep.c: Update - all uses of above. - * remote-rdi.c remote-rdp.c: Likewise. - * arm-linux-nat.c (ARM_CPSR_REGNUM): Renamed from CPSR_REGNUM. - -2002-02-11 Richard Earnshaw - - * arm-tdep.c (arm_frameless_function_invocation) - (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) - (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) - (arm_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) - (arm_pop_frame, arm_get_next_pc): Make static. - (arm_gdbarch_init): Register above in gdbarch structure. - (arm_read_fp): Renamed from arm_target_read_fp. - (arm_pc_is_thumb, arm_pc_is_thumb_dummy): Make static. - * config/arm/tm-arm.h (arm_frameless_function_invocation) - (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) - (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) - (arm_target_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) - (arm_pop_frame, arm_get_next_pc, arm_pc_is_thumb) - (arm_pc_is_thumb_dummy): Delete declarations. - (INIT_EXTRA_FRAME_INFO, TARGET_READ_FP, FRAME_CHAIN) - (FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS) - (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, FRAME_ARGS_SKIP) - (FRAME_INIT_SAVED_REGS, PUSH_DUMMY_FRAME, POP_FRAME): Delete. - -2002-02-10 Daniel Jacobowitz - - * symtab.c (compare_search_syms): New function. - (sort_search_symbols): New function. - (search_symbols): Sort symbols after searching rather than - before. - -2002-02-10 Andrew Cagney - - * NEWS: Linux -> GNU/Linux. - -2002-02-10 Andrew Cagney - - * gdbarch.sh: For for level one methods, disallow a definition - when partially multi-arched. Add comments explaining rationale. - * gdbarch.h: Re-generate. - -2002-02-10 Andrew Cagney - - * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Don't require when - multi-arch partial. - -2002-02-10 Andrew Cagney - - * gdbarch.sh: Map LEVEL onto a symbolic GT_LEVEL. Exit on bad - field. Use diff -u. - * gdbarch.c: Re-generate. - -2002-02-10 Andrew Cagney - - * config/mips/tm-mips.h (CALL_DUMMY_LOCATION): Delete. - * gdbarch.sh (PUSH_RETURN_ADDRESS): Don't require when multi-arch - partial. - -2002-02-10 Andrew Cagney - - * gdbarch.sh (REGISTER_CONVERTIBLE): Don't require when - multi-arch partial. - (PUSH_ARGUMENTS): Switch to using predefault. - * gdbarch.c: Regenerate. - -2002-02-10 Andrew Cagney - - * valops.c (PUSH_ARGUMENTS): Delete definition. - * gdbarch.sh (PUSH_ARGUMENTS): Don't require when multi-arch - partial. Default to default_push_arguments. - * gdbarch.h, gdbarch.c: Regenerate. - -2002-02-09 Andrew Cagney - - * defs.h (throw_exception): Rename return_to_top_level. Update - comments. - * utils.c (error_stream, internal_verror, quit): Ditto. - * top.c (throw_exception, catcher): Ditto. - * sparclet-rom.c (sparclet_load): Ditto. - * remote.c (interrupt_query, minitelnet): Ditto. - * remote-sds.c (interrupt_query): Ditto. - * remote-mips.c (mips_error, mips_kill): Ditto. - * ocd.c (interrupt_query): Ditto. - * monitor.c (monitor_interrupt_query): Ditto. - * m3-nat.c (suspend_all_threads, thread_resume_command): Ditto. - * target.h: Update comment. - - * m3-nat.c, ocd.c, sparclet-rom.c: Update copyright. - -2002-02-09 Andrew Cagney - - * gdbarch.sh (TARGET_LONG_DOUBLE_FORMAT): Default to - default_double_format. - * gdbarch.h, gdbarch.c: Re-generate. - * findvar.c (floatformat_unknown): Delete variable definition. - * doublest.h (floatformat_unknown): Delete variable declaration. - -2002-02-09 Jim Blandy - - * stabsread.c (read_type): Add code to parse Sun's syntax for - prototyped function types. - -2002-02-09 Andrew Cagney - - * Makefile.in (SUBDIR_CLI_INITS): Set to SUBDIR_CLI_SRCS. - (SUBDIR_MI_INITS): Set to SUBDIR_MI_SRCS. - -2002-02-09 Peter Schauer - - * xcoffsolib.c (_initialize_xcoffsolib): Renamed from - _initialize_solib. Fixes name clash with solib.c:_initialize_solib, - now _initialize_xcoffsolib gets called again and overrides the - commands from solib.c in a native configuration. - -2002-02-09 Mark Kettenis - - * doublest.c (store_typed_floating): Don't try to return a value. - Fixes PR gdb/290. - -2002-02-08 Jim Blandy - - * c-typeprint.c (c_type_print_varspec_suffix): If a function type - is prototyped and has no arguments, print its argument list as - `(void)'. - -2002-02-08 Chris Demetriou - - * MAINTAINERS (write-after-approval): Add myself. - (paper-trail): I've escaped! - -2002-02-08 Christopher Faylor - - * win32-nat.c (cygwin_pid_to_str): Revert 2002-02-08 change xasprintf - changes. - (_initialize_check_for_gdb_ini): Ditto. - -2002-02-08 Martin M. Hunt - - * win32-nat.c (cygwin_pid_to_str): Fix typo. - xaprintf -> xasprintf. - -2002-02-08 Pierre Muller - - * win32-nat.c: Remove use of printf and sprintf functions. - -2002-02-08 Richard Earnshaw - - * arm-tdep.c (arm_frame_chain_valid): Make static. - (arm_push_arguments): Likewise. - (arm_gdbarch_init): New function. - (_initialize_arm_tdep): Call it. - * config/arm/tm-arm.h (GDB_MULTI_ARCH): Set to 1. - (TARGET_DOUBLE_FORMAT): Test TARGET_BYTE_ORDER, not target_byte_order. - (FRAME_CHAIN_VALID): Delete. - (arm_frame_chain_valid): Delete declaration. - (PUSH_ARGUMENTS): Delete. - (arm_push_arguments): Delete declaration. - (CALL_DUMMY_P): Delete. - -2002-02-08 Andrew Cagney - Corinna Vinschen - - * gdbtypes.c (build_gdbtypes): Disable setting a specific float format - on builtin float types. - -2002-02-08 Daniel Jacobowitz - - * utils.c: Include before "bfd.h". - * tui/tui-hooks.c: Likewise. - * tui/tui.c: Likewise. - * tui/tuiCommand.c: Likewise. - * tui/tuiData.c: Likewise. - * tui/tuiDataWin.c: Likewise. - * tui/tuiDisassem.c: Likewise. - * tui/tuiGeneralWin.c: Likewise. - * tui/tuiIO.c: Likewise. - * tui/tuiLayout.c: Likewise. - * tui/tuiRegs.c: Likewise. - * tui/tuiSource.c: Likewise. - * tui/tuiSourceWin.c: Likewise. - * tui/tuiStack.c: Likewise. - * tui/tuiWin.c: Likewise. - -2002-02-07 Elena Zannoni - - * sh-tdep.c (sh_nofp_frame_init_saved_regs): Extend where[] array - to include space for pseudoregs as well. Update loops accordingly. - (sh_fp_frame_init_saved_regs): Ditto. - (sh_init_extra_frame_info, sh_pop_frame): Split long lines. - -2002-02-07 Andrew Cagney - - * MAINTAINERS: Andreas Schwab is GNU/Linux m68k maintainer. - Add Richard Earnshaw to Arm maintainers. - -2002-02-07 Andrew Cagney - - * defs.h (warning_begin): Delete declaration. - - * config/powerpc/tm-ppcle-eabi.h (TARGET_BYTE_ORDER_DEFAULT): - Delete macro. - -2002-02-07 Michael Snyder - - * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): - Logic bug, remove misplaced else. - -2002-02-07 Klee Dienes - - * fork-inferior.c (fork_inferior): Add '!' to the list of - characters that need to be quoted when building a string for the - shell. Quote '!' specifically with a backslash, since CSH chokes - when trying to evaluate "str!str". - -2002-02-06 Nick Clifton - - * rdi-share/host.h: Only provide a typedef for bool if it is not - defined. - -2002-02-04 Michael Snyder - - * breakpoint.h (enum bptype): Add new overlay event bp type. - (enable_overlay_breakpoints, disable_overlay_breakpoints): Export. - - * breakpoint.c (create_internal_breakpoint): New function. - (internal_breakpoint_number): Moved into create_internal_breakpoint. - (create_longjmp_breakpoint): Use create_internal_breakpoint. - (create_thread_event_breakpoint): Ditto. - (create_solib_event_breakpoint): Ditto. - (create_overlay_event_breakpoint): New function. - (enable_overlay_breakpoints, disable_overlay_breakpoints): New funcs. - (update_breakpoints_after_exec): Delete and re-initialize - overlay event breakpoints after an exec. Add FIXME comment - about longjmp breakpoint. - (print_it_typical): Ignore overlay event breakpoints. - (print_one_breakpoint): Ditto. - (mention): Ditto. - (bpstat_what): Do not stop for overlay event breakpoints. - (delete_breakpoint): Don't delete overlay event breakpoints. - (breakpoint_re_set_one): Delete the overlay event breakpoint. - (breakpoint_re_set): Re-create overlay event breakpoint. - - * symfile.c (overlay_auto_command): Enable overlay breakpoints. - (overlay_manual_command): Disable overlay breakpoints. - (overlay_off_command): Disable overlay breakpoints. - -2002-02-06 Richard Earnshaw - - * arm-tdep.c: Include elf-bfd.h and coff/internal.h. - (MSYMBOL_SET_SPECIAL, MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Move defines - to here from config/tm-arm.h. - (coff_sym_is_thumb): Make static. - (arm_elf_make_msymbol_special): New function. - (arm_coff_make_msymbol_special): New function. - * config/arm/tm-arm.h (MSYMBOL_SET_SPECIAL): Delete definition. - (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Likewise. - (coff_sym_is_thumb): Delete declaration. - (arm_elf_make_msymbol_special): Declare. - (arm_coff_make_msymbol_special): Declare. - (ELF_MAKE_MSYMBOL_SPECIAL): Call arm_elf_make_msymbol_special. - (COFF_MAKE_MSYMBOL_SPECIAL): Call arm_coff_make_msymbol_special. - -2002-02-06 Richard Earnshaw - - * arm-tdep.c (arm_software_single_step): ANSIfy function declaration. - -2002-02-06 Richard Earnshaw - - * gdbarch.sh (PRINT_FLOAT_INFO): Add rule. - * gdbarch.c gdbarch.h: Regenerate. - * arch-utils.c (default_print_float_info): New function. - * arch-utils.h (default_print_float_info): Prototype it. - * infcmd.c (float_info): Call PRINT_FLOAT_INFO. - * doc/gdbint.texinfo (FLOAT_INFO): Mark as deprecated. - (PRINT_FLOAT_INFO): Document it. - - * arm-tdep.c (arm_print_float_info): Renamed from arm_float_info. - * config/arm/tm-arm.h (FLOAT_INFO): Delete. - (PRINT_FLOAT_INFO): Define. - -2002-02-06 Pierre Muller - - * win32-nat.c (_initialize_check_for_gdb_ini): - Add typecast to sprintf argument to suppress a warning. - -2002-02-05 Pierre Muller - - * win32-nat.c (last_sig): Changed type of variable to target_signal, - to allow easier handling of pass state. - (DEBUG_EXCEPTION_SIMPLE): New macro, used in handle_exception, - that gives exception name and address. - (handle_exception): Use DEBUG_EXCEPTION_SIMPLE macro - and set last_sig value to ourstatus->value.sig. Some missing - exceptions added. - (child_continue): Correctly report continue_status. - (get_child_debug_event,do_initial_child_stuff): Set last_sig to - TARGET_SIGNAL_0 (new default value). - (child_resume): consider sig argument passed to decide if - the exception should be passed to debuggee or not. - -2002-02-05 Michael Snyder - - * regcache.c (fetch_register): Call target_fetch_register - only if we don't call FETCH_PSEUDO_REGISTER. - (store_register): Call target_store_register only if we - don't call STORE_PSEUDO_REGISTER. - -2002-02-05 Elena Zannoni - - * gdbarch.sh: Add definitions for COFF_MAKEMSYMBOL_SPECIAL and - ELF_MAKE_MSYMBOL_SPECIAL. - * gdbarch.c, gdbarch.h: Regenerate. - * arch-utils.c (default_make_msymbol_special): New function. - * arch-utils.h (default_make_msymbol_special): Export. - * elfread.c (elf_symtab_read): Compile use of - ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now - multiarched. - * coffread.c (coff_symtab_read): Ditto, for - COFF_MAKE_MSYMBOL_SPECIAL. - -2002-02-05 Jim Blandy - - * solib-svr4.c (svr4_truncate_ptr): New function. - (svr4_relocate_section_addresses): Do the address arithmetic with - the appropriate truncation for target addresses, even when - CORE_ADDR is larger than a target address. - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c (mywait): Cast second argument of waitpid - to (int *). - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c (kill_inferior): Remove commented out - code. - -2002-02-05 Daniel Jacobowitz - - * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c: Remove unused include files. - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c: Define PTRACE_ARG3_TYPE. - (read_inferior_memory): Use it. - (write_inferior_memory): Likewise. - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c (create_inferior): Call strerror instead of - grubbing through sys_errlist. - -2002-02-05 Daniel Jacobowitz - - * gdbserver/linux-low.c: New file, copied exactly from low-linux.c. - -2002-02-04 Pierre Muller - * win32-nat.c (handle_exception): Handle Ctrl-Break exception. - -2002-02-04 Andrew Cagney - - * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions. - (do_sfunc, set_cmd_sfunc): New functions. - - * command.h (struct cmd_list_element): Add field func. - * cli/cli-decode.h (struct cmd_list_element): Ditto. - * command.h (set_cmd_sfunc, set_cmd_cfunc): Declare. - * cli/cli-decode.h: Ditto. - - * cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc. - (help_all, help_cmd_list): Ditto. - (find_cmd, complete_on_cmdlist): Ditto. - * top.c (execute_command): Ditto. - - * cli/cli-setshow.c (do_setshow_command): Call func instead of - function.sfunc. - - * infcmd.c (notice_args_read): Fix function signature. - - * cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc. - * cli/cli-decode.c (add_set_cmd): Ditto. - * utils.c (initialize_utils): Ditto. - * maint.c (_initialize_maint_cmds): Ditto. - * infrun.c (_initialize_infrun): Ditto. - * demangle.c (_initialize_demangler): Ditto. - * remote.c (add_packet_config_cmd): Ditto. - * mips-tdep.c (_initialize_mips_tdep): Ditto. - * cris-tdep.c (_initialize_cris_tdep): Ditto. - * proc-api.c (_initialize_proc_api): Ditto. - * kod.c (_initialize_kod): Ditto. - * valprint.c (_initialize_valprint): Ditto. - * top.c (init_main): Ditto. - * infcmd.c (_initialize_infcmd): Ditto. - * corefile.c (_initialize_core): Ditto. - * arm-tdep.c (_initialize_arm_tdep): Ditto. - * arch-utils.c (initialize_current_architecture): Ditto. - (_initialize_gdbarch_utils): Ditto. - * alpha-tdep.c (_initialize_alpha_tdep): Ditto. - - * cli/cli-decode.c (add_cmd): Use set_cmd_cfunc. - * wince.c (_initialize_inftarg): Ditto. - * symfile.c (_initialize_symfile): Ditto. - * mips-tdep.c (_initialize_mips_tdep): Ditto. - * language.c (_initialize_language): Ditto. - * arc-tdep.c (_initialize_arc_tdep): Ditto. - -2002-02-04 Michael Snyder - - * memattr.c (_initialize_mem): Elaborate the help for 'mem' command. - -2002-02-04 Daniel Jacobowitz - - * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS. - Add rules for building the register data files. - -2002-02-04 Daniel Jacobowitz - - * regformats/regdat.sh: Add braces to the definition of - expedite_regs_${arch}. - -2002-02-04 Daniel Jacobowitz - - * regformats/regdef.h (struct reg): Add comment describing the - requirements for offset and size fields. - -2002-02-04 Andreas Schwab - - * config/ia64/linux.mh: Don't set NAT_CLIBS and REGEX. - * config/ia64/linux.mt: Don't set GDBSERVER_LIBS. - -2002-02-04 Richard Earnshaw - - * gdbarch.sh (copyright): Update years in generated header. - (SMASH_TEXT_ADDRESS): Add rule. - * gdbarch.h, gdbarch.c: Re-generate. - * coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS. - * dbxread.c: Likewise. - * dwarfread.c: Likewise. - * elfread.c: Likewise. - * somread.c: Likewise. - - * arm-tdep.c (arm_smash_text_address): New function. - * config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above. - -2002-02-04 Pierre Muller - - Add support for hardware watchpoints on win32 native. - * win32-nat.c (CONTEXT_DEBUG_DR macro): Add use of - CONTEXT_DEBUG_REGISTERS. - (dr variable): New variable. Static array containing a local copy - of debug registers. - (debug_registers_changed): New variable. Reflects when debug registers - are changed and need to be written to inferior. - (debug_registers_used): New variable. Reflects when any debug register - was set, used when new threads are created. - (cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): New functions used by - i386-nat code. - (thread_rec): Set dr array if id is the thread of current_event . - (child_continue, child_resume): Change the debug registers for all - threads if debug_registers_changed. - (child_add_thread): Change the debug registers if debug_registers_used. - * config/i386/cygwin.mh: Add use of i386-nat.o file. - Link nm.h to new nm-cygwin.h file. - + config/i386/nm-cygwin.h: New file. Contains the macros used for use - of hardware registers. - -2002-02-03 Andrew Cagney - - * valprint.c (print_floating): Allow non TYPE_CODE_FLT types. - Restore behavour broken by 2002-01-20 Andrew Cagney - IEEE_FLOAT removal. - -2002-02-03 Daniel Jacobowitz - - * c-valprint.c (c_val_print): Pass a proper valaddr to - cp_print_class_method. - * valops.c (search_struct_method): If there is only one method - and args is NULL, return that method. - -2002-02-03 Daniel Jacobowitz - - * gdbtypes.c (init_simd_type): Use TYPE_TAG_NAME instead of - accessing tag_name directly. - -2002-02-03 Daniel Jacobowitz - - * ax-gdb.c (find_field): Use TYPE_TAG_NAME instead - of accessing tag_name directly. - -2002-02-03 Daniel Jacobowitz - - PR gdb/280 - * gdbtypes.c (replace_type): New function. - * gdbtypes.h (replace_type): Add prototype. - * stabsread.c (read_type): Use replace_type. - -2002-02-03 Richard Earnshaw - - * Makefile.in (memattr.o): Add missing dependencies rule. - -2002-02-03 Peter Schauer - - * breakpoint.c (break_at_finish_command): Really export. - (break_at_finish_at_depth_command): Ditto. - (tbreak_at_finish_command): Ditto. - * hppa-tdep.c: Include completer.h. - * Makefile.in (hppa-tdep.o): Add dependency on $(completer_h). - (COMMON_OBS): Remove duplicate ui-file.o, frame.o, doublest.o. - -2002-02-01 Andrew Cagney - - * utils.c (do_write): New function. - (error_stream): Rewrite combining the code from error_begin and - verror. - (verror): Rewrite using error_stream. - (error_begin): Delete function. - -2002-02-01 Andrew Cagney - - * utils.c (error_begin): Make static. - * defs.h (error_begin): Delete declaration. - - * linespec.c (cplusplus_error): Replace cplusplus_hint. - (decode_line_1): Use cplusplus_error instead of error_begin, - cplusplus_hint and return_to_top_level. - * coffread.c (coff_symfile_read): Use error instead of error_begin - and return_to_top_level. - * infrun.c (default_skip_permanent_breakpoint): Ditto. - -2002-02-01 Andrew Cagney - - * language.h (type_error, range_error): Make string parameter - constant. - * language.c (warning_pre_print): Delete extern declaration. - * dwarfread.c (warning_pre_print): Ditto. - * language.c (type_error, range_error): Rewrite to use verror and - vwarning instead of warning_begin. - -2002-02-01 Michael Snyder - - * breakpoint.c (breakpoint_re_set): Delete ancient #if 0 code. - (set_ignore_count): Move misplaced comment back where it belongs. - -2002-02-01 Andrew Cagney - - * command.h (NO_FUNCTION): Delete macro. - * cli/cli-decode.h (NO_FUNCTION): Ditto. - * top.c (execute_command): Replace NO_FUNCTION with NULL. - * tracepoint.c (_initialize_tracepoint): Ditto. - * cli/cli-decode.c (add_set_cmd): Ditto. - * cli/cli-cmds.c (init_cli_cmds): Ditto. - -2002-02-01 Daniel Jacobowitz - - * gnu-v3-abi.c (gnuv3_virtual_fn_field): Update comments. - Update ``this'' pointer when calling virtual functions. - -2002-02-01 Michael Snyder - - * breakpoint.c (create_temp_exception_breakpoint): Delete. - * hppa-tdep.c: Deprecate xbreak, txbreak and bx commands. - -2002-02-01 Daniel Jacobowitz - - * regformats/reg-arm.dat: New file. - * regformats/reg-i386.dat: New file. - * regformats/reg-ia64.dat: New file. - * regformats/reg-m68k.dat: New file. - * regformats/reg-mips.dat: New file. - * regformats/reg-ppc.dat: New file. - * regformats/reg-sh.dat: New file. - * regformats/regdef.h: New file. - * regformats/regdat.sh: New file. - -2002-02-01 Richard Earnshaw - - * arm-tdep.c (arm_frameless_function_invocation): Add some comments. - (arm_frame_args_address, arm_frame_locals_address): New functions. - (arm_frame_num_args): New function. - * config/tm-arm.h (FRAME_ARGS_ADDRESS): Call arm_frame_args_address. - (FRAME_LOCALS_ADDRESS): Call arm_frame_locals_address. - (FRMA_NUM_ARGS): Call arm_frame_num_args. - -2002-01-31 Michael Snyder - - * breakpoint.c (break_at_finish_command): Export. - (break_at_finish_at_depth_command): Export. - (tbreak_at_finish_command): Export. - (_initialize_breakpoint): Delete "xbreak" and "txbreak" commands. - * hppa-tdep.c (_initialize_hppa_tdep): Add "xbreak" and - "txbreak" commands, which are HPPA specific. - - * printcmd.c (disassemble_command): Remove an ancient - artifact of an old merge. - - * symfile.h (enum overlay_debugging_state): - Define enum constant values for overlay mode. - * symfile.c (overlay_debugging): Use enums instead of literals. - (overlay_is_mapped, overlay_auto_command, - overlay_manual_command): Ditto. - - * breakpoint.c (insert_breakpoints, remove_breakpoint, - breakpoint_here_p, breakpoint_inserted_here_p, - breakpoint_thread_match, bpstat_stop_status, - describe_other_breakpoints, check_duplicates, clear_command): - Coding standard fixes. - - * target.c (target_xfer_memory): Add spaces, coding standard. - (do_xfer_memory): Add missing line to trust-readonly - code: check bfd SEC_READONLY flag for section. - -2002-01-31 Andrew Cagney - - * PROBLEMS: Fix typo, 5.1->5.1.1. - -2002-01-30 Daniel Jacobowitz - - * symtab.c (find_pc_sect_psymtab): Do not search psymtabs for - data symbols, since we search based on textlow and texthigh. - (find_pc_sect_symtab): Likewise. - -2002-01-30 Andrew Cagney - - * defs.h (vwarning): Declare. - * utils.c (vwarning): New function. - (warning): Call vwarning. - (warning_begin): Delete function. - - * rs6000-nat.c (vmap_ldinfo): Use the function warning to print - the warning message. - * d10v-tdep.c (d10v_address_to_pointer) [0]: Delete call to - warning_begin. - -2002-01-30 Michael Snyder - - * NEWS: Mention "set trust-readonly-sections" command. - Mention generate-core-file command. - -2002-01-15 Michael Snyder - - * target.c: New command, "set trust-readonly-sections on". - (do_xfer_memory): Honor the suggestion to trust readonly sections - by reading them from the object file instead of from the target. - (initialize_targets): Register command "set trust-readonly-sections". - -2002-01-29 Andrew Cagney - - * parse.c (target_map_name_to_register): Simplify, search regs and - pseudo-regs using a single loop. - -2002-01-30 Andrew Cagney - - * PROBLEMS: Note that the i386 fix was missing from 5.1.1. - -2002-01-15 Rodney Brown - - * config/i386/tm-i386v4.h: Define HAVE_I387_REGS. - * config/i386/i386v42mp.mh: Add i387-nat.o . - * i386v4-nat.c: Include i387-nat.h. - (supply_fpregset): Use i387_supply_fsave. - (fill_fpregset): Use i387_fill_fsave. - -2002-01-30 Richard Earnshaw - - * arm-tdep.c (arm_call_dummy_words): Define. - * arm-linux-tdep.c (arm_linux_call_dummy_words): Define. - * config/arm/tm-arm.h (CALL_DUMMY_P): Define. - (CALL_DUMMY_WORDS): Define. - (arm_call_dummy_words): Declare. - * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Define. - (arm_linux_call_dummy_words): Declare. - -2002-01-30 Andreas Schwab - - * m68klinux-nat.c: Fix last change to use regcache_collect - instead of referencing registers[] directly. - -2002-01-29 Andrew Cagney - - * parse.c (target_map_name_to_register): Delete code wrapped in - #ifdef REGISTER_NAME_ALIAS_HOOK. - -2002-01-28 Michael Snyder - - * regcache.c (legacy_read_register_gen): Need to be able to - read pseudo-register as well as real register. - (legacy_write_register_gen): Ditto. - -2002-01-28 Andrew Cagney - - * config/mips/tm-wince.h (TARGET_BYTE_ORDER): Delete. - * config/sparc/tm-sparc.h (TARGET_BYTE_ORDER): Delete. - * config/ns32k/tm-umax.h (TARGET_BYTE_ORDER): Delete. - * config/ia64/tm-ia64.h (TARGET_BYTE_ORDER): Delete. - * config/m32r/tm-m32r.h (TARGET_BYTE_ORDER): Delete. - * config/m68k/tm-m68k.h (TARGET_BYTE_ORDER): Delete. - * config/m88k/tm-m88k.h (TARGET_BYTE_ORDER): Delete. - * config/mn10200/tm-mn10200.h (TARGET_BYTE_ORDER): Delete. - * config/pa/tm-hppa.h (TARGET_BYTE_ORDER): Delete. - * config/sh/tm-wince.h (TARGET_BYTE_ORDER): Delete. - * config/v850/tm-v850.h (TARGET_BYTE_ORDER): Delete. - * config/vax/tm-vax.h (TARGET_BYTE_ORDER): Delete. - * config/z8k/tm-z8k.h (TARGET_BYTE_ORDER): Delete. - * config/i960/tm-i960.h (TARGET_BYTE_ORDER): Delete. - * config/i386/tm-i386.h (TARGET_BYTE_ORDER): Delete. - * config/h8500/tm-h8500.h (TARGET_BYTE_ORDER): Delete. - * config/h8300/tm-h8300.h (TARGET_BYTE_ORDER): Delete. - * config/fr30/tm-fr30.h (TARGET_BYTE_ORDER): Delete. - * config/d30v/tm-d30v.h (TARGET_BYTE_ORDER): Delete. - * config/alpha/tm-alpha.h (TARGET_BYTE_ORDER): Delete. - -2002-01-28 Andrew Cagney - - * arch-utils.c (TARGET_BYTE_ORDER_DEFAULT): Delete macro. - (target_byte_order): Initialize to BFD_ENDIAN_BIG. - (initialize_current_architecture): Update target_byte_order using - information from BFD. - * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_DEFAULT): - * config/arm/tm-arm.h (TARGET_BYTE_ORDER_DEFAULT): Delete. - -2002-01-28 Andrew Cagney - - * config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here... - * vax-tdep.c (INVALID_FLOAT): To here. Document why it is broken. - - * rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in - #ifdef INVALID_FLOAT. - * infcmd.c (do_registers_info): Ditto. - * values.c (unpack_double): Ditto. Add comment. - - * config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was - already commented out. - -2002-01-26 Andreas Schwab - - * config/m68k/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define. - * m68klinux-nat.c: Update ptrace interface for fetching/storing - registers and add support for PTRACE_GETREGS. - -2002-01-24 Andrew Cagney - - GDB 5.1.1 released from 5.1 branch. - * NEWS: Add 5.1.1 news. - * README: Sync with 5.1 branch. - -2002-01-23 Fred Fish - - * mdebugread.c (parse_partial_symbols): Only copy stabstring1 to - stabstring on initial malloc. Reallocing will copy it for us, - if necessary. - -2002-01-23 Elena Zannoni - - * Makefile.in (hpread_h): Delete. - (HFILES_NO_SRCDIR): Remove hpread.h. - (ALLDEPFILES): Remove hp-psymtab-read.c and hp-symtab-read.c. - (hpread.o): Update dependencies. - (hp-psymtab-read.o, hp-symtab-read.o): Remove. - - * hp-psymtab-read.c: Remove file. - * hp-symtab-read.c: Remove file. - * hpread.h: Remove file. - - * hpread.c: Merge all contents of hp-psymtab-read.c, - hp-symtab-read.c and hpread.h into this file, as it was prior to - January 1999. - - * config/pa/hpux11w.mh, config/pa/hpux11.mh, - config/pa/hpux1020.mh, config/pa/hppaosf.mh, - config/pa/hppahpux.mh, config/pa/hppabsd.mh (NATDEPFILES): - Remove hp-psymtab-read.o and hp-symtab-read.o, add hpread.o. - -2002-01-23 Elena Zannoni - - * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset, - fill_gregset): Call gdbarch_tdep() just once, assign result to - variable and use that, instead of calling the function several - times. - -2002-01-24 Alexandre Oliva - - * configure.host: Accept sparcv9 as alias for sparc64. - * configure.tgt: Likewise. - -2002-01-22 Kevin Buettner - - * solib-aix5.c (build_so_list_from_mapfile) - (aix5_relocate_main_executable): Fix xcalloc() calls so order of - arguments is not reversed. - * solib-sunos.c (sunos_relocate_main_executable): Likewise. - * solib-svr4.c (svr4_relocate_main_executable): Likewise. - -2002-01-22 Elena Zannoni - - * sh-tdep.c (sh_pseudo_register_read): New function. Renamed and - modified version of obsolete sh_fetch_pseudo_register. - (sh_fetch_pseudo_register): Rename to sh_pseudo_register_read. - (sh4_register_read): New function. - (sh_pseudo_register_write): New function. Renamed and modified - version of obsolete sh_store_pseudo_register. - (sh_store_pseudo_register): Rename to sh_pseudo_register_write. - (sh4_register_write): New function. - (sh_gdbarch_init): Remove setting of gdbarch function - fetch_pseudo_register and store_pseudo_register. Remove setting of - register_convert_to_raw, register_convert_to_virtual, - register_convertible. - (sh_sh4_register_convertible): Delete. No longer needed. All is - taken care by architecture specific functions - register_read/register_write. - (sh_sh4_register_convert_to_virtual): Make static. - (sh_sh4_register_convert_to_raw): Ditto. - -2002-01-22 Andrew Cagney - - * doublest.c (floatformat_is_negative): Assert FMT is non NULL. - (floatformat_is_nan, floatformat_mantissa): Ditto. - - * gdbtypes.c (_initialize_gdbtypes): Initialize TYPE_FLOATFORMAT - for builtin_type_ieee_single_little, builtin_type_ieee_double_big, - builtin_type_ieee_double_little, - builtin_type_ieee_double_littlebyte_bigword, - builtin_type_m68881_ext, builtin_type_i960_ext, - builtin_type_m88110_ext, builtin_type_m88110_harris_ext, - builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword, - builtin_type_ia64_spill_big, builtin_type_ia64_spill_little and - builtin_type_ia64_quad_big, builtin_type_ia64_quad_little. - -2002-01-22 Corinna Vinschen - - * xstormy16-tdep.c (xstormy16_scan_prologue): Add frameless - parameter. Set frameless flag if it exists and depended of - whether the scanned function is frameless or not. - (xstormy16_skip_prologue): If function is frameless, return - result of xstormy16_scan_prologue(). - (xstormy16_frame_init_saved_regs): Adjust xstormy16_scan_prologue() - call. - -2002-01-21 Elena Zannoni - - * sh-tdep.c (sh_fp_frame_init_saved_regs, sh_push_arguments, - sh_generic_show_regs, sh3_show_regs, sh3e_show_regs, - sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs, - sh_sh4_register_byte, sh_sh4_register_raw_size, - sh_sh3e_register_virtual_type, sh_sh4_register_virtual_type, - sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual, - sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register, - sh_store_pseudo_register, sh_do_pseudo_register): Call - gdbarch_tdep() just once, assign result to variable and use that, - instead of calling the function several times. - -2002-01-20 Mark Kettenis - - * go32-nat.c (fetch_register): Use FP_REGNUM_P and FPC_REGNUM_P - macros instead of LAST_FPU_CTRL_REGNUM. - (store_register): Likewise. - -2002-01-21 Jim Blandy - - * infcmd.c (run_command): Check that the `exec' target layer's BFD - is up-to-date before running the program, not just when a program - exits. - -2002-01-21 Fred Fish - - * arm-tdep.c (thumb_skip_prologue): Quit scanning prologue - when we have found all instructions we are looking for. - -2002-01-21 Richard Earnshaw - - * arm-tdep.c (arm_register_name): New function. - (arm_registers_names): Make static. - * config/arm/tm-arm.h (arm_register_names): Delete declaration. - (arm_register_name): Declare. - (REGISTER_NAME): Use it. - -2002-01-21 Richard Earnshaw - Kevin Buettner - - Convert arm targets to new FRAME interface. - * arm-tdep.c (struct frame_extra_info): Remove fsr. - (arm_frame_find_save_regs): Delete. - (arm_frame_init_saved_regs): New. - (arm_init_extra_frame_info): Alloacte saved_regs as required. - Allocate extra_info as required. Convert all uses of fsr.regs - to use saved_regs, similarly all uses of EXTRA_FRAME_INFO fields - to use extra_info. - (thumb_scan_prologue, arm_scan_prologue, arm_find_callers_reg) - (arm_frame_chain, arm_frame_saved_pc, arm_pop_frame): Likewise. - (check_prologue_cache, save_prologue_cache): Likewise. - (_initialize_arm_tdep): Ensure prologue_cache is correctly set up. - * config/arm/tm-arm.h (EXTRA_FRAME_INFO): Delete. - (FRAME_FIND_SAVED_REGS): Delete. - (arm_frame_find_saved_regs): Delete prototype. - (arm_frame_init_saved_regs): New prototype. - (FRAME_INIT_SAVED_REGS): Define. - -2002-01-20 Andrew Cagney - - * config/arc/tm-arc.h (IEEE_FLOAT): Delete. - -2002-01-20 Andrew Cagney - - From Jeff Law : - * infttrace.c: Include . - (child_pid_to_exec_file): Revamp. Use pstat call to get the - exec file if the ttrace equivalent fails. - -2002-01-20 Andrew Cagney - - * rdi-share/devsw.c (openLogFile): Delete unused ``struct tm lt''. - (closeLogFile): Ditto. - -2002-01-20 Michael Chastain - - * top.c (print_gdb_version): Bump copyright year to 2002. - -2002-01-20 Andrew Cagney - - * MAINTAINERS (Blanket Write Privs): Add Kevin Buettner, Elena - Zannoni and Eli Zaretskii. - -2002-01-20 Daniel Jacobowitz - - * buildsym.c: Update copyright years. - * c-typeprint.c: Likewise. - * dwarf2read.c: Likewise. - * f-typeprint.c: Likewise. - * gdbtypes.c: Likewise. - * gdbtypes.h: Likewise. - * hp-symtab-read.c: Likewise. - * hpread.c: Likewise. - * mdebugread.c: Likewise. - * p-typeprint.c: Likewise. - -2002-01-20 Andrew Cagney - - * remote-sim.c (gdbsim_open): Simplify code testing the macro - TARGET_BYTE_ORDER_SELECTABLE_P. Assume the target is always - byte-order selectable. - * sparc-tdep.c (sparc_target_architecture_hook): Ditto. - * arch-utils.c: Ditto. - (set_endian): Ditto. - (set_endian_from_file): Ditto. - * gdbserver/low-sim.c (create_inferior): Ditto. - * gdbarch.sh: Ditto. - * gdbarch.h: Re-generate. - * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE_P): - * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE): - * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER_SELECTABLE): - * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_SELECTABLE_P): - * config/arm/tm-wince.h (TARGET_BYTE_ORDER_SELECTABLE_P): - * config/arm/tm-linux.h (TARGET_BYTE_ORDER_SELECTABLE_P): - * config/arc/tm-arc.h (TARGET_BYTE_ORDER_SELECTABLE): - * config/arm/tm-arm.h (TARGET_BYTE_ORDER_SELECTABLE_P): Delete - macro definition. - * config/mips/tm-wince.h: Remove #undef of macro - TARGET_BYTE_ORDER_SELECTABLE. - * config/sh/tm-wince.h: Ditto. - -2002-01-20 Daniel Jacobowitz - - * gdbtypes.h (struct cplus_struct_type): Add is_artificial to - member function fields. Add accessor macro - TYPE_FN_FIELD_ARTIFICIAL. - * dwarf2read.c (dwarf2_add_member_fn): Check for artificial methods. - * c-typeprint.c (c_type_print_base): Skip artificial member - functions. - -2002-01-20 Daniel Jacobowitz - - * f-typeprint.c: Delete unused function f_type_print_args. - * p-typeprint.c: Delete unused function pascal_type_print_args. - -2002-01-20 Daniel Jacobowitz - - * gdbtypes.h (struct type): Fix whitespace. Remove obsolete - comment. Add ``artificial'' to ``union field_location''. - - * dwarf2read.c: Remove ad-hoc TYPE_FIELD_ARTIFICIAL. - - * buildsym.c (finish_block): Initialize TYPE_FIELD_ARTIFICIAL to 0. - * mdebugread.c (parse_symbol): Likewise. - * stabsread.c (define_symbol): Likewise. - * hp-symtab-read.c (hpread_function_type): Likewise, instead of - initializing TYPE_FIELD_BITPOS to n (obsolete). - (hpread_doc_function_type): Likewise. - * hpread.c (hpread_function_type): Likewise. - -2002-01-20 Andrew Cagney - - * configure.in (host_makefile_frag): Only require a host makefile - fragment when a native build. - * configure: Re-generate. - -2002-01-20 Andrew Cagney - - * doublest.h (floatformat_from_type): Declare. - * doublest.c (floatformat_from_type): New function. - (convert_typed_floating): Use. - - * valprint.c (print_floating): Replace checks for IEEE_FLOAT with - call to function floatformat_from_type. - - * gdbarch.sh (IEEE_FLOAT): Delete. - * gdbarch.h, gdbarch.c: Re-generate. - * config/i960/tm-i960.h (IEEE_FLOAT): Delete macro. - * config/i386/tm-i386.h (IEEE_FLOAT): Ditto. - * config/z8k/tm-z8k.h (IEEE_FLOAT): Ditto. - * config/sparc/tm-sparc.h (IEEE_FLOAT): Ditto. - * config/pa/tm-hppa.h (IEEE_FLOAT): Ditto. - * config/m88k/tm-m88k.h (IEEE_FLOAT): Ditto. - * config/m68k/tm-m68k.h (IEEE_FLOAT): Ditto. - * config/h8500/tm-h8500.h (IEEE_FLOAT): Ditto. - * config/h8300/tm-h8300.h (IEEE_FLOAT): Ditto. - * config/fr30/tm-fr30.h (IEEE_FLOAT): Ditto. - * config/arm/tm-arm.h (IEEE_FLOAT): Ditto. - * config/alpha/tm-alpha.h (IEEE_FLOAT): Ditto. - - * s390-tdep.c (s390_gdbarch_init): Do not set ieee_float. - * x86-64-tdep.c (i386_gdbarch_init): Ditto. - * sparc-tdep.c (sparc_gdbarch_init): Ditto. - * sh-tdep.c (sh_gdbarch_init): Ditto. - * mips-tdep.c (mips_gdbarch_init): Ditto. - * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - * cris-tdep.c (cris_gdbarch_init): Ditto. - -2002-01-20 Jiri Smid - - * configure.host, configure.tgt: Support x86-64. - * NEWS: Note new target x86-64. - - * config/i386/x86-64linux.mh (NATDEPFILES): x86-64-nat.o removed. - * x86-64-linux-nat.c (x86_64_register_u_addr): New function. - * config/i386/nm-x86-64.h (ATTACH_LWP): Removed. - * Makefile.in (x86-64-tdep.o, x86-64-linux-tdep.o, - x86-64-linux-nat.o): Fix dependencies. - -2002-01-19 Andrew Cagney - - * utils.c: Remove #ifndef MALLOC_INCOMPATIBLE. - * config/sparc/xm-sun4os4.h (PTRACE_ARG3_TYPE): Move macro .... - * config/sparc/nm-sun4os4.h (PTRACE_ARG3_TYPE): ... to here. - * config/sparc/xm-sun4os4.h: Delete file. - * config/sparc/sun4os4.mh (XM_FILE): Delete makefile variable. - -2002-01-19 Andrew Cagney - - * config/sparc/sparclynx.mh (XM_FILE): Delete. - * config/rs6000/rs6000lynx.mh (XM_FILE): Delete. - * config/m68k/m68klynx.mh (XM_FILE): Delete. - * config/i386/i386lynx.mh (XM_FILE): Delete. - * config/rs6000/xm-rs6000ly.h: Delete file. - * config/sparc/xm-sparclynx.h: Delete file. - * config/m68k/xm-m68klynx.h: Delete file. - * config/i386/xm-i386lynx.h: Delete file. - * config/xm-lynx.h: Delete file. - * config/djgpp/fnchange.lst: Update. - -2002-01-19 Jason Thorpe - - * alpha-tdep.c (alpha_register_byte): New function. - (alpha_register_raw_size): Ditto. - (alpha_register_virtual_size): Ditto. - (alpha_skip_prologue_internal): Renamed from - alpha_skip_prologue. - (alpha_skip_prologue): New version that calls - alpha_skip_prologue_internal. - (alpha_in_lenient_prologue): Use alpha_skip_prologue_internal. - * config/alpha/tm-alpha.h (SKIP_PROLOGUE): Remove - second argument from alpha_skip_prologue. - (REGISTER_BYTE): Use alpha_register_byte. - (REGISTER_RAW_SIZE): Use alpha_register_raw_size. - (REGISTER_VIRTUAL_SIZE): Use alpha_register_virtual_size. - (FRAMELESS_FUNCTION_INVOCATION): Use - generic_frameless_function_invocation_not. - (FRAME_NUM_ARGS): Use frame_num_args_unknown. - (COERCE_FLOAT_TO_DOUBLE): Use standard_coerce_float_to_double. - -2002-01-19 Andrew Cagney - - * config/mips/xm-news-mips.h: Delete file. - * config/mips/news-mips.mh (XM_FILE): Delete makefile variable. - - * config/m88k/xm-m88k.h: Delete file. - * config/m88k/xm-dgux.h: Do not include xm-m88k.h. - * config/m88k/xm-delta88v4.h: Ditto. - * config/m88k/xm-delta88.h: Ditto. - - * config/alpha/xm-fbsd.h: Delete file. - * config/alpha/fbsd.mh (XM_FILE): Delete makefile variable. - - * config/sparc/xm-sparc.h: Delete file. - * Makefile.in (xm-sun4os4.h): Delete dependency. - * config/sparc/xm-sun4sol2.h: Do not include xm-sparc.h. - * config/sparc/xm-sun4os4.h: Ditto. - * config/sparc/xm-linux.h: Ditto. - - * config/i386/xm-windows.h: Delete file. - -2002-01-19 Andrew Cagney - - * utils.c: Include for MAXPATHLEN. - (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined. - -2002-01-19 Jason Thorpe - - * alpha-tdep.c (alpha_call_dummy_words): New. - * config/alpha/tm-alpha.h (CALL_DUMMY): Remove. - (CALL_DUMMY_P): Define. - (CALL_DUMMY_WORDS): Define. - (SIZEOF_CALL_DUMMY_WORDS): Define. - -2002-01-19 Per Bothner - - * gnu-v3-abi.c (gnuv3_rtti_type): Guard that vtable_symbol_name - isn't NULL, which can happen with some gcj-3.x-produced code. - -2002-01-19 Jason Thorpe - - * alpha-tdep.c (alpha_register_virtual_type): New function. - (alpha_init_frame_pc_first): Ditto. - (alpha_fix_call_dummy): Ditto. - (alpha_store_struct_return): Ditto. - (alpha_extract_struct_value_address): Ditto. - * config/alpha/tm-alpha.h (REGISTER_VIRTUAL_TYPE): Use - alpha_register_virtual_type. - (STORE_STRUCT_RETURN): Use alpha_store_struct_return. - (EXTRACT_STRUCT_VALUE_ADDRESS): Use - alpha_extract_struct_value_address. - (FIX_CALL_DUMMY): Use alpha_fix_call_dummy. - (INIT_FRAME_PC): Use init_frame_pc_noop. - (INIT_FRAME_PC_FIRST): Use alpha_init_frame_pc_first. - -2002-01-19 Mark Kettenis - - * i386gnu-nat.c: Include "i386-tdep.h". - (fetch_fpregs): Simplify code dealing with uninitialized floating - point states such that it doesn't require FP7_REGNUM. - -2002-01-18 Jason Thorpe - - * alpha-tdep.c (frame_extra_info): New. - (alpha_find_saved_regs): Make static. Use - frame->extra_info. - (alpha_frame_init_saved_regs): New function. - (alpha_frame_saved_pc): Use frame->extra_info. - (temp_saved_regs): Don't declare as struct frame_saved_regs. - (heuristic_proc_desc): Adjust for temp_saved_regs changes. - (init_extra_frame_info): Rename to... - (alpha_init_extra_frame_info): ...this. Use frame->extra_info. - (alpha_print_extra_frame_info): New function. - (alpha_frame_locals_address): Ditto. - (alpha_frame_args_address): Ditto. - (alpha_pop_frame): Use frame->extra_info. - * config/alpha/tm-alpha.h (FRAME_ARGS_ADDRESS): Use - alpha_frame_args_address. - (FRAME_LOCALS_ADDRESS): Use alpha_frame_locals_address. - (alpha_find_saved_regs): Remove prototype. - (FRAME_INIT_SAVED_REGS): Use alpha_frame_init_saved_regs. - (EXTRA_FRAME_INFO): Remove. - (INIT_EXTRA_FRAME_INFO): Use alpha_init_extra_frame_info. - (PRINT_EXTRA_FRAME_INFO): Use alpha_print_extra_frame_info. - -2002-01-18 Jason Thorpe - - * alpha-tdep.c (alpha_osf_in_sigtramp): New function. - (alpha_cannot_fetch_register): Ditto. - (alpha_cannot_store_register): Ditto. - (alpha_register_convertible): Ditto. - (alpha_use_struct_convention): Ditto. - * config/alpha/tm-alpha.h: Update copyright years. - (IN_SIGTRAMP): Use alpha_osf_in_sigtramp. - (INNER_THAN): Use core_addr_lessthan. - (CANNOT_FETCH_REGISTER): Use alpha_cannot_fetch_register. - (CANNOT_STORE_REGISTER): Use alpha_cannot_store_register. - (REGISTER_CONVERTIBLE): Use alpha_register_convertible. - (USE_STRUCT_CONVENTION): Use alpha_use_struct_convention. - (FRAME_CHAIN): Remove unnecessary cast. - -2002-01-18 Andrew Cagney - - * NEWS: Document that testsuite/gdb.hp/gdb.threads-hp/ is - obsolete. - -2002-01-18 Andrew Cagney - - * infptrace.c: Remove ATTRIBUTE_UNUSED. Update copyright. - * monitor.c, remote-array.c, remote-bug.c: Ditto. - * remote-e7000.c, remote-es.c, remote-mips.c: Ditto. - * remote-nindy.c, remote-os9k.c, remote-rdi.c: Ditto. - * remote-rdp.c, remote-sds.c, remote-sim.c: Ditto. - * remote-st.c, remote-vx.c, remote.c, win32-nat.c: Ditto. - * x86-64-linux-nat.c: Ditto. - -2002-01-18 Jason Thorpe - - * alpha-tdep.c (alpha_register_name): New function. - * config/alpha/tm-alpha.h (REGISTER_NAMES): Remove. - (REGISTER_NAME): Define. - -2002-01-18 Jason Thorpe - - * config/nm-nbsd.h (KERNEL_U_ADDR): Remove. - -2002-01-18 Jason Thorpe - - * alpha-tdep.c: Update copyright years. - (alpha_next_pc): New function. - (alpha_software_single_step): Ditto. - * config/alpha/tm-alpha.h: Add prototype for - alpha_software_single_step. - -2002-01-18 Jason Thorpe - - * alphabsd-nat.c: Update copyright years. - (fill_gregset): Use regcache_collect. - (fill_fpregset): Likewise. - (fetch_inferior_registers): Only fetch integer registers - if requested to do so. - (store_inferior_registers): Only store integer registers - if requested to do so. - -2002-01-17 Andrew Cagney - - * config/alpha/alpha-osf3.mh (XDEPFILES): Delete. - * config/alpha/alpha-osf2.mh (XDEPFILES): Delete. - * config/alpha/alpha-osf1.mh (XDEPFILES): Delete. - * config/alpha/alpha-linux.mh (XDEPFILES): Delete. - * config/alpha/fbsd.mh (XDEPFILES): Delete. - * config/arm/linux.mh (XDEPFILES): Delete. - * config/arm/nbsd.mh (XDEPFILES): Delete. - * config/i386/i386dgux.mh (XDEPFILES): Delete. - * config/i386/i386sol2.mh (XDEPFILES): Delete. - * config/i386/i386m3.mh (XDEPFILES): Delete. - (NATDEPFILES): Move i387-tdep.o and core-aout.o to here. - * config/i386/i386gnu.mh (XDEPFILES): Delete. - * config/i386/fbsd.mh (XDEPFILES): Delete. - * config/i386/i386bsd.mh (XDEPFILES): Delete. - * config/i386/i386sco5.mh (XDEPFILES): Delete. - * config/i386/i386v4.mh (XDEPFILES): Delete. - * config/i386/i386v42mp.mh (XDEPFILES): Delete. - * config/i386/i386sco4.mh (XDEPFILES): Delete. - * config/i386/i386aix.mh (XDEPFILES): Delete. - * config/i386/go32.mh (XDEPFILES): Delete. - * config/i386/cygwin.mh (XDEPFILES): Delete. - * config/i386/i386lynx.mh (XDEPFILES): Delete. - * config/i386/i386mach.mh (XDEPFILES): Delete. - * config/i386/i386v32.mh (XDEPFILES): Delete. - * config/i386/linux.mh (XDEPFILES): Delete. - * config/i386/nbsdelf.mh (XDEPFILES): Delete. - * config/i386/ncr3000.mh (XDEPFILES): Delete. - * config/i386/i386mk.mh (NATDEPFILES): Rename XDEPFILES. - * config/i386/i386sco.mh (XDEPFILES): Delete. - * config/i386/i386v.mh (XDEPFILES): Delete. - * config/i386/nbsd.mh (XDEPFILES): Delete. - * config/i386/ptx.mh (NATDEPFILES): Rename XDEPFILES. - * config/i386/ptx4.mh (NATDEPFILES): Rename XDEPFILES. - * config/i386/symmetry.mh (XDEPFILES): Delete. - * config/i386/obsd.mh (XDEPFILES): Delete. - * config/i386/x86-64linux.mh (XDEPFILES): Delete. - * config/ia64/linux.mh (XDEPFILES): Delete. - * config/ia64/aix.mh (XDEPFILES): Delete. - * config/m68k/apollo68b.mh (XDEPFILES): Delete. - * config/m68k/dpx2.mh (XDEPFILES): Delete. - * config/m68k/3b1.mh (NATDEPFILES): Rename XDEPFILES. - * config/m68k/apollo68v.mh (XDEPFILES): Delete. - * config/m68k/hp300bsd.mh (XDEPFILES): Delete. - * config/m68k/linux.mh (XDEPFILES): Delete. - * config/m68k/m68klynx.mh (XDEPFILES): Delete. - * config/m68k/m68kv4.mh (XDEPFILES): Delete. - * config/m68k/nbsd.mh (XDEPFILES): Delete. - * config/m68k/sun2os3.mh (XDEPFILES): Delete. - * config/m68k/sun2os4.mh (XDEPFILES): Delete. - * config/m68k/sun3os3.mh (XDEPFILES): Delete. - * config/m68k/sun3os4.mh (XDEPFILES): Delete. - * config/m88k/delta88.mh (XDEPFILES): Delete. - * config/m88k/delta88v4.mh (XDEPFILES): Delete. - * config/m88k/m88k.mh (XDEPFILES): Delete. - * config/mips/littlemips.mh (NATDEPFILES): Rename XDEPFILES. - * config/mips/linux.mh (XDEPFILES): Delete. - * config/mips/irix6.mh (XDEPFILES): Delete. - * config/mips/irix5.mh (XDEPFILES): Delete. - * config/mips/irix4.mh (XDEPFILES): Delete. - * config/mips/irix3.mh (XDEPFILES): Delete. - * config/mips/decstation.mh (XDEPFILES): Delete. - * config/mips/mipsm3.mh (XDEPFILES): Delete. - (NATDEPFILES): Move core-aout.o to here. - * config/ns32k/nbsd.mh (XDEPFILES): Delete. - * config/pa/hpux1020.mh (XDEPFILES): Delete. - * config/pa/hppabsd.mh (XDEPFILES): Delete. - * config/pa/hppahpux.mh (XDEPFILES): Delete. - * config/pa/hpux11w.mh (XDEPFILES): Delete. - * config/pa/hppaosf.mh (XDEPFILES): Delete. - * config/pa/hpux11.mh (XDEPFILES): Delete. - * config/powerpc/aix.mh (XDEPFILES): Delete. - * config/powerpc/nbsd.mh (XDEPFILES): Delete. - * config/powerpc/linux.mh (XDEPFILES): Delete. - * config/romp/rtbsd.mh: Rename XDEPFILES. - * config/rs6000/rs6000lynx.mh (XDEPFILES): Delete. - * config/rs6000/aix4.mh (XDEPFILES): Delete. - * config/rs6000/rs6000.mh (XDEPFILES): Delete. - * config/s390/s390.mh (XDEPFILES): Delete. - * config/vax/vaxbsd.mh (NATDEPFILES): Rename XDEPFILES. - * config/sparc/sun4sol2.mh (XDEPFILES): Delete. - * config/sparc/sun4os4.mh (XDEPFILES): Delete. - * config/sparc/sparclynx.mh (XDEPFILES): Delete. - * config/sparc/nbsdelf.mh (XDEPFILES): Delete. - * config/sparc/nbsd.mh (XDEPFILES): Delete. - * config/sparc/linux.mh (XDEPFILES): Delete. - * config/vax/vaxult.mh (XDEPFILES): Delete. - * config/vax/vaxult2.mh (XDEPFILES): Delete. - * Makefile.in (DEPFILES): Remove XDEPFILES. - -2002-01-17 Andrew Cagney - - * utils.c (internal_verror): Fix comments, default is yes not no. - Update queries to match. Default to quit and dump core. - -2002-01-17 Andrew Cagney - - * breakpoint.c: Update assuming #if UI_OUT is always true. Update - copyright. - * defs.h, event-top.c, gdbcmd.h: Ditto. - * infcmd.c, infrun.c, main.c, printcmd.c, remote.c: Ditto. - * source.c, stack.c, symfile.c, symtab.c, thread.c: Ditto. - * top.c, cli/cli-cmds.c, cli/cli-decode.c: Ditto. - * cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.c: Ditto. - * mi/ChangeLog, mi/mi-cmd-break.c, mi/mi-cmd-stack.c: Ditto. - * mi/mi-main.c:Ditto. - - * stack.c, symfile.c: Update copyright. - -2002-01-17 Daniel Jacobowitz - - * gdbserver/low-hppabsd.c, gdbserver/low-lynx.c, - gdbserver/low-nbsd.c, gdbserver/low-sim.c, - gdbserver/low-sparc.c, gdbserver/low-sun3.c, - gdbserver/low-linux.c, gdbserver/server.c: Correct copyright notices. - -2002-01-17 Daniel Jacobowitz - - * gdbserver/low-hppabsd.c (myattach): New function, returning -1. - * gdbserver/low-lynx.c (myattach): Likewise. - * gdbserver/low-nbsd.c (myattach): Likewise. - * gdbserver/low-sim.c (myattach): Likewise. - * gdbserver/low-sparc.c (myattach): Likewise. - * gdbserver/low-sun3.c (myattach): Likewise. - - * gdbserver/low-linux.c (myattach): New function. - - * gdbserver/server.c (attach_inferior): New function. - (main): Handle "--attach". - -2002-01-16 Andrew Cagney - - * MAINTAINERS (language support): Daniel Jacobwitz is C++ - maintainer. - -2002-01-15 Daniel Jacobowitz - - * c-typeprint.c (is_type_conversion_operator): Add additional - check for non-conversion operators. - -2002-01-15 Michael Snyder - - * linux-proc.c: Add "info proc" command, a la procfs.c. - (read_mapping): New function, abstract and re-use code. - (linux_find_memory_regions): Use new func read_mapping. - (linux_info_proc_cmd): New function, implement "info proc". - (_initialize_linux_proc): Add new command "info proc". - -2002-01-15 Michael Snyder - - * symfile.c (generic_load): Use bfd_map_over_sections method - instead of manipulating bfd structure members directly. - (add_section_size_callback): New function, bfd sections callback - used by generic_load. - (load_sections_callback): New function, bfd sections callback - used by generic_load. - -2002-01-15 Elena Zannoni - - [Based on work by Jim Blandy] - * gdbtypes.h (builtin_type_v16qi, builtin_type_v8hi): Export. - (builtin_type_vec128): Export. - * gdbtypes.c (builtin_type_v16qi, builtin_type_v8hi): New SIMD - types. - (builtin_type_vec128): New builtin type for 128 bit vector - registers. - (build_gdbtypes): Initialize builtin_type_v16qi and - builtin_type_v8hi. Create the vec128 register builtin type - structure. - (build_builtin_type_vec128): New function. - (_initialize_gdbtypes): Register builtin_type_v16qi and - builtin_type_v8hi with gdbarch. Same for builtin_type_vec128. - * rs6000-tdep.c (rs6000_register_virtual_type): Change type of - AltiVec register to new builtin type. - -2001-01-15 Daniel Jacobowitz - - * stabsread.c (read_type): Pass dbx_lookup_type (typenums) - to make_cv_type. - -2002-01-14 Andrew Cagney - - * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Rename - CLEAN_UP_REGISTER_VALUE. - * regcache.c (supply_register): Update only call. - -2002-01-14 Andrew Cagney - - * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, - a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and - a29k-*-vxworks* targets as obsolete. - -2002-01-14 Michael Snyder - - * linux-proc.c (linux_do_thread_registers): Ignore fpxregs - until we can resolve portability issues. - * gregset.h: Remove references to fpxregs. - * gcore.c (gcore_command): Initialize note_sec to NULL. - -2002-01-13 Andrew Cagney - - * signals.c (target_signal_to_name): Rewrite. Only use - signals[].name when in bounds and non-NULL. - -2002-01-13 Andrew Cagney - - From Petr Ledvina : - * signals.c (target_signal_to_name): Verify that SIG is within the - bounds of the signals array. - -2002-01-13 Andrew Cagney - - * MAINTAINERS: Remove arm-coff and arm-pe from target list. - -2002-01-13 Keith Seitz - - * stack.c (print_frame_info_base): Print the frame's pc - only if when print_frame_info_listing_hook is not defined. - -2002-01-13 Keith Seitz - - * varobj.c (varobj_set_value): Make sure that there were no - errors evaluating the object before attempting to set its - value. - value_cast now properly adjusts VALUE_ADDRESS for baseclasses, - so this offset adjustment is no longer necessary. - (create_child): Don't set the error flag if the child is - a CPLUS_FAKE_CHILD. - (value_of_child): If value_fetch_lazy fails, return NULL - so that callers will be notified that an error occurred. - (c_value_of_variable): Delay check of variable's validity - until later. We actually want all structs and unions to have - the value "{...}". - Do not return "???" for variables which could not be evaluated. - This error condition must be returned to the caller so that it - can get the error condition from gdb. - (cplus_name_of_child): Adjust index for vptr before figuring - out the name of the child. - (cplus_value_of_child): If a child's (real) parent is not valid, - don't even bother trying to give a value for it. Just return - an error. Change all instances in this function. - (cplus_type_of_child): If our parent is one of the "fake" - parents, we need to get at the type of the real parent, and - derive the child's true type using this information. - -2002-01-13 Andrew Cagney - - From 2002-01-09 John Marshall : - * CONTRIBUTE, README, TODO: Change sourceware.cygnus.com to - sources.redhat.com, and tweak some related URLs which had - suffered from linkrot. - -2002-01-13 Andrew Cagney - - From Jeff law: - * hppa-tdep.c (hppa_push_arguments): Correct handling of 5-7 byte - structures passed in registers. - -2002-01-13 Eli Zaretskii - - * go32-nat.c (save_npx) [__DJGPP_MINOR__ < 3]: Remove extraneous - white space which prevented compilation. Reported by DSK - . - -2002-01-11 Michael Snyder - - * symfile.c (build_section_addr_info_from_section_tab): - Use bfd access method instead of manipulating bfd directly. - (syms_from_objfile): Ditto. - (simple_overlay_update_1): Ditto. - (simple_overlay_update): Ditto. - (generic_load): Ditto. - (overlay_unmapped_address): FIXME comment, bfd access methods. - (sections_overlap): FIXME comment, bfd access methods. - (pc_in_mapped_range): FIXME comment, bfd access methods. - (pc_in_unmapped_range): FIXME comment, bfd access methods. - (section_is_mapped): FIXME comment, bfd access methods. - (section_is_overlay): FIXME comment, bfd access methods. - - * symfile.c (generic_load): Whitespace and long line cleanups. - Remove duplicate variable, change several local variables to - more appropriate data types. - (print_transfer_performance): Use %lu instead of %ld for ulongs. - -2002-01-12 Andrew Cagney - - From Peter Schauer: - * language.c (longest_local_hex_string_custom): Use phex_nz to - convert NUM to a hex string. - -2002-01-12 Elena Zannoni - - * sh-tdep.c (sh_gdbarch_init): Move setting of long_bit earlier in - the function. - Update Copyright year. - -2002-01-12 Andrew Cagney - - * language.c (longest_raw_hex_string): Delete unused function. - -2002-01-11 Petr Sorfa - - * MAINTAINERS (write-after-approval): Add myself. - * dwarf2read.c (read_tag_string_type): Handling of - DW_AT_byte_size. - (read_tag_string_type): FORTRAN fix to prevent propagation of - first string size. - (set_cu_language): Handling of DW_LANG_Fortran95 - -2002-01-11 Richard Earnshaw - - * armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid -> - GETPID(inferior_ptid). - (store_inferior_registers): Likewise. - -2002-01-10 Jason Merrill - - * dwarf2read.c (decode_locdesc): Implement DW_OP_litn, DW_OP_dup. - Fix DW_OP_minus. - -2002-01-10 Andrew Cagney - - * config/djgpp/fnchange.lst: Add renames for bfd/ChangeLog-0001 - and bfd/elf32-sh-nbsd.c. - -2002-01-10 Michael Snyder - - * NEWS: Mention --pid and corefile/proc-id behavior change. - - * Makefile.in: Add rules for gcore.o and linux-proc.o. - * gcore.c: Include cli/cli-decode.h instead of command.h. - - * main.c (captured_main): Add new command line option "--pid". - If the second command line argument (following the symbol-file) - begins with a digit, try to attach to it before trying to open - it as a corefile. - (print_gdb_help): Document the "--pid" argument. - -2002-01-10 Eli Zaretskii - - * completer.c (command_completer): New function. - - * completer.h : Add prototype. - - * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the - completer for the "help" command. - -2002-01-09 Jason Merrill - - * c-typeprint.c (is_type_conversion_operator): Fix thinko. - -2002-01-09 Michael Snyder - - * i386-linux-nat.c (fill_fpxregset): Make global. - (store_fpxregset): Ditto. - - * gregset.h (gdb_fpxregset_t): Define. - (supply_fpxregset): Prototype. - (fill_fpxregset): Prototype. - - * exec.c (exec_make_note_section): Don't call elfcore_write_prpsinfo. - -2002-01-09 Richard Earnshaw - - * config/arm/arm-tdep.h (arm_software_single_step): Remove PARAMS. - * config/arm/nm-nbsd.h (arm_register_u_addr): Likewise. - * config/arm/tm-nbsd.h (get_longjmp_target): Likewise. - -2002-01-09 Andrew Cagney - - * MAINTAINERS: Update target maintainer rules so that any - Maintainer can approve a tested patch for a maintenance-only - target. - -2002-01-09 Richard Earnshaw - - * MAINTAINERS (write-after-approval): Add myself. - - * arm-tdep.c (arm_init_extra_frame_info): Cast NULL argument to - IN_SIGTRAMP. - -2002-01-08 Michael Snyder - - * linux-proc.c (child_pid_to_exec_file): Use readlink to get the - real name of the executable, rather than the /proc name. - -2002-01-03 Michael Snyder - - Implement a "generate-core-file" command in gdb, save target state. - * gcore.c: New file. Implement new command 'generate-core-file'. - Save a corefile image of the current state of the inferior. - * linux-proc.c: Add linux-specific code for saving corefiles. - * target.h (struct target_ops): Add new target vectors for saving - corefiles; to_find_memory_regions and to_make_corefile_notes. - (target_find_memory_regions): New macro. - (target_make_corefile_notes): New macro. - * target.c (update_current_target): Inherit new target methods. - (dummy_find_memory_regions): New place-holder method. - (dummy_make_corefile_notes): New place-holder method. - (init_dummy_target): Initialize new dummy target vectors. - * exec.c (exec_set_find_memory_regions): New function. - Allow the exec_ops vector for memory regions to be taken over. - (exec_make_note_section): New function, target vector method. - * defs.h (exec_set_find_memory_regions): Export prototype. - * procfs.c (proc_find_memory_regions): New function, corefile method. - (procfs_make_note_section): New function, corefile method. - (init_procfs_ops): Set new target vector pointers. - (find_memory_regions_callback): New function. - (procfs_do_thread_registers): New function. - (procfs_corefile_thread_callback): New function. - * sol-thread.c (sol_find_memory_regions): New function. - (sol_make_note_section): New function. - (init_sol_thread_ops): Initialize new target vectors. - * inftarg.c (inftarg_set_find_memory_regions): New function. - Allow to_find_memory_regions vector to be taken over. - (inftarg_set_make_corefile_notes): New function. - Allow to_make_corefile_notes vector to be taken over. - * thread-db.c (thread_db_new_objfile): Don't activate thread-db - interface layer if not target_has_execution (may be a corefile). - * config/i386/linux.mh: Add gcore.o to NATDEPFILES. - * config/sparc/sun4sol2.mh: Ditto. - * config/alpha/alpha-linux.mh: Ditto. - * config/arm/linux.mh: Ditto. - * config/i386/x86-64linux.mh: Ditto. - * config/ia64/linux.mh: Ditto. - * config/m68k/linux.mh: Ditto. - * config/mips/linux.mh: Ditto. - * config/powerpc/linux.mh: Ditto. - * config/sparc/linux.mh: Ditto. - -2002-01-07 Michael Snyder - - * arm-linux-nat.c: Remove references to regcache.c internal data - (registers[] and register_valid[]). - -2002-01-07 Michael Snyder - - * linux-proc.c: New file. Implement child_pid_to_exec_file, - so that attaching to a pid will automatically read the process's - symbol file and shlibs. - * Makefile.in: Add rule for linux-proc.o. - * config/nm-linux.h: Define CHILD_PID_TO_EXEC_FILE. - * config/alpha/alpha-linux.mh: Add linux-proc.o to NATDEPFILES. - * config/arm/linux.mh: Ditto. - * config/i386/linux.mh: Ditto. - * config/i386/x86-64linux.mh: Ditto. - * config/ia64/linux.mh: Ditto. - * config/m68k/linux.mh: Ditto. - * config/mips/linux.mh: Ditto. - * config/powerpc/linux.mh: Ditto. - * config/sparc/linux.mh: Ditto. - -2002-01-06 Pierre Muller - - * win32-nat.c: Add i386-tdep.h dependency. - -2002-01-07 Michael Snyder - - * solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT - instead of bfd_get_arch_size. Don't bail out just because - there's no exec_bfd. - - * cp-valprint.c (cp_print_value): FIXME comment, alloca size. - * p-valprint.c (pascal_object_print_value): Ditto. - * somread.c (som_symtab_read): Ditto. - * symfile.c (simple_free_overlay_region_table): Ditto. - * valops.c (value_assign): Ditto. - - * tracepoint.c (tracepoint_save_command): From Klee Dienes -- - use tilde_expand and strerror for opening save-tracepoints file. - - * thread-db.c (thread_db_new_objfile): Indendation fix. - - * infptrace.c (GDB_MAX_ALLOCA): New define. - (child_xfer_memory): Use xmalloc/xfree instead of alloca if the - size of the buffer exceeds GDB_MAX_ALLOCA (default 1 megabyte, - can be overridden with whatever value is appropriate to the host). - * infttrace.c (child_xfer_memory): Add FIXME warning about use of - alloca to allocate potentially large buffer. - * rs6000-nat.c (child_xfer_memory): Ditto. - * symm-nat.c (child_xfer_memory): Ditto. - * x86-64-linux-nat.c (child_xfer_memory): Ditto. - -2002-01-07 Jackie Smith Cashion - - From Nick Clifton - * d10v-tdep.c: Set STACK_START to 0x200bffe. - -2002-01-07 Michael Snyder - - * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): - Don't use exec_bfd if it's NULL. - -2002-01-06 Mark Kettenis - - * valops.c (value_arg_coerce): Fix formatting. - -2002-01-06 Andrew Cagney - - * hp-psymtab-read.c: Include "gdb_string.h" instead of . - * gnu-nat.c: Ditto. - -2002-01-06 Andrew Cagney - - * MAINTAINERS: Note that alpha-dec-osf4.0a, arc-elf, arm-coff, - arm-elf, arm-pe, d30v-elf, fr30-elf, h8300hms, h8500hms, - i960-coff, m32r-elf, m68k-elf, m88k, mcore-elf, mn10200-elf, - ns32k-netbsd, hppa1.1-hp-proelf, v850-elf, vax-dec-vms5.5 and - z8k-coff have not been multi-arched. Update z8k-coff build - status. - -2002-01-06 Andrew Cagney - - * MAINTAINERS: Mark a29k target as obsolete. - * Makefile.in (a29k-tdep.o, remote-adapt.o, remote-eb.o) - (remote-mm.o, remote-udi.o): Obsolete. Remove references in - comments. - * NEWS: Note that a29k targets are obsolete. - * a29k-tdep.c: Mark as obsolete. - * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, - a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and - a29k-*-vxworks* targets as obsolete. - * remote-adapt.c: Obsolete. - * remote-eb.c: Obsolete. - * remote-mm.c: Obsolete. - * remote-udi.c: Obsolete. - * config/a29k/a29k-udi.mt: Obsolete. - * config/a29k/a29k.mt: Obsolete. - * config/a29k/tm-a29k.h: Obsolete. - * config/a29k/tm-vx29k.h: Obsolete. - * config/a29k/vx29k.mt: Obsolete. - -2002-01-05 Andrew Cagney - - * rs6000-tdep.c (rs6000_do_registers_info): Replace BIG_ENDIAN - with BFD_ENDIAN_BIG. - -2002-01-05 Andrew Cagney - - * configure.in (AC_CHECK_HEADERS): Do not check for . - * configure, config.in: Re-generate. - * config/vax/xm-vaxbsd.h: Do not include . - * defs.h: Do not include . - -2002-01-05 Jason Thorpe - - * acconfig.h (HAVE_PT_GETXMMREGS): New. - * config.in: Regenerate. - * configure.in: Update copyright years. - Add test for PT_GETXMMREGS supplied by . - * configure: Regenerate. - * i386bsd-nat.c: Update copyright years. - (fill_gregset): Use regcache_collect. - (fetch_inferior_registers): Only fetch integer registers - if requested to do so. Add support for XMM registers - using PT_GETXMMREGS. - (store_inferior_registers): Only store integer registers - if requested to do so. Add support for XMM registers - using PT_SETXMMREGS. - * i386nbsd-nat.c (fetch_inferior_registers): Remove. - (store_inferior_registers): Remove. - (fetch_core_registers): Use supply_gregset and i387_supply_fsave. - (fetch_elfcore_registers): New function. - (i386nbsd_elfcore_fns): New. - (_initialize_i386nbsd_nat): Register i386nbsd_elfcore_fns. - * config/i386/nbsd.mh (NATDEPFILES): Add i387-nat.o and - i386bsd-nat.o. - * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. - * config/i386/nbsd.mt (TDEPFILES): Add i386bsd-nat.o. - * config/i386/nbsdelf.mt (TDEPFILES): Likewise. - * config/i386/tm-nbsd.h: Update copyright years. - (HAVE_SSE_REGS): Define. - (IN_SIGTRAMP): Define as i386bsd_in_sigtramp. - (SIGTRAMP_START): Redefine as i386bsd_sigtramp_start. - (SIGTRAMP_END): Redefine as i386bsd_sigtramp_end. - (SIGCONTEXT_PC_OFFSET): Remove. - (FRAME_SAVED_PC): Define as i386bsd_frame_saved_pc. - -2002-01-05 Andrew Cagney - - * configure.tgt: Remove powerpc-*-macos* target. - * config/m68k/xm-mpw.h: Delete file. - * config/xm-mpw.h: Delete file. - * ser-mac.c: Delete file. - * mpw-make.sed: Delete file. - * mpw-config.in: Delete file. - * mac-xdep.c: Delete file. - * mac-gdb.r: Delete file. - * mac-defs.h: Delete file. - * mac-nat.c: Delete file. - * config/powerpc/macos.mh: Delete file. - * config/powerpc/macos.mt: Delete file. - * config/powerpc/nm-macos.h: Delete file. - * config/powerpc/tm-macos.h: Delete file. - * source.c (openp, open_source_file): Remove obsolete code. - * top.c (gdb_readline): Ditto. - * utils.c (query): Ditto. - * event-top.c (display_gdb_prompt): Ditto. - * Makefile.in (ser-mac.o): Delete obsolete target. - * NEWS: Update. - -2002-01-04 Andrew Cagney - - * defs.h (BIG_ENDIAN): Delete macro definition. - * a29k-tdep.c, arch-utils.c, arm-tdep.c, ax-gdb.c, ch-exp.c, - coffread.c, cris-tdep.c, d10v-tdep.c, d30v-tdep.c, defs.h, - findvar.c, infcmd.c, mem-break.c, mips-tdep.c, mn10300-tdep.c, - printcmd.c, remote-os9k.c, remote-rdi.c, remote-rdp.c, - remote-sim.c, remote.c, rs6000-tdep.c, sh-tdep.c, sparcl-tdep.c, - stabsread.c, valops.c, valprint.c, config/a29k/tm-a29k.h, - config/a29k/tm-vx29k.h, config/arm/tm-arm.h, - config/d30v/tm-d30v.h, config/fr30/tm-fr30.h, - config/h8300/tm-h8300.h, config/h8500/tm-h8500.h, - config/m32r/tm-m32r.h, config/m68k/tm-m68k.h, - config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h, - config/sparc/tm-sparc.h, config/z8k/tm-z8k.h, mi/mi-cmd-disas.c, - mi/mi-main.c: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. - * gdbarch.sh: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. - * gdbarch.c: Re-generate. - -2002-01-04 Daniel Jacobowitz - - * thread-db.c (thread_db_new_objfile): Do not enable thread_db - for core files. - -2002-01-04 Jason Thorpe - - * config/arm/nbsd.mh (XDEPFILES): Remove ser-tcp.o. - -2002-01-04 Andrew Cagney - - * value.h (value_ptr): Delete typedef. - -2002-01-04 Jason Thorpe - - * i386nbsd-nat.c: Update copyright years. - Include i386-tdep.h. - -2002-01-04 Elena Zannoni - - * stabsread.c: Update copyright years. - - From Debashis Mahata : - (read_struct_fields): Deal with Sun C compiler erroneous stab - output for structs and unions. - Fix PR gdb/269. - -2002-01-04 Daniel Jacobowitz - - * p-valprint.c: Include "cp-abi.h" for baseclass_offset - prototype. - -2002-01-04 Daniel Jacobowitz - - * cp-abi.c: Fix whitespace. - (baseclass_offset): New wrapper function. - * cp-abi.h (baseclass_offset): Add prototype. - (struct cp_abi_ops): Add baseclass_offset pointer. - - * valops.c (vb_match): Move to... - * gnu-v2-abi.c (vb_match): here. - * valops.c (baseclass_offset): Move to... - * gnu-v2-abi.c (gnuv2_baseclass_offset): here, and rename. - - * gnu-v3-abi.c (gnuv3_baseclass_offset): New function. - - * gnu-v2-abi.c (init_gnuv2_ops): Initialize baseclass_offset. - * gnu-v3-abi.c (init_gnuv3_ops): Likewise. - * hpacc-abi.c (init_hpacc_ops): Likewise. - -2002-01-04 Daniel Jacobowitz - - * valops.c (find_overload_match): Accept obj as a - reference parameter. Update it before returning. - * value.h (find_overload_match): Update prototype. - * eval.c (evaluate_subexp_standard): Pass object to - find_overload_match by reference. - -2002-01-03 Andrew Cagney - - * valarith.c: Replace value_ptr with struct value pointer. Remove - register attribute from value declarations. - * valops.c: Ditto. - * value.h: Ditto. - * scm-lang.c (scm_lookup_name): Ditto. - -2002-01-03 Michael Snyder - - Abstract the functionality of iterating over mapped memory - regions into a general purpose iterator function. - * procfs.c (iterate_over_mappings): New function, general purpose - iterator for memory sections. - (proc_iterate_over_mappings): Reimplement using iterate_over_mappings. - (solib_mappings_callback): New function, callback for above. - (info_proc_mappings): Reimpliment using iterate_over_mappings. - (info_mappings_callback): New function, callback for above. - - * procfs.c (proc_set_watchpoint): Add cast to suppress warning. - -2002-01-01 Mark Kettenis - - * i386-tdep.h (struct gdbarch_tdep): Add `os_ident' member. - * i386-tdep.c: Include "elf-bfd.h". - (process_note_abi_tag_sections): New function. - (i386_gdbarch_init): Add code to recognize various OS/ABI - combinations. - - * maint.c (_initialize_maint_cmds): Add missing \ in - string-literal. - -For older changes see ChangeLog-2001 +For older changes see ChangeLog-2002 Local Variables: mode: change-log diff --git a/gdb/ChangeLog-2002 b/gdb/ChangeLog-2002 new file mode 100644 index 0000000..ad2cfda --- /dev/null +++ b/gdb/ChangeLog-2002 @@ -0,0 +1,15039 @@ +2002-12-31 Mark Kettenis + + * gdb_dirent.h: Cleanup and update code to match the example in + the Autoconf manual. + * configure.in: Call AC_HEADER_DIRENT. Remove dirent.h, + sys/ndir.h, sys/dir.h and ndir.h from call to AC_CHECK_HEADERS. + * configure: Regenerated. + +2002-12-30 Adam Fedor + + * objc-exp.y (parse_number): Cast sscanf arguments to proper type. + (yylex): Initialize c to avoid uninitialized warning. + +2002-12-29 Kazu Hirata + + * doc/fdl.texi: Revert the last change. + +2002-12-29 Mark Kettenis + + * tracepoint.c (ISATTY): Removed. + +2002-12-26 J. Brobecker + + Continuing work to convert the hppa targets to multiarch partil. + + * hppa-tdep.c: Add some missing forward declarations. + (frameless_function_invocation): Prefix the function name + by "hppa_" to avoid polluting the namespace. Update all calls + to use the new function name. + (saved_pc_after_call): Ditto. + (init_extra_frame_info): Ditto. + (frame_chain): Ditto. + (push_dummy_frame): Ditto. + (target_read_pc): Ditto. + (target_write_pc): Ditto. + (in_solib_call_trampoline): Ditto. + (in_solib_return_trampoline): Ditto. + (skip_trampoline_code): Ditto. + (hppa_read_fp): New function, renamed from target_read_fp. + (hppa_target_read_fp): New function, using hppa_read_fp. + This function conforms to the function profile for the + READ_FP gdbarch method. + (hppa_extract_struct_value_address): New function, extracted + from the definition of the DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS + macro. + (hppa_frame_num_args): New function. + (hppa_gdbarch_init): Setup the gdbarch vector for the hppa target. + + * config/pa/tm-hppa.h: Wrap around all gdbarch-eligible macros + inside "#if !GDB_MULTI_ARCH ... #endif" conditional, in preparation + for the switch to multiarch partial. + Update some of the macros definitions to match some changes + described above in the name of the function they are calling. + (PUSH_DUMMY_FRAME): Add a FIXME explaining why this macro will + not be straightforward to convert. Do now wrap it inside + "#if !... #endif" to remember that this macro has still not + been taken care of. + (FIX_CALL_DUMMY): Likewise. + +2002-12-26 J. Brobecker + + Continuing work to convert the hppa targets to multiarch partial. + + * hppa-tdep.c (hppa_register_raw_size): New function replacing + the body of macro REGISTER_RAW_SIZE. + * hppa-hpux-tdep.c: Add new functions replacing macro bodies from + config/pa/tm-hppah.h. These functions will be used to initialize + the gdbarch structure. + (hppa_hpux_pc_in_sigtramp): New function. + (hppa_hpux_frame_saved_pc_in_sigtramp): New function. + (hppa_hpux_frame_base_before_sigtramp): New function. + (hppa_hpux_frame_find_saved_regs_in_sigtramp): New function. + Add gdbcore.h #include. + * config/pa/tm-hppa.h (REGISTER_RAW_SIZE): Change the definition + of this gdbarch-eligible macro to a call to the new associated + function. + * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Likewise. + (FRAME_SAVED_PC_IN_SIGTRAMP): Change the definition of this macro + into a call to the new associated function. + (FRAME_BASE_BEFORE_SIGTRAMP): Likewise. + (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP): Likewise. + * Makefile.in (hppa-hpux-tdep.o): Add dependency on gdbcore.h. + +2002-12-24 David Carlton + + * config/sparc/tm-sparc.h: Delete duplicate definition of + DEPRECATED_PC_IN_CALL_DUMMY. + +2002-12-24 Kevin Buettner + + * Makefile.in (mips-linux-tdep.o): Add $(mips_tdep_h) and + $(gdb_assert_h). + * configure.tgt: Recognize mips64*-*-linux*. + * mips-linux-tdep.c (mips-tdep.h, gdb_assert.h): Include. + (supply_32_bit_reg): New function. + (supply_gregset): Call supply_32bit_reg() instead of supply_register(). + (fill_gregset): Use regcache_collect() instead of + deprecated_registers[]. + (register_addr): Change name to mips_linux_register_addr(). + (MIPS64_ELF_NGREG, MIPS64_ELF_NFPREG, MIPS64_FPR_BASE, MIPS64_PC) + (MIPS64_CAUSE, MIPS64_BADVADDR, MIPS64_MMHI, MIPS64_MMLO) + (MIPS64_FPC_CSR, MIPS64_FPC_EIR, MIPS64_EF_REG0, MIPS64_EF_REG31) + (MIPS64_EF_LO, MIPS64_EF_HI, MIPS64_EF_CP0_EPC, MIPS64_EF_CP0_BADVADDR) + (MIPS64_EF_CP0_STATUS, MIPS64_EF_CP0_CAUSE, MIPS64_EF_SIZE) + (MIPS64_LINUX_JB_PC): New defines. + (mips64_elf_greg_t, mips64_elf_gregset_t, mips64_elf_fpreg_t) + (mips64_elf_fpregset_t): New typedefs. + (mips64_linux_get_longhmp_target, mips64_supply_gregset) + (mips64_fill_gregset, mips64_supply_fpregset, mips64_fill_fpregset) + (mips64_linux_register_addr, set_mips_linux_register_addr) + (register_addr, mips64_linux_svr4_fetch_link_map_offsets): + (init_register_addr_data) + New functions. + (fetch_core_registers): Add support for core file formats with 64-bit + registers. + (mips_linux_init_abi): Distinguish o32, n32, and n64 ABIs. + (register_addr_data): New static global variable. + (_initialize_mips_linux_tdep): Initialize register_addr_data. Invoke + gdbarch_register_osabi() for each MIPS machine. + * config/mips/linux64.mt: New file. + * config/mips/tm-linux64.h: New file. + +2002-12-23 Adam Fedor + + * maint.c (maintenance_demangle): Add switch to demangle + ObjC language symbols as well. + +2002-12-23 Adam Fedor + + * objc-lang.c (lookup_objc_class, lookup_child_selector): Remove + last argument from complaint function call. + +2002-12-23 Kevin Buettner + + * exec.c (print_section_info): Add FIXME comments regarding format + string choices. + +2002-12-23 Daniel Jacobowitz + + * config/pa/nm-hppab.h: Delete duplicate CANNOT_STORE_REGISTER decl. + * config/pa/nm-hppao.h: Delete duplicate CANNOT_STORE_REGISTER decl. + +2002-12-23 Rodney Brown + + * config/pa/nm-hppah.h: Delete duplicate CANNOT_STORE_REGISTER decl. + +2002-12-23 David Carlton + + * symtab.c (lookup_symbol_aux): Delete 'force_return' variable. + (lookup_symbol_aux_minsyms): Delete 'force_return' argument. + (search_symbols): Call lookup_symbol_aux_minsyms to find debugging + information associated to a minsym, not lookup_symbol. + +2002-12-21 Mark Kettenis + + * x86-64-tdep.h (x86_64_init_abi): New prototype. + * x86-64-tdep.c (i386_fp_regnum_p): Remove function. + (x86_64_init_abi): Make non-static. Set number of pseudo + registers to 0. + (x86_64_gdbarch_init): Remove function. + (_initialize_x86_64_tdep): Renove register_gdbarch_init call. + Remove code dealing with dissambly. + * x86-64-linux-tdep.c (x86_64_linux_init_abi): New function. + (_initialize_x86_64_linux_tdep): New function. + * config/i386/x86-64linux.mt (TDEPFILES): Add i386-tdep.o and + i386-tdep.o. + +2002-12-14 Mark Kettenis + + * osabi.c: Include "gdb_assert.h" and "gdb_string.h". + (struct gdb_osabi_handler): Remove member `arch'. Add member + `arch_info'. + (gdbarch_register_osabi): Add new argument `machine'. Use ot to + construct a `struct bfd_arch_info' and store it in the `struct + gdb_osabi_handler' that is created. + (gdbarch_init_osabi): Check for compatibility based on machine + type and architecture. + * osabi.h (gdbarch_register_osabi): Adjust prototype and update + comment. + * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as + second argument in call to gdbarch_register_osabi. + * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. + * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. + * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. + * arm-tdep.c (_initialize_arm_tdep): Likewise. + * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. + * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. + * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. + * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. + * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. + * i386-tdep.c (_initialize_i386_tdep): Likewise. + * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. + * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. + * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from + _initialize_i386bsd_tdep and updated likewise. + * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. + * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. + * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. + * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. + * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. + * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. + * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. + * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. + * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. + * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise. + +2002-12-20 Kevin Buettner + + * solib-svr4.c (elf_locate_base): Fix sizeof() related bug. Add + DT_MIPS_RLD_MAP case for 64-bit targets. + +2002-12-20 Kevin Buettner + + * mips-tdep.c (heuristic_proc_desc): Clear memory associated with + ``temp_saved_regs'', not the pointer or other storage contiguous + to this pointer. + +2002-12-20 Kevin Buettner + + * Makefile.in (mips-linux-tdep.o): Add $(osabi_h) and $(gdb_string_h). + * config/mips/tm-linux.h (mips_linux_svr4_fetch_link_map_offsets) + (mips_linux_get_longjmp_target): Delete declarations. + (SVR4_FETCH_LINK_MAP_OFFSETS, GET_LONGJMP_TARGET) + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Delete definitions. + * mips-linux-tdep.c (osabi.h, gdb_string.h): Include. + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Define. + (mips_linux_get_longjmp_target) + (mips_linux_svr4_fetch_link_map_offsets): Make static. + (mips_linux_init_abi): New function. + (_initialize_mips_linux_tdep): Register mips_linux_init_abi(). + +2002-12-19 Keith Seitz + + patch committed by Elena Zannoni + * thread.c (do_captured_list_thread_ids): Call prune_threads and + target_find_new_threads. Fix for PR mi/669. + +2002-12-19 David Carlton + + * linespec.c (decode_line_1): Move code into decode_all_digits. + (decode_all_digits): New function. + +2002-12-19 Kevin Buettner + + * exec.c (print_section_info): Select a format string to use with + local_hex_string_custom() based upon the value of TARGET_ADDR_BIT. + +2002-12-18 Andrew Cagney + + * frame.c (deprecated_update_current_frame_pc_hack): Replace + deprecated_update_current_frame_pc_hack. + (deprecated_update_frame_base_hack): New function. + * frame.h (deprecated_update_frame_pc_hack): Replace + (deprecated_update_frame_base_hack): Declare. + * infrun.c (normal_stop): Update. + +2002-12-18 Andrew Cagney + + * rs6000-tdep.c (rs6000_init_extra_frame_info): Use + frame_extra_info_zalloc. + (rs6000_frame_args_address): Use get_frame_extra_info. + (frame_get_saved_regs): Use get_frame_saved_regs. + (frame_initial_stack_address): Use get_frame_saved_regs and + get_frame_extra_info. + (frame_initial_stack_address): Use get_frame_extra_info. + +2002-12-17 Kevin Buettner + + * dve3900-rom.c (r3900_regnames): Don't use NUM_REGS to determine + array size. + (fetch_bitmapped_register, store_bitmapped_register): Add bounds + checks for r3900_regnames[]. + +2002-12-17 Richard Earnshaw + + * armnbsd-tdep.c (ARM_NBSD_JB_PC): Renamed from JB_PC. + All uses changed + (ARM_NBSD_JB_ELELMENT_SIZE): Similarly. + +2002-12-17 David Carlton + + * symtab.c (lookup_partial_symbol): Don't search past the end of + the partial symbols. + +2002-12-17 Andrew Cagney + + * stack.c (frame_info): Use get_frame_saved_regs. + * breakpoint.c (until_break_command): Use get_frame_pc. + +2002-12-16 Kevin Buettner + + * buildsym.c (block_end_complaint, anon_block_end_complaint) + (innerblock_complaint, innerblock_anon_complaint) + (blockvector_complaint): Delete deprecated complaint structs. + (finish_block, make_blockvector, end_symtab): Replace calls + to complain() with calls to complaint(). + * coffread.c (ef_complaint, ef_stack_complaint, eb_stack_complaint) + (bf_no_aux_complaint, ef_no_aux_complaint, lineno_complaint) + (unexpected_type_complaint, bad_sclass_complaint) + (misordered_blocks_complaint, tagndx_bad_complaint, eb_complaint): + Delete deprecated complaint structs. + (coff_symtab_read, enter_linenos, decode_type, decode_base_type): + Replace calls to complain() with calls to complaint(). + * dbxread.c (lbrac_complaint, string_table_offset_complaint) + (unknown_symtype_complaint, unknown_symchar_complaint) + (lbrac_rbrac_complaint, lbrac_unmatched_complaint) + (lbrac_mismatch_complaint, repeated_header_complaint) + (unclaimed_bincl_complaint, discarding_local_symbols_complaint): + Delete deprecated complaint structs. + (unknown_symtype_complaint, lbrac_mismatch_complaint) + (repeated_header_complaint) + (function_outside_compiliation_unit_complaint): New functions. + (add_old_header_file, find_corresponding_bincl_psymtab) + (set_namestring, find_stab_function_addr, read_dbx_symtab) + (process_one_symbol): Replace calls to complain() with, possibly + indirect, calls to complaint(). + * dwarfread.c (no_bfd_get_N, malformed_die, bad_die_ref) + (unknown_attribute_form, unknown_attribute_length) + (unexpected_fund_type, unknown_type_modifier, volatile_ignored) + (const_ignored, botched_modified_type, op_deref2, op_deref4) + (basereg_not_handled, dup_user_type_allocation) + (dup_user_type_definition, missing_tag, bad_array_element_type) + (subscript_data_items, unhandled_array_subscript_format) + (unknown_array_subscript_format, not_row_major) + (missing_at_name): Delete deprecated complaint structs. + (bad_die_ref_complaint, unknown_attribute_form_complaint) + (dup_user_type_definition_complaint) + (bad_array_element_type_complaint): New functions. + (lookup_utype, alloc_utype, struct_type, decode_array_element_type) + (decode_subscript_data_item, dwarf_read_array_type) + (read_tag_string_type, read_subroutine_type, read_func_scope) + (locval, scan_partial_symbols, decode_modified_type) + (decode_func_type, basicdieinfo, completeddieinfo, target_to_host) + (attribute_size): Replace calls to complain() with, possibly + indirect, calls to complaint(). + * elfread.c (section_info_complaint, section_info_dup_complaint) + (stab_info_mismatch_complaint, stab_info_questionable_complaint): + Delete deprecated complaint structs. + (elf_symtab_read, elfstab_offset_sections): Replace calls to + complain() with calls to complaint(). + * gdbtypes.c (stub_noname_complaint): Delete deprecated complaint + struct. + (stub_noname_complaint): New function. + (check_typedef, add_mangled_type): Replace calls to complain() + with calls to complaint(). + * hpread.c (string_table_offset_complaint, lbrac_unmatched_complaint) + (lbrac_mismatch_complaint, hpread_unhandled_end_common_complaint) + (hpread_unhandled_type_complaint, hpread_struct_complaint) + (hpread_array_complaint, hpread_type_lookup_complaint) + (hpread_unexpected_end_complaint, hpread_tagdef_complaint) + (hpread_unhandled_common_complaint) + (hpread_unhandled_blockdata_complaint): Delete deprecated complaint + struct definitions and declarations. + (lbrac_unmatched_complaint, lbrac_mismatch_complaint): New functions. + (SET_NAMESTRING, hpread_type_lookup, hpread_process_one_debug_symbol): + Replace calls to complain() with, possibly indirect, calls to + complaint(). + * macrotab.c (macro_include, check_for_redefinition, macro_undef): + Likewise. + * mdebugread.c (bad_file_number_complaint, index_complaint) + (aux_index_complaint, block_index_complaint) + (unknown_ext_complaint, unknown_sym_complaint) + (unknown_st_complaint, block_overflow_complaint) + (basic_type_complaint, unknown_type_qual_complaint) + (array_index_type_complaint, bad_tag_guess_complaint) + (block_member_complaint, stEnd_complaint) + (unknown_mdebug_symtype_complaint, stab_unknown_complaint) + (pdr_for_nonsymbol_complaint, pdr_static_symbol_complaint) + (bad_setjmp_pdr_complaint, bad_fbitfield_complaint) + (bad_continued_complaint, bad_rfd_entry_complaint) + (unexpected_type_code_complaint, unable_to_cross_ref_complaint) + (bad_indirect_xref_complaint, illegal_forward_tq0_complaint) + (illegal_forward_bt_complaint, bad_linetable_guess_complaint) + (bad_ext_ifd_complaint, bad_ext_iss_complaint): Delete deprecated + complaint structs. + (index_complaint, unknown_ext_complaint, basic_type_complaint) + (bad_tag_guess_complaint, bad_rfd_entry_complaint) + (unexpected_type_code_complaint) + (function_outside_compilation_unit_complaint): New functions. + (parse_symbol, parse_type, upgrade_type, parse_procedure) + (parse_partial_symbols, psymtab_to_symtab_1, cross_ref, add_symbol): + Replace calls to complain() with, possibly indirect calls to + complaint(). + * objc-lang.c (noclass_lookup_complaint, nosel_lookup_complaint): + Delete deprecated complaint structs. + (lookup__objc_class, lookup_child_selector): Replace complain() + with complaint(). + * remote-vx.c (cant_contact_target): Delete deprecated complaint + struct. + (vx_lookup_symbol): Replace complain() with complaint(). + * stabsread.c (invalid_cpp_abbrev_complaint) + (invalid_cpp_type_complaint, member_fn_complaint) + (const_vol_complaint, error_type_complaint) + (invalid_member_complaint, range_type_base_complaint) + (reg_value_complaint, vtbl_notfound_complaint) + (unrecognized_cplus_name_complaint, rs6000_builtin_complaint) + (unresolved_sym_chain_complaint, stabs_general_complaint) + (lrs_general_complaint, multiply_defined_struct): Delete + deprecated complaint structs. + (invalid_cpp_abbrev_complaint, ref_value_complaint) + (stabs_general_complaint, lrs_general_complaint) + (msg_unknown_complaint): New functions. + (dbx_lookup_type, read_cfront_baseclasses) + (read_cfront_member_functions, resolve_symbol_reference) + (define_symbol, resolve_live_range, add_live_range, read_type) + (rs6000_builtin_type, read_member_functions, read_cpp_abbrev) + (read_one_struct_field, read_baseclasses, read_tilde_fields) + (read_cfront_static_fields, attach_fields_to_type) + (complain_about_struct_wipeout, read_range_type) + (common_block_start, common_block_end, cleanup_undefined_types) + (scan_file_globals): Replace complain() with complaint(). + * stabsread.h (unknown_symtype_complaint, unknown_symchar_complaint): + Delete deprecated complaint struct declarations. + * xcoffread.c (storclass_complaint, bf_notfound_complaint) + (ef_complaint, eb_complaint): Delete deprecated complaint structs. + (bf_not_found_complaint, ef_complaint, eb_complaint) + (function_outside_compilation_unit_complaint): New functions. + (record_include_begin, record_include_end, enter_line_range) + (xcoff_next_symbol_text, read_xcoff_symtab, process_xcoff_symbol) + (read_symbol, read_symbol_lineno, scan_xcoff_symtab) Replace + complain() with complaint(). + +2002-12-16 Andrew Cagney + + * config/arc/arc.mt, config/arc/tm-arc.h: Delete. + * config/d30v/d30v.mt, config/d30v/tm-d30v.h: Delete. + * config/fr30/fr30.mt, config/fr30/tm-fr30.h: Delete. + * config/i386/i386aix.mh, config/i386/i386aix.mt: Delete. + * config/i386/i386m3.mh, config/i386/i386m3.mt: Delete. + * config/i386/i386mach.mh, config/i386/i386os9k.mt: Delete. + * config/i386/nm-i386aix.h, config/i386/nm-i386mach.h: Delete. + * config/i386/nm-m3.h, config/i386/tm-i386aix.h: Delete. + * config/i386/tm-i386m3.h, config/i386/tm-i386mk.h: Delete. + * config/i386/xm-i386aix.h, config/i386/xm-i386m3.h: Delete. + * config/i386/xm-i386mach.h, config/i386/xm-i386mk.h: Delete. + * config/i960/mon960.mt, config/i960/nindy960.mt: Delete. + * config/i960/tm-i960.h, config/i960/tm-mon960.h: Delete. + * config/i960/tm-nindy960.h, config/i960/tm-vx960.h: Delete. + * config/i960/vxworks960.mt, config/m68k/apollo68b.mh: Delete. + * config/m68k/apollo68b.mt, config/m68k/apollo68v.mh: Delete. + * config/m68k/hp300bsd.mh, config/m68k/hp300bsd.mt: Delete. + * config/m68k/hp300hpux.mh, config/m68k/hp300hpux.mt: Delete. + * config/m88k/delta88.mh, config/m88k/delta88.mt: Delete. + * config/m88k/delta88v4.mh, config/m88k/delta88v4.mt: Delete. + * config/m88k/m88k.mh, config/m88k/m88k.mt: Delete. + * config/m88k/nm-delta88v4.h, config/m88k/nm-m88k.h: Delete. + * config/m88k/tm-delta88.h, config/m88k/tm-delta88v4.h: Delete. + * config/m88k/tm-m88k.h, config/m88k/xm-delta88.h: Delete. + * config/m88k/xm-dgux.h: Delete. + * fr30-tdep.c, i386aix-nat.c, i386m3-nat.c: Delete. + * i386mach-nat.c, i960-tdep.c, m88k-nat.c: Delete. + * os9kread.c, remote-bug.c, remote-nindy.c: Delete. + * remote-nrom.c, remote-os9k.c, remote-vx960.c: Delete. + * d30v-tdep.c, arc-tdep.c, cxux-nat.c, dst.h, dstread.c: Delete. + * ch-exp.c, ch-lang.c, ch-lang.h, ch-typeprint.c: Delete. + * ch-valprint.c: Delete. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Rearrange code to resume if + no catchpoint triggers for an event. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED + and TARGET_WAITKIND_VFORKED cases. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Assume that catchpoints + are not affected by DECR_PC_AFTER_BREAK. + +2002-12-15 Daniel Jacobowitz + + * target.c (update_current_target): Don't inherit DONT_USE. + * target.h (struct target_ops): Remove DONT_USE. + (target_next): Remove macro. + +2002-12-15 Mark Kettenis + + * ui-out.c (MAX_UI_OUT_LEVELS): Raise to 6. Fixes PR cli/654. + +2002-12-14 Richard Earnshaw + + * arm-tdep.c (convert_from_extended): New argument to hold the + type of floating point result we want to convert to. Make input + argument const. Fix all callers. + (convert_to_extended): Similarly. + (arm_extract_return_value): Now takes a regcache argument. Change + code to use regcache accessor functions. Correctly extract + smaller-than-word results on big-endian machines. + (arm_store_return_value): Now takes a regcache argument. Change + code to use regcache accessor functions. Correctly zero/sign extend + smaller than word results before storing into r0. + (arm_gdbarch_init): Register new-style extract_return_value and + store_return_value functions. + +2002-12-13 Michael Snyder + + * thread-db.c (thread_from_lwp): Uniquify error msg. + (lwp_from_thread): Ditto. + (check_event): Ditto. + (find_new_threads_callback): Ditto. + (thread_db_pid_to_str): Ditto. + +2002-12-13 Andrew Cagney + + * frame.h (get_frame_saved_regs): Declare. + (frame_saved_regs_zalloc): Change return type to CORE_ADDR + pointer. + * frame.c (get_frame_saved_regs): New function. + (frame_saved_regs_zalloc): Return the allocated saved_regs. + +2002-12-13 Andrew Cagney + + * frame.c (deprecated_update_current_frame_pc_hack): New + function. + * frame.h (deprecated_update_current_frame_pc_hack): Declare. + * infrun.c (normal_stop): Use said function instead of directly + modifying the frame's PC. + +2002-12-13 Alexandre Oliva + + * frame.h (frame_id_unwind_ftype): Fix typo in return type. + +2002-12-13 Kevin Buettner + + * config/mips/tm-mips.h, config/mips/tm-irix3.h, + config/mips/tm-irix6.h (NUM_REGS): Delete. + * mips-tdep.c (mips_gdbarch_init): Call set_gdbarch_num_regs(). + (temp_saved_regs): Declare as a pointer rather than an array. + (mips32_heuristic_proc_desc, heuristic_proc_desc): Make sure + that ``temp_saved_regs'' has storage allocated to it and that + it's the correct size. + +2002-12-13 Jeff Johnston + + * defs.h (init_last_source_visited): New prototype. + (add_path): Ditto. + * source.c (add_path): New function that adds to a specified path. + (mod_path): Change to call add_path. + (init_last_source_visited): New function to allow interfaces to + initialize static variable: last_source_visited. Part of fix + for PR gdb/741. + * Makefile.in: Add support for mi/mi-cmd-env.c. + +2002-12-13 Andrew Cagney + + * frame.h (frame_id_unwind): Declare. + (struct frame_info): Add fields id_unwind, id_unwind_cache_p and + id_unwind_cache. + (frame_id_unwind_ftype): Declare. + * frame.c (frame_id_unwind): New function. + (set_unwind_by_pc): Add unwind_id parameter. Initialized. + (create_new_frame, get_prev_frame): Pass id_unwind to + set_unwind_by_pc. + (frame_saved_regs_id_unwind): New function. + (frame_saved_regs_id_unwind): New function. + * dummy-frame.c (dummy_frame_id_unwind): New function. + (struct dummy_frame): Add field id. + (generic_push_dummy_frame): Initialize `id'. + * dummy-frame.h (dummy_frame_id_unwind): Declare. + +2002-12-13 Andrew Cagney + + * infcmd.c (run_stack_dummy): Create a frame ID directly and then + pass that to set_momentary_breakpoint. Move comments to where they + belong. + * frame.h (set_current_frame): Delete declaration. + * frame.c (set_current_frame): Delete function. + +2002-12-13 Andrew Cagney + + * frame.c (frame_extra_info_zalloc): New function. + * frame.h (frame_extra_info_zalloc): Declare. + +2002-12-13 Joel Brobecker + + * hppa-tdep.c (hppa_pop_frame): Fix a compilation error introduced + in the previous prototype change to set_momentary_breakpoint. + +2002-12-12 Daniel Jacobowitz + + * infrun.c (pending_follow): Remove saw_parent_fork, saw_child_fork, + and saw_child_exec. + (follow_fork, init_wait_for_inferior, handle_inferior_event): Remove + references to saw_parent_fork, saw_child_fork, and saw_child_exec. + (stop_stepping): Remove outdated check for child vfork events. + +2002-12-12 Andrew Cagney + + * GDB 5.3 released from gdb_5_3-branch. + +2002-12-11 Daniel Jacobowitz + + * corelow.c (init_core_ops): Delete references to to_require_attach + and to_require_detach. + * exec.c (init_exec_ops): Likewise. + * hppah-nat.c (child_follow_fork): Call hppa_require_attach and + hppa_require_detach directly. + * inferior.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. + * inftarg.c (child_detach): Remove. + (child_detach_from_process): Rename to child_detach, remove + after_fork argument. + (child_attach): Remove. + (child_attach_to_process): Rename to child_attach, remove after_fork + argument. + (init_child_ops): Delete references to to_require_attach + and to_require_detach. + * infttrace.c (hppa_require_attach): Update comment. + * target.c (cleanup_target, update_current_target) + (init_dummy_target, setup_target_debug): Delete references to + to_require_attach and to_require_detach. + (find_default_require_detach, find_default_require_attach) + (debug_to_require_attach, debug_to_require_detach): Remove + functions. + * target.h (struct target_ops): Remove to_require_attach + and to_require_detach. + (target_require_attach, target_require_detach): Delete macros. + (find_default_require_detach, find_default_require_attach): Delete + prototypes. + * config/pa/nm-hppah.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. + +2002-12-11 Andrew Cagney + + * frame.c (get_frame_extra_info): New function. + * frame.h (get_frame_extra_info): Declare. + +2002-12-11 Andrew Cagney + + * breakpoint.h (struct breakpoint): Replace frame with frame_id. + (set_momentary_breaokpoint): Replace `struct frame_info' parameter + with `struct frame_id'. + (set_longjmp_resume_breakpoint): Ditto. + * infrun.c (handle_inferior_event): Update. + * breakpoint.c (watch_command_1, until_break_command): Update. + * infrun.c (handle_inferior_event, check_sigtramp2): Update. + (handle_inferior_event, step_over_function): Update. + * breakpoint.c (bpstat_stop_status, print_one_breakpoint): Update. + (set_raw_breakpoint, set_longjmp_resume_breakpoint): Update. + (set_momentary_breakpoint, deprecated_frame_in_dummy): Update. + * infcmd.c (finish_command, run_stack_dummy): Update. + +2002-12-11 Kevin Buettner + + * dwarf2read.c (dwarf2_const_ignored, dwarf2_volatile_ignored) + (dwarf2_non_const_array_bound_ignored) + (dwarf2_missing_line_number_section) + (dwarf2_statement_list_fits_in_line_number_section) + (dwarf2_mangled_line_number_section, dwarf2_unsupported_die_ref_attr) + (dwarf2_unsupported_stack_op, dwarf2_complex_location_expr) + (dwarf2_unsupported_tag, dwarf2_unsupported_at_encoding) + (dwarf2_unsupported_at_frame_base, dwarf2_unexpected_tag) + (dwarf2_missing_at_frame_base, dwarf2_bad_static_member_name) + (dwarf2_unsupported_accessibility, dwarf2_bad_member_name_complaint) + (dwarf2_missing_member_fn_type_complaint) + (dwarf2_vtbl_not_found_complaint, dwarf2_absolute_sibling_complaint) + (dwarf2_const_value_length_mismatch) + (dwarf2_unsupported_const_value_attr, dwarf2_misplaced_line_number) + (dwarf2_line_header_too_long, dwarf2_missing_macinfo_section) + (dwarf2_macros_too_long, dwarf2_macros_not_terminated) + (dwarf2_macro_outside_file, dwarf2_macro_unmatched_end_file) + (dwarf2_macro_malformed_definition, dwarf2_macro_spaces_in_definition) + (dwarf2_invalid_attrib_class, dwarf2_invalid_pointer_size): Delete + complaints using deprecated struct.. + (dwarf2_non_const_array_bound_ignored_complaint) + (dwarf2_complex_location_expr_complaint) + (dwarf2_unsupported_at_frame_base_complaint) + (dwarf2_const_value_length_mismatch_complaint) + (dwarf2_macros_too_long_complaint) + (dwarf2_macro_malformed_definition_complaint) + (dwarf2_invalid_attrib_class_complaint): New functions. + (read_func_scope, dwarf2_attach_fields_to_type, dwarf2_add_member_fn) + (read_structure_scope, read_array_type, read_common_block) + (read_tag_pointer_type, read_base_type, read_partial_die) + (dwarf_decode_line_header, check_cu_functions, dwarf_decode_lines) + (new_symbol, dwarf2_const_value, read_type_die) + (dwarf2_get_ref_die_offset, decode_locdesc, consume_improper_spaces) + (parse_macro_definition, dwarf_decode_macros): Replace calls to + complain() with, possibly indirect, calls to complaint(). + +2002-12-11 Andrew Cagney + + * frame.c (deprecated_get_frame_saved_regs): Rename + get_frame_saved_regs. + * frame.h (deprecated_get_frame_saved_regs): Update declaration. + * sparc-tdep.c: Update. + * hppa-tdep.c: Update. + * h8500-tdep.c: Update. + +2002-12-11 Kevin Buettner + + * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME) + (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of + ``char *'' for return and parameter types. + * gdbarch.h, gdbarch.c: Regenerate. + * gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change + return type from ``char *'' to ``const char *''. + * c-typeprint.c (c_type_print_modifier): Make ``address_space_id'' + const. + +2002-12-11 Mark Kettenis + + * i386-tdep.c: Include "dummy-frame.h". + (i386_frame_chain, i386_frame_saved_pc): Replace + DEPRECATED_PC_IN_CALL_DUMMY with call to pc_in_dummy_frame. + (i386_gdbarch_init): Don't set deprecated_pc_in_call_dummy. + +2002-12-10 Andrew Cagney + + * gdbarch.sh (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. + Change to a function with predicate. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (get_prev_frame): Update. Test + DEPRECATED_INIT_FRAME_PC_P. + * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC): Update. + * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC): Update. + * config/mn10200/tm-mn10200.h (DEPRECATED_INIT_FRAME_PC): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * i386-interix-tdep.c (i386_interix_init_abi): Update. + * arm-tdep.c: Update comments. + * h8300-tdep.c (h8300_gdbarch_init): Explicitly set init_frame_pc. + * config/m32r/tm-m32r.h (DEPRECATED_INIT_FRAME_PC): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * x86-64-tdep.c (x86_64_init_abi): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * vax-tdep.c (vax_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * config/z8k/tm-z8k.h (INIT_FRAME_PC_FIRST): Delete macro. + (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. + +2002-12-10 Daniel Jacobowitz + + * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_VFORK): Change to + CHILD_FOLLOW_FORK. + * hppah-nat.c (saved_vfork_pid): Add. + (child_post_follow_vfork): Remove. + (child_follow_fork): New function. + (child_wait): Call detach_breakpoints after receiving the child vfork. + Call child_resume directly instead of going through resume (). + Make sure we have the exec before reporting the vfork. + * inferior.h (follow_inferior_reset_breakpoints): Add prototype. + * infrun.c (follow_fork, follow_vfork, follow_inferior_fork): Remove. + (follow_fork): New function. Call target_follow_fork. + (follow_inferior_reset_breakpoints): New function broken out from + old follow_inferior_fork. + (resume): Remove hack to follow exec after vfork. + * inftarg.c (child_post_follow_vfork): Remove. + (child_follow_fork): New function. + (init_child_ops): Replace to_post_follow_vfork with to_follow_fork. + * target.c (cleanup_target): Replace to_post_follow_vfork with + to_follow_fork. + (update_current_target): Likewise. + (setup_target_debug): Likewise. + (debug_to_post_follow_vfork): Remove. + (debug_to_follow_fork): New function. + * target.h (struct target_ops): Replace to_post_folow_vfork with + to_follow_fork. + (child_post_follow_vfork): Remove prototype. + (child_follow_fork): Add prototype. + (target_post_follow_vfork): Remove macro. + (target_follow_fork): Add macro. + +2002-12-10 Daniel Jacobowitz + + * hppah-nat.c (saved_child_execd_pathname, saved_vfork_state): New. + (child_post_follow_vfork): Cancel pending exec event if we follow + the parent. + (child_wait): Only return TARGET_WAITKIND_VFORKED when all necessary + events have been processed. Return a fake TARGET_WAITKIND_EXECD + event at the following wait call if necessary. + * infrun.c (follow_vfork): Don't follow_exec here. + (handle_inferior_event): Add comment to TARGET_WAITKIND_EXECD + case about HP/UX 10.20. Remove code pushed down to + hppah-nat.c:child_wait. + * infttrace.c (child_resume): Use TT_PROC_CONTINUE if + vfork_in_flight is set. + +2002-12-10 Daniel Jacobowitz + + * hppah-nat.c (child_wait): Return TARGET_WAITKIND_IGNORE + for the parent's fork event. + * infrun.c (handle_inferior_event): Only expect one fork event. + Call prepare_to_wait for TARGET_WAITKIND_IGNORE. Update comment. + * target.h: Update comment for TARGET_WAITKIND_IGNORE. + +2002-12-10 Andrew Cagney + + * PROBLEMS: Delete reference to PR gdb/725. + + * MAINTAINERS (gdb.c++): Add David Carlton. + +2002-12-09 David Carlton + + * cli/cli-setshow.c: #include after defs.h. + * cli/cli-cmds.c: Ditto. + +2002-12-09 Andrew Cagney + + * gdbarch.sh (gdbarch_dump): Print NAME_OF_MALLOC using %s. Wrap + function address in <>. + * gdbarch.c: Re-generate. + +2002-12-09 David Carlton + + * p-exp.y: Rename TRUE and FALSE to TRUEKEYWORD and FALSEKEYWORD. + +2002-12-09 David Carlton + + * linespec.c (symtab_from_filename): New function. + (decode_line_1): Move code into symtab_from_filename. + +2002-12-09 Kevin Buettner + + * lin-lwp.c (strsignal): Make extern declaration match that of glibc. + +2002-12-07 Andrew Cagney + + * f-valprint.c (info_common_command): Use get_frame_pc. + * std-regs.c (value_of_builtin_frame_pc_reg): Ditto. + * ax-gdb.c (agent_command): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + (rs6000_pop_frame): Ditto. + (rs6000_frameless_function_invocation): Ditto. + (rs6000_frame_saved_pc, frame_get_saved_regs): Ditto. + (frame_initial_stack_address, rs6000_frame_chain): Ditto. + * macroscope.c (default_macro_scope): Ditto. + * stack.c (print_frame_info_base): Ditto. + (print_frame, frame_info, print_frame_label_vars): Ditto. + (return_command, func_command, get_frame_language): Ditto. + * infcmd.c (finish_command): Ditto. + * dummy-frame.c (cached_find_dummy_frame): Ditto. + * breakpoint.c (deprecated_frame_in_dummy): Ditto. + (break_at_finish_at_depth_command_1): Ditto. + (break_at_finish_command_1): Ditto. + (until_break_command, get_catch_sals): Ditto. + * blockframe.c (func_frame_chain_valid): Ditto. + (frameless_look_for_prologue): Ditto. + (frame_address_in_block, generic_func_frame_chain_valid): Ditto. + +2002-12-08 Andrew Cagney + + * config/rs6000/tm-rs6000.h (init_frame_pc_noop): Add declaration. + * dwarf2cfi.c (cfi_init_frame_pc): Cast the PC to a pointer. + +2002-12-08 Andrew Cagney + + * gdbarch.sh (INIT_FRAME_PC_FIRST, INIT_FRAME_PC_DEFAULT): Convert + to pure functions. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (get_prev_frame): Explictly assign prev's pc with value + returned by INIT_FRAME_PC_FIRST and INIT_EXTRA_FRAME_INFO. + + * arch-utils.h (init_frame_pc_default, init_frame_pc_noop): Change + declaration to a function returning a CORE_ADDR. + * x86-64-tdep.h (x86_64_init_frame_pc): Ditto. + * arch-utils.c (init_frame_pc_noop): Return the PC value. + (init_frame_pc_default): Ditto. + * x86-64-linux-tdep.c (x86_64_init_frame_pc): Ditto. + * s390-tdep.c (s390_init_frame_pc_first): Ditto. + * mips-tdep.c (mips_init_frame_pc_first): Ditto. + * dwarf2cfi.h (cfi_init_frame_pc): Ditto. + * dwarf2cfi.c (cfi_init_frame_pc): Ditto. + * alpha-tdep.c (alpha_init_frame_pc_first): Ditto. + + * i386-interix-tdep.c (i386_interix_init_abi): Set init_frame_pc + to init_frame_pc_noop. + (i386_interix_init_frame_pc): Delete function. + * z8k-tdep.c (init_frame_pc): Delete function. + * config/z8k/tm-z8k.h (INIT_FRAME_PC): Define as init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Ditto. + * config/mn10200/tm-mn10200.h (INIT_FRAME_PC): Ditto. + (INIT_FRAME_PC_FIRST): Ditto. + * config/sparc/tm-sparc.h (INIT_FRAME_PC): Ditto. + * config/rs6000/tm-rs6000.h (INIT_FRAME_PC): Redefine as + init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Convert to an expression. + * config/sparc/tm-sparc.h (INIT_FRAME_PC_FIRST): Ditto. + +2002-12-08 Andrew Cagney + + * blockframe.c: Use get_frame_base instead of directly accessing + the `struct frame_info' member frame. + * f-valprint.c, std-regs.c, rs6000-tdep.c: Ditto. + * stack.c, dummy-frame.c, breakpoint.c: Ditto. + +2002-12-08 Elena Zannoni + + * Makefile.in (readline_h): Define. + (completer.o): Depend on readline_h. + (corelow.o): Ditto. + (event-top.o): Ditto. + (exec.o): Ditto. + (solib.o): Ditto. + (source.o): Ditto. + (symfile.o): Ditto. + (symmisc.o): Ditto. + (top.o): Ditto. + (tracepoint.o): Ditto. + (utils.o): Ditto. + (cli-dump.o): Ditto. + (tui-hooks.o): Ditto. + (tuiWin.o): Ditto. + +2002-12-08 Elena Zannoni + + More cleanup from import of readline 4.3. + * completer.h (complete_line, readline_line_completion_function): + Update prototypes. + (line_completion_function): Removed, not used outside of completer.c. + * completer.c (readline_line_completion_function, + complete_function, line_completion_function): Use const for first + parameter. + (line_completion_function): Make static. + (filename_completer): filename_completion_function is now called + rl_filename_completion_function + * corelow.c: Include . + * exec.c: Ditto. + * solib.c: Ditto. + * source.c: Ditto. + * symfile.c: Ditto. + * symmisc.c: Ditto. + * top.c (init_main): No need to coerce + readline_line_completion_function anymore. + * cli/cli-dump.c: Include . + +2002-12-08 Andrew Cagney + + * stack.c (frame_info): Use get_prev_frame. + * blockframe.c (frame_address_in_block): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + (rs6000_frameless_function_invocation): Ditto. + (rs6000_frame_saved_pc): Ditto. + (rs6000_frame_chain): Ditto. + * arch-utils.c (init_frame_pc_default): Ditto. + +2002-12-08 Andrew Cagney + + * config/mn10200/tm-mn10200.h (DEPRECATED_PC_IN_CALL_DUMMY): + Delete redundant definition. + +2002-12-08 Elena Zannoni + + Import of readline 4.3: + * cli/cli-cmds.c: Include readline/tilde.h. + * cli/cli-setshow.c: Ditto. + * defs.h: Don't declare tilde_expand anymore, since readline + exports it. + +2002-12-08 Elena Zannoni + + * Makefile.in (thread-db.o): Add explicit rule to ignore the use of + -Werror on this file. + +2002-12-07 Andrew Cagney + + * gdbarch.sh (TARGET_FLOAT_FORMAT): Use the macro when printing + the format name. + (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. + * gdbarch.c: Regenerate. + +2002-12-06 Andrew Cagney + + * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename + INIT_FRAME_PC_FIRST. Change to a function with predicate. Do not + provide a default value. + * gdbarch.h, gdbarch.c: Regenerate. + * frame.c (get_prev_frame): Update. Check + DEPRECATED_INIT_FRAME_PC_FIRST_P. + * s390-tdep.c (s390_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. + * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2002-12-06 Elena Zannoni + + * ia64-linux-nat.c: Include gdb_string.h. + * alpha-nat.c: Ditto. + * ppc-linux-nat.c: Ditto. + * Makefile.in (ia64-linux-nat.o, alpha-nat.o, ppc-linux-nat.o): + Update dependencies. + +2002-12-05 Andrew Cagney + + * gdbthread.h: Include "frame.h". + (struct thread_info): Replace step_frame_address with + step_frame_id. + * inferior.h: Include "frame.h". + (step_frame_id): Replace external variable step_frame_address. + * gdbthread.h (save_infrun_state): Replace step_frame_address + parameter with step_frame_id parameter. + (load_infrun_state): Ditto. + * Makefile.in (gdbthread_h, inferior_h): Add $(frame_h). + * infcmd.c (step_frame_id, step_1, step_once): Update. + * thread.c (load_infrun_state, save_infrun_state): Update. + * infrun.c (clear_proceed_status, save_inferior_status): Update. + (handle_inferior_event, step_over_function): Update. + (normal_stop, context_switch, restore_inferior_status): Update. + (struct inferior_status): Replace step_frame_address with + step_frame_id. + +2002-12-05 David Carlton + + * dwarf2read.c (dwarf2_add_field): Treat a field that is a + DW_TAG_member as well as a declaration as being a C++ static data + member. + (read_structure_scope): Combine tests for DW_TAG_member and + DW_TAG_variable. + +2002-12-05 David Carlton + + * linespec.c (decode_compound): New function. + (decode_line_1): Move code into decode_compound. + +2002-12-05 David Carlton + + * symtab.c (lookup_symbol_aux_local): Add 'static_block' + argument. + (lookup_symbol_aux): Do the 'field_of_this' check before checking + the static block. See PR gdb/804. + +2002-12-05 David Carlton + + * symtab.c (lookup_symbol_aux_block): New function. + (lookup_symbol_aux_local): Move code into lookup_symbol_aux_block. + +2002-12-05 Andrew Cagney + + * gdbarch.sh: Dump the predicate function and macro values. + (read): Print error on standard error. + * gdbarch.c: Regenerate. + +2002-12-04 Kevin Buettner + + * Makefile.in (mips_tdep_h): Define. + (mips-tdep.o): Add mips_tdep_h to dependency list. + * mips-tdep.h: New file. + * mips-tdep.c (mips-tdep.h): Include. + (enum mips_abi): Move to mips-tdep.h. + (mips_abi): New function. + +2002-12-04 David Carlton + + * Makefile.in (f-exp.tab.c): Don't depend on c-exp.tab.c. + +2002-12-04 David Carlton + + * symtab.c (lookup_symbol_aux): Move minsym code into a separate + function. + (lookup_symbol_aux_minsyms): New function. + +2002-12-04 J. Brobecker + + * pa64solib.c: s/boolean/int/. Fixes a build failure on hppa64-hpux. + +2002-12-04 J. Brobecker + + * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Renamed from IN_SIGTRAMP, + which is an obsolete macro name. + +2002-12-04 Daniel Jacobowitz + + * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int. + * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee. + +2002-12-03 H.J. Lu (hjl@gnu.org) + + * breakpoint.c (create_thread_event_breakpoint): Use xasprintf. + (create_breakpoints): Make sure the addr_string field is not + NULL. + +2002-12-03 Andrew Cagney + + * sparc-nat.c (fetch_inferior_registers) + (store_inferior_registers): Add comment on problem of LWP vs + threads. + + From 2002-11-21 Daniel Jacobowitz + * lin-lwp.c (lin_lwp_fetch_registers): Remove. + (lin_lwp_store_registers): Remove. + (init_lin_lwp_ops): Use fetch_inferior_registers + and store_inferior_registers directly. + * sparc-nat.c (fetch_inferior_registers): Honor LWP ID. + (store_inferior_registers): Likewise. + Fix PR gdb/725. + +2002-12-03 Andrew Cagney + + * frame.h (get_frame_id): Convert to a function. + (null_frame_id, frame_id_p): Declare. + (frame_id_eq, frame_id_inner): Declare. + (frame_id_build): New function. + * frame.c (get_frame_id): Update. Use null_frame_id. + (frame_find_by_id): Rewrite using frame_id_p, frame_id_eq and + frame_id_inner. + (null_frame_id, frame_id_p): Define. + (frame_id_eq, frame_id_inner): Define. + (frame_id_build): New function. + * varobj.c (varobj_create): Update. + (varobj_update): Update. + * valops.c (value_assign): Update. + (new_root_variable): Update. + * infrun.c (save_inferior_status): Update. + * breakpoint.c (watch_command_1): Update. + +2002-12-03 J. Brobecker + + * config/pa/tm-hppah.h (SNAP1): Remove unused macro. + (SNAP2): Likewise. + +2002-12-03 Andrew Cagney + + * NEWS: Mention Daniel Jacobowitz's multi-threaded shared library + patch. + + * PROBLEMS: Mention PR gdb/725. + +2002-12-03 Andreas Schwab + + * infcmd.c (construct_inferior_arguments): Handle empty arguments. + +2002-12-02 Adam Fedor + Klee Dienes + + * objc-lang.c (objc_printstr): Add width arg to match + printstr prototype. + (compare_selectors): Add 'const' to arg types. + (compare_classes): Likewise. + (find_imps): Cast msym pointer to avoid compiler warning. + (print_object_command): Validate the address before + passing it to the print routine. + (find_objc_msgcall_submethod): Change function argument to + return an int. + * objc-lang.h: Add 'extern' to all function declarations. + (value_nsstring): Add declaration. + +2002-12-02 J. Brobecker + + * somsolib.c (dld_cache): Replace boolean by int for field is_valid. + Fixes a build failure on HP/UX. + + * hpread.c (told_objfile): Replace boolean type by int. Fixes a build + failure on HP/UX. + (hpread_has_name): Advance declaration to avoid a compilation warning. + (pst_syms_count): Add missing variable type. By change, the compiler + was defaulting to int, which seems a good choice. Fixes a compilation + warning. + (pst_syms_size): Likewise. + +2002-12-02 J. Brobecker + + * hppa-tdep.c: Add #include "osabi.h" (for hppa_gdbarch_init). + (hppa_gdbarch_init): Detect osabi from objfile. Will be needed + later to set the proper gdbarch methods depending on the osabi. + * Makefile.in (hppa-tdep.o): Add dependency on osabi.h. + +2002-12-02 J. Brobecker + + * osabi.h (gdb_osabi): Add two new enum values for HPUX ELF and SOM. + * osabi.c (gdb_osabi_name): Add strings images for the two new + enum values. + (generic_elf_osabi_sniffer): Handle HPUX objfiles. + +2002-12-02 Andrew Cagney + + * MAINTAINERS (Java): Global maintainers are responible for Java. + (Past Maintainers): Mention both Anthony Green and Per Bothner as + part Java maintainers. + +2002-12-02 J. Brobecker + + * xcoffread.c (read_symbol_lineno): Replace boolean by int. + Fixes a compilation failure on AiX. + +2002-12-02 J. Brobecker + + * config/powerpc/aix432.mh (NATDEPFILES): Add a comment explaining + why aix-thread.o is not listed. + +2002-12-01 Andrew Cagney + + * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename + PC_IN_CALL_DUMMY. Change to predicate. Always allow call. + * gdbarch.h, gdbarch.c: Re-generate. + * config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update. + * config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update. + * config/pa/tm-hppa.h, frame.h: Update. + * x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update. + * s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update. + * m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update. + * cris-tdep.c, alpha-tdep.c: Update. + * frame.c (set_unwind_by_pc, create_new_frame): Use either + DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame. + (get_prev_frame): Ditto. + +2002-11-30 Andrew Cagney + + * exec.c (xfer_memory): Replace boolean with int. + * p-exp.y: Use 0 instead of false. + * corelow.c (gdb_check_format): Change return type to int from + boolean. + * utils.c: Don't include or first. + +2002-11-29 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_register_raw_size): Remove. + (m68hc11_register_byte): Remove. + (m68hc11_gdbarch_init): Don't set the above. + +2002-11-29 Andrew Cagney + + * remote-mips.c (mips_initialize): Force a selected frame rebuild + by calling get_selected_frame. + * ocd.c (ocd_start_remote): Use get_selected frame instead of + set_current_frame, create_new_frame, select_frame and + get_current_frame. + * remote-e7000.c (e7000_start_remote): Ditto. + * remote-mips.c (common_open): Ditto + * remote-rdp.c (remote_rdp_open): Ditto. + +2002-11-29 Andreas Schwab + + * m68k-tdep.c (m68k_frame_chain, m68k_frame_saved_pc) + (altos_skip_prologue, delta68_frame_saved_pc, isi_frame_num_args) + (delta68_frame_num_args, news_frame_num_args, m68k_skip_prologue) + (m68k_frame_init_saved_regs, m68k_saved_pc_after_call): Use + read_memory_unsigned_integer instead of read_memory_integer when + dealing with addresses and instruction opcodes. + * m68klinux-tdep.c (m68k_linux_sigtramp_saved_pc) + (m68k_linux_frame_saved_pc): Likewise. + +2002-11-29 Andrew Cagney + + * stack.c (selected_frame, select_frame): Move from here ... + * frame.c (selected_frame, select_frame): ... to here. Include + "language.h". + * Makefile.in (frame.o): Update dependencies. + * frame.c (get_selected_frame): New function. + * frame.h (get_selected_frame): Declare. + (deprecated_selected_frame): Rename selected_frame. + * ada-lang.c, ada-tasks.c, breakpoint.c, corelow.c: Update. + * eval.c, f-valprint.c, findvar.c, frame.c, frame.h: Update. + * h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, infcmd.c: Update. + * inflow.c, infrun.c, macroscope.c, mips-tdep.c: Update. + * mn10300-tdep.c, ocd.c, regcache.h, remote-e7000.c: Update. + * remote-mips.c, remote-rdp.c, sh-tdep.c, sparc-tdep.c: Update. + * stack.c, thread.c, tracepoint.c, valops.c, varobj.c: Update. + * z8k-tdep.c, cli/cli-cmds.c: Update. + +2002-11-29 Andrew Cagney + + * frame.h (get_selected_block): Add comments. + +2002-11-28 Andrew Cagney + + * frame.c (pc_notcurrent): New function. + (find_frame_sal): New function. + * frame.h (find_frame_sal): Declare. + (struct symtab_and_line): Add opaque declaration. + * stack.c (print_frame_info_base): Use find_frame_sal instead of + find_pc_line. + (frame_info): Ditto. + * ada-lang.c (find_printable_frame): Ditto. + +2002-11-28 J. Brobecker + + * configure.in: Check that the pthdebug library is recent enough + before enabling thread support on native AiX. + * configure: Regenerate. + + * config/powerpc/aix432.mh (NATDEPFILES): Remove aix-thread.o + from the list of object files as it is now appended by configure + if thread support is enabled. + (NAT_CLIBS): Removed as -lpthdebug is also appended by configure + if thread support is enabled. + +2002-11-28 Andrew Cagney + + * stack.c (get_selected_block): In-line get_current_block. + * frame.h (get_current_block): Delete declaration. + * blockframe.c (get_current_block): Delete function. + +2002-11-28 Andrew Cagney + + * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Rename + USE_GENERIC_DUMMY_FRAMES. + * gdbarch.h, gdbarch.c: Regenerate. + * valops.c, frame.c: Update. + * config/z8k/tm-z8k.h, config/mn10200/tm-mn10200.h: Update. + * config/m32r/tm-m32r.h, config/h8500/tm-h8500.h: Update. + * config/pa/tm-hppa.h, blockframe.c: Update. + * vax-tdep.c, sparc-tdep.c, ns32k-tdep.c: Ditto. + * m68k-tdep.c, alpha-tdep.c: Ditto. + + * arm-tdep.c: Eliminate USE_GENERIC_DUMMY_FRAMES as always 1. + * mips-tdep.c: Ditto. + +2002-11-27 Andrew Cagney + + * gdbarch.sh (CALL_DUMMY_LOCATION): Default to AT_ENTRY_POINT. + (USE_GENERIC_DUMMY_FRAMES): Default to true. + (PC_IN_CALL_DUMMY): Default to generic_pc_in_call_dummy. + * gdbarch.c, gdbarch.h: Re-generate. + * inferior.h (USE_GENERIC_DUMMY_FRAMES): Delete macro definition. + (CALL_DUMMY_LOCATION): Delete macro definition. + (PC_IN_CALL_DUMMY): Delete macro definitions. + + * arm-tdep.c (arm_gdbarch_init): Do not set pc_in_call_dummy, + default is already generic_pc_in_call_dummy. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + + * arm-tdep.c (arm_gdbarch_init): Do not set + use_generic_dummy_frames, default is already 1. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set + call_dummy_location, default is already AT_ENTRY_POINT. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + +2002-11-28 Andrew Cagney + + * frame.h: Update comments on set_current_frame, create_new_frame, + flush_cached_frames, reinit_frame_cache, select_frame and + selected_frame. + +2002-11-27 Andrew Cagney + + * config/z8k/tm-z8k.h (PC_IN_CALL_DUMMY): Update definition to use + deprecated pc_in_call_dummy function. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Ditto. + * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Ditto. + * config/pa/tm-hppa.h (PC_IN_CALL_DUMMY): Ditto. + * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Ditto. + * config/h8500/tm-h8500.h (PC_IN_CALL_DUMMY): Ditto. + +2002-11-26 Martin M. Hunt + + * Makefile.in: Remove Tix dependencies. + * acinclude.m4: Ditto. + * aclocal.m4: Ditto. + * configure.in: Ditto. + * configure: Regenerated. + +2002-11-26 Andrew Cagney + + * gdbarch.sh (TARGET_FLOAT_FORMAT): Print the float format name. + (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. + * gdbarch.c: Re-generate. + +2002-11-26 Andrew Cagney + + * config/h8500/tm-h8500.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. + * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Define as + pc_in_call_dummy_at_entry_point. + * config/pa/tm-hppa.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. + * config/pa/tm-hppa64.h (CALL_DUMMY_LOCATION): Delete undefine. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Define as + pc_in_call_dummy_on_stack. + * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Redefine as + pc_in_call_dummy_at_entry_point and pc_in_call_dummy_on_stack. + * config/z8k/tm-z8k.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Defile as pc_in_call_dummy_on_stack. + +2002-11-26 Andrew Cagney + + * inferior.h (deprecated_pc_in_call_dummy_before_text_end): Rename + pc_in_call_dummy_before_text_end + (deprecated_pc_in_call_dummy_after_text_end): Rename + pc_in_call_dummy_after_text_end. + (deprecated_pc_in_call_dummy_on_stack): Rename + pc_in_call_dummy_on_stack. + (deprecated_pc_in_call_dummy_at_entry_point): Rename + pc_in_call_dummy_at_entry_point. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Update. + * blockframe.c (deprecated_pc_in_call_dummy_before_text_end) + (deprecated_pc_in_call_dummy_after_text_end) + (deprecated_pc_in_call_dummy_on_stack) + (deprecated_pc_in_call_dummy_at_entry_point): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2002-11-25 Daniel Jacobowitz + + * acconfig.h (HAVE_PREAD64): Add. + * configure.in: Check for pread64. + * config.in: Regenerated. + * configure: Regenerated. + * lin-lwp.c (lin_lwp_xfer_memory): Call linux_proc_xfer_memory. + * linux-proc.c (linux_proc_xfer_memory): New function. + * config/nm-linux.h (linux_proc_xfer_memory): Add prototype. + +2002-11-25 David Carlton + + * dwarf2read.c (scan_partial_symbols): Descend into namespace + pdi's with no name. + +2002-11-25 Andrew Cagney + + * MAINTAINERS: Mark h8500 as broken. Breakage occured Fri Nov 5 + 16:32:04 1999 Andrew Cagney . + +2002-11-25 Jim Blandy + + * symfile.c (init_objfile_sect_indices): New function. + (default_symfile_offsets): Move the section-index-initializing + stuff into init_objfile_sect_indices, and call that. + + * symtab.h (SIZEOF_N_SECTION_OFFSETS): New macro. + (SIZEOF_SECTION_OFFSETS): Use SIZEOF_N_SECTION_OFFSETS. + + * symfile.c (syms_from_objfile): Adjust indentation. + + * symfile.c (symbol_file_add): Flush gdb_stdout even if from_tty + || info_verbose isn't true. + +2002-11-24 Andrew Cagney + + * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Change + default to get_frame_base. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.c (default_frame_address): Delete function. + * arch-utils.h (default_frame_address): Delete declaration + +2002-11-24 Pierre Muller + + * varobj.c (find_frame_addr_in_frame_chain): + Use get_frame_base instead of FRAME_FP, + obvious fix. + +2002-11-19 Andrew Cagney + + * frame.h (FRAME_FP): Delete macro. + (get_frame_base): New function declaration. + * frame.c (get_frame_base): New function. + (get_frame_id): Use ->frame. + (frame_find_by_id): Rewrite to use get_frame_id. + * blockframe.c: Use get_frame_base instead of FRAME_FP. + * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto. + * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto. + * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto. + * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto. + * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto. + * v850-tdep.c, valops.c, z8k-tdep.c: Ditto. + +2002-11-24 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Do not set get_saved_register. + +2002-11-24 Andrew Cagney + + * frame.c (set_unwind_by_pc): Revert change below, use + PC_IN_CALL_DUMMY. + (get_prev_frame): Ditto. + +2002-11-24 Andrew Cagney + + * dummy-frame.c (pc_in_dummy_frame): New function. + (generic_pc_in_call_dummy): Call pc_in_dummy_frame. + (find_dummy_frame): Update comment. + (generic_pop_current_frame): Use get_frame_type. + * dummy-frame.h (pc_in_dummy_frame): Declare. + * frame.c (set_unwind_by_pc): Use pc_in_dummy_frame. + (create_new_frame): Use pc_in_dummy_frame. + (get_prev_frame): Use pc_in_dummy_frame. + (frame_saved_regs_register_unwind): Use get_prev_frame. + (deprecated_generic_get_saved_register): Use get_prev_frame. + +2002-11-23 Andrew Cagney + + * blockframe.c (find_frame_addr_in_frame_chain): Move function + from here ... + * varobj.c (find_frame_addr_in_frame_chain): ... to here. + (varobj_create): Note that frame ID should be used. + * frame.h (find_frame_addr_in_frame_chain): Delete declaration. + +2002-11-23 Andrew Cagney + + * breakpoint.c: Include "gdb_assert.h". + (deprecated_frame_in_dummy): Assert that generic dummy frames are + not being used. + * Makefile.in (breakpoint.o): Update dependencies. + * ada-lang.c (find_printable_frame): Use get_frame_type instead of + deprecated_frame_in_dummy. + * stack.c (print_frame_info_base): Ditto. + (frame_info): Ditto. + (print_frame_info_base): Ditto. Delete dead code. + +2002-11-23 Andreas Schwab + + * Makefile.in (m68k_tdep_h): Define. + (abug-rom.o, cpu32bug-rom.o, dbug-rom.o, m68k-tdep.o, m68klinux-nat.o) + (remote-est.o, rom68k-rom.o): Add $(m68k_tdep_h). + * m68k-tdep.c: Move register number enum ... + * m68k-tdep.h: ... to this new file and rename the constants from + E_* to M68K_*. All uses changed. + * config/m68k/tm-m68k.h (D0_REGNUM, A0_REGNUM): Remove definitions. + * abug-rom.c: Include "m68k-tdep.h". Use + M68K_D0_REGNUM/M68K_A0_REGNUM instead of D0_REGNUM/A0_REGNUM. + * cpu32bug-rom.c: Likewise. + * dbug-rom.c: Likewise. + * m68k-tdep.c: Likewise. + * m68klinux-nat.c: Likewise. + * remote-est.c: Likewise. + * rom68k-rom.c: Likewise. + * config/m68k/tm-linux.h: Likewise. + +2002-11-23 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Remove old style non-generic + dummy frame initialization code. + * mips-tdep.c (mips_gdbarch_init): Ditto. + +2002-11-22 Christopher Faylor + + * win32-nat.c (child_attach): Reset saw_create counter or subsequent + attach will hang. + +2002-11-22 Andrew Cagney + + * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Default + to default_frame_address. + * gdbarch.h, gdbarch.c: Re-generate. + + * d10v-tdep.c (d10v_gdbarch_init): Do not set frame_args_address + or frame_locals_address to default_frame_address. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + + * cris-tdep.c (cris_frame_args_address): Delete function. + (cris_frame_locals_address): Delete function. + (cris_gdbarch_init): Do not set frame_args_address or + frame_locals_address. + +2002-11-22 Michael Snyder + + * thread-db.c (thread_db_load): Tell the user what's going on + if dlopen fails on libthread_db. + +2002-11-23 Andreas Schwab + + * m68k-tdep.c (m68k_register_virtual_type): Use architecture + invariant return values. + +2002-11-22 Andreas Schwab + + * valops.c (value_slice): Move declaration of `offset' to avoid + warning. + +2002-11-22 Christopher Faylor + + * win32-nat.c (psapi_get_dll_name): Fix a compiler warning. + (struct so_stuff): Add end_addr field. + (register_loaded_dll): Calculate and store end address of loaded dll. + (solib_address): New function. + (child_solib_loaded_library_pathname): Pass carefully constructed + section info to safe_symbol_file_add rather than ignoring it. + (get_child_debug_event): Call re_enable_breakpoints_in_shlibs when a + DLL is loaded. + (do_initial_child_stuff): Call disable_breakpoints_in_shlibs. + (child_create_inferior): Fix a compiler warning. + * config/i386/tm-cygwin.h (PC_SOLIB): Define new macro. + (solib_address): Declare new function. + +2002-11-22 Andreas Schwab + + * m68k-tdep.c (m68k_register_virtual_type): Return int for SR, FPC + and FPS registers. + +2002-11-21 Daniel Jacobowitz + + * maint.c (_initialize_maint_cmds): Fix typo. From + Francesco Potorti` . + +2002-11-21 Andrew Cagney + + * mips-tdep.c (mips_dump_tdep): Delete references to + GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. + * config/mips/tm-mips.h (GDB_TARGET_MASK_DISAS_PC): Delete macro. + (GDB_TARGET_UNMASK_DISAS_PC): Delete macro. + * printcmd.c (build_address_symbolic): Delete calls to + GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. + (address_info): Ditto. + Fix PR gdb/773. + +2002-11-19 Klee Dienes + Adam Fedor + + * completer.c (skip_quoted_chars): Renamed from skip_chars. Add + the ability to explicitly specify the quote characters and word + break characters; if NULL is specified for either, use the old + behavior of using the characters used by the completer. + (skip_chars): New function. Convenience wrapper around + skip_quoted_chars to provide the original skip_chars behavior. + * completer.h (skip_quoted_chars): Add prototype. + +2002-11-19 Andrew Cagney + + Problems reported by Paul Eggert. + * gdbarch.sh: Use `sort -k 3`. Fix PR gdb/527. + +2002-11-19 Andreas Schwab + + * m68klinux-nat.c (IS_SIGTRAMP, IS_RT_SIGTRAMP) + (m68k_linux_in_sigtramp, SIGCONTEXT_PC_OFFSET) + (UCONTEXT_PC_OFFSET, m68k_linux_sigtramp_saved_pc) + (m68k_linux_frame_saved_pc): Move to ... + * m68klinux-tdep.c: ... here. New file. + * Makefile.in (m68klinux-tdep.o): Add dependencies. + * config/m68k/linux.mt (TDEPFILES): Add m68klinux-tdep.o. + +2002-11-19 Adam Fedor + + * objc-exp.y: Revert to old skip_quoted usage. + +2002-11-19 Adam Fedor + + * Makefile.in (SFILES): Add objc-exp.y objc-lang.c. + (objc_lang_h): Define. + (YYFILES): Add objc-exp.tab.c. + (local-maintainer-clean): Remove objc-exp.tab.c. + (objc-exp.tab.c, objc-exp.tab.o, objc-lang.o): New target. + +2002-11-19 Pierre Muller + + * p-exp.y (typecast rule): Add automatic dereference of + pascal classes if needed. + (THIS): Set current_type. + Automatically dereference pascal classes. + (typebase rule): Add ^typebase recognition. + +2002-11-18 Adam Fedor + + * expprint.c (print_subexp): Handle OP_OBJC_NSSTRING, + OP_OBJC_MSGCALL, and OP_OBJC_SELF. + (op_name): Handle OP_OBJC_SELF. + * Makefile.in (expprint.o): Add additional depends. + +2002-11-18 Adam Fedor + + * expression.h: Rename ObjC ops to OP_OBJC_MSGCALL, + OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF. + * parse.c (length_of_subexp, prefixify_subexp): Likewise. + * objc-exp.y: Likewise. + +2002-11-18 Adam Fedor + + * gdb/parser-defs.h: (struct objc_class_str): New structure + for parsing ObjC classes. + +2002-11-18 Andrew Cagney + + * stack.c (frame_relative_level): Copy function from here ... + * frame.c (frame_relative_level): ...to here. + +2002-11-18 Andrew Cagney + + * frame.h (enum frame_type): Define. + (get_frame_type): Declare. + (struct frame_info): Add field `type'. Delete field + signal_handler_caller. + (deprecated_set_frame_signal_handler_caller): Declare. + * frame.c (get_frame_type): New function. + (deprecated_set_frame_type): New function. + (create_new_frame): Set the frame's type. + (get_prev_frame): Similar. + * sparc-tdep.c: Use get_frame_type instead of signal_handler_caller. + * s390-tdep.c: Ditto. + * m68klinux-nat.c: Ditto. + * ns32k-tdep.c: Ditto. + * x86-64-linux-tdep.c: Ditto. + * vax-tdep.c: Ditto. + * rs6000-tdep.c: Ditto. + * ppc-linux-tdep.c: Ditto. + * i386-interix-tdep.c: Ditto. + * mips-tdep.c: Ditto. + * m68k-tdep.c: Ditto. + * hppa-tdep.c: Ditto. + * ia64-tdep.c: Ditto. + * cris-tdep.c: Ditto. + * arm-tdep.c: Ditto. + * alpha-tdep.c: Ditto. + * i386-tdep.c: Ditto. + * stack.c: Ditto. + * ada-lang.c: Ditto. + * blockframe.c: Update. + * i386-interix-tdep.c (i386_interix_back_one_frame): Use + deprecated_set_frame_type instead of signal_handler_caller. + * ppc-linux-tdep.c (ppc_linux_init_extra_frame_info): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + * breakpoint.h: Delete FIXME suggesting get_frame_type. + +2002-11-18 Klee Dienes + + * Makefile.in (buildsym.o): Add dependency for gdb_assert.h. + +2002-11-18 Klee Dienes + + * buildsym.c (pop_context): Add comment. + +2002-11-18 Klee Dienes + + * buildsym.h (pop_context): Convert to function, defined in + buildsym.c. + * buildsym.c: Include gdb_assert.h. + (pop_context): Implement as C function. Add check for stack + underflow. + * dbxread.c (process_one_symbol): Complain and stop processing + that symbol if we are already at the top of the context stack for + a function-end N_FUN (this would imply an umatched RBRAC). Ditto + when processing N_RBRAC. + +2002-11-16 Daniel Jacobowitz + + * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_INFERIOR_BY_CLONE): Don't + define. + (struct target_waitstatus): Add opaque definition. + * corelow.c (init_core_ops): Don't set to_clone_and_follow_inferior. + * exec.c (init_exec_ops): Likewise. + * fork-child.c (clone_and_follow_inferior): Remove. + * hppah-nat.c (child_post_follow_inferior_by_clone): Remove. + * inferior.h (clone_and_follow_inferior): Remove prototype. + * infrun.c (follow_fork_mode_both): Remove. + (follow_fork_mode_kind_names): Remove commented out "both". + (follow_inferior_fork): Remove follow_fork_mode_both support. + * inftarg.c (child_clone_and_follow_inferior): Remove. + (child_post_follow_inferior_by_clone): Remove. + (init_child_ops): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + * target.c (default_clone_and_follow_inferior): Remove. + (cleanup_target): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + (find_default_clone_and_follow_inferior): Remove. + (init_dummy_target): Don't set to_clone_and_follow_inferior. + (debug_to_clone_and_follow_inferior): Remove. + (debug_to_post_follow_inferior_by_clone): Remove. + (setup_target_debug): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + * target.h (struct target_ops): Remove to_clone_and_follow_inferior + and to_post_follow_inferior_by_clone. + (child_clone_and_follow_inferior): Remove prototype. + (child_post_follow_inferior_by_clone): Remove prototype. + (target_clone_and_follow_inferior): Remove macro. + (target_post_follow_inferior_by_clone): Remove macro. + (find_default_clone_and_follow_inferior): Remove prototype. + +2002-11-16 Daniel Jacobowitz + + * breakpoint.c (bpstat_stop_status): Call inferior_has_forked, + inferior_has_vforked, and inferior_has_execd instead of + target_has_forked, target_has_vforked, and target_has_execd. + * config/pa/nm-hppah.h (CHILD_HAS_FORKED, CHILD_HAS_VFORKED) + (CHILD_HAS_EXECD, CHILD_HAS_SYSCALL_EVENT): Don't define. + (CHILD_WAIT): Define. + (child_wait): Add prototype. + * hppah-nat.c (hpux_has_forked): Rename from child_has_forked. + Add prototype. + (hpux_has_vforked): Likewise, from child_has_vforked. + (hpux_has_execd): Likewise, from child_has_execd. + (hpux_has_syscall_event): Likewise, from child_has_syscall_event. + (not_same_real_pid, child_wait): New, copied from inftarg.c. + Call hpux_has_forked, hpux_has_vforked, hpux_has_execd, + and hpux_has_syscall_event instead of the target hooks. + * infrun.c (inferior_has_forked, inferior_has_vforked) + (inferior_has_execd): New functions. + * inftarg.c (not_same_real_pid): Remove. + (child_wait): Remove references to not_same_real_pid, + target_has_forked, target_has_vforked, target_has_execd, + and target_has_syscall_event. + (child_has_forked, child_has_vforked, child_has_execd) + (child_has_syscall_event): Remove. + (init_child_ops): Remove references to child_has_forked, + child_has_vforked, child_has_execd, and child_has_syscall_event. + * infttrace.c (hpux_has_forked): Rename from child_has_forked. + (hpux_has_vforked): Likewise, from child_has_vforked. + (hpux_has_execd): Likewise, from child_has_execd. + (hpux_has_syscall_event): Likewise, from child_has_syscall_event. + * target.c (cleanup_target): Remove references to + to_has_forked, to_has_vforked, to_has_execd, and + to_has_syscall_event. + (update_current_target): Likewise. + (setup_target_debug): Likewise. + (debug_to_has_forked): Remove. + (debug_to_has_vforked): Remove. + (debug_to_has_execd): Remove. + (debug_to_has_syscall_event): Remove. + * target.h (struct target_ops): Remove to_has_forked. + to_has_vforked, to_has_execd, and to_has_syscall_event. + (child_has_forked, child_has_vforked, child_has_execd) + (child_has_syscall_event): Remove prototypes. + (inferior_has_forked, inferior_has_vforked, inferior_has_execd): Add + prototypes. + (target_has_forked, target_has_vforked, target_has_execd) + (target_has_syscall_event): Remove macros. + +2002-11-16 Daniel Jacobowitz + + * hppah-nat.c (child_can_follow_vfork_prior_to_exec): Remove. + * inftarg.c (child_can_follow_vfork_prior_to_exec): Remove. + (init_child_ops): Don't initialize to_can_follow_vfork_prior_to_exec. + * infttrace.c (child_can_follow_vfork_prior_to_exec): Remove. + * target.c (cleanup_target): Remove reference to + to_can_follow_vfork_prior_to_exec. + (update_current_target): Likewise. + (debug_to_can_follow_vfork_prior_to_exec): Remove. + (setup_target_debug): Remove reference to + to_can_follow_vfork_prior_to_exec. + * target.h (struct target_ops): Remove + to_can_follow_vfork_prior_to_exec. + (child_can_follow_vfork_prior_to_exec): Remove prototype. + (target_can_follow_vfork_prior_to_exec): Remove definition. + * config/pa/nm-hppah.h (CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC): Don't + define. + * infrun.c (follow_vfork_when_exec): Remove. + (follow_inferior_fork): Remove references to follow_vfork_when_exec. + (follow_exec): Likewise. + (handle_inferior_event): Likewise. + (keep_going): Likewise. + +2002-11-15 Andrew Cagney + + * frame.c (generic_unwind_get_saved_register): Make static. + * frame.h (generic_unwind_get_saved_register): Delete declaration. + * avr-tdep.c (avr_gdbarch_init): Do not set get_saved_register, + defaults to generic_unwind_get_saved_register. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Delete macro. + +2002-11-15 Andrew Cagney + + * x86-64-linux-nat.c (i386_sse_regnum_p): New function. Copy from + i386-tdep.c. + +2002-11-15 Andrew Cagney + + * frame.h (sigtramp_saved_pc): Delete declaration. + * blockframe.c (sigtramp_saved_pc): Delete function. + * ns32k-tdep.c (ns32k_sigtramp_saved_pc): New function. + (ns32k_frame_saved_pc): Call ns32k_sigtramp_saved_pc. + * vax-tdep.c (vax_sigtramp_saved_pc): New function. + (vax_frame_saved_pc): Call vax_sigtramp_saved_pc. + +2002-11-15 Andrew Cagney + + * frame.c (frame_pc_unwind): New function. + (frame_saved_regs_pc_unwind): New function. + (frame_register_unwind): Pass unwind_cache instead of + register_unwind_cache. + (set_unwind_by_pc): Add unwind_pc parameter, set. + (create_new_frame): Pass frame->pc_unwind to set_unwind_by_pc. + (get_prev_frame): Ditto. + * frame.h (frame_pc_unwind_ftype): Declare. + (struct frame_info): Add pc_unwind, pc_unwind_cache_p and + pc_unwind_cache. Rename register_unwind_cache to unwind_cache. + (frame_pc_unwind): Declare. + * dummy-frame.c (dummy_frame_pc_unwind): New function. + (struct dummy_frame): Add comment mentioning that values are for + previous frame. + * dummy-frame.h (dummy_frame_pc_unwind): Declare. + * blockframe.c (file_frame_chain_valid): Use frame_pc_unwind. + (generic_file_frame_chain_valid): Ditto. + * stack.c (frame_info): Ditto. + +2002-11-15 David Carlton + + * linespec.c (locate_first_half): New function. + (decode_line_1): Move code into locate_first_half. + +2002-11-15 Andrew Cagney + + * complaints.h: Add comment explaining how to eliminate a + deprecated_complain call. + * complaints.h: Fix spelling errors. + +2002-11-15 David Carlton + + * printcmd.c: Remove #include "disasm.h". + +2002-11-14 Andrew Cagney + + * frame.h: Move the most relevant interface functions to the start + of the file. + +2002-11-14 Andrew Cagney + + * regcache.h (deprecated_registers): Rename registers. + * a68v-nat.c, alpha-nat.c, arch-utils.c, core-sol2.c: Update. + * hp300ux-nat.c, hppab-nat.c, hppah-nat.c: Update. + * hppam3-nat.c, hpux-thread.c, i386gnu-nat.c: Update. + * ia64-aix-nat.c, ia64-linux-nat.c, ia64-tdep.c: Update. + * irix4-nat.c, irix5-nat.c, lynx-nat.c, m68k-tdep.c: Update. + * m68knbsd-nat.c, mips-linux-tdep.c, mipsm3-nat.c: Update. + * mipsv4-nat.c, ns32knbsd-nat.c, ppc-bdm.c: Update. + * ppc-sysv-tdep.c, ptx4-nat.c, regcache.c, remote-es.c: Update. + * remote-sds.c, remote-vx68.c, remote-vxmips.c: Update. + * remote-vxsparc.c, rs6000-tdep.c, sol-thread.c: Update. + * sparc-nat.c, sparc-tdep.c, sun3-nat.c, symm-nat.c: Update. + * v850ice.c: Update. + +Wed Nov 13 19:51:05 2002 Andrew Cagney + + * utils.c (gdb_realpath): Add comment mentioning realpath with a + NULL buffer. + +2002-11-13 Andrew Cagney + + * regcache.h (deprecated_read_register_bytes): Rename + read_register_bytes. + (deprecated_write_register_bytes): Rename write_register_bytes. + * alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update. + * dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update. + * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update. + * ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update. + * remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update. + * sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update. + * xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update. + * config/nm-m3.h, config/h8500/tm-h8500.h: Update. + * config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update. + * config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update. + * config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update. + * config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update. + * config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update. + * config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update. + +2002-11-13 Jim Blandy + + * findvar.c (read_var_value): Doc fix. + +2002-11-13 Andrew Cagney + + * regcache.c (struct regcache): Replace passthough_p with + readonly_p. + (regcache_xmalloc): Initialize readonly_p. + (build_regcache): Initialize readonly_p. + (regcache_save): New function. + (regcache_restore): New function. + (regcache_cpy): Re-implement using regcache_save and + regcache_restore. + (regcache_raw_read): Update. + (regcache_cooked_read): When a read-only cache, checked for cached + pseudo register values. + (regcache_raw_write): Assert that the cache is not read-only. + Remove code handling a non-passthrough cache. + * regcache.h (regcache_save): Declare. + (regcache_restore): Declare. + +2002-11-13 Andrew Cagney + + * regcache.c (struct regcache_descr): Add fields + sizeof_cooked_registers and sizeof_cooked_register_valid_p. + (init_legacy_regcache_descr): Compute the size of a cooked + register cache and then assign that to sizeof_raw_registers. Set + sizeof_raw_register_valid_p to sizeof_cooked_register_valid_p + (init_legacy_regcache_descr): Ditto. + +2002-11-13 Andrew Cagney + + * regcache.c (register_buffer): Move to near start of file, update + description. + (regcache_raw_read): Use. + (regcache_raw_write): Use. + (struct regcache): Rename raw_registers to registers and + raw_register_valid_p to register_valid_p. + (regcache_xmalloc): Update. + (regcache_xfree): Update. + (register_buffer): Update. + (regcache_cpy): Update. + (regcache_cpy_no_passthrough): Update. + (regcache_valid_p): Update. + (deprecated_grub_regcache_for_registers): Update. + (deprecated_grub_regcache_for_register_valid): Update. + (set_register_cached): Update. + (regcache_raw_write): Update. + +2002-11-13 Pierre Muller + + * p-exp.y (name_not_typename): Use copy_name to + set current_type variable for fields of THIS. + +2002-11-12 Daniel Jacobowitz + + * gnu-nat.c (init_gnu_ops): Remove NULL initializations. + * monitor.c (init_base_monitor_ops): Likewise. + * ppc-bdm.c (init_bdm_ppc_ops): Likewise. + * remote-array.c (init_array_ops): Likewise. + * remote-e7000.c (init_e7000_ops): Likewise. + * remote-es.c (init_es1800_ops): Likewise. + (init_es1800_child_ops): Likewise. + * remote-rdp.c (init_remote_rdp_ops): Likewise. + * remote-sim.c (init_gdbsim_ops): Likewise. + * remote-st.c (init_st2000_ops): Likewise. + * sol-thread.c (init_sol_core_ops): Likewise. + (init_sol_thread_ops): Likewise. + * v850ice.c (init_850ice_ops): Likewise. + * win32-nat.c (init_child_ops): Likewise. + * wince.c (init_child_ops): Likewise. + +2002-11-12 Andrew Cagney + + * utils.c (gdb_realpath): Make rp a constant pointer. + +2002-11-12 Andrew Cagney + + * utils.c (gdb_realpath): Rewrite. Try, in order: realpath() with + a constant buffer; cannonicalize_file_name(); realpath() with a + pathconf() defined buffer, xstrdup(). + +2002-11-12 Andrew Cagney + + * config/djgpp/fnchange.lst: Fix typo, hang1.c to hang1.C; hang2.c + to hang2.C; hang3.c to hang3.C. + +2002-11-11 Elena Zannoni + + * findvar.c (read_var_value): Reenable TLS code. + +2002-11-11 Elena Zannoni + Jim Blandy + + * gdb_thread_db.h (enum): Add TD_NOTALLOC. + * target.c (update_current_target): Add + to_get_thread_local_address. + * target.h (to_get_thread_local_address): Export. + (target_get_thread_local_address): Define. + (target_get_thread_local_address_p): Define. + * thread-db.c: Include solib-svr4.h. + (td_thr_tls_get_addr_p): Define. + (thread_db_load): Get a pointer to td_thr_tls_get_addr. + (thread_db_get_thread_local_address): New function. + (init_thread_db_ops): Initialize to_get_thread_local_address. + * configure.in: Add test for TD_NOTALLOC in thread_db.h. + * configure: Regenerate. + * config.in: Regenerate. + +2002-11-11 David Carlton + + * linespec.c (set_flags): New function. + (decode_line_1): Move code into set_flags. + +2002-11-11 David Carlton + + * linespec.c (decode_line_1): Move chunks of code to separate + functions. + (initialize_defaults): New function. + (decode_indirect): New function. + +2002-11-11 Andrew Cagney + + * blockframe.c (sigtramp_saved_pc): Fix tipo. void_func_ptr + instead of void_code_ptr. + (sigtramp_saved_pc): Ditto. + + * x86-64-tdep.c (i386_fp_regnum_p): Copy i386-tdep.c's + i386_fp_regnum_p. + +2002-11-10 Daniel Jacobowitz + + * gdbtypes.h (struct main_type): Move artificial flag out of + loc. New member of ``struct field'' named static_kind. Reduce + overloaded meaning of bitsize. + (FIELD_ARTIFICIAL, SET_FIELD_PHYSNAME, SET_FIELD_PHYSADDR) + (TYPE_FIELD_STATIC, TYPE_FIELD_STATIC_HAS_ADDR): Likewise. + (FIELD_STATIC_KIND, TYPE_FIELD_STATIC_KIND): New macros. + + * ada-lang.c (fill_in_ada_prototype): Initialize static_kind for + new fields. + (template_to_fixed_record_type, template_to_static_fixed_type) + (to_record_with_fixed_variant_part): Likewise. + * coffread.c (coff_read_struct_type, coff_read_enum_type): Likewise. + * dwarf2read.c (dwarf2_add_field, read_enumeration): Likewise. + * dwarfread.c (struct_type, enum_type): Likewise. + * hpread.c (hpread_read_enum_type) + (hpread_read_function_type, hpread_read_doc_function_type) + (hpread_read_struct_type): Likewise. + * mdebugread.c (parse_symbol): Likewise. + +2002-11-10 Andrew Cagney + + * breakpoint.h (deprecated_frame_in_dummy): Rename frame_in_dummy. + * stack.c (print_frame_info_base): Update. + (print_frame_info_base, frame_info): Update. + * sparc-tdep.c (sparc_init_extra_frame_info): Update. + (sparc_frame_saved_pc): Update. + * ada-lang.c (find_printable_frame): Update. + * breakpoint.c (deprecated_frame_in_dummy): Update. + +2002-11-09 Mark Kettenis + + * i386-linux-nat.c (ORIG_EAX): Define to -1 if not already + defined. + (regmap): Extend to cover all registers. + (PT_READ_U, PT_WRITE_U, PTRACE_XFER_TYPE, + OLD_CANNOT_FETCH_REGISTERS, OLD_CANNOT_STORE_REGISTERS): Remove + definitions. + (fetch_register, sore_register): Simplify. + (old_fetch_inferior_registers, old_store_inferior_registers): + Remove functions. + (cannot_fetch_register, cannot_store_register): Change + implementation to use regmap array to decide which registers + cannot be fetched/stored. This removes $orig_eax from the + registers that cannot be fetched/stored. + (fetch_inferior_registers): Call fetch_register directly instead + of calling old_fetch_inferior_registers. + (store_inferior_registers): Call store_register directly instead + of calling old_store_inferior_registers. + (i386_linux_dr_get): Replace PT_READ_U with PTRACE_PEEKUSER. + (i386_linux_dr_set): Replace PT_WRITE_U with PTRACE_POKEUSER. + * config/i386/nm-linux.h (U_REGS_OFFSET): Remove definition. + +2002-11-09 Klee Dienes + + * i387-tdep.c (i387_supply_register): When called with NULL as a + buffer, mark the register as not provided (to mirror the behavior + of supply_register). + (i387_supply_fxsave): Ditto. + (i387_supply_fsave): Ditto (inherits the behavior from + i387_supply_register). + +2002-11-09 Klee Dienes + + * blockframe.c (sigtramp_saved_pc): Use + builtin_type_void_code_ptr, not builtin_type_void_data_ptr (we are + extracting the PC). Use TYPE_LENGTH (builtin_type_void_code_ptr) + instead of (TARGET_PTR_BIT / TARGET_CHAR_BIT). + +2002-11-09 Andrew Cagney + + * frame.c (get_prev_frame): Test prev_p to identify a previously + unwound frame. Initialize prev_p. + * frame.h (struct frame_info): Add field prev_p. Expand prev/next + comment. + +2002-11-09 Andrew Cagney + + * frame.c (get_prev_frame): Cleanups. Eliminate redundant tests + for a NULL NEXT_FRAME. Simplify fromleaf initialization. Add + more comments. Zap dead code. + +2002-11-09 Mark Kettenis + + * infcmd.c (print_vector_info, print_float_info): Move code that + checks whether the target has any registers and whether there is a + selected frame up, such that it is also used if a target provides + multi-arch definitions of these functions. + +2002-11-08 Andrew Cagney + + * Makefile.in (DESTDIR): Define. + (install-only, install-gdbtk, uninstall-gdbtk): Add $(DESTDIR) + prefix. + + * config/djgpp/fnchange.lst: 8.3 proof i386obsd-nat.c and + i386obsd-tdep.c. Rename to "gdb.cxx", paths containing "gdb.c++". + +2002-11-08 Andrew Cagney + + * i386-linux-tdep.c: Include "reggroups.h". + (i386_linux_register_reggroup_p): New function. + (i386_linux_init_abi): Set register_reggroup_p to + i386_linux_register_reggroup_p. + * i386-tdep.h (i386_register_reggroup_p): Declare. + * i386-tdep.c: Include "reggroups.h". + (i386_init_reggroups): New function. + (i386_add_reggroups): New function. + (i386_register_reggroup_p): New function. + (i386_sse_reggroup, i386_mmx_reggroup): New variables. + (_initialize_i386_tdep): Call i386_init_reggroups. + (i386_gdbarch_init): Set register_reggroup_p and add in the i386 + specific reggroups. + +2002-11-09 Mark Kettenis + + * infptrace.c (child_xfer_memory): Make use of the new PT_IO + request that's available in *BSD. + + * i386-tdep.h (IS_FPU_CTRL_REGNUM): Remove. + + * i387-tdep.c (i387_fill_fxsave): Use FOOFF_REGNUM instead of + FDOFF_REGNUM. + +2002-11-08 Andrew Cagney + + * frame.c (set_unwind_by_pc): Use dummy_frame_register_unwind. + * dummy-frame.c (find_dummy_frame): Rename + generic_find_dummy_frame, make static. Return the dummy frame + instead of the regcache. + (generic_find_dummy_frame): Re-implement using find_dummy_frame, + (cached_find_dummy_frame): New function. Use find_dummy_frame. + (dummy_frame_register_unwind): Rename + generic_call_dummy_register_unwind. Use cached_find_dummy_frame. + * dummy-frame.h (dummy_frame_register_unwind): Rename + generic_call_dummy_register_unwind. + +2002-11-08 Mark Kettenis + + * config/i386/tm-i386v42mp.h: Remove file. Move its contents, + except the inclusion of "i386/tm-i386.h", to... + * config/i386/nm-i386v42mp.h: ...here. + * config/i386/i386v42mp.mt (TM_FILE): Set to tm-i386.h. + +2002-11-08 Andrew Cagney + + * Makefile.in (frame.o): Update dependencies. + * blockframe.c (current_frame, frame_obstack_alloc) + (frame_saved_regs_zalloc, get_current_frame) + (set_current_frame, create_new_frame) + (set_unwind_by_pc, get_next_frame) + (flush_cached_frames, reinit_frame_cache) + (frame_saved_regs_register_unwind) + (deprecated_generic_get_saved_register) + (get_prev_frame, get_frame_pc, get_frame_saved_regs) + (_initialize_blockframe): Move frame code from here... + * frame.c: ...to here. Include "gdb_obstack.h", "gdbcore.h", + "annotate.h" and "dummy-frame.h". + (_initialize_frame): New function. + +2002-11-08 Jim Blandy + + * dwarf2read.c (read_func_scope): Restore list_in_scope properly + when we finish a function a context. + * buildsym.h (outermost_context_p): New macro. + (Bug analyzed by David Edelsohn.) + +2002-11-08 Andrew Cagney + + * blockframe.c: Include "dummy-frame.h". + (struct dummy_frame, dummy_frame_stack) + (generic_find_dummy_frame, deprecated_generic_find_dummy_frame) + (generic_pc_in_call_dummy, deprecated_read_register_dummy) + (generic_push_dummy_frame, generic_save_dummy_frame_tos) + (generic_save_call_dummy_addr, generic_pop_current_frame) + (generic_pop_dummy_frame, generic_fix_call_dummy) + (generic_fix_call_dummy, generic_call_dummy_register_unwind): Move + dummy frame code from here... + * dummy-frame.c: ...to here. New file. + * dummy-frame.h: New file. + (generic_call_dummy_register_unwind): Declare. + (generic_find_dummy_frame): Declare. + * Makefile.in (SFILES): Add dummy-frame.c. + (dummy-frame.o): Specify dependencies. + (dummy_frame_h): Define. + (COMMON_OBS): Add dummy-frame.o. + (blockframe.o): Update dependencies. + +2002-11-08 Jim Blandy + + * dwarf2read.c (read_func_scope): Restore local_symbols and + param_symbols after we finish the function context. (Based on a + patch from David Edelsohn.) + +2002-11-08 David Carlton + + * linespec.c (symbol_found): New function. + (minsym_found): New function. + (decode_line_1): Separate out some code into separate functions. + +2002-11-08 Joel Brobecker + + * i386-tdep.c (i386_frameless_signal_p): Make non static for + the benefit of the interix target. + * i386-tdep.h (i386_frameless_signal_p): Declare. + +2002-11-08 Andrew Cagney + + * i386-tdep.h (i386_linux_orig_eax_regnum_p): Delete stray + declaration that snuck in from change below. + +2002-11-06 Andrew Cagney + + * i386-tdep.c (i386_mmx_regnum_p): Rename mmx_regnum_p. Update + all callers. + (i386_fp_regnum_p): New function. Use instead of FP_REGNUM_P. + (i386_fpc_regnum_p): New function. Use instead of FPC_REGNUM_P. + (i386_sse_regnum_p): New function. Use instead of SSE_REGNUM_P. + (i386_mxcsr_regnum_p): new function. Use instead of + MXCSR_REGNUM_P. + * i386-tdep.h (SSE_REGNUM_P): Delete macro. + (i386_sse_regnum_p): Declare. + (i386_mxcsr_regnum_p): Declare. + (FP_REGNUM_P, FPC_REGNUM_P): Delete macros. + (i386_fp_regnum_p, i386_fpc_regnum_p): Declare. + (IS_FP_REGNUM): Update definition. + (IS_FPU_CTRL_REGNUM): Update definition.. + (IS_SSE_REGNUM): Update definition.. + * i386v-nat.c (register_u_addr): Update. + * go32-nat.c (fetch_register): Update. + (store_register): Update. + +2002-11-07 Joel Brobecker + + Preparation work to convert the hppa targets to multiarch partial. + + * hppa-tdep.c: Add new functions replacing macro bodies from + config/pa/tm-hppa.h. These function will be used to initialize + the gdbarch structure. Import some comments from tm-hppa.h, + and place them where appropriate, to avoid loosing them when + we cleanup this file. + (hppa_reg_struct_has_addr): New function. + (hppa_inner_than): New function. + (hppa_stack_align): New function. + (hppa_pc_requires_run_before_use): New function. + (hppa_instruction_nullified): New function. + (hppa_register_byte): New function. + (hppa_register_virtual_type): New function. + (hppa_store_struct_return): New function. + (hppa_cannot_store_register): New function. + (hppa_frame_args_address): New function. + (hppa_frame_locals_address): New function. + (hppa_smash_text_address): New function. + (hppa_coerce_float_to_double): New function. Requires the inclusion + of "language.h". + + * Makefile.in (hppa-tdep.o): Add dependency on language.h. + + * tm-hppa.h (REG_STRUCT_HAS_ADDR): Change the definition of this + gdbarch-eligible macro to a call to the new associated function + created in hppa-tdep.c. + (INNER_THAN): Likewise. + (STACK_ALIGN): Likewise. + (PC_REQUIRES_RUN_BEFORE_USE): Likewise. + (INSTRUCTION_NULLIFIED): Likewise. + (REGISTER_BYTE): Likewise. + (REGISTER_VIRTUAL_TYPE): Likewise. + (STORE_STRUCT_RETURN): Likewise. + (CANNOT_STORE_REGISTER): Likewise. + (FRAME_ARGS_ADDRESS): Likewise. + (FRAME_LOCALS_ADDRESS): Likewise. + (SMASH_TEXT_ADDRESS): Likewise. + (COERCE_FLOAT_TO_DOUBLE): Likewise. + (ABOUT_TO_RETURN): Delete, as no longer used. + +2002-11-07 Fernando Nasser + + * printcmd.c (disassemble_command): Remove obsolete function. + (_initialize_printcmd): Do not create disassemble command here. + * cli/cli-cmds.c (disassemble_command): New function. Implements + disassemble command. + (init_cli_cmds): Create disassemble command here instead. + +2002-11-07 Andrew Cagney + + * MAINTAINERS: Add Daniel Jacobowitz to global maintainers list. + +2002-11-07 Andrew Cagney + + * regcache.h (regcache_cooked_read_using_offset_hack) + (regcache_cooked_write_using_offset_hack): Delete declarations. + (register_changed): Delete declaration. + * regcache.c (regcache_cooked_read_using_offset_hack) + (regcache_cooked_write_using_offset_hack): Delete functions. + (cooked_xfer_using_offset_hack): Delete function. + (register_changed): Delete function. + +2002-11-07 Jim Blandy + + * macroscope.c: #include "complaints.h". + (sal_macro_scope): Cope with filenames that appear in the symtabs, + but not in the macro table. + * Makefile.in (macroscope.o): Record dependency. + +2002-11-07 Joel Brobecker + + * PROBLEMS: Document gdb/816 (unable to read core file on alpha-osf). + +2002-11-07 Andrew Cagney + + * regcache.c (deprecated_registers_fetched): Update. + * regcache.h (deprecated_registers_fetched): Rename + registers_fetched. + * remote-vxsparc.c (vx_read_register): Update. + * remote-vxmips.c (vx_read_register): Update. + * remote-vx68.c (vx_read_register): Update. + * irix5-nat.c (fetch_core_registers): Update. + * mipsm3-nat.c (fetch_inferior_registers): Update. + * sun3-nat.c (fetch_inferior_registers): Update. + * symm-nat.c (fetch_inferior_registers): Update. + * ns32knbsd-nat.c (fetch_inferior_registers): Update. + (fetch_core_registers): Update. + (fetch_kcore_registers): Update. + * mips-nat.c (fetch_inferior_registers): Update. + * corelow.c (get_core_registers): Update. + * a68v-nat.c (fetch_inferior_registers): Update. + +2002-11-06 Joel Brobecker + + Put in place the framework necessary for multiarching the hppa targets. + * hppa-tdep.c (hppa_gdbarch_init): New function. + (hppa_dump_tdep): New function. + (_initialize_hppa_tdep): Register the hppa gdbarch init function and + tdep structure dumper. + * config/pa/tm-hppa.h (GDB_MULTI_ARCH): New macro, defined to 0 + until the multi-arching conversion has partially been completed. + +2002-11-06 Andrew Cagney + + * valops.c (value_assign): Merge lval_register case into + lval_reg_frame_relative. Use frame_register and + regcache_cooked_write instead of get_saved_register and + write_register_bytes. After flushing the register cache, try to + re-select the selected frame. + +2002-11-06 Andrew Cagney + + * regcache.h (deprecated_register_valid): Rename register_valid. + * regcache.c: Update. + * ia64-aix-nat.c: Update. + * i386gnu-nat.c: Update. + * alpha-nat.c: Update. + * sparc-nat.c: Update. + * lynx-nat.c: Update. + * remote-mips.c: Update. + +2002-11-06 Joel Brobecker + + * hppa-tdep.c (_initialize_hppa_tdep): Move function body + to end of file, to be more consistent with the pratice followed + by other targets. + +2002-11-06 Andrew Cagney + + * infcmd.c: Include "reggroups.h" and . + (print_float_info): Print registers in float_reggroup. + (print_vector_info): Print registers in vector_reggroup. + (default_print_registers_info): When all, print registers in + all_reggroup. Otherwize, print registers in general_reggroup. + (registers_info): Rewrite. Add support for register groups. + Eliminate a goto. + +2002-11-06 Elena Zannoni + + * symtab.c (methods_info): Delete. It has been ifdeffed out for + ages. + (symtab_symbol_info): Remove eons old ifdeffed out code. + (_initialize_symtab): Remove prehistoric disabled 'info methods' + command. + +2002-11-06 Theodore A. Roth + + * c-exp.y: Add missing semi-colons. + * f-exp.y: Add missing semi-colons. + * m2-exp.y: Add missing semi-colons. + * p-exp.y: Add missing semi-colons. + Add empty action to start rule to avoid a type clash error when + building with bison >= 1.50. + +2002-11-06 Jim Blandy + + * macrotab.h (struct macro_source_file): Doc fix. + +2002-11-05 Jeff Johnston + + * varobj.c (child_exists, cplus_number_of_children): Change + STREQ macro references to strcmp. + (cplus_name_of_child): Change code to handle the fact that + fields are not necessarily contiguous with regards to their + access control. This is a fix for PR gdb/792. + +2002-11-05 Andrew Cagney + + * gdbarch.sh (GET_SAVED_REGISTER): Change to a predicate function. + * gdbarch.h, gdbarch.c: Regnerate. + * frame.h (frame_register): Declare. + * frame.c (frame_register): New function. + (get_saved_register): Test GET_SAVED_REGISTER_P before calling + GET_SAVED_REGISTER, otherwize call + generic_unwind_get_saved_register. + (frame_register_read): Use frame_register instead of + get_saved_register. + +2002-11-05 Elena Zannoni + + From Jim Ingham : + * event-top.c (gdb_disable_readline): New function. + (_initialize_event_loop): Move comment. + +2002-11-05 Elena Zannoni + + * event-loop.c (start_event_loop): Add comment. + Update copyright. + +2002-11-05 Andrew Cagney + + * infcmd.c (default_print_registers_info): Do not call + PRINT_REGISTER_HOOK. + +2002-11-05 Andrew Cagney + + * sparc-tdep.c (sparc_print_register_hook): Make static. + (sparc_print_registers_info): New function. + (sparc_do_registers_info): New function. + (sparclet_print_registers_info): New function. + (sparclet_do_registers_info): New function. + (do_sparc_print_registers_info): New function. + (sparc_print_registers): New static function, clone of infcmd.c's + default_print_registers_info. + * config/sparc/tm-sparclet.h (PRINT_REGISTER_HOOK): Delete macro. + (sparclet_do_registers_info): Declare. + (DEPRECATED_DO_REGISTERS_INFO): Re-define. + * config/sparc/tm-sparc.h (DEPRECATED_DO_REGISTERS_INFO): + Re-define. + (sparc_do_registers_info): Declare. + (PRINT_REGISTER_HOOK): Delete macro. + (sparc_print_register_hook): Delete declaration. + +2002-11-05 David Carlton + + * symtab.c (lookup_symbol_aux): Move chunks of code into separate + functions. + (lookup_symbol_aux_local): New function. + (lookup_symbol_aux_symtabs): New function. + (lookup_symbol_aux_psymtabs): New function. + +2002-11-05 David Carlton + + * symtab.c (lookup_symbol_aux): In minsym sections, don't use the + previous values of 'objfile' and 'block'. + +2002-11-05 Pierre Muller + + * values.c (value_change_enclosing_type): Set + enclosing_type field correctly also for the case where + more memory needs to be allocated. + +2002-11-03 Mark Kettenis + + * i387-tdep.c (i387_print_float_info): Call fputs_filtered instead + of puts_filtered. + + * i387-tdep.c (i387_print_float_info): Replace calls to + register_read and deprecated_read_register_gen with calls to + frame_register_read, and make the necessary adjustments to the + surrounding code. + +2002-11-02 Andrew Cagney + + * gdbarch.sh (register_reggroup_p): Allow default value. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-11-02 Andrew Cagney + + * regcache.h: Add coment indicating replacements for deprecated + functions. + +2002-11-02 Andrew Cagney + + * reggroups.h, reggroups.c: New files. + * regcache.c: Include "reggroups.h". + (enum regcache_dump_what): Add `regcache_dump_groups'. + (regcache_dump): Contract size of the "Type" column. When + specified, dump the register's groups. + (maintenance_print_register_groups): New function. + (_initialize_regcache): Add command `maint print register-groups'. + * Makefile.in (COMMON_OBS): Add reggroups.o + (SFILES): Add reggroups.c. + (reggroups_h): Define. + (regcache.o, gdbarch.o): Update dependencies. + (reggroups.o): Specify dependencies. + * gdbarch.sh (register_reggroup_p): Add pure multi-arch method. + Add opaque declaration for `struct reggroup' in generated .h file. + Include "reggroups.h" in generated .c file. + gdbarch.h, gdbarch.c: Re-generate. + +2002-11-02 Andrew Cagney + + * regcache.h (deprecated_read_register_gen): Rename + read_register_gen. + (deprecated_write_register_gen): Rename write_register_gen. + * i387-tdep.c: Update. + * x86-64-linux-nat.c: Update + * wince.c: Update. + * thread-db.c: Update. + * win32-nat.c: Update. + * mips-tdep.c: Update. + * d10v-tdep.c: Update. + * cris-tdep.c: Update. + * remote-sim.c: Update. + * remote-rdi.c: Update. + * remote-rdp.c: Update. + * frame.c: Update. + * target.c: Update. + * blockframe.c: Update. + * x86-64-tdep.c: Update. + * xstormy16-tdep.c: Update. + * sh-tdep.c: Update. + * s390-tdep.c: Update. + * rs6000-tdep.c: Update. + * sparc-tdep.c: Update. + * i386-tdep.c: Update. + * dwarf2cfi.c: Update. + * regcache.c: Update. + +2002-11-01 Joel Brobecker + + New interix-specific files: + * config/i386/nm-interix.h: New file. + * config/i386/interix.mh: New file. + * config/i386/interix.mt: New file. + * i386-interix-nat.c: New file. + * i386-interix-tdep.c: New file. + +2002-11-01 Andrew Cagney + + * frame.h (deprecated_generic_get_saved_register): Rename + generic_get_saved_register. + * blockframe.c (deprecated_generic_get_saved_register): Update. + * xstormy16-tdep.c (xstormy16_get_saved_register): Update. + (xstormy16_frame_saved_register): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_get_saved_register): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * config/m32r/tm-m32r.h (GET_SAVED_REGISTER): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + +2002-10-31 Daniel Jacobowitz + + * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step. + +2002-10-31 Daniel Jacobowitz + + * i386-linux-tdep.c (i386_linux_pc_in_sigtramp): Check for + trampolines in sigaction. + +2002-10-31 Andrew Cagney + + * h8300-tdep.c: Include "gdb_assert.h". + (h8300_print_register): Add gdbarch, file and frame parameters. + Use frame_read_unsigned_register to read the register's value. + Use fprintf_filtered to display output. + (h8300_print_registers_info): Replace h8300_do_registers_info. + (h8300_gdbarch_init): Set print_registers_info. + +2002-10-31 Andrew Cagney + + * frame.c (frame_read_unsigned_register): New function. + (frame_read_signed_register): New function. + * frame.h (frame_read_unsigned_register): Declare. + (frame_read_signed_register): Declare. + +2002-10-31 Andrew Cagney + + * h8500-tdep.c (h8500_print_registers_info): New static function, + clone of infcmd.c's default_print_registers_info. + (h8500_do_registers_info): New funtion. + (h8500_print_register_hook): Rename print_register_hook, make + static. + + * config/h8500/tm-h8500.h: Update copyright. + (DEPRECATED_DO_REGISTERS_INFO): Define. + (h8500_do_registers_info: Declare. + (PRINT_REGISTER_HOOK): Delete macro. + (print_register_hook): Delete function. + +2002-10-31 Andrew Cagney + + * z8k-tdep.c (z8k_print_register_hook): Make static. + (z8k_print_registers_info): New static function, clone of + infcmd.c's default_print_registers_info. + (z8k_do_registers_info): New function. Wrap + z8k_print_registers_info. + * config/z8k/tm-z8k.h: Update copyright. + (PRINT_REGISTER_HOOK): Delete macro. + (z8k_print_register_hook): Delete declaration. + (DEPRECATED_DO_REGISTERS_INFO): Define. + (z8k_do_registers_info): Declare. + +2002-10-30 Joel Brobecker + + * hppa-tdep.c (find_function_in_inferior): Remove this extern, + as this is already provided by value.h, and was actually causing + a compilation error because of a conflict in parameter type + declaration due to a missing const keyword. + (low_text_segment_addres): Fix a compilation warning. + +2002-10-29 Daniel Jacobowitz + + * mips-linux-nat.c (mips_linux_cannot_fetch_register): Don't fetch + registers without a name. + (mips_linux_cannot_store_register): Don't store registers without + a name. + +2002-10-28 David Carlton + + * symtab.c (find_addr_symbol): Delete. (It was already commented + out.) + * symtab.h: Delete prototype for find_addr_symbol. + +2002-10-26 Andrew Cagney + + * gdbarch.sh (DEPRECATED_DO_REGISTERS_INFO): Rename + DO_REGISTERS_INFO. + gdbarch.h, gdbarch.c: Re-generate. + * infcmd.c (default_print_registers_info): Update reference. + * mips-tdep.c (mips_gdbarch_init): Set deprecated_do_registers_info. + (mips_dump_tdep): Do not print DO_REGISTERS_INFO. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + +2002-10-26 Mark Kettenis + + * x86-64-tdep.c (x86_64_init_abi): Set init_extra_frame_info to + cfi_init_extra_frame_info. + * x86-64-tdep.h (x86_64_init_extra_frame_info): Remove prototype. + * x86-64-linux-tdep.c (x86_64_init_extra_frame_info): Remove function. + + * x86-64-tdep.c (x86_64_init_abi): Add calls to override the i386 + target where necessary. Add more comments and remove the ones + that don't provide any useful information. + + * i386-tdep.c (i386_frame_saved_pc): Replace call to + deprecated_read_register_dummy with + frame_unwind_unsigned_register. + + * i386-tdep.c (i386_extract_struct_value_address): Use + regcache_raw_read_unsigned instead of + regcache_cooked_read_unsigned since we know that the register + we're reading isn't a pseudo register. Rename variable 'val' into + the more descriptive 'addr'. + + * x86-64-tdep.c: Fix some formatting problems, mostly in comments. + (x86_64_push_return_address): Add comment. + (x86_64_pop_frame): Make static. + (examine_argument): Clarify comment. + (x86_64_skip_prologue): Make prolog_expact variable static. + + * dwarf2cfi.c: Fix some formatting problems. + (context_cpy, read_encoded_pointer): Clarify comments. + + * x86-64-tdep.c (x86_64_breakpoint_from_pc): Constify. + (x86_64_init_abi): Move set_gdbarch_* calls that overlap with the + i386 target back into x86_64_gdbarch_init. Add some comments and + remove meaningless ones. + +2002-10-25 Andrew Cagney + + * complaints.h (struct deprecated_complaint): Rename `struct + complaint'. + * complaints.c (complain): Update. + * remote-vx68.c, remote-vxmips.c, remote-vxsparc.c: Delete + incorrect comment indicating that "symfile.h" was being included + for the `struct complaint' definition. + * remote-vx.c: Update. + * objc-lang.c: Update. + * xcoffread.c: Update. + * hpread.c: Update. + * mdebugread.c: Update. + * stabsread.c: Update. + * dwarf2read.c: Update. + * dwarfread.c: Update. + * elfread.c: Update. + * coffread.c: Update. + * stabsread.h: Update. + * dbxread.c: Update. + * buildsym.c: Update. + * gdbtypes.c: Update. + * macrotab.c: Update. + +2002-10-25 Mark Kettenis + + * x86-64-tdep.c (x86_64_gdbarch_init): Make a bit more similar to + the version in i386-tdep.c. Move set_gdbarch_* calls out into... + (x86_64_init_abi): ...new function. + + * Makefile.in (i386v-nat.o): Add $(i386_tdep_h). + * i386v-nat.c: Include "i386-tdep.h". + +2002-10-25 Andrew Cagney + + * gdbtypes.c (address_space_name_to_int): Update. + (address_space_int_to_name): Update. + * gdbarch.sh (address_class_type_flags_to_name): Change to a pure + multi-arch predicate. + (address_class_name_to_type_flags): Ditto. + * gdbarch.h, gdbarch.c: Re-generate. + + * MAINTAINERS: Check all warnings when h8300hms and alpha-elf. + +2002-10-24 Martin M. Hunt + + * utils.c (string_to_core_addr): Revert patch from 11 Oct. + +2002-10-24 Elena Zannoni + + * symtab.h (INIT_SAL): Delete macro. + (init_sal): Export. + * symtab.c (init_sal): New function. + + * ada-lang.c (ada_finish_decode_line_1): Change INIT_SAL macro + to init_sal function call. + (find_sal_from_funcs_and_line): Ditto. + (all_sals_for_line): Ditto. + * breakpoint.c (create_internal_breakpoint): Ditto. + (create_fork_vfork_event_catchpoint): Ditto. + (create_exec_event_catchpoint): Ditto. + (parse_breakpoint_sals): Ditto. + (watch_command_1): Ditto. + (handle_gnu_4_16_catch_command): Ditto. + (clear_command): Ditto. + * hppa-tdep.c (child_enable_exception_callback): Ditto. + * infcmd.c (run_stack_dummy): Ditto. + * infrun.c (process_event_stop_test): Ditto. + (check_sigtramp2): Ditto. + (step_over_function): Ditto. + * linespec.c (decode_line_2): Ditto. + (decode_line_1): Ditto. + * source.c (line_info): Ditto. + * symtab.c (find_pc_sect_line): Ditto. + +2002-10-24 Michal Ludvig + + * dwarf2cfi.c (struct context) + (struct context_reg): Moved to dwarf2cfi.h + (context_alloc, frame_state_alloc, context_cpy): + Made extern instead of static, removed prototypes. + * dwarf2cfi.h (struct context) + (struct context_reg): New, moved from dwarf2cfi.c + (context_alloc, frame_state_alloc, context_cpy): + New prototypes. + * x86-64-linux-tdep.c (x86_64_linux_sigtramp_saved_pc): + Changed from static to extern. + (LINUX_SIGINFO_SIZE, LINUX_SIGCONTEXT_PC_OFFSET) + (LINUX_SIGCONTEXT_FP_OFFSET) + (LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Adjusted. + (x86_64_linux_in_sigtramp, x86_64_linux_frame_chain) + (x86_64_init_frame_pc, x86_64_init_extra_frame_info): New. + * x86-64-tdep.c (x86_64_gdbarch_init): Several + set_gdbarch_*() calls now use x86-64 specific functions + instead of DWARF2 CFI ones. + * x86-64-tdep.h (x86_64_linux_in_sigtramp) + (x86_64_linux_frame_chain, x86_64_init_frame_pc) + (x86_64_init_extra_frame_info): New prototypes. + +2002-10-23 David Carlton + + * linespec.c: #include "parser-defs.h". + Delete prototype for find_template_name_end. + * Makefile.in (linespec.o): Depend on $(parser_defs_h). + +2002-10-23 Jeff Johnston + + * NEWS: add recent mi fixes. + * varobj.c (struct varobj): Add new "updated" flag. + (new_variable): Default "updated" flag to 0. + (varobj_set_value): Set "updated" flag to 1 if value + changes. + (varobj_update): Check varobj "updated" flag before + comparing old and refreshed values. Fix for + PR gdb/702. + +2002-10-23 David Carlton + + * parse.c (parse_exp_1): Use BLOCK_START. + * x86-64-tdep.c (x86_64_skip_prologue): Use BLOCK_END, + SYMBOL_BLOCK_VALUE. + * objc-lang.c (find_methods): Use BLOCK_START, BLOCK_END. + +2002-10-23 David Carlton + + * symtab.c: Delete cplusplus_hint. + Delete prototype for find_template_name_end. + +2002-10-23 Elena Zannoni + + * symtab.h: Update comment. + +2002-10-23 Michael Snyder + + * printcmd.c (address_info): Restore quotes in output. + * valops.c (value_of_local): Restore quotes in error message. + +2002-10-23 Elena Zannoni + + * symtab.c (symbol_demangled_name): New function. + * symtab.h (SYMBOL_DEMANGLED_NAME): Simplify macro, by + turning most of it into a function. + (symbol_demangled_name): Export. + +2002-10-23 Michael Snyder + + * valops.c (value_of_local): Restore quotes in error message. + +2002-10-23 Elena Zannoni + + * symtab.c (symbol_init_language_specific): New function. + * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by + turning most of it into a function. + (symbol_init_language_specific): Export. + +2002-10-23 David Carlton + + * dwarf2read.c (dwarf_tag_name): Add DWARF 3 names. + (dwarf_attr_name): Ditto. + (dwarf_type_encoding_name): Ditto. + (scan_partial_symbols): Descend into DW_TAG_namespace entries. + (process_die): Handle DW_TAG_namespace, + DW_TAG_imported_declaration, DW_TAG_imported_module. + (read_namespace): New function. + +2002-10-22 Joel Brobecker + + * configure.in: Define NEW_PROC_API on Interix too. + * configure: Regenerate. + +2002-10-21 Joel Brobecker + + * configure: Regenerate using the proper version of autoconf. + +2002-10-21 Elena Zannoni + + * findvar.c (read_var_value): Temporarily disable TLS code, until + complete TLS support is added. + +2002-10-21 Jim Blandy + Elena Zannoni + + * symtab.h (address_class): Re-add LOC_THREAD_LOCAL_STATIC + for thread local storage locations. + (struct symbol): Add objfile field. + (SYMBOL_OBJFILE): Define. + * dwarf2read.c (is_thread_local): New static variable. + (new_symbol): If variable is in thread local fill in address class + and objfile appropriately. + (decode_locdesc): Recognize and handle DW_OP_GNU_push_tls_address + stack operation. + * printcmd.c (address_info): Print the information for thread + local storage variable. + * findvar.c (read_var_value): In case of thread local variable, + defer to the target vector code to compute address. + +2002-10-21 Elena Zannoni + + * solib-svr4.c (svr4_fetch_objfile_link_map): New function. + * solib-svr4.h (svr4_fetch_objfile_link_map): Export. + +2002-10-21 Elena Zannoni + + * symtab.h (address_class): Rename + LOC_THREAD_LOCAL_STATIC to LOC_HP_THREAD_LOCAL_STATIC. + * hpread.c (hpread_process_one_debug_symbol): Ditto. + * printcmd.c (address_info): Ditto. + * findvar.c (symbol_read_needs_frame, read_var_value): Ditto. + +2002-10-20 Mark Kettenis + + * i386bsd-nat.c (i386bsd_dr_set, i386bsd_dr_get_status): Use + DBREG_DRX macro to acces debug registers. + + * Makefile.in (i386obsd-tdep.o): New target. + + * solib-sunos.c: Include "bcache.h" and "regcache.h". + * Makefile.in (solib-sunos.o): Add $(bcache_h) and $(regcache_h). + + * configure.tgt (i[3456]86-*-openbsd*): Set gdb_target to obds. + * config/i386/obsd.mt: New file. + * i386bsd-nat.c (_initialize_i386bsd_nat): Introduce + i386obsd_sc_pc_offset and i386obsd_sc_sp_offset; + * i386obsd-nat.c (_initialize_i386obsd_nat): Set + i386obsd_sigtramp_start and i386obsd_sigtramp_end instead of + i386nbsd_sigtramp_start and i386nbsd_sigtramp_end. + * i386obsd-tdep.c: New file. + +2002-10-19 Adam Fedor + + * objc-exp.y (name_not_typename): Fix invalid comment. + +2002-10-20 Mark Kettenis + + * solib-sunos.c (allocate_rt_common_objfile): Use bcache_xmalloc + to allocate partial syms and macro byte caches. + +2002-10-18 David Carlton + + * symtab.h: Delete 'struct source' and 'struct sourcevector'. + +2002-10-18 Adam Fedor + + * stabsread.c (find_name_end): New function. + (define_symbol): Use it. + +2002-10-18 Daniel Jacobowitz + + * config/alpha/nm-fbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1. + * config/alpha/nm-linux.h (CANNOT_STEP_BREAKPOINT): Define to 1. + * config/alpha/nm-nbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1. + * config/alpha/nm-osf.h (CANNOT_STEP_BREAKPOINT): Define to 1. + +2002-10-17 David Carlton + + * symfile.h: Add opaque declaration for struct obstack. + Declare obsavestring to take a const char *. + * symfile.c (obsavestring): Make first argument a const char *. + +2002-10-16 Adam Fedor + + * breakpoint.c (parse_breakpoint_sals): Ignore ObjC method + names when matching breakpoints in current file. + +2002-10-16 Kevin Buettner + + * dwarf2read.c (dwarf2_invalid_pointer_size): New complaint. + (read_tag_pointer_type): Add address class support. + * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS) + (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME, ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): + New methods. + * gdbarch.h, gdbarch.c: Regenerate. + * gdbtypes.c (address_space_name_to_int, address_space_int_to_name) + (make_type_with_address_space, recursive_type_dump): Add address + class support. + * gdbtypes.h (TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2) + (TYPE_FLAG_ADDRESS_CLASS_ALL, TYPE_ADDRESS_CLASS_1) + (TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): New defines + +2002-10-16 Klee Dienes + + * stabsread.c (read_tilde_fields): Use name[sizeof(vptr_name)-2] + to get the last character of a char[] buffer, not + name[sizeof(vptr_name)-1]. + +2002-10-14 Adam Fedor + + * symtab.h: New objc_specific struct. + (SYMBOL_INIT_LANGUAGE_SPECIFIC): Handle ObjC. + (SYMBOL_DEMANGLED_NAME): Likewise. + +2002-10-14 Adam Fedor + + * symfile.c (init_filename_language_table): Add ObjC file extension. + +2002-10-14 Adam Fedor + + * utils.c (puts_filtered_tabular): New function. + (fprintf_symbol_filtered): Get ObjC demangled name. + * defs.h (puts_filtered_tabular): Declared. + +2002-10-14 Kevin Buettner + + * c-lang.h (c_type_print_varspec_prefix): Delete. + * c-typeprint.c (c_type_print_varspec_prefix): Make static. Add + ``need_post_space'' parameter. Adjust all callers. + +2002-10-14 Daniel Jacobowitz + + * config/mips/nm-irix4.h (HAVE_NONSTEPPABLE_WATCHPOINT): Define to 1. + * config/mips/nm-irix5.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. + * config/mips/tm-embed.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. + * config/pa/nm-hppah.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise. + +2002-10-13 Adam Fedor + + * source.c (print_source_lines): Update comments. + +2002-10-13 Adam Fedor + + * valops.c (value_of_local): New function. + (value_of_this): Use it. + * value.h (value_of_local): Declared. + +2002-10-13 Adam Fedor + + * parse.c: (length_of_subexp, prefixify_subexp): Handle + OP_MSGCALL, OP_SELECTOR, OP_NSSTRING, and OP_SELF. + +2002-10-12 Adam Fedor + + * language.c (binop_result_type): Add language_objc to case. + (integral_type): Likewise. + (character_type): Likewise. + (string_type): Likewise. + (boolean_type): Likewise. + (structured_type): Likewise. + (binop_type_check): Likewise. + +2002-10-11 Adam Fedor + + * printcmd.c (address_info): Print 'self' for ObjC. + +2002-10-11 Adam Fedor + + * expression.h: New ops OP_NSSTRING, OP_SELECTOR, OP_MSGCALL, and + OP_SELF. + +2002-10-11 Adam Fedor + + * language.h (CAST_IS_CONVERSION): Add language_objc. + +2002-10-11 Adam Fedor + + * defs.h (enum language): Add language_objc. + +2002-10-11 Klee Dienes + + * corefile.c (read_memory_typed_address): New function. + * gdbcore.h (read_memory_typed_address): Add prototype. + * blockframe.c (sigtramp_saved_pc): Use read_memory_typed_address + to read a value destined for a CORE_ADDR, not read_memory_integer. + * f-valprint.c (f77_get_dynamic_upperbound): Ditto. + (f77_get_dynamic_lowerbound): Ditto. + +2002-10-11 Martin M. Hunt + + * utils.c (string_to_core_addr): After turning string into + a number, convert to a CORE_ADDR using INTEGER_TO_ADDRESS + which will do necessary sign-extension, etc. + +2002-10-11 Daniel Jacobowitz + + * c-exp.y (THIS): Delete token and grammar rule. + (yylex): Don't return THIS. + * cp-valprint.c (vtbl_ptr_name_old): Delete. + (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old. + * demangle.c (cplus_markers): Update comment. Put '$' + first. Remove CPLUS_MARKER. + (_initialize_demangler): Don't call set_cplus_marker_for_demangling. + * jv-exp.y (THIS): Delete token and grammar rule. + (yylex): Don't return THIS. + * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER. + * objc-exp.y (THIS): Delete token and grammar rule. + (yylex): Don't return THIS. + * p-exp.y (yylex): Remove reference to CPLUS_MARKER. + * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'. + (read_member_functions): Likewise for opname. + (read_tilde_fields): Use is_cplus_marker. + + * defs.h (CPLUS_MARKER): Don't define. + * config/tm-sysv4.h (CPLUS_MARKER): Likewise. + * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise. + * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise. + * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise. + * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise. + + * config/i386/tm-i386v4.h: Delete file. + * config/djgpp/fnchange.lst: Delete tm-i386v4.h. + * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead. + * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead. + * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead. + * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h. + * config/i386/i386sco5.mt (TM_FILE): Likewise. + * config/i386/i386v4.mt (TM_FILE): Likewise. + * config/i386/ncr3000.mt (TM_FILE): Likewise. + +2002-10-10 Marko Mlinar + + * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C, + accidentially not commited 2002-10-09 + * gdbarch.h, gdbarch.c: Re-generate. + +2002-10-09 Marko Mlinar + + * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C. + * gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Add. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-10-08 Petr Sorfa + + Revised and re-submitted by John Wolfe + + Move the Dwarf 2 abbrev table to a per-compilation-unit structure, + so we can work on more than one compilation unit at a time. This + helps prepare GDB to handle inter-CU die references. + * dwarf2read.c (ABBREV_HASH_SIZE): moved definition forward in + the code to be defined before struct comp_unit_head. + (comp_unit_head): Added new members - offset, cu_head, + begin_die, next and dwarf2_abbrevs. + (dwarf2_abbrevs): Removed single static var; now member of + struct comp_unit_head. + dwarf2_build_psymtabs_hard): Complete new struct comp_unit_head + members. + (psymtab_to_symtab_1): Changed to work with the new + struct comp_unit_head. + (dwarf2_read_abbrevs): Now accepts a cu_header parameter and + constructs the dwarf2_abbrevs[] inside the cu_header. + (dwarf2_empty_abbrev_table): Now expects a ptr to a + dwarf2_abbrev table to clean up. + (dwarf2_lookup_abbrev): Now accepts a cu_header parameter and + handling of dwarf2_abbrevs inside the cu_header. + (read_partial_die): Now supports the call to the new + dwarf2_lookup_abbrev. + (read_full_die): Now supports the call to the new + dwarf2_lookup_abbrev. + +2002-10-06 Christopher Faylor + + * Makefile.in (install-gdbtk): Add missing continuation backslash to + insure that shell variables, such as "transformed_name" are propagated + to later shell statements in rule. + +2002-10-06 Mark Kettenis + + * config/i386/nm-i386sco.h: Add protection against + multiple-inclusion. Include "i386/nm-i386v.h". + (REGISTER_U_ADDR): Remove define. + (i386_register_u_addr): Remove prototype. + +2002-10-04 Michael Snyder + + * m32r-stub.c (handle_exception): Make sure exception is "trap" + before treating it as a single-step event. + +2002-10-03 Adam Fedor + + * objc-lang.c: ARI fixes. Change string.h to gdb_string.h. + (objc_demangle): Remove assignment in if statements, Replace + free with xfree. + (add_msglist): Likewise. + (end_msglist): Likewise. + (complare_selectors): Likewise. + (selectors_info): Likewise. + (compare_classes): Likewise. + (classes_info): Likewise. + (print_object_command): Likewise. + (find_objc_msgcall_submethod): Replace PTR with void *. + * objc-lang.h: Remove check for __STDC__. + +2002-10-03 Jeff Johnston + + * ui-out.h (ui_out_field_fmt_int): New prototype. + * ui-out.c (ui_out_field_fmt_int): New function allowing specification + of field width and alignment. + * stack.c (print_frame_info_base): When printing frame level, use + ui_out_field_fmt_int with a width of 2 and left alignment. Fix for + PR gdb/192 + +2002-10-03 Jeff Johnston + + * MAINTAINERS: Add self to Write After Approval list. + +2002-10-02 Elena Zannoni + + * infcmd.c (interrupt_target_command_wrapper): Delete. + (interrupt_target_command): Make non static. + (nofp_registers_info): Make static. + * stack.c (return_command_wrapper): Delete. + (return_command): Make non static. + +2002-10-02 Elena Zannoni + + * event-top.c (gdb_setup_readline): New function. Code moved from + _initialize_event_loop(). + (_initialize_event_loop): Call gdb_setup_readline(). + +2002-10-02 Andrew Cagney + + * infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C. + * gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-10-02 Daniel Jacobowitz + + Fix PR gdb/778 + * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef + before recursing. + * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value + of fill_in_vptr_fieldno. + +2002-10-02 Elena Zannoni + + * inferior.h (registers_info, stepi_command, nexti_command, + continue_command, interrupt_target_command): Export from infcmd.c. + * frame.h (args_info, selected_frame_level_changed_hook, + return_command): Export from stack.c. + * v850ice.c (stepi_command, nexti_command, continue_command): use + prototypes from inferior.h. + * tracepoint.c (registers_info, args_info, locals_info): Use + prototypes from frame.h and inferior.h. + * Makefile.in (mi-main.o): Add dependency on frame.h. + +2002-10-02 Andrew Cagney + + * rs6000-tdep.c (rs6000_store_struct_return): Store struct_return + value in register 3 adjusted by ppc_gp0_regnum. + + * rs6000-tdep.c (skip_prologue): Bias alloca_reg by ppc_gp0_regnum. + +2002-10-02 Marko Mlinar + + * MAINTAINERS: Add myself to the Write After Approval list. + +2002-10-01 Alexandre Oliva + + * mips-tdep.c (mips_find_abi_section): .mdebug.abi64 is the name + of the section for the N64 ABI, fixed. + + * config/mips/tm-irix6.h: Include solib.h. + +2002-10-01 Elena Zannoni + + * dwarf2read.c (dwarf_stack_op_name): Recognize more dwarf3 and + GNU operators. + +2002-10-01 Andrew Cagney + + * NEWS: Mention that MI syntax, selected by "mi" changed to "mi2" + and that "mi0" syntax has been removed. + +2002-09-30 David Carlton + + * Makefile.in (ppc-sysv-tdep.o): Depend on gdb_string_h. + * ppc-sysv-tdep.c: #include "gdb_string.h". + * remote-sds.c (getmessage): Add semicolon after 'retry' label to + pacify GCC. + +2002-10-01 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): For powerpc:7400, fix + "vrsave"'s register number. + +2002-09-30 Andrew Cagney + + * mips-tdep.c (mips_frame_saved_pc): When a generic dummy frame, + use frame_unwind_signed_register to obtain the PC. + (mips_frame_chain): Handle a generic dummy frame. + (mips_init_extra_frame_info): When a generic dummy frame, don't + re-compute the frame base. + (mips_pop_frame): Handle generic dummy frames. + (mips_gdbarch_init): When generic dummy frames, set + use_generic_dummy_frames, push_dummy_frame to + generic_push_dummy_frame, pc_in_call_dummy to + generic_pc_in_call_dummy, and save_dummy_frame_top_of_stack to + generic_save_dummy_frame_tos. + +2002-09-30 Andrew Cagney + + * blockframe.c (generic_find_dummy_frame): Rewrite. Only test + against TOP when TOP was explictly set. + (generic_push_dummy_frame): Set TOP to zero. + +2002-09-30 Elena Zannoni + + * event-loop.c (start_event_loop): Rename variable 'result' to + 'gdb_result', to avoid conflicts with upcoming intepreters changes. + +2002-09-30 Keith Seitz + + * gdb-events.sh (selected_thread_changed): New event. + * gdb-events.c: Regenerated. + * gdb-events.h: Regenerated. + +2002-09-30 Hans-Peter Nilsson + + * MAINTAINERS: Add self to Write After Approval list. + +2002-09-30 Fernando Nasser + + * disasm.c: New file. + * disasm.h: New file. + * mi/mi-cmd-disas.c (gdb_dis_asm_read_memory): Moved to disasm.c. + (compare_lines): Ditto. + (dump_insns): Ditto. + (do_mixed_source_and_assembly): Moved to disasm.c. Added uiout + argument. + (do_assembly_only): Ditto. + (do_disassembly): Renamed to gdb_disassembly and moved to + disasm.c. Sdded uiout argument. + * Makefile.in: Add new files. Reorder SFILES list. Update + dependencies. Include libgdb.a later in the insight executable. + +2002-09-29 Andrew Cagney + + * config/djgpp/fnchange.lst: Rename bfd/elf64-alpha.c and + bfd/elf64-alpha-fbsd.c. + +2002-09-29 Andrew Cagney + + * config/djgpp/fnchange.lst: Rename i386gnu-nat.c and + i386gnu-tdep.c. + +2002-09-29 Andrew Cagney + + * gnu-nat.h (debug): Use __FILE__ and __LINE__ instead of + __FUNCTION__. + * gnu-nat.c (do_mach_notify_no_senders): Replace __FUNCTION__ with + function name. + (do_mach_notify_port_deleted, do_mach_notify_msg_accepted): Ditto. + (do_mach_notify_port_destroyed, do_mach_notify_send_once): Ditto. + (S_proc_setmsgport_reply, S_proc_getmsgport_reply): Ditto. + (S_msg_sig_post_reply): Ditto. + +2002-09-28 Corinna Vinschen + + * sh-tdep.c (sh_use_struct_convention): Use definition according + to ABI. + (sh_push_arguments): Store in register with correct endianess. + (sh_default_store_return_value): Ditto. + (sh_gdbarch_init): Set sizeof long double to 8. + +2002-09-27 Mark Kettenis + + * defs.h: Move inclusion of "ansidecl.h" before "gdb_locale.h". + Fix some whitespace problems. + +2002-09-27 David Carlton + + * Makefile.in (cris-tdep.o): Depend on gdb_string_h. + (mcore-tdep.o): Ditto. + (ns32k-tdep.o): Ditto. + (ns32knbsd-tdep.o): Ditto. + (sh3-rom.o): Ditto. + (vax-tdep.o): Ditto. + * cris-tdep.c: #include "gdb_string.h" + * mcore-tdep.c: Ditto. + * ns32k-tdep.c: Ditto. + * ns32knbsd-tdep.c: Ditto. + * sh3-rom.c: Ditto. + * vax-tdep.c: Ditto. + +2002-09-27 David Carlton + + * config/djgpp/fnchange.lst: Add entries for + gdb/testsuite/gdb.c++/m-static files. + +2002-09-27 Jim Wilson + + * MAINTAINERS: Add myself to the Write After Approval list. + +2002-09-26 Martin M. Hunt + + * mips-tdep.c (find_proc_desc): Initialize startaddr. + + +2002-09-26 Andrew Cagney + + * rs6000-tdep.c (rs6000_frame_chain): Don't chain past the dummy + frame. + +2002-09-26 Andrew Cagney + + * rs6000-tdep.c (rs6000_extract_struct_value_address): Return 0. + (rs6000_struct_return_address): Delete variable. + (rs6000_store_struct_return): Update. + (rs6000_gdbarch_init): Set extract_struct_value_address instead of + deprecated_extract_struct_value_address. + (rs6000_frame_align): New function. + (rs6000_gdbarch_init): Set frame_align. + +2002-09-26 Andrew Cagney + + From Grace Sainsbury : + * Makefile.in (gdbtk-main.o): New target. + (gdb.o): New target. + (main_h): Define. + (main.o): Update dependencies. + (gdb$(EXEEXT)): Add gdb.o. + (SUBDIR_GDBTK_SRCS): Add gdbtk-main.c. + (SUBDIR_GDBTK_ALL, SUBDIR_GDBTK_UNINSTALL): Set. + (SUBDIR_GDBTK_CLEAN): Set. + (install-gdbtk): Install the insight binary. + (uninstall-gdbtk): New target. + (all-gdbtk, clean-gdbtk): New rule. + * top.c (use_windows): Default to zero. + * main.c: Include "main.h". + (main): Delete. + (struct captured_main_args): Delete. + (gdb_main): New function. + * main.h: New file. + * gdb.c: New File. + +2002-09-25 Andrew Cagney + + * frame.c: Include "gdb_string.h" and "builtin-regs.h". + (frame_map_regnum_to_name): New function. + (frame_map_name_to_regnum): New function. + * frame.h (frame_map_name_to_regnum): Declare. + (frame_map_regnum_to_name): Declare. + * builtin-regs.c (builtin_reg_map_regnum_to_name): New function. + * builtin-regs.h (builtin_reg_map_regnum_to_name): Declare. + * parse.c: Do not include "builtin-regs.h". + (target_map_name_to_register): Delete function. + (write_dollar_variable): Use frame_map_name_to_regnum. + * parser-defs.h (target_map_name_to_register): Delete declaration. + * expprint.c: Include "frame.h". + (print_subexp): Use frame_map_regnum_to_name. + * eval.c (evaluate_subexp_standard): Use frame_map_regnum_to_name. + * infcmd.c (registers_info): Use frame_map_name_to_regnum. + +2002-09-25 Andrew Cagney + + * rs6000-tdep.c (rs6000_frame_saved_pc): If the link register + wasn't saved, and the next innermost frame is a dummy, return the + dummy frame's link register. + +2002-09-24 Jim Blandy + + Fix from Paul Breed: + * main.c (captured_main): Add a `break' after the case for 'b'. + +2002-09-24 Keith Seitz + + * varobj.c (c_type_of_child): Use get_target_type instead + of TYPE_TARGET_TYPE. + +2002-09-22 Fernando Nasser + + * source.c (get_current_or_default_source_symtab_and_line): Remove + function. + (set_default_source_symtab_and_line): New function. Attempts to + determine a source file to list lines from if one is not currently + defined. + (get_current_source_symtab_and_line): Initialize sal.pc and + sal.end fields. + (set_current_source_symtab_and_line): Mark argument as const. + * source.h: Update declarations and comments. + * linespec.c (decode_line_1): Replace call to removed routine above. + * stack.c (print_frame_info_base): Ditto. + * cli/cli-cmds.c (edit_command): Ditto. + (list_command): Ditto. + +2002-09-22 Fernando Nasser + + * source.c (get_current_or_default_source_symtab_and_line): Initialize + sal.pc and sal.end fields. + (get_current_or_default_source_symtab_and_line): Ditto. + * breakpoint.c (parse_breakpoint_sals): Use correct accessor function + so we do not cause a new source symtab to be searched for (reverting an + unintentional change from the 2002-09-20 patch). + * scm-lang.c (scm_unpac): Ditto. + +2002-09-21 Andrew Cagney + + * complaints.c (symfile_explanations): Remove new-line from + ``isolated_message''. + (vcomplaint): When ISOLATED_MESSAGE, force a line break. + (clear_complaints): When a SUBSEQUENT_MESSAGE, force a line break. + +2002-09-20 Nick Clifton + + * NEWS: Announce that V850EA ISA is no longer supported. + * v850-tdep.c: Remove reference to bfd_mach_v850ea. + +2002-09-20 David Carlton + + * Makefile.in (c-lang.o): Correct dependencies. + (utils.o): Gather dependencies. + (charset.o): Move. + * c-lang.c: #include "gdb_string.h" + +2002-09-20 Fernando Nasser + + From 2002-07-02 George Helffrich + * cli/cli-cmds.c (list_command): New function. Implements the new + cli edit command. + (_init_cli_cmds): Add new command definition. + * gdb.1: Document edit command. + * doc/gdb.texinfo: Document edit command. + +2002-09-20 Fernando Nasser + + * source.c: Make global variables current_source_symtab and + current_source_line static. + (list_command): Moved to cli/cli-cmds.c. + (ambiguous_line_spec): Moved to cli/cli-cmds.c. + (get_first_line_listed): New accessor function. + (get_lines_to_list): New accessor function. + (get_current_source_symtab_and_line): New function. Retrieves the + position in the source code that we consider current. + (get_current_or_default_source_symtab_and_line): New function. + Like the above but attempts to determine a default position if one + is not currently defined. + (set_current_source_symtab_and_line): New function. Sets the source + code position considered current and returns the previously set one. + (clear_current_source_symtab_and_line): Reset stored information about + a current source line. + (_initialize_source): Remove registration for the "list" command and + its alias. + * source.h: Add declarations for the new functions above. + * symtab.h: Remove declarations for the global variables mentioned + above. + * breakpoint.c (parse_breakpoint_sals): Use accessor functions to + obtain current source line. + * linespec.c (decode_line_1): Ditto. + * macroscope.c (default_macro_scope): Ditto. + * scm-lang.c (scm_unpac): Ditto. + * stack.c (print_frame_info_base): Ditto. + * symfile.c (clear_symtab_users): Ditto. + * symtab.c (decode_line_spec): Ditto. + * cli/cli-cmds.c (list_command): Moved here from source.c. + (ambiguous_line_spec): Moved here from source.c. + (_init_cli_cmds): Add definition for "list" and its alias. + * Makefile.in: Update dependencies. + +2002-09-20 Corinna Vinschen + + * h8300-tdep.c (h8300_examine_prologue): Match saved regs location + with what gcc thinks is correct. + +2002-09-20 Corinna Vinschen + + * h8300-tdep.c (h8300_examine_prologue): Fix loop for saved regs in + multiple register push instruction. + +2002-09-19 Jim Blandy + + Add support for distinct host and target character sets. + * charset.c, charset.h: New files. + * c-exp.y: #include "charset.h". + (yylex): Convert character and string literals to the target + character set, before returning them as the semantic value of the + token. + * c-lang.c: #include "charset.h". + (c_emit_char): Use charset-specific methods to recognize + characters with backslash escape forms, to decide which characters + to print literally and which to print using numeric escape + sequences, and to convert target characters to host characters + before printing. + * utils.c: #include "charset.h". + (no_control_char_error): New function. + (parse_escape): Use charset-specific methods to recognize + backslash escapes, parse `control character' notation, and convert + characters from the host character set to the target character set. + * configure.in: Set the default host character set. + Check where to find iconv, and what its argument types might be. + * acinclude.m4 (AM_ICONV): New macro, borrowed from GCC. + * Makefile.in (SFILES): List charset.c. + (COMMON_OBS): List charset.o. + (charset.o): New rule. + (charset_h): New header dependency variable. + (c-lang.o, utils.o, c-exp.tab.o): Note dependency on $(charset_h). + (LIBICONV): New variable, set by configure. + (CLIBS): Include $(LIBICONV) here. + * aclocal.m4, config.in, configure: Regenerated. + +2002-09-19 Joel Brobecker + + * ada-exp.y: Add missing semicolons to end rules. Fixes a + bison 1.35 warning. + +2002-09-19 Richard Earnshaw + + * gdb_mbuild.sh: New file. + +2002-09-19 Andrew Cagney + + * objc-exp.y, objc-lang.h, objc-lang.c: Fix copyright notice. + +2002-09-18 Andrew Cagney + + * breakpoint.c, c-exp.y, defs.h, elfread.c, expression.h, + jv-exp.y, language.c, language.h, p-exp.y, parse.c, parser-defs.h, + printcmd.c, source.c, stabsread.c, symfile.c, symtab.h, utils.c, + valops.c, value.h: Revert previous change. + +2002-09-18 Michael Snyder + + Preliminary support for Objective-C: + * defs.h (language_objc): New enum value. + (puts_filtered_tabular): Declaration only, exported from utils.c. + (skip_quoted): Delete, declared in completer.h. + * c-exp.y: Include completer.h. + * p-exp.y: Ditto. + * jv-exp.y: Ditto. + * expression.h (OP_MSGCALL, OP_SELECTOR, OP_SELF, OP_NSSTRING): + New operator enum values. + * language.h (CAST_IS_CONVERSION): Test for language_objc. + * language.c (binop_result_type): Handle language_objc case. + (integral_type, character_type, string_type, boolean_type, + structured_type, binop_type_check): Ditto. + * symtab.h (SYMBOL_OBJC_DEMANGLED_NAME): Define. + (struct objc_specific): Add to general_symbol_info. + (SYMBOL_INIT_LANGUAGE_SPECIFIC): Add objc initialization. + (SYMBOL_DEMANGLED_NAME): Handle objc case. + * parser-defs.h (struct objc_class_str): New struct type. + (start_msglist, end_msglist, add_msglist): Declaration only, + exported from objc-lang.c. + * value.h (value_of_local, value_nsstring, + call_function_by_hand_expecting_type): Exported from valops.c. + * valops.c (find_function_addr): Export. + (call_function_by_hand_expecting_type): New function. + (value_of_local): New function. + * symfile.c (init_filename_language_table): Add ".m" extension + for Objective-C. + * utils.c (puts_filtered_tabular): New function. + (fprintf_symbol_filtered): Add objc demangling support (disabled). + (set/show demangle): Extend help-string to refer to ObjC. + * elfread.c (elf_symtab_read): Skip Objective-C special symbols. + * stabsread.c (symbol_reference_defined): Objective-C symbols + may contain colons: make allowances when scanning stabs strings + for colons. + (objc_find_colon): New function. + * printcmd.c (address_info): If language == objc then print + "self" instead of "this". + * parse.c (length_of_subexp): Handle new operators OP_MSGCALL, + OP_NSSTRING, and OP_SELF. + (prefixify_subexp): Ditto. + * source.c (print_source_lines): Mention objc in comment. + * breakpoint.c (parse_breakpoint_sals): Recognize Objective-C + method names. + +2002-09-18 Andrew Cagney + + * complaints.h: Update copyright. + (struct complaints): Declare. + (struct complaint): Make `message' constant. + (internal_complaint): Declare. + (complaint): Declare. + (complaint_root): Delete declaration. + (symfile_complaints): Delete declaration. + (struct complaints): Add opaque declaration. + (clear_complaints): Add a complaints parameter. + * complaints.c: Update copyright. + (enum complaint_series): Define. + (complaint_root): Delete. + (struct complaints): Define. + (complaint_sentinel, symfile_complaint_book): New variables. + (symfile_explanations, symfile_complaints): New variables. + New variables. + (get_complaints): New function. + (vcomplaint): New function. + (complaint): New function. + (internal_complaint): New function. + (complain): Call vcomplain with symfile_complaint. + (clear_complaints): Rewrite. + (_initialize_complaints): Use add_setshow_command. + * Makefile.in (complaints.o): Update dependencies. + * symfile.c (syms_from_objfile): Add symfile_complaints parameter + to call to clear_complaints. + (new_symfile_objfile, reread_symbols): Ditto. + (oldsyms_complaint): Delete. + (empty_symtab_complaint, unknown_option_complaint): Delete. + (free_named_symtabs): Use complaint instead of complain. + +2002-09-18 Michael Snyder + + Contributed by Apple Computer, Inc. Merged with current sources + by Adam Fedor [cagney]. + + * objc-lang.c: First clean-up round: comments, indentation. + * objc-lang.h: Ditto. + * objc-lang.y: Ditto. + +2002-09-18 Andrew Cagney + + * maint.c (maintenance_internal_error): Print the parameter as the + error message. + (maintenance_internal_warning): New function. + (_initialize_maint_cmds): Add command `maint internal-warning'. + + * defs.h (internal_warning, internal_vwarning): Declare. + * utils.c (struct internal_problem): Define. + (internal_vproblem): New function. + (internal_warning): New function. + (internal_vwarning): New function. + (internal_warning_problem, internal_error_problem): New variables. + (internal_verror): Just call internal_vproblem. + +2002-09-18 Michael Snyder + + * objc-lang.c: New file, support for Objective-C. + Preliminary check-in, not yet integrated into gdb. + * objc-lang.h: New file. + * objc-exp.y: New file. + +2002-09-18 Andrew Cagney + + * infrun.c (signal_stop_update): Convert definition to ISO C. + (signal_print_update): Ditto. + (signal_pass_update): Ditto. + * inflow.c (terminal_save_ours): Ditto. + + * h8300-tdep.c (h8300_gdbarch_init): Use C instead of C++ + comments. + + * config/djgpp/fnchange.lst: Handle name clashes between + bfd/coff-tic30.c, bfd/coff-tic4x.c, bfd/coff-tic54x.c and + bfd/coff-tic80.c. + + * i386-linux-tdep.h: Fix tipo. + +2002-09-18 Adam Fedor + + * MAINTAINERS: Add myself to the Write After Approval list. + +2002-09-18 Jim Blandy + + * dbxread.c, mdebugread.c: Revert my change of 2001-10-23. Moving + texthigh and textlow to reader-specific structs caused + objfile_relocate to miss them. This is fixable, but the work that + the change was supposed to prepare GDB for never got done anyway. + +2002-09-18 David Carlton + + * MAINTAINERS: Alphabetize Write After Approval list. + +2002-09-18 Daniel Jacobowitz + + Fix PR gdb/709 + * values.c (value_static_field): Call read_var_value. + +2002-09-18 Andrew Cagney + + * valops.c (hand_function_call): Align the initial stack pointer + and STRUCT_ADDR using frame_align. When STRUCT_RETURN and + FRAME_ALIGN_P, use STRUCT_ADDR to obtain the called function's + return value. + * mips-tdep.c (mips_frame_align): New function. + (mips_gdbarch_init): Set frame_align. + * gdbarch.sh (FRAME_ALIGN): New method. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-09-18 Michal Ludvig + + * x86-64-linux-nat.c (x86_64_regmap): Added CS and SS + registers. + +2002-09-17 Andrew Cagney + + * NEWS: Mention that MIPS $fp behavior changed. + * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register): Delete + reference to FP_REGNUM. + (mipsnbsd_cannot_store_register): Ditto. + * mips-linux-nat.c: Update copyright. + (mips_linux_cannot_fetch_register): Delete reference to FP_REGNUM. + (mips_linux_cannot_store_register): Ditto. + * mips-linux-tdep.c (supply_gregset): Ditto. Update copyright. + * config/mips/tm-mips.h: Update copyright. + (FP_REGNUM): Delete macro. + (MIPS_REGISTER_NAMES): Replace "fp" with "". + * config/mips/tm-irix6.h (FP_REGNUM): Delete macro. + * mips-tdep.c (mips_gdbarch_init): Set read_fp to mips_read_sp. + (mips_r3041_reg_names, mips_r3051_reg_names) + (mips_r3081_reg_names): Replace "fp" with "". + Fix PR gdb/480. + +2002-09-17 Theodore A. Roth + + * gdb/avr-tdep.c(avr_scan_prologue): Fix bad call to + generic_read_register_dummy() (PR gdb/703). + (avr_push_return_address): #if 0 out unused vars. + (avr_gdbarch_init): Enable use of avr_push_return_address(). + +2002-09-17 Michael Snyder + + * m32r-stub.c (restore_and_return): Postpone restoring of PSW. + RTE will take care of it. + +2002-09-17 Andrew Cagney + + * arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is + invalid, return SP_REGNUM. + +2002-09-17 Michael Snyder + + * mips-tdep.c (mips_pop_frame): Read saved values of floating + point registers without sign extension. + +2002-09-17 Andrew Cagney + + * blockframe.c (deprecated_read_register_dummy): Rename + generic_read_register_dummy. + * frame.c (frame_unwind_signed_register): New function. + (frame_unwind_unsigned_register): New function. + * frame.h (frame_unwind_signed_register): Declare. + (frame_unwind_unsigned_register): Declare. + (deprecated_read_register_dummy): Rename + generic_read_register_dummy. + + * h8300-tdep.c (h8300_frame_chain): Update. + (h8300_frame_saved_pc): Update. + * xstormy16-tdep.c (xstormy16_frame_saved_pc): Update. + * rs6000-tdep.c (rs6000_frame_saved_pc): Update. + * s390-tdep.c (s390_frame_saved_pc_nofix): Update. + (s390_frame_chain): Update. + * v850-tdep.c (v850_find_callers_reg): Update. + (v850_frame_saved_pc): Update. + * m32r-tdep.c (m32r_init_extra_frame_info): Update. + (m32r_find_callers_reg): Update. + (m32r_frame_saved_pc): Update. + * sh-tdep.c (sh_find_callers_reg): Update. + (sh64_get_saved_pr): Update. + (sh_init_extra_frame_info): Update. + (sh_init_extra_frame_info): Update. + (sh64_init_extra_frame_info): Update. + (sh64_init_extra_frame_info): Update. + * mcore-tdep.c (mcore_find_callers_reg): Update. + (mcore_frame_saved_pc): Update. + (mcore_init_extra_frame_info): Update. + * i386-tdep.c (i386_frame_saved_pc): Update. + * ia64-tdep.c (ia64_frame_saved_pc): Update. + (ia64_init_extra_frame_info): Update. + (ia64_init_extra_frame_info): Update. + * d10v-tdep.c (d10v_frame_saved_pc): Update. + * cris-tdep.c (cris_init_extra_frame_info): Update. + * avr-tdep.c (avr_frame_chain): Update. + (avr_init_extra_frame_info): Update. + (avr_frame_saved_pc): Update. + * arm-tdep.c (arm_find_callers_reg): Update. + (arm_init_extra_frame_info): Update. + (arm_frame_saved_pc): Update. + +2002-09-17 Tom Tromey + + * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter + is "'". + +2002-09-17 Corinna Vinschen + + * MAINTAINERS: Remove "non multi-arched" text from h8300. + * h8300-tdep.c (h8300_next_prologue_insn) Renamed from + NEXT_PROLOGUE_INSN. + (h8300_examine_prologue): Call h8300_next_prologue_insn instead of + NEXT_PROLOGUE_INSN. + +2002-09-16 Joel Brobecker + + * osfsolib.c: Remove file, replaced by solib-osf.c. + * Makefile.in: Remove compilation rules for osfsolib.c. + +2002-09-16 David Carlton + + * cp-valprint.c (cp_print_class_method): Correct args to + check_stub_method_group. + +2002-09-16 Corinna Vinschen + + * h8300-tdep.c: Multiarch. Drop `set machine' command in favor of + `set architecture'. Unify naming convention of functions. + (h8300_skip_prologue): Improve prologue analysis. + (h8300_push_arguments): Rewritten to more closely match GCC's + bizarre argument-passing behavior, along with the comment describing + said behavior. + * remote-hms.c (hms_regnames): Don't use NUM_REGS in definition. + * config/h8300/tm-h8300.h: Multiarch. Just keep stuff needed by + sim, remote-e7000.c, remote-hms.c and remote.c + +2002-09-15 Mark Kettenis + + * i386-tdep.c (gdb_print_insn_i386): Removed. + (i386_print_insn): New function. + (i386_gdbarch_init): Set print_insn to i386_print_insns. + (_initialize_i386_tdep): Don't initialize tm_print_insn and + tm_print_insn_info. + +2002-09-14 Mark Kettenis + + * gdbtypes.c (check_stub_method_group): Initialize found_stub to + zero. + +2002-09-14 Corinna Vinschen + + * arch-utils.c (legacy_pc_in_sigtramp): Move preprocessor expression + for IN_SIGTRAMP to here. Use IN_SIGTRAMP only if it's defined. + Guard usage of SIGTRAMP_START() by using SIGTRAMP_START_P. + +2002-09-13 Christopher Faylor + + * win32-nat.c (child_create_inferior): Honor 'tty' command. + +2002-09-13 Daniel Jacobowitz + + * gdbtypes.c (check_stub_method): Make static. + (check_stub_method_group): New function. + * gdbtypes.h: Update prototypes. + * cp-support.c: New file. + * cp-support.h: New file. + + * stabsread.c: Include "cp-abi.h" and "cp-support.h". + (update_method_name_from_physname): New function. + (read_member_functions): Correct method names for operators + and v3 constructors/destructors. Separate v2 constructors and + destructors. + * Makefile.in (stabsread.o): Update dependencies. + (SFILES): Add cp-support.c. + (COMMON_OBS): Add cp-support.o. + (cp_support_h, cp-support.o): Add. + + * cp-valprint.c (cp_print_class_method): Call + check_stub_method_group instead of check_stub_method. Remove + extraneous QUITs. + * p-valprint.c (pascal_object_print_class_method): Likewise. + * valops.c (search_struct_method): Likewise. + (find_method_list, value_struct_elt_for_reference): Likewise. + +2002-09-13 Andrew Cagney + + * gdbarch.sh (SIGTRAMP_END): Change to a predicate function. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-09-13 Andrew Cagney + + * frame.c (find_saved_register): Delete function. + * frame.h (find_saved_register): Delete declaration. + Fix PR gdb/631. + +Fri Sep 13 14:59:55 2002 Andrew Cagney + + * mips-tdep.c (read_next_frame_reg): Re-hack using + frame_register_unwind. + +Fri Sep 13 07:42:09 2002 Andrew Cagney + + * mips-tdep.c (mips_get_saved_register): Re-hack using + frame_register_unwind. + +2002-09-12 Joel Brobecker + + * gdbarch.sh (NAME_OF_MALLOC): New variable in the architecture + vector. Will be useful for Interix. + * gdbarch.h, gdbarch.c: Regenerate. + + * valops.c (value_allocate_space_in_inferior): Replace hard-coded + name of the malloc function by NAME_OF_MALLOC. + +2002-09-12 Joel Brobecker + + * value.h (find_function_in_inferior): Add const keyword to + one of the parameters. Allows us to invoke this function with + a const char *. + * valops.c (find_function_in_inferior): Likewise. + +2002-09-12 Joel Brobecker + + * exec.c (xfer_memory): Fix compilation warning with old versions + of GCC. + * tracepoint.c (trace_find_tracepoint_command): Likewise. + +2002-09-12 David Carlton + + * symtab.h: Run through gdb_indent.h. + Add 2002 to Copyright year list. + +2002-09-12 Alan Modra + + * x86-64-tdep.c (_initialize_x86_64_tdep): Don't use hard-coded + mach constants. + * MAINTAINERS: Add myself to write after approval list. + +2002-09-11 J. Brobecker + + * osabi.c (gdb_osabi_name): Add entry for GDB_OSABI_INTERIX. + +2002-09-11 J. Brobecker + + * osabi.h (gdb_osabi): Add new GDB_OSABI_INTERIX enum value for + Interix. + +2002-06-05 Paul N. Hilfinger + + * procfs.c (do_detach): Clear current signal, not just fault. + Corrects problem with breakpoint trap signal leaking to detached + process on Tru64. + +2002-09-10 Michael Snyder + + * buildsym.c (finish_block): Protect against null pointer. + +2002-09-10 Andrew Cagney + + * infcmd.c (default_print_registers_info): Send all output to + ``file'' instead of ``gdb_stdout''. + +2002-09-10 Michael Snyder + + * mips-tdep.c (mips_extract_struct_value_address): Make val a + LONGEST, and use signed register read (addresses are sign- + extended for mips). + +2002-09-10 Stephane Carrez + + * event-loop.c (gdb_do_one_event): Make public. + * event-loop.h (gdb_do_one_event): Declare. + +2002-09-10 Jeff Law + + * infttrace.c (child_resume): Simplify and rework to avoid + TT_PROC_CONTINUE. + +2002-09-09 Fred Fish + + * printcmd.c (print_scalar_formatted): "len" is the number of + target bytes, NOT the number of target bits. + +2002-09-09 Elena Zannoni + + From: Emmanuel Thome' + * top.c (init_main): Set rl_terminal_name. + +2002-09-08 Aidan Skinner + + * ada-lang.c (ada_array_bound, ada_type_match, + _initialize_ada_language): Fix K&R definitions. + * ada-tasks.c (get_current_task): Fix K&R definitions. + * ada-valprint.c (adjust_type_signedness): Fix K&R definitions. + +2002-09-07 Christopher Faylor + + * MAINTAINERS: Remove CE from list of maintainership responsibilities. + Add XP. + +2002-09-06 Mark Kettenis + + * i386-tdep.c (i386_register_virtual_type, + i386_register_convertible, i386_register_convert_to_virtual, + i386_register_comvert_to_raw): Use FP_REGNUM_P and SSE_REGNUM_P + instead of IS_FP_REGNUM and IS_SSE_REGNUM. + (i386_gdbarch_init): Fix comment. Add comments on calls that set + sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum. + Don't set push_arguments twice. + + * i386bsd-tdep.c (i386bsd_init_abi): Set sigtramp_start and + sigtramp_end to i386bsd_sigtramp_start and i386bsd_sigtramp_end. + * i386nbsd-tdep.c (i386nbsd_init_abi): Set sigtramp_start and + sigtramp_end to NULL. + * config/i386/tm-fbsd.h (SIGTRAMP_START, SIGTRAMP_END): Remove + defines. + (i386bsd_sigtramp_start, i386_sigtramp_end): Remove prototypes. + + * i386nbsd-tdep.c (i386nbsd_pc_in_sigtramp): Remove spurious + whitespace. + + * gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): New methods. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (find_pc_sect_partial_function): Convert to use + SIGTRAMP_START_P predicate. + +2002-09-05 Michael Snyder + + * arm-tdep.c (arm_init_extra_frame_info): Distinguish between + generic_dummy_frame method and old method. Also distinguish + between ARM_FP_REGNUM and THUMB_FP_REGNUM. + (arm_extract_return_value): Use new regcache method. + + * mips-tdep.c (mips_n32n64_push_arguments): Remove alignment + adjustment that doesn't conform to the ABI. + (mips_extract_struct_value_address): Retrieve V0_REGNUM from + saved regcache, not from current regcache. + +2002-09-05 Andrew Cagney + + * NEWS: Update for 5.3. Add new section ``Changes since 5.3''. + * README: Update. + +2002-09-04 Jason Thorpe + + * arm-tdep.c (arm_addr_bits_remove): Don't check for Thumb mode + if arm_apcs_32 is false. + +2002-09-04 Andrew Cagney + + GDB 5.3 branch created. + +2002-09-03 Theodore A. Roth + + * gdb/avr-tdep.c (avr_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-09-03 David Carlton + + * dwarf2read.c (dwarf2_add_member_fn): Add the 'type' + argument (PR gdb/653). Update call to smash_to_method_type. + (read_structure_scope): Update call to dwarf2_add_member_fn. + +2002-09-03 Michal Ludvig + + * x86-64-linux-tdep.c: Include gdb_string.h + * x86-64-linux-nat.c: Ditto. + +2002-09-02 Jason Thorpe + + * ada-exp.y (yyname, yyrule): Remap global variables that appear + when YYDEBUG is set to 1. + * c-exp.y: Likewise. + * f-exp.y: Likewise. + * jv-exp.y: Likewise. + * m2-exp.y: Likewise. + * p-exp.y: Likewise. + +2002-09-02 Jason Thorpe + + * Makefile.in (i386nbsd-tdep.o): Add $(solib_svr4_h) to + dependency list. + * i386nbsd-tdep.c (i386nbsdelf_init_abi): Set + solib_svr4_fetch_link_map_offsets to + nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/i386/nbsd.mt (TDEPFILES): Add solib.o and solib-svr4.o. + * config/i386/nbsdaout.mh (NATDEPFILES): Remove solib.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove solib.o, + solib-svr4.o, and solib-legacy.o. + * config/i386/tm-nbsd.h: Include solib.h. + +2002-09-02 Jason Thorpe + + * configure.tgt (i[3456]86-*-netbsdelf*): Merge with... + (i[3456]86-*-netbsd*): ...this. Set gdb_target to nbsd. + (i[3456]86-*-openbsd*): Make this a separate entry. Add a + comment noting that this needs its own target configuration. + * config/i386/nbsd.mt: New file. + * config/i386/nbsdaout.mt: Remove. + * config/i386/nbsdelf.mt: Ditto. + * config/i386/tm-nbsdaout.h: Ditto. + +2002-09-02 Jason Thorpe + + * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): New function. + (i386nbsd_pc_in_sigtramp): Rewrite to use i386nbsd_sigtramp_offset. + (i386nbsd_init_abi): Don't initialize tdep->sigtramp_start or + tdep->sigtramp_end. + (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): Remove. + * config/i386/tm-nbsd.h (SIGTRAMP_START, SIGTRAMP_END) + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove. + +2002-09-02 Jason Thorpe + + * Makefile.in (i386nbsd-tdep.o): Add $(arch_utils_h), + $(i386_tdep_h), and $(nbsd_tdep_h) to dependency list. + * i386-tdep.h (i386bsd_init_abi): New prototype. + * i386bsd-tdep.c (i386bsd_init_abi): Remove "static" from + function declaration. + (_initialize_i386bsd_tdep): Don't register OS ABI handlers + for NetBSD-a.out or NetBSD-ELF. + (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end) + (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset) + (i386nbsd_init_abi, i386nbsdelf_init_abi): Move to... + * i386nbsd-tdep.c: ...here. Include arch-utils.h, i386-tdep.h, + and nbsd-tdep.h. + (i386nbsd_pc_in_sigtramp): New function. + (i386nbsd_init_abi): Set gdbarch_pc_in_sigtramp to + i386nbsd_pc_in_sigtramp. + (_initialize_i386nbsd_tdep): Register i386nbsd_init_abi + and i386nbsdelf_init_abi OS ABI handlers. + * config/i386/nbsdaout.mt (TDEPFILES): Add nbsd-tdep.o. + * config/i386/nbsdelf.mt (TDEPFILES): Likewise. + +2002-09-02 Mark Kettenis + + * i386-linux-nat.c (dummy_sse_values): Only try to fill in the SSE + registers if the target really has them. + +2002-08-31 Jason Thorpe + + * Makefile.in (mipsnbsd-tdep.o): Use $(nbsd_tdep_h) rather + than nbsd-tdep.h. + +2002-08-31 Jason Thorpe + + * Makefile.in (alphanbsd-tdep.o): Add $(frame_h) to dependency + list. + * alphanbsd-tdep.c (alphanbsd_sigcontext_addr) + (alphanbsd_skip_sigtramp_frame): New functions. + (alphanbsd_init_abi): Set tdep->skip_sigtramp_frame to + alphanbsd_skip_sigtramp_frame. Set tdep->sigcontext_addr + to alphanbsd_sigcontext_addr. + +2002-08-31 Jason Thorpe + + * Makefile.in (mipsnbsd-tdep.o): Add nbsd-tdep.h to dependency + list. + (nbsd-tdep.o): Add $(gdb_string_h) to dependency list. + * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): Use + nbsd_pc_in_sigtramp. + * mipsnbsd-tdep.c: Include nbsd-tdep.h. + (mipsnbsd_pc_in_sigtramp): Use nbsd_pc_in_sigtramp. + * nbsd-tdep.c: Include gdb_string.h. + (nbsd_pc_in_sigtramp): New function. + * nbsd-tdep.h (nbsd_pc_in_sigtramp): New prototype. + * ppcnbsd-tdep.c (ppcnbsd_pc_in_sigtramp): New function. + (ppcnbsd_init_abi): Set gdbarch_pc_in_sigtramp to + ppcnbsd_pc_in_sigtramp. + * shnbsd-tdep.c (shnbsd_pc_in_sigtramp): New function. + (shnbsd_init_abi): Set gdbarch_pc_in_sigtramp to + shnbsd_pc_in_sigtramp. + * sparcnbsd-tdep.c (sparcnbsd_init_abi_elf): Set + gdbarch_pc_in_sigtramp to nbsd_pc_in_sigtramp. + * config/mips/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. + +2002-08-30 Pierre Muller + + * breakpoint.c (breakpoint_init_inferior): Reset the val field of + watchpoints to NULL. + (insert_breakpoints): set val field of watchpoints if NULL. + + +2002-08-29 Jim Blandy + + * symtab.c (lookup_symbol_aux): In the cases where we find a + minimal symbol of an appropriate name and use its address to + select a symtab to read and search, use `name' (as passed to us) + as the demangled name when searching the symtab's global and + static blocks, not the minsym's name. + +2002-08-29 Keith Seitz + + * 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 Michael Snyder + + * breakpoint.c (insert_breakpoints): Protect all references + to 'process_warning'. Shorten long lines. + +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 + T-packets; the 'a' is not taken as a register number. + (remote_check_watch_resources, remote_stopped_by_watchpoint) + (remote_stopped_data_address): New functions; add to target + vector. + (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Change + prototypes to match other implementations of this + function. replace integer argument with pointer -- the length + field in the Z-packet is the length of what is pointed to or 1 if + pointer is null. Add to target vector. + (remote_insert_watchpoint, remote_remove_watchpoint): Add to + target vector. + + From Mark Salter: + * remote.c (remote_wait): Add support to extract optional + watchpoint information from T-packet. Ignore unrecognized + optional info in T-packet. + (remote_async_wait): Ditto. + +2002-08-09 Corinna Vinschen + + * cli/cli-dump.c: Change fopen modes to use binary open modes + as defined in include/fopen-bin.h throughout. + +2002-08-08 Michael Snyder + + * mips-tdep.c: Minor whitespace and indentation clean-ups. + +2002-08-08 Kevin Buettner + + * doublest.c (store_floating): Avoid floatformat_from_doublest() + assertion failure by returning early after a warning. + +2002-08-08 Kevin Buettner + + * mips-tdep.c (mips_find_saved_regs): Make static. + (mips_frame_init_saved_regs): New function. + (mips_gdbarch_init): Setup FRAME_INIT_SAVED_REGS method. + * config/mips/tm-mips.h (FRAME_INIT_SAVED_REGS): Delete macro. + (mips_find_saved_regs): Delete declaration. + +2002-08-08 Grace Sainsbury + + * remote.c (remote_wait, remote_async_wait): Change + thread_num from int to ULONGEST. + (unpack_varlen_hex): Change result parameter from + int * to ULONGEST *. + +2002-08-08 Andrew Cagney + + * configure.tgt: Replace powerpc-*-sysv*, powerpc-*-elf*, + powerpcle-*-eabi*, powerpcle-*-sysv* and powerpcle-*-elf* with + powerpc*-*-*. + * MAINTAINERS: Remove redundant rs6000-ibm-aix4.1 target. + +2002-08-08 Andrew Cagney + + * gcore.c (override_derive_stack_segment): Delete variable. + (preempt_derive_stack_segment): Delete function. + (derive_stack_segment): Delete function. + (default_derive_stack_segment): Renamed to derive_stack_segment. + (override_derive_heap_segment): Delete variable. + (preempt_derive_heap_segment): Delete function. + (derive_heap_segment): Delete function. + (default_derive_heap_segment): Rename to derive_heap_segment. + +2002-08-06 Michael Snyder + + * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION. + * mips-tdep.c (mips_EABI_use_struct_convention, + mips_OABI_use_struct_convention, mips_NABI_use_struct_convention): + New functions. (mips_use_struct_convention): Delete. + (mips_gdbarch_init): set use_gdbarch_convention. + +2002-08-06 Michael Snyder + + * mips-tdep.c: gdbarch-ify reg_struct_has_addr. + (mips_eabi_reg_struct_has_addr, mips_n32n64_reg_struct_has_addr, + mips_o32_reg_struct_has_addr): New functions. + (mips_gdbarch_init): Set gdbarch reg_struct_has_addr. + +2002-08-07 Andrew Cagney + + * regcache.c (pseudo_register): Delete function. + (fetch_register): Delete function. + (store_register): Delete function. + (regcache_raw_read, legacy_read_register_gen): Use + target_fetch_registers instead of fetch_register. + (legacy_write_register_gen, regcache_raw_write): Use + target_store_register instead of store_register. + (write_register_bytes): Ditto. + + * gdbarch.sh (FETCH_PSEUDO_REGISTER): Delete. + (STORE_PSEUDO_REGISTER): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-06 Corinna Vinschen + + * cli/cli-dump.c (add_dump_command): Explicitely use "b" flag to + write dump file binary. + +2002-08-05 Michael Snyder + + * mips-tdep.c (mips_find_saved_regs): Adjust stack according + to MIPS_SAVED_REGSIZE, not GDB_TARGET_IS_MIPS64. Enhance comment. + (mips_gdbarch_init): Set N32 target to be mips64. + +2002-08-06 Kevin Buettner + + * frame.c (find_saved_register): Break out of loop once saved + register address is found. Don't mention sparc in loop comment + anymore. + +2002-08-06 Kevin Buettner + + * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set + mips_default_saved_regsize to 8. + +2002-08-06 Andrew Cagney + + * gcore.c: Do not include . + * Makefile.in (gcore.o): Update dependencies. + +2002-08-06 Andrew Cagney + + * configure.tgt: Make arc-*-* obsolete. + * NEWS: Mention that arc-*-* has been identifed as obsolete. + * MAINTAINERS: Make arc-elf obsolete. + * arc-tdep.c: Make file obsolete. + * config/arc/arc.mt: Ditto. + * config/arc/tm-arc.h: Ditto. + +2002-08-05 Theodore A. Roth + + * avr-tdep.c (avr_skip_prologue): Fix to return the correct pc. + +2002-08-05 Andrew Cagney + + * mcore-tdep.c (mcore_gdbarch_init): Use + generic_unwind_get_saved_register instead of + generic_get_saved_register. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Ditto. + * config/h8300/tm-h8300.h (GET_SAVED_REGISTER): Ditto. + +2002-08-05 Joel Brobecker + + * objfiles.h: Add missing #include "symfile.h" + + * Makefile.in (objfiles_h): Add dependency on symfile.h and dependents. + +2002-08-04 Andrew Cagney + + From 2002-08-01 david carlton : + * hpread.c (hpread_read_struct_type): Deleted superfluous setting + of FIELD_BITSIZE. + +2002-08-04 Daniel Jacobowitz + + * NEWS: Cleanup and nitpick. + +2002-08-03 Andrew Cagney + + * NEWS: Cleanup. Use *-linux*-gnu*. Only use `*' for headings. + +2002-08-03 Andrew Cagney + + * Makefile.in (gdbtk-bp.o): Update dependencies. + (gdbtk-register.o): Ditto. + (gdbtk-varobj.o): Ditto. + +2002-08-03 Andrew Cagney + + * m68hc11-tdep.c (m68hc11_pseudo_register_read): Replace + m68hc11_fetch_pseudo_register. + (m68hc11_pseudo_register_write): Replace + m68hc11_store_pseudo_register. + (m68hc11_gdbarch_init): Update. + +Fri Aug 2 15:53:50 2002 Andrew Cagney + + * gdbarch.sh: Include "gdb_string.h". + * gdbarch.c: Regenerate. + + * regcache.c: Include "gdb_string.h". + * ax-general.c: Ditto. + * varobj.c: Ditto. + * std-regs.c: Ditto. + * fbsd-proc.c: Ditto. + * thread.c: Ditto. + + * Makefile.in (regcache.o): Update dependencies. + (thread.o, gdbarch.o): Ditto. + (ax-general.o, gdbarch.o): Ditto. + (varobj.o, std-regs.o): Ditto. + (fbsd-proc.o): Specify dependencies. + +2002-08-02 Andrew Cagney + + * regcache.c (regcache_cooked_read): Rename rawnum parameter to + regnum. + (regcache_cooked_write): Ditto. + +2002-08-02 Andrew Cagney + + * regcache.c (regcache_cooked_read): New function. + (regcache_cooked_write): New function. + (read_register_gen): Rewrite using regcache_cooked_read. + (write_register_gen): Rewrite using regcache_cooked_write. + + * regcache.h (regcache_cooked_read, regcache_cooked_write): + Declare. + +2002-08-02 Andrew Cagney + + * gdbarch.sh (pseudo_register_read, pseudo_register_write): + Replace the architecture methods register_read and register_write. + * gdbarch.h, gdbarch.c: Regenerate. + * regcache.c (init_regcache_descr): Update. + (read_register_gen): Update. + (write_register_gen): Update. + (supply_register): Update comment. + + * sh-tdep.c (sh_gdbarch_init): Update. + (sh_pseudo_register_read, sh64_pseudo_register_read): Add + `regcache' and `gdbarch' parameters. Make `buffer' a void + pointer. Update code. + (sh_pseudo_register_write, sh64_pseudo_register_write): Add + `regcache' and `gdbarch' parameters. Make `buffer' a constant + void pointer. Update code. + (sh64_register_write): Delete. + (sh4_register_read): Delete. + (sh64_register_read): Delete. + (sh4_register_write): Delete. + (sh_sh4_register_convert_to_raw): Make `from' parameter a constant + void pointer, `to' parameter a void pointer. + (sh_sh64_register_convert_to_raw): Ditto. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_register_virtual_type): Use architecture + invariant return values. + +2002-08-01 Andrew Cagney + + * linux-proc.c: Include "gdb_string.h". + * Makefile.in (linux-proc.o): Update dependency list. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_gdbarch_init): Add comments. Fix typo in + comment. + +2002-08-01 Grace Sainsbury + + * target.h: Add to_insert_hw_breakpoint, to_remove_hw_breakpoint, + to_insert_watchpoint, to_remove_watchpoint, + to_stopped_by_watchpoint, to_stopped_data_address, + to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint to + target vecctor. Define their corresponding macros so they call + them. + + * target.c: Add default and debug versions of for + to_insert_hw_breakpoint, to_remove_hw_breakpoint, + to_insert_watchpoint, to_remove_watchpoint, + to_stopped_by_watchpoint, to_stopped_data_address, + to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_register_virtual_type): New function. + (mips_gdbarch_init): Register mips_register_virtual_type() + with gdbarch machinery. + * config/mips/tm-irix6.h (mips/tm-bigmips64.h): Include + this file instead of tm-bigmips.h. + (MIPS_REGSIZE): Delete this macro. + (REGISTER_VIRTUAL_TYPE): Delete macro. Undef macro so that + multiarch version in mips-tdep.c will be found. + +2002-08-01 Andrew Cagney + + * NEWS: Menion that CHILL has been made obsolete. + + * gdbtypes.c (chill_varying_type): Make chill references obsolete. + * stabsread.c (read_range_type): Ditto. + * gdbtypes.h: Ditto. + * language.c (binop_type_check): Ditto. + (binop_result_type): Ditto. + (integral_type): Ditto. + (character_type): Ditto. + (string_type): Ditto. + (boolean_type): Ditto. + (structured_type): Ditto. + (lang_bool_type): Ditto. + (binop_type_check): Ditto. + * language.h (_LANG_chill): Ditto. + * dwarfread.c (set_cu_language): Ditto. + * dwarfread.c (CHILL_PRODUCER): Ditto. + * dwarfread.c (handle_producer): Ditto. + * expression.h (enum exp_opcode): Ditto. + * eval.c: Ditto for comments. + * typeprint.c (typedef_print) [_LANG_chill]: Ditto. + * expprint.c (print_subexp): Ditto. + (print_subexp): Ditto. + * valops.c (value_cast): Ditto. + (search_struct_field): Ditto. + * value.h (COERCE_VARYING_ARRAY): Ditto. + * symfile.c (init_filename_language_table): Ditto. + (add_psymbol_with_dem_name_to_list): Ditto. + * valarith.c (value_binop): Ditto. + (value_neg): Ditto. + * valops.c (value_slice): Ditto. + * symtab.h (union language_specific): Ditto. + (SYMBOL_INIT_LANGUAGE_SPECIFIC): Ditto. + (SYMBOL_DEMANGLED_NAME): Ditto. + (SYMBOL_CHILL_DEMANGLED_NAME): Ditto. + * defs.h (enum language): Ditto. + * symtab.c (got_symtab): Ditto. + * utils.c (fprintf_symbol_filtered): Ditto. + + * ch-typeprint.c: Make file obsolete. + * ch-valprint.c: Make file obsolete. + * ch-lang.h: Make file obsolete. + * ch-exp.c: Make file obsolete. + * ch-lang.c: Make file obsolete. + + * Makefile.in (FLAGS_TO_PASS): Do not pass CHILL or CHILLFLAGS or + CHILL_LIB. + (TARGET_FLAGS_TO_PASS): Ditto. + (CHILLFLAGS): Obsolete. + (CHILL): Obsolete. + (CHILL_FOR_TARGET): Obsolete. + (CHILL_LIB): Obsolete. + (SFILES): Remove ch-exp.c, ch-lang.c, ch-typeprint.c and + ch-valprint.c. + (HFILES_NO_SRCDIR): Remove ch-lang.h. + (COMMON_OBS): Remove ch-valprint.o, ch-typeprint.o, ch-exp.o and + ch-lang.o. + (ch-exp.o, ch-lang.o, ch-typeprint.o, ch-valprint.o): Delete + targets. + +2002-07-31 Joel Brobecker + + * dwarf2read.c (set_cu_language): Add handler for LANG_Ada95. + This does not change anything at the moment, but will be helpful + later when full Ada support is integrated. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (_initialize_mips_tdep): Add "n64" to "set mips abi" + help message. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (mips_push_arguments): Fetch gdbarch_tdep struct + and save it in a local variable. Use variable in later test. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (mips_find_abi_section): Add N64 ABI recognition + test. (Thanks to Daniel Jacobowitz.) + +2002-07-31 Kevin Buettner + + * mips-tdep.c (enum mips_abi): Add MIPS_ABI_N64. + (mips_abi_strings): Add "n64". + (mips_gdbarch_init): Add test for n64 abi. Add MIPS_ABI_N64 case. + +2002-07-31 Kevin Buettner + + * config/mips/tm-irix6.h (MIPS_REGSIZE): Define to be 8. + (REGISTER_VIRTUAL_TYPE): Some registers are now 64 bits wide. + +2002-07-31 Kevin Buettner + + * utils.c (host_pointer_to_address, address_to_host_pointer): + Use gdb_assert() instead of explicit call to internal_error(). + +2002-07-30 Kevin Buettner + + * Makefile.in (rs6000-nat.o): Update dependencies. + + From Nicholas Duffek: + * Makefile.in (ALLDEPFILES): Add aix-thread.c. + (aix-thread.o): New rule. + * configure.host (gdb_host): Set to aix432 on AIX 4.3.2+. + * config/powerpc/aix432.mh: New file. + +2002-07-30 Daniel Jacobowitz + + * ppc-linux-tdep.c (ELF_NGREG, ELF_NFPREG, ELF_NVRREG) + (ELF_FPREGSET_SIZE, ELF_GREGSET_SIZE): New enums. + (fetch_core_registers, ppc_linux_supply_gregset) + (ppc_linux_supply_fpregset): New functions. + (ppc_linux_regset_core_fns): New. + (_initialize_ppc_linux_tdep): Call add_core_fns. + * ppc-tdep.h: Add prototypes for ppc_linux_supply_fpregset + and ppc_linux_supply_gregset. + * ppc-linux-nat.c (supply_gregset): Call ppc_linux_supply_gregset. + (supply_fpregset): Call ppc_linux_supply_fpregset. + * config/powerpc/linux.mh (NATDEPFILES): Remove core-regset.o and + corelow.o. + * config/powerpc/linux.mt (TDEPFILES): Add corelow.o. + +2002-07-30 Daniel Jacobowitz + + * symtab.c (lookup_symbol): Demangle before lowercasing. + +2002-07-30 Andrew Cagney + + * symtab.h: Replace #include "gdb_obstack.h" with opaque + declaration. + * cli/cli-cmds.c, cli/cli-script.c: Include "gdb_string.h". + * gnu-v3-abi.c, arc-tdep.c, cli/cli-decode.c: Ditto. + * avr-tdep.c, mon960-rom.c, i960-tdep.c: Ditto. + * arch-utils.c, cli/cli-setshow.c: Unconditionally include + "gdb_string.h". + * Makefile.in (cli-script.o, cli-cmds.o): Update dependencies. + (gnu-v3-abi.o, cli-setshow.o, i960-tdep.o): Ditto. + (cli-decode.o, mi-cmd-var.o, mi-cmd-disas.o): Ditto. + (avr-tdep.o, mon960-rom.o): Ditto. + (aout_stabs_gnu_h): Define. + (symtab_h): Remove $(gdb_obstack_h). + +2002-07-30 Jim Blandy + + Patch from David Carlton : + * gdbinit.in: Move the `dir' commands that add GDB's own source + directory to the search path to the end, so that the `gdb' source + directory will be searched first. + +2002-07-29 Andrew Cagney + + * gdb_obstack.h: New file. + * symtab.h: Include "gdb_obstack.h" instead of "obstack.h". + (obstack_chunk_alloc, obstack_chunk_free): Delete macros. + * objfiles.h: Include "gdb_obstack.h". + * Makefile.in (gdb_obstack_h): Define. + (symtab_h): Add $(gdb_obstack_h). + (objfiles_h): Add $(gdb_obstack_h). + + * objfiles.c: Include "gdb_obstack.h" instead of "obstack.h". + * macrotab.c, cp-valprint.c, dbxread.c: Ditto. + * ch-typeprint.c, ch-valprint.c, dstread.c: Ditto. + * macroexp.c, p-typeprint.c, stabsread.c: Ditto. + * symtab.c, f-typeprint.c, mdebugread.c: Ditto. + * p-valprint.c, symmisc.c, typeprint.c: Ditto. + * symfile.c, coffread.c, c-typeprint.c: Ditto. + * buildsym.c, bcache.c, ada-typeprint.c: Ditto. + + * Makefile.in (bcache.o): Update dependencies. + (buildsym.o, c-typeprint.o, ch-typeprint.o): Ditto. + (ch-valprint.o, coffread.o, cp-valprint.o): Ditto. + (dbxread.o, dstread.o, f-typeprint.o): Ditto. + (objfiles.o, p-typeprint.o, p-valprint.o): Ditto. + (stabsread.o, symfile.o, symmisc.o): Ditto. + (symtab.o, typeprint.o, macroexp.o): Ditto. + (macrotab.o, mdebugread.o): Ditto. + (f_lang_h, coff_sym_h, coff_symconst_h): Define. + (coff_ecoff_h, aout_aout64_h): Define. + (aout_stabs_gnu_h, libaout_h): Define. + +2002-07-29 Andrew Cagney + + * regcache.c (struct regcache_descr): Rename nr_registers to + nr_cooked_registers. Revise comments describing the structure + member fields. + (init_regcache_descr): Update. + (init_legacy_regcache_descr): Update. + (read_register_gen, write_register_gen): When a cooked register in + the raw register range, directly access the value from the raw + register cache. + +2002-07-29 Andrew Cagney + + * z8k-tdep.c: Do not include "obstack.h". + * h8300-tdep.c, h8500-tdep.c: Ditto. + * m68hc11-tdep.c, sh-tdep.c: Ditto. + * valprint.c, v850-tdep.c: Ditto. + * d10v-tdep.c, mn10300-tdep.c: Ditto. + * mn10200-tdep.c: Ditto. + + * Makefile.in (z8k-tdep.o): Update dependencies. + (m68hc11-tdep.o, valprint.o): Ditto. + (v850-tdep.o, d10v-tdep.o): Ditto. + (mn10300-tdep.o, sparc-tdep.o): Ditto. + (sh-tdep.o, h8500-tdep.o, h8300-tdep.o): Ditto. + (m32r-tdep.o, mn10200-tdep.o): Specify dependencies. + (sh_opc_h, gdb_sim_sh_h): Define. + (elf_sh_h, elf_bfd_h): Define. + (opcode_m68hc11_h): Define. + (OPCODES_SRC, OPCODES_DIR): define. + (OPCODES): Use $(OPCODES_DIR). + (gdb_sim_d10v_h): Rename sim_d10v_h. + (gdb_sim_arm_h): Rename sim_arm_h. + +2002-07-26 Kevin Buettner + + * utils.c (host_pointer_to_address, address_to_host_pointer): + Change internal_error() message to indicate function responsible + for the error. + +2002-07-26 Kevin Buettner + + * ui-out.c (ui_out_field_core_addr): Remove unnecessary cast in + calls to local_hex_string_custom(). + +2002-07-26 Kevin Buettner + + * irix5-nat.c: Move IRIX shared library support from here... + * solib-irix.c: ...to here. Revised substantially to work with + generic solib framework. + + * osabi.h (gdb_osabi): Add new enum constant GDB_OSABI_IRIX. + * osabi.c (gdb_osabi_names): Add corresponding string for Irix. + * mips-irix-tdep.c: New file. + + * Makefile.in (ALLDEPFILES): Add mips-irix-tdep.c and solib-irix.c. + (mips-irix-tdep.o, solib-irix.o): New rules. + * config/mips/irix5.mt (TDEPFILES): Add mips-irix-tdep.o, solib.o, + solib-irix.o. + * config/mips/irix6.mt (TDEPFILES): Likewise. + * config/mips/irix6.mh (NATDEPFILES): Remove solib.o. + +2002-07-26 Kevin Buettner + + * aix-thread.c (coff/internal.h, bfd/libcoff.h, pthread.h): Remove + disabled (via ``#if 0'') includes. + +2002-07-26 Kevin Buettner + + * aix-thread.c (special_register_p, supply_sprs64, supply_sprs32) + (fetch_regs_user_thread, fetch_regs_kernel_thread, fill_sprs64) + (fill_sprs32, store_regs_user_thread, store_regs_kernel_thread): + Add support for the fpscr register. + * rs6000-nat.c (regmap, fetch_inferior_registers) + (store_inferior_registers, fetch_core_registers): Likewise. + +2002-07-26 Kevin Buettner + + * rs6000-nat.c (language.h): Include. + (special_regs): Delete this array. + (regmap): New function. + (fetch_register, store_register): Use regmap() to map gdb + register numbers to ptrace register numbers. Also, use + outputs from regmap() to make decisions regarding type of + ptrace() call to make. In particular, don't compare against + FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. + (fetch_inferior_registers, store_inferior_registers): Where + possible, obtain register numbers from tdep struct. Don't + refer to FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. + * config/rs6000/tm-rs6000.h (FIRST_UISA_SP_REGNUM) + (LAST_UISA_SP_REGNUM): Delete. + +2002-07-25 Kevin Buettner + + * rs6000-nat.c (ppc-tdep.h): Include. + (fetch_registers, store_register, fetch_core_registers): Don't + access registers[] directly. Instead, use supply_register() or + regcache_collect() as appropriate. + (find_toc_address): Format hex address with local_hex_string(). + +2002-07-25 Andrew Cagney + + * config/djgpp/fnchange.lst: Rename bfd/elf32-fr30.c and + bfd/elf32-frv.c. + +2002-07-24 Tom Tromey + + * jv-exp.y: Marked all strings with _(). + (ClassInstanceCreationExpression, ArrayCreationExpression): Use + internal_error. + (MethodInvocation, CastExpression, parse_number, yyerror, + java_type_from_name, push_expression_name, yylex): Typo fixes. + +2002-07-24 Daniel Jacobowitz + + * ui-file.c (struct tee_file, tee_file_new, tee_file_delete) + (tee_file_flush, tee_file_write, tee_file_fputs) + (tee_file_isatty): New. + * ui-file.h (tee_file_new): Add prototype. + +2002-07-24 Aidan Skinner + + * ada-lang.c: Change k&r style function definitions to prototyped + form. + * ada-typeprint.c: Change k&r style function definitions to prototyped + form. + * ada-valprint.c: Change k&r style function definitions to prototyped + form. + +2002-07-24 Andrew Cagney + + * README: Remove reference to remote-bug. + * Makefile.in (ALLDEPFILES): Remove m88k-nat.c, m88k-tdep.c and + remote-bug.c. + (m88k-nat.o): Delete rule. + (m88k-tdep.o): Delete rule. + (remote-bug.o): Delete rule. + * MAINTAINERS: Mark as obsolete. + * elfread.c (elf_symtab_read): Mention that m88k is obsolete. + * m88k-tdep.c: Make file obsolete. + * config/m88k/m88k.mh: Ditto. + * config/m88k/delta88v4.mh: Ditto. + * config/m88k/delta88v4.mt: Ditto. + * config/m88k/delta88.mt: Ditto. + * config/m88k/delta88.mh: Ditto. + * remote-bug.c: Ditto. + * config/m88k/tm-delta88.h: Ditto. + * config/m88k/nm-delta88v4.h: Ditto. + * config/m88k/xm-delta88.h: Ditto. + * config/m88k/xm-dgux.h: Ditto. + * config/m88k/tm-m88k.h: Ditto. + * config/m88k/nm-m88k.h: Ditto. + * config/m88k/tm-delta88v4.h: Ditto. + * m88k-nat.c: Ditto. + * cxux-nat.c: Ditto. + * configure.host: Make m88*-motorola-sysv4*, m88*-motorola-sysv* + and m88*-*-* obsolete. + * configure.tgt: Make m88*-motorola-sysv4*, m88*-motorola-* and + m88*-*-* obsolete. + +2002-07-24 Andrew Cagney + + * findvar.c (extract_unsigned_integer): Make `addr' parameter + constant. Same for local pointer variables. + (extract_signed_integer): Ditto. + * defs.h (extract_unsigned_integer): Update. + (extract_signed_integer): Update. + +2002-07-24 Andrew Cagney + + * regcache.c (regcache_raw_write): Change buf parameter to a + constant void pointer. + (regcache_raw_read): Change buf parameter to a void pointer. + (legacy_write_register_gen): Change myaddr parameter a constant + void pointer. + (supply_register): Change val parameter to a const void pointer. + * regcache.h (regcache_raw_write): Update declaration. + (regcache_raw_read): Update declaration. + (supply_register): Update declaration. + +2002-07-24 Tom Tromey + + * defs.h (gdb_readline_wrapper): Declare. + * utils.c (prompt_for_continue): Use gdb_readline_wrapper. + * tracepoint.c (read_actions): Use gdb_readline_wrapper. + * top.c (gdb_readline_wrapper): New function. + (command_line_input): Use it. + +2002-07-24 Andrew Cagney + + * regcache.h (regcache_raw_read, regcache_raw_write): Replace + regcache_read and regcache_write. + (regcache_raw_read_as_address): Replace regcache_read_as_address. + * regcache.c: Update. + * sh-tdep.c (sh64_push_arguments): Update comment. + (sh_pseudo_register_read): Update. + (sh_pseudo_register_write): Update. + (sh4_register_read): Update. + (sh4_register_write): Update. + (sh64_pseudo_register_read): Update. + (sh64_pseudo_register_write): Update. + (sh64_register_read): Update. + (sh64_register_write): Update. + * i386-tdep.c (i386_extract_return_value): Update. + (i386_extract_struct_value_address): Update. + (i386_extract_return_value): Update. + * blockframe.c (generic_read_register_dummy): Update. + (generic_call_dummy_register_unwind): Update + * infrun.c (write_inferior_status_register): Update. + +2002-07-23 Jim Blandy + + * parser-defs.h (expression_context_pc): Make this extern. + (Thanks to Michael Snyder.) + +2002-07-23 Andrew Cagney + + GDB 5.2.1 released from 5.2 branch. + * NEWS: Mention changes in 5.2.1 including addition of AVR target. + * README: Update to mention 5.2.1. + +2002-07-23 Mark Salter + + * remote.c (remote_read_bytes): Fix check for error. + +2002-07-22 Kevin Buettner + + * aix-thread.c (language.h): Include. + (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) + (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc): + Print newlines at end of debug messages. + (pdc_symbol_addrs, pdc_read_regs, pdc_write_regs, pdc_read_data) + (pdc_write_data): Use local_hex_string() instead of %llx formats. + +2002-07-22 Kevin Buettner + + * aix-thread.c (ppc-tdep.h): Include. + (special_register_p): New function. + (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32) + (store_regs_user_thread): Use register number information from + gdbarch_tdep struct instead of hardcoded offsets relative to + FIRST_UISA_SP_REGNUM. + (fetch_regs_kernel_thread, store_regs_kernel_thread): Call + special_register_p() instead of using FPLAST_REGNUM and + LAST_UISA_SP_REGNUM as lower and upper bounds on the special + register numbers. Also, don't assume that LAST_UISA_SP_REGNUM + will be MQ's register number. + +2002-07-22 Michael Snyder + + * aix-thread.c (ops): Rename to aix_thread_ops. + (base_ops): Rename to base_target. + (ops_attach): Rename to aix_thread_attach. + (ops_detach): Rename to aix_thread_detach. + (ops_resume): Rename to aix_thread_detach. + (ops_wait): Rename to aix_thread_wait. + (ops_kill): Rename to aix_thread_kill. + (init_ops): Rename to init_aix_thread_ops. + (ops_fetch_register): Rename to aix_thread_fetch_register. + (ops_store_register): Rename to aix_thread_store_register. + (ops_mourn_inferior): Rename to aix_thread_mourn_inferior. + (ops_thread_alive): Rename to aix_thread_thread_alive. + (ops_extra_thread_info: Rename to aix_thread_extra_thread_info. + (ops_pid_to_str): Rename to aix_thread_pid_to_str. + (ops_xfer_memory): Rename to aix_thread_xfer_memory. + (fetch_regs_lib): Rename to fetch_regs_user_thread. + (fetch_regs_kern): Rename to fetch_regs_kernel_thread. + (store_regs_lib): Rename to store_regs_user_thread. + (store_regs_kern): Rename to store_regs_kernel_thread. + +2002-07-22 Michael Snyder + + * aix-thread.c (ops_prepare_to_store): Eliminate. + (init_ops): Don't initialize ops.prepare_to_store. + (store_regs_kern): Pre-fetch register buffers from child, + because some registers may not be in the cache. Copy + regs from register cache only if they are cached. + (store_regs_lib): Copy regs from register cache only + if they are cached. + (fill_sprs32, (fill_sprs64, fill_fprs, fill_gprs32, + fill_gprs64): Ditto. + +2002-07-22 Kevin Buettner + + * aix-thread.c (gdb_assert.h): Include. + (fill_sprs64, fill_sprs32): Add selected asserts to make sure that + register sizes (from register cache) match size of buffer holding + register data. + (fill_sprs32): Change parameter types to match those in the ptrace() + buffer. + (store_regs_lib): Likewise, but for 32-bit temporary variables. + (ops_prepare_to_store): Rename loop variable ``i'' to ``regno''. + +2002-07-22 Michael Snyder + + * aix-thread.c (supply_sprs64): Cosmetic change. + (supply_sprs32): Cosmetic change. + (fill_gprs64, fill_gprs32, fill_fprs, fill_sprs32): New funcs. + (fill_sprs64): Use regcache_collect instead of read_register. + (store_regs_lib): Use regcache_collect instead of + read_register. Use fill_sprs32 instead of fill_sprs64, + if debugging a 32-bit architecture. + (store_regs_kern): Use fill_gprs64 etc. to pull the values + out of the register cache, instead of passing a pointer into + the register cache directly to ptrace. Use regcache_collect + insteaad of read_register. + (ops_prepare_to_store): Use target_read_registers instead + of read_register_bytes. + +2002-07-20 Aidan Skinner + + * MAINTAINERS: Add self under write after approval. + +2002-07-20 Aidan Skinner + + * ada-tasks.c: Change k&r style function definitions to prototyped + form. + +2002-07-19 Andrew Cagney + + * Makefile.in (x86-64-tdep.o): Add $(objfiles_h). + * x86-64-tdep.c: Include "objfiles.h". + (x86_64_gdbarch_init): Set in_solib_call_trampoline to + in_plt_section. From 2002-07-18 Michal Ludvig . + +2002-07-17 Michal Ludvig + + * dwarf2cfi.c (execute_stack_op): Complain on unknown DW_OP_ value. + (update_context): Initialise cfa variable. + +2002-07-17 Michael Snyder + + * aix-thread.c: Shorten some long lines. + Bring comments into line with code spec. + +2002-07-18 Joel Brobecker + + * infrun.c: Re-indent using gdb_indent.sh. + +2002-07-18 Joel Brobecker + + * infrun.c (handle_inferior_event): Remove unneeded extra brace. + Leave the indentation temporarily untouched, to minimize the diffs. + +2002-07-18 Elena Zannoni + + * stabsread.c: Make os9k sections of the code obsolete, + for real this time. + * stabsread.h: Make os9k sections of the code obsolete. + +2002-07-18 Michal Ludvig + + * linux-low.c (regsets_store_inferior_registers): Add free() + at the end of a loop to prevent memory leak. + * linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers. + (X86_64_NUM_GREGS): Count it from the size of x86_64_regmap. + * config/sparc/tm-sp64linux.h: Make the rest of #endif + line a comment. + * Makefile.in (x86-64-linux-nat.o): Remove dependency on i387-tdep.h + +2002-07-17 Jim Blandy + + * macrocmd.c (info_macro_command): Remove newline from error + message. + +2002-07-17 J"orn Rennecke + + * sh-tdep.c (sh_dsp_register_sim_regno): New function. + (sh_gdbarch_init): Use it for sh-dsp. + +2002-07-16 Kevin Buettner + + * dwarf2read.c (read_initial_length): Handle older, non-standard, + 64-bit DWARF2 format. + +2002-07-16 Joel Brobecker + + * proc-api.c: use HAVE_SYS_PROC_H macro to avoid including + when not available. + +2002-07-16 Andrew Cagney + + * NEWS: Mention that the i[34]86-*-os9k has been made obsolete. + * stabsread.c: Make os9k sections of the code obsolete. + * configure.tgt: Make i[3456]86-*-os9k target obsolete. + * config/i386/i386os9k.mt: Make file obsolete. + * Makefile.in (ALLDEPFILES): Remove remote-os9k.c. + (COMMON_OBS): Remove os9kread.o + (SFILES): Remove os9kread.c. + (os9kread.o, remote-os9k.o): Make target obsolete. + * remote-os9k.c: Make file obsolete. + * os9kread.c: Make file obsolete. + * Makefile.in + +2002-07-16 Andrew Cagney + + * NEWS: Mention that the FR30 has been made obsolete. + * fr30-tdep.c: Make file obsolete. + * config/fr30/tm-fr30.h: Ditto. + * config/fr30/fr30.mt: Ditto. + * configure.tgt: Make fr30-*-elf obsolete. + * MAINTAINERS: Make fr30-elf obsolete. + +2002-07-16 Pierre Muller + + * blockframe.c (get_pc_function_start): return 0 if the minimal symbol + found is not inside a section. + +2002-07-15 Kevin Buettner + + * aix-thread.c (ptrace_check): Use safe_strerror() instead of + strerror(). + (pdc_realloc): Use xrealloc() instead of realloc(). + +2002-07-15 Kevin Buettner + + * aix-thread.c (PD_ERROR, CALL_BASE): Delete. + (ops_resume, ops_wait, fetch_regs_lib, store_regs_lib) + (ops_xfer_memory, ops_kill): Don't use PD_ERROR or CALL_BASE + macros. + +2002-07-15 Kevin Buettner + + * aix-thread.c (ptrace_check): Eliminate goto. + (sync_threadlists): Eliminate gotos. Also, fix array overrun + problem. + +2002-07-15 Kevin Buettner + + * aix-thread.c (gdbcmd.h): Include. + (DEBUG, DBG, DBG2, dbg): Eliminate. + (debug_aix_thread): New static global. + (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) + (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc) + (fetch_regs_lib, store_regs_lib, store_regs_kern): Rewrite + invocations to DBG and DBG2 macros to test against + ``debug_aix_thread'' and call fprintf_unfiltered(). + (_initialize_aix_thread): Add new command "set debug aix-thread". + +2002-07-15 Andrew Cagney + + From Gerhard Tonn : + * s390-nat.c (fill_fpregset, fill_gregset): Use regcache_collect + instead of supply_register. + +2002-07-15 Andrew Cagney + + * dwarf2cfi.c: Include "gdb_assert.h". + (frame_state_for): Use gdb_assert to check that fde->cie_ptr is + non-NULL. + (update_context): Do not use __func__. Add missing ``break''. + (update_context): Do not use __func__. + +2002-07-15 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Remove variable print_insn + and its setting. Set gdbarch instruction printing functions + directly. For non-rs6000 case use new function + gdb_print_insn_powerpc. + (gdb_print_insn_powerpc): New function. + +2002-07-13 Andrew Cagney + + * NEWS: Mention that the d30v has been marked obsolete. + * MAINTAINERS: Note that d30v / d30v-elf has been made obsolete. + * configure.tgt: Mark d30v-*-* as obsolete. + * d30v-tdep.c: Mark file as obsolete. + * config/d30v/d30v.mt: Ditto. + * config/d30v/tm-d30v.h: Ditto. + +2002-07-13 Aidan Skinner + + * ada-tasks.c (add_task_entry): replace calls to + malloc() with xmalloc + * ada-tasks.c (init_task_list): replace calls to free with xfree() + + * ada-lang.c (replace_operator_with_call, fill_in_ada_prototype, + ada_finish_decode_line_1, all_sals_for_line + ada_breakpoint_rewrite): replace calls to free() with xfree() + +2002-07-12 Kevin Buettner + + From Nicholas Duffek (with minor changes by Martin Hunt, + Louis Hamilton, and Kevin Buettner): + * aix-thread.c: New file. + +2002-07-12 Petr Sorfa + + * dwarf2read.c (dwarf2_invalid_attrib_class): New + complaint for invalid attribute class or form. + (read_func_scope): DW_AT_frame_base + better handling of DW_AT_block*. + (dwarf2_add_member_fn): DW_AT_vtable_elem_location + better handling of DW_AT_block*. + (read_common_block): DW_AT_location + better handling of DW_AT_block*. + (read_partial_die): DW_AT_location better handling + of DW_AT_block*. + (new_symbol): DW_AT_external better handling of + DW_AT_block*. Proper initialization of variable + "addr". + (attr_form_is_block): New function that returns true + if the attribute's form is of DW_FORM_block*. + +2002-07-12 Peter Schauer + + * valops.c (find_method_list): Remove comment about + removed STATIC_MEMFUNCP argument. + (value_find_oload_method_list): Likewise. + +2002-07-12 Kevin Buettner + + From Nicholas Duffek: + * rs6000-nat.c (vmap_ldinfo, xcoff_relocate_core): Call + target_new_objfile_hook. + +2002-07-12 Kevin Buettner + + From Nicholas Duffek: + * xcoffread.c (scan_xcoff_symtab): Recognize XMC_TD as a data storage + csect. + +2002-07-12 Andrew Cagney + + * MAINTAINERS: Mention --enable-sim-build-warnings. + (m68hc11-elf): Disable sim build warnings. + (m32r-elf): Mark as broken obsolete candidate. + (x86_64-linux-gnu): Mark as buildable with -Werror. + (arm-elf): Change -w to ``,'' which enables warnings but not + -Werror. + +2002-07-12 Andrew Cagney + + * bcache.h: Update copyright. + (struct bstring, struct bcache): Move definition to "bcache.c". + Replaced by opaque declaration. + (bcache_xfree): Replace free_bcache. + (bcache_xmalloc, bcache_memory_used): Declare. + + * bcache.c: Update copyright. + (struct bstring, struct bcache): Moved to here from "bcache.h". + Update comments. + (bcache_xmalloc, bcache_memory_used): New functions. + (bcache_xfree): Replace function free_bcache. + + * Makefile.in (objfiles.o): Add $(bcache_h). + (objfiles_h): Remove $(bcache_h). + (symfile.o): Add $(bcache_h). + + * symmisc.c: Update copyright. + (print_symbol_bcache_statistics): Pass psymbol_cache by value. + (print_objfile_statistics): Use bcache_memory_used. + + * symfile.c: Include "bcache.h". + (reread_symbols): Use bcache_xfree. + (reread_symbols): Use bcache_xmalloc and bcache_xfree. + (add_psymbol_to_list): Pass psymbol_cache by value. + (add_psymbol_with_dem_name_to_list): Ditto. + + * objfiles.h: Update copyright. + (struct bcache): Declare opaque. Do not include "bcache.h". + (struct objfile): Change psymbol_cache and macro_cache to ``struct + bcache'' pointers. + * dwarf2read.c (macro_start_file): Pass macro_cache by value. + + * objfiles.c: Include "bcache.h". Update copyright. + (allocate_objfile): Use bcache_xmalloc to create psymbol_cache and + macro_cache. + (free_objfile): Use bcache_xfree. + +2002-07-11 Grace Sainsbury + + * monitor.c (monitor_fetch_register): Make name a constant. + (monitor_store_register): Same. + +2002-07-11 Daniel Jacobowitz + + Based on patch from Daniel Berlin . + * buildsym.c: Include "demangle.h" for SYMBOL_INIT_DEMANGLED_NAME. + (finish_block) For non-function blocks, hash the symbol table. For + function blocks, mark the symbol table as unhashed. + * minsyms.c (msymbol_hash): Return hash value without taking modulus. + (msymbol_hash_iw): Likewise. + (add_minsym_to_hash_table): Take modulus of msymbol_hash's return + value. + (add_minsym_to_demangled_hash_table): Likewise for msymbol_hash_iw. + (lookup_minimal_symbol): Likewise for both. + * symtab.h (struct block): Add `hashtable' flag. Comment the + hashtable. + (BLOCK_HASHTABLE, BLOCK_BUCKETS, BLOCK_BUCKET): New macro. + (ALL_BLOCK_SYMBOLS): Update. + (BLOCK_SHOULD_SORT): Do not sort hashed blocks. + (struct symbol): Add `hash_next' pointer. + * symtab.c (lookup_block_symbol): Search using the hash table when + possible. + (find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS. + (search_symbols, find_addr_symbol): Likewise. + + * dstread.c (process_dst_block): Clear hashtable bit for new block. + (read_dst_symtab): Likewise. + * jv-lang.c (get_java_class_symtab): Likewise. + * mdebugread.c: Include "gdb_assert.h". + (shrink_block): Assert that the block being modified is not hashed. + * coffread.c (patch_opaque_types): Use ALL_BLOCK_SYMBOLS. + * symmisc.c (free_symtab_block): Walk the hash table when freeing + symbols. + (dump_symtab): Recognize hashed blocks. + * printcmd.c (print_frame_args): Assert that function blocks do not + have hashed symbol tables. + * ada-lang.c (symtab_for_sym): Use ALL_BLOCK_SYMBOLS. + (fill_in_ada_prototype, debug_print_block): Likewise. + (ada_add_block_symbols): Use ALL_BLOCK_SYMBOLS. Handle hash tables. + +2002-07-11 Corinna Vinschen + + * stack.c (print_frame): Use result of frame_address_in_block() + instead of fi->pc when evaluating symbols. + (backtrace_command_1): Ditto. + +2002-07-11 Andrew Cagney + + * cris-tdep.c (cris_saved_pc_after_call): Fix parameter type. + Make static. + + * arm-tdep.c (arm_register_name): Make return type constant. + +2002-07-10 Andrew Cagney + + * win32-nat.c (has_detach_ability): Convert to strict ISO C + prototype. + * top.c (gdb_rl_operate_and_get_next_completion): Ditto. + * s390-tdep.c (s390_fp_regnum): Ditto. + (s390_read_fp): Ditto. + (s390_pop_frame): Ditto. + (_initialize_s390_tdep): Ditto. + * remote.c (get_remote_state): Ditto. + * procfs.c (mappingflags): Ditto. + * memattr.c (_initialize_mem): Ditto. + * mcore-tdep.c (mcore_pop_frame): Ditto. + * m68klinux-nat.c (_initialize_m68k_linux_nat): Ditto. + * m68k-tdep.c (m68k_register_bytes_ok): Ditto. + * language.c (set_case_str): Ditto. + * gnu-v3-abi.c (vtable_address_point_offset): Ditto. + * frv-tdep.c (new_variant): Ditto. + (frv_stopped_data_address): Ditto. + * dwarf2cfi.c (fde_chunks_need_space): Ditto. + (context_alloc): Ditto. + (frame_state_alloc): Ditto. + (unwind_tmp_obstack_init): Ditto. + (unwind_tmp_obstack_free): Ditto. + (cfi_read_fp): Ditto. + * cris-tdep.c (cris_saved_pc_after_call): Ditto. + (cris_pop_frame): Ditto. + * c-lang.c (scanning_macro_expansion): Ditto. + (finished_macro_expansion): Ditto. + (c_preprocess_and_parse): Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h, gdbarch.c: Regenerate. + * config/mn10200/tm-mn10200.h: Adjust indentation. + * target.c: Adjust indentation. + * symtab.h: Adjust indentation. + * stabsread.h: Adjust indentation. + * remote-es.c: Adjust indentation. + * os9kread.c: Adjust indentation. + +2002-07-10 Andrew Cagney + + * wince.c (_initialize_wince): Rename _initialize_inftarg. + * win32-nat.c (_initialize_win32_nat): Rename _initialize_inftarg. + +2002-07-10 Grace Sainsbury + + * NEWS: Mention m68k, mcore multi-arching. + * MAINTAINERS: Change status of m68k, mcore to reflect + multi-arching. + +2002-07-10 Daniel Jacobowitz + + * valops.c (find_overload_match): Free oload_syms. + +2002-07-09 Joel Brobecker + + Define HAVE_SYS_PROC_H if sys/proc.h exists + * configure.in: Add check for sys/proc.h + * config.in: Regenerate. + * configure: Regenerate. + +2002-07-09 Grace Sainsbury + + * config/m68k/tm-m68k.h: Remove macros wrapped in + #if !GDB_MULTI_ARCH. + +2002-07-08 Andrew Cagney + + * config.in, configure: Regenerate. + +2002-07-08 Mark Kettenis + + * dwarf2cfi.c: Include "gcore.h". + (execute_stack_op): Fix implementation of the + DW_OP_deref and DW_OP_deref_size operators by letting do their + lookup in the target. + +2002-07-07 Mark Kettenis + + From Peter Schauer : + * i386-sol2-tdep.c (i386_sol2_init_abi): Correct value for + tdep->sc_sp_offset. + +2002-07-05 Daniel Jacobowitz + + Fix PR gdb/595, gdb/602 + * gnu-v3-abi.c (gnuv3_baseclass_offset): Remove unused variables. + Don't call value_cast, just read the vtable pointer; update comments + to match. + +2002-07-05 Grace Sainsbury + + * config/mcore/tm-mcore.h: Remove file. + * config/mcore/mcore.mt: Remove definition of TM_FILE + * configure.tgt: Set gdb_multi_arch to yes for the mcore target. + +2002-07-05 Mark Kettenis + + * i386bsd-tdep.c: Include "gdb_string.h". + +2002-07-04 Grace Sainsbury + + * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2. + (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG,RETVAL_REGNUM): Move to + mcore-tdep. + (REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER) + (TARGET_VIRTUAL_FRAME_POINTER, BELIEVE_PCC_PROMOTION): Remove. + * mcore-tdep.c (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG) + (RETVAL_REGNUM): Move macros from tm-mcore.h + (mcore_reg_struct_has_addr): New function. + (mcore_gdbarch_init): Added initializations for the macros removed + from tm-mcore.h. + +2002-07-04 Mark Kettenis + + * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's + traditonal string branding within the ELF header. + +2002-07-04 Daniel Jacobowitz + + * symtab.c (remove_params): New function. + (make_symbol_overload_list): Use it instead of cplus_demangle. + (overload_list_add_symbol): Likewise. Reorder. Fix memory leak. + +2002-07-04 Mark Kettenis + + * i386obsd-nat.c (_initialize_i386obsd_nat): Fix typo in prototype. + + * i386bsd-tdep.c (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): + New variables. + (i386nbsd_init_abi): Use these to initialize tdep->sigtramp_start + and tdep->sigtramp_end. + * i386obsd-nat.c: New file. + * config/i386/obsd.mh (NATDEPFILES): Add i386obsd-nat.o. + + * dwarf2cfi.c (cfi_pop_frame): Use alloca() for regbuf. + Don't call get_current_frame(). + +2002-07-04 Pierre Muller + + * i386-nat.c (child_post_startup_inferior): New function + calling i386_cleanup_dregs if + I386_USE_GENERIC_WATCHPOINTS is defined. + * config/i386/nm-i386.h: define CHILD_POST_STARTUP_INFERIOR + conditional to acknowledge that i386-nat.c has its + own child_post_startup_inferior function. + +2002-07-04 Mark Kettenis + + * i386-tdep.h (I386_MAX_REGISTER_SIZE): New define. + * i386-tdep.c (i386_do_pop_frame): Use I386_MAX_REGISTER_SIZE + instead of MAX_REGISTER_RAW_SIZE. + (i386_extract_return_value, i386_extract_struct_value_address): + Convert to use regcache. + (i386_gdbarch_init): Set max_register_raw_size and + max_register_virtual_size to I386_MAX_REGISTER_SIZE. + Set extract_return_value and extract_struct_value_address instead + of their deprecated variants. + + Convert i386 target to generic dummy frames. + * i386-tdep.c: Include "symfile.h". + (i386_frameless_signal_p): Consider a function to be frameless if + the pc points at the first instruction of the function. + (i386_frame_chain): Handle (generic) call dummies. + (i386_frame_saved_pc): Likewise. + (i386_frame_init_saved_regs): Remove code dealing with call + dummies on the stack. + (i386_push_dummy_frame): Removed. + (i386_call_dummy_words): Removed. + (i386_fix_call_dummy): Removed. + (i386_push_return_address): New function. + (i386_do_pop_frame): Renamed from i386_pop_frame. Add FRAME + parameter, and don't call get_current_frame. + (i386_pop_frame): New function. + (i386_gdbarch_init): Set use_generic_dummy_frames to 1, set + call_dummy_location to AT_ENTRY_POINT, set call_dummy_address to + entry_point_address, set call_dummy_breakpoint_offset to 0, set + call_dummy_length to 0, set call_dummy_words to NULL, set + sizeof_call_dummy_words to 0, set fix_call_dummy to + generic_fix_call_dummy, set pc_in_call_dummy to + pc_in_call_dummy_at_entry_point, set push_dummy_frame to + generic_push_dummy_frame, set push_return_address to + i386_push_return_address and set frame_chain_valid to + generic_file_frame_chain_valid. + +2002-07-03 Andrew Cagney + + * gdbarch.sh (struct regcache): Add opaque declaration. + (EXTRACT_RETURN_VALUE): New architecture method. + (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.c (legacy_extract_return_value): New function. + * arch-utils.h (legacy_extract_return_value): Declare. + * values.c (value_being_returned): Re-enable code handling + EXTRACT_STRUCT_VALUE_ADDRESS. Move + deprecated_grub_regcache_for_registers call to block handling + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. + (EXTRACT_RETURN_VALUE): Do not define. + +2002-07-03 Grace Sainsbury + + * config/mcore/tm-mcore.h (REGISTER_BYTES, NUM_REGS, PC_REGNUM) + (SP_REGNUM, FP_REGNUM, FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK) + (BREAKPOINT_FROM_PC, INNER_THAN, SAVED_PC_AFTER_CALL) + (INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS, INIT_FRAME_PC) + (FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC) + (STORE_RETURN_VALUE, DEPRECATED_EXTRACT_RETURN_VALUE) + (STORE_STRUCT_RETURN, DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) + (SKIP_PROLOGUE, FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS) + (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, POP_FRAME) + (PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, PUSH_ARGUMENTS): Remove. + * mcore-tdep.c (mcore_init_extra_frame_info): Add fromleaf + argument so the function fits the prototype in the architecture + vector. + (mcore_pop_frame): Remove argument so the function fits the + prototype. Use get_current_frame instead of the argument. + (mcore_push_arguments): Change type of struct_return so the + function can be used in the architecture vector. + (mcore_store_struct_return): Add. + (mcore_frame_init_saved_regs): Add. + (mcore_gdbarch_init): Add function calls to replace the macros + removed from tm-mcore.h + +2002-07-03 Andrew Cagney + + * infcmd.c (print_return_value): Remove compatibility code calling + deprecated_grub_regcache_for_registers. + + * values.c: Include "regcache.h". + (value_being_returned): Update. Use + deprecated_grub_regcache_for_registers to extract the register + buffer address. + * value.h (value_being_returned): Change ``retbuf'' parameter to a + ``struct regcache''. + * Makefile.in (values.o): Add dependency on $(regcache_h). + + * inferior.h (run_stack_dummy): Change type of second parameter to + a ``struct regcache''. + * valops.c (hand_function_call): Change type of retbuf to ``struct + regcache''. Allocate using regcache_xmalloc, clean using + make_cleanup_regcache_xfree. + * infcmd.c (run_stack_dummy): Update. Use + regcache_cpu_no_passthrough instead of memcpy to copy the buffer. + + * regcache.c (do_regcache_xfree): New function. + (make_cleanup_regcache_xfree): New function. + * regcache.h (make_cleanup_regcache_xfree): Declare. + +2002-07-03 Martin M. Hunt + + * event-top.c (command_line_handler): Don't read past + beginning of buffer. + +2002-07-03 Martin M. Hunt + + * varobj.c (struct varobj_root): Change frame from CORE_ADDR to + struct frame_id. + (varobj_create): Store frame_id for root. + (varobj_gen_name): Use xasprintf. + (varobj_update): Save and restore frame using get_frame_id() and + frame_find_by_id(). + (create_child): Use xasprintf. + (new_root_variable): Initialize frame_id. + (c_name_of_child): Use xasprintf. Call find_frame_by_id(). + (c_value_of_variable): Use xasprintf. Move mem_fileopen call + to prevent memory leak. + +2002-07-03 Andrew Cagney + + * valops.c (hand_function_call): Move declaration of retbuf to + start of function, allocate using malloc, add a cleanup but before + the inf_status cleanup, cleanup the buffer. Rename local variable + old_chain to inf_status_cleanup. + +2002-07-03 Martin M. Hunt + + * top.c (execute_command): Use cmd_func() and cmd_func_p(). + + * cli/cli-decode.c (cmd_func_p): New function. + (cmd_func): New function. + + * command.h: Add cmd_func() and cmd_func_p(). + +2002-07-03 Grace Sainsbury + + * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0. + (REGISTER_SIZE): Remove. + (MAX_REGISTER_RAW_SIZE): Remove. + (REGISTER_VIRTUAL_TYPE): Remove. + (MAX_REGISTER_VIRTUAL_SIZE): Remove. + (REGISTER_NAME): Remove. + (USE_GENERIC_DUMMY_FRAMES): Remove. + (CALL_DUMMY): Remove. + (CALL_DUMMY_START_OFFSET): Remove. + (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. + (CALL_DUMMY_LOCATION): Remove. + (FIX_CALL_DUMMY): Remove. + (CALL_DUMMY_ADDRESS): Remove. + (SIZEOF_CALL_DUMMY_WORDS): Remove. + (SAVE_DUMMY_FRAME_TOS): Remove. + * mcore-tdep.c (MCORE_REG_SIZE, MCORE_NUM_REGS): Add macros. + (mcore_register_virtual_type): New function. + (mcore_register_byte): New function. + (mcore_register_size): New function. + (mcore_register_name): New function. + (mcore_gdbarch_init): New function. Add set_gdbarch calls for + macros removed from tm-mcore.h. + (mcore_dump_tdep): Add. + (_initialize_mcore_tdep): Add gdbarch_register call. + +2002-07-03 Mark Kettenis + + * i386-tdep.c (i386_frameless_signal_p): Provide an argument in to + frameless_look_for_prologue, such that we actually call this + function. + +2002-07-02 Joel Brobecker + + * frame.h (frame_address_in_block): New function. + + * blockframe.c (frame_address_in_block): New function extracted + from get_frame_block(). + (get_frame_block): Use frame_address_in_block(). + (block_innermost_frame): Use frame_address_in_block() to match + the frame pc address against the block boundaries rather than + the frame pc directly. This prevents a failure when a frame pc + is actually a return-address pointing immediately after the end + of the given block. + +2002-07-02 Grace Sainsbury + + * MAINTAINERS: Add self under write after approval. + +2002-07-02 Grace Sainsbury + + * m68k-tdep.c (m68k_remote_breakpoint_from_pc): Add. Currently not + used in architecture vector. The default is + m68k_local_breakpoint_from_pc. + (m68k_local_breakpoint_from_pc): Add. + (enum): Add register numbers from tm-m68k.h. + (m68k_gdbarch_init): Add breakpoint_from_pc to architecture + vector. + * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Set to + GDB_MULTI_ARCH_PARTIAL. + (BPT_VECTOR, REGISTER_BYTES_FP, REGISTER_BYTES_NOFP) + (NUM_FREGS, SIG_PC_FP_OFFSET, SP_ARG0, REMOTE_BPT_VECTOR): Move to + m68k-tdep.c. + (BREAKPOINT, REMOTE_BREAKPOINT): Remove. + (A1_REGNUM, FP0_REGNUM, FPC_REGNUM, FPS_REGNUM, FPI_REGNUM): Move + to enum in m68k-tdep.c + +2002-07-02 Joel Brobecker + + * solib-osf.c (open_map): Compute the list of shared libraries + loaded by the inferior, rather than the list of libraries loaded + by GDB itself. Otherwise, GDB ends up reading the symbols from + the wrong shared libraries... + +2002-07-02 Mark Kettenis + + * i386-linux-tdep.c (i386_linux_sigcontext_addr): Make static. + (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONEXT_SP_OFFSET): Remove + macros. + (i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp): + Remove functions. + (FRAMELESS_SIGNAL): Remove function. + (i386_linux_frame_chain, i386_linux_frame_saved_pc, + i386_linux_saved_pc_after_call): Removed. + (i386_linux_init_abi): Initialize tdep->sigcontext_addr, + tdep->sc_pc_offset and tdep->sc_sp_offset. Don't override + frame_chain, frame_saved_pc and saved_pc_after_call any longer. + + * i386-tdep.c (i386_frameless_signal_p): New function. + (i386_frame_chain): Deal with frameless signals. + (i386_sigtramp_saved_sp): New function. + (i386_frame_saved_pc): Deal with frameless signals. + (i386_saved_pc_after_call): Make sure the correct value is + returned just after entry into a sigtramp. + * i386bsd-tdep.c (i386bsd_sc_sp_offset, i386nbsd_sc_sp_offset, + i386fbsd4_sc_sp_offset): New variables. + (i386bsd_init_abi, i386nbsd_init_abi, i386fbsd4_init_abi): Use + these variables to initialize tdep->sc_sp_offset. * i386bsd-nat.c + (_initialize_i386bsd_nat): Add sanity check for sc_sp_offset + similiar to what we already did for sc_pc_offset. + * i386-sol2-tdep.c (i386_sol2_init_abi): Initialize + tdep->sc_sp_offset. + + * i386nbsd-tdep.c (fetch_elfcore_registers): Wrap long line. + +2002-07-02 Michal Ludvig + + * config/i386/tm-x86-64linux.h: New. + * config/i386/x86-64linux.mt: Add GDB_MULTI_ARCH and TM_FILE + definitions. + * config/i386/nm-x86-64.h: Rename to ... + * config/i386/nm-x86-64linux.h: ... this one. + * config/i386/x86-64linux.mh: Reflect the above change. + +2002-07-01 Mark Kettenis + + * i386-tdep.h (struct gdbarch_tdep): Replace sigtramp_saved_pc + with sigcontext_addr. Add sc_sp_offset. + (i386bsd_sigtramp_saved_pc): Remove prototype. + (i386bsd_sicontext_addr): Add prototype. + * i386-tdep.c (i386_sigtramp_saved_pc): New function. + (i386_frame_saved_pc): Rewrite to call i386_sigtramp_saved_pc. + (i386_svr4_sigtramp_saved_pc): Removed. + (i386_svr4_sigcontext_addr): New function. + (i386_svr4_init_abi): Don't initialize tdep->sigtramp_saved_pc. + Initialize tdep->sigcontext_addr instead. Initialize + tdep->sc_pc_offset and tdep->sc_sp_offset. + (i386_gdbarch_init): Likewise. + * i386bsd-tdep.c (i386bsd_sigcontext_addr): Don't make it static + any more. + (i386bsd_sigtramp_saved_pc): Remove function. + (i386bsd_init_abi): Don't initialize tdep->sigtramp_saved_pc. + Initialize tdep->sigcontext_addr instead. Initialize + tdep->sc_pc_offset. + * i386-linux-tdep.c (i386_linux_init_abi): Remove initialization + of tdep->sigtramp_saved_pc. + * i386-sol2-tdep.c (i386_sol2_init_abi): Don't initialize + tdep->sigtramp_saved_pc. Initialize tdep->sigcontext_addr + instead. + + * i386-tdep.c (i386_frameless_function_invocation, + i386_frame_num_args, i386_frame_init_saved_regs, + i386_skip_prologue, i386_push_dummy_frame, i386_fix_call_dummy, + i386_pop_frame, i386_push_arguments, i386_store_struct_return, + i386_extract_return_value, i386_store_return_value, + i386_extract_struct_value_address, i386_register_virtual_type, + i386_register_convertible, i386_register_convert_to_virtual, + i386_register_convert_to_raw, i386_svr4_sigtramp_saved_pc, + i386_go32_init_abi, i386_nw_init_abi, i386_gdbarch_init): Make + static. + +2002-07-01 Mark Kettenis + + * i386bsd-tdep.c (i386bsd_frame_saved_pc): Removed. + + * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Removed. + * i386-sol2-tdep.c (i386_sol2_init_abi): Adjust for the removal of + this macro. Include "value.h". + +2002-06-30 Aidan Skinner + + * ada-exp.tab.c: remove as it's a generated file + * ada-lex.c: remove as it's a generated file + +2002-06-30 Mark Kettenis + + * config/i386/tm-i386.h (struct frame_info, struct + frame_saved_regs, struct value, struct type): Remove forward + declarations. + + * config/i386/tm-linux.h [HAVE_PTRACE_GETFPXREGS] + (FILL_FPXREGSET, HAVE_SSE_REGS): Remove define. + * config/i386/nm-linux.h [HAVE_PTRACE_GETFPXREGS] + (FILL_FPXREGSET): Define. + + * config/i386/tm-nbsd.h (HAVE_SSE_REGS): Remove define. + + * configure.tgt (i[3456]86-*-openbsd*): Fold into + i[3456]86-*-netbsd* case. + * config/i386/tm-obsd.h: Removed. + * config/i386/obsd.mt: Removed. + * config/i386/obsd.mh (NATDEPFILES): Remove corelow.o and + core-aout.o. + (MH_CFLAGS): Add -DYYDEBUG=0. + + * i386bsd-nat.c (_initialize_i386bsd_nat): Define SC_PC_OFFSET to + i386nbsd_sc_pc_offset on OpenBSD too. + + * config/i386/tm-fbsd.h [!SVR4_SHARED_LIBS] + (IN_SOLIB_CALL_TRAMPOLINE): Remove define. + * config/i386/tm-nbsdaout.h (IN_SOLIB_CALL_TRAMPOLINE): Remove + define. + * i386bsd-tdep.c: Include "arch-utils.h". + (i386bsd_aout_in_solib_call_trampoline): New function. + (i386bsd_init_abi): Set in_solib_call_trampoline to + i386bsd_aout_in_solib_call_trampoline. + (i386nbsdelf_init_abi, i386fbsd_init_abi): Set + in_solib_call_trampoline to generic_in_solib_call_trampoline. + +2002-06-28 Andrew Cagney + + * macrotab.h: Do not include "obstack.h" or "bcache.h". + (struct obstack, struct bcache): Add opaque declarations. + * Makefile.in (macrotab_h): Update + +2002-06-28 Andrew Cagney + + * blockframe.c (generic_find_dummy_frame): Change return type to + ``struct regcache''. + (struct dummy_frame): Replace field ``registers'' with regcache, a + struct regcache object. + (generic_find_dummy_frame): Update. + (generic_push_dummy_frame): Update. Use regcache_xfree, + regcache_xmalloc and regcache_cpy. + (generic_pop_dummy_frame): Update. Use regcache_cpy and + regcache_xfree. + (deprecated_generic_find_dummy_frame): Update. + (generic_read_register_dummy): Update. Use + regcache_read_as_address. + (generic_call_dummy_register_unwind): Update. Use regcache_read. + (generic_get_saved_register): Update. Use regcache_read. + +2002-06-28 Andrew Cagney + + * Makefile.in (objfiles_h): Add $(bcache_h). + * objfiles.h: Include "bcache.h". + + * Makefile.in (symtab_h): Remove $(bcache_h). + * symtab.h: Do not include "bcache.h". + +2002-06-28 Andrew Cagney + + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Set frame_chain_valid to + generic_func_frame_chain_valid. + +2002-06-28 David O'Brien + + * config/i386/nm-fbsd.h: Include . + * config/i386/tm-fbsd.h: Likewise. + +2002-06-28 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-06-27 Andrew Cagney + + From 2002-06-27 John David Anglin : + * regcache.c (supply_register): Add missing argument to + register_buffer call. + +2002-06-27 Andrew Cagney + + * Makefile.in (init.c): Drop -e option to grep. Not necessary and + Solaris /bin/grep does not not like it. From Peter Schauer. + +2002-06-26 Tom Tromey + + * command.h (add_setshow_cmd): Declare. + (add_setshow_cmd_full): Declare. + * cli/cli-decode.c (add_setshow_cmd): No longer static. Now + returns void. Use add_setshow_cmd_full. + (add_setshow_cmd_full): New function. + (add_setshow_auto_boolean_cmd): Use add_setshow_cmd_full. + (add_setshow_boolean_cmd): Likewise. + +2002-06-26 Jason Thorpe + + * config/vax/tm-vax.h: Protect from multiple inclusion. + (TARGET_UPAGES, TARGET_NBPG, STACK_END_ADDR) + (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Move to... + * config/vax/tm-vaxbsd.h: ...here. New file. + * config/vax/vax.mt (TM_FILE): Set to tm-vaxbsd.h. + +2002-06-26 Jason Thorpe + + * config/vax/tm-vax.h (BREAKPOINT): Remove. + (BELIEVE_PCC_PROMOTION): Remove. + (AP_REGNUM): Move to... + * config/vax/nm-vax.h: ...here. + * vax-tdep.c: Use VAX_AP_REGNUM instead of AP_REGNUM. + (vax_breakpoint_from_pc): New function. + (vax_gdbarch_init): Initialize gdbarch_breakpoint_from_pc + and gdbarch_believe_pcc_promotion. + +2002-06-26 Jason Thorpe + + * Makefile.in (vax_tdep_h): Define. + (vax-tdep.o): Use $(vax_tdep_h). + * vax-tdep.c (vax_gdbarch_init): Use generic OS ABI framework. + (vax_dump_tdep): New function. + (_initialize_vax_tdep): Register vax_dump_tdep. + * vax-tdep.h: Include osabi.h. + (struct gdbarch_tdep): New. + +2002-06-26 Andrew Cagney + + * frame.h (deprecated_generic_find_dummy_frame): Rename + generic_find_dummy_frame. + * blockframe.c (generic_find_dummy_frame): Make static. + (deprecated_generic_find_dummy_frame): New function. + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Replace + generic_find_dummy_frame with deprecated_find_dummy_frame. + (sh64_nofp_frame_init_saved_regs): Ditto. + (sh_fp_frame_init_saved_regs): Ditto. + * s390-tdep.c (s390_frame_saved_pc_nofix): Ditto. + (s390_frame_chain): Ditto. + * cris-tdep.c (cris_frame_init_saved_regs): Ditto. + +2002-06-26 Grace Sainsbury + + * config/m68k/tm-m68k.h: Rearrange code so macros not in the + gdbarch vector are at the top. + (NUM_REGS): Remove. + (FP_REGNUM, SP_REGNUM, PS_REGNUM, PC_REGNUM, FP0_REGNUM): Remove. + (FRAME_ARGS_ADDRESS): Remove. + (FRAME_LOCALS_ADDRESS): Remove. + (FRAME_NUM_ARGS): Remove. + (FRAME_ARGS_SKIP): Remove. + * m68k-tdep.c (enum): Add eumeration of special register numbers. + (m68k_gdbarch_init): Add gdbarch initializations for macros + undefined in tm-m68k.h + +2002-06-26 Grace Sainsbury + + * monitor.h: Add the function regname to monitor_ops + structure. This way NUM_REGS does not have to be a constant. + * monitor.c (monitor_fetch_register): Added support for regname + function. The function is called if the array regnames is NULL. + (monitor_store_register): Same. + * cpu32bug-rom.c (cpu32bug_regname): Add function. Replaces + regnames array. + (init_cpu32bug_cmds): set cpu32bug_cmds.regnames to NULL, + cpu32bug_cmds.regname to point to new function. + * abug-rom.c (abug_regname): Same as above. + (init_abug_cmds): Same. + * dbug-rom.c (dbug_regname): Same as above. + (init_dbug_cmds): Same. + * remote-est.c (est_regname): Same. + (init_est_cmds): Same. + * rom68k-rom.c (rom68k_regname): Same. + (init_rom68k_cmds): Same. + +2002-06-25 Tom Tromey + + * breakpoint.c (delete_command): Don't repeat `delete' commands. + +2002-06-25 Andrew Cagney + + * infrun.c (stop_registers): Change variable's type to ``struct + regcache'''. + (xmalloc_inferior_status): Delete function. + (free_inferior_status): Delete function. + (normal_stop): Use regcache_cpy. + (struct inferior_status): Change type of fields ``stop_registers'' + and ``registers'' to ``struct regcache''. + (write_inferior_status_register): Use regcache_write. + (save_inferior_status): Instead of calling + xmalloc_inferior_status, allocate the inf_status buffer directly. + Use regcache_dup_no_passthrough and regcache_dup to save the + buffers. + (restore_inferior_status): Use regcache_xfree and regcache_cpy. + Replace the stop_registers regcache instead of overriding it. Use + regcache_xfree. Instead of calling free_inferior_status, xfree + the buffer directly. + (discard_inferior_status): Use regcache_xfree. Instead of calling + free_inferior_status, xfree the buffer directly. + (build_infrun): Use regcache_xmalloc. + (_initialize_infrun): Delete redundant call to build_infrun. + + * Makefile.in (infcmd.o): Add $(regcache_h). + + * infcmd.c: Include "regcache.h". + (run_stack_dummy): Use deprecated_grub_regcache_for_registers to + obtain the address of `stop_registers' register buffer. + (print_return_value): Ditto. + + * inferior.h (struct regcache): Add opaque declaration. + (stop_registers): Change variable's declared type to ``struct + regcache''. + +2002-06-24 Tom Tromey + + * cli/cli-decode.c (add_show_from_set): Fixed typo in comment. + * target.c (initialize_targets): Fixed typo in + trust-readonly-sections `show' documentation. + + * main.c: Marked all strings with _(). + +2002-06-24 Don Howard + + * memattr.c (create_mem_region): Treat hi == 0 as a special case + that means max CORE_ADDR+1. + (lookup_mem_region): Ditto. + (mem_info_command): Ditto. + +2002-06-24 Grace Sainsbury + + * config/m68k/tm-m68k.h (DECR_PC_AFTER_BREAK): Remove. + (REGISTER_BYTES_OK): Remove. + (REGISTER_BYTES): Remove. + (STORE_STRUCT_RETURN): Remove. + (DEPRECATED_EXTRACT_RETURN_VALUE): Remove. + (STORE_RETURN_VALUE): Remove. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. + (FRAME_CHAIN): Remove. + (FRAMELESS_FUNCTION_INVOCATION): Remove. + (FRAME_SAVED_PC): Remove. + * m68k-tdep.c (m68k_register_bytes_ok):Add. + (m68k_store_struct_return): Add. + (m68k_deprecated_extract_return_value): Add. + (m68k_deprecated_extract_struct_value_address): Add. + (m68k_store_return_value): Add. + (m68k_frame_chain): Add. + (m68k_frameless_function_invocation): Add. + (m68k_frame_saved_pc): Add. + (m68k_gdbarch_init): added set_gdbarch calls for new + functions and deleted macros. + +2002-06-23 Tom Tromey + + * Makefile.in (HFILES_NO_SRCDIR): Remove old files. + (ALLDEPFILES): Likewise. + (udiheaders): Removed. + (udip2soc.o): Likewise. + (udi2go32.o): Likewise. + (udr.o): Likewise. + (HFILES_WITH_SRCDIR): Don't mention udiheaders. + +2002-06-22 Andrew Cagney + + * infrun.c (_initialize_infrun): Delete unnecessary call to + build_infrun. + + * regcache.h: Update comments describing the regcache_cpy family + of functions. + (regcache_save, regcache_restore): Delete declaration. + (regcache_save_no_passthrough): Delete declaration. + (regcache_restore_no_passthrough): Delete declaration. + * regcache.c (regcache_save): Delete function. + (regcache_save_no_passthrough): Delete function. + (regcache_restore): Delete function. + (regcache_restore_no_passthrough): Delete function. + +2002-06-21 Andrew Cagney + + * config/m68k/tm-m68k.h: Fix typo. + (FRAME_INIT_SAVED_REGS): Define when non-multi-arch. + (m68k_frame_init_saved_regs): Declare. + +2002-06-21 Jim Blandy + + Remove some vestiges of Harris 88k support. + * dwarf2read.c (decode_locdesc): Remove `#if' block for Harris 88k + register numbering quirk. + * elfread.c (elf_symtab_read): Remove `#if' block for skipping + odd symbols occurring in Harris 88k ELF targets. + +2002-06-21 Tom Tromey + + * gdb_locale.h: New file. + * Makefile.in (GDB_CFLAGS): Define LOCALEDIR. + (defs_h): Added gdb_locale.h. + * configure, config.in: Rebuilt. + * configure.in (PACKAGE): Define. + * defs.h: Include gdb_locale.h. + * main.c (captured_main): Call setlocale, bindtextdomain, + textdomain. + +2002-06-21 Dave Brolley + + From Stan Shebs, Jim Blandy, Mark Salter, Kevin Buettner: + * config/frv/frv.mt: New file. + * config/frv/tm-frv.h: New file. + * configure.tgt: Support frv-*-*. + * Makefile.in (frv-tdep.o): New target. + * frv-tdep.c: New file. + * NEWS: Mention frv. + +2002-06-21 Dave Brolley + + * MAINTAINERS: Add self to "Write After Approval" list. + +2002-06-21 Grace Sainsbury + + * config/m68k/tm-m68k.h (REGISTER_BYTE, REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_TYPE, REGISTER_NAMES, TARGET_LONG_DOUBLE_FORMAT) + (FUNCTION_START_OFFSET, SKIP_PROLOGUE, SAVED_PC_AFTER_CALL) + (INNER_THAN, STACK_ALIGN, REGISTER_SIZE): Remove macros. + + * m68k-tdep.c: Include arch-utils.h + (m68k_register_raw_size): Add. + (m68k_register_virtual_size): Add. + (m68k_register_virtual_type): Add. + (m68k_register_name): Add. + (m68k_stack_align): Add. + (m68k_register_byte): Add. + (m68k_gdbarch_init): Add set_gdbarch calls for macros removed in + tm-m68k.h. + +2002-06-21 Grace Sainsbury + + * m68k-tdep.c (m68k_frame_init_saved_regs): Replace + m68k_find_saved_regs. + (m68k_pop_frame): Removed saved_regs structure, and replaced + references to it with frame->saved_regs. + (m68k_gdbarch_init): Added function calls to initialize the + gdbarch structure. + (m68k_fix_call_dummy): Add. + * config/m68k/tm-m68k.h: (FRAME_FIND_SAVED_REGS): Remove. + (CALL_DUMMY): Remove. + (CALL_DUMMY_LENGTH): Remove. + (CALL_DUMMY_START_OFFSET): Remove. + (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. + (FIX_CALL_DUMMY): Remove. + (PUSH_DUMMY_FRAME): Remove. + (POP_FRAME): Remove. + +2002-06-19 Pierre Muller + + * parse.c (parse_fprintf): New function used to avoid calls to + fprintf in bison parser generated debug code. + * parser-defs.h: Declaration of new parse_fprintf function. + * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y: + Set YYDEBUG to 1 by default. + Set YYFPRINTF as parse_fprintf. + +2002-06-21 Michal Ludvig + + * dwarf2cfi.c (read_encoded_pointer): Don't handle pointer + encoding anymore. + (pointer_encoding, enum ptr_encoding): New. + (execute_cfa_program): Take care about pointer encoding. + (dwarf2_build_frame_info): Only call parse_frame_info for + .debug_frame and .eh_frame. + (parse_frame_info): New, derived from former dwarf2_build_frame_info. + fixed augmentation handling, added relative addressing, + ignore duplicate FDEs. Added comments. + * dwarf2cfi.c: Reindented. + +2002-06-20 Elena Zannoni + + * event-top.c (command_handler): Don't use space_at_cmd_start + unless there is sbrk() on the host. Assign time and space data + to union fields of the appropriate length. + +2002-06-20 Michal Ludvig + + * x86-64-tdep.c (x86_64_register_nr2name): Rename to + x86_64_register_name. Return type changed to 'const char *'. + (x86_64_register_name2nr): Rename to x86_64_register_number. + (x86_64_gdbarch_init): Update to reflect the change. + * x86-64-tdep.h: Ditto. + * x86-64-linux-nat.c (x86_64_fxsave_offset) + (supply_fpregset): Ditto. + +2002-06-19 Andrew Cagney + + * regcache.h: Update copyright. + (struct regcache, struct gdbarch): Add opaque declarations. + (current_regcache): Declare global variable. + (regcache_read, regcache_write): Add gdbarch parameter. + (regcache_save, regcache_save_no_passthrough) + (regcache_restore, regcache_restore_no_passthrough) + (regcache_dup, regcache_dup_no_passthrough) + (regcache_cpy, regcache_cpy_no_passthrough) + (deprecated_grub_regcache_for_registers) + (deprecated_grub_regcache_for_register_valid) + (regcache_valid_p): Add function declarations. + + * regcache.c: Update copyright. + (regcache_descr_handle): New global variable. + (struct regcache_descr): Define. + (init_legacy_regcache_descr, init_regcache_descr): New functions. + (regcache_descr, xfree_regcache_descr): New functions. + (struct regcache): Define. + (regcache_xmalloc, regcache_xfree): New functions. + (regcache_cpy, regcache_cpy_no_passthrough): New functions. + (regcache_dup, regcache_dup_no_passthrough): New functions. + (regcache_valid_p, regcache_read_as_address): New functions. + (deprecated_grub_regcache_for_registers): New function. + (deprecated_grub_regcache_for_register_valid): New function. + (current_regcache): New global variable. + (register_buffer): Add regcache parameter. Update calls. + (regcache_read, regcache_write): Add regcache parameter. Rewrite. + (read_register_gen, write_register_gen): Update register_buffer + call. Test for legacy_p instead of gdbarch_register_read_p or + gdbarch_register_write_p. + (regcache_collect): Update register_buffer call. + (build_regcache): Rewrite. Use deprecated grub functions. + (regcache_save, regcache_save_no_passthrough): New functions. + (regcache_restore, regcache_restore_no_passthrough): New + functions. + (_initialize_regcache): Create the regcache_data_handle. Swap + current_regcache global variable. + + * sh-tdep.c (sh_pseudo_register_read): Add current_regcache + parameter to regcache_read and regcache_write calls. + (sh4_register_read): Ditto. + (sh64_pseudo_register_read): Ditto. + (sh64_register_read): Ditto. + (sh_pseudo_register_write): Ditto. + (sh4_register_write): Ditto. + (sh64_pseudo_register_write): Ditto. + (sh64_register_write): Ditto. + + * defs.h (XCALLOC): Define. + +2002-06-19 Grace Sainsbury + + * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Added (set to 0). + * m68k-tdep.c (m68k_gdbarch_init): Added. + (m68k_dump_tdep): Added. + +2002-06-19 Daniel Jacobowitz + + * ada-lang.c (fill_in_ada_prototype): Update comment. + +2002-06-19 Daniel Jacobowitz + + * mips-tdep.c (enum mips_abi): Explicitly start at 0. Add + MIPS_ABI_LAST. + (mips_abi_string, mips_abi_strings): New. + (struct gdbarch_tdep): Remove mips_abi_string, add found_abi. + (mips_gdbarch_init): Set tdep->found_abi. Don't set + tdep->mips_abi_string. Honor mips_abi_string. Default to + O32 if no ABI is found. + (mips_dump_tdep): Use mips_abi_strings. + (mips_abi_update): New function. + (_initialize_mips_tdep): Initialize mips_abi_string. Add + ``set mips abi'' and ``show mips abi''. Check the size of + mips_abi_strings. + +2002-06-19 Andrew Cagney + + * i386-linux-tdep.c (i386_linux_register_name): Make return type + constant. + +2002-06-18 Joel Brobecker + + * alpha-tdep.c (heuristic_proc_desc): Compute the size of the + current frame using only the first stack size adjustment. All + subsequent size adjustments are not considered to be part of + the "static" part of the current frame. + Compute the address of the saved registers relative to the + Frame Pointer ($fp) instead of the Stack Pointer if $fp is + in use in this frame. + +2002-06-18 Don Howard + + * valops.c (value_ind): Use value_at_lazy() when dereferencing + type int expressions. Thanks to Jim Blandy for + suggesting this solution. + +2002-06-18 Andrew Cagney + + * config/romp/xm-rtbsd.h: Delete file. + * config/romp/rtbsd.mh: Delete file. + +2002-06-18 Keith Seitz + + * breakpoint.c (condition_command): Post breakpoint_modify + when a condition is added to an existing breakpoint. + (commands_command): Likewise for commands. + (set_ignore_count): Likewise for ignore counts. + If no tty, do not simply return, still need to send event + notification. + (ignore_command): Only print a newline if the command came + from a tty. + Don't call breakpoints_changed, since this is now properly + handled by set_ignore_count. + +2002-06-18 Andrew Cagney + + * MAINTAINERS: Note that cris-elf target can be compiled with + -Werror. + * cris-tdep.c (cris_register_name): Make return type constant. + (cris_breakpoint_from_pc): Ditto. + +2002-06-18 Michal Ludvig + + * frame.h (struct frame_info): Change type of context to + 'struct context'. + +2002-06-17 Andrew Cagney + + * gdbarch.sh (REGISTER_NAME): Change return type a constant string + pointer. + * gdbarch.h, gdbarch.c: Regenerate. + * config/mips/tm-mips.h (mips_register_name): Update. + * i386-tdep.h (i386_register_name): Update. + * mips-tdep.c (mips_register_name): Update + * alpha-tdep.c (alpha_register_name): Update. + * arch-utils.c (legacy_register_name): Update. + * arch-utils.h (legacy_register_name): Update. + * avr-tdep.c (avr_register_name): Update. + * ia64-tdep.c (ia64_register_name): Update. + * i386-tdep.c (i386_register_name): Update. + * sparc-tdep.c (sparc32_register_name): Update. + (sparc64_register_name): Update. + (sparclite_register_name): Update. + (sparclet_register_name): Update. + * sh-tdep.c (sh_generic_register_name): Update. + (sh_sh_register_name): Update. + (sh_sh3_register_name): Update. + (sh_sh3e_register_name): Update. + (sh_sh_dsp_register_name): Update. + (sh_sh3_dsp_register_name): Update. + (sh_sh4_register_name): Update. + (sh_sh64_register_name): Update. + * s390-tdep.c (s390_register_name): Update. + * rs6000-tdep.c (rs6000_register_name): Update. + * ns32k-tdep.c (ns32k_register_name_32082): Update. + (ns32k_register_name_32382): Update. + * d10v-tdep.c (d10v_ts2_register_name): Update. + (d10v_ts3_register_name): Update. + * xstormy16-tdep.c (xstormy16_register_name): Update. + * vax-tdep.c (vax_register_name): Update. + * v850-tdep.c (v850_register_name): Update. + * m68hc11-tdep.c (m68hc11_register_name): Update. + * mn10300-tdep.c (mn10300_generic_register_name): Update. + (am33_register_name): Update. + +2002-06-17 Grace Sainsbury + + * m68k-tdep.c: Reindented. + +2002-06-17 Andrew Cagney + + * gdb_indent.sh: Add prgregset_t, fpregset_t, and gregset_t to the + list of predefined types. + +2002-06-16 Mark Kettenis + + * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE, + REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW): Remove defines. + (i386_register_virtual_type, i386_register_convertible, + i386_register_convert_to_virtual, i386_register_convert_to_raw): + Remove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + + * config/i386/tm-i386lynx.h (SAVED_PC_AFTER_CALL): Remove define. + (i386lynx_saved_pc_after_call): Remove prototype. + * i386ly-tdep.c: Include "i386-tdep.h". + (i386lynx_saved_pc_after_call): Make static. Use + read_memory_nobpt instead of read_memory. Use + read_memory_unsigned_integer instead of read_memory_integer. + (i386lynx_init_abi): New function. + (i386lynx_coff_osabi_sniffer): New function. + (_initialize_i386bsd_tdep): New function. + + * config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY, + CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET, + CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Remove defines. + (i386_fix_call_dummy): Remove prototype. + * i386-tdep.c (i386_call_dummy_words): New variable. + (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * command.h (add_setshow_auto_boolean_cmd): Replace + add_set_auto_boolean_cmd. + * cli/cli-decode.c (add_setshow_auto_boolean_cmd): Replace + add_set_auto_boolean_cmd. + * cli/cli-decode.h (add_set_auto_boolean_cmd): Delete declaration. + * mips-tdep.c (_initialize_mips_tdep): Update ``set mips + mask-address'' command. + (show_mask_address): Add cmd parameter. + * remote.c (add_packet_config_cmd): Update. Change type of + set_func and show_func to cmd_sfunc_ftype. + (_initialize_remote): Update `set remote Z-packet' + (show_remote_protocol_qSymbol_packet_cmd): Add cmd parameter. + (show_remote_protocol_e_packet_cmd): Ditto. + (show_remote_protocol_E_packet_cmd): Ditto. + (show_remote_protocol_P_packet_cmd): Ditto. + (show_remote_protocol_Z_software_bp_packet_cmd): Ditto. + (show_remote_protocol_Z_hardware_bp_packet_cmd): Ditto. + (show_remote_protocol_Z_write_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_read_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_access_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_packet_cmd): Ditto. + (show_remote_protocol_binary_download_cmd): Ditto. + (show_remote_cmd): Pass NULL to all of above. + +2002-06-15 Mark Kettenis + + * config/i386/tm-i386.h (PUSH_ARGUMENTS, STORE_STRUCT_RETURN, + DEPRECATED_EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS, PUSH_DUMMY_FRAME, + POP_FRAME): Remove defines. + (i386_push_arguments, i386_store_struct_return, + i386_extract_return_value, i386_store_return_value, + i386_extract_struct_value_address, i386_push_dummy_frame, + i386_pop_frame): Renove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * cli/cli-decode.c (add_setshow_boolean_cmd): Replace + add_set_boolean_cmd. + (add_setshow_cmd): New function. + * command.h (add_setshow_boolean_cmd): Replace + add_set_boolean_cmd. + * remote-rdi.c (_initialize_remote_rdi): Update ``set rdiheartbeat'' + and ``set rdiromatzero''. + * maint.c (_initialize_maint_cmds): Update commented out code. + * cli/cli-decode.h (add_set_boolean_cmd): Delete declaration. + * target.c (initialize_targets): Update `set + trust-readonly-sections'. + * remote.c (_initialize_remote): Update `set remotebreak'. + +2002-06-15 Mark Kettenis + + * config/i386/tm-i386.h (FUNCTION_START_OFFSET, INNER_THAN, + BREAKPOINT, DECR_PC_AFTER_BREAK): Removed. + * i386-tdep.c (i386_skip_prologue): Adjust function signature to + fit into multi-arch framework. + (i386_breakpoint_from_pc): New function. + (i386_gdbarch_init): Adjust for removal of the macros mentioned + above. + + * config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION, + FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, + FRAME_ARGS_SKIP, FRAME_INIT_SAVED_REGS): Remove defines. + (i386_frameless_function_invocation, i386_frame_num_args, + i386_frame_init_saved_regs): Remove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * cli/cli-decode.c (set_cmd_cfunc): Update. + (set_cmd_sfunc): Update. + * command.h (cmd_cfunc_ftype, cmd_sfunc_ftype): Declare. + (set_cmd_sfunc, set_cmd_cfunc): Update. + * cli/cli-decode.h: Update. + +2002-06-15 Mark Kettenis + + * i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function. + (_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer. + +2002-06-15 Andrew Cagney + + * defs.h (auto_boolean): Declare enum. + * command.h (cmd_auto_boolean): Delete enum. + * mips-tdep.c (mask_address_var): Update. + (mips_mask_address_p): Update. + (show_mask_address): Update. + * remote.c (struct packet_config): Update. + (update_packet_config): Update. + (show_packet_config_cmd): Update. + (packet_ok): Update. + (add_packet_config_cmd): Update. + (_initialize_remote): + * command.h: Update. + * cli/cli-setshow.c (parse_auto_binary_operation): Update. + (do_setshow_command): Update. + * cli/cli-decode.c (add_set_auto_boolean_cmd): Update. + * cli/cli-decode.h: Update. + +2002-06-15 Mark Kettenis + + * config/i386/tm-cygwin.h, config/i386/tm-fbsd.h, + config/i386/tm-go32.h, config/i386/tm-i386gnu.h, + config/i386/tm-i386sol2.h, config/i386/tm-i386v4.h, + config/i386/tm-linux.h, config/i386/tm-nbsd.h, + config/i386/tm-obsd.h (HAVE_I387_REGS): Remove define. + * config/i386/tm-i386.h: Unconditionally define FLOAT_INFO. + + * i386-tdep.c (i386_coff_osabi_sniffer): Add "coff-go32" to the + list of DJGPP COFF targets. + + * config/i386/tm-i386.h (REGISTER_SIZE): Remove define. + (NUM_GREGS, NUM_FREGS, NUM_SSE_REGS): Remove defines. + (FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove defines. + (FP0_REGNUM): Remove define. + (MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE, + MAX_REGISTER_VIRTUAL_SIZE): Remove define. + (i386_register_virtual_size): Remove protoype. + * i386-tdep.c (i386_register_virtual_size): Removed. + (i386_extract_return_value, i386_store_return_value): Use + FP0_REGNUM instead of NUM_FREGS to determine whether the + floating-point registers are available. + (i386_gdbarch_init): Tweak FIXME about FPU registers. + Adjust for removal of macros mentioned above. + +2002-06-15 Mark Kettenis + + * i386v4-nat.c: Include "i386-tdep.h". Reformat and tweak various + comments. + (fill_gregset, supply_gregset, supply_fpregset, fill_fpregset): + Remove prototypes. + (supply_gregset, fill_gregset): Remove use of register keyword and + remove declaration for regmap. Use I386_NUM_GREGS instead of + NUM_REGS and NUM_FREGS. + (FPREGSET_FSAVE_OFFSET): Remove. + (supply_fpregset, fill_fpregset): Use FPO_REGNUM instead of + NUM_FREGS to determine whether the floating-point registers are + available. + + * i386gnu-nat.c (supply_gregset, gnu_fetch_registers, + gnu_store_registers): Replace usage of NUM_GREGS with + I386_NUM_GREGS. + + * i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER, + OLD_CANNOT_STORE_REGISTER, supply_gregset, fill_gregset): Replace + usage of NUM_GREGS with I386_NUM_GREGS. + + * i386-linux-nat.c (fill_gregset): Remove redundant parentheses. + + * i386bsd-nat.c: Include "i386-tdep.h". + (supply_gregset, fill_gregset): Replace usage of NUM_GREGS with + I386_NUM_GREGS. + + * i386v-nat.c: Remove copnditional inclusion of , + and associated comment. They no longer make any sense, since we + don't use this file anymore on Linux. + + * config/i386/tm-i386.h (MAX_NUM_REGS): Removed. + * i386-tdep.c (i386_register_offset, i386_register_size): Use + I386_SSE_NUM_REGS instead of MAX_NUM_REGS for the number of + elements in these arrays. + (_initialize_i386_tdep): Use I386_SSE_NUM_REGS instead of + MAX_NUM_REGS. + +2002-06-15 Mark Kettenis + + * osabi.h (gdb_osabi): Add GDB_OSABI_LYNXOS. + * osabi.c (gdb_osabi_names): Add entry for "LynxOS". + +2002-06-14 Andrew Cagney + + * gdbarch.sh (DEPRECATED_EXTRACT_RETURN_VALUE): Rename + EXTRACT_RETURN_VALUE. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Rename + EXTRACT_STRUCT_VALUE_ADDRESS. + * gdbarch.h, gdbarch.c: Regenerate. + + * values.c (value_being_returned): Handle + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. + (EXTRACT_RETURN_VALUE): Define as DEPRECATED_EXTRACT_RETURN_VALUE. + + * arm-linux-tdep.c (arm_linux_init_abi): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + + * config/arc/tm-arc.h: Update. + * config/d30v/tm-d30v.h: Update. + * config/fr30/tm-fr30.h: Update. + * config/h8300/tm-h8300.h: Update. + * config/h8500/tm-h8500.h: Update. + * config/i386/tm-i386.h: Update. + * config/i386/tm-ptx.h: Update. + * config/i386/tm-symmetry.h: Update. + * config/i960/tm-i960.h: Update. + * config/m32r/tm-m32r.h: Update. + * config/m68k/tm-delta68.h: Update. + * config/m68k/tm-linux.h: Update. + * config/m68k/tm-m68k.h: Update. + * config/m88k/tm-m88k.h: Update. + * config/mcore/tm-mcore.h: Update. + * config/mips/tm-mips.h: Update. + * config/mn10200/tm-mn10200.h: Update. + * config/pa/tm-hppa.h: Update. + * config/pa/tm-hppa64.h: Update. + * config/sparc/tm-sp64.h: Update. + * config/sparc/tm-sparc.h: Update. + * config/sparc/tm-sparclet.h: Update. + * config/z8k/tm-z8k.h: Update. + +2002-06-14 Andrew Cagney + + * Makefile.in (i386_linux_tdep_h): Define. + (i386_tdep_h, i387_tdep_h): Define. + (i386-linux-nat.o): Add $(i386_linux_tdep_h), + $(i386_tdep_h) and $(i387_tdep_h). + * i386-linux-nat.c: Include "i386-linux-tdep.h". + +2002-06-14 Mark Kettenis + + * config/i386/tm-i386.h (START_INFERIOR_TRAPS_EXPECTED): Removed. + Already covered by the default. + + * config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT, + TARGET_LONG_DOUBLE_BIT): Remove. * i386-tdep.c + (i386_gdbarch_init): Initialize long_double_format and long_double + bit. + + * config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and + i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. + Move these to ... + * config/i386/i386sol2.mh: ... here. + * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. + (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. + (SIGCONTEXT_PC_OFFSET): Remove define. + (IN_SIGTRAMP): Remove define. + * i386-sol2-tdep.c: New file. + + * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. + * config/i386/tm-i386nw.h: Removed. + + * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, + USE_STRUCT_CONVENTION): Remove defines. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (IN_SIGTRAMP): Remove define. + (i386bsd_in_sigtramp): Remove prototype. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a + function. Update comment accordingly + (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. + (FRAME_SAVED_PC): Remove define. + (i386bsd_frame_saved_pc): Remove prototype. + * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, + GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (IN_SIGTRAMP): Remove define. + (i386bsd_in_sigtramp): Remove prototype. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a + function. Update comment accordingly + (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. + (FRAME_SAVED_PC): Remove define. + (i386bsd_frame_saved_pc): Remove prototype. + * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): + Remove prototype. + (USE_STRUCT_CONVENTION): Remove prototype. + * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove + declaration. + (_initialize_i386bsd_nat): Revise logic to determine some + constants at compile time when compiling a native GDB. Warn if + things don't match up with what we expect. + * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): + Remove variables. + (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite + to use date stored in `struct gdbarch_tdep'. + (i386bsd_sigcontext_offset): Remove varaible. + (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data + stored in `struct gdbarch_tdep'. + (i386bsd_frame_saved_pc): Make static. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. + (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, + i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, + i386fbsd4_sc_pc_offset): New variables. + (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, + i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New + functions. + (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New + functions. + * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. + Modify the value of i386fbsd_sigtramp_start and + i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and + i386fbsd_sigtramp_end. + * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove + function. + + * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move + define to i386-linux-tdep.h. + (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, + REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove + defines. + (i386_linux_register_name, i386_linux_register_byte, + i386_linux_register_raw_size): Remove prototypes. + (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. + (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. + (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, + TARGET_WRITE_PC): Remove defines. + (i386_linux_in_sigtramp, i386_linux_frame_chain, + i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, + i386_linux_write_pc): Remove prototypes. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + * i386-linux-tdep.h: New file. + * i386-linux-nat.c: Include "i386-linux-tdep.h". + * i386-linux-tdep.c: Include "i386-tdep.h" and + "i386-linux-tdep.h". + (i386_linux_register_name, i386_linux_register_byte, + i386_linux_register_raw_size, i386_linux_in_sigtramp, + i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): + Make static. + (i386_linux_init_abi): New function. + (_initialize_i386_linux_tdep): New function. + + * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. + (i386_saved_pc_after_call): Remove prototype. + (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". + (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, + DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. + (i386_register_name, i386_stab_reg_to_regnum, + i386_dwarf_reg_to_regnum): Remove prototypes. + (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, + SIZEOF_SSE_REGS): Remove defines. + (REGISTER_BYTES): Remove define. + (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. + (i386_register_byte, i386_register_raw_size): Remove prototypes. + (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. + (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. + * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. + (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, + JB_EDX, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. + (sigtramp_saved_pc): Remove define. + (i386v4_sigtramp_saved_pc): Remove prototype. + * config/i386/tm-go32.h (FRAME_CHAIN, + FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. + (i386go32_frame_saved_pc): Remove prototype. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + * i386-tdep.h: Include "osabi.h". + (enum i386_abi): Removed. + (enum struct_return): New enum. + (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, + struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and + sc_pc_offset members. + (i386_gdbarch_register_os_abi): Remove prototype. + (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, + I386_SSE_NUM_REGS): New defines. + (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, + I386_SSE_SIZEOF_REGS): New defines. + (i386_register_name, i386_register_byte, i386_register_raw_size): + New prototypes. + (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. + (i386bsd_sigtramp_saved_pc): New prototype. + * i386-tdep.c: Don't include "elf-bfd.h". + (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, + i386_frame_chain, i386_saved_pc_after_call): Make static. + (i386_frame_saved_pc): Rewrite to call architecture dependent + function to deal with signal handlers. Make static. + (i386go32_frame_saved_pc): Removed. + [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): + Removed. + (i386_get_longjmp_target): New function. + (default_struct_convention, pcc_struct_convention, + reg_struct_convention, valid_conventions, struct_convention): New + variables. + (i386_use_struct_convention): New function. + (i386v4_sigtramp_saved_pc): Renamed to + i386_svr4_sigtramp_saved_pc. Made static. Moved. + (i386_pc_in_sigtramp): New function. + (i386_abi_names): Removed. + (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, + ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): + Removed. + (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, + i386_gdbarch_register_os_abi): Removed. + (struct i386_abi_handler): Removed. + (i386_abi_handler_list): Removed. + (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New + functions. + (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, + i386_nw_init_abi): New functions. + (i386_gdbarch_init): Rewritten to use generic OS ABI framework. + Use set_gdbarch_xxx() calls instead of relying on macros for a + number of calls. + (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. + (_initialize_i386_tdep): Add new 'struct-convcention' command. + Register the various architecture variants defined in this file. + +2002-06-14 Daniel Jacobowitz + + * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. + (struct main_type): Remove arg_types member. Update comments for + struct field. + (TYPE_ARG_TYPES): Remove. + (TYPE_FN_FIELD_ARGS): Update. + (smash_to_method_type): Update prototype. + + * c-typeprint.c (cp_type_print_method_args): Take method type + instead of argument list. Use new argument layout. Simplify. + (c_type_print_args): Use new argument layout. Simplify. + (c_type_print_base): Update call to cp_type_print_method_args. + * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type + argument; use die->type instead. Update call to + smash_to_method_type. + (read_structure_scope): Update call to dwarf2_add_member_fn. + * gdbtypes.c (allocate_stub_method): Update comment. + (smash_to_method_type): Take new NARGS and VARARGS arguments. + Use new argument layout. + (check_stub_method): Use new argument layout. Don't count + void as an argument. + (print_arg_types): Update comments. Use new argument layout. + (recursive_dump_type): Don't print arg_types member. + * hpread.c (hpread_read_struct_type): Use new argument layout. + (fixup_class_method_type): Likewise. + (hpread_type_lookup): Likewise. + * stabsread.c (read_type): Update calls to read_args and + smash_to_method_type. + (read_args): Use new argument layout. Simplify. + * valops.c (typecmp): Use new argument layout. Update parameters + and comments. Simplify. + (hand_function_call): Use new argument layout. + (search_struct_method): Update call to typecmp. + (find_overload_match): Use new argument layout. + +2002-06-13 Daniel Jacobowitz + + * NEWS: Mention multithreaded debug support for gdbserver. + +2002-06-13 Daniel Jacobowitz + + * MAINTAINERS: Mention NEWS. + +2002-06-13 Daniel Jacobowitz + + * mips-tdep.c (PROC_SYMBOL): Add warning comment. + (struct mips_objfile_private, compare_pdr_entries): New. + (non_heuristic_proc_desc): Read the ".pdr" section if it + is present. + +2002-06-12 Andrew Cagney + + * arm-tdep.c (arm_push_arguments): Rewrite using a two-pass loop. + (arm_debug): New static variable. + (_initialize_arm_tdep): Add ``set debug arm'' command. + +2002-06-12 Andrew Cagney + + * Makefile.in (sim_arm_h): Define. + (arm-tdep.o): Add $(sim_arm_h) and $(gdb_assert_h). + * arm-tdep.c: Include "gdb/sim-arm.h" and "gdb_assert.h". + (arm_register_sim_regno): New function, map an internal REGNUM + onto a simulator register number. + (arm_gdbarch_init): Set register_sim_regno. + +2002-06-09 Aldy Hernandez + + * MAINTAINERS: Add self. + +2002-06-11 Jim Blandy + + * source.c (source_info): Mention whether the symtab has + information about preprocessor macros. + + Call the command `info macro', not `show macro'. + * macrocmd.c (info_macro_command): Renamed from `show_macro_command'. + Fix error message. + (_initialize_macrocmd): Register `info_macro_command' in + `infolist', not `showlist'. + +2002-06-11 Daniel Jacobowitz + + * mips-tdep.c (MIPS_FPU_TYPE, FP_REGISTER_DOUBLE, MIPS_EABI) + (MIPS_LAST_FP_ARG_REGNUM, MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_SAVED_REGSIZE, MIPS_REGS_HAVE_HOME_P) + (MIPS_DEFAULT_STACK_ARGSIZE, GDB_TARGET_IS_MIPS64) + (MIPS_DEFAULT_MASK_ADDRESS_P): Remove obsolete definitions. Define + unconditionally. + (set_mipsfpu_single_command, set_mipsfpu_double_command) + (set_mipsfpu_none_command): Remove if (GDB_MULTI_ARCH). + (_initialize_mips_tdep): Remove dead code. + * config/mips/tm-irix5.h (MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. + * config/mips/tm-irix6.h (MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. + * config/mips/tm-mips.h (MIPS_EABI, MIPS_LAST_ARG_REGNUM, + MIPS_LAST_FP_ARG_REGNUM): Remove. + +2002-06-11 Michal Ludvig + + * dwarf2cfi.c (unwind_tmp_obstack_init): New. + (unwind_tmp_obstack_free, parse_frame_info) + (update_context, cfi_read_fp, cfi_write_fp) + (cfi_frame_chain, cfi_init_extra_frame_info) + (cfi_virtual_frame_pointer): Use the above function. + * dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c'). + +2002-06-11 Corinna Vinschen + + * v850-tdep.c (v850_type_is_scalar): New function. + (v850_use_struct_convention): Match current gcc implementation + as close as possible. + (v850_push_arguments): Fix stack_offset handling. Don't write + struct_addr into register. This is done by v850_store_struct_return. + (v850_extract_return_value): Care for structs. + (v850_store_return_value): Ditto. + (v850_store_struct_return): Actually write address. + +2002-06-11 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Fix to work on functions + without debug information too. + +2002-06-10 Andrew Cagney + + * gdbarch.sh (PRINT_FLOAT_INFO): Add frame and ui_file parameters. + Make multi-arch pure. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-tdep.c (arm_print_float_info): Update. + * arch-utils.h (default_print_float_info): Update. + * arch-utils.c (default_print_float_info): Update. + * infcmd.c (float_info): Update call. + +2002-06-10 Andrew Cagney + + * Makefile.in (init.c): Move the call to _initialize_gdbtypes to + the front of the initialize list. + +2002-06-10 Andrew Cagney + + * infrun.c (struct inferior_status): Replace fields + selected_frame_address and selected_level with field + selected_frame_id. + (save_inferior_status): Update. Use get_frame_id. + (struct restore_selected_frame_args): Delete. + (restore_selected_frame): Update. Use frame_find_by_id. + (restore_inferior_status): Update. + + * breakpoint.h (struct breakpoint): Change type of + watchpoint_frame to frame_id. + * breakpoint.c (insert_breakpoints): Use frame_find_by_id. Remove + call to get_current_frame. + (do_enable_breakpoint): Use frame_find_by_id. Remove call to + get_current_frame. + (watchpoint_check): Use frame_find_by_id. + + * frame.h (record_selected_frame): Delete declaration. + * stack.c (record_selected_frame): Delete function. + + * frame.h (struct frame_id): Define. + (get_frame_id): Declare. + (frame_find_by_id): Declare. + * frame.c (frame_find_by_id): New function. + (get_frame_id): New function. + +2002-06-10 Andrey Volkov + + * ser-e7kpc.c: Fix duplicated define and call of + _initialize_ser_e7000pc + +2002-06-09 Daniel Jacobowitz + + * signals/signals.c (target_signal_from_host): Fix #ifdef + SIGRTMIN case. + (do_target_signal_to_host): Likewise. + +2002-06-09 Daniel Jacobowitz + + * mips-tdep.c (mips_find_abi_section): New function. + (mips_gdbarch_init): Call it. + +2002-06-09 Mark Kettenis + + * solib-svr4.c (init_fetch_link_map_offsets): Simply return + legacy_fetch_link_map_offsets. Adjust comment to reflect reality + after Andrew's 2002-06-08 gdbarch change. + +2002-06-09 Mark Kettenis + + * i386-linux-nat.c (suppy_gregset): Don't supply + I386_LINUX_ORIG_EAX_REGNUM if there isn't room for it in GDB's + register cache. + (fill_gregset): Don't fetch it under the same circumstances. + +2002-06-09 Andrew Cagney + + * Makefile.in (callback_h): Define. + (remote_sim_h): Update path to remote-sim.h. + (remote-rdp.o): Add $(callback_h). + (remote-sim.o): Use $(callback_h). + * remote-sim.c: Include "gdb/callback.h" and "gdb/remote-sim.h". + * remote-rdp.c: Include "gdb/callback.h". + +2002-06-09 Mark Kettenis + + * osabi.h (gdb_osabi): Add GDB_OSABI_GO32 and GDB_OSABI_NETWARE. + * osabi.c (gdb_osabi_names): Add "DJGPP" and "NetWare". + +2002-06-08 Andrew Cagney + + * sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__. + * rdi-share/serpardr.c: Ditto. + * rdi-share/unixcomm.c: Ditto. + * rdi-share/serdrv.c: Ditto. + * rdi-share/hostchan.h: Ditto. + * rdi-share/hostchan.c: Ditto. + * rdi-share/host.h: Ditto. + * rdi-share/devsw.c: Ditto. + + * objfiles.h: Change type of obj_private to void pointer. + * pa64solib.c: Update copyright. Don't include "assert.h", use + strcmp instead of STREQ, use LONGEST, do not use PTR + * somsolib.c: Ditto. + + * config/djgpp/fnchange.lst: Fix problems with bfd/elf32-i386.c, + bfd/elf32-i386qnx.c, bfd/elf32-sh.c, bfd/elf32-sh64-nbsd.c, + bfd/elf64-sh64-nbsd.c bfd/elf64-sh64.c. + +2002-06-08 Andrew Cagney + + * frame.c (GET_SAVED_REGISTER): Delete macro definition. + (default_get_saved_register): Delete function. + * gdbarch.sh (GET_SAVED_REGISTER): Set default to + generic_unwind_get_saved_register. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-06-08 Andrew Cagney + + * gdbarch.sh (FRAME_CHAIN_VALID): Set default to + generic_func_frame_chain_valid. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (generic_func_frame_chain_valid): Only check + PC_IN_CALL_DUMMY when generic dummy frames. Don't worry about + passing FP to PC_IN_CALL_DUMMY. + Fix PR gdb/360. + +2002-06-08 Andrew Cagney + + * gdbarch.sh (struct gdbarch_data): Add field init_p. + (register_gdbarch_data): Initialize init_p. + (gdbarch_data): Initialize data pointer using the init function. + (init_gdbarch_data): Delete function. + (gdbarch_update_p): Update. + (initialize_non_multiarch): Update. + (struct gdbarch): Add field initialized_p. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-06-07 Michal Ludvig + + * x86-64-linux-nat.c (x86_64_fxsave_offset): New. + (supply_fpregset, fill_fpregset): Don't call i387_*_fxsave, + better do the things actually here. + * x86-64-tdep.c (x86_64_register_name2nr): New. + (x86_64_register_name): Renamed to x86_64_register_nr2name. + (x86_64_gdbarch_init): Respect the above change. + * x86-64-tdep.h (x86_64_register_name2nr) + (x86_64_register_nr2name): Add prototypes. + * config/i386/x86-64linux.mt (TDEPFILES): Remove i387-tdep.o. + +2002-06-06 Michael Snyder + + * d10v-tdep.c (d10v_push_arguments): Handle struct_return. + Delete extra braces and re-indent. + (d10v_store_return_value): Char return values + must be shifted over by one byte in R0. + (d10v_extract_return_value): Delete extra braces, re-indent. + +2002-06-06 Elena Zannoni + + * d10v-tdep.c (d10v_read_sp, d10v_read_fp): Add prototype. + (d10v_register_virtual_type): Make $fp and $sp be pointer to data. + (d10v_integer_to_address): Rewrite. + (d10v_frame_init_saved_regs): When reading fp and sp registers use + the d10v specific functions which take care of converting to the + correct space. + +2002-06-06 Elena Zannoni + + * config/djgpp/fnchange.lst: Add testsuite files altivec-abi.c, + altivec-abi.exp, altivec-regs.c, altivec-regs.exp. + +2002-06-02 Andrew Cagney + + * config/alpha/nm-linux.h: Add "config/" prefix to tm, nm and xm + includes. + * config/tm-linux.h: Ditto. + * config/alpha/tm-alphalinux.h: Ditto. + * config/arm/nm-linux.h, config/arm/tm-linux.h: Ditto. + * config/arm/xm-nbsd.h, config/i386/nm-gnu.h: Ditto. + * config/i386/nm-i386lynx.h, config/i386/nm-i386sol2.h: Ditto. + * config/i386/nm-i386v4.h, config/i386/nm-i386v42mp.h: Ditto. + * config/i386/nm-linux.h, config/i386/nm-m3.h: Ditto. + * config/i386/nm-ptx4.h, config/i386/nm-x86-64.h: Ditto. + * config/i386/tm-i386gnu.h, config/i386/tm-i386lynx.h: Ditto. + * config/i386/tm-i386m3.h, config/i386/tm-i386sco5.h: Ditto. + * config/i386/tm-i386v4.h, config/i386/tm-linux.h: Ditto. + * config/i386/tm-ptx4.h, config/i386/tm-vxworks.h: Ditto. + * config/i386/xm-i386v4.h, config/i386/xm-nbsd.h: Ditto. + * config/i386/xm-ptx.h, config/i386/xm-ptx4.h: Ditto. + * config/i960/tm-vx960.h, config/ia64/nm-aix.h: Ditto. + * config/ia64/nm-linux.h, config/ia64/tm-aix.h: Ditto. + * config/ia64/tm-linux.h, config/ia64/xm-aix.h: Ditto. + * config/m68k/nm-linux.h, config/m68k/nm-m68klynx.h: Ditto. + * config/m68k/nm-sysv4.h, config/m68k/tm-linux.h: Ditto. + * config/m68k/tm-m68klynx.h, config/m68k/tm-m68kv4.h: Ditto. + * config/m68k/tm-sun2os4.h, config/m68k/tm-sun3os4.h: Ditto. + * config/m68k/tm-vx68.h, config/m68k/xm-m68kv4.h: Ditto. + * config/m68k/xm-nbsd.h, config/m88k/nm-delta88v4.h: Ditto. + * config/m88k/tm-delta88v4.h, config/m88k/xm-delta88v4.h: Ditto. + * config/mips/nm-irix5.h, config/mips/nm-linux.h: Ditto. + * config/mips/tm-linux.h, config/mips/tm-mips64.h: Ditto. + * config/mips/tm-mipsm3.h, config/mips/tm-mipsv4.h: Ditto. + * config/mips/tm-vxmips.h, config/mips/xm-irix5.h: Ditto. + * config/mips/xm-mipsv4.h, config/ns32k/xm-nbsd.h: Ditto. + * config/pa/nm-hppao.h, config/powerpc/nm-linux.h: Ditto. + * config/powerpc/tm-linux.h, config/powerpc/tm-vxworks.h: Ditto. + * config/powerpc/xm-aix.h, config/rs6000/nm-rs6000ly.h: Ditto. + * config/rs6000/tm-rs6000ly.h, config/rs6000/xm-aix4.h: Ditto. + * config/sh/tm-linux.h, config/sparc/nm-linux.h: Ditto. + * config/sparc/nm-sparclynx.h, config/sparc/nm-sun4sol2.h: Ditto. + * config/sparc/tm-linux.h, config/sparc/tm-sp64linux.h: Ditto. + * config/sparc/tm-sp64sim.h, config/sparc/tm-sparclynx.h: Ditto. + * config/sparc/tm-sun4os4.h, config/sparc/tm-sun4sol2.h: Ditto. + * config/sparc/tm-vxsparc.h, config/sparc/xm-sun4sol2.h: Ditto. + +2002-05-04 Aidan Skinner + + * ada-exp.tab.c: New file + * ada-exp.y: New file + * ada-lang.c: New file + * ada-lang.h: New file + * ada-lex.c: New file + * ada-lex.l: New file + * ada-tasks.c: New file + * ada-typeprint.c: New file + * ada-valprint.c: New file + +2002-06-02 Jason Thorpe + + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Don't set + use_struct_convention to ppc_sysv_abi_broken_use_struct_convention. + +2002-06-02 Jason Thorpe + + * config/rs6000/aix4.mt (TDEPFILES): Use ppc-sysv-tdep.o + insetead of ppc-linux-tdep.o. + * config/rs6000/rs6000.mt (TDEPFILES): Likewise. + * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise. + +2002-06-02 Andrew Cagney + + 2002-05-07 Christian Groessler + * z8k-tdep.c (z8k_print_register_hook): Fix display of 32 and 64 + bit register contents for little endian hosts. + +2002-06-01 Andrew Cagney + + * MAINTAINERS: Mention that any `HP/UX reader' can be changed by + any maintainer. + +2002-06-01 Andrew Cagney + + * gdbarch.h: Regenerate. + +2002-06-01 Andrew Cagney + + * MAINTAINERS: Add everyone to write-after-approval list. + +2002-06-01 Andrew Cagney + + * stack.c (frame_info): Use frame_register_unwind instead of + saved_regs. Mention when the SP is on the stack or in a register. + + * frame.h (frame_register_unwind_ftype): Define. Document. + (struct frame_info): Add field register_unwind and + register_unwind_cache. + (frame_register_unwind): Declare. + (generic_unwind_get_saved_register): Declare. + + * frame.c (frame_register_unwind): New function. + (generic_unwind_get_saved_register): New function. + + * blockframe.c (generic_call_dummy_register_unwind): New function. + (frame_saved_regs_register_unwind): New function. + (set_unwind_by_pc): New function. + (create_new_frame): New function. + (get_prev_frame): New function. + +2002-05-30 Andrew Cagney + + * a29k-share/: Delete directory. + * remote-vx29k.c: Delete file. + +2002-05-30 Jason Thorpe + + * config/djgpp/fnchange.lst: Add ns32knbsd-nat.c, ns32knbsd-tdep.c, + ppcnbsd-nat.c, ppcnbsd-tdep.c, sparcnbsd-nat.c, and sparcnbsd-tdep.c. + +2002-05-30 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add sparc64nbsd-nat.c, + sparcnbsd-nat.c, and sparcnbsd-tdep.c. + (sparc64nbsd-nat.o) + (sparcnbsd-nat.o) + (sparcnbsd-tdep.o): New dependency lists. + * NEWS: Note new UltraSPARC NetBSD native configuration. + * configure.host (sparc64-*-netbsd*): New host. + * configure.tgt (sparc-*-netbsdelf*) + (sparc-*-netbsd*): Set gdb_target to nbsd. + (sparc64-*-netbsd*): New target. + * sparc64nbsd-nat.c: New file. + * sparcnbsd-nat.c: New file. + * sparcnbsd-tdep.c: New file. + * sparcnbsd-tdep.h: New file. + * config/sparc/nbsd.mt: New file. + * config/sparc/nbsd64.mh: New file. + * config/sparc/nbsd64.mt: New file. + * config/sparc/nbsdaout.mh (NATDEPFILES): Remove corelow.o, + sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. + (HOST_IPC): Remove. + * config/sparc/nbsdaout.mt: Remove. + * config/sparc/nbsdelf.mh (NATDEPFILES): Remove corelow.o, + sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. + (HOST_IPC): Remove. + * config/sparc/nbsdelf.mt: Remove. + * config/sparc/nm-nbsd.h: Update copyright years. Remove all + sparc-nat.c compatiblity defines. + * config/sparc/tm-nbsd.h: Update copyright years. Include solib.h. + (GDB_MULTI_ARCH): Set to GDB_MULTI_ARCH_PARTIAL. + * config/sparc/tm-nbsd64.h: New file. + * config/sparc/tm-nbsdaout.h: Remove. + * config/sparc/xm-nbsd.h: Remove. + +2002-05-30 Jason Thorpe + + * Makefile.in (sparc-tdep.o): Add osabi.h to dependency list. + * sparc-tdep.c: Include osabi.h. + (gdbarch_tdep): Add osabi member. + (_initialize_sparc_tdep): Use gdbarch_register. + (sparc_gdbarch_init): Use generic OS ABI framework. + (sparc_dump_tdep): New function. + +2002-05-30 Kevin Buettner + + * corefile.c (do_captured_read_memory_integer): Return non-zero + result. + (safe_read_memory_integer): Copy result of memory read when + status is non-zero. Also, add comments. + +2002-05-20 Jason Thorpe + + * Makefile.in (ppc_tdep_h): Define. + (ppc-linux-nat.o) + (ppc-linux-tdep.o) + (rs6000-tdep.o): Use $(ppc_tdep_h). + (ppc-sysv-tdep.o) + (ppcnbsd-nat.o) + (ppcnbsd-tdep.o): New dependency lists. + * ppc-tdep.h: Use generic OS ABI framework. + * ppc-linux-tdep.c (_initialize_ppc_linux_tdep) + (ppc_linux_init_abi): New functions. + (ppc_sysv_abi_broken_use_struct_convention) + (ppc_sysv_abi_use_struct_convention) + (ppc_sysv_abi_push_arguments): Move to... + * ppc-sysv-tdep.c: ...here. + * ppcnbsd-nat.c: Don't include gdbcore.h and regcache.h. + * rs6000-tdep.c (process_note_abi_tag_sections) + (get_elfosabi): Remove. + (rs6000_gdbarch_init): Use generic OS ABI framework. + (rs6000_dump_tdep): New function. + (_initialize_rs6000_tdep): Use gdbarch_register. + * config/powerpc/linux.mt (TDEPFILES): Add ppc-sysv-tdep.o. + * config/powerpc/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. + * config/powerpc/aix.mt (TDEPFILES): Use ppc-sysv-tdep.o instead + of ppc-linux-tdep.o. + * config/powerpc/nbsd.mt (TDEPFILES): Likewise. + * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise. + * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise. + * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise. + * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise. + * config/powerpc/vxworks.mt (TDEPFILES): Likewise. + +2002-05-29 Jim Blandy + + * macroscope.c (default_macro_scope): Put `void' in empty argument + list. + +2002-05-29 Andrew Cagney + + * Makefile.in (arch-utils.o): Add $(sim_regno_h). + * arch-utils.c: Include "sim-regno.h". + * gdbarch.sh: Don't include "sim-regno.h". + * gdbarch.h, gdbarch.c: Regenerate. + * sim-regno.h (legacy_register_sim_regno): Move declaration from + here. + * arch-utils.h (legacy_register_sim_regno): To here. + * remote-sim.c (legacy_register_sim_regno): Move function from + here. + * arch-utils.c (legacy_register_sim_regno): To here. + +2002-05-28 Andrew Cagney + + * sim-regno.h: New file. + * Makefile.in (sim_regno_h): Define. + (d10v-tdep.o, remote-sim.o): Add dependency on $(sim_regno_h). + * remote-sim.c: Include "sim-regno.h" and "gdb_assert.h". + (legacy_register_sim_regno): New function. + (one2one_register_sim_regno): New function. + (gdbsim_fetch_register): Rewrite. + (gdbsim_store_register): Only store a register when + REGISTER_SIM_REGNO is valid. + * d10v-tdep.c: Include "sim-regno.h". + (d10v_ts2_register_sim_regno): Add legacy_regiter_sim_regno check. + (d10v_ts3_register_sim_regno): Ditto. + * gdbarch.sh: Include "sim-regno.h". + (REGISTER_SIM_REGNO): Set default to legacy_register_sim_regno. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.h (default_register_sim_regno): Delete declaration. + * arch-utils.c (default_register_sim_regno): Delete function. + +2002-05-28 Jason Thorpe + + * ppcnbsd-nat.c: Rewrite. + * ppcnbsd-tdep.c: New file. + * ppcnbsd-tdep.h: New file. + * config/powerpc/nbsd.mh (NATDEPFILES): Remove corelow.o, + solib.o, and solib-svr4.o. + * config/powerpc/nbsd.mt (TDEPFILES): Add ppcnbsd-tdep.o, + nbsd-tdep.o, and corelow.o. + +2002-05-28 Andrew Cagney + + * MAINTAINERS (--enable-gdb-build-warnings): Rewrite script to use + `tr' and `sed'. Mention that `broken' targets are not expected to + build. + +2002-05-27 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Remove obsolete note. + Let PC point right after the prologue before looking up symbols. + +2002-05-27 Martin M. Hunt + + * i386-tdep.c (i386_register_virtual_type): Return + builtin_type_vec128i for SSE registers. + + * gdbtypes.h (builtin_type_vec128i): Declare. + + * gdbtypes.c (build_builtin_type_vec128i): New function. + (builtin_type_v2_double, builtin_type_v4_int64): New types. + (builtin_type_vec128i): New type for SSE2 128-bit registers. + (build_gdbtypes): Initialize new builtin vector types. + (_initialize_gdbtypes): Register new vector types with gdbarch. + +2002-05-26 Jason Thorpe + + * MAINTAINERS: ns32k is not longer an obsolete candidate, + since it has been multi-arch'd. + * NEWS: Note that ns32k-*-* is now partial multi-arch. + Move Alpha and VAX multi-arch news entries to same section + as other multi-arch news. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c: include gdbtypes.h, inferior.h, regcache.h, + target.s, arch-utils.h, ns32k-tdep.h. Make many functions + static. Rename some register numbers to put them in ns32k-tdep + private namespace. + (ns32k_get_saved_register, ns32k_gdbarch_init_32082, + ns32k_gdbarch_init_32382, ns32k_gdbarch_init, ns32k_dump_tdep): New + functions. + (_initialize_ns32k_tdep): Use gdbarch_register. + * ns32k-tdep.h: New file. + * ns32knbsd-tdep.c: New file. + * config/ns32k/nbsdaout.mt (TDEPFILES): Add ns32knbsd-tdep.o. + * config/ns32k/tm-nbsd.h: Include "ns32k/tm-ns32k.h". + (IN_SOLIB_CALL_TRAMPOLINE, REGISTER_NAME, NUM_REGS, + REGISTER_BYTES, REGISTER_BYTE): Remove. + * config/ns32k/tm-ns32k.h: New file. + * config/ns32k/tm-umax.h: Remove. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_saved_pc_after_call, + ns32k_store_struct_return, ns32k_extract_return_value, + ns32k_store_return_value, ns32k_extract_struct_value_address): New + functions. + * config/ns32k/tm-umax.h (SAVED_PC_AFTER_CALL): Define as + ns32k_saved_pc_after_call. + (STORE_STRUCT_RETURN): Define as ns32k_store_struct_return. + (EXTRACT_RETURN_VALUE): Define as ns32k_extract_return_value. + (STORE_RETURN_VALUE): Define as ns32k_store_return_value. + (EXTRACT_STRUCT_VALUE_ADDRESS): Define as + ns32k_extract_struct_value_address. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_call_dummy_words, sizeof_ns32k_call_dummy_words, + ns32k_fix_call_dummy): New. + * config/ns32k/tm-umax.h (CALL_DUMMY_WORDS): Define as + ns32k_call_dummy_words. + (SIZEOF_CALL_DUMMY_WORDS): Define as sizeof_ns32k_call_dummy_words. + (CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_ADDR, + CALL_DUMMY_NARGS): Remove. + (FIX_CALL_DUMMY): Define as ns32k_fix_call_dummy. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_breakpoint_from_pc, ns32k_frame_chain, + ns32k_frame_saved_pc, ns32k_frame_args_address, + ns32k_frame_locals_address, ns32k_frame_init_saved_regs, + ns32k_push_dummy_frame, ns32k_pop_frame): New functions. + * config/ns32k/tm-nbsd.h (FRAME_SAVED_PC): Remove. + * config/ns32k/tm-umax.h (INNER_THAN): Define as core_addr_lessthan. + (BREAKPOINT_FROM_PC): Define as ns32k_breakpoint_from_pc. + (BREAKPOINT): Remove.. + (FRAME_CHAIN): Define as ns32k_frame_chain. + (FRAME_SAVED_PC): Define as ns32k_frame_saved_pc. + (FRAME_ARGS_ADDRESS): Define as ns32k_frame_args_address. + (FRAME_LOCALS_ADDRESS): Define as ns32k_frame_locals_address. + (FRAME_FIND_SAVED_REGS): Remove. + (FRAME_INIT_SAVED_REGS): Define as ns32k_frame_init_saved_regs. + (PUSH_DUMMY_FRAME): Define as ns32k_push_dummy_frame. + (POP_FRAME): Define as ns32k_pop_frame. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_register_byte_32082, + ns32k_register_byte_32382, ns32k_register_raw_size, + ns32k_register_virtual_size, ns32k_register_virtual_type): New + functions. + * config/ns32k/tm-nbsd.h (REGISTER_BYTE): Define as + ns32k_register_byte_32382. + * config/ns32k/tm-umax.h: Update copyright years. + (REGISTER_BYTE): Define as ns32k_register_byte_32082. + (REGISTER_RAW_SIZE): Define as ns32k_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Define as ns32k_register_virtual_size. + (REGISTER_VIRTUAL_TYPE): Define as ns32k_register_virtual_type. + (ns32k_get_enter_addr): Fix prototype. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c: Update copyright years. + (ns32k_register_name_32082): New function. + (ns32k_register_name_32382): Ditto. + * config/ns32k/tm-nbsd.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define as ns32k_register_name_32382. + * config/ns32k/tm-umax.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define as ns32k_register_name_32082. + +2002-05-24 Jim Blandy + + * dwarf2read.c (free_line_header): Use xfree, not free. + +2002-05-24 Jason Thorpe + + * config/djgpp/fnchange.lst: Add alphabsd-nat.c, + alphabsd-tdep.c, mipsnbsd-nat.c, and mipsnbsd-tdep.c + +2002-05-23 Andrew Cagney + + * PROBLEMS: Mention s390 and FreeBSD 4.4 build problems. + +2002-05-23 Andrew Cagney + + From Ross Alexander at NEC Europe: + * config/pa/hpux11w.mh (NATDEPFILES): Add solib.o. + +2002-05-23 Michael Snyder + + * cli/cli-dump.c (restore_command): Use parse_and_eval_long + for input, rather than parse_and_eval_address. + +2002-05-23 Andrew Cagney + + * d10v-tdep.c: Include "gdb/sim-d10v.h" instead of "sim-d10v.h". + * Makefile.in (sim_d10v_h): Update definition. + +2002-05-24 Andrew Cagney + + * d10v-tdep.c (d10v_gdbarch_init): Revert old code included in + change `2002-05-22 Michael Snyder' below. + (d10v_push_arguments): Ditto. + (d10v_extract_return_value): Ditto. + +2002-05-23 Jim Blandy + + * macrotab.c (check_for_redefinition): Don't complain if the new + definition is the same as the previous one. Take more arguments + to allow the comparison. + (macro_define_object, macro_define_function): Pass more arguments + to check_for_redefinition. + +2002-05-22 Michael Snyder + + * d10v-tdep.c: Change a few macros to enums for ease of debugging. + (d10v_frame_chain_valid): Add PC_IN_CALL_DUMMY clause. + (d10v_frame_saved_pc): Add PC_IN_CALL_DUMMY clause. + (d10v_frame_chain): Bail immediately if PC_IN_CALL_DUMMY. + Don't bail if return_pc is PC_IN_CALL_DUMMY. + Add a temp variable to save a call (and a memory read). + (d10v_init_extra_frame_info): Get fi->pc from callee's return_pc + if possible (so that PC_IN_CALL_DUMMY will work). + +2002-05-22 Corinna Vinschen + + * MAINTAINERS: Remove status `OBSOLETE' from v850. + +2002-05-22 Michal Ludvig + + * dwarf2cfi.c (frame_state_for): Added safety check for a valid + fde->cie_ptr. + (dwarf2_build_frame_info): Corrected handling of eh_frame. + (dwarf2_build_frame_info): Add offset to fde->initial_location + so that frames of shared libraries are mapped correctly. + (execute_stack_op): Change type of 'result' from ULONGEST to + CORE_ADDR. + +2002-05-22 Jason Thorpe + + * config/alpha/tm-nbsd.h: Include solib.h. + +2002-05-22 Jason Thorpe + + * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Don't make + assumptions about the host's byte order. + +2002-05-22 Jason Thorpe + + * Makefile.in (alphanbsd-tdep.o, shnbsd-tdep.o): Add solib-svr4.h + to dependency list. + * alphanbsd-tdep.c: Include solib-svr4.h. + * shnbsd-tdep.c: Ditto. + +2002-05-22 Jason Thorpe + + * Makefile.in (armnbsd-tdep.o): Add solib-svr4.h and + nbsd-tdep.h to dependency list. + * configure.host (arm*-*-netbsdelf*, arm*-*-netbsd*, + i[3456]86-*-netbsdaout*, i[3456]86-*-netbsd*, m68*-*-netbsd*, + ns32k-*-netbsd*, sparc-*-netbsdaout*, sparc-*-netbsd*): Use + nbsdaout.mh and nbsdelf.mh consistently. + * configure.tgt (i[3456]86-*-netbsd*, m68*-*-netbsd*, + ns32k-*-netbsd*, sparc-*-netbsdelf*, sparc-*-netbsd*) Use + nbsdaout.mt and nbsdelf.mh consistently. + * armnbsd-tdep.c: Include nbsd-tdep.h and solib-svr4.h. + (arm_netbsd_elf_init_abi): Use set_solib_svr4_fetch_link_map_offsets + to set nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/nm-nbsd.h: Garbage-collect SVR4_SHARED_LIBS. Move + a.out shared library stuff from here... + * config/nm-nbsdaout.h: ...to here. + * config/tm-nbsd.h: Remove. + * config/alpha/nm-nbsd.h (SVR4_SHARED_LIBS): Remove. + * config/arm/nbsd.mh: Remove. + * config/arm/nbsd.mt (TDEPFILES): Remove solib-sunos.o, add + nbsd-tdep.o. + * config/arm/nbsdaout.mh: New file. + * config/arm/nbsdelf.mh: New file. + * config/arm/nm-nbsdaout.h: New file. + * config/i386/nbsd.mh: Remove. + * config/i386/nbsd.mt: Remove. + * config/i386/nbsdaout.mh: New file. + * config/i386/nbsdaout.mt: New file. + * config/i386/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. + * config/i386/nbsdelf.mt (TM_FILE): Use tm-nbsd.h. + * config/i386/nm-nbsd.h (REGISTER_U_ADDR, + i386_register_u_addr): Remove. + * config/i386/nm-nbsdaout.h: New file. + * config/i386/nm-nbsdelf.h: Remove. + * config/i386/tm-nbsd.h: Don't include config/tm-nbsd.h. + (USE_STRUCT_CONVENTION): Remove. + * config/i386/tm-nbsdaout.h: New file. + * config/i386/tm-nbsdelf.h: Remove. + * config/m68k/nbsd.mh: Remove. + * config/m68k/nbsd.mt: Remove. + * config/m68k/nbsdaout.mh: New file. + * config/m68k/nbsdaout.mt: New file. + * config/m68k/nm-nbsd.h: Use config/nm-nbsd.h. + * config/m68k/nm-nbsdaout.h: New file. + * config/m68k/tm-nbsd.h: Don't include config/tm-nbsd.h. + (IN_SOLIB_CALL_TRAMPOLINE): Define. + * config/ns32k/nbsd.mh: Remove. + * config/ns32k/nbsd.mt: Remove. + * config/ns32k/nbsdaout.mh: New file. + * config/ns32k/nbsdaout.mt: New file. + * config/ns32k/nm-nbsd.h: Include config/nm-nbsd.h. + * config/ns32k/nm-nbsdaout.h: New file. + * config/ns32k/tm-nbsd.h: Don't include config/tm-nbsd.h. + (IN_SOLIB_CALL_TRAMPOLINE): Define. + * config/powerpc/nm-nbsd.h: Include config/nm-nbsd.h. + (SVR4_SHARED_LIBS): Remove. + * config/powerpc/tm-nbsd.h: Dont' include config/tm-nbsd.h. + * config/sparc/nbsd.mh: Remove. + * config/sparc/nbsd.mt: Remove. + * config/sparc/nbsdaout.mh: New file. + * config/sparc/nbsdaout.mt: New file. + * config/sparc/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. + * config/sparc/nbsdelf.mt: New file. + * config/sparc/nm-nbsdaout.h: New file. + * config/sparc/nm-nbsdelf.h: Remove. + * config/sparc/tm-nbsd.h: Don't include config/tm-nbsd.h. + * config/sparc/tm-nbsdaout.h: New file. + +2002-05-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add mipsnbsd-nat.c and + mipsnbsd-tdep.c + (mipsnbsd-nat.o, mipsnbsd-tdep.o): New dependency lists. + +2002-05-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add shnbsd-tdep.c and + shnbsd-nat.c. + (shnbsd-tdep.o, shnbsd-nat.o): New dependency lists. + +2002-05-21 Jason Thorpe + + * NEWS: Note new MIPS NetBSD native configuration. + * configure.host (mips*-*-netbsd*): New host. + * configure.tgt (mips*-*-netbsd*): New target. + * mipsnbsd-nat.c: New file. + * mipsnbsd-tdep.c: New file. + * mipsnbsd-tdep.h: New file. + * config/mips/nbsd.mh: New file. + * config/mips/nbsd.mt: New file. + * config/mips/nm-nbsd.h: New file. + * config/mips/tm-nbsd.h: New file. + +2002-05-21 Jason Thorpe + + * Makefile.in (SFILES): Add osabi.c. + (COMMON_OBS): Add osabi.o. + (osabi.o): New dependency list. + * osabi.c: New file. + * osabi.h: New file. + * doc/gdbint.texinfo: Document new generic OS ABI framework. + + * Makefile.in (alpha_tdep_h): Define and use instead of + alpha-tdep.h. + * alpha-tdep.c (alpha_abi_names, process_note_abi_tag_sections, + get_elfosabi, alpha_abi_handler_list, alpha_gdbarch_register_os_abi): + Remove. + (alpha_gdbarch_init, alpha_dump_tdep): Use generic OS ABI framework. + * alpha-tdep.h: Include osabi.h. + (alpha_abi): Remove. + (gdbarch_tdep): Use generic OS ABI framework. + * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Use + gdbarch_register_osabi. + * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. + * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. + + * Makefile.in (sh_tdep_h): Add osabi.h. + * sh-tdep.h (sh_osabi): Remove. + (gdbarch_tdep): Use generic OS ABI framework. + * sh-tdep.c (sh_osabi_names, process_note_abi_tag_sections, + sh_osabi_handler_list, sh_gdbarch_register_os_abi): Remove. + (sh_gdbarch_init, sh_dump_tdep): Use generic OS ABI framework. + * shnbsd-tdep.c (_initialize_shnbsd_tdep): Use gdbarch_register_osabi. + + * Makefile.in (arm_tdep_h): Define and use instead of arm-tdep.h. + * arm-linux-tdep.c (_initialize_arm_linux_tdep): Use + gdbarch_register_osabi. + * arm-tdep.c (arm_abi_names, process_note_abi_tag_sections, + arm_abi_handler_list, arm_gdbarch_register_os_abi): Remove. + (get_elfosabi): Rename to... + (arm_elf_osabi_sniffer): ...this. Adjust to use generic OS + ABI framework support routines. + (arm_gdbarch_init): Use generic OS ABI framework. + (arm_dump_tdep): Likewise. + (_initialize_arm_tdep): Likewise. + * arm-tdep.h: Include osabi.h. + (arm_abi): Remove. + (gdbarch_tdep): Remove arm_abi and abi_name members. Add + osabi member. + (arm_gdbarch_register_os_abi): Remove prototype. + * armnbsd-tdep.c (arm_netbsd_aout_osabi_sniffer): New function. + (_initialize_arm_netbsd_tdep): Use gdbarch_register_osabi. + + * Makefile.in (mips-tdep.o): Add osabi.h to dependency list. + * mips-tdep.c: Include osabi.h. + (gdbarch_tdep, mips_gdbarch_init, mips_dump_tdep): Use generic + OS ABI framework. + +2002-05-20 Kazu Hirata + + * h8300-tdep.c: Fix formatting. + +2002-05-20 Elena Zannoni + + * rs6000-tdep.c (rs6000_do_registers_info): Simplify code for + printing vector registers. + +2002-05-19 Andrew Cagney + + From Fernando Nasser: + * remote.c (remote_async_open_1): Re-throw the exception when the + connection fails. + (remote_cisco_open): Ditto. + (remote_open_1): Ditto. + +2002-05-19 Andrew Cagney + + * remote.c (remote_start_remote_dummy): Add uiout parameter. + (remote_start_remote): Add uiout parameter. Pass through to + remote_start_remote_dummy. + (remote_open_1): Use catch_exception instead of catch_errors. + (remote_async_open_1): Ditto. + (remote_cisco_open): Ditto. + +2002-05-19 Andrew Cagney + + * remote.c (remote_start_remote): Replace PTR with void pointer. + (sigint_remote_twice_token, sigint_remote_token): Ditto. Make + static. + +2002-05-18 Andrew Cagney + + * gdb_indent.sh: Allow the script to be run in the sim directory. + +2002-05-18 Mark Kettenis + + * config/i386/nm-cygwin.h (NO_PTRACE_H): Remove define. + * config/i386/nm-go32.h (NO_PTRACE_H): Remove define. + + * corelow.c (core_open): Only call set_gdbarch_from_file if + exec_bfd is NULL. + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Add support of EXR register + * config/h8300/tm-h8300.h: Ditto. + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Add additional CCR flags (I,UI,H,U) + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Change literal regnums to REGNO. + +2002-05-17 Jim Blandy + + * NEWS: Note addition of macro support. + + Expand preprocessor macros in C expressions. + * c-lang.h: #include "macroexp.h", for macro_lookup_ftype. + (scan_macro_expansion, scanning_macro_expansion, + finished_macro_expansion): New function declarations. + (expression_macro_lookup_func, expression_macro_lookup_baton): New + variable declarations. + * parser-defs.h (expression_context_pc): New declaration. + * parse.c (expression_context_pc): New variable. + (parse_exp_1): Set expression_context_pc, as well as + expression_context_block. + * c-exp.y (yylex): If we're not already reading the result of a + macro expansion, try to macro-expand the next token. When we're + done scanning a macro expansion, switch back to the mainline text. + Commas and `if's in a macro's expansion don't terminate the input. + * c-lang.c: #include "macroscope.h" and "gdb_assert.h". + (macro_original_text, macro_expanded_text, + expression_macro_lookup_func, expression_macro_lookup_baton): New + variables. + (scan_macro_expansion, scanning_macro_expansion, + finished_macro_expansion, scan_macro_cleanup, null_macro_lookup, + c_preprocess_and_parse): New functions. + (c_language_defn, cplus_language_defn, asm_language_defn): Call + c_preprocess_and_parse, instead of c_parse. + * Makefile.in (c_lang_h): Note that this #includes macroexp.h. + (c-lang.o): Note dependency on macroscope.h and gdb_assert.h. + +Fri May 17 14:26:19 2002 J"orn Rennecke + + * sh-tdep.c (gdb_print_insn_sh64): Delete. + (gdb_print_insn_sh): Just set info->endian and use print_insn_sh. + (sh_gdbarch_init): Always use gdb_print_insn_sh. + +2002-05-17 Corinna Vinschen + + * NEWS: Add section for multi-arched targets. Add v850 to that section. + +2002-05-17 Jason Thorpe + + * Makefile.in (sh_tdep_h): Define and use. + * config/sh/tm-sh.h (sh_osabi, sh_abi, gdbarch_tdep, + register enum): Move to... + * * sh-tdep.h: ...here. + * sh-tdep.c: Include sh-tdep.h. + * sh3-rom.c: Likewise. + * shnbsd-tdep.c: Likewise. + +2002-05-16 Michael Snyder + + * arm-tdep.c: Spelling fix in comment. + +2002-05-16 Jim Blandy + + Add commands for manually expanding macros and showing their + definitions. + * macrocmd.c, macroscope.c, macroscope.h: New files. + * Makefile.in (SFILES): Add macrocmd.c, macroscope.c. + (macroscope_h): New variable. + (HFILES_NO_SRCDIR): Add macroscope.h. + (COMMON_OBS): Add macrocmd.o, macroscope.o. + (macroscope.o, macrocmd.o): New rules. + + Teach the Dwarf 2 reader to read macro information. + * dwarf2read.c: #include "macrotab.h". + (dwarf_macinfo_buffer): New variable. + (struct dwarf2_pinfo): New members: dwarf_macinfo_buffer, and + dwarf_macinfo_size. + (DWARF_MACINFO_BUFFER, DWARF_MACINFO_SIZE): New macros. + (dwarf2_missing_macinfo_section, dwarf2_macros_too_long, + dwarf2_macros_not_terminated, dwarf2_macro_outside_file, + dwarf2_macro_unmatched_end_file, dwarf2_macro_malformed_definition, + dwarf2_macro_spaces_in_definition): New complaints. + (dwarf2_has_info): Initialize dwarf_macinfo_offset. + (dwarf2_build_psymtabs): Read the .dwarf_macinfo section. + (dwarf2_build_psymtabs_hard): Record the buffer and its size in + the partial symbol table. + (psymtab_to_symtab_1): Set the macinfo buffer and size globals + from what's recorded in the partial symbol table. + (read_file_scope): If the compilation unit has a + `DW_AT_macro_info' attribute, read its macro information. + * Makefile.in (dwarf2read.o): Depend on macrotab.h. + +2002-05-16 Daniel Jacobowitz + + Fix PR gdb/546 + * ser-tcp.c: Don't include . + +2002-05-16 Stephane Carrez + + * MAINTAINERS: Update my email address. + +2002-05-16 Richard Earnshaw + + * config/arm/nm-nbsd.h: Use "config/nm-nbsd.h" to include generic + include file of the same name. + +2002-05-16 Corinna Vinschen + + * configure.tgt: Mark v850 as multi-arched. + * config/v850/tm-v850.h: Remove file. + * config/v850/v850.mt: Eliminate TM_FILE. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Full multi-arch. + * config/v850/tm-v850.h: Eliminate or move to v850-tdep.c everything. + Define GDB_MULTI_ARCH to 2. + +2002-05-16 Pierre Muller + + * p-exp.y (current_type): New static variable. + Carries the type of the expression at the position that is parsed. + (push_current_type, pop_current_type): Two new functions. Used + to store/restore current_type in expression on specific tokens. + (search_field): New static variable. Set to one after parsing a point + as at that point only a FIELDNAME token should be searched. + (FIELDNAME): New token. After a point only a token belonging to + current_type type definition is allowed. + (all over token rules): reset and change current_type according + to rules. + (exp '[' rule): insert implicit array index field if + exp is a pascal string type. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Fix comment for v850_scan_prologue. Remove extra + frame info. Use frame_info's saved_regs instead of matching member + in extra_frame_info throughout. + (v850_frame_init_saved_regs): New function. + (v850_init_extra_frame_info): Move most functionality into + v850_frame_init_saved_regs(). + * config/v850/tm-v850.h (EXTRA_FRAME_INFO): Remove definition. + (v850_frame_find_saved_regs): Remove declaration. + (FRAME_FIND_SAVED_REGS): Remove definition. + (v850_frame_init_saved_regs): Add declaration. + (FRAME_INIT_SAVED_REGS): Add definition. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Begin multi-arch'ing v850. + (v850_target_architecture_hook): Remove function. + (v850_gdbarch_init): New function. Add code previously in + v850_target_architecture_hook(). + (_initialize_v850_tdep): Don't set target_architecture_hook. + Call register_gdbarch_init() instead. + +2002-05-16 Daniel Jacobowitz + + * gdbtypes.h (struct cplus_struct_type): Remove args field. + * hpread.c (hpread_read_struct_type): Remove assignments to args. + (fixup_class_method_type): Likewise. + +2002-05-15 Jim Blandy + + Add macro structures to GDB's symbol tables. Nobody puts anything + in them yet. + * symtab.h (struct symtab): New member: `macro_table'. + * buildsym.h (pending_macros): New global variable. + * buildsym.c: #include "macrotab.h". + (buildsym_init): Initialize `pending_macros'. + (end_symtab): If we found macro information while reading a CU's + debugging info, do build a symtab structure for it. Make the + symtab point to the macro information, and clear the + `pending_macros' pointer which held it while we were reading the + debug info. + (really_free_pendings): Free any pending macro table. + * objfiles.h (struct objfile): New member: `macro_cache'. + * objfiles.c (allocate_objfile): Set allocate and free functions + for the macro cache's objstack. + (free_objfile): Empty the macro cache's obstack. + * symfile.c (reread_symbols): Empty the macro cache's obstack, and + set new allocate and free functions for it. + * solib-sunos.c (allocate_rt_common_objfile): Set allocate and + free functions for the macro cache's objstack. (Why is this + function building its own objfile?) + * symmisc.c (print_objfile_statistics): Print statistics on the + macro bcache. + * Makefile.in: Note that buildsym.o depends on macrotab.h. + +2002-05-15 Richard Earnshaw + + * config/arm/nm-nbsd.h: Use <> for include of config/nm-nbsd.h. + (REGISTER_U_ADDR): Delete definition. + (arm_register_u_addr): Delete declaration. + +2002-05-15 Richard Earnshaw + + * arm-linux-tdep.c (ARM_LINUX_JB_PC): Renamed from JB_PC. + (ARM_LINUX_JB_ELEMENT_SIZE): Likewise. + +2002-05-14 Andrew Cagney + + * regcache.c (register_valid): Revise comments refering to "Not + available" and "unavailable". + * frame.c (frame_register_read): Ditto. + * findvar.c (value_of_register): Ditto. + +2002-05-15 Andrew Cagney + + * Makefile.in (remote_sim_h): Replace remote-sim_h. + (remote-sim.o): Update dependencies. + (d10v-tdep.o): Specify dependencies. + (sim_d10v_h): Define. + +2002-05-14 Jim Blandy + + * macroexp.c (init_buffer, gather_arguments, expand): Use NULL, not 0. + * macrotab.c (macro_lookup_inclusion, find_definition, + new_macro_table): Same. + + * macroexp.c (currently_rescanning, expand): Use `strcmp () == 0', + not `! strcmp ()'. This is a dubious improvement. + * macrotab.c (macro_lookup_inclusion, find_definition): Same. + + * macrotab.c (macro_lookup_inclusion): Initialize `best_depth', + although it's not necessary, to avoid a warning. + +2002-05-14 Daniel Jacobowitz + + * gdbtypes.h: Update accessor macros to use TYPE_MAIN_TYPE. + (TYPE_CONST, TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE): Use + TYPE_INSTANCE_FLAGS. + (struct main_type): New. + (struct type): Move most members to struct main_type. Change + cv_type and as_type to new type_chain member. Add instance_flags. + (TYPE_MAIN_TYPE, TYPE_CHAIN, TYPE_INSTANCE_FLAGS): New macros. + (TYPE_CV_TYPE, TYPE_AS_TYPE): Remove. + (finish_cv_type): Remove prototype. + * gdbtypes.c (alloc_type): Update comment. Allocate TYPE_MAIN_TYPE. + Set TYPE_CHAIN. + (alloc_type_instance): New function. + (smash_type): New function. + (make_pointer_type, make_reference_type, make_function_type) + (smash_to_member_type, smash_to_method_type): Call smash_type. + (make_qualified_type): New function. + (make_type_with_address_space): Call make_qualified_type. + (make_cv_type): Likewise. + (finish_cv_type): Remove unnecessary function. + (replace_type): Update comment. Copy TYPE_MAIN_TYPE. + (recursive_dump_type): Dump TYPE_CHAIN and TYPE_INSTANCE_FLAGS; + remove TYPE_CV_TYPE and TYPE_AS_TYPE. + * c-typeprint.c (c_type_print_modifier): Use TYPE_INSTANCE_FLAGS. + * dwarf2read.c (read_structure_scope): Don't call finish_cv_type. + * hpread.c (hpread_read_struct_type): Likewise. + * stabsread.c (read_struct_type): Likewise. + +2002-05-14 Elena Zannoni + + * configure.tgt: Add a catch all sh* target, for cases like + sh[2,3,4]-elf and sh-hms. + +2002-05-14 Keith Seitz + + * event-loop.c (create_file_handler): Don't do anything but + update data when we are given a fd which we are already + monitoring. + +2002-05-14 Michal Ludvig + + * dwarf2cfi.c (context_cpy): Copy registers correctly. + (update_context): Use __func__ in warnings. + +2002-05-14 Daniel Jacobowitz + + * ser-tcp.c: Include . Rename tcp_open + and tcp_close to net_open and net_close. + (net_open): Accept "udp:" and "tcp:" specifications. Connect + using UDP if requested. Don't try to disable Nagle on UDP + sockets. + * remote.c (remote_serial_open): New function. Warn about UDP. + (remote_open_1, remote_async_open_1, remote_cisco_open): Call it. + +2002-05-13 Elena Zannoni + + * MAINTAINERS: List sh-elf as buildable with ,-Werror. + +2002-05-13 Elena Zannoni + + * configure.tgt: Remove sh-hms target. + * MAINTAINERS: Don't list sh-hms as a separate target. + +2002-05-13 Jim Blandy + + Add first preprocessor macro-expansion files. + * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. + * Makefile.in (SFILES): Add macrotab.c, macroexp.c. + (splay_tree_h, macroexp_h, macrotab_h): New variable. + (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. + (COMMON_OBS): Add macrotab.o, macroexp.o. + (macroexp.o, macrotab.o): New rules. + +2002-05-13 Andrew Cagney + + * config/m88k/tm-m88k.h: Update copyright. + (m88k_target_write_pc): Declare + (TARGET_WRITE_PC): Redefine using m88k_target_write_pc. + (M88K_NNPC_REGNUM): Rename NNPC_REGNUM. + (SHIFT_INST_REGS): Update definition. + * m88k-tdep.c (m88k_target_write_pc): New function. Implement + using old definition of TARGET_WRITE_PC. + * regcache.c (generic_target_write_pc): Delete code handling + NNPC_REGNUM. + * gdbarch.sh (NNPC_REGNUM): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-05-13 Richard Earnshaw + + * builtin-regs.c (value_of_builtin_reg): Correctly calculate the + builtin reg number. + +2002-05-13 Daniel Jacobowitz + + * ax-gdb.c (gen_sign_extend, gen_fetch, gen_usual_unary) + (gen_cast, gen_scale, gen_add, gen_sub, gen_binop, gen_deref) + (gen_address_of, gen_struct_ref, gen_repeat): Use type + access macros. + * c-typeprint.c (cp_type_print_method_args): Likewise. + (c_type_print_args): Likewise. + * d10v-tdep.c (d10v_push_arguments): Likewise. + (d10v_extract_return_value): Likewise. + * expprint.c (print_subexp): Likewise. + * gdbtypes.c (lookup_primitive_typename): Likewise. + (lookup_template_type, add_mangled_type, print_arg_types): Likewise. + * gdbtypes.h (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB) + (TYPE_TARGET_STUB, TYPE_STATIC, TYPE_CONST, TYPE_VOLATILE) + (TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_CODE_SPACE, TYPE_VARARGS) + (TYPE_VECTOR): Likewise. + * hpread.c (hpread_read_struct_type) + (fix_static_member_physnames, fixup_class_method_type) + (hpread_type_lookup): Likewise. + * mdebugread.c (parse_symbol, parse_type): Likewise. + * p-lang.c (is_pascal_string_type): Likewise. + * valops.c (hand_function_call): Likewise. + * x86-64-tdep.c (classify_argument): Likewise. + + * hpread.c (hpread_read_function_type) + (hpread_read_doc_function_type): Call replace_type. + * dstread.c (create_new_type): Delete. + (decode_dst_structure, process_dst_function): Call alloc_type. + Use type access macros. + +2002-05-12 Mark Kettenis + + * i387-tdep.c (i387_supply_fxsave): Skip the SSE registers if + the're not supported by the current architecture. + (i387_fill_fxsave): Likewise. + +2002-05-12 Fred Fish + + * symfile.c (default_symfile_offsets): Arrange for uninitialized + sect_index_xxx members to index the first slot in section_offsets + if all of the section_offsets are zero. + +2002-05-12 Mark Kettenis + + * configure.tgt (sparc-*openbsd): Remove entry accidentially + checked in with last change. + +2002-05-12 Mark Kettenis + + * configure.tgt (i[3456]86-*-unixware*, i[3456]86-*-unixware2*): + Remove targets. These are canonicalized to i386-*-sysv4.2uw by + config.sub. + +2002-05-12 Daniel Jacobowitz + + * Makefile.in: Update dependencies. + +2002-05-11 Andrew Cagney + + * language.c (local_hex_string_custom): Simplify. Do not depend + on PRINTF_HAS_LONG_LONG or CC_HAS_LONG_LONG. + + * memattr.c (mem_info_command): Replace calls to + longest_local_hex_string and longest_local_hex_string_custom. + * buildsym.c (make_blockvector): Ditto. + * solib.c (info_sharedlibrary_command): Ditto. + * tracepoint.c (tracepoints_info): Ditto. + * symtab.c (print_msymbol_info): Ditto. + + * language.c (local_hex_string): Delete. + (local_hex_string_custom): Delete. + (longest_local_hex_string): Rename to local_hex_string. + (longest_local_hex_string_custom): Rename to + local_hex_string_custom. + * language.h (local_hex_string): Change parameter type to LONGEST. + (local_hex_string_custom): Ditto. + (longest_local_hex_string): Delete declaration. + (longest_local_hex_string_custom): Ditto. + + * solib.c: Update copyright. + * memattr.c: Update copyright. + +2002-05-11 Andrew Cagney + + * arch-utils.h (legacy_register_to_value): Declare. + (legacy_value_to_register): Declare. + (legacy_convert_register_p): Declare. + * arch-utils.c (legacy_register_to_value): New function. + (legacy_value_to_register): New function. + (legacy_convert_register_p): New function. + + * gdbarch.sh (REGISTER_TO_VALUE): Define. + (VALUE_TO_REGISTER): Define. + (CONVERT_REGISTER_P): Define. + * gdbarch.h, gdbarch.c: Regenerate. + + * valops.c (value_assign): Use CONVERT_REGISTER_P and + VALUE_TO_REGISTER. + * findvar.c (value_from_register): Use REGISTER_TO_VALUE and + CONVERT_REGISTER_P. + +2005-05-11 Daniel Jacobowitz + Peter Schauer + + * Makefile.in: Update dependencies for valops.c. + * valops.c: Include "gdb_assert.h". + (typecmp): Skip THIS parameter to methods. + (find_method_list): Remove static_memfuncp argument, + update callers. Check for stub methods. + (find_value_oload_method_list): Don't set *static_memfuncp. + (find_overload_match): Don't check for stub methods. Assert + that methods are not stubbed. Handle static methods. + (value_find_oload_method_list): Remove static_memfuncp argument. + * gdbtypes.c (check_stub_method): Do not add THIS pointer + to the argument list for static stub methods. + * value.h (value_find_oload_method_list): Update prototype. + +2002-05-11 Andrew Cagney + + * arch-utils.h (generic_register_size): Declare. + (generic_register_raw_size, generic_register_virtual_size): Delete + declarations. + * arch-utils.c (generic_register_raw_size): Delete. + (generic_register_size): New function. + (generic_register_virtual_size): Delete. + + * gdbarch.sh (REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE): Make + default generic_register_size. + * gdbarch.h, gdbarch.c: Re-generate. + + * d10v-tdep.c (d10v_gdbarch_init): Use generic_register_size for + register_virtual_size. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + +2002-05-11 Andrew Cagney + + * gdbarch.sh (gdbarch_data): Add gdbarch parameter. + * gdbarch.h, gdbarch.c: Regenerate. + * gnu-v3-abi.c: Update copyright. + (vtable_address_point_offset): Update. + (gnuv3_rtti_type): Update. + (gnuv3_baseclass_offset): Update. + * solib-svr4.c (svr4_fetch_link_map_offsets): Update. + (init_fetch_link_map_offsets): Update. + * remote.c (get_remote_state): Update. + +2002-05-11 Daniel Jacobowitz + + * TODO: Remove value_headof/value_from_vtable_info comment. + * printcmd.c (print_command_1): Don't call value_from_vtable_info. + * values.c (value_headof, value_from_vtable_info): Delete. + * value.h (value_from_vtable_info): Delete prototype. + +2002-05-11 Andrew Cagney + + * Makefile.in: Replace gdb_assert.h with $(gdb_assert_h), + gdb_string.h with $(gdb_string_h) and gdb_regex.h with + $(gdb_regex_h). + (gdb_assert_h): Define. + (gdb_wait_h): Define. + (gdb_regex_h): Define. + +2002-05-11 Daniel Jacobowitz + + From Peter Schauer : + * linespec.c (find_methods): Handle GCC 3.x template constructors. + +2002-05-11 Jason Thorpe + + * nbsd-tdep.c: Fix comment. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add nbsd-tdep.c. + (alphanbsd-tdep.o): Add nbsd-tdep.h to dependency list. + (nbsd-tdep.o): New dependency list. + * alphanbsd-tdep.c: Don't include solib-svr4.h. Include + nbsd-tdep.h. + (alphanbsd_solib_svr4_fetch_link_map_offsets): Remove. + (alphanbsd_init_abi): Use nbsd_lp64_solib_svr4_fetch_link_map_offsets. + * nbsd-tdep.c: New file. + * nbsd-tdep.h: New file. + * shnbsd-tdep.c: Don't include solib-svr4.h. Include + nbsd-tdep.h. + (shnbsd_solib_svr4_fetch_link_map_offsets): Remove. + (shnbsd_init_abi): Use nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/alpha/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. + * config/sh/nbsd.mt (TDEPFILES): Ditto. + +2002-05-11 Jason Thorpe + + * config/alpha/nbsd.mh (NATDEPFILES): Remove corelow.o. + * config/alpha/nbsd.mt (TDEPFILES): Add corelow.o. + * config/i386/nbsd.mh (NATDEPFILES): Remove corelow.o. + * config/i386/nbsd.mt (TDEPFILES): Add corelow.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove corelow.o. + * config/i386/nbsdelf.mt (TDEPFILES): Add corelow.o. + +2002-05-11 Jason Thorpe + + * config/i386/nbsd.mh (NATDEPFILES): Use line continuations. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/m68k/nbsd.mh (NATDEPFILES): Likewise. + * config/ns32k/nbsd.mh (NATDEPFILES): Likewise. + * config/powerpc/nbsd.mh (NATDEPFILES): Likewise. + * config/sparc/nbsd.mh (NATDEPFILES): Likewise. + * config/sparc/nbsdelf.mh (NATDEPFILES): Likewise. + +2002-05-11 Jason Thorpe + + * i386nbsd-nat.c: Delete file. Move fetch_core_registers and + fetch_elfcore_registers to... + * i386nbsd-tdep.c: ...here. + (i386nbsd_use_struct_convention): Rename to... + (i386nbsd_aout_use_struct_convention): ...this. + (i386nbsd_supply_reg): New function. + (i386nbsd_fill_reg): New function. + (fetch_core_registers): Use i386nbsd_supply_reg. + (fetch_elfcore_registers): Likewise. + (_initialize_i386nbsd_tdep): New function. + * config/i386/nbsd.mh (NATDEPFILES): Remove i386nbsd-nat.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/nbsdelf.mt (TDEPFILES): Add i386nbsd-tdep.o. + * config/i386/tm-nbsd.h (i386nbsd_use_struct_convention): Rename to... + (i386nbsd_aout_use_struct_convention): ...this. + +2002-05-11 Jason Thorpe + + * shnbsd-nat.c (fetch_inferior_registers): Use shnbsd_supply_reg. + (store_inferior_registers): Use shnbsd_fill_reg. + * shnbsd-tdep.c (sh_nbsd_supply_registers, + sh_nbsd_supply_register): Collapse into... + (shnbsd_supply_reg): ...this. + (sh_nbsd_fill_registers, sh_nbsd_fill_register): Collapse into... + (shnbsd_fill_reg): ...this. + (sh_nbsd_solib_svr4_fetch_link_map_offsets): Rename to... + (shnbsd_solib_svr4_fetch_link_map_offsets): ...this. + (fetch_core_registers): Use shnbsd_supply_reg. + (fetch_elfcore_registers): Use shnbsd_supply_reg. + (sh_nbsd_core_fns): Rename to... + (shnbsd_core_fns): ...this. + (sh_nbsd_elfcore_fns): Rename to... + (shnbsd_elfcore_fns): ...this. + (sh_nbsd_init_abi): Rename to... + (shnbsd_init_abi): ...this. + (_initialize_sh_nbsd_tdep): Rename to... + (_initialize_shnbsd_tdep): ...this. + * shnbsd-tdep.h (sh_nbsd_supply_registers, + sh_nbsd_supply_register, sh_nbsd_fill_registers, + sh_nbsd_fill_register): Remove prototypes. + (shnbsd_supply_reg, shnbsd_fill_reg): Add prototypes. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Remove i387-nat.c. + (i387-nat.o): Delete dependency list. + (go32-nat.o): Change i387-nat.h to i387-tdep.h. + (x86-64-linux-nat.o): Likewise. + * i387-nat.c: Delete file, moving contents to... + * i387-tdep.c: ...here. + * i387-nat.h: Rename... + * i387-tdep.h: ...to this. + * go32-nat.c: Include i387-tdep.h instead of i387-nat.h. + * i386-linux-nat.c: Likewise. + * i386bsd-nat.c: Likewise. + * i386gnu-nat.c: Likewise. + * i386nbsd-nat.c: Likewise. + * i386v4-nat.c: Likewise. + * x86-64-linux-nat.c: Likewise. + * config/i386/fbsd.mh (NATDEPFILES): Remove i387-nat.o. + * config/i386/go32.mh (NATDEPFILES): Likewise. + * config/i386/i386gnu.mh (NATDEPFILES): Likewise. + * config/i386/i386sol2.mh (NATDEPFILES): Likewise. + * config/i386/i386v42mp.mh (NATDEPFILES): Likewise. + * config/i386/linux.mh (NATDEPFILES): Likewise. + * config/i386/nbsd.mh (NATDEPFILES): Likewise. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/obsd.mh (NATDEPFILES): Likewise. + * config/i386/x86-64linux.mh (NATDEPFILES): Likewise. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Remove alphanbsd-nat.c. + (alphanbsd-nat.o): Remove dependency list. + (alphanbsd-tdep.o): Add $(regcache_h) to dependency list. + * alphanbsd-nat.c: Delete. Contents moved to... + * alphanbsd-tdep.c: ...here. + (_initialize_alphanbsd_tdep): Register core functions. + * config/alpha/nbsd.mh (NATDEPFILES): Remove alphanbsd-nat.o. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphabsd-tdep.c. + (alphabsd-nat.o): Depend on alphabsd-tdep.h. + (alphanbsd-nat.o): Likewise. + (alphabsd-tdep.o): New dependency list. + * alphabsd-nat.c (supply_gregset): Use alphabsd_supply_reg. + (fill_gregset): Use alphabsd_fill_reg. + (supply_fpregset): Use alphabsd_supply_fpreg. + (fill_fpregset): Use alphabsd_fill_fpreg. + (fetch_inferior_registers): Use struct reg and struct fpreg + rather than gregset_t and fpregset_t. Use alphabsd_supply_reg + and alphabsd_supply_fpreg. + (store_inferior_registers): Use struct reg and struct fpreg + rather than gregset_t and fpregset_t. Use alphabsd_fill_reg + and alphabsd_fill_fpreg. + * alphabsd-tdep.c: New file. + * alphabsd-tdep.h: New file. + * alphanbsd-nat.c (fetch_core_registers): Use alphabsd_supply_fpreg. + (fetch_elfcore_registers): Use alphabsd_supply_reg and + alphabsd_supply_fpreg. + * config/alpha/fbsd.mt (TDEPFILES): Add alphabsd-tdep.o. + * config/alpha/nbsd.mt (TDEPFILES): Likewise. + +2002-05-11 Eric Christopher + + * mips-tdep.c (mips_double_register_type): Fix thinko. + (mips_single_register_type): Ditto. + * MAINTAINERS: Add self. + +2002-05-11 Mark Kettenis + + * i387-nat.c (i387_supply_register, i387_fill_fsave, + i387_supply_fxsave, i387_fill_fxsave): Rewrite in order to do the + right thing on architectures with different endianness and/or + integer sizes. + +2002-05-10 Jason Thorpe + + From Christian Limpach + * configure.in: Change sed expression which comments out + NATDEPFILES to also comment out continuation lines. + * configure: Regenerate. + +2002-05-10 Elena Zannoni + + * sh-tdep.c: Clean up code erroneously reintroduced by previous + big patch. + +2002-05-10 Elena Zannoni + + * sh-tdep.c: Include correct file. + +2002-05-10 Elena Zannoni + + New support for sh64-elf (sh5) target. + + * configure.tgt: For sh64-elf target, default to sh-elf. + + * config/sh/tm-sh.h (enum sh-abi): Possible ABI's. + (struct gdbarch_tdep): Add new fields for new registers and ABI + info. + + * sh-tdep.c: Include elf-bfd.h, elf/sh.h, gdb/sim-sh.h. + (NUM_PSEUDO_REGS_SH_MEDIA, NUM_PSEUDO_REGS_SH_COMPACT, + MSYMBOL_IS_SPECIAL, IS_ISA32_ADDR, MAKE_ISA32_ADDR, + UNMAKE_ISA32_ADDR, IS_PTABSL_R18, IS_STS_R0, IS_STS_PR, + IS_MOV_TO_R15, IS_MOV_R14, IS_STQ_R18_R14, IS_STQ_R18_R15, + IS_STL_R18_R15, IS_STQ_R14_R15, IS_STL_R14_R15, IS_ADDIL_SP_MEDIA, + IS_ADDI_SP_MEDIA, IS_ADDL_SP_FP_MEDIA, IS_ADD_SP_FP_MEDIA, + IS_MOV_SP_FP_MEDIA, IS_MOV_R0, IS_MOVL_R0, IS_ADD_SP_R0, + IS_MOV_R14_R0, IS_MEDIA_IND_ARG_MOV, IS_MEDIA_ARG_MOV, + IS_MEDIA_MOV_TO_R14, IS_COMPACT_IND_ARG_MOV, IS_COMPACT_ARG_MOV, + IS_COMPACT_MOV_TO_R14, IS_JSR_R0, IS_NOP): New macros. + (sh_sh64_register_name, sh64_elf_make_msymbol_special, + pc_is_isa32, sh_sh64_breakpoint_from_pc, look_for_args_moves, + sh64_skip_prologue_hard_way, sh64_use_struct_convention, + gdb_print_insn_sh64, translate_insn_rn, sh64_frame_chain, + sh64_get_saved_pr, fpp_reg_base_num, is_media_pseudo, + sh64_get_gdb_regnum, sh64_media_reg_base_num, + sh64_compact_reg_base_num, translate_rn_to_arch_reg_num, + sign_extend, sh64_nofp_frame_init_saved_regs, + sh64_init_extra_frame_info, sh64_get_saved_register, + sh64_extract_struct_value_address, sh64_pop_frame, + sh64_push_arguments, sh64_extract_return_value, + sh64_store_return_value, sh64_show_media_regs, + sh64_show_compact_regs, sh64_show_regs, sh_sh64_register_byte, + sh_sh64_register_raw_size, sh_sh64_register_virtual_size, + sh_sh64_register_virtual_type, + sh_sh64_register_convert_to_virtual, + sh_sh64_register_convert_to_raw, sh64_pseudo_register_read, + sh64_register_read, sh64_pseudo_register_write, + sh64_register_write, do_fv_c_register_info, do_dr_c_register_info, + do_r_c_register_info, do_fpp_register_info, do_cr_c_register_info, + sh64_do_pseudo_register, sh_compact_do_registers_info, + sh64_do_registers_info, sh_gdbarch_init): New functions. + +2002-05-10 Elena Zannoni + + * sh-tdep.c (sh_breakpoint_from_pc): Add 'const' to return type. + +2002-05-10 Daniel Jacobowitz + + * linespec.c (decode_line_1): Check for a double quote after + a filename correctly. + +2002-05-10 Jim Blandy + + Properly track the size of the current objfile's .debug_line section. + * dwarf2read.c (struct dwarf2_pinfo): New member: dwarf_line_size. + (DWARF_LINE_SIZE): New macro. + (dwarf2_build_psymtabs_hard): Record the line section's size in + the partial symbol table. + (psymtab_to_symtab_1): Restore dwarf_line_size from the partial + symbol table. + +2002-05-10 Petr Sorfa + + * ia64-tdep.c: Handle breakpoints on L instruction type + in MLX instruction bundle by moving the breakpoint to + the third slot (X instruction type) as L holds only data. + +2002-05-10 Kevin Buettner + + * dbxread.c (discarding_local_symbols_complaint): New complaint. + (process_one_symbol): Complain about discarding local symbols + due to a misplaced N_LBRAC entry. + +2002-05-09 Elena Zannoni + + From Daniel Berlin + * linespec.c (find_toplevel_char): '<' and '>' also increase and + decrease the depth we are at, in the case of templates. + +2002-05-09 Daniel Jacobowitz + + * mips-tdep.c (mips_float_register_type): New function. + (mips_double_register_type): New function. + (mips_print_register): Use them. + (do_fp_register_row): Likewise. + +2002-05-09 Daniel Jacobowitz + + * signals/signals.c (signals): Remove conditional compilation around + Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. + (target_signal_from_name): Loop until TARGET_SIGNAL_LAST. + +2002-05-09 Michael Snyder + + * remote-rdp.c (remote_rdp_can_run): Remove. + +2002-05-09 Tom Tromey + + * jv-valprint.c (java_val_print): Handle `char' as a special case + of TYPE_CODE_INT. + +2002-05-09 Michael Snyder + + * arm-tdep.c (arm_scan_prologue): Accept strb r(0123),[r11,#-nn], + strh r(0123),[r11,#-nn], str r(0123),[r11,#-nn], as well as + strb r(0123),[sp,#nn], strh r(0123),[sp,#nn] and + str r(0123),[sp,#nn]. + (arm_skip_prologue): Ditto. Also make disassembly + order-independent by placing it in a loop. + +2002-05-06 Michael Snyder + + * stabsread.c (read_type): Add recognition for new attribute: + "@V;" means that an array type is actually a vector. + This is analogous to the vector flag that's been added to dwarf2. + +2002-05-09 Mark Kettenis + + * i386-tdep.h (i386_abi): New enum. + (struct gdbarch_tdep): Replace os_ident member with abi. + (i386_gdbarch_register_os_abi): New prototype. + * i386-tdep.c (i386_abi_names): New array. + (process_note_abi_tag_sections): Removed. + (process_note_sections): New function. + (i386_elf_abi_from_note, i386_elf_abi): New functions. + (struct i386_abi_handler): New struct. + (i386_abi_handler_list): New variable. + (i386_gdbarch_register_os_abi): New function. + (i386_gdbarch_init): Adapt for the changes given above. + +2002-05-08 Daniel Jacobowitz + + * gregset.h: Say "GNU/Linux". + +2002-05-08 Elena Zannoni + + * gdbtypes.c : Add new builtin type for 64 bit vectors. + (build_gdbtypes): Build builtin_type_v2_float. + (_initialize_gdbtypes): Register new builtin type. + +2002-05-08 Andrew Cagney + + * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. + (clear_gdbarch_swap): New function. + (initialize_non_multiarch): Call. + (gdbarch_update_p): Before calling init(), swap out and clear the + existing architecture. + * gdbarch.c: Regenerate. + +2002-05-08 Jason Thorpe + + * config/djgpp/fnchange.lst: Add alphanbsd-nat.c and + alphanbsd-tdep.c. + +2002-05-08 Jason Thorpe + + * sh-nbsd-nat.c: Rename to... + * shnbsd-nat.c: ...this. + * sh-nbsd-tdep.c: Rename to... + * shnbsd-tdep.c: ...this. + * sh-nbsd-tdep.h: Rename to... + * shnbsd-tdep.h: ...this. + * config/sh/nbsd.mh: Use shnbsd-nat.o. + * config/sh/nbsd.mt: Use shnbsd-tdep.o. + +2002-05-08 Richard Earnshaw + + * remote-rdi.c (_initializie_remote_rdi): Use ANSI-style string + concatenation for command help messages. + +2002-05-08 Jason Thorpe + + * NEWS: Note new sh*-*-netbsdelf* configuration. + * configure.host: Set gdb_host_cpu to sh for all sh*. + (sh*-*-netbsdelf*): New host. + * configure.tgt: Set gdb_target_cpu to sh for all sh*. + (sh*-*-netbsdelf*): New target. + * sh-nbsd-nat.c: New file. + * sh-nbsd-tdep.c: New file. + * sh-nbsd-tdep.h: New file. + * config/sh/nbsd.mh: New file. + * config/sh/nbsd.mt: New file. + * config/sh/nm-nbsd.h: New file. + * config/sh/tm-nbsd.h: New file. + +2002-05-08 Jason Thorpe + + * sh-tdep.c (sh_osabi_names): Declare. + (process_note_abi_tag_sections): New function. + (get_elfosabi): Ditto. + (sh_gdbarch_register_os_abi): Ditto. + (sh_dump_tdep): Ditto. + _initialize_sh_tdep): Use gdbarch_register to register + sh_gdbarch_init and sh_dump_tdep. + * config/sh/tm-sh.h (sh_osabi): Declare. + (gdbarch_tdep): Add sh_osabi and osabi_name members. + +2002-05-07 Andrew Cagney + + * arm-tdep.c (arm_skip_prologue): Handle generic dummy frames. + (thumb_scan_prologue): Ditto. + (arm_find_callers_reg): Ditto. + (arm_frame_chain): Ditto. + (arm_init_extra_frame_info): Ditto. + (arm_frame_saved_pc): Ditto. + (arm_pop_frame): Ditto. + (arm_push_return_address): New function. + (arm_gdbarch_init): Initialize use_generic_dummy_frames, + call_dummy_location, call_dummy_breakpoint_offset_p, + call_dummy_breakpoint_offset, call_dummy_p, + call_dummy_stack_adjust_p, call_dummy_words, + sizeof_call_dummy_words, call_dummy_start_offset, + call_dummy_length, fix_call_dummy, pc_in_call_dummy, + call_dummy_address, push_return_address and push_dummy_frame for + generic dummy frames. + +2002-05-07 Jason Thorpe + + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Fix error in + size computation for alloca. + (sh_fp_frame_init_saved_regs): Likewise. + +2002-05-07 Richard Earnshaw + + * arm-tdep.h (ARM_MAX_REGISTER_RAW_SIZE): Define. + (ARM_MAX_REGISTER_VIRTUAL_SIZE): Define. + * arm-tdep.c (arm_store_return_value): Use them. + Use FP_REGISTER_RAW_SIZE when setting the FPA return value. + * remote-rdp.c (remote_rdp_fetch_register): Use + ARM_MAX_REGISTER_RAW_SIZE. + (remote_rdp_store_register): Likewise. + +2002-05-07 Michal Ludvig + + * dwarf2cfi.c: Code cleanup, removed unused variables, + added default labels to switch {} statements. + * x86-64-tdep.c: Ditto. + * x86-64-linux-nat.c: Ditto. + +2002-05-07 Jason Thorpe + + * solib.h: Protect against multiple inclusion. + +2002-05-06 Jim Blandy + + Add first preprocessor macro-expansion files. + * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. + * Makefile.in (SFILES): Add macrotab.c, macroexp.c. + (splay_tree_h, macroexp_h, macrotab_h): New variable. + (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. + (COMMON_OBS): Add macrotab.o, macroexp.o. + (macroexp.o, macrotab.o): New rules. + + Separate the job of reading the line number info statement program + header (...expialidocious) out into its own function. + * dwarf2read.c (struct line_head, struct filenames, struct + directories): Replace with... + (struct line_header): New structure, containing the full + contents of the statement program header, including the + include directory and file name tables. + (read_file_scope): If we have line number info, instead of just + calling dwarf_decode_lines to do all the work, call + dwarf_decode_line_header first to get a `struct line_header' + containing the data in the statement program header, and then + pass that to dwarf_decode_lines, which will pick up where that + left off. Be sure to clean up the `struct line_header' object. + (dwarf_decode_line_header, free_line_header, add_include_dir, + add_file_name): New functions. + (dwarf_decode_lines): Move all the code to read the statement + program header into dwarf_decode_line_header. Take the line + header it built as the first argument, instead of the offset to + the compilation unit's line number info. Use the new `struct + line_header' type instead of the old structures. No need to do + cleanups here now, since we don't allocate anything. + (dwarf2_statement_list_fits_in_line_number_section, + dwarf2_line_header_too_long): New complaints. + +2002-05-06 Elena Zannoni + + * gdbtypes.c (init_vector_type): New function. + (build_builtin_type_vec128): Simplify the representation of SIMD + registers. + (build_gdbtypes): Initialize new builtin vector types. + (_initialize_gdbtypes): Register new vector types with gdbarch. + (builtin_type_v4_float, builtin_type_v4_int32, + builtin_type_v8_int16, builtin_type_v16_int8, + builtin_type_v2_int32, builtin_type_v4_int16, + builtin_type_v8_int8): New (renamed) SIMD types. + +2002-05-06 Mark Kettenis + + * i387-nat.c (i387_fill_fsave): Use regcache_collect. + (i387_fill_fxsave): Likewise. + +2002-05-05 Alexandre Oliva + + * alpha-tdep.c (alpha_extract_return_value): Don't use + non-constant array size in prototype. + +2002-05-04 Andrew Cagney + + From Brian Taylor : + * ui-out.c (ui_out_field_core_addr): Use the function + longest_local_hex_string_custom'to format addresses > 32 bits + wide. + + * ui-out.c (ui_out_field_core_addr): Update comment. + +2002-05-04 Andrew Cagney + + * stack.c (select_and_print_frame): Make static. Delete the + parameter `level'. + (func_command): Update call. + (select_frame_command): Delete code computing the frame level. + * frame.h (select_and_print_frame): Delete declaration. + +2002-05-04 Andrew Cagney + + * sparc-tdep.c (sparc_get_saved_register): Comment why + get_prev_frame call is safe. + +2002-05-04 Andrew Cagney + + * frame.h (select_frame): Delete level parameter. + * stack.c (select_frame): Update. Use frame_relative_level to + obtain the frame's level. + (select_and_print_frame): Update call. + (select_frame_command): Ditto. + (up_silently_base): Ditto. + (down_silently_base): Ditto. + * ocd.c (ocd_start_remote): Ditto. + * remote-rdp.c (remote_rdp_open): Ditto. + * remote-mips.c (mips_initialize): Ditto. + (common_open): Ditto. + * remote-e7000.c (e7000_start_remote): Ditto. + * m3-nat.c (select_thread): Ditto. + * hppa-tdep.c (child_get_current_exception_event): Ditto. + (child_get_current_exception_event): Ditto. + * varobj.c (varobj_create): Ditto. + (varobj_update): Ditto. + (c_value_of_root): Ditto. + * tracepoint.c (finish_tfind_command): Ditto. + * corelow.c (core_open): Ditto. + * arch-utils.c (generic_prepare_to_proceed): Ditto. + * thread.c (info_threads_command): Ditto. + (switch_to_thread): Ditto. + * infrun.c (normal_stop): Ditto. + (restore_selected_frame): Ditto. + (restore_inferior_status): Ditto. + * breakpoint.c (insert_breakpoints): Ditto. + (watchpoint_check): Ditto. + (bpstat_stop_status): Ditto. + (do_enable_breakpoint): Ditto. + * blockframe.c (flush_cached_frames): Ditto. + (reinit_frame_cache): Ditto. + +2002-05-04 Andrew Cagney + + * MAINTAINERS (Host/Native): Add Jason Thorpe as NetBSD + maintainer. + +2002-05-04 Jim Blandy + + * gdbtypes.c (replace_type): Doc fix. + +2002-05-04 Andrew Cagney + + * valprint.c (strcat_longest): Delete commented out function. + Update copyright. + +2002-05-04 Andrew Cagney + + * MAINTAINERS: Mark a29k as deleted. + * NEWS: Mention that a29k was removed. Add OBSOLETE section. + Move new configurations to the top. + * configure.tgt: Remove a29k. + * config/a29k/tm-vx29k.h: Delete. + * config/a29k/vx29k.mt: Delete. + * config/a29k/tm-a29k.h: Delete. + * config/a29k/a29k-udi.mt: Delete. + * config/a29k/a29k.mt: Delete. + * a29k-tdep.c: Delete. + * remote-udi.c: Delete. + * remote-mm.c: Delete. + * remote-eb.c: Delete. + * remote-adapt.c: Delete. + * Makefile.in: Remove obsolete code. + * config/s390/s390x.mt: Ditto. + * config/s390/s390.mt: Ditto. + * config/sparc/sparclynx.mh: Ditto. + * config/sparc/linux.mh: Ditto. + * config/pa/hppaosf.mh: Ditto. + * config/pa/hppabsd.mh: Ditto. + * config/ns32k/nbsd.mt: Ditto. + * config/mips/vr5000.mt: Ditto. + * config/m68k/sun3os4.mh: Ditto. + * config/m68k/nbsd.mt: Ditto. + * config/m68k/m68klynx.mh: Ditto. + * config/m32r/m32r.mt: Ditto. + * config/i386/x86-64linux.mt: Ditto. + * config/i386/nbsdelf.mt: Ditto. + * config/i386/nbsd.mt: Ditto. + * config/i386/i386lynx.mh: Ditto. + +2002-05-04 Andrew Cagney + + * target.c (debug_print_register): New function. Handle oversize + registers. + (debug_to_fetch_registers): Call. + (debug_to_store_registers): Call. + +2002-05-03 Jim Blandy + + * stabsread.c (cleanup_undefined_types): Use replace_type, not memcpy. + (read_type): Doc fix. + * gdbtypes.c (replace_type): Doc fix. + + * stabsread.c (multiply_defined_struct): New complaint. + (read_struct_type): If the type we were passed isn't empty, or + incomplete, don't read the new struct type into it; complain, + and return the original type unchanged. Take a new `type_code' + argument, which is the type code for the new type. + (read_type): Rather than storing the type's type code here, pass + it as an argument to read_struct_type, and let that take care of + storing it. That way, we don't overwrite the original type code, + so read_struct_type can use it to decide whether we're overwriting + something we shouldn't. + (complain_about_struct_wipeout): New function. + +2002-05-03 Andrew Cagney + + * gdbarch.sh: Assert that gdbarch is non-NULL. + * gdbarch.c: Regenerate. + +2002-05-03 Jason Merrill + + * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn + and return NULL. + +2002-05-03 Michal Ludvig + + * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map), + (x86_64_dwarf2gdb_regno_map_length), + (x86_64_dwarf2_reg_to_regnum): Added. + (x86_64_gdbarch_init): Added registration of x86_64_dwarf2_reg_to_regnum. + (x86_64_gdbarch_init): Renamed from i386_gdbarch_init. + (_initialize_x86_64_tdep): Synced with the change above. + (x86_64_skip_prologue): Reformulated message. + +2002-05-03 Pierre Muller + + * f-exp.y: Also use new prev_lexptr variable + to improve error reporting. Based on Michael Snyder + 2002-04-24 dated patch to c-exp.y. + * jv-exp.y: Likewise. + * m2-exp.y: Likewise. + +2002-05-02 Elena Zannoni + + * valops.c (value_arg_coerce): Don't coerce arrays to pointers if + we are dealing with vectors. + +2002-05-02 Pierre Muller + + * config/m68k/tm-nbsd.h: Obvious fix, + correct machine name. + +2002-05-02 Pierre Muller + + * p-typeprint.c (pascal_type_print_base): Add support + for TYPE_CODE_STRING and TYPE_CODE_BITSTRING. + +2002-05-02 Pierre Muller + + * p-lang.c (pascal_create_fundamental_type): Use TYPE_CODE_CHAR + for fondamental pascal 'char' type. + +2002-05-02 Pierre Muller + + * p-lang.h (is_pascal_string_type): Declaration changed, + new sixth argument of type char ** added. + * p-lang.c (is_pascal_string_type): Implementation + changed. Args length_pos, length_size, string_pos, char_size + can now be NULL. New argument arrayname set to the field + name of the char array. Return value set to char array + field index plus one. + * p-valprint.c (pascal_val_print): Adapt to new declaration of + is_pascal_string_type function. + +2002-05-02 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Revert 2002-05-02 Andrew Cagney + change. + * gdbarch.c: Regenerate. + +2002-05-02 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Swap out the old architecture + before probing for a new one. Detect errorenous gdbarch_init + functions. + * gdbarch.c: Regenerate. + +2002-05-01 Andrew Cagney + + * config/mn10200/tm-mn10200.h: Include "symfile.h" and "symtab.h". + * config/mcore/tm-mcore.h: Ditto. Update copyright. + * config/v850/tm-v850.h: Ditto. Update copyright. + +2002-04-30 Andrew Cagney + + * cris-tdep.c (cris_gdbarch_init): Use arches instead of + current_gdbarch. + +2002-04-30 Michael Snyder + + * arm-tdep.c: Whitespace clean-ups. + (arm_skip_prologue): Fix thinko; two lines + should have been removed as part of 4/24 change. + +2002-04-30 Kevin Buettner + + * rs6000-tdep.c: Added comment describing how fpscr register + numbers were chosen. + +2002-04-30 Michael Snyder + + * gnu-nat.c (gnu_find_memory_regions): Fix merge botch. + +2002-04-29 Elena Zannoni + + * hpread.c (DNTT_TYPE_VECTOR): Rename from TYPE_VECTOR. + (DNTT_TYPE_VECTOR_LENGTH): Rename from TYPE_VECTOR_LENGTH. + (hpread_symfile_init, hpread_lookup_type): Substitute throughout. + +2002-04-29 Kevin Buettner + + From Louis Hamilton : + * rs6000-tdep.c (coff/xcoff.h, libxcoff.h): Include. + * xcoffread.c (coff/xcoff.h, libxcoff.h): Likewise. + * rs6000-tdep.c (rs6000_gdbarch_init): Use bfd_xcoff_is_xcoff64(), + not bfd-private xcoff data, to determine wordsize. + * xcoffread.c (read_xcoff_xymtab, read_symbol_lineno): Likewise. + +2002-04-29 Andrew Cagney + + GDB 5.2 released from 5.2 branch. + +2002-04-29 Michal Ludvig + + * x86-64-linux-nat.c (fill_gregset): Explicit cast to avoid warning. + * x86-64-tdep.c (i386_gdbarch_init): Ditto. + (x86_64_register_info_table): Added comments with register numbers. + +2002-04-29 Elena Zannoni + + * rs6000-tdep.c (rs6000_extract_return_value, + rs6000_store_return_value): Handle returning vectors. + (rs6000_gdbarch_init): Use + ppc_sysv_abi_broken_use_struct_convention for native sysv cases. + * ppc-linux-tdep.c (ppc_sysv_abi_broken_use_struct_convention): + New function. + (ppc_sysv_abi_use_struct_convention): Deal with functions returning + vectors. + (ppc_sysv_abi_push_arguments): Handle vector parameters. + * ppc-tdep.h (ppc_sysv_abi_broken_use_struct_convention): Export. + +2002-04-24 Pierre Muller + + * hpread.c (hpread_psymtab_to_symtab_1, + hpread_psymtab_to_symtab): Replace fprintf tab_to_s...) + with fprintf_unfiltered (gdb_stderr,...). + +2002-04-24 Pierre Muller + + * remote-array.c (printf_monitor, write_monitor, + array_insert_breakpoint, array_remove_breakpoint ): + Replace fprintf (stderr,... + with fprintf_unfiltered (gdb_stderr,.... + * remote-es.c: Likewise. + * remote-os9k.c: Likewise. + * remote-st.c: Likewise. + +2002-04-28 Andreas Schwab + + * config/s390/s390.mh (NATDEPFILES): Remove solib.o, add + linux-proc.o and gcore.o. + +2002-04-26 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging + code without frame pointers. + +2002-04-26 Andrew Cagney + + * sparc-tdep.c (sparc_gdbarch_init): Add comment explaining why + ON_STACK is needed. + +2002-04-26 Ben Elliston + + * target.c (do_xfer_memory): Correct reference to the new option + "trust-readonly-sections". + +2002-04-26 Elena Zannoni + + * gdbtypes.h (TYPE_FLAG_VECTOR, TYPE_VECTOR): Define. + * gdbtypes.c (recursive_dump_type): Output the vector flag. + * dwarf2read.c (dwarf_attr_name): Handle new attribute for + vectors. + (read_array_type): Record the fact that this array type is really a + vector (i.e. are passed in by value). + +2002-04-26 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member. + * alpha-tdep.c (alpha_sigcontext_addr): New function. + (alpha_find_saved_regs): Use alpha_sigcontext_addr. + (alpha_gdbarch_init): Initialize tdep->sigcontext_addr. + * alpha-linux-tdep.c: Include frame.h. + (alpha_linux_sigcontext_addr): New function. + (alpha_linux_init_abi): Set tdep->sigcontext_addr to + alpha_linux_sigcontext_addr. + * alpha-osf1-tdep.c: Include gdbcore.h. + (alpha_osf1_sigcontext_addr): New function. + (alpha_osf1_init_abi): Set tdep->sigcontext_addr to + alpha_osf1_sigcontext_addr. + * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove. + * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove. + +2002-04-26 Andrew Cagney + + * stack.c (selected_frame_level): + (select_frame): Do not set selected_frame_level. + * frame.h (selected_frame_level): Delete declaration. + +2002-04-26 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Only set + convert_from_func_ptr-addr when AIX / PowerOpen. + +2002-04-25 Andrew Cagney + + * valops.c (hand_function_call): Call + generic_save_call_dummy_addr. + * frame.h (generic_save_call_dummy_addr): Declare. + * blockframe.c (struct dummy_frame): Add fields call_lo and + call_hi. + (generic_find_dummy_frame): Check for PC in range call_lo to + call_hi instead of entry_point_address. + (generic_pc_in_call_dummy): Search the dummy frames for a PC in + the call_lo to call_hi range. Allow for DECR_PC_AFTER_BREAK. + (generic_save_call_dummy_addr): New function. + +2002-04-24 David S. Miller + + * sparc-tdep.c (sparc_gdbarch_skip_prologue): Kill, duplicates + sparc_skip_prologue. + (sparc_skip_prologue): Kill frameless_p arg, and use line number + information to find prologue when possible. + (sparc_prologue_frameless_p): Call examine_prologue directly. + (sparc_gdbarch_init): Update set_gdbarch_skip_prologue call. + * config/sparc/tm-sparc.h (sparc_skip_prologue): Update for killed + second argument. + (SKIP_PROLOGUE): Likewise. + +2002-04-25 Jason Thorpe + + * alpha-tdep.c (alpha_skip_prologue_internal): Remove + GDB_TARGET_HAS_SHARED_LIBS #ifdef and update comment to + indicate that the condition it was testing is always true. + * config/alpha/nm-linux.h (GDB_TARGET_HAS_SHARED_LIBS): Remove. + * config/alpha/nm-nbsd.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. + * config/alpha/nm-osf.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. + +2002-04-25 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add jb_pc and jb_elt_size members. + * alpha-linux-tdep.c (alpha_linux_init_abi): Initialize + tdep->jb_pc and tdep->jb_elt_size. + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Likewise. + * alphafbsd-tdep.c (alphafbsd_init_abi): Likewise. + * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise. + * alpha-nat.c (get_longjmp_target): Remove. + (JB_ELEMENT_SIZE): Ditto. + (JB_PC): Ditto. + * alpha-tdep.c (alpha_get_longjmp_target): New function. + (alpha_gdbarch_init): Default tdep->jb_pc to -1. If the + OS ABI sets jb_pc to a valid value, set gdbarch_get_longjmp_target + to alpha_get_longjmp_target. + (alpha_dump_tdep): Report tdep->jb_pc and tdep->jb_elt_size. + * config/alpha/nm-linux.h (GET_LONGJMP_TARGET): Remove. + * config/alpha/nm-osf.h (GET_LONGJMP_TARGET): Remove. + +2002-04-25 Andrew Cagney + + * README: Update to GDB 5.2. + +2002-04-25 Andrew Cagney + + * gdbarch.sh (LC_ALL): Set to `c'. + +2002-04-25 Theodore A. Roth + + * avr-tdep.c: Ran through gdb_indent.sh. + +2002-04-25 Theodore A. Roth + + * MAINTAINERS: Add myself as AVR maintainer. + * NEWS: Note new target avr. + +2002-04-25 Theodore A. Roth + + * Makefile.in: Add support for AVR target. + * configure.tgt: Add support for AVR target. + * avr-tdep.c: New file + * config/avr/avr.mt: New file. + +2002-04-25 Theodore A. Roth + + * MAINTAINERS: Add myself to write-after-approval. + +2002-04-24 Pierre Muller + + * f-lang.c (get_bf_for_fcn): Replace fprintf (stderr,... + with fprintf_unfiltered (gdb_stderr,.... + +2002-04-25 Pierre Muller + + Fix PR gdb/508. + * symfile.c (add_filename_language): Fix wrong xrealloc size argument. + +2002-04-25 Pierre Muller + + * p-exp.y: Also use new prev_lexptr variable + to improve error reporting. Based on Michael Snyder + 2002-04-24 dated patch to c-exp.y. + +2002-04-25 Jason Thorpe + + * alpha-tdep.c (alpha_breakpoint_from_pc): New function. + (alpha_gdbarch_init): Set gdbarch_breakpoint_from_pc to + alpha_breakpoint_from_pc. Set gdbarch_function_start_offset + to 0. + * config/alpha/tm-alpha.h: Remove forward decls of struct type + and struct value. + (FUNCTION_START_OFFSET): Remove. + (BREAKPOINT): Ditto. + +2002-04-25 Jason Thorpe + + * MAINTAINERS: Reflect that multi-arch is enabled for VAX. + * NEWS: Ditto. + +2002-04-24 Jason Thorpe + + * alpha-linux-tdep.c (alpha_linux_pc_in_sigtramp): New function. + (alpha_linux_init_abi): Set gdbarch_pc_in_sigtramp to + alpha_linux_pc_in_sigtramp. + * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): New function. + (alpha_osf1_init_abi): Set gdbarch_pc_in_sigtramp to + alpha_osf1_pc_in_sigtramp. + * alpha-tdep.c (alpha_osf_in_sigtramp): Remove. + * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): New function. + (alphafbsd_init_abi): Set gdbarch_pc_in_sigtramp to + alphafbsd_pc_in_sigtramp. + * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): New function. + (alphanbsd_init_abi): Set gdbarch_pc_in_sigtramp to + alphanbsd_pc_in_sigtramp. + * config/alpha/tm-alpha.h (IN_SIGTRAMP): Remove. + * config/alpha/tm-alphalinux.h (IN_SIGTRAMP): Remove. + +2002-04-24 Jason Thorpe + + * config/alpha/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. + +2002-04-24 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphanbsd-nat.c and + alphanbsd-tdep.c. + (alphanbsd-nat.o): New dependency list. + (alphanbsd-tdep.o): Ditto. + * NEWS: Note new native NetBSD/alpha configuration. + * alphanbsd-nat.c: New file. + * alphanbsd-tdep.c: Ditto. + * configure.host (alpha*-*-netbsd*): New host. + * configure.tgt (alpha*-*-netbsd*): New target. + * config/alpha/nbsd.mh: New file. + * config/alpha/nbsd.mt: Ditto. + * config/alpha/nm-nbsd.h: Ditto. + * config/alpha/tm-nbsd.h: Ditto. + +2002-04-24 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alpha-osf1-tdep.c. + (alpha-osf1-tdep.o): New dependency list. + * alpha-tdep.h (gdbarch_tdep): Add dynamic_sigtramp_offset + and skip_sigtramp_frame members. + * alpha-linux-tdep.c: Include gdbcore.h. + (alpha_linux_sigtramp_offset): Change return type to LONGEST. + (alpha_linux_init_abi): Initialize tdep->dynamic_sigtramp_offset. + * alpha-osf1-tdep.c: New file. + * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Moved to + alpha-osf1-dep.c. + (alpha_frame_past_sigtramp_frame): New function. + (alpha_dynamic_sigtramp_offset): Ditto. + (alpha_proc_desc_is_dyn_sigtramp): Ditto. + (alpha_set_proc_desc_is_dyn_sigtramp): Ditto. + (ALPHA_PROC_SIGTRAMP_MAGIC): Define. + (push_sigtramp_desc): Use alpha_set_proc_desc_is_dyn_sigtramp. + (after_prologue): Use alpha_proc_desc_is_dyn_sigtramp. + (find_proc_desc): Use alpha_dynamic_sigtramp_offset. + (alpha_frame_chain): Use alpha_frame_past_sigtramp_frame. + (alpha_init_extra_frame_info): Use alpha_proc_desc_is_dyn_sigtramp. + (alpha_pop_frame): Use alpha_proc_desc_is_dyn_sigtramp. + (alpha_gdbarch_init): Initialize tdep->dynamic_sigtramp_offset + and tdep->skip_sigtramp_frame. Set gdbarch_skip_trampoline_code + to find_solib_trampoline_target. + * config/alpha/alpha-osf1.mt (TDEPFILES): Add alpha-osf1-tdep.o. + * config/alpha/tm-alpha.h: Remove inclusion of regcache.h. + (SKIP_TRAMPOLINE_CODE): Remove. + (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (DYNAMIC_SIGTRAMP_OFFSET): Ditto. + (FRAME_PAST_SIGTRAMP_FRAME): Ditto. + * config/alpha/tm-alphalinux.h (PROC_DESC_IS_DYN_SIGTRAMP): Remove. + (PROC_SIGTRAMP_MAGIC): Ditto. + (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (DYNAMIC_SIGTRAMP_OFFSET): Ditto. + (FRAME_PAST_SIGTRAMP_FRAME): Ditto. + +2002-04-24 Jason Thorpe + + * NEWS: Note that Alpha targets are now multi-arch. + +2002-04-24 Michael Snyder + + * parser-defs.h (prev_lexptr): New external variable. + * parse.c (parse_exp_1): Set prev_lexptr to null before + calling the language-specific parser. + * c-exp.y (yylex): Set prev_lexptr to start of current token. + (yyerror): Use prev_lexptr in error reporting. + +2002-04-24 Daniel Jacobowitz + + * config/i386/tm-linux.h: Define FILL_FPXREGSET. + * gregset.h: If FILL_FPXREGSET is defined, provide + gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset. + * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET + is defined, call fill_fpxregset. + +2002-04-24 Roland McGrath + + * config/i386/i386gnu.mh (NATDEPFILES): Add core-regset.o here. + * i386gnu-nat.c [HAVE_SYS_PROCFS_H] + (supply_gregset, supply_fpregset): New functions. + + * gnu-nat.c (gnu_find_memory_regions): New function. + (init_gnu_ops): Set `to_find_memory_regions' hook to that. + (gnu_xfer_memory): Add a cast. + +2002-04-24 Michael Snyder + + * arm-tdep.c (arm_scan_prologue): Move "mov ip, sp" into the + loop. Add handling for "str lr, [sp, #-4]!" and for saves + of argument regs ("str r(0123), [r11, #-nn"]). + (arm_skip_prologue): Better handling for frameless functions. + Treat "mov ip, sp" as optional. Recognize "str lr, [sp, #-4]". + (arm_skip_prologue): Recognize str r(0123), [r11, #-nn]. + +Wed Apr 24 14:22:21 2002 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Add comment that NUM_REGS nor + NUM_PSEUDO_REGS can be used. + +2002-04-24 Andrew Cagney + + * arch-utils.h: Update copyright. + + * gdbarch.sh (PC_IN_SIGTRAMP): Add. + * gdbarch.h, gdbarch.c: Re-generate. + + * inferior.h (IN_SIGTRAMP): Delete definition. + * arch-utils.c (legacy_pc_in_sigtramp): New function. + * arch-utils.h (legacy_pc_in_sigtramp): Declare. + + * mips-tdep.c (mips_init_extra_frame_info): Use PC_IN_SIGTRAMP. + (mips_dump_tdep): Do not print value of IN_SIGTRAMP. + * hppa-tdep.c (pc_in_interrupt_handler): Use PC_IN_SIGTRAMP. + (find_proc_framesize): Ditto. + * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Ditto. + (alpha_init_extra_frame_info): Ditto. + * infrun.c (handle_inferior_event): Ditto. + (handle_inferior_event): Ditto. + (check_sigtramp2): Ditto. + * blockframe.c (create_new_frame): Ditto. + (get_prev_frame): Ditto. + * ppc-linux-tdep.c: Update comments. + * i386-linux-tdep.c: Update comments. + * breakpoint.c (bpstat_what): Update comment. + +2002-04-24 David S. Miller + + * i960-tdep.c (register_in_window_p): New function. + (i960_find_saved_register): Use it instead of + REGISTER_IN_WINDOW_P. + * config/i960/tm-i960.h (REGISTER_IN_WINDOW): Delete. + + * symtab.h (find_stab_function_addr): Kill extern. + * minsyms.c (find_stab_function_addr): Remove from here... + * dbxread.c: ... to here, and mark it static. + +2002-04-20 David S. Miller + + * sparc-tdep.c (sparc_pop_frame): Only need to allocate + SPARC_INTREG_SIZE * 16 bytes for reg_temp. + +2002-04-21 David S. Miller + + * remote-vxsparc.c (vx_read_register): Fix typo, we want + REGISTER_RAW_SIZE of SP_REGNUM not CORE_ADDR. + (vx_write_register): Likewise. + +2002-04-23 J. Brobecker + + * source.c (is_regular_file): New function. + (openp): Check wether file to open is a regular file + to avoid opening directories. + +2002-04-22 Jason Thorpe + + * findvar.c (extract_signed_integer): Cast printf argument + to suppress format warning. + (extract_unsigned_integer): Likewise. + * infcmd.c (registers_info): Likewise. + * top.c (get_prompt_1): Likewise. + * valops.c (value_assign): Likewise. + * valprint.c (print_decimal): Likewise. + +2002-04-22 H.J. Lu (hjl@gnu.org) + + * c-exp.y (typebase): Support + + [long|long long|short] [signed|unsigned] [int|] + + and + + signed [long|long long|short] int + +2002-04-22 Jason Thorpe + + * Makefile.in (vax-tdep.o): Add $(arch_utils_h), $(inferior_h), + and vax-tdep.h. + * vax-tdep.h: New file. + * vax-tdep.c: Include inferior.h, arch-utils.h, and vax-tdep.h. + Make several routines static. + (vax_get_saved_register): New function. + (vax_gdbarch_init): New function. + (_initialize_vax_tdep): Register vax_gdbarch_init. + * config/vax/tm-vax.h: Set GDB_MULTI_ARCH to GDB_MULTI_ARCH_PARTIAL. + Remove macros now under the control of gdbarch. + +2002-04-22 Michael Snyder + + * arm-tdep.c (arm_skip_prologue): Recognize "sub sp, sp, #nn". + Some whitespace and coding standards tweaks. + +2002-04-22 Jason Thorpe + + * vax-tdep.c: Include regcache.h. + (vax_call_dummy_words): New. + (sizeof_vax_call_dummy_words): New. + (vax_fix_call_dummy): New function. + (vax_saved_pc_after_call): Ditto. + * config/vax/tm-vax.h: Don't include regcache.h. + (SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call. + (CALL_DUMMY): Remove. + (CALL_DUMMY_WORDS): Define. + (SIZEOF_CALL_DUMMY_WORDS): Define. + (FIX_CALL_DUMMY): Use vax_fix_call_dummy. + +2002-04-18 Michael Snyder + + * arm-tdep.h: Change regnum defines to enums for ease of debugging. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_chain): New function. + (vax_push_dummy_frame): Ditto. + (vax_pop_frame): Ditto. + * config/vax/tm-vax.h (FRAME_CHAIN): vax_frame_chain. + (FRAMELESS_FUNCTION_INVOCATION): Use + generic_frameless_function_invocation_not. + (PUSH_DUMMY_FRAME): Use vax_push_dummy_frame. + (POP_FRAME): Use vax_pop_frame. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_store_struct_return): New function. + (vax_extract_return_value): Ditto. + (vax_store_return_value): Ditto. + (vax_extract_struct_value_address): Ditto. + * config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use + vax_store_struct_return. + (EXTRACT_RETURN_VALUE): Use vax_extract_return_value. + (STORE_RETURN_VALUE): Use vax_store_return_value. + (EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_saved_pc): New function. + (vax_frame_args_address_correct): Ditto. + (vax_frame_args_address): Ditto. + (vax_frame_locals_address): Ditto. + (vax_frame_num_args): Move code to be in proximity to + other frame-related functions. + * config/vax/tm-vax.h (INNER_THAN): Use core_addr_lessthan. + (FRAME_SAVED_PC): Use vax_frame_saved_pc. + (FRAME_ARGS_ADDRESS_CORRECT): Use vax_frame_args_address_correct. + (FRAME_ARGS_ADDRESS): Use vax_frame_args_address. + (FRAME_LOCALS_ADDRESS): Use vax_frame_locals_address. + +2002-04-22 H.J. Lu (hjl@gnu.org) + + * Makefile.in (FLAGS_TO_PASS): Add libdir, mandir, datadir and + includedir. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_init_saved_regs): New function. + * config/vax/tm-vax.h (FRAME_FIND_SAVED_REGS): Remove. + (FRAME_INIT_SAVED_REGS): New macro. + +2002-04-22 Jason Thorpe + + * MAINTAINERS: Reflect that the Alpha target has been multi-arch'd. + +2002-04-22 Jason Thorpe + + * alpha-nat.c (get_longjmp_target): Use ALPHA_* constants + where needed. + (fetch_osf_core_registers): Likewise. + (supply_gregset): Likewise. + +2002-04-22 J. Brobecker + + * symfile.h (get_section_index): Define. + * symfile.c (get_section_index): New function. + * mdebugread.c (SC_IS_SBSS): New macro. + (SC_IS_BSS): Return true for the scBss storage class only, as + the scSBss storage class refers to the .sbss section. + (parse_partial_symbols): Discard the symbols which associated + section does not exist. + Make sure to use the .sbss section index for symbols which + storage class is scBss, rather than using the .bss section index. + +2002-04-22 Jason Thorpe + + * vax-tdep.c: Update copyright years. + (vax_register_name): New function. + (vax_register_byte): Ditto. + (vax_register_raw_size): Ditto. + (vax_register_virtual_size): Ditto. + (vax_register_virtual_type): Ditto. + * config/vax/tm-vax.h: Update copyright years. + (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define. + (REGISTER_BYTE): Use vax_register_byte. + (REGISTER_RAW_SIZE): Use vax_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Use vax_register_virtual_size. + (REGISTER_VIRTUAL_TYPE): Use vax_register_virtual_type. + +2002-04-21 Andrew Cagney + + * config/sparc/tm-sparc.h (sparc_skip_prologue): Restore + declaration + * arc-tdep.c (arc_prologue_frameless_p): Fix syntax error. + +2002-04-21 David S. Miller + + * arch-utils.c (generic_prologue_frameless_p): Kill + SKIP_PROLOGUE_FRAMELESS_P code. + * config/arc/tm-arc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete + references. + (PROLOGUE_FRAMELESS_P, arc_prologue_frameless_p): New. + * arc-tdep.c (arc_prologue_frameless_p): Implement. + * config/arc/tm-sparc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete + references. + (PROLOGUE_FRAMELESS_P, sparc_prologue_frameless_p): New. + * sparc-tdep.c (sparc_prologue_frameless_p): Implement. + (sparc_gdbarch_init): Pass it to + set_gdbarch_prologue_frameless_p. + +2002-04-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphabsd-nat.c. + (alphabsd-nat.o): New dependency list. + +2002-04-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alpha-linux-tdep.c and + alphafbsd-tdep.c. + (alpha-linux-tdep.o): New dependency list. + (alphafbsd-tdep.o): Likewise. + +2002-04-21 Jason Thorpe + + * alpha-linux-tdep.c: New file. Move alpha_linux_sigtramp_offset + to here... + * alpha-tdep.c: ...from here. + * config/alpha/alpha-linux.mt (TDEPFILES): Add alpha-linux-tdep.o. + +2002-04-21 Jason Thorpe + + * config/alpha/tm-alpha.h: Move alpha_software_single_step + prototype from here... + * alpha-tdep.h: ...to here. + +2002-04-21 Andrew Cagney + + * frame.h (selected_frame_level): Document as deprecated. + (frame_relative_level): Declare. + * stack.c (frame_relative_level): New function. + (selected_frame_level): Document as deprecated. + (select_frame): Do not set the selected_frame_level. + + * stack.c (frame_info, record_selected_frame): Update. + (frame_command, current_frame_command): Update. + (up_silently_base, up_command, down_silently_base): Update. + (down_command): Update. + * inflow.c (kill_command): Update. + * tracepoint.c (finish_tfind_command): Update. + * corelow.c (core_open): Update. + * thread.c (info_threads_command): Update. + (do_captured_thread_select): Update. + * infcmd.c (finish_command): Update. + * breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update. + +2002-04-21 Jason Thorpe + + * config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Remove. + +2002-04-21 Andrew Cagney + + * arm-tdep.c (arm_breakpoint_from_pc): Make static. Make return + type const. + +2002-04-21 Jason Thorpe + + * alphafbsd-tdep.c: Update copyright years. Include + alpha-tdep.h. + (alphafbsd_use_struct_convention): Make static. + (alphafbsd_init_abi): New function. + (_initialize_alphafbsd_tdep): New function. + * config/alpha/tm-fbsd.h: Update copyright years. + (USE_STRUCT_CONVENTION): Remove. + +2002-04-21 Jason Thorpe + + * alpha-tdep.c (alpha_abi_handler): New structure to describe + an Alpha ABI variant. + (alpha_abi_handler_list): Declare. + (alpha_gdbarch_register_os_abi): New function. + (alpha_gdbarch_init): Give registered ABI variant handlers a + chance to tweak the gdbarch once we have set up defaults. + * alpha-tdep.h: Prototype alpha_gdbarch_register_os_abi. + +2002-04-21 Jason Thorpe + + * alpha-tdep.c (alpha_gdbarch_init): Set coerce_float_to_double + to standard_coerce_float_to_double. + * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Remove. + +2002-04-21 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add vm_min_address member. + * alpha-tdep.c (heuristic_proc_start): Use vm_min_address + from gdbarch_tdep rather than a constant. + (alpha_gdbarch_init): Initialize tdep->vm_min_address to + the default text address for all Alpha Unix ABIs. + (alpha_dump_tdep): Report the value of tdep->vm_min_address. + * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete. + +2002-04-21 Jason Thorpe + + * alpha-tdep.h: New file. Includes several Alpha target constants + taken from... + * config/alpha/tm-alpha.h: ...here. Remove macros that we now + let gdbarch deal with. + (GDB_MULTI_ARCH): Define as GDB_MULTI_ARCH_PARTIAL. + * Makefile.in (alpha-nat.o): Add alpha-tdep.h and $(BFD_SRC)/elf-bfd + to dependency list. + * alpha-nat.c: Include alpha-tdep.h. Update for adjusted + Alpha target register names. + * alphabsd-nat.c: Likewise. + * alpha-tdep.c: Include alpha-tdep.h. Update for adjusted + Alpha target register names. Make serveral routines static. + (alpha_get_saved_register): New function. + (alpha_abi_names): New. + (process_note_abi_tag_sections): New function. + (get_elfosabi): New function. + (alpha_gdbarch_init): New function. + (alpha_dump_tdep): New function. + (_initialize_alpha_tdep): Register alpha_gdbarch_init. + +2002-04-21 Andrew Cagney + + * frame.c (find_saved_register): Delete #ifdef + HAVE_REGISTER_WINDOWS code. + * config/sparc/tm-sparc.h: Update comments. + * config/i960/tm-i960.h (HAVE_REGISTER_WINDOWS): Delete macro. + +2002-04-21 Andrew Cagney + + * i960-tdep.c (i960_find_saved_register): New function. + (i960_get_saved_register): New function. + * config/i960/tm-i960.h (GET_SAVED_REGISTER): Define. + (i960_get_saved_register): Declare. + * config/i960/tm-i960.h, i960-tdep.c: Update copyright. + +2002-04-20 David S. Miller + + * sparc-nat.c (store-inferior_registers): Fix ambiguous else. + +2002-04-20 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs + instead of NUM_PSEUDO_REGS. + +2002-04-20 David S. Miller + + * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Define to + GDB_MULTI_ARCH_PARTIAL + * config/sparc/tm-sp64linux.h (GDB_MULTI_ARCH): Do not + define, let tm-sp64.h do it. + +2002-04-20 Jason Thorpe + + * frame.c (find_saved_register): Avoid a NULL pointer + dereference and actually walk the frame list. + +2002-04-20 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Keep the list of architectures + sorted in most most-recent-used order. Document. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-04-19 Andrew Cagney + + * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame + instead of ->prev. + * z8k-tdep.c (z8k_frame_chain): Do not use ->prev. + * s390-tdep.c (s390_frame_chain): Do not use ->prev. + * rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain() + instead of ->prev. + +2002-04-19 Elena Zannoni + + Fix PR gdb/471. + * gdbtypes.c (init_simd_type): Rewrite using new functions. + (build_builtin_type_vec128): Ditto. + (append_composite_type_field): Fix calculation of type length in + union case. + +2002-04-19 Eli Zaretskii + + * config/djgpp/README: Update. + + * go32-nat.c (store_register): Cast &a_tss to `char *' to avoid a + compiler warnings. + +2002-04-19 Jason Thorpe + + * alpha-tdep.c (setup_arbitrary_frame): Rename... + (alpha_setup_arbitrary_frame): ...to this. + * config/alpha/tm-alpha.h (SETUP_ARBITRARY_FRAME): Update + for alpha_setup_arbitrary_frame. + +2002-04-18 Andrew Cagney + + * gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer. + * gdbarch.h, gdbarch.c: Regenerate. + + * defs.h (breakpoint_from_pc_fn): Delete type definition. + * target.h (memory_breakpoint_from_pc): Update declaration. + * config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto. + + * arch-utils.c (legacy_breakpoint_from_pc): Update return type. + * mcore-tdep.c (mcore_breakpoint_from_pc): Ditto. + * mem-break.c (memory_breakpoint_from_pc): Ditto. + * rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto. + * s390-tdep.c (s390_breakpoint_from_pc): Ditto + * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto. + * mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto. + * mips-tdep.c (mips_breakpoint_from_pc): Ditto. + * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto. + * ia64-tdep.c (ia64_breakpoint_from_pc): Ditto. + * d10v-tdep.c (d10v_breakpoint_from_pc): Ditto. + * arch-utils.c (legacy_breakpoint_from_pc): Ditto.. + + * mem-break.c (default_memory_insert_breakpoint): Make `bp' a + const pointer. + * monitor.c (monitor_insert_breakpoint): Ditto. + * rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'. + + * config/mcore/tm-mcore.h: Update copyright. + * mem-break.c: Ditto. + * xstormy16-tdep.c: Ditto. + +2002-04-18 Pierre Muller + + * p-exp.y: Add precedence rule for '^' token. + This removes the shift/reduce conflicts. + Remove the comment concerning these shift/reduce conflicts. + +2002-04-18 Elena Zannoni + + * rs6000-tdep.c (COMMON_UISA_NOFP_REGS): New macro. + (registers_powerpc_nofp): New register set for processors + without floating point unit. + +2002-04-18 David S. Miller + + * MAINTAINERS: Add myself to write-after-approval. + +2002-04-17 Michael Snyder + + * MAINTAINERS: Add myself as co-maintainer of testsuite/gdb.asm. + +2002-04-17 Andrew Cagney + + * rs6000-tdep.c (frame_initial_stack_address): Use + frame_register_read to read the alloca_reg. + +2002-04-17 Andrew Cagney + + * frame.c (find_saved_register): Find saved registers in the next + not prev frame. + Fix PR gdb/365. + +2002-04-17 Andrew Cagney + + * gdbarch.sh (LANG): Set to ``c''. + +2002-04-15 Andrew Cagney + + * PROBLEMS: Mention hppa2.0-hp-hpux10.20 compile problems. + +2002-04-15 Andrew Cagney + + * bcache.c: Include and after "defs.h". + Update copyright. + + * hpread.c (hpread_get_lntt): Add declaration. + Also fix PR gdb/391. + +2002-04-14 Andrew Cagney + + * acinclude.m4 (AM_PROG_CC_STDC): Import from automake 1.6. + * aclocal.m4, configure: Re-generate. + Fix PR gdb/391. + +2002-04-14 Elena Zannoni + + * mi/mi-cmd-disas.c (dump_insns): Use TARGET_PRINT_INSN + instead of tm_print_insn. + +2002-04-14 Elena Zannoni + + * ppc-bdm.c (bdm_ppc_fetch_registers): Fix typo. + +2002-04-14 Andrew Cagney + + * config/pa/tm-hppa.h (FRAME_CHAIN_COMBINE): Delete macro. + * blockframe.c (FRAME_CHAIN_COMBINE): Delete macro. + (get_prev_frame): Do not call FRAME_CHAIN_COMBINE. + +2002-04-12 Don Howard + + * cli/cli-cmds.c (init_cli_cmds): Add new user settable value: + max_user_call_depth. + (init_cmd_lists): Initialize the new value; + * cli/cli-script.c (execute_user_command): Limit the call depth of + user defined commands. This avoids a core-dump when user commands + are infinitly recursive. + +2002-04-12 Kevin Buettner + + * ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''. + * rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset'' + from tdep struct instead of DEFAULT_LR_SAVE. + (rs6000_gdbarch_init): Initialize ``lr_frame_offset''. + * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete. + * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete. + +2002-04-12 Michael Snyder + + * Remote.c: Spelling fix. + * gcore.c (default_derive_heap_segment): Use bfd_section_name. + If no symbol found for "sbrk", try "_sbrk". + (make_output_phdrs): Use bfd_section_name. + (gcore_copy_callback): Use bfd_section_name. + * eval.c: Indentation fix-ups. + * d10v-tdep.c (d10v_make_iaddr): Make it idempotent, + in case it gets applied to an address that is already + in the instruction space. + * cli/cli-decode.c (help_list): Allow long lines to wrap. + * symfile.c: Fix indentation, long lines. + * source.c: White space fix-up. + +2002-04-12 Andrew Cagney + + * defs.h (read_relative_register_raw_bytes): Delete declaration. + * frame.c (frame_register_read): New function. Return non-zero on + success. + (read_relative_register_raw_bytes_for_frame): Delete. + (read_relative_register_raw_bytes): Delete. + * frame.h (frame_register_read): Declare. + * d30v-tdep.c: Update Copyright. Use frame_register_read. + * sh-tdep.c: Ditto. + * infcmd.c (do_registers_info): Ditto. + * hppa-tdep.c: Ditto. + * rs6000-tdep.c: Ditto. + * h8500-tdep.c: Ditto. + * mips-tdep.c: Ditto. + * h8300-tdep.c: Ditto. + * z8k-tdep.c: Ditto. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Use rs6000_* methods for + 64-bit SysV ABI. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from + bfd info. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (powerpc64, 630, rs64ii, rs64iii): Define + register sets for these processor variants. + +2002-04-11 Daniel Jacobowitz + + * regformats/reg-ppc.dat: Support FPSCR. + +2002-04-11 Kevin Buettner + + * ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''. + * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): + Add fpscr as an invalid/unfetchable register. + * ppc-linux-nat.c (ppc_register_u_addr, store_register) + (fetch_ppc_registers, store_ppc_registers, supply_fpregset) + (fill_fpregset): Add support for register fpscr. + (fetch_ppc_registers, store_ppc_registers, supply_gregset) + (fill_gregset): Account for the fact that register ``mq'' might + not exist. + * rs6000-tdep.c (PPC_UISA_SPRS): Use (unused) slot 70 for fpscr. + (registers_power): Add fpscr to register set at slot 71. + (rs6000_gdbarch_init): Account for the fact that ``mq'' doesn't + exist on most PPC architectures. Initialize ppc_fpscr_regnum. + +2002-04-11 Michael Snyder + + * configure.in: Autoconfiscate _SYSCALL32 define for solaris. + * configure: Regenerate. + * config.in: Regenerate. + * acconfig.h: Add define for _SYSCALL32. + * core-sol2.c: Remove #define _SYSCALL32. + * solib-legacy.c: Remove #define _SYSCALL32. + +2002-04-10 Andrew Cagney + + * stack.c (select_frame): Cleanup internal error message, do not + use %p. + +2002-04-10 Andrew Cagney + + * stack.c (select_frame): Check that selected_frame and the + specified level are as expected. + * blockframe.c (get_prev_frame): Set the `level' from next_frame. + Update copyright. + * frame.h (struct frame_info): Add field `level'. Update + copyright. + Work-in-progress PR gdb/464. + +2002-04-10 Andrew Cagney + + * maint.c (maint_print_section_info): Rename print_section_info. + (print_bfd_section_info, print_objfile_section_info): Update. + * inferior.h (struct gdbarch): Add opaque declaration. + * gdbarch.sh: Add include of "inferior.h" to gdbarch.sh. + * gdbarch.h: Regenerate. + +2002-04-10 Michal Ludvig + + * x86-64-linux-nat.c (child_resume, child_xfer_memory): Delete. + (PTRACE_XFER_TYPE): Moved to config/i386/nm-x86-64.h. + (kernel_u_size): Added. + * config/i386/nm-x86-64.h (CHILD_XFER_MEMORY, CHILD_RESUME): Delete. + (PTRACE_XFER_TYPE): Moved here from config/i386/nm-x86-64.h. + +2002-04-04 Jim Ingham + + * valarith.c (find_size_for_pointer_math): New function, either returns + the size for a pointer's target, returns 1 for void *, or errors for + incomplete types. + (value_add, value_sub): use find_size_for_pointer_math. + +2002-04-09 Daniel Jacobowitz + + * linux-low.c (linux_look_up_symbols): New hook. + (linux_target_ops): Add linux_look_up_symbols. + * remote-utils.c (decode_address): New function. + (look_up_one_symbol): New function. + * server.c (handle_query): Call target look_up_symbols hook. + * server.h (look_up_one_symbol): Add prototype. + * target.h (struct target_ops): Add look_up_symbols hook. + +2002-04-09 Andrew Cagney + + * frame.c (read_relative_register_raw_bytes_for_frame): Do not + override FP_REGNUM with frame->fp. Update copyright. + * parse.c (num_std_regs, std_regs): Delete. + (target_map_name_to_register): Do not search std_regs. Update + function description. + * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete + declarations. Update copyright. + Fix PR gdb/251. + +2002-04-09 Daniel Jacobowitz + + * symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer + after the last symbol in a block. + +2002-04-09 Pierre Muller + + * p-exp.y (yylex): Handle also the fact that is_a_field_of_this + is non zero as a found symbol. + +2002-04-08 Andrew Cagney + + * findvar.c: Include "builtin-regs.h". + (value_of_register): Call value_of_builtin_reg when applicable. + * parse.c: Include "builtin-regs.h" and "gdb_assert.h". + (target_map_name_to_register): Call + builtin_reg_map_name_to_regnum. + * Makefile.in (SFILES): Add builtin-regs.c and std-regs.c. + (COMMON_OBS): Add builtin-regs.o and std-regs.o. + (builtin_regs_h): Define. + (builtin-regs.o): New target. + (findvar.o): Add $(builtin_regs_h). + * builtin-regs.c, builtin-regs.h: New files. + * std-regs.c: New file. + Partial fix for PR gdb/251. + +2002-04-08 Kevin Buettner + + * rs6000-tdep.c (rs6000_gdbarch_init): Don't set tm_print_insn; + it's no longer required. + +2002-04-08 Andrew Cagney + + * Makefile.in (gdbtk-wrapper.o): Add missing dependencies. + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_software_single_step): Use + rs6000_breakpoint_from_pc() to fetch breakpoint instruction + and size. Use target_insert_breakpoint() and + target_remove_breakpoint() to insert and remove breakpoints + instead of explicit memory reads and writes. + +2002-04-08 Kevin Buettner + + * config/powerpc/tm-ppc-eabi.h (ELF_OBJECT_FORMAT): Delete. + * rs6000-tdep.c (rs6000_push_arguments): Eliminate + ELF_OBJECT_FORMAT ifdef. + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_print_insn(). + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_fix_call_dummy): Delete unused macro + definitions for TOC_ADDR_OFFSET and TARGET_ADDR_OFFSET. + +2002-04-07 Mark Kettenis + + * fbsd-proc.c (child_pid_to_exec_file, fbsd_find_memory_regions): + s/asprintf/xasprintf/. + (fbsd_make_corefile_notes): s/strdup/xstrdup/. + +2002-04-07 Andrew Cagney + + I believe Jeff Law denies responsability for this one: + * config/pa/hpux11w.mh (MH_CFLAGS): Add -Dvfork=fork. + * config/pa/hpux11.mh (MH_CFLAGS): Add -Dvfork=fork. + * config/pa/hpux1020.mh (MH_CFLAGS): Add -Dvfork=fork. + Work-around for PR gdb/366. + +2002-04-07 Elena Zannoni + + * remote-e7000.c (write_small, e7000_read_inferior_memory, + e7000_read_inferior_memory_large, e7000_insert_breakpoint, + e7000_remove_breakpoint): Use paddr_nz() to print addresses. + +2002-04-07 Elena Zannoni + + * sh-tdep.c (sh_fp_frame_init_saved_regs, + sh_nofp_frame_init_saved_regs): Use alloca() for 'where' + information. + +2002-04-07 Andrew Cagney + + * MAINTAINERS (Misc): List Daniel Jacobowitz as the GDBSERVER + maintainer. + +2002-04-07 Andrew Cagney + + * README (Reporting Bugs in GDB): Document the bug web page as the + prefered way of submitting bugs. + Fix PR gdb/402. + +2002-04-06 Andrew Cagney + + * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of + -1. Update comment. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-04-07 Andreas Schwab + + * m68klinux-nat.c (fill_fpregset): Properly pass address of + buffer to regcache_collect. + +2002-04-06 Andrew Cagney + + * gdbarch.sh (PS_REGNUM): Add. Document. Default to -1. + * gdbarch.c, gdbarch.h: Re-generate. + +2002-04-06 Andrew Cagney + + * symtab.c (lookup_symtab): Remove ``const'' from ``rp'' + declaration. Fix -Werror. + +2002-04-05 Daniel Jacobowitz + + * gdbarch.sh (initialize_non_multiarch): Call init_gdbarch_swap. + * gdbarch.c: Regenerate. + +2002-04-05 Michael Snyder + + * breakpoint.c (clear_command): Rewrite middle section to + combine two loops with identical control conditions. + Add a cleanup to eliminate a memory leak. + * cli/cli-dump.c (restore_section_callback): Use paddr_nz. + +2002-04-05 H.J. Lu (hjl@gnu.org) + + * solib-svr4.c (bkpt_names): Add "__start". + +2002-04-04 Andrew Cagney + + * sparc-tdep.c (sparc_push_dummy_frame): Use GDB_TARGET_IS_SPARC64 + as test for 64 bit target. + +2002-04-05 Andrew Cagney + + * h8500-tdep.c (h8500_write_fp): Delete function. + * dwarf2cfi.c (cfi_write_fp): Document as not used. + * mips-tdep.c (mips_gdbarch_init): Do not set write_fp. + * ia64-tdep.c (ia64_gdbarch_init): Do not set write_fp. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set write_fp. + * rs6000-tdep.c (rs6000_gdbarch_init): Do not set write_fp. + * s390-tdep.c (s390_gdbarch_init): Do not set write_fp. + (s390_write_fp): + * sh-tdep.c (sh_gdbarch_init): Do not set write_fp. + * x86-64-tdep.c (i386_gdbarch_init): Do not set write_fp. + * d10v-tdep.c (d10v_gdbarch_init): Do not set write_fp. + (d10v_write_fp): Delete function. + * inferior.h (write_fp, generic_target_write_fp): Delete + declarations. + * regcache.c (generic_target_write_fp): Delete function. + (write_fp): Delete function. + * gdbarch.sh (TARGET_WRITE_FP): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + * config/v850/tm-v850.h (TARGET_WRITE_FP): Delete macro. + * config/sparc/tm-sp64.h (TARGET_WRITE_FP): Delete macro. + (sparc64_write_fp): Delete declaration. + * config/h8500/tm-h8500.h (TARGET_WRITE_FP): Delete macro. + (h8500_write_fp): Delete declaration. + +2002-04-04 Andrew Cagney + + * sparc-tdep.c (sparc64_write_fp): Delete. + (sparc_push_dummy_frame): Replace write_fp call with code to store + the FP directly. + (sparc_gdbarch_init): Do not initialize write_fp. + +2002-04-05 Kevin Buettner + + * rs6000-tdep.c (skip_prologue): Eliminate unused/unreachable + clause. + +2002-03-29 Jim Blandy + + * stack.c (get_selected_block): Add new argument `addr_in_block', + used to return the exact code address we used to select the block, + not just the block. + * blockframe.c (get_frame_block, get_current_block): Same. + * frame.h (get_frame_block, get_current_block, + get_selected_block): Update declarations. + * linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c, + linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed. + +2002-04-05 Michael Snyder + + * breakpoint.c (insert_breakpoints): Change 'hw' to 'hardware in + warning message. + +2002-04-05 J. Brobecker + + * utils.c (xfullpath): New function. + * defs.h (xfullpath): Add declaration. + * source.c (openp): Use xfullpath in place of gdb_realpath to + avoid resolving the basename part of filenames when the + associated file is a symbolic link. This fixes a potential + inconsistency between the filenames known to GDB and the + filenames it prints in the annotations. + * symtab.c (lookup_symtab): Use the new xfullpath function, in order + to be able to match a filename with either the real filename, or + the name of any symbolic link to this file. + (lookup_partial_symtab): Ditto. + +2002-04-04 Michael Snyder + + * breakpoint.c: Add support for hardware breakpoints in overlays. + (overlay_events_enabled): New state variable. + (insert_breakpoints): Use overlay_events_enabled to decide + whether to attempt to set a breakpoint at the overlay load addr. + Handle bp_hardware_breakpoint as well as bp_breakpoint. + (remove_breakpoint): Use overlay_events_enabled to decide + whether breakpoints need to be removed from overlay load addr. + Handle bp_hardware_breakpoint as well as bp_breakpoint. + (bpstat_stop_status): Handle bp_hardware_breakpoint in overlays. + (create_overlay_event_breakpoint, enable_overlay_breakpoints, + disable_overlay_breakpoints): Update overlay_events_enabled. + +2002-04-04 Daniel Jacobowitz + + * dwarf2read.c (struct function_range): New. + (cu_first_fn, cu_last_fn, cu_cached_fn): New. + (check_cu_functions): New. + (read_file_scope): Initialize global function lists. + Call dwarf_decode_line after processing children. + (read_func_scope): Add to global function list. + (dwarf_decode_lines): Call check_cu_functions everywhere + record_line is called. Call record_line with a linenumber + of 0 to mark sequence ends. + +2002-04-04 Michal Ludvig + + * x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI + change sync with glibc. + +2002-04-03 Jim Blandy + + * configure.in: Call AC_C_INLINE. + * configure: Regenerated. + +2002-04-01 Daniel Jacobowitz + + * rs6000-tdep.c: Change #include of "bfd/libcoff.h" + and "bfd/libbfd.h" to "libcoff.h" and "libbfd.h". + +2002-03-31 Mark Kettenis + + * NEWS: Mention gcore support on FreeBSD/i386. + + * fbsd-proc.c: New file. + * config/i386/nm-fbsd.h (CHILD_PID_TO_EXEC_FILE): Define. + * config/i386/fbsd.mh (NATDEPFILES): Add gcore.o and fbsd-proc.o. + + * lin-lwp.c (child_wait): Check SAVE_ERRNO instead of ERRNO in + while statement. + +2002-03-29 Jim Blandy + + * cli/cli-dump.c (_initialize_cli_dump): Older GCC's tolerate + unescaped newlines in string literals, but newer ones don't. So + escape them. + +2002-03-26 Michael Snyder + Andrew Cagney + + * cli/cli-dump.c: New file. Dump memory to file, + restore file to memory. + * cli/cli-dump.h: New file. + * Makefile.in: Add rules, dependencies for cli-dump.o. + * NEWS: Mention new commands. + +2002-03-28 Michael Snyder + + * symfile.c (symbol_file_add): Move test for null symbols to later. + +2002-03-27 Andrew Cagney + + From veksler at il.ibm.com: + * utils.c (gdb_realpath): If canonicalize_file_name fails, return + the xstrduped original path. + Fix PR gdb/417. + +2002-03-27 Michael Snyder + + * breakpoint.c (_initialize_breakpoint): Clean up help string. + * infcmd.c (_initialize_infcmd): Ditto. + * language.c (_initialize_language): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * top.c (_init_main): Ditto. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + +2002-03-27 Elena Zannoni + + * rs6000-tdep.c (struct rs6000_framedata): Add fields for AltiVec + vector registers handling. + (skip_prologue): Handle new AltiVec instructions. Fill in new + fields of frame data. + (frame_get_saved_regs): Fill in information for AltiVec registers. + +2002-03-27 Jim Blandy + + * symtab.h (SYMBOL_INIT_MANGLED_NAME): Turn this macro's body into + a function; leave this macro here to invoke that function. + (symbol_init_mangled_name): Declaration for that function. + * symtab.c (symbol_init_mangled_name): New function. + +2002-03-27 Andrew Cagney + + * valarith.c: Replace strerror with safe_strerror. + * tracepoint.c: Ditto. + * lin-lwp.c: Ditto. + * go32-nat.c: Ditto. + * inflow.c: Ditto. + * gnu-nat.c: Ditto. + +2002-03-27 Andreas Schwab + + * event-top.c (command_line_handler): Remove useless if. + +2002-03-27 Andreas Jaeger + + * dwarf2cfi.c: Give credit to Daniel Berlin, reformat copyright + comment. + +2002-03-27 Michal Ludvig + + * x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines. + (x86_64_num_regs, x86_64_num_gregs): Added extern variables. + * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS. + (x86_64_linux_dr_get_status, supply_gregset), + (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs. + * x86-64-tdep.c (x86_64_register_raw_size_table): Delete. + (x86_64_register_info_table): Add. + (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add. + (x86_64_register_raw_size, x86_64_register_virtual_type), + (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new + general x86_64_register_info_table. + (i386_gdbarch_init): gdbarch_register_bytes is now set + dynamicaly during initialization. + * regformats/reg-x86-64.dat: Synced with changes to registers above. + * gdbserver/linux-x86-64-low.c: Ditto. + +2002-03-27 Daniel Jacobowitz + + * gdbserver/server.c (main): Call target_signal_to_host_p + and target_signal_to_host on signals received from the remote. + * gdbserver/remote-utils.c (prepare_resume_reply): Call + target_signal_from_host on signals sent to the remote. + * gdbserver/server.h: Add prototypes. Include "gdb/signals.h". + * gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}. + +2002-03-27 Daniel Jacobowitz + + * signals/signals.c: Include "server.h" in gdbserver build. + (target_signal_from_name): Don't use STREQ. + (_initialize_signals): Likewise. Don't include function in + gdbserver build. + +2002-03-27 Daniel Jacobowitz + + * signals.c: Moved to... + * signals/signals.c: Here. + * Makefile (signals.o): Update. + +2002-03-26 Jeff Law (law@redhat.com) + + * somread.c (som_symtab_read): Remove some commented out code and + updated related comments. Do not set the minimal symbol table to + mst_solib_trampoline for ST_ENTRY symbols with SS_LOCAL scope + in a dynamic executable. + * hppa-tdep.c (find_proc_framesize): Sanely handle the case + where we are unable to find the minimal symbol for the given + PC value. + +2002-03-25 Jeff Law (law@redhat.com) + + * linux-proc.c (read_mapping): Scan up to end of line for filename. + +2002-03-25 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Rewritten from scratch. + +2002-03-23 Andrew Cagney + + * command.h: Update copyright. + (struct cmd_list_element): Replace definition with opaque + declaration. + (enum cmd_types): Document that it will eventually be moved to + cli/cli-decode.h + (CMD_DEPRECATED, DEPRECATED_WARN_USER): Delete macros. + (MALLOCED_REPLACEMENT): Delete macro. + * Makefile.in (cli_decode_h): Add $(command_h). + (top.o, completer.o, maint.o): Add dependency on $(cli_decode_h). + * top.c: Include "cli/cli-decode.h". + * completer.c: Include "cli/cli-decode.h". + * maint.c: Include "cli/cli-decode.h". + * cli/cli-decode.h: Include "command.h". + (enum command_class): Delete. + (enum cmd_types): Comment out. + (enum cmd_auto_boolean): Delete. + (enum var_types): Delete. + +2002-03-23 Andrew Cagney + + * cli/cli-decode.c: Include "gdb_assert.h". + (add_set_or_show_cmd): New static function. + (add_set_cmd): Rewrite. Use add_set_or_show_cmd. + (add_show_from_set): Rewrite. Use add_set_or_show_cmd. Don't copy + all fields, such as func, from the set command. + +2002-03-23 Andrew Cagney + + * MAINTAINERS (sh-elf): Change warning flag to -w. + +2002-03-23 Andrew Cagney + + * defs.h (error): Add printf format attribute. + * thread-db.c (thread_from_lwp): Fix error format string. + * stack.c (parse_frame_specification): Ditto. + * cli/cli-decode.c (undef_cmd_error): Ditto. + * scm-lang.c (scm_lookup_name): Ditto. + * tracepoint.c (trace_error): Ditto. + * remote-utils.c (usage): Ditto. + * remote.c (compare_sections_command): Ditto. + Fix PR gdb/328. + +2002-03-22 Andrew Cagney + + * gdbtypes.c (append_composite_type_field): New function. + (init_composite_type): New function. + * gdbtypes.h (append_composite_type_field): Declare. + (init_composite_type): Ditto. + +2002-03-22 Elena Zannoni + + * ppc-linux-tdep.c (ppc_sysv_abi_use_struct_convention): New + function. + * ppc-tdep.h (ppc_sysv_abi_use_struct_convention): Export. + * rs6000-tdep.c (rs6000_gdbarch_init): Use different + structure returning convention for SYSV ABI case, but not + for GNU/Linux, FreeBSD, or NetBSD. + +2002-03-22 Daniel Jacobowitz + + * symtab.h (lookup_block_symbol): Add mangled_name argument + to prototype. + + * symmisc.c (maintenance_check_symtabs): Call lookup_block_symbol + with new mangled_name argument. + * linespec.c (decode_line_1): Likewise. + * valops (value_of_this): Likewise. + * symtab.c (lookup_transparent_type): Likewise. + (lookup_symbol_aux): Likewise. Accept new mangled_name argument. + (lookup_symbol): If we are given a mangled name, pass it down + to lookup_symbol_aux. + (lookup_block_symbol): If we are given a mangled name to check + against, only return symbols which match it. + +2002-03-22 Christopher Faylor + + * win32-nat.c (child_create_inferior): Check for proper shell to use + here, in case the user changes it on the fly. + (_initialize_inftarg): Remove shell path considerations. + +2002-03-21 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Use correct max size value + for gdbarch_max_register_raw_size and max_register_virtual_size. + Adjust copyright year. + +2002-03-21 Daniel Jacobowitz + + * dbxread.c (process_one_symbol): Extend the first N_SLINE + in a function to cover the entire beginning of the function + as well if it does not already. + +2002-03-21 Tom Rix + + * rs6000-nat.c (rs6000_ptrace32): Renamed from ptrace32. + (rs6000_ptrace64): Renamed from ptrace64. + +2002-03-20 Martin M. Hunt + + * gdbserver/remote-utils.c (remote_open): Don't call + getprotobyname, we're all using TCP here so just use + IPPROTO_TCP. + * gdbserver/gdbreplay.c (remote_open): Ditto. + +2002-03-20 Martin M. Hunt + + * regcache.c (_initialize_regcache): No need to call + build_regcache() at this time; it gets called whenever + the gdbarch changes. + +2002-03-20 David O'Brien + + * sparc-nat.c: Include sys/param.h where possible. + +2002-03-20 Daniel Jacobowitz + + Fix PR gdb/422. + * c-lang.c (c_create_fundamental_type): Handle FT_COMPLEX, + FT_DBL_PREC_COMPLEX, and FT_EXT_PREC_COMPLEX. + * dwarf2read.c (read_base_type): Set TYPE_TARGET_TYPE for + complex types. + * stabsread.c (rs6000_builtin_type): Likewise. + (read_sun_floating_type): Likewise. + +2002-03-19 Peter Schauer + + * stabsread.c (read_member_functions): Remove skip code for duplicate + constructor/destructor methods. Use standard parsing for these + methods and just do not chain them to the list of methods after + parsing. + +2002-03-19 Alexandre Oliva + + * coffread.c: Remove redundant static declarations. Replace + occurrences of `PTR' with `void *'. + * elfread.c, mdebugread.c, minsyms.c, mipsread.c: Likewise. + * top.h (quit_cover): Likewise. + * defs.h (catch_errors): Likewise. + +2002-03-18 Andrew Cagney + + * defs.h (XMALLOC): Define. + * gdb-events.sh (XMALLOC): Delete macro. + * gdb-events.c, gdb-events.h: Regenerate. + * gdbarch.sh (XMALLOC): Delete macro. + * gdbarch.c: Regenerate. + * serial.c (XMALLOC): Delete macro. + * ui-file.c (XMALLOC): Ditto. + * ser-unix.h (XMALLOC): Ditto. + * sh-tdep.c (XMALLOC): Ditto. + * ui-out.c (XMALLOC): Ditto. + * utils.c (XMALLOC): Ditto. + * i386-tdep.c (XMALLOC): Ditto. + * gdb-events.c (XMALLOC): Ditto. + * d10v-tdep.c (XMALLOC): Ditto. + * cli-out.c (XMALLOC): Ditto. + + * cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright. + * gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto. + * ui-file.c, ui-out.c: Ditto. + +2002-03-18 Andrew Cagney + + * command.h (struct cmd_list_element): Add field context. + (set_cmd_context, get_cmd_context): Declare. + * cli/cli-decode.h: Ditto. + * cli/cli-decode.c (get_cmd_context): New function. + (set_cmd_context): New function. + (add_cmd): Initialize context. + Part of fixing PR gdb/145 and PR gdb/146. + +2002-03-17 Andrew Cagney + + * cli/cli-decode.c (cmd_type): New function. + * command.h (cmd_type): Declare. + * infrun.c (set_schedlock_func): Call function cmd_type. + * kod.c (kod_set_os): Call cmd_type. + * cris-tdep.c (cris_version_update): Use function cmd_type. + (cris_mode_update, cris_abi_update): Ditto. + + * command.h: (execute_cmd_post_hook): Declare. + (execute_cmd_pre_hook): Declare. + * cli/cli-script.c (clear_hook_in_cleanup): New function. + (execute_cmd_post_hook, execute_cmd_pre_hook): New + functions. Execute pre/post hook while ensuring that afterwords + hook_in is cleared. + * top.c (execute_command): Use execute_cmd_post_hook, and + execute_cmd_pre_hook to execute pre/post commands. + * infrun.c (normal_stop): Pass stop_command and not pre_hook to + hook_stop_stub. + (hook_stop_stub): Call execute_cmd_pre_hook. + +2002-03-17 Andrew Cagney + + * kod.c (kod_set_os): Revert previous change. Is called by ``info + set'' and this leads to a core dump. Move xstrdup of + operating_system to after check that it is not NULL. + +2002-03-17 Andrew Cagney + + * kod.c (kod_set_os): Remove unnecessary check that + ``command->type'' is set_cmd. + + * valprint.c (set_input_radix): Use input_radix. + (set_output_radix): Use output_radix. + (set_input_radix_1, set_output_radix_1): Add FIXME - bad radix + isn't reverted. + +2002-03-16 Andrew Cagney + + * value.h (struct value): Delete field ``substring_addr''. Change + aligner fields to force_doublest_align, force_longest_align, + force_core_addr_align and force_pointer_aligh. + + * value.h (struct value): Fix typo in above change. + +2002-03-16 Peter Schauer + + * ia64-tdep.c (ia64_gdbarch_init): Call set_gdbarch_frame_args_skip, + to fix internal_error from ``maintenance print architecture''. + +2002-03-16 Peter Schauer + + * cp-valprint.c (cp_is_vtbl_ptr_type): Handle vtbl field type + for gcc versions after gcc-2.8.1. + +2002-03-16 Peter Schauer + + * eval.c (evaluate_subexp_standard): Fix setup of ``this'' pointer + for method resolution. Restore adjustment of ``this'' pointer after + calling value_struct_elt, which was accidentally removed during the + HP merge. + +2002-03-15 Andrew Cagney + + * eval.c (evaluate_subexp_standard): Pass ``selected_frame'' to + value_of_register. + * findvar.c (value_of_register): Add ``frame'' parameter. Pass to + get_saved_register. + * value.h (value_of_register): Update. + +2002-03-14 Richard Henderson + + * configure.in: Detect declaration for canonicalize_file_name. + * utils.c (canonicalize_file_name): Declare, if needed. + (gdb_realpath): Prefer realpath if available and usable. + * config.in, configure: Rebuild. + +2002-03-14 Richard Henderson + + * dwarf2read.c (read_array_type): Accept DW_FORM_data8 as + a constant array bound. + + * MAINTAINERS: Add myself to write-after-approval. + +2002-03-14 Michael Snyder + + * symfile.c (syms_from_objfile): Return immediately if no syms. + (symbol_file_add): Return immediately if no syms. + (find_sym_fns): Return immediately if no syms. + +2002-03-13 Michal Ludvig + + * gdbserver/remote-util.c (remote_open): Print remote-side's + IP address when remote debugging over the network. + +2002-03-12 David O'Brien + + * config/sparc/fbsd.mh: Fix copyright. + * config/sparc/fbsd.mt: Likewise. + +2002-03-11 Richard Earnshaw + + * MAINTAINERS: Fix typo in name of gdb warnings option. + (x86-64): Fix formating so that this can be parsed by awk. + +2002-03-10 Daniel Jacobowitz + + * Makefile.in (defs_h): Add $(INCLUDE_DIR)/gdb/signals.h. + * defs.h: Include "gdb/signals.h". + (enum target_signal): Move to $(INCLUDE_DIR)/gdb/signals.h. + +2002-03-10 Michal Ludvig + + * x86-64-tdep.h (sys/reg.h, x86_64_regmap): Moved to x86-64-linux-nat.c + * x86-64-linux-nat.c (sys/reg.h, x86_64_regmap): Moved here + from x86-64-tdep.h + +2002-03-10 Daniel Jacobowitz + Don Howard + + * mips-tdep.c (ST0_FR): Define. + (mips2_fp_compat): New function, temporarily disabled. + (mips_read_fp_register_single): New function. + (mips_read_fp_register_double): New function. + (mips_print_register): Use them. + (do_fp_register_row): Likewise. + +2002-03-09 Andrew Cagney + + * MAINTAINERS: Add Jim Ingham and Klee Dienes to ``write after + approval''. + +2002-03-08 Peter Schauer + + * stabsread.c (read_member_functions): Fix is_stub test for + static member functions, improve comment. + +2002-03-07 Richard Earnshaw + + * remote-rdi.c (myprint): Replace 'PTR' with 'void *'. + (mywrite, mywritec, mypause, myreadc, mygets): Likewise. + (_initialize_remote_rdi): Use add_set_boolean_cmd to register + commands that set boolean values. + (arm_rdi_remove_breakpoint): Rewrite to avoid uninitialized warning. + (arm_rdi_resume): Always initialize PC. + (arm_rdi_open): Don't use rslt as a boolean. + (arm_rdi_create_inferior, arm_rdi_close, arm_rdi_resume) + (arm_rdi_fetch_registers, arm_rdi_store_registers) + (arm_rdi_xfer_memory, arm_rdi_files_info, arm_rdi_kill) + (arm_rdi_insert_breakpoint, arm_rdi_remove_breakpoint): Likewise. + +2002-03-06 Alexandre Oliva + + * configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX. + * configure: Rebuilt. + +2002-03-06 Stephane Carrez + + * m68hc11-tdep.c (_initialize_m68hc11_tdep): Don't set tm_print_insn. + (m68hc11_gdbarch_init): But use set_gdbarch_print_insn instead. + +2002-03-06 Andrew Cagney + + * cli/cli-decode.c (set_cmd_completer): New function. + * command.h (set_cmd_completer): Declare. + * cli/cli-decode.h (set_cmd_completer): Ditto. + + * breakpoint.c (_initialize_breakpoint): Use set_cmd_completer. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + * win32-nat.c (_initialize_inftarg): Ditto. + * remote-rdi.c (_initialize_remote_rdi): Ditto. + * proc-api.c (_initialize_proc_api): Ditto. + * hppa-tdep.c (_initialize_hppa_tdep): Ditto. + * source.c (_initialize_source): Ditto. + * exec.c (_initialize_exec): Ditto. + * solib.c (_initialize_solib): Ditto. + * top.c (init_main): Ditto. + * tracepoint.c (_initialize_tracepoint): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * printcmd.c (_initialize_printcmd): Ditto. + * infcmd.c (_initialize_infcmd): Ditto. + * corefile.c (_initialize_core): Ditto. + +2002-03-05 Andrew Cagney + + * MAINTAINERS (Past Maintainers): Add Frank Ch. Eigler. + +2002-03-05 Andrew Cagney + + * MAINTAINERS: Fix Mac OS X and Objective-C/C++. + +2002-03-05 Andrew Cagney + + * NEWS: Update headings, 5.2 has branched. + +2002-03-04 Daniel Jacobowitz + + * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long. + (num_regs, regmap): Move inside HAVE_LINUX_USRREGS. + (register_addr, REGISTER_RAW_SIZE): Likewise. + (usr_store_inferior_registers): Use PTRACE_XFER_TYPE. + * gdbserver/linux-x86-64-low.c: Remove extra #endif. + +2002-03-03 Michal Ludvig + + * MAINTAINERS (x86-64): Add myself. + * x86-64-tdep.c (x86_64_push_arguments): Fixed typo naregs->nregs, + changed value_ptr -> struct value * + +2002-03-01 David O'Brien + + * configure.host (sparc64-*-freebsd): Add. + * configure.tgt: Likewise. + * config/sparc/fbsd.mh: New file. + * config/sparc/fbsd.mt: Likewise. + * config/sparc/nm-fbsd.h: Likewise. + * config/sparc/tm-fbsd.h: Likewise. + +2002-03-01 Daniel Jacobowitz + + * config/djgpp/fnchange.lst: Add regformats/reg-i386-linux.dat and + regformats/reg-s390x.dat. + +2002-03-01 Andrew Cagney + + * utils.c: Add FIXME explaining true/false problem. + +2002-02-28 Andrew Cagney + + * MAINTAINERS (Past Maintainers): Add J.T. Conklin. + +2002-02-28 Michael Chastain + + * MAINTAINERS: Fix typo: gdb.satbs -> gdb.stabs . + +2002-02-28 Daniel Jacobowitz + + * gdbserver/linux-s390-low.c: New file. + * regformats/reg-s390.dat: New file. + * regformats/reg-s390x.dat: New file. + * gdbserver/configure.srv: Add S/390. + * gdbserver/Makefile.in: Add S/390. + * configure.tgt: Enable gdbserver for S/390. + +2002-02-28 Eli Zaretskii + + * go32-nat.c (_initialize_go32_nat): Don't use periods in the + first line of the doc string for "info dos", except at the end of + the sentence, since the short help stops at the first period. + +2002-02-28 Jason Merrill + + * dwarf2read.c (dwarf_cfi_name): Add new codes. + +2002-02-27 Fred Fish + + * blockframe.c (generic_fix_call_dummy): Fix obvious typo in + comment (dumy -> dummy). + +2002-02-27 Peter Schauer + + * symtab.c (gdb_mangle_name): Handle fully mangled v3 abi physnames. + +2002-02-27 Rodney Brown + + * utils.c (gdb_realpath): Add pathconf fallback for sco3.2v5. + +2002-02-27 Daniel Jacobowitz + + * gdbserver/acconfig.h: New file. + * gdbserver/i387-fp.c: New file. + * gdbserver/i387-fp.h: New file. + * gdbserver/linux-x86-64.c: New file. + * regformats/reg-x86-64.dat: New file. + * configure.tgt: Add x86_64-*-linux* gdbserver support. + * gdbserver/configure.srv: Add x86_64-*-linux* and regset support. + * gdbserver/configure.in: Add support for regsets. + * gdbserver/config.in: Regenerate. + * gdbserver/configure: Regenerate. + * gdbserver/Makefile.in: Likewise. Add $(linux_low_h). + * gdbserver/linux-low.h: New file. + * gdbserver/linux-low.c: Include "linux-low.h". Add support + for regsets. + * gdbserver/linux-arm-low.c: Include "linux-low.h". + * gdbserver/linux-ia64-low.c: Include "linux-low.h". + * gdbserver/linux-m68k-low.c: Include "linux-low.h". + * gdbserver/linux-mips-low.c: Include "linux-low.h". + * gdbserver/linux-ppc-low.c: Include "linux-low.h". + * gdbserver/linux-sh-low.c: Include "linux-low.h". + * gdbserver/linux-i386-low.c: Include "linux-low.h". Include + "i387-fp.h". Add PTRACE_GETREGS and friends. + * gdbserver/regcache.c (supply_register): New function. + (supply_register_by_name): New function. + (collect_register): New function. + (collect_register_by_name): New function. + +2002-02-27 Daniel Jacobowitz + + * gdbserver/Makefile.in (INTERNAL_CFLAGS): Remove -DGDBSERVER. + (config.status): Add configure.srv dependency. + (server_h): Add config.h dependency. + +2002-02-27 Daniel Jacobowitz + + * regformats/reg-i386-linux.dat: New file, with $orig_eax. + * gdbserver/Makefile.in: Add rules for reg-i386-linux.o. + * gdbserver/configure.srv: Change i386-*-linux* to use + reg-i386-linux.o. + +2002-02-26 Andrew Cagney + + * x86-64-tdep.c: Re-indent. Update copyright date. + +2002-02-26 Andrew Cagney + + From Michal Ludvig : + * x86-64-tdep.c (value.h): Delete. + (gdb_assert.h): Include. + (x86_64_register_convert_to_virtual, + x86_64_register_convert_to_raw ): Add check which lets only + floating-point values to be converted. + (value_push): Delete. + (x86_64_push_arguments): Order of arguments pushed on stack fixed. + (i386_gdbarch_init): Number of register_bytes fixed. + +2002-02-26 Andrew Cagney + + * MAINTAINERS: Add x86-64 target. + +2002-02-26 Andrew Cagney + + * memattr.c (mem_command): Eliminate ``true'' and ``false''. + * osfsolib.c (solib_map_sections): Ditto. + * irix5-nat.c (solib_map_sections): Ditto. + * corelow.c (gdb_check_format): Ditto. + * symfile.c (symfile_bfd_open): Ditto. + * solib.c (solib_map_sections): Ditto. + Fix PR gdb/354. + +2002-02-26 Andrew Cagney + + * remote.c (_initialize_remote): By default, disable ``e'' and + ``E'' step out-of-range packets. + +2002-02-26 Andreas Schwab + + * config/m68k/tm-linux.h (FRAME_SAVED_PC): Define as + m68k_linux_frame_saved_pc. + (IN_SIGTRAMP): Define as m68k_linux_in_sigtramp instead of + in_sigtramp. + (SIGCONTEXT_PC_OFFSET): Remove. + * m68klinux-nat.c (m68k_linux_frame_saved_pc, + m68k_linux_sigtramp_saved_pc): New functions. + (IS_SIGTRAMP, IS_RT_SIGTRAMP): Define. + (SIGCONTEXT_PC_OFFSET): Moved here from config/m68k/tm-linux.h. + (UCONTEXT_PC_OFFSET): Define. + (m68k_linux_in_sigtramp): Renamed from in_sigtramp, handle both + non-RT and RT signal trampolines. + +2002-02-26 Richard Earnshaw + + * config/arm/tm-embed.h (TARGET_UPAGES): Delete. + (TARGET_NBPG, STACK_END_ADDR): Delete + (VARIABLES_INSIDE_BLOCK): Delete. + +2002-02-25 Andrew Cagney + + * utils.c (perror_with_name): Make string parameter constant. + (print_sys_errmsg): Ditto. + (query): Ditto. + * defs.h (perror_with_name): Update. + (print_sys_errmsg): Update. + (query): Update. + +2002-02-25 Daniel Jacobowitz + + From Eliot Dresselhaus : + * gdbserver/linux-mips-low.c (cannot_fetch_register): Fix typo. + +2002-02-25 Peter Schauer + + * rs6000-nat.c (set_host_arch): Do not switch to a new architecture + if it already matches the current architecture from the exec file. + Include arch-utils.h for gdbarch_info_init prototype. + * Makefile.in (rs6000-nat.o): Update dependencies. + +2002-02-25 Eli Zaretskii + + * config/djgpp/djconfig.sh: Set NM=nm and CFLAGS="-g -O2" in the + list of exported variables. + +2002-02-24 Daniel Jacobowitz + + * gdbserver/configure.srv: New file. + * gdbserver/configure.in: Use configure.srv instead + of the host/target makefile fragments. Set GDBSERVER_DEPFILES + from it. + * gdbserver/configure: Regenerated. + * gdbserver/terminal.h: New file. + * gdbserver/Makefile.in: Update for configure changes. Remove + more unneeded include paths. + +2002-02-24 Andrew Cagney + + From wiz at danbala: + * config/sparc/tm-sp64.h: Fix grammar and typos. + Fix PR gdb/287. + +2002-02-24 Andrew Cagney + + * lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux'' + with either ``GNU/Linux'' or ``Linux kernel''. Update copyright. + * m68klinux-nat.c, sparc-linux-nat.c, x86-64-linux-nat.c: Ditto. + * x86-64-linux-tdep.c, gregset.h, gdb_wait.h: Ditto. + * ia64-linux-nat.c, infrun.c, linux-proc.c: Ditto. + * proc-service.c, i386-linux-tdep.c, ppc-linux-tdep.c: Ditto. + * s390-tdep.c: Ditto. + * config/nm-linux.h, config/alpha/nm-linux.h: Ditto. + * config/alpha/tm-alpha.h, config/alpha/tm-alphalinux.h: + * config/alpha/xm-alphalinux.h, config/i386/nm-linux.h: Ditto. + * config/i386/nm-x86-64.h, config/i386/tm-linux.h: Ditto. + * config/m68k/tm-linux.h, config/mips/nm-linux.h: Ditto. + * config/mips/tm-linux.h, config/mips/xm-linux.h: Ditto. + * config/powerpc/tm-linux.h, config/s390/nm-linux.h: Ditto. + * config/s390/tm-linux.h, config/sh/tm-linux.h: Ditto. + * config/sparc/nm-linux.h, config/sparc/tm-linux.h: Ditto. + * config/sparc/tm-sp64linux.h, config/sparc/xm-linux.h: Ditto. + Fix PR gdb/378. + +2002-02-23 Andrew Cagney + + * lin-thread.c: Delete file. + * configure.in (gdb_cv_struct_reg_r_gs): Update comment to refer + to gdb_proc_service.h. + * configure: Re-generate. + + * ocd.c (ocd_open): Do not try to open the "ocd" device. + * serial.c (serial_open): Delete check for "ocd". + Fix PR gdb/349. + + * Makefile.in (linux-thread.o): Delete target. + * linux-thread.c: Delete file. + + * config/djgpp/fnchange.lst: Rename bfd/elf32-sh64.c. Tweak other + renamed SH files to be consistent. + + * symtab.c (sort_search_symbols): Use xfree. + +2002-02-23 Richard Earnshaw + + * arm-linux-tdep.c (arm_linux_init_abi): Register + IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE + * config/arm/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE): Replace old + definition with undef, since we don't want the sysvr4 definition. + (SKIP_TRAMPOLINE_CODE): Likewise. + +2002-02-23 Andrew Cagney + + From 2002-02-22 Alfred M. Szmidt : + + * configure.in: (AC_CHECK_FUNCS) Added test for + canonicalize_file_name Regenerated. + * config.in, configure: Regenerated. + * utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is + defined use canonicalize_file_name. + +2002-02-23 Michael Chastain + + * MAINTAINERS: Remove Michael Chastain from "paper trail" list. + +2002-02-23 Andrew Cagney + + * README: Remove references to cygnus.com. + * MAINTAINERS: Change Past Maintainer addresses to ``foo at bar + dot com'' form. Remove references to cygnus.com and sourceware. + +2002-02-23 Andrew Cagney + + From 2002-02-19 Paul Eggert : + * Makefile.in (VER): Change "head -1" to "sed q", since POSIX + 1003.1-2001 no longer allows "head -1". + * gdb/Makefile.in (version.c): Likewise. + * gdb/doc/Makefile.in (GDBvn.texi): Likewise. + * gdb/CONTRIBUTE: Change "diff -c3" to "diff -c", which is + equivalent. POSIX 1003.1-2001 no longer allows "diff -c3". + +2002-02-23 Andrew Cagney + + * cli/cli-decode.c (cmd_cfunc_eq): New function. + * command.h (cmd_cfunc_eq): Declare. + * cli/cli-decode.h (cmd_cfunc_eq): Ditto. + + * cli/cli-cmds.h (is_complete_command): Change parameter to a + ``struct cmd_list_element *''. + * cli/cli-cmds.c (is_complete_command): Update. Use + cmd_cfunc_eq. + * top.c (execute_command): Pass the command to + is_complete_command. + * tracepoint.c: Replace function.cfunc with cmd_cfunc_eq. + +2002-02-23 Andrew Cagney + + From 2002-02-20 Martin Schwidefsky : + * config/s390/tm-s390.h (GDB_TARGET_IS_ESAME): Use renamed + architecture defines. + * s390-tdep.c (s390_gdbarch_init): Likewise. + +2002-02-23 Richard Earnshaw + + * arm-linux-tdep.c (arm_linux_extract_return_value): Make static. + (arm_linux_push_arguments): Likewise. + (arm_linux_init_abi): Register them. Also register linux-specific + call_dummy_words. + (find_minsym_and_objfile): Use strcmp, not STREQ. + * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Delete. + (arm_linux_call_dummy_words): Delete declaration. + (EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS): Delete. + (arm_linux_extract_return_value, arm_linux_push_arguments): Delete + declarations. + (LOWEST_PC): Delete. + +2002-02-23 Peter Schauer + + * maint.c (print_section_info): Do not prepend `0x' to filepos + output, it will be handled by local_hex_string_custom. + +2002-02-23 Richard Earnshaw + + * arm-linux-nat.c (store_newfpe_single): Use regcache_collect. + (store_newfpe_double, store_newfpe_extended, store_fpregister) + (store_register, store_regs, fill_gregset, fill_fpregset): Likewise. + +2002-02-22 Jim Blandy + + Indicate that the bcache functions don't change the strings + they're passed. + * bcache.h (bcache, hash): Add `const' keywords to declarations. + * bcache.c (bcache, hash): Add `const' keywords to definitions. + +2002-02-22 Pierre Muller + + * win32-nat.c (child_create_inferior): Fix create flags setting bug. + +2002-02-21 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Just use raw name when we can't + find the complete path to a loaded DLL. + +2002-02-21 Fred Fish + + * dbxread.c (process_one_symbol): When finding an N_FUN symbol + that marks the end of the range of a function, enter a line number + entry that has a line number of zero and a PC offset that matches + the end of the function. This starts a range of PC's for which no + line number information is known. + * symtab.c (find_pc_sect_line): If our best fit is in a range of + PC's for which no line number info is found (line number is zero) + then we didn't find any valid line information. + * symtab.h: Document use of zero line number entry. + +2002-02-21 Elena Zannoni + + * ppc-linux-nat.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Define. + (have_ptrace_getvrregs): Define for run time checks. + (gdb_vrregset_t): New type for Altivec register handling. + (fetch_register, store_register): Fetch/store altivec register + when needed. + (fetch_altivec_register, store_altivec_register): New functions. + (supply_vrregset, fill_vrregset): New functions. + (fetch_altivec_registers, store_altivec_registers): New functions. + (fetch_ppc_registers, store_ppc_registers): Fetch/store altivec + registers as well. + +2002-02-21 Jiri Smid + + * config/i386/x86-64linux.mh (NATDEPFILES): Remove x86-64-nat.o. + +2002-02-21 Richard Earnshaw + + * Makefile.in (armnbsd-nat.o): Update dependencies. + * armnbsd-nat.c (supply_gregset): New function. Common code to + supply the integer register set. + (supply_fparegset): New function. Similar for FPA registers. + (fetch_regs, fetch_fp_regs): Use them. + (fetch_core_registers): Likewise. + (fetch_elfcore_registers): New function. + (arm_netbsd_elfcore_fns): New core-file type specification. + (_initialize_arm_netbsd_nat): Register it. + +2002-02-21 Richard Earnshaw + + * armnbsd-nat.c: Include gdbcore.h. + (FETCH_INFERIOR_REGISTERS): Just error if this isn't defined. + (fetch_regs, fetch_fp_regs, store_regs, store_fp_regs): Add explicit + 'void' to declaration, to shut up ARI. + (fetch_core_registers): Make static. Rewrite using supply_register. + (arm_netbsd_core_fns): New core-file type specification. + (_initialize_arm_netbsd_nat): New function. + +2002-02-21 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Correctly check for invalid handle + value. + +2002-02-20 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Handle case where FindFirstFile + fails. + +2002-02-20 Daniel Jacobowitz + + * jv-exp.y (parse_number): Change type of implicit longs + to builtin_type_uint64. + +2002-02-20 Daniel Jacobowitz + + * gdbserver/linux-low.c (mywait): Change argument to waitpid + to be an integer instead of a `union wait'. + +2002-02-20 Daniel Jacobowitz + + * mips-linux-nat.c: Call the operating system GNU/Linux. + * mips-linux-tdep.c: Likewise. + * mips-tdep.c: Likewise. + +2002-02-20 Daniel Jacobowitz + + Fix PR gdb/265. + * jv-exp.y (parse_number): Handle 64-bit integers. + +2002-02-20 Daniel Jacobowitz + + * gdbserver/configure.in: Remove AM_PROC_CC_STDC. Change + AC_STDC_HEADERS to AC_HEADER_STDC. + * gdbserver/configure: Regenerated. + +2002-02-20 Richard Earnshaw + + * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC + is defined. + * sparc-tdep.c (get_longjmp_target): Likewise. + +2002-02-20 Richard Earnshaw + + * News: Add news about ARM and Multi-arch. Mention the new target + arm*-*-netbsd*. + +2002-02-19 Jim Blandy + + * stabsread.c (error_type_complaint): Improve error message. + +2002-02-19 Daniel Jacobowitz + + * gdbserver/README: Update documentation. + * gdbserver/configure.in: Update configury to match documentation. + * gdbserver/Makefile.in: Likewise. + * gdbserver/configure: Regenerated. + * gdbserver/aclocal.m4: New file, generated by aclocal. + * gdbserver/config.in: New file, generated by autoheader. + +2002-02-19 Richard Earnshaw + + * config/djgpp/fnchange.lst: Add change rules for armnbsd-tdep.c and + armnbsd-nat.c. + +2002-02-19 Richard Earnshaw + + * arm-tdep.h (enum arm_float_model): New enum. + (struct gdbarch_tdep): Add fp_model. + * arm-tdep.c (arm_gdbarch_init): Set fp_model in tdep. Defer setting + up floating-point conversions until we know the floating-point model + in use by the inferior. Don't complain about being unable to + determine the ABI of the inferior when we don't have one. + (arm_extract_return_value): Support different floating-point models. + (arm_store_return_value): Likewise. + * armnbsd-tdep.c (arm_netbsd_aout_init_abi): Set fp_model in tdep to + ARM_FLOAT_SOFT. + (arm_netbsd_elf_init_abi): Set fp_model to ARM_FLOAT_SOFT_VFP. + +2002-02-19 Peter Schauer + + * i386-tdep.c (i386_gdbarch_init): Eliminate incorrect use + of ``current_gdbarch''. + +2002-02-19 Richard Earnshaw + + * armnbsd-nat.c : ANSIfy all function declarations. + (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs): New. + (fetch_inferior_registers): Re-implement in terms of above. + (store_register, store_regs, store_fp_register, store_fp_regs): New. + (store_inferior_registers): Re-implement in terms of above. + +2002-02-19 Richard Earnshaw + + * arm-linux-nat.c: Linux -> GNU/Linux when not talking about the + kernel. + * arm-linux-tdep.c: Likewise. + * config/arm/tm-linux.h: Likewise. + +2002-02-19 Richard Earnshaw + + * configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch. + * config/arm/nbsd.mt (TM_FILE): Delete. + * config/arm/tm-nbsd.h: Delete. + +2002-02-19 Richard Earnshaw + + * arm-tdep.c (arm_gdbarch_init): Initialize TARGET_CHAR_SIGNED. + Initialize CALL_DUMMY_LENGTH. + +2002-02-19 Richard Earnshaw + + * armnbsd-tdep.c (arm_netbsd_aout_in_solib_call_trampoline): New + function. + (arm_netbsd_aout_init_abi): Initialize IN_SOLIB_CALL_TRAMPOLINE. + * config/arm/tm-nbsd.h: Don't include config/tm-nbsd.h, it only + defines one thing and that is incorrect for this port. + (IN_SOLIB_CALL_TRAMPOLINE): Delete. + +2002-02-18 Pierre Muller + + * go32-nat.c: add i386-tdep.h include to import FP_REGNUM_P macro. + +2002-02-18 Pierre Muller + + * win32-nat.c (display_selector): New function. Displays information + about the information returned by GetThreadSelectorEntry API function. + (display_selectors): New function. Displays the infomation of + the selector given as argument, or of CS, DS ans FS selectors + if no argument is given. + ( _initialize_inftarg): Add "w32" as info prefix command. + Add "info w32 selector" as command calling display_selectors. + +2002-02-19 Pierre Muller + + * i386-tdep.c (get_longjmp_target): Fix compilation failure + by setting dummy values to JB_PC and JB_ELEMENT_SIZE + if not defined. + +2002-02-18 Richard Earnshaw + + * config/arm/nbsd.mt (TDEPFILES): Add solib-sunos.o. + +2002-02-18 Richard Earnshaw + + * arm-tdep.c (arm_set_call_dummy_breakpoint_offset): New function. + (arm_fix_call_dummy): Call it. + (arm_call_dummy_breakpoint_offset): Delete. + (arm_gdbarch_init): Initialize call_dummy_breakpoint_offset. + * config/arm/tm-arm.h (CALL_DUMMY_BREAKPOINT_OFFSET): Delete. + +2002-02-18 Andrew Cagney + + * gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2. + Default to func_frame_chain_valid. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.h (FRAME_CHAIN_VALID): Delete definition. + +2002-02-18 Elena Zannoni + + * ppc-linux-nat.c: Update copyright. + (fetch_register, store_register): Add tid parameter, don't compute + tid here. + (fetch_ppc_registers, store_ppc_registers): Add tid + parameter. Pass it along to callees. + (fetch_inferior_registers, store_inferior_registers): Compute tid + here, and pass it to calleed functions. + (fill_gregset, supply_fpregset): Clean up formatting. + +2002-02-18 Richard Earnshaw + + * arm-tdep.c (arm_gdbarch_init): Initialize coerce_float_to_double. + * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Delete. + +2002-02-18 Richard Earnshaw + + * gdbarch.sh (GET_LONGJMP_TARGET): Add rule. + * gdbarch.c gdbarch.h: Regenerate. + * breakpoint.c (create_longjmp_breakpoint): Always compile this + function. + (breakpoint_reset): Test GET_LONGJMP_TARGET_P(). + * infrun.c (GET_LONGJMP_TARGET): Delete default definition. + (handle_inferior_event): Test GET_LONGJMP_TARGET_P(). + + * arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields. + * arm-tdep.c (arm_get_longjmp_target): New function. + (arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes + this to a positive value register arm_get_longjmp_target as the + longjmp handler. + * arm-linux-tdep.c (arm_get_longjmp_target): Delete. + (arm_linux_init_abi): Set up longjmp description in tdep. + * armnbsd-nat.c (get_longjmp_target): Delete. + * armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp + description in tdep. + * config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete. + (get_longjmp_target): Delete declaration. + (GET_LONGJMP_TARGET): Delete. + * config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration. + (GET_LONGJMP_TARGET): Delete. + +2002-02-17 Kevin Buettner + + From Peter Schauer : + * ia64-tdep.c (ia64_gdbarch_init): Eliminate incorrect use + of ``current_gdbarch''. + +2002-02-17 Tom Tromey + + * cli/cli-cmds.c (compare_strings): New function. + (complete_command): Only print each unique item once. + * completer.h (complete_line): Declare. + * completer.c (complete_line): New function. + (line_completion_function): Use it. + +2002-02-16 Andrew Cagney + + * gdbarch.sh (TARGET_LONG_DOUBLE_BIT): Default to 64. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-02-16 Daniel Jacobowitz + + * valarith.c (value_x_unop): Fix decrement; support post-decrement. + +2002-02-16 Daniel Jacobowitz + + From Peter Schauer : + * valops.c (value_arg_coerce): Don't take the address of a reference + to convert an argument to a reference. + +2002-02-15 Christopher Faylor + + * win32-nat.c (get_image_name): New function. + (handle_load_dll): Use get_image_name function. + (get_child_debug_event): Avoid registering debug events until possibly + execed process is started. + (child_create_inferior): Allow invocation via shell so that command + line redirection, etc. works ok. + (_initialize_inftarg): Add new command: "set shell" to control whether + a shell is used to start a process. + +2002-02-15 Daniel Jacobowitz + + * gdbserver/linux-mips-low.c (cannot_fetch_register): Use find_regno + instead of find_register_by_number. + (cannot_store_register): Likewise. + +2002-02-14 Pierre Muller + + * dwarf2read.c: Replace fprintf (stderr, ...) by + fprintf_unfiltered (gdb_stderr, ...). + +2002-02-15 Daniel Jacobowitz + + * gdbserver/gdbserver.1: Document --attach. + +2002-02-15 Richard Earnshaw + + * arm-tdep.h (struct gdbarch_tdep): Add fields for breakpoint + descriptions. + * arm-tdep.c (arm_default_arm_le_breakpoint) + (arm_default_arm_be_breakpoint, arm_default_thumb_le_breakpoint) + (arm_default_thumb_be_breakpoint): New. Initialize them from + traditional breakpoint defines. + (arm_breakpoint_from_pc): Use new gdbarch_tdep entries. + (arm_gdbarch_init): Initialize new breakpoint variables. + * arm-linux-tdep.c (arm_linux_arm_le_breakpoint): New. + (arm_linux_init_abi): Initialize linux-specific breakpoint. + * armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint): New. + (arm_netbsd_aout_init_abi, arm_netbsd_elf_init_abi): Split common + code out to ... + (arm_netbsd_init_abi_common): ... here; new function. + * config/arm/tm-arm.h (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT) + (THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Delete. + * config/arm/tm-linux.h (ARM_LE_BREAKPOINT): Delete. + * config/arm/tm-nbsd.h (ARM_LE_BREAKPOINT): Delete. + +2002-02-15 Richard Earnshaw + + * arm-tdep.h (enum arm_abi): New enum. + (struct gdbarch_tdep): New structure. + (LOWEST_PC): Provide a default. + (arm_gdbarch_register_os_abi): Declare new function. + * arm-tdep.c (arm_abi_names): New array. + (process_note_abi_tag_sections): New function. + (get_elfosabi): New function. + (arm_gdbarch_register_os_abi): New function. + (arm_gdbarch_init): Try to determine the ABI of the inferior. If + support for that ABI has been built in, then call the appropriate + configuration routine. Use gdbarch_num_regs() to get the number + of registers. + (arm_dump_tdep): New function. + (arm_init_abi_eabi_v1, arm_init_abi_eabi_v2, arm_init_abi_apcs): New + place-holder functions. + (_initialize_arm_tdep): Register them. + * config/arm/tm-arm.h (LOWEST_PC): Delete. + + * armnbsd-tdep.c: New file. + * Makefile.in (armnbsd-tdep.o): Add dependencies. + * config/arm/nbsd.mt (TDEPFILES): Add it. + * config/arm/tm-nbsd.h (LOWEST_PC): Delete. + + * armnbsd-nat.c: Include regcache.h. + * Makefile.in (armnbsd-nat.o): Update dependency list. + + * arm-tdep.c (arm_get_next_pc): Use printf_filtered for error message. + +2002-02-14 Daniel Jacobowitz + + * gdbserver/Makefile.in: Fix typos in target rules. + +2002-02-14 Daniel Jacobowitz + + Fix part of PR gdb/267. + * linespec.c (find_methods): Handle constructors specially for now. + +2002-02-14 Corinna Vinschen + + * arm-tdep.c (arm_push_arguments): Eliminate special float type + handling. + * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Define to call + standard_coerce_float_to_double(). + +2002-02-14 Christopher Faylor + + * config/i386/xm-cygwin.h: Revert inadvertent reinclusion of + GDBINIT_FILENAME. + +2002-02-14 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Don't call + find_variant_by_name, because it confuses the multiarch + framework. Return NULL if there isn't an architecture with the + user supplied name, instead of forcing a different one without + recording the change with the multiarch machinery. + (find_variant_by_name): Delete. + +2002-02-14 Peter Schauer + + * config/i386/i386sol2.mh (NATDEPFILES): Add i387-nat.o, needed by + i386v4-nat.o now. Add gcore.o, Solaris x86 supports gcore. + +2002-02-13 Martin M. Hunt + + * stack.c (print_frame_info_base): When calling + print_frame_info_listing_hook, set current_source_symtab. + +2002-02-14 Daniel Jacobowitz + + * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS, + and remove unused $(INCLUDE_DIR). + Add regcache.c to OBS. + Add generated register protocol files to clean target. + Update dependencies for new objects, obsolete old target code. + + * gdbserver/linux-low.c: Remove all platform-specific code to + new files. Remove various dead code. Update to use regcache + functionality. + * gdbserver/remote-utils.c (fromhex): Add return statement + to quiet warning. + (putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer + constant. + (input_interrupt): Add integer parameter to match prototype + of a signal handler. + (outreg): Use register_data (). + (prepare_resume_reply): Use gdbserver_expedite_regs. + * gdbserver/server.c (main): Dynamically allocate own_buf because + PBUFSIZ is no longer constant. Use registers_to_string () and + registers_from_string (). + * gdbserver/server.h: No longer include "defs.h". Add prototypes + for error (), fatal (), and warning (). Update definition of + PBUFSIZ to use regcache functionality. Add include guard. + * gdbserver/utils.c (fatal): Add missing ``const''. + (warning): New function. + + * regformats/regdat.sh: Include "regcache.h" in generated files. + Provide init_registers () function. + * regformats/regdef.h: Add prototype for set_register_cache (). + Add include guard. + + * gdbserver/linux-arm-low.c: New file. + * gdbserver/linux-i386-low.c: New file. + * gdbserver/linux-ia64-low.c: New file. + * gdbserver/linux-m68k-low.c: New file. + * gdbserver/linux-mips-low.c: New file. + * gdbserver/linux-ppc-low.c: New file. + * gdbserver/linux-sh-low.c: New file. + + * gdbserver/regcache.c: New file. + * gdbserver/regcache.h: New file. + + * gdbserver/low-linux.c: Removed obsolete file. + +2002-02-14 Daniel Jacobowitz + + * config/arm/linux.mt: Update GDBSERVER_DEPFILES. + * config/i386/linux.mt: Likewise. + * config/ia64/linux.mt: Likewise. + * config/m68k/linux.mh: Likewise. + * config/powerpc/linux.mh: Likewise. + * config/mips/linux.mt: Likewise. + + * config/sh/linux.mt: Add GDBSERVER_DEPFILES. + + * config/i386/i386lynx.mh: Mark gdbserver variables + as (currently) obsolete for this target. + * config/i386/nbsd.mt: Likewise. + * config/i386/nbsdelf.mt: Likewise. + * config/m32r/m32r.mt: Likewise. + * config/m68k/m68klynx.mh: Likewise. + * config/m68k/nbsd.mt: Likewise. + * config/m68k/sun3os4.mh: Likewise. + * config/mips/vr5000.mt: Likewise. + * config/ns32k/nbsd.mt: Likewise. + * config/pa/hppabsd.mh: Likewise. + * config/pa/hppaosf.mh: Likewise. + * config/powerpc/nbsd.mt: Likewise. + * config/rs6000/rs6000lynx.mh: Likewise. + * config/s390/s390.mt: Likewise. + * config/s390/s390x.mt: Likewise. + * config/sparc/sparclynx.mh: Likewise. + * config/sparc/sun4os4.mh: Likewise. + * config/i386/x86-64linux.mt: Likewise. + * config/sparc/linux.mh: Likewise. + +2002-02-14 Daniel Jacobowitz + + * configure.tgt: Configure gdbserver only for known working + targets. Set ${build_gdbserver} instead of modifying ${configdirs}. + * configure.in: Check ${build_gdbserver}. Put gdbserver/ into + SUBDIRS if it is configured. Update comment for ${nativefile}. + * configure: Regenerated. + +2002-02-13 Michael Snyder + + * config/i386/i386v42mp.mh: Add gcore.o to NATDEPFILES. + + * gcore.c (gcore_command): Use gcore_default_target instead of NULL. + (default_gcore_mach): Just return 0, work around a problem in bfd. + (default_gcore_target): OK to return NULL if exec_bfd is null. + (make_mem_sec): Use a cast, avoid a warning. + + * procfs.c (find_memory_regions_callback): Use a cast instead of + calling host_pointer_to_address (which complains if + sizeof (host pointer) != sizeof (target pointer)). + (procfs_make_note_section): Avoid overflow in psargs string. + + * procfs.c (procfs_make_note_section): Make the default + implementation return an error. + +2002-02-13 Rodney Brown + + * procfs.c (procfs_make_note_section): Provide a default definition + (for alpha-dec-osf4.0f). Fix typos. + +2002-02-13 Elena Zannoni + + * linux-proc.c: Add include of regcache.h. + * Makefile.in (linux-proc.o): Add dependency on regcache.h. + +2002-02-13 Andrew Cagney + + From 2002-01-18 Greg McGary : + * memattr.c (create_mem_region): Disallow useless empty region. + Regions are half-open intervals, so allow [A..B) [B..C) as + non-overlapping. + +2002-02-13 Michael Chastain + + * defs.h: Kill CONST_PTR. + * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const". + * c-lang.c (c_builtin_types): Likewise. + * ch-lang.c (ch_builtin_types): Likewise. + * f-lang.c (f_builtin_types): Likewise. + * language.c (unknown_builtin_types): Likewise. + * m2-lang.c (m2_builtin_types): Likewise. + * p-lang.c (pascal_builtin_types): Likewise. + * scm-lang.c (c_builtin_types): Likewise. + +2002-02-13 Keith Seitz + + * arm-tdep.h (arm_get_next_pc): Add declaration. + +2002-02-13 Richard Earnshaw + + * arm-tdep.c (arm_use_struct_convention): Make static. Move to be + with other related struct-returning functions. + (arm_extract_struct_value_address): New function. + (arm_gdbarch_init): Initialize the above in multi-arch vector. Also + initialize float_format, double_format and long_double_format as + appropriate to the endianness of the target. + * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Delete. + (arm_use_struct_convention): Delete declaration. + (USE_STRUCT_CONVENTION, EXTRACT_STRUCT_VALUE_ADDRESS): Delete. + +2002-02-13 Keith Seitz + + * defs.h (core_addr_to_string_nz): New function. + +2002-02-13 Mark Kettenis + + Apply missing bits of 2002-01-15 patch. + * i386v4-nat.c (supply_fpregset): Use i387_supply_fsave. + (fill_fpregset): Use i387_fill_fsave. + +2002-02-12 Keith Seitz + + * utils.c (core_addr_to_string): Use phex instead of phex_nz. + (core_addr_to_string_nz): New function. + +2002-02-11 Richard Earnshaw + + * arm-linux-nat.c: Really include arm-tdep.h. + * config/arm/tm-linux.h (struct type, struct value): Declare. + +2002-02-11 Michael Snyder + + * procfs.c: Include elf-bfd.h (for elfcore_write functions). + (gcore section): Ifdef for Solaris and Unixware only. + (procfs_do_thread_registers): Unixware needs one lwpstatus + per thread (not one prstatus or pstatus). + (procfs_make_note_section): Iterate only over kernel threads (lwps), + not over all gdb threads. For unixware, call elfcore_write_pstatus + once before iterating over threads. + +2002-02-11 Richard Earnshaw + + * arm-tdep.h: New file. + * arm-tdep.c: Include arm-tdep.h. + (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) + (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) + (arm_print_float_info, arm_register_type, convert_to_extended) + (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) + (arm_extract_return_value, arm_register_name): Make static. + (arm_software_single_step): Similarly. Fix types in declaration. + (arm_register_byte, arm_register_raw_size, arm_register_virtual_size) + (arm_store_return_value, arm_store_struct_return): New functions. + (arm_gdbarch_init): Register the above functions. Also register + call_dummy_start_offset, sizeof_call_dummy_words, + function_start_offset, inner_than, decr_pc_after_break, fp_regnum, + sp_regnum, pc_regnum, register_bytes, num_regs, max_register_raw_size, + max_register_virtual_size, register_size. Set up + prologue_cache.saved_regs here, rather than ... + (_initialize_arm_tdep): ... here. + * config/arm/tm-arm.h (struct type, struct value): Delete forward + declarations. + (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) + (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) + (arm_print_float_info, arm_register_type, convert_to_extended) + (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) + (arm_extract_return_value, arm_register_name): Delete declarations. + (SMASH_TEXT_ADDRESS, ADDR_BITS_REMOVE, FUNCTION_START_OFFSET) + (SKIP_PROLOGUE, SAVED_PC_AFTER_CALL, INNER_THAN, BREAKPOINT_FROM_PC) + (DECR_PC_AFTER_BREAK, PRINT_FLOAT_INFO, REGISTER_SIZE, NUM_REGS) + (REGISTER_NAME, REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) + (MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN) + (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, CALL_DUMMY_WORDS) + (SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_START_OFFSET, FIX_CALL_DUMMY) + (SOFTWARE_SINGLE_STEP_P, SOFTWARE_SINGLE_STEP) + (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) Delete. + (arm_pc_is_thumb, arm_pc_is_thumb_dummy, thumb_get_next_pc) + (arm_get_next_pc): No-longer static -- these are needed by the RDI + interface. + * arm-linux-nat.c arm-linux-tdep.c armnbsd-nat.c: Include arm-tdep.h. + * remote-rdi.c remote-rdp.c: Likewise. + * Makefile.in (arm-linux-nat.o, arm-linux-tdep.o arm-tdep.o) + (armnbsd-nat.o, remote-rdi.o, remote_rdp.o): Update dependencies. + * config/arm/tm-nbsd.h (SOFTWARE_SINGLE_STEP_P): Delete bogus + definition. + + * arm-tdep.h (ARM_A1_REGNUM, ARM_A4_REGNUM, ARM_AP_REGNUM) + (ARM_SP_REGNUM, ARM_LR_REGNUM, ARM_PC_REGNUM, ARM_F0_REGNUM) + (ARM_F3_REGNUM, ARM_F7_REGNUM, ARM_FPS_REGNUM, ARM_PS_REGNUM): Renamed + from non-ARM_ prefixed definitions. + * arm-tdep.c armnbsd-nat.c arm-linux-nat.c arm-linux-tdep.c: Update + all uses of above. + * remote-rdi.c remote-rdp.c: Likewise. + * arm-linux-nat.c (ARM_CPSR_REGNUM): Renamed from CPSR_REGNUM. + +2002-02-11 Richard Earnshaw + + * arm-tdep.c (arm_frameless_function_invocation) + (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) + (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) + (arm_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) + (arm_pop_frame, arm_get_next_pc): Make static. + (arm_gdbarch_init): Register above in gdbarch structure. + (arm_read_fp): Renamed from arm_target_read_fp. + (arm_pc_is_thumb, arm_pc_is_thumb_dummy): Make static. + * config/arm/tm-arm.h (arm_frameless_function_invocation) + (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) + (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) + (arm_target_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) + (arm_pop_frame, arm_get_next_pc, arm_pc_is_thumb) + (arm_pc_is_thumb_dummy): Delete declarations. + (INIT_EXTRA_FRAME_INFO, TARGET_READ_FP, FRAME_CHAIN) + (FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS) + (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, FRAME_ARGS_SKIP) + (FRAME_INIT_SAVED_REGS, PUSH_DUMMY_FRAME, POP_FRAME): Delete. + +2002-02-10 Daniel Jacobowitz + + * symtab.c (compare_search_syms): New function. + (sort_search_symbols): New function. + (search_symbols): Sort symbols after searching rather than + before. + +2002-02-10 Andrew Cagney + + * NEWS: Linux -> GNU/Linux. + +2002-02-10 Andrew Cagney + + * gdbarch.sh: For for level one methods, disallow a definition + when partially multi-arched. Add comments explaining rationale. + * gdbarch.h: Re-generate. + +2002-02-10 Andrew Cagney + + * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Don't require when + multi-arch partial. + +2002-02-10 Andrew Cagney + + * gdbarch.sh: Map LEVEL onto a symbolic GT_LEVEL. Exit on bad + field. Use diff -u. + * gdbarch.c: Re-generate. + +2002-02-10 Andrew Cagney + + * config/mips/tm-mips.h (CALL_DUMMY_LOCATION): Delete. + * gdbarch.sh (PUSH_RETURN_ADDRESS): Don't require when multi-arch + partial. + +2002-02-10 Andrew Cagney + + * gdbarch.sh (REGISTER_CONVERTIBLE): Don't require when + multi-arch partial. + (PUSH_ARGUMENTS): Switch to using predefault. + * gdbarch.c: Regenerate. + +2002-02-10 Andrew Cagney + + * valops.c (PUSH_ARGUMENTS): Delete definition. + * gdbarch.sh (PUSH_ARGUMENTS): Don't require when multi-arch + partial. Default to default_push_arguments. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-02-09 Andrew Cagney + + * defs.h (throw_exception): Rename return_to_top_level. Update + comments. + * utils.c (error_stream, internal_verror, quit): Ditto. + * top.c (throw_exception, catcher): Ditto. + * sparclet-rom.c (sparclet_load): Ditto. + * remote.c (interrupt_query, minitelnet): Ditto. + * remote-sds.c (interrupt_query): Ditto. + * remote-mips.c (mips_error, mips_kill): Ditto. + * ocd.c (interrupt_query): Ditto. + * monitor.c (monitor_interrupt_query): Ditto. + * m3-nat.c (suspend_all_threads, thread_resume_command): Ditto. + * target.h: Update comment. + + * m3-nat.c, ocd.c, sparclet-rom.c: Update copyright. + +2002-02-09 Andrew Cagney + + * gdbarch.sh (TARGET_LONG_DOUBLE_FORMAT): Default to + default_double_format. + * gdbarch.h, gdbarch.c: Re-generate. + * findvar.c (floatformat_unknown): Delete variable definition. + * doublest.h (floatformat_unknown): Delete variable declaration. + +2002-02-09 Jim Blandy + + * stabsread.c (read_type): Add code to parse Sun's syntax for + prototyped function types. + +2002-02-09 Andrew Cagney + + * Makefile.in (SUBDIR_CLI_INITS): Set to SUBDIR_CLI_SRCS. + (SUBDIR_MI_INITS): Set to SUBDIR_MI_SRCS. + +2002-02-09 Peter Schauer + + * xcoffsolib.c (_initialize_xcoffsolib): Renamed from + _initialize_solib. Fixes name clash with solib.c:_initialize_solib, + now _initialize_xcoffsolib gets called again and overrides the + commands from solib.c in a native configuration. + +2002-02-09 Mark Kettenis + + * doublest.c (store_typed_floating): Don't try to return a value. + Fixes PR gdb/290. + +2002-02-08 Jim Blandy + + * c-typeprint.c (c_type_print_varspec_suffix): If a function type + is prototyped and has no arguments, print its argument list as + `(void)'. + +2002-02-08 Chris Demetriou + + * MAINTAINERS (write-after-approval): Add myself. + (paper-trail): I've escaped! + +2002-02-08 Christopher Faylor + + * win32-nat.c (cygwin_pid_to_str): Revert 2002-02-08 change xasprintf + changes. + (_initialize_check_for_gdb_ini): Ditto. + +2002-02-08 Martin M. Hunt + + * win32-nat.c (cygwin_pid_to_str): Fix typo. + xaprintf -> xasprintf. + +2002-02-08 Pierre Muller + + * win32-nat.c: Remove use of printf and sprintf functions. + +2002-02-08 Richard Earnshaw + + * arm-tdep.c (arm_frame_chain_valid): Make static. + (arm_push_arguments): Likewise. + (arm_gdbarch_init): New function. + (_initialize_arm_tdep): Call it. + * config/arm/tm-arm.h (GDB_MULTI_ARCH): Set to 1. + (TARGET_DOUBLE_FORMAT): Test TARGET_BYTE_ORDER, not target_byte_order. + (FRAME_CHAIN_VALID): Delete. + (arm_frame_chain_valid): Delete declaration. + (PUSH_ARGUMENTS): Delete. + (arm_push_arguments): Delete declaration. + (CALL_DUMMY_P): Delete. + +2002-02-08 Andrew Cagney + Corinna Vinschen + + * gdbtypes.c (build_gdbtypes): Disable setting a specific float format + on builtin float types. + +2002-02-08 Daniel Jacobowitz + + * utils.c: Include before "bfd.h". + * tui/tui-hooks.c: Likewise. + * tui/tui.c: Likewise. + * tui/tuiCommand.c: Likewise. + * tui/tuiData.c: Likewise. + * tui/tuiDataWin.c: Likewise. + * tui/tuiDisassem.c: Likewise. + * tui/tuiGeneralWin.c: Likewise. + * tui/tuiIO.c: Likewise. + * tui/tuiLayout.c: Likewise. + * tui/tuiRegs.c: Likewise. + * tui/tuiSource.c: Likewise. + * tui/tuiSourceWin.c: Likewise. + * tui/tuiStack.c: Likewise. + * tui/tuiWin.c: Likewise. + +2002-02-07 Elena Zannoni + + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Extend where[] array + to include space for pseudoregs as well. Update loops accordingly. + (sh_fp_frame_init_saved_regs): Ditto. + (sh_init_extra_frame_info, sh_pop_frame): Split long lines. + +2002-02-07 Andrew Cagney + + * MAINTAINERS: Andreas Schwab is GNU/Linux m68k maintainer. + Add Richard Earnshaw to Arm maintainers. + +2002-02-07 Andrew Cagney + + * defs.h (warning_begin): Delete declaration. + + * config/powerpc/tm-ppcle-eabi.h (TARGET_BYTE_ORDER_DEFAULT): + Delete macro. + +2002-02-07 Michael Snyder + + * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): + Logic bug, remove misplaced else. + +2002-02-07 Klee Dienes + + * fork-inferior.c (fork_inferior): Add '!' to the list of + characters that need to be quoted when building a string for the + shell. Quote '!' specifically with a backslash, since CSH chokes + when trying to evaluate "str!str". + +2002-02-06 Nick Clifton + + * rdi-share/host.h: Only provide a typedef for bool if it is not + defined. + +2002-02-04 Michael Snyder + + * breakpoint.h (enum bptype): Add new overlay event bp type. + (enable_overlay_breakpoints, disable_overlay_breakpoints): Export. + + * breakpoint.c (create_internal_breakpoint): New function. + (internal_breakpoint_number): Moved into create_internal_breakpoint. + (create_longjmp_breakpoint): Use create_internal_breakpoint. + (create_thread_event_breakpoint): Ditto. + (create_solib_event_breakpoint): Ditto. + (create_overlay_event_breakpoint): New function. + (enable_overlay_breakpoints, disable_overlay_breakpoints): New funcs. + (update_breakpoints_after_exec): Delete and re-initialize + overlay event breakpoints after an exec. Add FIXME comment + about longjmp breakpoint. + (print_it_typical): Ignore overlay event breakpoints. + (print_one_breakpoint): Ditto. + (mention): Ditto. + (bpstat_what): Do not stop for overlay event breakpoints. + (delete_breakpoint): Don't delete overlay event breakpoints. + (breakpoint_re_set_one): Delete the overlay event breakpoint. + (breakpoint_re_set): Re-create overlay event breakpoint. + + * symfile.c (overlay_auto_command): Enable overlay breakpoints. + (overlay_manual_command): Disable overlay breakpoints. + (overlay_off_command): Disable overlay breakpoints. + +2002-02-06 Richard Earnshaw + + * arm-tdep.c: Include elf-bfd.h and coff/internal.h. + (MSYMBOL_SET_SPECIAL, MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Move defines + to here from config/tm-arm.h. + (coff_sym_is_thumb): Make static. + (arm_elf_make_msymbol_special): New function. + (arm_coff_make_msymbol_special): New function. + * config/arm/tm-arm.h (MSYMBOL_SET_SPECIAL): Delete definition. + (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Likewise. + (coff_sym_is_thumb): Delete declaration. + (arm_elf_make_msymbol_special): Declare. + (arm_coff_make_msymbol_special): Declare. + (ELF_MAKE_MSYMBOL_SPECIAL): Call arm_elf_make_msymbol_special. + (COFF_MAKE_MSYMBOL_SPECIAL): Call arm_coff_make_msymbol_special. + +2002-02-06 Richard Earnshaw + + * arm-tdep.c (arm_software_single_step): ANSIfy function declaration. + +2002-02-06 Richard Earnshaw + + * gdbarch.sh (PRINT_FLOAT_INFO): Add rule. + * gdbarch.c gdbarch.h: Regenerate. + * arch-utils.c (default_print_float_info): New function. + * arch-utils.h (default_print_float_info): Prototype it. + * infcmd.c (float_info): Call PRINT_FLOAT_INFO. + * doc/gdbint.texinfo (FLOAT_INFO): Mark as deprecated. + (PRINT_FLOAT_INFO): Document it. + + * arm-tdep.c (arm_print_float_info): Renamed from arm_float_info. + * config/arm/tm-arm.h (FLOAT_INFO): Delete. + (PRINT_FLOAT_INFO): Define. + +2002-02-06 Pierre Muller + + * win32-nat.c (_initialize_check_for_gdb_ini): + Add typecast to sprintf argument to suppress a warning. + +2002-02-05 Pierre Muller + + * win32-nat.c (last_sig): Changed type of variable to target_signal, + to allow easier handling of pass state. + (DEBUG_EXCEPTION_SIMPLE): New macro, used in handle_exception, + that gives exception name and address. + (handle_exception): Use DEBUG_EXCEPTION_SIMPLE macro + and set last_sig value to ourstatus->value.sig. Some missing + exceptions added. + (child_continue): Correctly report continue_status. + (get_child_debug_event,do_initial_child_stuff): Set last_sig to + TARGET_SIGNAL_0 (new default value). + (child_resume): consider sig argument passed to decide if + the exception should be passed to debuggee or not. + +2002-02-05 Michael Snyder + + * regcache.c (fetch_register): Call target_fetch_register + only if we don't call FETCH_PSEUDO_REGISTER. + (store_register): Call target_store_register only if we + don't call STORE_PSEUDO_REGISTER. + +2002-02-05 Elena Zannoni + + * gdbarch.sh: Add definitions for COFF_MAKEMSYMBOL_SPECIAL and + ELF_MAKE_MSYMBOL_SPECIAL. + * gdbarch.c, gdbarch.h: Regenerate. + * arch-utils.c (default_make_msymbol_special): New function. + * arch-utils.h (default_make_msymbol_special): Export. + * elfread.c (elf_symtab_read): Compile use of + ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now + multiarched. + * coffread.c (coff_symtab_read): Ditto, for + COFF_MAKE_MSYMBOL_SPECIAL. + +2002-02-05 Jim Blandy + + * solib-svr4.c (svr4_truncate_ptr): New function. + (svr4_relocate_section_addresses): Do the address arithmetic with + the appropriate truncation for target addresses, even when + CORE_ADDR is larger than a target address. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (mywait): Cast second argument of waitpid + to (int *). + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (kill_inferior): Remove commented out + code. + +2002-02-05 Daniel Jacobowitz + + * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: Remove unused include files. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: Define PTRACE_ARG3_TYPE. + (read_inferior_memory): Use it. + (write_inferior_memory): Likewise. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (create_inferior): Call strerror instead of + grubbing through sys_errlist. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: New file, copied exactly from low-linux.c. + +2002-02-04 Pierre Muller + * win32-nat.c (handle_exception): Handle Ctrl-Break exception. + +2002-02-04 Andrew Cagney + + * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions. + (do_sfunc, set_cmd_sfunc): New functions. + + * command.h (struct cmd_list_element): Add field func. + * cli/cli-decode.h (struct cmd_list_element): Ditto. + * command.h (set_cmd_sfunc, set_cmd_cfunc): Declare. + * cli/cli-decode.h: Ditto. + + * cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc. + (help_all, help_cmd_list): Ditto. + (find_cmd, complete_on_cmdlist): Ditto. + * top.c (execute_command): Ditto. + + * cli/cli-setshow.c (do_setshow_command): Call func instead of + function.sfunc. + + * infcmd.c (notice_args_read): Fix function signature. + + * cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc. + * cli/cli-decode.c (add_set_cmd): Ditto. + * utils.c (initialize_utils): Ditto. + * maint.c (_initialize_maint_cmds): Ditto. + * infrun.c (_initialize_infrun): Ditto. + * demangle.c (_initialize_demangler): Ditto. + * remote.c (add_packet_config_cmd): Ditto. + * mips-tdep.c (_initialize_mips_tdep): Ditto. + * cris-tdep.c (_initialize_cris_tdep): Ditto. + * proc-api.c (_initialize_proc_api): Ditto. + * kod.c (_initialize_kod): Ditto. + * valprint.c (_initialize_valprint): Ditto. + * top.c (init_main): Ditto. + * infcmd.c (_initialize_infcmd): Ditto. + * corefile.c (_initialize_core): Ditto. + * arm-tdep.c (_initialize_arm_tdep): Ditto. + * arch-utils.c (initialize_current_architecture): Ditto. + (_initialize_gdbarch_utils): Ditto. + * alpha-tdep.c (_initialize_alpha_tdep): Ditto. + + * cli/cli-decode.c (add_cmd): Use set_cmd_cfunc. + * wince.c (_initialize_inftarg): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * mips-tdep.c (_initialize_mips_tdep): Ditto. + * language.c (_initialize_language): Ditto. + * arc-tdep.c (_initialize_arc_tdep): Ditto. + +2002-02-04 Michael Snyder + + * memattr.c (_initialize_mem): Elaborate the help for 'mem' command. + +2002-02-04 Daniel Jacobowitz + + * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS. + Add rules for building the register data files. + +2002-02-04 Daniel Jacobowitz + + * regformats/regdat.sh: Add braces to the definition of + expedite_regs_${arch}. + +2002-02-04 Daniel Jacobowitz + + * regformats/regdef.h (struct reg): Add comment describing the + requirements for offset and size fields. + +2002-02-04 Andreas Schwab + + * config/ia64/linux.mh: Don't set NAT_CLIBS and REGEX. + * config/ia64/linux.mt: Don't set GDBSERVER_LIBS. + +2002-02-04 Richard Earnshaw + + * gdbarch.sh (copyright): Update years in generated header. + (SMASH_TEXT_ADDRESS): Add rule. + * gdbarch.h, gdbarch.c: Re-generate. + * coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS. + * dbxread.c: Likewise. + * dwarfread.c: Likewise. + * elfread.c: Likewise. + * somread.c: Likewise. + + * arm-tdep.c (arm_smash_text_address): New function. + * config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above. + +2002-02-04 Pierre Muller + + Add support for hardware watchpoints on win32 native. + * win32-nat.c (CONTEXT_DEBUG_DR macro): Add use of + CONTEXT_DEBUG_REGISTERS. + (dr variable): New variable. Static array containing a local copy + of debug registers. + (debug_registers_changed): New variable. Reflects when debug registers + are changed and need to be written to inferior. + (debug_registers_used): New variable. Reflects when any debug register + was set, used when new threads are created. + (cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): New functions used by + i386-nat code. + (thread_rec): Set dr array if id is the thread of current_event . + (child_continue, child_resume): Change the debug registers for all + threads if debug_registers_changed. + (child_add_thread): Change the debug registers if debug_registers_used. + * config/i386/cygwin.mh: Add use of i386-nat.o file. + Link nm.h to new nm-cygwin.h file. + + config/i386/nm-cygwin.h: New file. Contains the macros used for use + of hardware registers. + +2002-02-03 Andrew Cagney + + * valprint.c (print_floating): Allow non TYPE_CODE_FLT types. + Restore behavour broken by 2002-01-20 Andrew Cagney + IEEE_FLOAT removal. + +2002-02-03 Daniel Jacobowitz + + * c-valprint.c (c_val_print): Pass a proper valaddr to + cp_print_class_method. + * valops.c (search_struct_method): If there is only one method + and args is NULL, return that method. + +2002-02-03 Daniel Jacobowitz + + * gdbtypes.c (init_simd_type): Use TYPE_TAG_NAME instead of + accessing tag_name directly. + +2002-02-03 Daniel Jacobowitz + + * ax-gdb.c (find_field): Use TYPE_TAG_NAME instead + of accessing tag_name directly. + +2002-02-03 Daniel Jacobowitz + + PR gdb/280 + * gdbtypes.c (replace_type): New function. + * gdbtypes.h (replace_type): Add prototype. + * stabsread.c (read_type): Use replace_type. + +2002-02-03 Richard Earnshaw + + * Makefile.in (memattr.o): Add missing dependencies rule. + +2002-02-03 Peter Schauer + + * breakpoint.c (break_at_finish_command): Really export. + (break_at_finish_at_depth_command): Ditto. + (tbreak_at_finish_command): Ditto. + * hppa-tdep.c: Include completer.h. + * Makefile.in (hppa-tdep.o): Add dependency on $(completer_h). + (COMMON_OBS): Remove duplicate ui-file.o, frame.o, doublest.o. + +2002-02-01 Andrew Cagney + + * utils.c (do_write): New function. + (error_stream): Rewrite combining the code from error_begin and + verror. + (verror): Rewrite using error_stream. + (error_begin): Delete function. + +2002-02-01 Andrew Cagney + + * utils.c (error_begin): Make static. + * defs.h (error_begin): Delete declaration. + + * linespec.c (cplusplus_error): Replace cplusplus_hint. + (decode_line_1): Use cplusplus_error instead of error_begin, + cplusplus_hint and return_to_top_level. + * coffread.c (coff_symfile_read): Use error instead of error_begin + and return_to_top_level. + * infrun.c (default_skip_permanent_breakpoint): Ditto. + +2002-02-01 Andrew Cagney + + * language.h (type_error, range_error): Make string parameter + constant. + * language.c (warning_pre_print): Delete extern declaration. + * dwarfread.c (warning_pre_print): Ditto. + * language.c (type_error, range_error): Rewrite to use verror and + vwarning instead of warning_begin. + +2002-02-01 Michael Snyder + + * breakpoint.c (breakpoint_re_set): Delete ancient #if 0 code. + (set_ignore_count): Move misplaced comment back where it belongs. + +2002-02-01 Andrew Cagney + + * command.h (NO_FUNCTION): Delete macro. + * cli/cli-decode.h (NO_FUNCTION): Ditto. + * top.c (execute_command): Replace NO_FUNCTION with NULL. + * tracepoint.c (_initialize_tracepoint): Ditto. + * cli/cli-decode.c (add_set_cmd): Ditto. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + +2002-02-01 Daniel Jacobowitz + + * gnu-v3-abi.c (gnuv3_virtual_fn_field): Update comments. + Update ``this'' pointer when calling virtual functions. + +2002-02-01 Michael Snyder + + * breakpoint.c (create_temp_exception_breakpoint): Delete. + * hppa-tdep.c: Deprecate xbreak, txbreak and bx commands. + +2002-02-01 Daniel Jacobowitz + + * regformats/reg-arm.dat: New file. + * regformats/reg-i386.dat: New file. + * regformats/reg-ia64.dat: New file. + * regformats/reg-m68k.dat: New file. + * regformats/reg-mips.dat: New file. + * regformats/reg-ppc.dat: New file. + * regformats/reg-sh.dat: New file. + * regformats/regdef.h: New file. + * regformats/regdat.sh: New file. + +2002-02-01 Richard Earnshaw + + * arm-tdep.c (arm_frameless_function_invocation): Add some comments. + (arm_frame_args_address, arm_frame_locals_address): New functions. + (arm_frame_num_args): New function. + * config/tm-arm.h (FRAME_ARGS_ADDRESS): Call arm_frame_args_address. + (FRAME_LOCALS_ADDRESS): Call arm_frame_locals_address. + (FRMA_NUM_ARGS): Call arm_frame_num_args. + +2002-01-31 Michael Snyder + + * breakpoint.c (break_at_finish_command): Export. + (break_at_finish_at_depth_command): Export. + (tbreak_at_finish_command): Export. + (_initialize_breakpoint): Delete "xbreak" and "txbreak" commands. + * hppa-tdep.c (_initialize_hppa_tdep): Add "xbreak" and + "txbreak" commands, which are HPPA specific. + + * printcmd.c (disassemble_command): Remove an ancient + artifact of an old merge. + + * symfile.h (enum overlay_debugging_state): + Define enum constant values for overlay mode. + * symfile.c (overlay_debugging): Use enums instead of literals. + (overlay_is_mapped, overlay_auto_command, + overlay_manual_command): Ditto. + + * breakpoint.c (insert_breakpoints, remove_breakpoint, + breakpoint_here_p, breakpoint_inserted_here_p, + breakpoint_thread_match, bpstat_stop_status, + describe_other_breakpoints, check_duplicates, clear_command): + Coding standard fixes. + + * target.c (target_xfer_memory): Add spaces, coding standard. + (do_xfer_memory): Add missing line to trust-readonly + code: check bfd SEC_READONLY flag for section. + +2002-01-31 Andrew Cagney + + * PROBLEMS: Fix typo, 5.1->5.1.1. + +2002-01-30 Daniel Jacobowitz + + * symtab.c (find_pc_sect_psymtab): Do not search psymtabs for + data symbols, since we search based on textlow and texthigh. + (find_pc_sect_symtab): Likewise. + +2002-01-30 Andrew Cagney + + * defs.h (vwarning): Declare. + * utils.c (vwarning): New function. + (warning): Call vwarning. + (warning_begin): Delete function. + + * rs6000-nat.c (vmap_ldinfo): Use the function warning to print + the warning message. + * d10v-tdep.c (d10v_address_to_pointer) [0]: Delete call to + warning_begin. + +2002-01-30 Michael Snyder + + * NEWS: Mention "set trust-readonly-sections" command. + Mention generate-core-file command. + +2002-01-15 Michael Snyder + + * target.c: New command, "set trust-readonly-sections on". + (do_xfer_memory): Honor the suggestion to trust readonly sections + by reading them from the object file instead of from the target. + (initialize_targets): Register command "set trust-readonly-sections". + +2002-01-29 Andrew Cagney + + * parse.c (target_map_name_to_register): Simplify, search regs and + pseudo-regs using a single loop. + +2002-01-30 Andrew Cagney + + * PROBLEMS: Note that the i386 fix was missing from 5.1.1. + +2002-01-15 Rodney Brown + + * config/i386/tm-i386v4.h: Define HAVE_I387_REGS. + * config/i386/i386v42mp.mh: Add i387-nat.o . + * i386v4-nat.c: Include i387-nat.h. + (supply_fpregset): Use i387_supply_fsave. + (fill_fpregset): Use i387_fill_fsave. + +2002-01-30 Richard Earnshaw + + * arm-tdep.c (arm_call_dummy_words): Define. + * arm-linux-tdep.c (arm_linux_call_dummy_words): Define. + * config/arm/tm-arm.h (CALL_DUMMY_P): Define. + (CALL_DUMMY_WORDS): Define. + (arm_call_dummy_words): Declare. + * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Define. + (arm_linux_call_dummy_words): Declare. + +2002-01-30 Andreas Schwab + + * m68klinux-nat.c: Fix last change to use regcache_collect + instead of referencing registers[] directly. + +2002-01-29 Andrew Cagney + + * parse.c (target_map_name_to_register): Delete code wrapped in + #ifdef REGISTER_NAME_ALIAS_HOOK. + +2002-01-28 Michael Snyder + + * regcache.c (legacy_read_register_gen): Need to be able to + read pseudo-register as well as real register. + (legacy_write_register_gen): Ditto. + +2002-01-28 Andrew Cagney + + * config/mips/tm-wince.h (TARGET_BYTE_ORDER): Delete. + * config/sparc/tm-sparc.h (TARGET_BYTE_ORDER): Delete. + * config/ns32k/tm-umax.h (TARGET_BYTE_ORDER): Delete. + * config/ia64/tm-ia64.h (TARGET_BYTE_ORDER): Delete. + * config/m32r/tm-m32r.h (TARGET_BYTE_ORDER): Delete. + * config/m68k/tm-m68k.h (TARGET_BYTE_ORDER): Delete. + * config/m88k/tm-m88k.h (TARGET_BYTE_ORDER): Delete. + * config/mn10200/tm-mn10200.h (TARGET_BYTE_ORDER): Delete. + * config/pa/tm-hppa.h (TARGET_BYTE_ORDER): Delete. + * config/sh/tm-wince.h (TARGET_BYTE_ORDER): Delete. + * config/v850/tm-v850.h (TARGET_BYTE_ORDER): Delete. + * config/vax/tm-vax.h (TARGET_BYTE_ORDER): Delete. + * config/z8k/tm-z8k.h (TARGET_BYTE_ORDER): Delete. + * config/i960/tm-i960.h (TARGET_BYTE_ORDER): Delete. + * config/i386/tm-i386.h (TARGET_BYTE_ORDER): Delete. + * config/h8500/tm-h8500.h (TARGET_BYTE_ORDER): Delete. + * config/h8300/tm-h8300.h (TARGET_BYTE_ORDER): Delete. + * config/fr30/tm-fr30.h (TARGET_BYTE_ORDER): Delete. + * config/d30v/tm-d30v.h (TARGET_BYTE_ORDER): Delete. + * config/alpha/tm-alpha.h (TARGET_BYTE_ORDER): Delete. + +2002-01-28 Andrew Cagney + + * arch-utils.c (TARGET_BYTE_ORDER_DEFAULT): Delete macro. + (target_byte_order): Initialize to BFD_ENDIAN_BIG. + (initialize_current_architecture): Update target_byte_order using + information from BFD. + * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_DEFAULT): + * config/arm/tm-arm.h (TARGET_BYTE_ORDER_DEFAULT): Delete. + +2002-01-28 Andrew Cagney + + * config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here... + * vax-tdep.c (INVALID_FLOAT): To here. Document why it is broken. + + * rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in + #ifdef INVALID_FLOAT. + * infcmd.c (do_registers_info): Ditto. + * values.c (unpack_double): Ditto. Add comment. + + * config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was + already commented out. + +2002-01-26 Andreas Schwab + + * config/m68k/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define. + * m68klinux-nat.c: Update ptrace interface for fetching/storing + registers and add support for PTRACE_GETREGS. + +2002-01-24 Andrew Cagney + + GDB 5.1.1 released from 5.1 branch. + * NEWS: Add 5.1.1 news. + * README: Sync with 5.1 branch. + +2002-01-23 Fred Fish + + * mdebugread.c (parse_partial_symbols): Only copy stabstring1 to + stabstring on initial malloc. Reallocing will copy it for us, + if necessary. + +2002-01-23 Elena Zannoni + + * Makefile.in (hpread_h): Delete. + (HFILES_NO_SRCDIR): Remove hpread.h. + (ALLDEPFILES): Remove hp-psymtab-read.c and hp-symtab-read.c. + (hpread.o): Update dependencies. + (hp-psymtab-read.o, hp-symtab-read.o): Remove. + + * hp-psymtab-read.c: Remove file. + * hp-symtab-read.c: Remove file. + * hpread.h: Remove file. + + * hpread.c: Merge all contents of hp-psymtab-read.c, + hp-symtab-read.c and hpread.h into this file, as it was prior to + January 1999. + + * config/pa/hpux11w.mh, config/pa/hpux11.mh, + config/pa/hpux1020.mh, config/pa/hppaosf.mh, + config/pa/hppahpux.mh, config/pa/hppabsd.mh (NATDEPFILES): + Remove hp-psymtab-read.o and hp-symtab-read.o, add hpread.o. + +2002-01-23 Elena Zannoni + + * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset, + fill_gregset): Call gdbarch_tdep() just once, assign result to + variable and use that, instead of calling the function several + times. + +2002-01-24 Alexandre Oliva + + * configure.host: Accept sparcv9 as alias for sparc64. + * configure.tgt: Likewise. + +2002-01-22 Kevin Buettner + + * solib-aix5.c (build_so_list_from_mapfile) + (aix5_relocate_main_executable): Fix xcalloc() calls so order of + arguments is not reversed. + * solib-sunos.c (sunos_relocate_main_executable): Likewise. + * solib-svr4.c (svr4_relocate_main_executable): Likewise. + +2002-01-22 Elena Zannoni + + * sh-tdep.c (sh_pseudo_register_read): New function. Renamed and + modified version of obsolete sh_fetch_pseudo_register. + (sh_fetch_pseudo_register): Rename to sh_pseudo_register_read. + (sh4_register_read): New function. + (sh_pseudo_register_write): New function. Renamed and modified + version of obsolete sh_store_pseudo_register. + (sh_store_pseudo_register): Rename to sh_pseudo_register_write. + (sh4_register_write): New function. + (sh_gdbarch_init): Remove setting of gdbarch function + fetch_pseudo_register and store_pseudo_register. Remove setting of + register_convert_to_raw, register_convert_to_virtual, + register_convertible. + (sh_sh4_register_convertible): Delete. No longer needed. All is + taken care by architecture specific functions + register_read/register_write. + (sh_sh4_register_convert_to_virtual): Make static. + (sh_sh4_register_convert_to_raw): Ditto. + +2002-01-22 Andrew Cagney + + * doublest.c (floatformat_is_negative): Assert FMT is non NULL. + (floatformat_is_nan, floatformat_mantissa): Ditto. + + * gdbtypes.c (_initialize_gdbtypes): Initialize TYPE_FLOATFORMAT + for builtin_type_ieee_single_little, builtin_type_ieee_double_big, + builtin_type_ieee_double_little, + builtin_type_ieee_double_littlebyte_bigword, + builtin_type_m68881_ext, builtin_type_i960_ext, + builtin_type_m88110_ext, builtin_type_m88110_harris_ext, + builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword, + builtin_type_ia64_spill_big, builtin_type_ia64_spill_little and + builtin_type_ia64_quad_big, builtin_type_ia64_quad_little. + +2002-01-22 Corinna Vinschen + + * xstormy16-tdep.c (xstormy16_scan_prologue): Add frameless + parameter. Set frameless flag if it exists and depended of + whether the scanned function is frameless or not. + (xstormy16_skip_prologue): If function is frameless, return + result of xstormy16_scan_prologue(). + (xstormy16_frame_init_saved_regs): Adjust xstormy16_scan_prologue() + call. + +2002-01-21 Elena Zannoni + + * sh-tdep.c (sh_fp_frame_init_saved_regs, sh_push_arguments, + sh_generic_show_regs, sh3_show_regs, sh3e_show_regs, + sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs, + sh_sh4_register_byte, sh_sh4_register_raw_size, + sh_sh3e_register_virtual_type, sh_sh4_register_virtual_type, + sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual, + sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register, + sh_store_pseudo_register, sh_do_pseudo_register): Call + gdbarch_tdep() just once, assign result to variable and use that, + instead of calling the function several times. + +2002-01-20 Mark Kettenis + + * go32-nat.c (fetch_register): Use FP_REGNUM_P and FPC_REGNUM_P + macros instead of LAST_FPU_CTRL_REGNUM. + (store_register): Likewise. + +2002-01-21 Jim Blandy + + * infcmd.c (run_command): Check that the `exec' target layer's BFD + is up-to-date before running the program, not just when a program + exits. + +2002-01-21 Fred Fish + + * arm-tdep.c (thumb_skip_prologue): Quit scanning prologue + when we have found all instructions we are looking for. + +2002-01-21 Richard Earnshaw + + * arm-tdep.c (arm_register_name): New function. + (arm_registers_names): Make static. + * config/arm/tm-arm.h (arm_register_names): Delete declaration. + (arm_register_name): Declare. + (REGISTER_NAME): Use it. + +2002-01-21 Richard Earnshaw + Kevin Buettner + + Convert arm targets to new FRAME interface. + * arm-tdep.c (struct frame_extra_info): Remove fsr. + (arm_frame_find_save_regs): Delete. + (arm_frame_init_saved_regs): New. + (arm_init_extra_frame_info): Alloacte saved_regs as required. + Allocate extra_info as required. Convert all uses of fsr.regs + to use saved_regs, similarly all uses of EXTRA_FRAME_INFO fields + to use extra_info. + (thumb_scan_prologue, arm_scan_prologue, arm_find_callers_reg) + (arm_frame_chain, arm_frame_saved_pc, arm_pop_frame): Likewise. + (check_prologue_cache, save_prologue_cache): Likewise. + (_initialize_arm_tdep): Ensure prologue_cache is correctly set up. + * config/arm/tm-arm.h (EXTRA_FRAME_INFO): Delete. + (FRAME_FIND_SAVED_REGS): Delete. + (arm_frame_find_saved_regs): Delete prototype. + (arm_frame_init_saved_regs): New prototype. + (FRAME_INIT_SAVED_REGS): Define. + +2002-01-20 Andrew Cagney + + * config/arc/tm-arc.h (IEEE_FLOAT): Delete. + +2002-01-20 Andrew Cagney + + From Jeff Law : + * infttrace.c: Include . + (child_pid_to_exec_file): Revamp. Use pstat call to get the + exec file if the ttrace equivalent fails. + +2002-01-20 Andrew Cagney + + * rdi-share/devsw.c (openLogFile): Delete unused ``struct tm lt''. + (closeLogFile): Ditto. + +2002-01-20 Michael Chastain + + * top.c (print_gdb_version): Bump copyright year to 2002. + +2002-01-20 Andrew Cagney + + * MAINTAINERS (Blanket Write Privs): Add Kevin Buettner, Elena + Zannoni and Eli Zaretskii. + +2002-01-20 Daniel Jacobowitz + + * buildsym.c: Update copyright years. + * c-typeprint.c: Likewise. + * dwarf2read.c: Likewise. + * f-typeprint.c: Likewise. + * gdbtypes.c: Likewise. + * gdbtypes.h: Likewise. + * hp-symtab-read.c: Likewise. + * hpread.c: Likewise. + * mdebugread.c: Likewise. + * p-typeprint.c: Likewise. + +2002-01-20 Andrew Cagney + + * remote-sim.c (gdbsim_open): Simplify code testing the macro + TARGET_BYTE_ORDER_SELECTABLE_P. Assume the target is always + byte-order selectable. + * sparc-tdep.c (sparc_target_architecture_hook): Ditto. + * arch-utils.c: Ditto. + (set_endian): Ditto. + (set_endian_from_file): Ditto. + * gdbserver/low-sim.c (create_inferior): Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h: Re-generate. + * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arm/tm-wince.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arm/tm-linux.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arc/tm-arc.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/arm/tm-arm.h (TARGET_BYTE_ORDER_SELECTABLE_P): Delete + macro definition. + * config/mips/tm-wince.h: Remove #undef of macro + TARGET_BYTE_ORDER_SELECTABLE. + * config/sh/tm-wince.h: Ditto. + +2002-01-20 Daniel Jacobowitz + + * gdbtypes.h (struct cplus_struct_type): Add is_artificial to + member function fields. Add accessor macro + TYPE_FN_FIELD_ARTIFICIAL. + * dwarf2read.c (dwarf2_add_member_fn): Check for artificial methods. + * c-typeprint.c (c_type_print_base): Skip artificial member + functions. + +2002-01-20 Daniel Jacobowitz + + * f-typeprint.c: Delete unused function f_type_print_args. + * p-typeprint.c: Delete unused function pascal_type_print_args. + +2002-01-20 Daniel Jacobowitz + + * gdbtypes.h (struct type): Fix whitespace. Remove obsolete + comment. Add ``artificial'' to ``union field_location''. + + * dwarf2read.c: Remove ad-hoc TYPE_FIELD_ARTIFICIAL. + + * buildsym.c (finish_block): Initialize TYPE_FIELD_ARTIFICIAL to 0. + * mdebugread.c (parse_symbol): Likewise. + * stabsread.c (define_symbol): Likewise. + * hp-symtab-read.c (hpread_function_type): Likewise, instead of + initializing TYPE_FIELD_BITPOS to n (obsolete). + (hpread_doc_function_type): Likewise. + * hpread.c (hpread_function_type): Likewise. + +2002-01-20 Andrew Cagney + + * configure.in (host_makefile_frag): Only require a host makefile + fragment when a native build. + * configure: Re-generate. + +2002-01-20 Andrew Cagney + + * doublest.h (floatformat_from_type): Declare. + * doublest.c (floatformat_from_type): New function. + (convert_typed_floating): Use. + + * valprint.c (print_floating): Replace checks for IEEE_FLOAT with + call to function floatformat_from_type. + + * gdbarch.sh (IEEE_FLOAT): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * config/i960/tm-i960.h (IEEE_FLOAT): Delete macro. + * config/i386/tm-i386.h (IEEE_FLOAT): Ditto. + * config/z8k/tm-z8k.h (IEEE_FLOAT): Ditto. + * config/sparc/tm-sparc.h (IEEE_FLOAT): Ditto. + * config/pa/tm-hppa.h (IEEE_FLOAT): Ditto. + * config/m88k/tm-m88k.h (IEEE_FLOAT): Ditto. + * config/m68k/tm-m68k.h (IEEE_FLOAT): Ditto. + * config/h8500/tm-h8500.h (IEEE_FLOAT): Ditto. + * config/h8300/tm-h8300.h (IEEE_FLOAT): Ditto. + * config/fr30/tm-fr30.h (IEEE_FLOAT): Ditto. + * config/arm/tm-arm.h (IEEE_FLOAT): Ditto. + * config/alpha/tm-alpha.h (IEEE_FLOAT): Ditto. + + * s390-tdep.c (s390_gdbarch_init): Do not set ieee_float. + * x86-64-tdep.c (i386_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + +2002-01-20 Jiri Smid + + * configure.host, configure.tgt: Support x86-64. + * NEWS: Note new target x86-64. + + * config/i386/x86-64linux.mh (NATDEPFILES): x86-64-nat.o removed. + * x86-64-linux-nat.c (x86_64_register_u_addr): New function. + * config/i386/nm-x86-64.h (ATTACH_LWP): Removed. + * Makefile.in (x86-64-tdep.o, x86-64-linux-tdep.o, + x86-64-linux-nat.o): Fix dependencies. + +2002-01-19 Andrew Cagney + + * utils.c: Remove #ifndef MALLOC_INCOMPATIBLE. + * config/sparc/xm-sun4os4.h (PTRACE_ARG3_TYPE): Move macro .... + * config/sparc/nm-sun4os4.h (PTRACE_ARG3_TYPE): ... to here. + * config/sparc/xm-sun4os4.h: Delete file. + * config/sparc/sun4os4.mh (XM_FILE): Delete makefile variable. + +2002-01-19 Andrew Cagney + + * config/sparc/sparclynx.mh (XM_FILE): Delete. + * config/rs6000/rs6000lynx.mh (XM_FILE): Delete. + * config/m68k/m68klynx.mh (XM_FILE): Delete. + * config/i386/i386lynx.mh (XM_FILE): Delete. + * config/rs6000/xm-rs6000ly.h: Delete file. + * config/sparc/xm-sparclynx.h: Delete file. + * config/m68k/xm-m68klynx.h: Delete file. + * config/i386/xm-i386lynx.h: Delete file. + * config/xm-lynx.h: Delete file. + * config/djgpp/fnchange.lst: Update. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_register_byte): New function. + (alpha_register_raw_size): Ditto. + (alpha_register_virtual_size): Ditto. + (alpha_skip_prologue_internal): Renamed from + alpha_skip_prologue. + (alpha_skip_prologue): New version that calls + alpha_skip_prologue_internal. + (alpha_in_lenient_prologue): Use alpha_skip_prologue_internal. + * config/alpha/tm-alpha.h (SKIP_PROLOGUE): Remove + second argument from alpha_skip_prologue. + (REGISTER_BYTE): Use alpha_register_byte. + (REGISTER_RAW_SIZE): Use alpha_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Use alpha_register_virtual_size. + (FRAMELESS_FUNCTION_INVOCATION): Use + generic_frameless_function_invocation_not. + (FRAME_NUM_ARGS): Use frame_num_args_unknown. + (COERCE_FLOAT_TO_DOUBLE): Use standard_coerce_float_to_double. + +2002-01-19 Andrew Cagney + + * config/mips/xm-news-mips.h: Delete file. + * config/mips/news-mips.mh (XM_FILE): Delete makefile variable. + + * config/m88k/xm-m88k.h: Delete file. + * config/m88k/xm-dgux.h: Do not include xm-m88k.h. + * config/m88k/xm-delta88v4.h: Ditto. + * config/m88k/xm-delta88.h: Ditto. + + * config/alpha/xm-fbsd.h: Delete file. + * config/alpha/fbsd.mh (XM_FILE): Delete makefile variable. + + * config/sparc/xm-sparc.h: Delete file. + * Makefile.in (xm-sun4os4.h): Delete dependency. + * config/sparc/xm-sun4sol2.h: Do not include xm-sparc.h. + * config/sparc/xm-sun4os4.h: Ditto. + * config/sparc/xm-linux.h: Ditto. + + * config/i386/xm-windows.h: Delete file. + +2002-01-19 Andrew Cagney + + * utils.c: Include for MAXPATHLEN. + (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_call_dummy_words): New. + * config/alpha/tm-alpha.h (CALL_DUMMY): Remove. + (CALL_DUMMY_P): Define. + (CALL_DUMMY_WORDS): Define. + (SIZEOF_CALL_DUMMY_WORDS): Define. + +2002-01-19 Per Bothner + + * gnu-v3-abi.c (gnuv3_rtti_type): Guard that vtable_symbol_name + isn't NULL, which can happen with some gcj-3.x-produced code. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_register_virtual_type): New function. + (alpha_init_frame_pc_first): Ditto. + (alpha_fix_call_dummy): Ditto. + (alpha_store_struct_return): Ditto. + (alpha_extract_struct_value_address): Ditto. + * config/alpha/tm-alpha.h (REGISTER_VIRTUAL_TYPE): Use + alpha_register_virtual_type. + (STORE_STRUCT_RETURN): Use alpha_store_struct_return. + (EXTRACT_STRUCT_VALUE_ADDRESS): Use + alpha_extract_struct_value_address. + (FIX_CALL_DUMMY): Use alpha_fix_call_dummy. + (INIT_FRAME_PC): Use init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Use alpha_init_frame_pc_first. + +2002-01-19 Mark Kettenis + + * i386gnu-nat.c: Include "i386-tdep.h". + (fetch_fpregs): Simplify code dealing with uninitialized floating + point states such that it doesn't require FP7_REGNUM. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (frame_extra_info): New. + (alpha_find_saved_regs): Make static. Use + frame->extra_info. + (alpha_frame_init_saved_regs): New function. + (alpha_frame_saved_pc): Use frame->extra_info. + (temp_saved_regs): Don't declare as struct frame_saved_regs. + (heuristic_proc_desc): Adjust for temp_saved_regs changes. + (init_extra_frame_info): Rename to... + (alpha_init_extra_frame_info): ...this. Use frame->extra_info. + (alpha_print_extra_frame_info): New function. + (alpha_frame_locals_address): Ditto. + (alpha_frame_args_address): Ditto. + (alpha_pop_frame): Use frame->extra_info. + * config/alpha/tm-alpha.h (FRAME_ARGS_ADDRESS): Use + alpha_frame_args_address. + (FRAME_LOCALS_ADDRESS): Use alpha_frame_locals_address. + (alpha_find_saved_regs): Remove prototype. + (FRAME_INIT_SAVED_REGS): Use alpha_frame_init_saved_regs. + (EXTRA_FRAME_INFO): Remove. + (INIT_EXTRA_FRAME_INFO): Use alpha_init_extra_frame_info. + (PRINT_EXTRA_FRAME_INFO): Use alpha_print_extra_frame_info. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (alpha_osf_in_sigtramp): New function. + (alpha_cannot_fetch_register): Ditto. + (alpha_cannot_store_register): Ditto. + (alpha_register_convertible): Ditto. + (alpha_use_struct_convention): Ditto. + * config/alpha/tm-alpha.h: Update copyright years. + (IN_SIGTRAMP): Use alpha_osf_in_sigtramp. + (INNER_THAN): Use core_addr_lessthan. + (CANNOT_FETCH_REGISTER): Use alpha_cannot_fetch_register. + (CANNOT_STORE_REGISTER): Use alpha_cannot_store_register. + (REGISTER_CONVERTIBLE): Use alpha_register_convertible. + (USE_STRUCT_CONVENTION): Use alpha_use_struct_convention. + (FRAME_CHAIN): Remove unnecessary cast. + +2002-01-18 Andrew Cagney + + * NEWS: Document that testsuite/gdb.hp/gdb.threads-hp/ is + obsolete. + +2002-01-18 Andrew Cagney + + * infptrace.c: Remove ATTRIBUTE_UNUSED. Update copyright. + * monitor.c, remote-array.c, remote-bug.c: Ditto. + * remote-e7000.c, remote-es.c, remote-mips.c: Ditto. + * remote-nindy.c, remote-os9k.c, remote-rdi.c: Ditto. + * remote-rdp.c, remote-sds.c, remote-sim.c: Ditto. + * remote-st.c, remote-vx.c, remote.c, win32-nat.c: Ditto. + * x86-64-linux-nat.c: Ditto. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (alpha_register_name): New function. + * config/alpha/tm-alpha.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define. + +2002-01-18 Jason Thorpe + + * config/nm-nbsd.h (KERNEL_U_ADDR): Remove. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c: Update copyright years. + (alpha_next_pc): New function. + (alpha_software_single_step): Ditto. + * config/alpha/tm-alpha.h: Add prototype for + alpha_software_single_step. + +2002-01-18 Jason Thorpe + + * alphabsd-nat.c: Update copyright years. + (fill_gregset): Use regcache_collect. + (fill_fpregset): Likewise. + (fetch_inferior_registers): Only fetch integer registers + if requested to do so. + (store_inferior_registers): Only store integer registers + if requested to do so. + +2002-01-17 Andrew Cagney + + * config/alpha/alpha-osf3.mh (XDEPFILES): Delete. + * config/alpha/alpha-osf2.mh (XDEPFILES): Delete. + * config/alpha/alpha-osf1.mh (XDEPFILES): Delete. + * config/alpha/alpha-linux.mh (XDEPFILES): Delete. + * config/alpha/fbsd.mh (XDEPFILES): Delete. + * config/arm/linux.mh (XDEPFILES): Delete. + * config/arm/nbsd.mh (XDEPFILES): Delete. + * config/i386/i386dgux.mh (XDEPFILES): Delete. + * config/i386/i386sol2.mh (XDEPFILES): Delete. + * config/i386/i386m3.mh (XDEPFILES): Delete. + (NATDEPFILES): Move i387-tdep.o and core-aout.o to here. + * config/i386/i386gnu.mh (XDEPFILES): Delete. + * config/i386/fbsd.mh (XDEPFILES): Delete. + * config/i386/i386bsd.mh (XDEPFILES): Delete. + * config/i386/i386sco5.mh (XDEPFILES): Delete. + * config/i386/i386v4.mh (XDEPFILES): Delete. + * config/i386/i386v42mp.mh (XDEPFILES): Delete. + * config/i386/i386sco4.mh (XDEPFILES): Delete. + * config/i386/i386aix.mh (XDEPFILES): Delete. + * config/i386/go32.mh (XDEPFILES): Delete. + * config/i386/cygwin.mh (XDEPFILES): Delete. + * config/i386/i386lynx.mh (XDEPFILES): Delete. + * config/i386/i386mach.mh (XDEPFILES): Delete. + * config/i386/i386v32.mh (XDEPFILES): Delete. + * config/i386/linux.mh (XDEPFILES): Delete. + * config/i386/nbsdelf.mh (XDEPFILES): Delete. + * config/i386/ncr3000.mh (XDEPFILES): Delete. + * config/i386/i386mk.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/i386sco.mh (XDEPFILES): Delete. + * config/i386/i386v.mh (XDEPFILES): Delete. + * config/i386/nbsd.mh (XDEPFILES): Delete. + * config/i386/ptx.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/ptx4.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/symmetry.mh (XDEPFILES): Delete. + * config/i386/obsd.mh (XDEPFILES): Delete. + * config/i386/x86-64linux.mh (XDEPFILES): Delete. + * config/ia64/linux.mh (XDEPFILES): Delete. + * config/ia64/aix.mh (XDEPFILES): Delete. + * config/m68k/apollo68b.mh (XDEPFILES): Delete. + * config/m68k/dpx2.mh (XDEPFILES): Delete. + * config/m68k/3b1.mh (NATDEPFILES): Rename XDEPFILES. + * config/m68k/apollo68v.mh (XDEPFILES): Delete. + * config/m68k/hp300bsd.mh (XDEPFILES): Delete. + * config/m68k/linux.mh (XDEPFILES): Delete. + * config/m68k/m68klynx.mh (XDEPFILES): Delete. + * config/m68k/m68kv4.mh (XDEPFILES): Delete. + * config/m68k/nbsd.mh (XDEPFILES): Delete. + * config/m68k/sun2os3.mh (XDEPFILES): Delete. + * config/m68k/sun2os4.mh (XDEPFILES): Delete. + * config/m68k/sun3os3.mh (XDEPFILES): Delete. + * config/m68k/sun3os4.mh (XDEPFILES): Delete. + * config/m88k/delta88.mh (XDEPFILES): Delete. + * config/m88k/delta88v4.mh (XDEPFILES): Delete. + * config/m88k/m88k.mh (XDEPFILES): Delete. + * config/mips/littlemips.mh (NATDEPFILES): Rename XDEPFILES. + * config/mips/linux.mh (XDEPFILES): Delete. + * config/mips/irix6.mh (XDEPFILES): Delete. + * config/mips/irix5.mh (XDEPFILES): Delete. + * config/mips/irix4.mh (XDEPFILES): Delete. + * config/mips/irix3.mh (XDEPFILES): Delete. + * config/mips/decstation.mh (XDEPFILES): Delete. + * config/mips/mipsm3.mh (XDEPFILES): Delete. + (NATDEPFILES): Move core-aout.o to here. + * config/ns32k/nbsd.mh (XDEPFILES): Delete. + * config/pa/hpux1020.mh (XDEPFILES): Delete. + * config/pa/hppabsd.mh (XDEPFILES): Delete. + * config/pa/hppahpux.mh (XDEPFILES): Delete. + * config/pa/hpux11w.mh (XDEPFILES): Delete. + * config/pa/hppaosf.mh (XDEPFILES): Delete. + * config/pa/hpux11.mh (XDEPFILES): Delete. + * config/powerpc/aix.mh (XDEPFILES): Delete. + * config/powerpc/nbsd.mh (XDEPFILES): Delete. + * config/powerpc/linux.mh (XDEPFILES): Delete. + * config/romp/rtbsd.mh: Rename XDEPFILES. + * config/rs6000/rs6000lynx.mh (XDEPFILES): Delete. + * config/rs6000/aix4.mh (XDEPFILES): Delete. + * config/rs6000/rs6000.mh (XDEPFILES): Delete. + * config/s390/s390.mh (XDEPFILES): Delete. + * config/vax/vaxbsd.mh (NATDEPFILES): Rename XDEPFILES. + * config/sparc/sun4sol2.mh (XDEPFILES): Delete. + * config/sparc/sun4os4.mh (XDEPFILES): Delete. + * config/sparc/sparclynx.mh (XDEPFILES): Delete. + * config/sparc/nbsdelf.mh (XDEPFILES): Delete. + * config/sparc/nbsd.mh (XDEPFILES): Delete. + * config/sparc/linux.mh (XDEPFILES): Delete. + * config/vax/vaxult.mh (XDEPFILES): Delete. + * config/vax/vaxult2.mh (XDEPFILES): Delete. + * Makefile.in (DEPFILES): Remove XDEPFILES. + +2002-01-17 Andrew Cagney + + * utils.c (internal_verror): Fix comments, default is yes not no. + Update queries to match. Default to quit and dump core. + +2002-01-17 Andrew Cagney + + * breakpoint.c: Update assuming #if UI_OUT is always true. Update + copyright. + * defs.h, event-top.c, gdbcmd.h: Ditto. + * infcmd.c, infrun.c, main.c, printcmd.c, remote.c: Ditto. + * source.c, stack.c, symfile.c, symtab.c, thread.c: Ditto. + * top.c, cli/cli-cmds.c, cli/cli-decode.c: Ditto. + * cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.c: Ditto. + * mi/ChangeLog, mi/mi-cmd-break.c, mi/mi-cmd-stack.c: Ditto. + * mi/mi-main.c:Ditto. + + * stack.c, symfile.c: Update copyright. + +2002-01-17 Daniel Jacobowitz + + * gdbserver/low-hppabsd.c, gdbserver/low-lynx.c, + gdbserver/low-nbsd.c, gdbserver/low-sim.c, + gdbserver/low-sparc.c, gdbserver/low-sun3.c, + gdbserver/low-linux.c, gdbserver/server.c: Correct copyright notices. + +2002-01-17 Daniel Jacobowitz + + * gdbserver/low-hppabsd.c (myattach): New function, returning -1. + * gdbserver/low-lynx.c (myattach): Likewise. + * gdbserver/low-nbsd.c (myattach): Likewise. + * gdbserver/low-sim.c (myattach): Likewise. + * gdbserver/low-sparc.c (myattach): Likewise. + * gdbserver/low-sun3.c (myattach): Likewise. + + * gdbserver/low-linux.c (myattach): New function. + + * gdbserver/server.c (attach_inferior): New function. + (main): Handle "--attach". + +2002-01-16 Andrew Cagney + + * MAINTAINERS (language support): Daniel Jacobwitz is C++ + maintainer. + +2002-01-15 Daniel Jacobowitz + + * c-typeprint.c (is_type_conversion_operator): Add additional + check for non-conversion operators. + +2002-01-15 Michael Snyder + + * linux-proc.c: Add "info proc" command, a la procfs.c. + (read_mapping): New function, abstract and re-use code. + (linux_find_memory_regions): Use new func read_mapping. + (linux_info_proc_cmd): New function, implement "info proc". + (_initialize_linux_proc): Add new command "info proc". + +2002-01-15 Michael Snyder + + * symfile.c (generic_load): Use bfd_map_over_sections method + instead of manipulating bfd structure members directly. + (add_section_size_callback): New function, bfd sections callback + used by generic_load. + (load_sections_callback): New function, bfd sections callback + used by generic_load. + +2002-01-15 Elena Zannoni + + [Based on work by Jim Blandy] + * gdbtypes.h (builtin_type_v16qi, builtin_type_v8hi): Export. + (builtin_type_vec128): Export. + * gdbtypes.c (builtin_type_v16qi, builtin_type_v8hi): New SIMD + types. + (builtin_type_vec128): New builtin type for 128 bit vector + registers. + (build_gdbtypes): Initialize builtin_type_v16qi and + builtin_type_v8hi. Create the vec128 register builtin type + structure. + (build_builtin_type_vec128): New function. + (_initialize_gdbtypes): Register builtin_type_v16qi and + builtin_type_v8hi with gdbarch. Same for builtin_type_vec128. + * rs6000-tdep.c (rs6000_register_virtual_type): Change type of + AltiVec register to new builtin type. + +2001-01-15 Daniel Jacobowitz + + * stabsread.c (read_type): Pass dbx_lookup_type (typenums) + to make_cv_type. + +2002-01-14 Andrew Cagney + + * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Rename + CLEAN_UP_REGISTER_VALUE. + * regcache.c (supply_register): Update only call. + +2002-01-14 Andrew Cagney + + * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, + a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and + a29k-*-vxworks* targets as obsolete. + +2002-01-14 Michael Snyder + + * linux-proc.c (linux_do_thread_registers): Ignore fpxregs + until we can resolve portability issues. + * gregset.h: Remove references to fpxregs. + * gcore.c (gcore_command): Initialize note_sec to NULL. + +2002-01-13 Andrew Cagney + + * signals.c (target_signal_to_name): Rewrite. Only use + signals[].name when in bounds and non-NULL. + +2002-01-13 Andrew Cagney + + From Petr Ledvina : + * signals.c (target_signal_to_name): Verify that SIG is within the + bounds of the signals array. + +2002-01-13 Andrew Cagney + + * MAINTAINERS: Remove arm-coff and arm-pe from target list. + +2002-01-13 Keith Seitz + + * stack.c (print_frame_info_base): Print the frame's pc + only if when print_frame_info_listing_hook is not defined. + +2002-01-13 Keith Seitz + + * varobj.c (varobj_set_value): Make sure that there were no + errors evaluating the object before attempting to set its + value. + value_cast now properly adjusts VALUE_ADDRESS for baseclasses, + so this offset adjustment is no longer necessary. + (create_child): Don't set the error flag if the child is + a CPLUS_FAKE_CHILD. + (value_of_child): If value_fetch_lazy fails, return NULL + so that callers will be notified that an error occurred. + (c_value_of_variable): Delay check of variable's validity + until later. We actually want all structs and unions to have + the value "{...}". + Do not return "???" for variables which could not be evaluated. + This error condition must be returned to the caller so that it + can get the error condition from gdb. + (cplus_name_of_child): Adjust index for vptr before figuring + out the name of the child. + (cplus_value_of_child): If a child's (real) parent is not valid, + don't even bother trying to give a value for it. Just return + an error. Change all instances in this function. + (cplus_type_of_child): If our parent is one of the "fake" + parents, we need to get at the type of the real parent, and + derive the child's true type using this information. + +2002-01-13 Andrew Cagney + + From 2002-01-09 John Marshall : + * CONTRIBUTE, README, TODO: Change sourceware.cygnus.com to + sources.redhat.com, and tweak some related URLs which had + suffered from linkrot. + +2002-01-13 Andrew Cagney + + From Jeff law: + * hppa-tdep.c (hppa_push_arguments): Correct handling of 5-7 byte + structures passed in registers. + +2002-01-13 Eli Zaretskii + + * go32-nat.c (save_npx) [__DJGPP_MINOR__ < 3]: Remove extraneous + white space which prevented compilation. Reported by DSK + . + +2002-01-11 Michael Snyder + + * symfile.c (build_section_addr_info_from_section_tab): + Use bfd access method instead of manipulating bfd directly. + (syms_from_objfile): Ditto. + (simple_overlay_update_1): Ditto. + (simple_overlay_update): Ditto. + (generic_load): Ditto. + (overlay_unmapped_address): FIXME comment, bfd access methods. + (sections_overlap): FIXME comment, bfd access methods. + (pc_in_mapped_range): FIXME comment, bfd access methods. + (pc_in_unmapped_range): FIXME comment, bfd access methods. + (section_is_mapped): FIXME comment, bfd access methods. + (section_is_overlay): FIXME comment, bfd access methods. + + * symfile.c (generic_load): Whitespace and long line cleanups. + Remove duplicate variable, change several local variables to + more appropriate data types. + (print_transfer_performance): Use %lu instead of %ld for ulongs. + +2002-01-12 Andrew Cagney + + From Peter Schauer: + * language.c (longest_local_hex_string_custom): Use phex_nz to + convert NUM to a hex string. + +2002-01-12 Elena Zannoni + + * sh-tdep.c (sh_gdbarch_init): Move setting of long_bit earlier in + the function. + Update Copyright year. + +2002-01-12 Andrew Cagney + + * language.c (longest_raw_hex_string): Delete unused function. + +2002-01-11 Petr Sorfa + + * MAINTAINERS (write-after-approval): Add myself. + * dwarf2read.c (read_tag_string_type): Handling of + DW_AT_byte_size. + (read_tag_string_type): FORTRAN fix to prevent propagation of + first string size. + (set_cu_language): Handling of DW_LANG_Fortran95 + +2002-01-11 Richard Earnshaw + + * armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid -> + GETPID(inferior_ptid). + (store_inferior_registers): Likewise. + +2002-01-10 Jason Merrill + + * dwarf2read.c (decode_locdesc): Implement DW_OP_litn, DW_OP_dup. + Fix DW_OP_minus. + +2002-01-10 Andrew Cagney + + * config/djgpp/fnchange.lst: Add renames for bfd/ChangeLog-0001 + and bfd/elf32-sh-nbsd.c. + +2002-01-10 Michael Snyder + + * NEWS: Mention --pid and corefile/proc-id behavior change. + + * Makefile.in: Add rules for gcore.o and linux-proc.o. + * gcore.c: Include cli/cli-decode.h instead of command.h. + + * main.c (captured_main): Add new command line option "--pid". + If the second command line argument (following the symbol-file) + begins with a digit, try to attach to it before trying to open + it as a corefile. + (print_gdb_help): Document the "--pid" argument. + +2002-01-10 Eli Zaretskii + + * completer.c (command_completer): New function. + + * completer.h : Add prototype. + + * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the + completer for the "help" command. + +2002-01-09 Jason Merrill + + * c-typeprint.c (is_type_conversion_operator): Fix thinko. + +2002-01-09 Michael Snyder + + * i386-linux-nat.c (fill_fpxregset): Make global. + (store_fpxregset): Ditto. + + * gregset.h (gdb_fpxregset_t): Define. + (supply_fpxregset): Prototype. + (fill_fpxregset): Prototype. + + * exec.c (exec_make_note_section): Don't call elfcore_write_prpsinfo. + +2002-01-09 Richard Earnshaw + + * config/arm/arm-tdep.h (arm_software_single_step): Remove PARAMS. + * config/arm/nm-nbsd.h (arm_register_u_addr): Likewise. + * config/arm/tm-nbsd.h (get_longjmp_target): Likewise. + +2002-01-09 Andrew Cagney + + * MAINTAINERS: Update target maintainer rules so that any + Maintainer can approve a tested patch for a maintenance-only + target. + +2002-01-09 Richard Earnshaw + + * MAINTAINERS (write-after-approval): Add myself. + + * arm-tdep.c (arm_init_extra_frame_info): Cast NULL argument to + IN_SIGTRAMP. + +2002-01-08 Michael Snyder + + * linux-proc.c (child_pid_to_exec_file): Use readlink to get the + real name of the executable, rather than the /proc name. + +2002-01-03 Michael Snyder + + Implement a "generate-core-file" command in gdb, save target state. + * gcore.c: New file. Implement new command 'generate-core-file'. + Save a corefile image of the current state of the inferior. + * linux-proc.c: Add linux-specific code for saving corefiles. + * target.h (struct target_ops): Add new target vectors for saving + corefiles; to_find_memory_regions and to_make_corefile_notes. + (target_find_memory_regions): New macro. + (target_make_corefile_notes): New macro. + * target.c (update_current_target): Inherit new target methods. + (dummy_find_memory_regions): New place-holder method. + (dummy_make_corefile_notes): New place-holder method. + (init_dummy_target): Initialize new dummy target vectors. + * exec.c (exec_set_find_memory_regions): New function. + Allow the exec_ops vector for memory regions to be taken over. + (exec_make_note_section): New function, target vector method. + * defs.h (exec_set_find_memory_regions): Export prototype. + * procfs.c (proc_find_memory_regions): New function, corefile method. + (procfs_make_note_section): New function, corefile method. + (init_procfs_ops): Set new target vector pointers. + (find_memory_regions_callback): New function. + (procfs_do_thread_registers): New function. + (procfs_corefile_thread_callback): New function. + * sol-thread.c (sol_find_memory_regions): New function. + (sol_make_note_section): New function. + (init_sol_thread_ops): Initialize new target vectors. + * inftarg.c (inftarg_set_find_memory_regions): New function. + Allow to_find_memory_regions vector to be taken over. + (inftarg_set_make_corefile_notes): New function. + Allow to_make_corefile_notes vector to be taken over. + * thread-db.c (thread_db_new_objfile): Don't activate thread-db + interface layer if not target_has_execution (may be a corefile). + * config/i386/linux.mh: Add gcore.o to NATDEPFILES. + * config/sparc/sun4sol2.mh: Ditto. + * config/alpha/alpha-linux.mh: Ditto. + * config/arm/linux.mh: Ditto. + * config/i386/x86-64linux.mh: Ditto. + * config/ia64/linux.mh: Ditto. + * config/m68k/linux.mh: Ditto. + * config/mips/linux.mh: Ditto. + * config/powerpc/linux.mh: Ditto. + * config/sparc/linux.mh: Ditto. + +2002-01-07 Michael Snyder + + * arm-linux-nat.c: Remove references to regcache.c internal data + (registers[] and register_valid[]). + +2002-01-07 Michael Snyder + + * linux-proc.c: New file. Implement child_pid_to_exec_file, + so that attaching to a pid will automatically read the process's + symbol file and shlibs. + * Makefile.in: Add rule for linux-proc.o. + * config/nm-linux.h: Define CHILD_PID_TO_EXEC_FILE. + * config/alpha/alpha-linux.mh: Add linux-proc.o to NATDEPFILES. + * config/arm/linux.mh: Ditto. + * config/i386/linux.mh: Ditto. + * config/i386/x86-64linux.mh: Ditto. + * config/ia64/linux.mh: Ditto. + * config/m68k/linux.mh: Ditto. + * config/mips/linux.mh: Ditto. + * config/powerpc/linux.mh: Ditto. + * config/sparc/linux.mh: Ditto. + +2002-01-06 Pierre Muller + + * win32-nat.c: Add i386-tdep.h dependency. + +2002-01-07 Michael Snyder + + * solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT + instead of bfd_get_arch_size. Don't bail out just because + there's no exec_bfd. + + * cp-valprint.c (cp_print_value): FIXME comment, alloca size. + * p-valprint.c (pascal_object_print_value): Ditto. + * somread.c (som_symtab_read): Ditto. + * symfile.c (simple_free_overlay_region_table): Ditto. + * valops.c (value_assign): Ditto. + + * tracepoint.c (tracepoint_save_command): From Klee Dienes -- + use tilde_expand and strerror for opening save-tracepoints file. + + * thread-db.c (thread_db_new_objfile): Indendation fix. + + * infptrace.c (GDB_MAX_ALLOCA): New define. + (child_xfer_memory): Use xmalloc/xfree instead of alloca if the + size of the buffer exceeds GDB_MAX_ALLOCA (default 1 megabyte, + can be overridden with whatever value is appropriate to the host). + * infttrace.c (child_xfer_memory): Add FIXME warning about use of + alloca to allocate potentially large buffer. + * rs6000-nat.c (child_xfer_memory): Ditto. + * symm-nat.c (child_xfer_memory): Ditto. + * x86-64-linux-nat.c (child_xfer_memory): Ditto. + +2002-01-07 Jackie Smith Cashion + + From Nick Clifton + * d10v-tdep.c: Set STACK_START to 0x200bffe. + +2002-01-07 Michael Snyder + + * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): + Don't use exec_bfd if it's NULL. + +2002-01-06 Mark Kettenis + + * valops.c (value_arg_coerce): Fix formatting. + +2002-01-06 Andrew Cagney + + * hp-psymtab-read.c: Include "gdb_string.h" instead of . + * gnu-nat.c: Ditto. + +2002-01-06 Andrew Cagney + + * MAINTAINERS: Note that alpha-dec-osf4.0a, arc-elf, arm-coff, + arm-elf, arm-pe, d30v-elf, fr30-elf, h8300hms, h8500hms, + i960-coff, m32r-elf, m68k-elf, m88k, mcore-elf, mn10200-elf, + ns32k-netbsd, hppa1.1-hp-proelf, v850-elf, vax-dec-vms5.5 and + z8k-coff have not been multi-arched. Update z8k-coff build + status. + +2002-01-06 Andrew Cagney + + * MAINTAINERS: Mark a29k target as obsolete. + * Makefile.in (a29k-tdep.o, remote-adapt.o, remote-eb.o) + (remote-mm.o, remote-udi.o): Obsolete. Remove references in + comments. + * NEWS: Note that a29k targets are obsolete. + * a29k-tdep.c: Mark as obsolete. + * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, + a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and + a29k-*-vxworks* targets as obsolete. + * remote-adapt.c: Obsolete. + * remote-eb.c: Obsolete. + * remote-mm.c: Obsolete. + * remote-udi.c: Obsolete. + * config/a29k/a29k-udi.mt: Obsolete. + * config/a29k/a29k.mt: Obsolete. + * config/a29k/tm-a29k.h: Obsolete. + * config/a29k/tm-vx29k.h: Obsolete. + * config/a29k/vx29k.mt: Obsolete. + +2002-01-05 Andrew Cagney + + * rs6000-tdep.c (rs6000_do_registers_info): Replace BIG_ENDIAN + with BFD_ENDIAN_BIG. + +2002-01-05 Andrew Cagney + + * configure.in (AC_CHECK_HEADERS): Do not check for . + * configure, config.in: Re-generate. + * config/vax/xm-vaxbsd.h: Do not include . + * defs.h: Do not include . + +2002-01-05 Jason Thorpe + + * acconfig.h (HAVE_PT_GETXMMREGS): New. + * config.in: Regenerate. + * configure.in: Update copyright years. + Add test for PT_GETXMMREGS supplied by . + * configure: Regenerate. + * i386bsd-nat.c: Update copyright years. + (fill_gregset): Use regcache_collect. + (fetch_inferior_registers): Only fetch integer registers + if requested to do so. Add support for XMM registers + using PT_GETXMMREGS. + (store_inferior_registers): Only store integer registers + if requested to do so. Add support for XMM registers + using PT_SETXMMREGS. + * i386nbsd-nat.c (fetch_inferior_registers): Remove. + (store_inferior_registers): Remove. + (fetch_core_registers): Use supply_gregset and i387_supply_fsave. + (fetch_elfcore_registers): New function. + (i386nbsd_elfcore_fns): New. + (_initialize_i386nbsd_nat): Register i386nbsd_elfcore_fns. + * config/i386/nbsd.mh (NATDEPFILES): Add i387-nat.o and + i386bsd-nat.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/nbsd.mt (TDEPFILES): Add i386bsd-nat.o. + * config/i386/nbsdelf.mt (TDEPFILES): Likewise. + * config/i386/tm-nbsd.h: Update copyright years. + (HAVE_SSE_REGS): Define. + (IN_SIGTRAMP): Define as i386bsd_in_sigtramp. + (SIGTRAMP_START): Redefine as i386bsd_sigtramp_start. + (SIGTRAMP_END): Redefine as i386bsd_sigtramp_end. + (SIGCONTEXT_PC_OFFSET): Remove. + (FRAME_SAVED_PC): Define as i386bsd_frame_saved_pc. + +2002-01-05 Andrew Cagney + + * configure.tgt: Remove powerpc-*-macos* target. + * config/m68k/xm-mpw.h: Delete file. + * config/xm-mpw.h: Delete file. + * ser-mac.c: Delete file. + * mpw-make.sed: Delete file. + * mpw-config.in: Delete file. + * mac-xdep.c: Delete file. + * mac-gdb.r: Delete file. + * mac-defs.h: Delete file. + * mac-nat.c: Delete file. + * config/powerpc/macos.mh: Delete file. + * config/powerpc/macos.mt: Delete file. + * config/powerpc/nm-macos.h: Delete file. + * config/powerpc/tm-macos.h: Delete file. + * source.c (openp, open_source_file): Remove obsolete code. + * top.c (gdb_readline): Ditto. + * utils.c (query): Ditto. + * event-top.c (display_gdb_prompt): Ditto. + * Makefile.in (ser-mac.o): Delete obsolete target. + * NEWS: Update. + +2002-01-04 Andrew Cagney + + * defs.h (BIG_ENDIAN): Delete macro definition. + * a29k-tdep.c, arch-utils.c, arm-tdep.c, ax-gdb.c, ch-exp.c, + coffread.c, cris-tdep.c, d10v-tdep.c, d30v-tdep.c, defs.h, + findvar.c, infcmd.c, mem-break.c, mips-tdep.c, mn10300-tdep.c, + printcmd.c, remote-os9k.c, remote-rdi.c, remote-rdp.c, + remote-sim.c, remote.c, rs6000-tdep.c, sh-tdep.c, sparcl-tdep.c, + stabsread.c, valops.c, valprint.c, config/a29k/tm-a29k.h, + config/a29k/tm-vx29k.h, config/arm/tm-arm.h, + config/d30v/tm-d30v.h, config/fr30/tm-fr30.h, + config/h8300/tm-h8300.h, config/h8500/tm-h8500.h, + config/m32r/tm-m32r.h, config/m68k/tm-m68k.h, + config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h, + config/sparc/tm-sparc.h, config/z8k/tm-z8k.h, mi/mi-cmd-disas.c, + mi/mi-main.c: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. + * gdbarch.sh: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. + * gdbarch.c: Re-generate. + +2002-01-04 Daniel Jacobowitz + + * thread-db.c (thread_db_new_objfile): Do not enable thread_db + for core files. + +2002-01-04 Jason Thorpe + + * config/arm/nbsd.mh (XDEPFILES): Remove ser-tcp.o. + +2002-01-04 Andrew Cagney + + * value.h (value_ptr): Delete typedef. + +2002-01-04 Jason Thorpe + + * i386nbsd-nat.c: Update copyright years. + Include i386-tdep.h. + +2002-01-04 Elena Zannoni + + * stabsread.c: Update copyright years. + + From Debashis Mahata : + (read_struct_fields): Deal with Sun C compiler erroneous stab + output for structs and unions. + Fix PR gdb/269. + +2002-01-04 Daniel Jacobowitz + + * p-valprint.c: Include "cp-abi.h" for baseclass_offset + prototype. + +2002-01-04 Daniel Jacobowitz + + * cp-abi.c: Fix whitespace. + (baseclass_offset): New wrapper function. + * cp-abi.h (baseclass_offset): Add prototype. + (struct cp_abi_ops): Add baseclass_offset pointer. + + * valops.c (vb_match): Move to... + * gnu-v2-abi.c (vb_match): here. + * valops.c (baseclass_offset): Move to... + * gnu-v2-abi.c (gnuv2_baseclass_offset): here, and rename. + + * gnu-v3-abi.c (gnuv3_baseclass_offset): New function. + + * gnu-v2-abi.c (init_gnuv2_ops): Initialize baseclass_offset. + * gnu-v3-abi.c (init_gnuv3_ops): Likewise. + * hpacc-abi.c (init_hpacc_ops): Likewise. + +2002-01-04 Daniel Jacobowitz + + * valops.c (find_overload_match): Accept obj as a + reference parameter. Update it before returning. + * value.h (find_overload_match): Update prototype. + * eval.c (evaluate_subexp_standard): Pass object to + find_overload_match by reference. + +2002-01-03 Andrew Cagney + + * valarith.c: Replace value_ptr with struct value pointer. Remove + register attribute from value declarations. + * valops.c: Ditto. + * value.h: Ditto. + * scm-lang.c (scm_lookup_name): Ditto. + +2002-01-03 Michael Snyder + + Abstract the functionality of iterating over mapped memory + regions into a general purpose iterator function. + * procfs.c (iterate_over_mappings): New function, general purpose + iterator for memory sections. + (proc_iterate_over_mappings): Reimplement using iterate_over_mappings. + (solib_mappings_callback): New function, callback for above. + (info_proc_mappings): Reimpliment using iterate_over_mappings. + (info_mappings_callback): New function, callback for above. + + * procfs.c (proc_set_watchpoint): Add cast to suppress warning. + +2002-01-01 Mark Kettenis + + * i386-tdep.h (struct gdbarch_tdep): Add `os_ident' member. + * i386-tdep.c: Include "elf-bfd.h". + (process_note_abi_tag_sections): New function. + (i386_gdbarch_init): Add code to recognize various OS/ABI + combinations. + + * maint.c (_initialize_maint_cmds): Add missing \ in + string-literal. + +For older changes see ChangeLog-2001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index b6a7655..cc6b053 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -1,7 +1,7 @@ GDB Maintainers - Blanket Write Privs + Global Maintainers (alphabetic) Jim Blandy jimb@redhat.com @@ -24,7 +24,7 @@ Note individuals who maintain parts of the debugger need approval to check in changes outside of the immediate domain that they maintain. If there is no maintainer for a given domain then the responsibility -falls to the head maintainer. +falls to a global maintainer. If there are several maintainers for a given domain then responsibility falls to the first maintainer. The first maintainer is @@ -391,7 +391,7 @@ Stan Shebs shebs@apple.com Aidan Skinner aidan@velvet.net Jiri Smid smid@suse.cz David Smith dsmith@redhat.com -Stephen P. Smith ischis2@home.com +Stephen P. Smith ischis2@cox.net Jackie Smith Cashion jsmith@redhat.com Michael Snyder msnyder@redhat.com Petr Sorfa petrs@caldera.com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 057405f..8eee1c2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -136,6 +136,10 @@ INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC) # Where is the ICONV library? This can be empty if libc has iconv. LIBICONV = @LIBICONV@ +# Did the user give us a --with-sysroot option? +TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ +TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ + # # CLI sub directory definitons # @@ -318,7 +322,8 @@ GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(prefix)/share/l # M{H,T}_CFLAGS, if defined, have host- and target-dependent CFLAGS # from the config directory. GLOBAL_CFLAGS = $(MT_CFLAGS) $(MH_CFLAGS) -#PROFILE_CFLAGS = -pg + +PROFILE_CFLAGS = @PROFILE_CFLAGS@ # CFLAGS is specifically reserved for setting from the command line # when running make. I.E. "make CFLAGS=-Wmissing-prototypes". @@ -345,7 +350,8 @@ LDFLAGS = @LDFLAGS@ # Profiling options need to go here to work. # I think it's perfectly reasonable for a user to set -pg in CFLAGS # and have it work; that's why CFLAGS is here. -INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) +# PROFILE_CFLAGS is _not_ included, however, because we use monstartup. +INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) # If your system is missing alloca(), or, more likely, it's there but # it doesn't work, then refer to libiberty. @@ -507,6 +513,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ dummy-frame.c dwarfread.c dwarf2read.c \ elfread.c environ.c eval.c event-loop.c event-top.c expprint.c \ f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c frame.c \ + frame-unwind.c \ gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \ hpacc-abi.c \ inf-loop.c infcmd.c inflow.c infrun.c \ @@ -521,7 +528,9 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ objfiles.c osabi.c \ p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \ regcache.c reggroups.c remote.c \ - scm-exp.c scm-lang.c scm-valprint.c serial.c ser-unix.c source.c \ + scm-exp.c scm-lang.c scm-valprint.c \ + sentinel-frame.c \ + serial.c ser-unix.c source.c \ stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \ target.c thread.c top.c tracepoint.c typeprint.c \ tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \ @@ -619,6 +628,7 @@ event_top_h = event-top.h expression_h = expression.h $(symtab_h) $(doublest_h) f_lang_h = f-lang.h frame_h = frame.h +frame_unwind_h = frame-unwind.h gdb_events_h = gdb-events.h gdb_stabs_h = gdb-stabs.h gdb_h = gdb.h @@ -678,6 +688,7 @@ 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 +sentinel_frame_h = sentinel-frame.h ser_unix_h = ser-unix.h serial_h = serial.h sh_tdep_h = sh-tdep.h @@ -769,9 +780,6 @@ HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \ jv-lang.h \ m2-lang.h p-lang.h \ complaints.h valprint.h \ - nindy-share/b.out.h \ - nindy-share/block_io.h nindy-share/coff.h \ - nindy-share/env.h nindy-share/stop.h \ vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \ vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \ vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \ @@ -824,12 +832,14 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ varobj.o wrapper.o \ jv-lang.o jv-valprint.o jv-typeprint.o \ m2-lang.o p-lang.o p-typeprint.o p-valprint.o \ - scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \ + scm-exp.o scm-lang.o scm-valprint.o \ + sentinel-frame.o \ + complaints.o typeprint.o \ c-typeprint.o f-typeprint.o m2-typeprint.o \ c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \ nlmread.o serial.o mdebugread.o top.o utils.o \ ui-file.o \ - frame.o doublest.o \ + frame.o frame-unwind.o doublest.o \ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \ reggroups.o @@ -947,10 +957,8 @@ init.c: $(INIT_FILES) @rm -f init.c-tmp init.l-tmp @-echo $(INIT_FILES) | \ tr ' ' '\012' | \ - sed -e '/^Onindy.o/d' \ + sed \ -e '/^init.o/d' \ - -e '/^nindy.o/d' \ - -e '/ttyflush.o/d' \ -e '/xdr_ld.o/d' \ -e '/xdr_ptrace.o/d' \ -e '/xdr_rdb.o/d' \ @@ -1003,31 +1011,6 @@ libgdb.a: $(LIBGDB_OBS) $(AR) q libgdb.a $(LIBGDB_OBS) $(RANLIB) libgdb.a -saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c - #setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS - #load ./init.c $(SFILES) - #unload $(srcdir)/c-exp.y - #unload $(srcdir)/jv-exp.y - #unload $(srcdir)/m2-exp.y - #unload $(srcdir)/p-exp.y - #unload vx-share/*.h - #unload nindy-share/[A-Z]* - #load c-exp.tab.c - #load jv-exp.tab.c - #load m2-exp.tab.c - #load p-exp.tab.c - #load copying.c version.c - #load ../opcodes/libopcodes.a - #load ../libiberty/libiberty.a - #load ../bfd/libbfd.a - #load ../readline/libreadline.a - #load ../mmalloc/libmmalloc.a - #load ../intl/libintl.a - #load -ltermcap - #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` - echo "Load .c corresponding to:" $(DEPFILES) - - # A Mach 3.0 program to force gdb back to command level stop-gdb: stop-gdb.o @@ -1331,7 +1314,7 @@ force_update: # will remove them. MAKEOVERRIDES= -ALLDEPFILES = a68v-nat.c \ +ALLDEPFILES = \ aix-thread.c \ alpha-nat.c alphabsd-nat.c \ alpha-tdep.c alpha-linux-tdep.c alphabsd-tdep.c alphanbsd-tdep.c \ @@ -1343,7 +1326,7 @@ ALLDEPFILES = a68v-nat.c \ core-sol2.c core-regset.c core-aout.c corelow.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 hppa-hpux-tdep.c \ + hppa-tdep.c hppa-hpux-tdep.c \ hppab-nat.c hppah-nat.c hpread.c \ i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \ i386v4-nat.c i386ly-tdep.c \ @@ -1363,15 +1346,13 @@ ALLDEPFILES = a68v-nat.c \ mips-tdep.c mipsm3-nat.c mipsv4-nat.c \ mipsnbsd-nat.c mipsnbsd-tdep.c \ nbsd-tdep.c \ - nindy-share/Onindy.c nindy-share/nindy.c \ - nindy-share/ttyflush.c nindy-tdep.c \ ns32k-tdep.c solib-osf.c \ somread.c somsolib.c $(HPREAD_SOURCE) \ ppc-sysv-tdep.o ppc-linux-nat.c ppc-linux-tdep.c \ ppcnbsd-nat.o ppcnbsd-tdep.o \ procfs.c \ remote-array.c remote-e7000.c \ - remote-es.c remote-hms.c remote-mips.c \ + remote-hms.c remote-mips.c \ remote-rdp.c remote-sim.c \ remote-st.c remote-utils.c dcache.c \ remote-vx.c \ @@ -1403,6 +1384,11 @@ hpux-thread.o: $(srcdir)/hpux-thread.c -I$(srcdir)/osf-share/HP800 -I/usr/include/dce \ $(srcdir)/hpux-thread.c +# main.o needs an explicit build rule to get TARGET_SYSTEM_ROOT and BINDIR. +main.o: main.c + $(CC) -c $(INTERNAL_CFLAGS) $(TARGET_SYSTEM_ROOT_DEFINE) \ + -DBINDIR=\"$(bindir)\" $(srcdir)/main.c + # FIXME: Procfs.o gets -Wformat errors because things like pid_t don't # match output format strings. procfs.o: $(srcdir)/procfs.c @@ -1465,7 +1451,6 @@ ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.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) $(m68k_tdep_h) ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ @@ -1603,9 +1588,9 @@ cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ $(solib_h) $(solib_svr4_h) $(gdb_string_h) 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) $(gdb_sim_d10v_h) \ - $(sim_regno_h) + $(dis_asm_h) $(symfile_h) $(objfiles_h) $(language_h) $(arch_utils_h) \ + $(regcache_h) $(floatformat_h) $(gdb_sim_d10v_h) $(sim_regno_h) \ + $(gdb_assert_h) dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(m68k_tdep_h) dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \ @@ -1627,7 +1612,7 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \ dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \ - $(frame_h) $(inferior_h) $(gdb_assert_h) + $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) 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) \ @@ -1679,7 +1664,10 @@ fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(builtin_regs_h) \ $(gdb_obstack_h) $(dummy_frame_h) $(gdbcore_h) $(annotate_h) \ - $(language_h) + $(language_h) $(frame_unwind_h) $(command_h) $(gdbcmd_h) \ + $(sentinel_frame_h) +frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \ + $(gdb_assert_h) $(dummy_frame_h) $(legacy_frame_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) \ @@ -1714,8 +1702,6 @@ h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_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) \ @@ -1932,14 +1918,10 @@ mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_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) $(gdb_string_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) \ @@ -2015,8 +1997,6 @@ 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) $(reggroups_h) $(gdb_assert_h) \ $(gdb_string_h) $(gdbcmd_h) @@ -2028,9 +2008,6 @@ remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ 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) $(m68k_tdep_h) remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ @@ -2110,6 +2087,8 @@ scm-lang.o: scm-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_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) +sentinel-frame.o: sentinel-frame.c $(defs_h) $(regcache_h) \ + $(sentinel_frame_h) $(inferior_h) $(frame_unwind_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) \ @@ -2205,7 +2184,7 @@ symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_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) $(source_h) \ - $(readline_h) + $(gdb_assert_h) $(readline_h) $(filenames_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) \ @@ -2376,7 +2355,7 @@ install-gdbtk: $(DESTDIR)$(GDBTK_LIBRARY)/help/images \ $(DESTDIR)$(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; \ + 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 help/images/*.png; \ do \ $(INSTALL_DATA) $$i $(DESTDIR)$(GDBTK_LIBRARY)/$$i ; \ done ; @@ -2529,23 +2508,6 @@ mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c # -# 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. - -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 - -ttyflush.o: nindy-share/ttyflush.c $(srcdir)/nindy-share/ttyflush.c - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c - -# # rdi-share sub-directory # # Need to explicitly specify the compile rule as make will do nothing diff --git a/gdb/NEWS b/gdb/NEWS index cb3af22..6bb4508 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,19 @@ *** Changes since GDB 5.3: +* d10v `regs' command deprecated + +The `info registers' command has been updated so that it displays the +registers using a format identical to the old `regs' command. + +* Profiling support + +A new command, "maint set profile on/off", has been added. This command can +be used to enable or disable profiling while running GDB, to profile a +session or a set of commands. In addition there is a new configure switch, +"--enable-profiling", which will cause GDB to be compiled with profiling +data, for more informative profiling results. + * Default MI syntax changed to "mi2". The default MI (machine interface) syntax, enabled by the command line diff --git a/gdb/README b/gdb/README index 5f722b4..a8b4b82 100644 --- a/gdb/README +++ b/gdb/README @@ -69,7 +69,20 @@ different; see the file gdb-5.3/gdb/config/djgpp/README for details.) `configure' can't determine your system type, specify one as its argument, e.g., `./configure sun4' or `./configure decstation'. - If you get compiler errors during this stage, see the `Reporting + Make sure that your 'configure' line ends in 'gdb-5.3/configure': + + /berman/migchain/source/gdb-5.3/configure # RIGHT + /berman/migchain/source/gdb-5.3/gdb/configure # WRONG + + The gdb package contains several subdirectories, such as 'gdb', +'bfd', and 'readline'. If your 'configure' line ends in +'gdb-5.3/gdb/configure', then you are configuring only the gdb +subdirectory, not the whole gdb package. This leads to build errors +such as: + + make: *** No rule to make target `../bfd/bfd.h', needed by `gdb.o'. Stop. + + If you get other compiler errors during this stage, see the `Reporting Bugs' section below; there are a few known problems. GDB requires an ISO C (ANSI C) compiler. If you do not have an ISO @@ -451,7 +464,6 @@ monitors and other hardware: remote-array.c Array Tech RAID controller remote-e7000.c Hitachi E7000 ICE - remote-es.c Ericsson 1800 monitor remote-est.c EST emulator remote-hms.c Hitachi Micro Systems H8/300 monitor remote-mips.c MIPS remote debugging protocol @@ -497,7 +509,7 @@ Graphical interface to GDB -- X Windows, MS Windows Several graphical interfaces to GDB are available. You should check: - http://www.gnu.org/software/gdb/gui/ + http://www.gnu.org/software/gdb/links/ for an up-to-date list. diff --git a/gdb/a68v-nat.c b/gdb/a68v-nat.c deleted file mode 100644 index 0bfe8e2..0000000 --- a/gdb/a68v-nat.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Host-dependent code for Apollo-68ks for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 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 "inferior.h" -#include "regcache.h" - -#ifndef _ISP__M68K -#define _ISP__M68K 1 -#endif - -#include - -extern int errno; - -void -fetch_inferior_registers (int ignored) -{ - struct ptrace_$data_regs_m68k inferior_registers; - struct ptrace_$floating_regs_m68k inferior_fp_registers; - struct ptrace_$control_regs_m68k inferior_control_registers; - - ptrace_$init_control (&inferior_control_registers); - inferior_fp_registers.size = sizeof (inferior_fp_registers); - - deprecated_registers_fetched (); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, - ptrace_$data_set, - (PTRACE_ARG3_TYPE) & inferior_registers, - ptrace_$data_set); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k); - - bcopy (&inferior_registers, &deprecated_registers[0], 16 * 4); - bcopy (&inferior_fp_registers, - &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.regs); - *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)] - = inferior_control_registers.sr; - *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)] - = inferior_control_registers.pc; -} - -/* 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 ptrace_$data_regs_m68k inferior_registers; - struct ptrace_$floating_regs_m68k inferior_fp_registers; - struct ptrace_$control_regs_m68k inferior_control_registers; - - ptrace_$init_control (&inferior_control_registers); - inferior_fp_registers.size = sizeof (inferior_fp_registers); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k); - - bcopy (&deprecated_registers[0], &inferior_registers, - sizeof (inferior_registers)); - - bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], - inferior_fp_registers.regs, sizeof inferior_fp_registers.regs); - - inferior_control_registers.sr - = *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]; - inferior_control_registers.pc - = *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]; - - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, - ptrace_$data_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_registers, - ptrace_$data_set_m68k); - - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - ptrace_$floating_set_m68k); - - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k, - (PTRACE_ARG3_TYPE) & inferior_control_registers, - ptrace_$control_set_m68k); -} diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index a215108..e8951df 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -927,3 +927,18 @@ AC_DEFUN([AC_GNU_SOURCE], AC_BEFORE([$0], [AC_TRY_RUN])dnl AC_DEFINE([_GNU_SOURCE]) ]) + +dnl written by Guido Draheim , original by Alexandre Oliva +dnl Version 1.3 (2001/03/02) +dnl source http://www.gnu.org/software/ac-archive/Miscellaneous/ac_define_dir.html + +AC_DEFUN([AC_DEFINE_DIR], [ + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo [$]$2` + ac_define_dir=`eval echo [$]ac_define_dir` + ifelse($3, , + AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) +]) + diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index 8391330..d925c33 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -1,6 +1,6 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 +dnl aclocal.m4 generated automatically by aclocal 1.4 -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -936,12 +936,27 @@ AC_BEFORE([$0], [AC_TRY_RUN])dnl AC_DEFINE([_GNU_SOURCE]) ]) +dnl written by Guido Draheim , original by Alexandre Oliva +dnl Version 1.3 (2001/03/02) +dnl source http://www.gnu.org/software/ac-archive/Miscellaneous/ac_define_dir.html + +AC_DEFUN([AC_DEFINE_DIR], [ + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo [$]$2` + ac_define_dir=`eval echo [$]ac_define_dir` + ifelse($3, , + AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) +]) + + # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 -AC_DEFUN([AM_MAINTAINER_MODE], +AC_DEFUN(AM_MAINTAINER_MODE, [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, @@ -958,7 +973,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], # Define a conditional. -AC_DEFUN([AM_CONDITIONAL], +AC_DEFUN(AM_CONDITIONAL, [AC_SUBST($1_TRUE) AC_SUBST($1_FALSE) if $2; then diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 0a0c99a..8633f2c 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -66,7 +66,7 @@ static void val_print_packed_array_elements (struct type *, char *valaddr, static void adjust_type_signedness (struct type *); -static int ada_val_print_stub (PTR args0); +static int ada_val_print_stub (void *args0); static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR, struct ui_file *, int, int, int, @@ -512,7 +512,7 @@ ada_val_print (struct type *type, char *valaddr0, int embedded_offset, /* Helper for ada_val_print; used as argument to catch_errors to unmarshal the arguments to ada_val_print_1, which does the work. */ static int -ada_val_print_stub (PTR args0) +ada_val_print_stub (void * args0) { struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0; return ada_val_print_1 (argsp->type, argsp->valaddr0, diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index f315508..548869b 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -1,5 +1,5 @@ /* Low level Alpha interface, for GDB when running native. - Copyright 1993, 1995, 1996, 1998, 1999, 2000, 2001 + Copyright 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -149,25 +149,36 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size, memset (&deprecated_registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8); memset (&deprecated_register_valid[ALPHA_V0_REGNUM], 1, 32); deprecated_register_valid[PC_REGNUM] = 1; + + if (core_reg_size >= 33 * 8) + { + memcpy (&deprecated_registers[REGISTER_BYTE (ALPHA_UNIQUE_REGNUM)], + core_reg_sect + 32 * 8, 8); + deprecated_register_valid[ALPHA_UNIQUE_REGNUM] = 1; + } } } /* Map gdb internal register number to a ptrace ``address''. - These ``addresses'' are defined in */ + These ``addresses'' are defined in , with + the exception of ALPHA_UNIQUE_PTRACE_ADDR. */ -#define REGISTER_PTRACE_ADDR(regno) \ - (regno < FP0_REGNUM ? GPR_BASE + (regno) \ - : regno == PC_REGNUM ? PC \ - : regno >= FP0_REGNUM ? FPR_BASE + ((regno) - FP0_REGNUM) \ - : 0) - -/* Return the ptrace ``address'' of register REGNO. */ +#ifndef ALPHA_UNIQUE_PTRACE_ADDR +#define ALPHA_UNIQUE_PTRACE_ADDR 0 +#endif CORE_ADDR register_addr (int regno, CORE_ADDR blockend) { - return REGISTER_PTRACE_ADDR (regno); + if (regno == PC_REGNUM) + return PC; + if (regno == ALPHA_UNIQUE_REGNUM) + return ALPHA_UNIQUE_PTRACE_ADDR; + if (regno < FP0_REGNUM) + return GPR_BASE + regno; + else + return FPR_BASE + regno - FP0_REGNUM; } int diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 9cca20d..cf5abc8 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -288,7 +288,7 @@ alpha_register_name (int regno) "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr", - "pc", "vfp", + "pc", "vfp", "unique", }; if (regno < 0) diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 6a75ca7..76f91f3 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -28,7 +28,7 @@ #define ALPHA_REGISTER_SIZE 8 /* Number of machine registers. */ -#define ALPHA_NUM_REGS 66 +#define ALPHA_NUM_REGS 67 /* Total amount of space needed to store our copies of the machine's register state. */ @@ -61,6 +61,7 @@ #define ALPHA_FPCR_REGNUM 63 /* Floating point control register */ #define ALPHA_PC_REGNUM 64 /* Contains program counter */ #define ALPHA_FP_REGNUM 65 /* Virtual frame pointer */ +#define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */ /* The alpha has two different virtual pointers for arguments and locals. diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index f2255f5..e38e675 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1,5 +1,7 @@ -/* GDB-specific functions for operating on agent expressions - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* GDB-specific functions for operating on agent expressions. + + Copyright 1998, 1999, 2000, 2001, 2003 Free Software Foundation, + Inc. This file is part of GDB. diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 35fc798..d5ed002 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -39,10 +39,6 @@ #include "command.h" #include "gdbcmd.h" -/* Flag to indicate whether backtraces should stop at main. */ - -static int backtrace_below_main; - /* Prototypes for exported functions. */ void _initialize_blockframe (void); @@ -611,24 +607,6 @@ block_innermost_frame (struct block *block) below is for infrun.c, which may give the macro a pc without that subtracted out. */ -extern CORE_ADDR text_end; - -int -deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) -{ - return ((pc) >= text_end - CALL_DUMMY_LENGTH - && (pc) <= text_end + DECR_PC_AFTER_BREAK); -} - -int -deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) -{ - return ((pc) >= text_end - && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK); -} - /* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and top of the stack frame which we are checking, where "bottom" and "top" refer to some section of memory which contains the code for @@ -697,53 +675,9 @@ frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) if (inside_entry_file (frame_pc_unwind (fi))) return 0; - /* If we want backtraces to stop at main, and we're inside main, then it - isn't valid. */ - if (!backtrace_below_main && inside_main_func (get_frame_pc (fi))) - return 0; - /* If the architecture has a custom FRAME_CHAIN_VALID, call it now. */ if (FRAME_CHAIN_VALID_P ()) return FRAME_CHAIN_VALID (fp, fi); return 1; } - -void -do_flush_frames_sfunc (char *args, int from_tty, struct cmd_list_element *c) -{ - int saved_level; - struct frame_info *cur_frame; - - if (! target_has_stack) - return; - - saved_level = frame_relative_level (get_selected_frame ()); - - flush_cached_frames (); - - cur_frame = find_relative_frame (get_current_frame (), &saved_level); - select_frame (cur_frame); - - /* If we were below main and backtrace-below-main was turned off, - SAVED_LEVEL will be non-zero. CUR_FRAME will point to main. - Accept this but print the new frame. */ - if (saved_level != 0) - print_stack_frame (get_selected_frame (), -1, 0); -} - -void -_initialize_blockframe (void) -{ - add_setshow_boolean_cmd ("backtrace-below-main", class_obscure, - &backtrace_below_main, - "Set whether backtraces should continue past \"main\".\n" - "Normally the caller of \"main\" is not of interest, so GDB will terminate\n" - "the backtrace at \"main\". Set this variable if you need to see the rest\n" - "of the stack trace.", - "Show whether backtraces should continue past \"main\".\n" - "Normally the caller of \"main\" is not of interest, so GDB will terminate\n" - "the backtrace at \"main\". Set this variable if you need to see the rest\n" - "of the stack trace.", - do_flush_frames_sfunc, NULL, &setlist, &showlist); -} diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 10c2bc6..4544ed5 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -73,7 +73,7 @@ static void map_breakpoint_numbers (char *, void (*)(struct breakpoint *)); static void ignore_command (char *, int); -static int breakpoint_re_set_one (PTR); +static int breakpoint_re_set_one (void *); static void clear_command (char *, int); @@ -108,9 +108,9 @@ static void breakpoint_1 (int, int); static bpstat bpstat_alloc (struct breakpoint *, bpstat); -static int breakpoint_cond_eval (PTR); +static int breakpoint_cond_eval (void *); -static void cleanup_executing_breakpoints (PTR); +static void cleanup_executing_breakpoints (void *); static void commands_command (char *, int); @@ -140,9 +140,9 @@ typedef struct } args_for_catchpoint_enable; -static int watchpoint_check (PTR); +static int watchpoint_check (void *); -static int cover_target_enable_exception_callback (PTR); +static int cover_target_enable_exception_callback (void *); static void maintenance_info_breakpoints (char *, int); @@ -1916,7 +1916,7 @@ bpstat_clear_actions (bpstat bs) /* Stub for cleaning up our state if we error-out of a breakpoint command */ /* ARGSUSED */ static void -cleanup_executing_breakpoints (PTR ignore) +cleanup_executing_breakpoints (void *ignore) { executing_breakpoint_commands = 0; } @@ -2331,7 +2331,7 @@ bpstat_print (bpstat bs) make it pass through catch_errors. */ static int -breakpoint_cond_eval (PTR exp) +breakpoint_cond_eval (void *exp) { struct value *mark = value_mark (); int i = !value_true (evaluate_expression ((struct expression *) exp)); @@ -2371,7 +2371,7 @@ bpstat_alloc (struct breakpoint *b, bpstat cbs /* Current "bs" value */ ) /* Check watchpoint condition. */ static int -watchpoint_check (PTR p) +watchpoint_check (void *p) { bpstat bs = (bpstat) p; struct breakpoint *b; @@ -5576,7 +5576,7 @@ until_break_command_continuation (struct continuation_arg *arg) /* ARGSUSED */ void -until_break_command (char *arg, int from_tty) +until_break_command (char *arg, int from_tty, int anywhere) { struct symtabs_and_lines sals; struct symtab_and_line sal; @@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from_tty) resolve_sal_pc (&sal); - breakpoint = - set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame), - bp_until); + if (anywhere) + /* If the user told us to continue until a specified location, + we don't specify a frame at which we need to stop. */ + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until); + else + /* Otherwise, specify the current frame, because we want to stop only + at the very same frame. */ + breakpoint = set_momentary_breakpoint (sal, + get_frame_id (deprecated_selected_frame), + bp_until); if (!event_loop_p || !target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from_tty) add_continuation (until_break_command_continuation, arg1); } - /* Keep within the current frame */ - + /* Keep within the current frame, or in frames called by the current + one. */ if (prev_frame) { sal = find_pc_line (get_frame_pc (prev_frame), 0); @@ -5659,7 +5666,7 @@ until_break_command (char *arg, int from_tty) if (!event_loop_p || !target_can_async_p ()) do_cleanups (old_chain); } - + #if 0 /* These aren't used; I don't konw what they were for. */ /* Set a breakpoint at the catch clause for NAME. */ @@ -6225,7 +6232,7 @@ catch_exception_command_1 (enum exception_event_kind ex_event, char *arg, inside a catch_errors */ static int -cover_target_enable_exception_callback (PTR arg) +cover_target_enable_exception_callback (void *arg) { args_for_catchpoint_enable *args = arg; struct symtab_and_line *sal; @@ -6902,7 +6909,7 @@ delete_command (char *arg, int from_tty) Unused in this case. */ static int -breakpoint_re_set_one (PTR bint) +breakpoint_re_set_one (void *bint) { /* get past catch_errs */ struct breakpoint *b = (struct breakpoint *) bint; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 7b359cb..ba4d278 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (struct frame_info *); extern int breakpoint_thread_match (CORE_ADDR, ptid_t); -extern void until_break_command (char *, int); +extern void until_break_command (char *, int, int); extern void breakpoint_re_set (void); diff --git a/gdb/buildsym.c b/gdb/buildsym.c index eabf8a8..5e9ac84 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -1,6 +1,7 @@ /* Support routines for building symbol tables in GDB's internal format. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -609,15 +610,17 @@ start_subfile (char *name, char *dirname) later via a call to record_debugformat. */ subfile->debugformat = NULL; - /* cfront output is a C program, so in most ways it looks like a C - program. But to demangle we need to set the language to C++. We - can distinguish cfront code by the fact that it has #line - directives which specify a file name ending in .C. - - So if the filename of this subfile ends in .C, then change the +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* cfront output is a C program, so in most ways it looks like a C +// OBSOLETE program. But to demangle we need to set the language to C++. We +// OBSOLETE can distinguish cfront code by the fact that it has #line +// OBSOLETE directives which specify a file name ending in .C. */ +#endif /* OBSOLETE CFront */ + + /* If the filename of this subfile ends in .C, then change the language of any pending subfiles from C to C++. We also accept - any other C++ suffixes accepted by deduce_language_from_filename - (in particular, some people use .cxx with cfront). */ + any other C++ suffixes accepted by deduce_language_from_filename. */ + /* OBSOLETE (in particular, some people use .cxx with cfront). */ /* Likewise for f2c. */ if (subfile->name) diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 9df0aee..d47588e 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -781,7 +781,7 @@ array_mod: '[' ']' func_mod: '(' ')' { $$ = 0; } | '(' nonempty_typelist ')' - { free ((PTR)$2); $$ = 0; } + { free ($2); $$ = 0; } ; /* We used to try to recognize more pointer to member types here, but diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index e7c02cc..53b07c6 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -1,7 +1,7 @@ /* Support for printing C values for GDB, the GNU debugger. - Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/charset.c b/gdb/charset.c index d24eb70..4f5e5b4 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -1,5 +1,6 @@ /* Character set conversion support for GDB. - Copyright 2001 Free Software Foundation, Inc. + + Copyright 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index cb54721..d8ab67d 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -1,5 +1,6 @@ /* Header file for GDB command decoding library. - Copyright 2000 Free Software Foundation, Inc. + + Copyright 2000, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 2b23301..6b7bec6 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1228,7 +1228,7 @@ struct source_cleanup_lines_args }; static void -source_cleanup_lines (PTR args) +source_cleanup_lines (void *args) { struct source_cleanup_lines_args *p = (struct source_cleanup_lines_args *) args; diff --git a/gdb/complaints.c b/gdb/complaints.c index b4c55da..4758008 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -249,16 +249,6 @@ internal_complaint (struct complaints **complaints, const char *file, va_end (args); } -void -complain (struct deprecated_complaint *complaint, ...) -{ - va_list args; - va_start (args, complaint); - vcomplaint (&symfile_complaints, NULL/*file*/, 0/*line*/, - complaint->message, args); - va_end (args); -} - /* Clear out / initialize all complaint counters that have ever been incremented. If LESS_VERBOSE is 1, be less verbose about successive complaints, since the messages are appearing all diff --git a/gdb/complaints.h b/gdb/complaints.h index a94de27..0168b52 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -50,42 +50,4 @@ extern void clear_complaints (struct complaints **complaints, int less_verbose, int noisy); -/* Deprecated interfaces to keep the old code working (until it is all - converted to the above). Existing code such as: - - struct deprecated_complaint msg = { "msg 0x%08x[sic]", 0, 0 }; - deprecated_complain (&msg, addr); - - should be replaced by either the new call (for the singular case): - - complaint (&symtab_complaints, "msg 0x%s", paddr (addr)); - - or with a wrapper function (for the many-of case): - - msg_complaint (CORE_ADDR addr) - { complaint (&symtab_complaints, "msg 0x%s", paddr (addr)); } - ... - msg_complaint (addr); - - Yes, the typo is intentional. The motivation behind this interface - change is to eliminate all possibility of this problem re-occurring - (it has occurred in the past and no one is sure that it isn't - present now). - - Support for complaining about things in the symbol file that aren't - catastrophic. - - Each such thing gets a counter. The first time we have the problem, - during a symbol read, we report it. At the end of symbol reading, - if verbose, we report how many of each problem we had. */ - -struct deprecated_complaint -{ - const char *message; - unsigned counter_ignored; - struct deprecated_complaint *next_ignored; -}; - -extern void complain (struct deprecated_complaint *, ...); - #endif /* !defined (COMPLAINTS_H) */ diff --git a/gdb/config.in b/gdb/config.in index 2e49e00..06f4670 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -188,6 +188,9 @@ /* Define if you have the __argz_stringify function. */ #undef HAVE___ARGZ_STRINGIFY +/* Define if you have the _mcleanup function. */ +#undef HAVE__MCLEANUP + /* Define if you have the canonicalize_file_name function. */ #undef HAVE_CANONICALIZE_FILE_NAME @@ -200,6 +203,9 @@ /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE +/* Define if you have the monstartup function. */ +#undef HAVE_MONSTARTUP + /* Define if you have the munmap function. */ #undef HAVE_MUNMAP @@ -416,6 +422,9 @@ /* Name of this package. */ #undef PACKAGE +/* Global directory for separate debug files. */ +#undef DEBUGDIR + /* Define to BFD's default architecture. */ #undef DEFAULT_BFD_ARCH diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h index fed32e7..9e99b33 100644 --- a/gdb/config/alpha/nm-linux.h +++ b/gdb/config/alpha/nm-linux.h @@ -1,7 +1,7 @@ /* Native definitions for alpha running GNU/Linux. - Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002 Free Software - Foundation, Inc. + Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -45,4 +45,7 @@ pointer to the first register. */ #define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp)) +/* The address of UNIQUE for ptrace. */ +#define ALPHA_UNIQUE_PTRACE_ADDR 65 + #endif /* NM_LINUX_H */ diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index 046b065..5792b35 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -32,6 +32,7 @@ @V@/bfd/elf64-alpha-fbsd.c @V@/bfd/e64alph.c @V@/bfd/elf64-sh64.c @V@/bfd/e64sh64.c @V@/bfd/elf64-sh64-nbsd.c @V@/bfd/e64sh64n.c +@V@/bfd/po/.cvsignore @V@/bfd/po/_cvsignore @V@/dejagnu/baseboards/mn10200-cygmon.exp @V@/dejagnu/baseboards/mn10200cygmon.exp @V@/dejagnu/baseboards/mn10200-sim.exp @V@/dejagnu/baseboards/mn10200sim.exp @V@/dejagnu/baseboards/mn10300-cygmon.exp @V@/dejagnu/baseboards/mn10300cygmon.exp @@ -66,7 +67,9 @@ @V@/gdb/ChangeLog-1999 @V@/gdb/ChangeLog.99 @V@/gdb/ChangeLog-2000 @V@/gdb/ChangeLog.000 @V@/gdb/ChangeLog-2001 @V@/gdb/ChangeLog.001 +@V@/gdb/ChangeLog-2002 @V@/gdb/ChangeLog.002 @V@/gdb/ChangeLog-3.x @V@/gdb/ChangeLog.3-x +@V@/gdb/ada-exp.tab.c @V@/gdb/ada-exp_tab.c @V@/gdb/alphabsd-nat.c @V@/gdb/alphb-nat.c @V@/gdb/alphabsd-tdep.c @V@/gdb/alphb-tdep.c @V@/gdb/alphanbsd-nat.c @V@/gdb/alphnb-nat.c @@ -105,6 +108,8 @@ @V@/gdb/config/mips/tm-embed64.h @V@/gdb/config/mips/tm-emb64.h @V@/gdb/config/mips/tm-embedl.h @V@/gdb/config/mips/tm-embdl.h @V@/gdb/config/mips/tm-embedl64.h @V@/gdb/config/mips/tm-embl64.h +@V@/gdb/config/mips/tm-linux.h @V@/gdb/config/mips/tm-lx.h +@V@/gdb/config/mips/tm-linux64.h @V@/gdb/config/mips/tm-lx64.h @V@/gdb/config/mips/tm-vr4300el.h @V@/gdb/config/mips/tm-v43el.h @V@/gdb/config/mips/tm-vr4xxxel.h @V@/gdb/config/mips/tm-v4xel.h @V@/gdb/config/mips/tm-vr5000el.h @V@/gdb/config/mips/tm-vr5kel.h @@ -129,6 +134,8 @@ @V@/gdb/gdbtk/library/ChangeLog-1999 @V@/gdb/gdbtk/library/ChangeLog.99 @V@/gdb/gdbtk/library/ChangeLog-2000 @V@/gdb/gdbtk/library/ChangeLog.000 @V@/gdb/gdbtk/library/ChangeLog-2001 @V@/gdb/gdbtk/library/ChangeLog.001 +@V@/gdb/i386-interix-nat.c @V@/gdb/i386ix-nat.c +@V@/gdb/i386-interix-tdep.c @V@/gdb/i386ix-tdep.c @V@/gdb/i386-linux-tdep.c @V@/gdb/i386linux-tdep.c @V@/gdb/i386bsd-nat.c @V@/gdb/i3bsd-nat.c @V@/gdb/i386bsd-tdep.c @V@/gdb/i3bsd-tdep.c @@ -142,15 +149,17 @@ @V@/gdb/ia64-linux-nat.c @V@/gdb/ia64linux-nat.c @V@/gdb/jv-exp.tab.c @V@/gdb/jv-exp_tab.c @V@/gdb/m2-exp.tab.c @V@/gdb/m2-exp_tab.c +@V@/gdb/m68klinux-nat.c @V@/gdb/m68kl-nat.c +@V@/gdb/m68klinux-tdep.c @V@/gdb/m68kl-tdep.c @V@/gdb/m68knbsd-nat.c @V@/gdb/m6nbsd-nat.c @V@/gdb/m68knbsd-tdep.c @V@/gdb/m6nbsd-tdep.c @V@/gdb/mips-linux-nat.c @V@/gdb/mipslnxnat.c @V@/gdb/mips-linux-tdep.c @V@/gdb/mipslnxtdep.c @V@/gdb/mipsnbsd-nat.c @V@/gdb/mipsnbnat.c @V@/gdb/mipsnbsd-tdep.c @V@/gdb/mipsnbtdep.c -@V@/gdb/nindy-share/b.out.h @V@/gdb/nindy-share/b_out.h @V@/gdb/ns32knbsd-nat.c @V@/gdb/ns32nb-nat.c @V@/gdb/ns32knbsd-tdep.c @V@/gdb/ns32nb-tdep.c +@V@/gdb/objc-exp.tab.c @V@/gdb/objc-exp_tab.c @V@/gdb/osf-share/cma_stack_int.h @V@/gdb/osf-share/cma_stkint.h @V@/gdb/p-exp.tab.c @V@/gdb/p-exp_tab.c @V@/gdb/ppc-linux-tdep.c @V@/gdb/ppc-linx-tdep.c @@ -162,11 +171,9 @@ @V@/gdb/remote-array.c @V@/gdb/rmt-array.c @V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c @V@/gdb/remote-eb.c @V@/gdb/rmt-eb.c -@V@/gdb/remote-es.c @V@/gdb/rmt-es.c @V@/gdb/remote-est.c @V@/gdb/rmt-est.c @V@/gdb/remote-mips.c @V@/gdb/emt-mips.c @V@/gdb/remote-mm.c @V@/gdb/emt-mm.c -@V@/gdb/remote-nindy.c @V@/gdb/rmt-nindy.c @V@/gdb/remote-nrom.c @V@/gdb/rmt-nrom.c @V@/gdb/remote-rdi.c @V@/gdb/rmt-rdi.c @V@/gdb/remote-rdp.c @V@/gdb/rmt-rdp.c @@ -198,6 +205,8 @@ @V@/gdb/testsuite/gdb.c++/annota2.exp @V@/gdb/testsuite/gdb.cxx/annota2.exp @V@/gdb/testsuite/gdb.c++/anon-union.cc @V@/gdb/testsuite/gdb.cxx/anon-union.cc @V@/gdb/testsuite/gdb.c++/anon-union.exp @V@/gdb/testsuite/gdb.cxx/anon-union.exp +@V@/gdb/testsuite/gdb.c++/casts.cc @V@/gdb/testsuite/gdb.cxx/casts.cc +@V@/gdb/testsuite/gdb.c++/casts.exp @V@/gdb/testsuite/gdb.cxx/casts.exp @V@/gdb/testsuite/gdb.c++/classes.exp @V@/gdb/testsuite/gdb.cxx/classes.exp @V@/gdb/testsuite/gdb.c++/configure @V@/gdb/testsuite/gdb.cxx/configure @V@/gdb/testsuite/gdb.c++/configure.in @V@/gdb/testsuite/gdb.cxx/configure.in @@ -239,6 +248,13 @@ @V@/gdb/testsuite/gdb.c++/overload.exp @V@/gdb/testsuite/gdb.cxx/overload.exp @V@/gdb/testsuite/gdb.c++/ovldbreak.cc @V@/gdb/testsuite/gdb.cxx/ovldbreak.cc @V@/gdb/testsuite/gdb.c++/ovldbreak.exp @V@/gdb/testsuite/gdb.cxx/ovldbreak.exp +@V@/gdb/testsuite/gdb.c++/pr-574.cc @V@/gdb/testsuite/gdb.cxx/pr-574.cc +@V@/gdb/testsuite/gdb.c++/pr-574.exp @V@/gdb/testsuite/gdb.cxx/pr-574.exp +@V@/gdb/testsuite/gdb.c++/printmethod.cc @V@/gdb/testsuite/gdb.cxx/printmethod.cc +@V@/gdb/testsuite/gdb.c++/printmethod.exp @V@/gdb/testsuite/gdb.cxx/printmethod.exp +@V@/gdb/testsuite/gdb.c++/psmang.exp @V@/gdb/testsuite/gdb.cxx/psmang.exp +@V@/gdb/testsuite/gdb.c++/psmang1.cc @V@/gdb/testsuite/gdb.cxx/psmang1.cc +@V@/gdb/testsuite/gdb.c++/psmang2.cc @V@/gdb/testsuite/gdb.cxx/psmang2.cc @V@/gdb/testsuite/gdb.c++/ref-types.cc @V@/gdb/testsuite/gdb.cxx/ref-types.cc @V@/gdb/testsuite/gdb.c++/ref-types.exp @V@/gdb/testsuite/gdb.cxx/ref-types.exp @V@/gdb/testsuite/gdb.c++/templates.cc @V@/gdb/testsuite/gdb.cxx/templates.cc @@ -254,6 +270,10 @@ @V@/gdb/testsuite/gdb.mi/mi0-var-child.exp @V@/gdb/testsuite/gdb.mi/mi0varchild.exp @V@/gdb/testsuite/gdb.mi/mi0-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi0varcmd.exp @V@/gdb/testsuite/gdb.mi/mi0-var-display.exp @V@/gdb/testsuite/gdb.mi/mi0vardisplay.exp +@V@/gdb/testsuite/gdb.mi/mi1-var-block.exp @V@/gdb/testsuite/gdb.mi/mi1varblock.exp +@V@/gdb/testsuite/gdb.mi/mi1-var-child.exp @V@/gdb/testsuite/gdb.mi/mi1varchild.exp +@V@/gdb/testsuite/gdb.mi/mi1-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi1varcmd.exp +@V@/gdb/testsuite/gdb.mi/mi1-var-display.exp @V@/gdb/testsuite/gdb.mi/mi1vardisplay.exp @V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c @V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h @V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c @@ -370,6 +390,8 @@ @V@/opcodes/ia64-opc-m.c @V@/opcodes/ia64opcm.c @V@/opcodes/ia64-opc-x.c @V@/opcodes/ia64opcx.c @V@/opcodes/ia64-opc.c @V@/opcodes/ia64-opc.c +@V@/opcodes/iq2000-desc.c @V@/opcodes/iq2000desc.c +@V@/opcodes/iq2000-dis.c @V@/opcodes/iq2000dis.c @V@/opcodes/m68hc11-dis.c @V@/opcodes/m68hc11dis.c @V@/opcodes/m68hc11-opc.c @V@/opcodes/m68hc11opc.c @V@/opcodes/openris-dis.c @V@/opcodes/orisc-dis.c @@ -378,6 +400,7 @@ @V@/opcodes/openrisc-ibld.c @V@/opcodes/orisc-ibld.c @V@/opcodes/openrisc-opc.c @V@/opcodes/orisc-opc.c @V@/opcodes/openrisc-opc.h @V@/opcodes/orisc-opc.h +@V@/opcodes/po/.cvsignore @V@/opcodes/po/_cvsignore @V@/readline/config.h.bot @V@/readline/config.h-bot @V@/readline/config.h.in @V@/readline/config.h-in @V@/sim/m68hc11/dv-m68hc11eepr.c @V@/sim/m68hc11/dv-eepr.c diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index 6b91a71..5915565 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -1,6 +1,6 @@ /* Parameters for execution on a H8/500 series machine. - Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002 Free + Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/config/i386/i386dgux.mh b/gdb/config/i386/i386dgux.mh deleted file mode 100644 index fd7f56c..0000000 --- a/gdb/config/i386/i386dgux.mh +++ /dev/null @@ -1,10 +0,0 @@ -# Host: Intel 386 running DGUX, cloned from SVR4 - -XM_FILE= xm-i386v4.h -# for network communication -XM_CLIBS= -lsocket -lnsl - -NAT_FILE= nm-i386v4.h -NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o \ - solib.o solib-svr4.o solib-legacy.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gdb/config/i386/i386mk.mh b/gdb/config/i386/i386mk.mh deleted file mode 100644 index 0c119be..0000000 --- a/gdb/config/i386/i386mk.mh +++ /dev/null @@ -1,4 +0,0 @@ -# Host: Intel 386 running Mach3 with OSF 1/MK - -NATDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o -XM_FILE= xm-i386osf1mk.h diff --git a/gdb/config/i386/i386mk.mt b/gdb/config/i386/i386mk.mt deleted file mode 100644 index fc59442..0000000 --- a/gdb/config/i386/i386mk.mt +++ /dev/null @@ -1,6 +0,0 @@ -# Target: Intel 386 with a.out in osf 1/mk -TDEPFILES= i386-tdep.o -TM_FILE= tm-i386osf1mk.h - -TM_CFLAGS= -I/usr/mach3/include -TM_CLIBS= /usr/mach3/ccs/lib/libmachid.a /usr/mach3/ccs/lib/libnetname.a /usr/mach3/ccs/lib/libmach.a diff --git a/gdb/config/i386/i386v32.mh b/gdb/config/i386/i386v32.mh deleted file mode 100644 index f394372..0000000 --- a/gdb/config/i386/i386v32.mh +++ /dev/null @@ -1,8 +0,0 @@ -# Host: Intel 386 running System V release 3.2 - -XM_FILE= xm-i386v32.h -XM_CLIBS= -lPW - -NAT_FILE= nm-i386v.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o - diff --git a/gdb/config/i386/tm-i386os9k.h b/gdb/config/i386/tm-i386os9k.h deleted file mode 100644 index 78fbc21..0000000 --- a/gdb/config/i386/tm-i386os9k.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Macro definitions for i386 running under BSD Unix. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996 - Free Software Foundation, Inc. - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef TM_I386OS9K_H -#define TM_I386OS9K_H 1 - -#include "i386/tm-i386.h" - -/* Number of machine registers */ - -#undef NUM_REGS -#define NUM_REGS (16) /* Basic i*86 regs */ - -/* Initializer for an array of names of registers. There should be at least - NUM_REGS strings in this initializer. Any excess ones are simply ignored. - The order of the first 8 registers must match the compiler's numbering - scheme (which is the same as the 386 scheme) and also regmap in the various - *-nat.c files. */ - -#undef REGISTER_NAME -#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \ - "esp", "ebp", "esi", "edi", \ - "eip", "eflags", "cs", "ss", \ - "ds", "es", "fs", "gs", \ - } - -#define DATABASE_REG 3 /* ebx */ - -/* Amount PC must be decremented by after a breakpoint. This is often the - number of bytes in BREAKPOINT but not always (such as now). */ - -#undef DECR_PC_AFTER_BREAK -#define DECR_PC_AFTER_BREAK 0 - -/* On 386 bsd, sigtramp is above the user stack and immediately below - the user area. Using constants here allows for cross debugging. - These are tested for BSDI but should work on 386BSD. */ -#define SIGTRAMP_START(pc) 0xfdbfdfc0 -#define SIGTRAMP_END(pc) 0xfdbfe000 - -/* Saved Pc. Get it from sigcontext if within sigtramp. */ - -/* Offset to saved PC in sigcontext, from . */ -#define SIGCONTEXT_PC_OFFSET 20 - -#define BELIEVE_PCC_PROMOTION 1 - -#endif /* #ifndef TM_I386OS9K_H */ diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h index 2b7a86c..6a75298 100644 --- a/gdb/config/i386/tm-ptx.h +++ b/gdb/config/i386/tm-ptx.h @@ -1,7 +1,9 @@ /* Target machine definitions for GDB on a Sequent Symmetry under ptx with Weitek 1167 and i387 support. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000, + 2003 Free Software Foundation, Inc. + Symmetry version by Jay Vosburgh (fubar@sequent.com). This file is part of GDB. @@ -41,15 +43,6 @@ #undef DECR_PC_AFTER_BREAK #define DECR_PC_AFTER_BREAK 0 -#if 0 --- -this code can 't be used unless we know we are running native, -since it uses host specific ptrace calls. -/* code for 80387 fpu. Functions are from i386-dep.c, copied into - * symm-dep.c. - */ -#define FLOAT_INFO { i386_float_info(); } -#endif - /* Number of machine registers */ #undef NUM_REGS diff --git a/gdb/config/i386/tm-symmetry.h b/gdb/config/i386/tm-symmetry.h index dc7c81f..a15f45f 100644 --- a/gdb/config/i386/tm-symmetry.h +++ b/gdb/config/i386/tm-symmetry.h @@ -1,7 +1,9 @@ /* Target machine definitions for GDB on a Sequent Symmetry under dynix 3.0, with Weitek 1167 and i387 support. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2003 Free + Software Foundation, Inc. + Symmetry version by Jay Vosburgh (fubar@sequent.com). This file is part of GDB. @@ -39,15 +41,6 @@ #undef DECR_PC_AFTER_BREAK #define DECR_PC_AFTER_BREAK 0 -#if 0 -/* --- this code can't be used unless we know we are running native, - since it uses host specific ptrace calls. */ -/* code for 80387 fpu. Functions are from i386-dep.c, copied into - * symm-dep.c. - */ -#define FLOAT_INFO { i386_float_info(); } -#endif - /* Number of machine registers */ #undef NUM_REGS diff --git a/gdb/config/i386/xm-i386sco.h b/gdb/config/i386/xm-i386sco.h index 72552c9..18b64bf 100644 --- a/gdb/config/i386/xm-i386sco.h +++ b/gdb/config/i386/xm-i386sco.h @@ -24,10 +24,6 @@ #include "i386/xm-i386v.h" -/* Apparently there is inconsistency among various System V's about what - the name of this field is. */ -#define U_FPSTATE(u) u.u_fps.u_fpstate - /* SCO 3.2v2 and later have job control. */ /* SCO 3.2v4 I know has termios; I'm not sure about earlier versions. GDB does not currently support the termio/job control combination. */ diff --git a/gdb/config/m68k/es1800.mt b/gdb/config/m68k/es1800.mt deleted file mode 100644 index d809c61..0000000 --- a/gdb/config/m68k/es1800.mt +++ /dev/null @@ -1,9 +0,0 @@ -# Target: Ericsson ES-1800 emulator (remote) for m68k. - -# remote-es.o should perhaps be part of the standard monitor.mt -# configuration, if it is desirable to reduce the number of different -# configurations. However, before that happens remote-es.c has to be -# fixed to compile on a DOS host. - -TDEPFILES= m68k-tdep.o remote-es.o -TM_FILE= tm-es1800.h diff --git a/gdb/config/m68k/nm-apollo68b.h b/gdb/config/m68k/nm-apollo68b.h index eca8bfa..75731a7 100644 --- a/gdb/config/m68k/nm-apollo68b.h +++ b/gdb/config/m68k/nm-apollo68b.h @@ -30,8 +30,6 @@ #define KERNEL_U_ADDR 0 -#undef FLOAT_INFO /* No float info yet */ - #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = (6 + 4 * (regno)) diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h index d7581dd..253fd53 100644 --- a/gdb/config/m68k/tm-sun3.h +++ b/gdb/config/m68k/tm-sun3.h @@ -78,7 +78,7 @@ #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) /* If sun3 pcc says that a parameter is a short, it's a short. */ -#define BELIEVE_PCC_PROMOTION_TYPE +#define BELIEVE_PCC_PROMOTION_TYPE 1 /* Can't define BELIEVE_PCC_PROMOTION for SunOS /bin/cc of SunOS 4.1.1. Apparently Sun fixed this for the sparc but not the sun3. */ diff --git a/gdb/config/nm-lynx.h b/gdb/config/nm-lynx.h index 1cd2bd1..1fb0eb6 100644 --- a/gdb/config/nm-lynx.h +++ b/gdb/config/nm-lynx.h @@ -1,6 +1,7 @@ /* Native-dependent definitions for LynxOS. - Copyright 1993, 1994, 1995, 1996, 1999, 2000 - Free Software Foundation, Inc. + + Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2003 Free Software + Foundation, Inc. This file is part of GDB. @@ -42,8 +43,6 @@ #define KERNEL_U_ADDR USRSTACK -#undef FLOAT_INFO /* No float info yet */ - /* As of LynxOS 2.2.2 (beta 8/15/94), this is int. Previous versions seem to have had no prototype, so I'm not sure why GDB used to define this to char *. */ diff --git a/gdb/config/ns32k/nm-nbsd.h b/gdb/config/ns32k/nm-nbsd.h index 4e1e13b..eb803f2 100644 --- a/gdb/config/ns32k/nm-nbsd.h +++ b/gdb/config/ns32k/nm-nbsd.h @@ -25,10 +25,6 @@ /* Get generic NetBSD native definitions. */ #include "config/nm-nbsd.h" -#if 0 -#define FLOAT_INFO { extern ns32k_float_info(); ns32k_float_info(); } -#endif - #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = ns32k_register_u_addr ((blockend),(regno)); diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 6262008..1b9e770 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -255,10 +255,10 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \ } while (0) -/* Define DEPRECATED_REGISTERS_INFO() to do machine-specific formatting - of register dumps. */ +/* Define DEPRECATED_DO_REGISTERS_INFO() to do machine-specific + formatting of register dumps. */ -#define DEPRECATED_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp) +#define DEPRECATED_DO_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp) extern void pa_do_registers_info (int, int); #if 0 @@ -444,8 +444,8 @@ extern int hppa_frame_num_args (struct frame_info *frame); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ hppa_frame_find_saved_regs (frame_info, &frame_saved_regs) -extern void -hppa_frame_find_saved_regs (struct frame_info *, struct frame_saved_regs *); +extern void hppa_frame_find_saved_regs (struct frame_info *, + struct frame_saved_regs *); /* Things needed for making the inferior call functions. */ @@ -625,8 +625,8 @@ extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int, #if !GDB_MULTI_ARCH #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) -extern CORE_ADDR -hppa_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); +extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); #endif diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 9a1ceb0..775055f 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -217,7 +217,6 @@ call_dummy #undef FUNC_LDO_OFFSET #undef SR4EXPORT_LDIL_OFFSET #undef SR4EXPORT_LDO_OFFSET -#undef CALL_DUMMY_LOCATION #undef REG_STRUCT_HAS_ADDR diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 0c3731f..e8f5656 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -112,14 +112,13 @@ #define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) #undef PUSH_RETURN_ADDRESS #define PUSH_RETURN_ADDRESS(PC, SP) sparc_at_entry_push_return_address (PC, SP) -extern CORE_ADDR -sparc_at_entry_push_return_address (CORE_ADDR pc, CORE_ADDR sp); +extern CORE_ADDR sparc_at_entry_push_return_address (CORE_ADDR pc, + CORE_ADDR sp); #undef STORE_STRUCT_RETURN #define STORE_STRUCT_RETURN(ADDR, SP) \ sparc_at_entry_store_struct_return (ADDR, SP) -extern void -sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); +extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); #else diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index b43e3a3..05495ed 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -686,8 +686,8 @@ void sparc_pop_frame (void); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ sparc32_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) -extern CORE_ADDR -sparc32_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); +extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); /* Store the address of the place in which to copy the structure the subroutine will return. This is called from call_function_by_hand. diff --git a/gdb/configure b/gdb/configure index 6c3003f..b16718a 100755 --- a/gdb/configure +++ b/gdb/configure @@ -19,18 +19,24 @@ ac_help="$ac_help ac_help="$ac_help --with-included-gettext use the GNU gettext library included here" ac_help="$ac_help + --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]" +ac_help="$ac_help --disable-gdbcli disable command-line interface (CLI)" ac_help="$ac_help --disable-gdbmi disable machine-interface (MI)" ac_help="$ac_help --enable-tui enable full-screen terminal user interface (TUI)" ac_help="$ac_help - --enable-gtk enable gdbtk graphical user interface (GUI)" + --enable-gdbtk enable gdbtk graphical user interface (GUI)" +ac_help="$ac_help + --enable-profiling enable profiling of GDB" ac_help="$ac_help --without-included-regex don't use included regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system)" ac_help="$ac_help + --with-sysroot[=DIR] Search for usr/lib et al within DIR." +ac_help="$ac_help --enable-build-warnings Enable build-time compiler warnings if gcc is used" ac_help="$ac_help --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used" @@ -579,7 +585,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:583: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:589: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -605,7 +611,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:609: checking for $ac_word" >&5 +echo "configure:615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -635,7 +641,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:639: checking for $ac_word" >&5 +echo "configure:645: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -686,7 +692,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:690: checking for $ac_word" >&5 +echo "configure:696: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -718,7 +724,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -729,12 +735,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 733 "configure" +#line 739 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -760,12 +766,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:764: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:769: checking whether we are using GNU C" >&5 +echo "configure:775: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -774,7 +780,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -793,7 +799,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:797: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:803: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -830,7 +836,7 @@ EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:834: checking how to run the C preprocessor" >&5 +echo "configure:840: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -845,13 +851,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:861: \"$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 : @@ -862,13 +868,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:878: \"$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 : @@ -879,13 +885,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:895: \"$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 : @@ -910,9 +916,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:914: checking for AIX" >&5 +echo "configure:920: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:938: checking for POSIXized ISC" >&5 +echo "configure:944: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -958,7 +964,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:962: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:968: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -975,7 +981,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -1012,7 +1018,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1083,7 +1089,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1087: checking host system type" >&5 +echo "configure:1093: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1104,7 +1110,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:1108: checking target system type" >&5 +echo "configure:1114: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1122,7 +1128,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1126: checking build system type" >&5 +echo "configure:1132: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1149,7 +1155,7 @@ test "$host_alias" != "$target_alias" && # doesn't support cross-compilation, but the one from Autoconf 2.5x # does. Override RANLIB here (i.e. before running AC_PROG_RANLIB) to # deal with the lossage. Note that CY_GNU_GETTEXT currently calls -# AC_PROG_RANLIB. This can be removed when we switch to # Autoconf +# AC_PROG_RANLIB. This can be removed when we switch to Autoconf # 2.5x. if test $host != $build; then ac_tool_prefix=${host_alias}- @@ -1160,7 +1166,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:1164: checking for $ac_word" >&5 +echo "configure:1170: 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 @@ -1192,7 +1198,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:1196: checking for $ac_word" >&5 +echo "configure:1202: 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 @@ -1227,7 +1233,7 @@ fi ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1231: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1237: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1256,7 +1262,7 @@ fi # 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:1260: checking for $ac_word" >&5 +echo "configure:1266: 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 @@ -1284,12 +1290,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1288: checking for ANSI C header files" >&5 +echo "configure:1294: 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 @@ -1297,7 +1303,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1307: \"$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* @@ -1314,7 +1320,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 @@ -1332,7 +1338,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 @@ -1353,7 +1359,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1364,7 +1370,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1388,12 +1394,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1392: checking for working const" >&5 +echo "configure:1398: 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:1452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1463,21 +1469,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1467: checking for inline" >&5 +echo "configure:1473: 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:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1503,12 +1509,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1507: checking for off_t" >&5 +echo "configure:1513: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1536,12 +1542,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1540: checking for size_t" >&5 +echo "configure:1546: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1571,19 +1577,19 @@ fi # 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:1575: checking for working alloca.h" >&5 +echo "configure:1581: 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:1587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1593: \"$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 @@ -1604,12 +1610,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1608: checking for alloca" >&5 +echo "configure:1614: 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:1647: \"$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 @@ -1669,12 +1675,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1673: checking whether alloca needs Cray hooks" >&5 +echo "configure:1679: 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:1703: checking for $ac_func" >&5 +echo "configure:1709: 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:1737: \"$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 @@ -1754,7 +1760,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1758: checking stack direction for C alloca" >&5 +echo "configure:1764: 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 @@ -1762,7 +1768,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:1791: \"$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 @@ -1806,17 +1812,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:1810: checking for $ac_hdr" >&5 +echo "configure:1816: 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:1820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1826: \"$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* @@ -1845,12 +1851,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1849: checking for $ac_func" >&5 +echo "configure:1855: 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:1883: \"$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 @@ -1898,7 +1904,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1902: checking for working mmap" >&5 +echo "configure:1908: 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 @@ -1906,7 +1912,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:2056: \"$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 @@ -2074,17 +2080,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2078: checking for $ac_hdr" >&5 +echo "configure:2084: 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:2088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2094: \"$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* @@ -2114,12 +2120,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2118: checking for $ac_func" >&5 +echo "configure:2124: 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:2152: \"$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 @@ -2171,12 +2177,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2175: checking for $ac_func" >&5 +echo "configure:2181: 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:2209: \"$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 @@ -2233,19 +2239,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2237: checking for LC_MESSAGES" >&5 +echo "configure:2243: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2266,7 +2272,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2270: checking whether NLS is requested" >&5 +echo "configure:2276: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2286,7 +2292,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2290: checking whether included gettext is requested" >&5 +echo "configure:2296: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2305,17 +2311,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2309: checking for libintl.h" >&5 +echo "configure:2315: checking for libintl.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:2319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2325: \"$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* @@ -2332,19 +2338,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2336: checking for gettext in libc" >&5 +echo "configure:2342: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2360,7 +2366,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2364: checking for bindtextdomain in -lintl" >&5 +echo "configure:2370: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2368,7 +2374,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2389: \"$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 @@ -2395,19 +2401,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2399: checking for gettext in libintl" >&5 +echo "configure:2405: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+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:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2435,7 +2441,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2439: checking for $ac_word" >&5 +echo "configure:2445: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2469,12 +2475,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2473: checking for $ac_func" >&5 +echo "configure:2479: 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:2507: \"$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 @@ -2524,7 +2530,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2528: checking for $ac_word" >&5 +echo "configure:2534: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2560,7 +2566,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2564: checking for $ac_word" >&5 +echo "configure:2570: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2592,7 +2598,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2632,7 +2638,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2636: checking for $ac_word" >&5 +echo "configure:2642: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2666,7 +2672,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2670: checking for $ac_word" >&5 +echo "configure:2676: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2702,7 +2708,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2706: checking for $ac_word" >&5 +echo "configure:2712: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2792,7 +2798,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2796: checking for catalogs to be installed" >&5 +echo "configure:2802: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2820,17 +2826,17 @@ echo "configure:2796: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2824: checking for linux/version.h" >&5 +echo "configure:2830: checking for linux/version.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:2834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2840: \"$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* @@ -2896,6 +2902,26 @@ cat >> confdefs.h <<\EOF EOF +debugdir=${libdir}/debug + +# Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. +if test "${with_separate_debug_dir+set}" = set; then + withval="$with_separate_debug_dir" + debugdir="${withval}" +fi + + + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo $debugdir` + ac_define_dir=`eval echo $ac_define_dir` + cat >> confdefs.h <&2; exit 1; } ;; + esac +else + enable_profiling=no +fi + + +for ac_func in monstartup _mcleanup +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3117: 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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3145: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +if test "$enable_profiling" = yes ; then + if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then + { echo "configure: error: --enable-profiling requires monstartup and _mcleanup" 1>&2; exit 1; } + fi + PROFILE_CFLAGS=-pg + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PROFILE_CFLAGS" + + echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6 +echo "configure:3178: checking whether $CC supports -pg" >&5 +if eval "test \"`echo '$''{'ac_cv_cc_supports_pg'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cc_supports_pg=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cc_supports_pg=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cc_supports_pg" 1>&6 + + if test $ac_cv_cc_supports_pg = no; then + { echo "configure: error: --enable-profiling requires a compiler which supports -pg" 1>&2; exit 1; } + fi + + CFLAGS="$OLD_CFLAGS" +fi + # --------------------- # # Checks for programs. # # --------------------- # @@ -3078,7 +3216,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:3082: checking for $ac_word" >&5 +echo "configure:3220: 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 @@ -3119,7 +3257,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:3123: checking for a BSD compatible install" >&5 +echo "configure:3261: 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 @@ -3172,7 +3310,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3176: checking whether ln -s works" >&5 +echo "configure:3314: 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 @@ -3195,7 +3333,7 @@ fi # 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:3199: checking for $ac_word" >&5 +echo "configure:3337: 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 @@ -3227,7 +3365,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:3231: checking for $ac_word" >&5 +echo "configure:3369: 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 @@ -3261,7 +3399,7 @@ test -n "$YACC" || YACC="yacc" # 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:3265: checking for $ac_word" >&5 +echo "configure:3403: 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 @@ -3293,7 +3431,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:3297: checking for $ac_word" >&5 +echo "configure:3435: 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 @@ -3325,7 +3463,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:3329: checking for $ac_word" >&5 +echo "configure:3467: 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 @@ -3359,7 +3497,7 @@ fi # 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:3363: checking for $ac_word" >&5 +echo "configure:3501: 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 @@ -3395,7 +3533,7 @@ fi # We might need to link with -lm; most simulators need it. echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3399: checking for main in -lm" >&5 +echo "configure:3537: 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 @@ -3403,14 +3541,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:3552: \"$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 @@ -3443,12 +3581,12 @@ fi # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 # is known to have this problem). Therefore we avoid libw if we can. echo $ac_n "checking for wctype""... $ac_c" 1>&6 -echo "configure:3447: checking for wctype" >&5 +echo "configure:3585: checking for wctype" >&5 if eval "test \"`echo '$''{'ac_cv_func_wctype'+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:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_wctype=yes" else @@ -3489,7 +3627,7 @@ if eval "test \"`echo '$ac_cv_func_'wctype`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:3493: checking for wctype in -lw" >&5 +echo "configure:3631: 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 @@ -3497,7 +3635,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:3650: \"$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 @@ -3541,14 +3679,14 @@ fi # Some systems (e.g. Solaris) have `socketpair' in libsocket. echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6 -echo "configure:3545: checking for library containing socketpair" >&5 +echo "configure:3683: checking for library containing socketpair" >&5 if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_socketpair="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="none required" else @@ -3570,7 +3708,7 @@ rm -f conftest* test "$ac_cv_search_socketpair" = "no" && for i in socket; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="-l$i" break @@ -3617,14 +3755,14 @@ fi if test "$need_curses" = yes; then echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6 -echo "configure:3621: checking for library containing initscr" >&5 +echo "configure:3759: checking for library containing initscr" >&5 if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_initscr="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_initscr="none required" else @@ -3646,7 +3784,7 @@ rm -f conftest* test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_initscr="-l$i" break @@ -3694,14 +3832,14 @@ case $host_os in # ??? Why? echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:3698: checking for library containing tgetent" >&5 +echo "configure:3836: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -3723,7 +3861,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -3761,14 +3899,14 @@ esac # Readline doesn't, so I think we're safe with leaving them out. echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:3765: checking for library containing tgetent" >&5 +echo "configure:3903: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -3790,7 +3928,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -3835,12 +3973,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3839: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3977: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -3848,7 +3986,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3873,7 +4011,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:3877: checking for opendir in -ldir" >&5 +echo "configure:4015: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3881,7 +4019,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4034: \"$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 @@ -3914,7 +4052,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3918: checking for opendir in -lx" >&5 +echo "configure:4056: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3922,7 +4060,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4075: \"$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 @@ -3956,12 +4094,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3960: checking whether stat file-mode macros are broken" >&5 +echo "configure:4098: 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 @@ -4012,12 +4150,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4016: checking for ANSI C header files" >&5 +echo "configure:4154: 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 @@ -4025,7 +4163,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4167: \"$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* @@ -4042,7 +4180,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 @@ -4060,7 +4198,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 @@ -4081,7 +4219,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4092,7 +4230,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4119,17 +4257,17 @@ for ac_hdr in link.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4123: checking for $ac_hdr" >&5 +echo "configure:4261: 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:4133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4271: \"$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* @@ -4159,17 +4297,17 @@ for ac_hdr in nlist.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4163: checking for $ac_hdr" >&5 +echo "configure:4301: 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:4173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4311: \"$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* @@ -4199,17 +4337,17 @@ for ac_hdr in poll.h sys/poll.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4203: checking for $ac_hdr" >&5 +echo "configure:4341: 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:4213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4351: \"$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* @@ -4239,17 +4377,17 @@ for ac_hdr in proc_service.h thread_db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4243: checking for $ac_hdr" >&5 +echo "configure:4381: 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:4253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4391: \"$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* @@ -4279,17 +4417,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4283: checking for $ac_hdr" >&5 +echo "configure:4421: 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:4293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4431: \"$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* @@ -4319,17 +4457,17 @@ for ac_hdr in stdlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4323: checking for $ac_hdr" >&5 +echo "configure:4461: 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:4333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4471: \"$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* @@ -4359,17 +4497,17 @@ for ac_hdr in stdint.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4363: checking for $ac_hdr" >&5 +echo "configure:4501: 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:4373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4511: \"$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* @@ -4399,17 +4537,17 @@ for ac_hdr in string.h memory.h strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4403: checking for $ac_hdr" >&5 +echo "configure:4541: 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:4413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4551: \"$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* @@ -4439,17 +4577,17 @@ for ac_hdr in sys/fault.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4443: checking for $ac_hdr" >&5 +echo "configure:4581: 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:4453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4591: \"$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* @@ -4479,17 +4617,17 @@ for ac_hdr in sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4483: checking for $ac_hdr" >&5 +echo "configure:4621: 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:4493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4631: \"$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* @@ -4519,17 +4657,17 @@ for ac_hdr in sys/filio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4523: checking for $ac_hdr" >&5 +echo "configure:4661: 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:4533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4671: \"$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* @@ -4559,17 +4697,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4563: checking for $ac_hdr" >&5 +echo "configure:4701: 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:4573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4711: \"$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* @@ -4599,17 +4737,17 @@ for ac_hdr in sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4603: checking for $ac_hdr" >&5 +echo "configure:4741: 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:4613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4751: \"$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* @@ -4639,17 +4777,17 @@ for ac_hdr in sys/proc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4643: checking for $ac_hdr" >&5 +echo "configure:4781: 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:4653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4791: \"$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* @@ -4679,17 +4817,17 @@ for ac_hdr in sys/procfs.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4683: checking for $ac_hdr" >&5 +echo "configure:4821: 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:4693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4831: \"$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* @@ -4719,17 +4857,17 @@ for ac_hdr in sys/ptrace.h ptrace.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4723: checking for $ac_hdr" >&5 +echo "configure:4861: 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:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4871: \"$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* @@ -4759,17 +4897,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4763: checking for $ac_hdr" >&5 +echo "configure:4901: 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:4773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4911: \"$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* @@ -4799,17 +4937,17 @@ for ac_hdr in sys/select.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4803: checking for $ac_hdr" >&5 +echo "configure:4941: 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:4813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4951: \"$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* @@ -4839,17 +4977,17 @@ for ac_hdr in sys/syscall.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4843: checking for $ac_hdr" >&5 +echo "configure:4981: 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:4853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4991: \"$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* @@ -4879,17 +5017,17 @@ for ac_hdr in sys/user.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4883: checking for $ac_hdr" >&5 +echo "configure:5021: 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:4893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5031: \"$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* @@ -4919,17 +5057,17 @@ for ac_hdr in sys/wait.h wait.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4923: checking for $ac_hdr" >&5 +echo "configure:5061: 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:4933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5071: \"$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* @@ -4959,17 +5097,17 @@ for ac_hdr in termios.h termio.h sgtty.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4963: checking for $ac_hdr" >&5 +echo "configure:5101: 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:4973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5111: \"$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* @@ -4999,17 +5137,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:5003: checking for $ac_hdr" >&5 +echo "configure:5141: 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:5013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5151: \"$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* @@ -5052,17 +5190,17 @@ for ac_hdr in curses.h ncurses.h term.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5056: checking for $ac_hdr" >&5 +echo "configure:5194: 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:5066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5204: \"$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* @@ -5095,17 +5233,17 @@ for ac_hdr in ctype.h time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5099: checking for $ac_hdr" >&5 +echo "configure:5237: 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:5109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5247: \"$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* @@ -5137,12 +5275,12 @@ done # ------------------ # echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5141: checking return type of signal handlers" >&5 +echo "configure:5279: 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 @@ -5159,7 +5297,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5183,12 +5321,12 @@ EOF # ------------------------------------- # echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5187: checking for working const" >&5 +echo "configure:5325: 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:5379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5258,21 +5396,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5262: checking for inline" >&5 +echo "configure:5400: 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:5414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5305,19 +5443,19 @@ esac # 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:5309: checking for working alloca.h" >&5 +echo "configure:5447: 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:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5459: \"$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 @@ -5338,12 +5476,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5342: checking for alloca" >&5 +echo "configure:5480: 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:5513: \"$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 @@ -5403,12 +5541,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5407: checking whether alloca needs Cray hooks" >&5 +echo "configure:5545: 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:5437: checking for $ac_func" >&5 +echo "configure:5575: 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:5603: \"$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 @@ -5488,7 +5626,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5492: checking stack direction for C alloca" >&5 +echo "configure:5630: 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 @@ -5496,7 +5634,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:5657: \"$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 @@ -5540,17 +5678,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:5544: checking for $ac_hdr" >&5 +echo "configure:5682: 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:5554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5692: \"$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* @@ -5579,12 +5717,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5583: checking for $ac_func" >&5 +echo "configure:5721: 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:5749: \"$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 @@ -5632,7 +5770,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5636: checking for working mmap" >&5 +echo "configure:5774: 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 @@ -5640,7 +5778,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:5922: \"$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 @@ -5803,12 +5941,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5807: checking for pid_t" >&5 +echo "configure:5945: 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 @@ -5837,17 +5975,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:5841: checking for vfork.h" >&5 +echo "configure:5979: 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:5851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5989: \"$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* @@ -5872,18 +6010,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:5876: checking for working vfork" >&5 +echo "configure:6014: 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:5882: checking for vfork" >&5 +echo "configure:6020: 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:6048: \"$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 @@ -5928,7 +6066,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -6023,7 +6161,7 @@ main() { } } EOF -if { (eval echo configure:6027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6165: \"$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 @@ -6048,12 +6186,12 @@ fi for ac_func in canonicalize_file_name realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6052: checking for $ac_func" >&5 +echo "configure:6190: 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:6218: \"$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 @@ -6103,12 +6241,12 @@ done for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6107: checking for $ac_func" >&5 +echo "configure:6245: 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:6273: \"$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 @@ -6158,12 +6296,12 @@ done for ac_func in pread64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6162: checking for $ac_func" >&5 +echo "configure:6300: 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:6328: \"$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 @@ -6213,12 +6351,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6217: checking for $ac_func" >&5 +echo "configure:6355: 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:6383: \"$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 @@ -6268,12 +6406,12 @@ done for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6272: checking for $ac_func" >&5 +echo "configure:6410: 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:6438: \"$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 @@ -6323,12 +6461,12 @@ done for ac_func in sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6327: checking for $ac_func" >&5 +echo "configure:6465: 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:6493: \"$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 @@ -6378,12 +6516,12 @@ done for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6382: checking for $ac_func" >&5 +echo "configure:6520: 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:6548: \"$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 @@ -6433,7 +6571,7 @@ done if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6437: checking whether setpgrp takes no argument" >&5 +echo "configure:6575: 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 @@ -6441,7 +6579,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:6603: \"$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 @@ -6486,12 +6624,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6490: checking whether setpgrp takes no argument" >&5 +echo "configure:6628: 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 < @@ -6505,7 +6643,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -6529,12 +6667,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:6533: checking for sigsetjmp" >&5 +echo "configure:6671: 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 < @@ -6543,7 +6681,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:6547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -6569,12 +6707,12 @@ gdb_use_included_regex=yes # However, if the system regex is GNU regex, then default to *not* # using the included regex. echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6573: checking for GNU regex" >&5 +echo "configure:6711: 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 < int main() { @@ -6584,7 +6722,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:6588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6619,19 +6757,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:6623: checking for r_fs in struct reg" >&5 +echo "configure:6761: 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:6635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -6651,19 +6789,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:6655: checking for r_gs in struct reg" >&5 +echo "configure:6793: 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:6667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -6685,19 +6823,19 @@ fi # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:6689: checking for PTRACE_GETREGS" >&5 +echo "configure:6827: 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:6701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -6719,19 +6857,19 @@ fi # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:6723: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:6861: 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:6735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -6753,12 +6891,12 @@ fi # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:6757: checking for PT_GETDBREGS" >&5 +echo "configure:6895: 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 @@ -6766,7 +6904,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:6770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -6788,12 +6926,12 @@ fi # See if provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:6792: checking for PT_GETXMMREGS" >&5 +echo "configure:6930: 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 @@ -6801,7 +6939,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:6805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -6823,12 +6961,12 @@ fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:6827: checking whether malloc must be declared" >&5 +echo "configure:6965: 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 < @@ -6849,7 +6987,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:6853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -6870,12 +7008,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:6874: checking whether realloc must be declared" >&5 +echo "configure:7012: 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 < @@ -6896,7 +7034,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:6900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -6917,12 +7055,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:6921: checking whether free must be declared" >&5 +echo "configure:7059: 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 < @@ -6943,7 +7081,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:6947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -6964,12 +7102,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:6968: checking whether strerror must be declared" >&5 +echo "configure:7106: 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 < @@ -6990,7 +7128,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:6994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -7011,12 +7149,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:7015: checking whether strdup must be declared" >&5 +echo "configure:7153: 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 < @@ -7037,7 +7175,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:7041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -7058,12 +7196,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:7062: checking whether strstr must be declared" >&5 +echo "configure:7200: 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 < @@ -7084,7 +7222,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:7088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -7105,12 +7243,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:7109: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:7247: 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 < @@ -7131,7 +7269,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:7135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -7157,9 +7295,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:7161: checking for HPUX save_state structure" >&5 +echo "configure:7299: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -7174,7 +7312,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -7244,12 +7382,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:7248: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:7386: 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:7400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -7280,12 +7418,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:7284: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:7422: 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:7436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -7316,12 +7454,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:7320: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:7458: 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:7472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -7352,12 +7490,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:7356: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:7494: 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:7508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -7388,12 +7526,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:7392: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:7530: 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:7544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -7424,12 +7562,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:7428: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:7566: 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:7580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -7460,12 +7598,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:7464: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:7602: 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:7616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -7496,12 +7634,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:7500: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:7638: 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:7652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -7532,12 +7670,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:7536: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:7674: 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:7688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -7568,12 +7706,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:7572: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:7710: 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:7724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -7604,12 +7742,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:7608: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:7746: 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:7760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -7640,12 +7778,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:7644: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:7782: 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:7796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -7676,12 +7814,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:7680: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:7818: 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:7832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -7712,12 +7850,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:7716: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:7854: 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:7868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -7753,7 +7891,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:7757: checking whether prfpregset_t type is broken" >&5 +echo "configure:7895: 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 @@ -7761,7 +7899,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -7771,7 +7909,7 @@ else return 0; } EOF -if { (eval echo configure:7775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7913: \"$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 @@ -7796,12 +7934,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7800: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:7938: 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 @@ -7814,7 +7952,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:7818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -7838,19 +7976,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:7842: checking for member l_addr in struct link_map" >&5 +echo "configure:7980: 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:7854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -7872,12 +8010,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:7876: checking for member lm_addr in struct link_map" >&5 +echo "configure:8014: 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 @@ -7885,7 +8023,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:7889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -7907,12 +8045,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:7911: checking for member som_addr in struct so_map" >&5 +echo "configure:8049: 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 @@ -7923,7 +8061,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:7927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -7945,12 +8083,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:7949: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:8087: 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 < @@ -7958,7 +8096,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:7962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -7985,12 +8123,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:7989: checking for long long support in compiler" >&5 +echo "configure:8127: 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:8142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -8022,7 +8160,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:8026: checking for long long support in printf" >&5 +echo "configure:8164: 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 @@ -8030,7 +8168,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:8186: \"$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 @@ -8068,19 +8206,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:8072: checking for long double support in compiler" >&5 +echo "configure:8210: 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:8222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -8102,7 +8240,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:8106: checking for long double support in printf" >&5 +echo "configure:8244: 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 @@ -8110,7 +8248,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:8262: \"$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 @@ -8144,7 +8282,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:8148: checking for long double support in scanf" >&5 +echo "configure:8286: 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 @@ -8152,7 +8290,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:8166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8304: \"$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 @@ -8187,7 +8325,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6 case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:8191: checking for -bbigtoc option" >&5 +echo "configure:8329: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8201,14 +8339,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:8350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -8231,7 +8369,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:8235: checking for HPUX/OSF thread support" >&5 +echo "configure:8373: 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 @@ -8254,7 +8392,7 @@ EOF # because version 0 (present on Solaris 2.4 or earlier) doesn't have # the same API. echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:8258: checking for Solaris thread debugging library" >&5 +echo "configure:8396: 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 @@ -8264,7 +8402,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:8268: checking for dlopen in -ldl" >&5 +echo "configure:8406: 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 @@ -8272,7 +8410,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:8425: \"$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 @@ -8315,17 +8453,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:8319: checking for the ld -export-dynamic flag" >&5 +echo "configure:8457: 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:8467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -8344,13 +8482,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:8348: checking if is old" >&5 +echo "configure:8486: 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 < @@ -8361,7 +8499,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -8387,12 +8525,12 @@ EOF ;; aix*) echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6 -echo "configure:8391: checking for AiX thread debugging library" >&5 +echo "configure:8529: checking for AiX thread debugging library" >&5 if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -8401,7 +8539,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:8405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_aix_thread_debug=yes else @@ -8426,19 +8564,19 @@ fi if test "x$ac_cv_header_thread_db_h" = "xyes"; then echo $ac_n "checking whether has TD_NOTALLOC""... $ac_c" 1>&6 -echo "configure:8430: checking whether has TD_NOTALLOC" >&5 +echo "configure:8568: checking whether has TD_NOTALLOC" >&5 if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int i = TD_NOTALLOC; ; return 0; } EOF -if { (eval echo configure:8442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_thread_db_h_has_td_notalloc=yes else @@ -8462,6 +8600,43 @@ EOF fi +# Check whether --with-sysroot or --without-sysroot was given. +if test "${with_sysroot+set}" = set; then + withval="$with_sysroot" + + case ${with_sysroot} in + yes) { echo "configure: error: with-sysroot must specify path" 1>&2; exit 1; } ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' + + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + case ${TARGET_SYSTEM_ROOT} in + ${test_prefix}*) + t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" + TARGET_SYSTEM_ROOT_DEFINE="$t" + ;; + esac + +else + + TARGET_SYSTEM_ROOT= + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"' + +fi + + + + # NOTE: Don't add -Wall or -Wunused, they both include # -Wunused-parameter which reports bogus warnings. # NOTE: If you add to this list, remember to update @@ -8511,7 +8686,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:8515: checking compiler warning flags" >&5 +echo "configure:8690: 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 @@ -8521,14 +8696,14 @@ echo "configure:8515: 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:8707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -8576,12 +8751,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:8580: checking for cygwin" >&5 +echo "configure:8755: 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:8663: checking for Tcl configuration" >&5 +echo "configure:8838: 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 @@ -8767,7 +8942,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:8771: checking for Tk configuration" >&5 +echo "configure:8946: 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 @@ -8876,7 +9051,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:8880: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:9055: 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" @@ -8942,17 +9117,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:8946: checking for tclInt.h" >&5 +echo "configure:9121: 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:8956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9131: \"$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* @@ -9012,7 +9187,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:9016: checking for Tk private headers" >&5 +echo "configure:9191: 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" @@ -9078,17 +9253,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:9082: checking for tk.h" >&5 +echo "configure:9257: 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:9092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9267: \"$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* @@ -9134,7 +9309,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9138: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:9313: 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 @@ -9157,7 +9332,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9161: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:9336: 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 @@ -9212,7 +9387,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:9216: checking for Itcl configuration" >&5 +echo "configure:9391: 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 @@ -9315,7 +9490,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:9319: checking for Itk configuration" >&5 +echo "configure:9494: 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 @@ -9458,7 +9633,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:9462: checking for X" >&5 +echo "configure:9637: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -9520,12 +9695,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:9529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9704: \"$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* @@ -9594,14 +9769,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:9780: \"$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. @@ -9741,6 +9916,7 @@ fi + # target_subdir is used by the testsuite to find the target libraries. target_subdir= if test "${host}" != "${target}"; then @@ -9848,7 +10024,7 @@ fi # We only build gdbserver automatically if host and target are the same. if test "x$target" = "x$host"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:9852: checking whether gdbserver is supported on this host" >&5 +echo "configure:10028: checking whether gdbserver is supported on this host" >&5 if test "x$build_gdbserver" = xyes; then configdirs="$configdirs gdbserver" echo "$ac_t""yes" 1>&6 @@ -9912,12 +10088,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:9916: checking for Cygwin environment" >&5 +echo "configure:10092: 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:10108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -9945,19 +10121,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:9949: checking for mingw32 environment" >&5 +echo "configure:10125: 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:10137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -9976,7 +10152,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:9980: checking for executable suffix" >&5 +echo "configure:10156: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9986,10 +10162,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:9990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:10166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -10028,7 +10204,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:10032: checking for iconv" >&5 +echo "configure:10208: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10036,7 +10212,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include @@ -10046,7 +10222,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -10058,7 +10234,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat > conftest.$ac_ext < #include @@ -10068,7 +10244,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -10089,13 +10265,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:10093: checking for iconv declaration" >&5 +echo "configure:10269: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -10114,7 +10290,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:10118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -10330,6 +10506,8 @@ s%@DLLTOOL@%$DLLTOOL%g s%@WINDRES@%$WINDRES%g s%@MIG@%$MIG%g s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g +s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g +s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g s%@WARN_CFLAGS@%$WARN_CFLAGS%g s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g @@ -10392,6 +10570,7 @@ s%@GDBTK_SRC_DIR@%$GDBTK_SRC_DIR%g s%@IGNORE_SIM@%$IGNORE_SIM%g s%@IGNORE_SIM_OBS@%$IGNORE_SIM_OBS%g s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g +s%@PROFILE_CFLAGS@%$PROFILE_CFLAGS%g s%@CONFIG_OBS@%$CONFIG_OBS%g s%@CONFIG_LIB_OBS@%$CONFIG_LIB_OBS%g s%@CONFIG_DEPS@%$CONFIG_DEPS%g diff --git a/gdb/configure.host b/gdb/configure.host index fc16f17..3f2d749 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -54,7 +54,7 @@ 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-*-bsd*) gdb_host=i386bsd ;; -i[3456]86-*-dgux*) gdb_host=i386dgux ;; +i[3456]86-*-dgux*) gdb_host=i386v4 ;; i[3456]86-*-freebsd*) gdb_host=fbsd ;; i[3456]86-*-netbsdelf*) gdb_host=nbsdelf ;; i[3456]86-*-netbsdaout*) gdb_host=nbsdaout ;; @@ -69,15 +69,13 @@ i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;; i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;; i[3456]86-*-sco*) gdb_host=i386sco ;; i[3456]86-*-solaris*) gdb_host=i386sol2 ;; -i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;; -i[3456]86-*-sysv32*) gdb_host=i386v32 ;; i[3456]86-*-sysv4.2*) gdb_host=i386v42mp ;; i[3456]86-*-sysv4*) gdb_host=i386v4 ;; i[3456]86-*-sysv5*) gdb_host=i386v42mp ;; i[3456]86-*-unixware2*) gdb_host=i386v42mp ;; i[3456]86-*-unixware*) gdb_host=i386v4 ;; i[3456]86-*-sysv*) gdb_host=i386v ;; -i[3456]86-*-isc*) gdb_host=i386v32 ;; +i[3456]86-*-isc*) gdb_host=i386v ;; i[3456]86-*-cygwin*) gdb_host=cygwin ;; ia64-*-aix*) gdb_host=aix ;; diff --git a/gdb/configure.in b/gdb/configure.in index 064ff4e..65b62f0 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -38,7 +38,7 @@ AC_CANONICAL_SYSTEM # doesn't support cross-compilation, but the one from Autoconf 2.5x # does. Override RANLIB here (i.e. before running AC_PROG_RANLIB) to # deal with the lossage. Note that CY_GNU_GETTEXT currently calls -# AC_PROG_RANLIB. This can be removed when we switch to # Autoconf +# AC_PROG_RANLIB. This can be removed when we switch to Autoconf # 2.5x. AC_CHECK_TOOL(RANLIB, ranlib, :) @@ -47,6 +47,15 @@ ALL_LINGUAS= CY_GNU_GETTEXT AC_DEFINE(PACKAGE, "gdb", [Name of this package. ]) +debugdir=${libdir}/debug + +AC_ARG_WITH(separate-debug-dir, +[ --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]], +[debugdir="${withval}"]) + +AC_DEFINE_DIR(DEBUGDIR, debugdir, + [Global directory for separate debug files. ]) +#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"), dnl List of object files added by configure. @@ -164,7 +173,7 @@ fi # Enable gdbtk. AC_ARG_ENABLE(gdbtk, -[ --enable-gtk enable gdbtk graphical user interface (GUI)], +[ --enable-gdbtk enable gdbtk graphical user interface (GUI)], [case $enableval in yes | no) ;; @@ -183,6 +192,37 @@ case $host_os in enable_gdbtk=no ;; esac +# Profiling support. +AC_ARG_ENABLE(profiling, +[ --enable-profiling enable profiling of GDB], + [case $enableval in + yes | no) + ;; + *) + AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;; + esac], + [enable_profiling=no]) + +AC_CHECK_FUNCS(monstartup _mcleanup) +if test "$enable_profiling" = yes ; then + if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then + AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup) + fi + PROFILE_CFLAGS=-pg + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PROFILE_CFLAGS" + + AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg, + [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes, + ac_cv_cc_supports_pg=no)]) + + if test $ac_cv_cc_supports_pg = no; then + AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg) + fi + + CFLAGS="$OLD_CFLAGS" +fi + # --------------------- # # Checks for programs. # # --------------------- # @@ -851,6 +891,38 @@ fi dnl Handle optional features that can be enabled. +AC_ARG_WITH(sysroot, +[ --with-sysroot[=DIR] Search for usr/lib et al within DIR.], +[ + case ${with_sysroot} in + yes) AC_ERROR(with-sysroot must specify path) ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' + + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + case ${TARGET_SYSTEM_ROOT} in + ${test_prefix}*) + t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" + TARGET_SYSTEM_ROOT_DEFINE="$t" + ;; + esac +], [ + TARGET_SYSTEM_ROOT= + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"' +]) +AC_SUBST(TARGET_SYSTEM_ROOT) +AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + # NOTE: Don't add -Wall or -Wunused, they both include # -Wunused-parameter which reports bogus warnings. # NOTE: If you add to this list, remember to update @@ -1132,6 +1204,7 @@ AC_SUBST(IGNORE_SIM) AC_SUBST(IGNORE_SIM_OBS) AC_SUBST(ENABLE_CFLAGS) +AC_SUBST(PROFILE_CFLAGS) AC_SUBST(CONFIG_OBS) AC_SUBST(CONFIG_LIB_OBS) diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 76b9b12..488b41f 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -126,7 +126,6 @@ m68000-*-sunos4*) gdb_target=sun2os4 ;; m68*-bull-sysv*) gdb_target=dpx2 ;; m68*-att-*) gdb_target=3b1 ;; m68*-cisco*-*) gdb_target=cisco ;; -m68*-ericsson-*) gdb_target=es1800 ;; m68*-motorola-*) gdb_target=delta68 ;; m68*-netx-*) gdb_target=vxworks68 ;; m68*-tandem-*) gdb_target=st2000 ;; diff --git a/gdb/corefile.c b/gdb/corefile.c index b525656..8a0073a 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -1,7 +1,7 @@ /* Core dump and executable file functions above target vector, for GDB. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1996, 1997, 1998, - 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1996, 1997, + 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/corelow.c b/gdb/corelow.c index ff758b8..016140f 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -58,7 +58,7 @@ static struct core_fns *core_vec = NULL; static void core_files_info (struct target_ops *); #ifdef SOLIB_ADD -static int solib_add_stub (PTR); +static int solib_add_stub (void *); #endif static struct core_fns *sniff_core_bfd (bfd *); @@ -75,7 +75,7 @@ static void core_close_cleanup (void *ignore); static void get_core_registers (int); -static void add_to_thread_list (bfd *, asection *, PTR); +static void add_to_thread_list (bfd *, asection *, void *); static int ignore (CORE_ADDR, char *); @@ -222,7 +222,7 @@ core_close_cleanup (void *ignore) is really an int * which points to from_tty. */ static int -solib_add_stub (PTR from_ttyp) +solib_add_stub (void *from_ttyp) { SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target, auto_solib_add); re_enable_breakpoints_in_shlibs (); @@ -234,7 +234,7 @@ solib_add_stub (PTR from_ttyp) list of threads in a core file. */ static void -add_to_thread_list (bfd *abfd, asection *asect, PTR reg_sect_arg) +add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) { int thread_id; asection *reg_sect = (asection *) reg_sect_arg; diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index f362d84..a2ccbdb 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -130,7 +130,8 @@ cp_print_class_method (char *valaddr, check_stub_method_group (domain, i); for (j = 0; j < len2; j++) { - if (STREQ (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j))) + if (strcmp (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j)) + == 0) goto common; } } diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index b9fae82..5911318 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1868,8 +1868,7 @@ process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env) /* Just a forward declaration. */ -unsigned long -get_data_from_address (unsigned short *inst, CORE_ADDR address); +unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address); /* Calculates the prefix value for the general case of offset addressing mode. */ @@ -4008,7 +4007,7 @@ bfd_lookup_symbol (bfd *abfd, const char *symname) if (storage_needed > 0) { symbol_table = (asymbol **) xmalloc (storage_needed); - back_to = make_cleanup (free, (PTR) symbol_table); + back_to = make_cleanup (free, symbol_table); number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); for (i = 0; i < number_of_symbols; i++) diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 76b2a6d..c6b94bd 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -24,6 +24,7 @@ #include "defs.h" #include "frame.h" +#include "frame-unwind.h" #include "symtab.h" #include "gdbtypes.h" #include "gdbcmd.h" @@ -42,6 +43,8 @@ #include "gdb/sim-d10v.h" #include "sim-regno.h" +#include "gdb_assert.h" + struct frame_extra_info { CORE_ADDR return_pc; @@ -102,19 +105,6 @@ static void d10v_eva_prepare_to_trace (void); static void d10v_eva_get_trace_data (void); -static int prologue_find_regs (unsigned short op, struct frame_info *fi, - CORE_ADDR addr); - -static void d10v_frame_init_saved_regs (struct frame_info *); - -static void do_d10v_pop_frame (struct frame_info *fi); - -static int -d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame) -{ - return (get_frame_pc (frame) > IMEM_START); -} - static CORE_ADDR d10v_stack_align (CORE_ADDR len) { @@ -472,22 +462,36 @@ d10v_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */ static void -d10v_store_return_value (struct type *type, char *valbuf) +d10v_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) { - char tmp = 0; - /* Only char return values need to be shifted right within R0. */ + /* Only char return values need to be shifted right within the first + regnum. */ if (TYPE_LENGTH (type) == 1 && TYPE_CODE (type) == TYPE_CODE_INT) { - /* zero the high byte */ - deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM), &tmp, 1); - /* copy the low byte */ - deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM) + 1, - valbuf, 1); + bfd_byte tmp[2]; + tmp[1] = *(bfd_byte *)valbuf; + regcache_cooked_write (regcache, RET1_REGNUM, tmp); } else - deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM), - valbuf, TYPE_LENGTH (type)); + { + int reg; + /* A structure is never more than 8 bytes long. See + use_struct_convention(). */ + gdb_assert (TYPE_LENGTH (type) <= 8); + /* Write out most registers, stop loop before trying to write + out any dangling byte at the end of the buffer. */ + for (reg = 0; (reg * 2) + 1 < TYPE_LENGTH (type); reg++) + { + regcache_cooked_write (regcache, RET1_REGNUM + reg, + (bfd_byte *) valbuf + reg * 2); + } + /* Write out any dangling byte at the end of the buffer. */ + if ((reg * 2) + 1 == TYPE_LENGTH (type)) + regcache_cooked_write_part (regcache, reg, 0, 1, + (bfd_byte *) valbuf + reg * 2); + } } /* Extract from an array REGBUF containing the (raw) register state @@ -495,24 +499,11 @@ d10v_store_return_value (struct type *type, char *valbuf) as a CORE_ADDR (or an expression that can be used as one). */ static CORE_ADDR -d10v_extract_struct_value_address (char *regbuf) +d10v_extract_struct_value_address (struct regcache *regcache) { - return (extract_address ((regbuf) + REGISTER_BYTE (ARG1_REGNUM), - REGISTER_RAW_SIZE (ARG1_REGNUM)) - | DMEM_START); -} - -static CORE_ADDR -d10v_frame_saved_pc (struct frame_info *frame) -{ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) - return d10v_make_iaddr (deprecated_read_register_dummy (get_frame_pc (frame), - get_frame_base (frame), - PC_REGNUM)); - else - return (get_frame_extra_info (frame)->return_pc); + ULONGEST addr; + regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr); + return (addr | DMEM_START); } /* Immediately after a function call, return the saved pc. We can't @@ -526,55 +517,6 @@ d10v_saved_pc_after_call (struct frame_info *frame) | IMEM_START); } -/* Discard from the stack the innermost frame, restoring all saved - registers. */ - -static void -d10v_pop_frame (void) -{ - generic_pop_current_frame (do_d10v_pop_frame); -} - -static void -do_d10v_pop_frame (struct frame_info *fi) -{ - CORE_ADDR fp; - int regnum; - char raw_buffer[8]; - - fp = get_frame_base (fi); - /* fill out fsr with the address of where each */ - /* register was stored in the frame */ - d10v_frame_init_saved_regs (fi); - - /* now update the current registers with the old values */ - for (regnum = A0_REGNUM; regnum < A0_REGNUM + NR_A_REGS; regnum++) - { - if (get_frame_saved_regs (fi)[regnum]) - { - read_memory (get_frame_saved_regs (fi)[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum)); - deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, - REGISTER_RAW_SIZE (regnum)); - } - } - for (regnum = 0; regnum < SP_REGNUM; regnum++) - { - if (get_frame_saved_regs (fi)[regnum]) - { - write_register (regnum, read_memory_unsigned_integer (get_frame_saved_regs (fi)[regnum], REGISTER_RAW_SIZE (regnum))); - } - } - if (get_frame_saved_regs (fi)[PSW_REGNUM]) - { - write_register (PSW_REGNUM, read_memory_unsigned_integer (get_frame_saved_regs (fi)[PSW_REGNUM], REGISTER_RAW_SIZE (PSW_REGNUM))); - } - - write_register (PC_REGNUM, read_register (LR_REGNUM)); - write_register (SP_REGNUM, fp + get_frame_extra_info (fi)->size); - target_store_registers (-1); - flush_cached_frames (); -} - static int check_prologue (unsigned short op) { @@ -672,54 +614,20 @@ d10v_skip_prologue (CORE_ADDR pc) return pc; } -/* Given a GDB frame, determine the address of the calling function's - frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. */ - -static CORE_ADDR -d10v_frame_chain (struct frame_info *fi) +struct d10v_unwind_cache { - CORE_ADDR addr; - - /* A generic call dummy's frame is the same as caller's. */ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), - get_frame_base (fi))) - return get_frame_base (fi); - - d10v_frame_init_saved_regs (fi); - - - if (get_frame_extra_info (fi)->return_pc == IMEM_START - || inside_entry_file (get_frame_extra_info (fi)->return_pc)) - { - /* This is meant to halt the backtrace at "_start". - Make sure we don't halt it at a generic dummy frame. */ - if (!DEPRECATED_PC_IN_CALL_DUMMY (get_frame_extra_info (fi)->return_pc, 0, 0)) - return (CORE_ADDR) 0; - } - - if (!get_frame_saved_regs (fi)[FP_REGNUM]) - { - if (!get_frame_saved_regs (fi)[SP_REGNUM] - || get_frame_saved_regs (fi)[SP_REGNUM] == STACK_START) - return (CORE_ADDR) 0; - - return get_frame_saved_regs (fi)[SP_REGNUM]; - } - - addr = read_memory_unsigned_integer (get_frame_saved_regs (fi)[FP_REGNUM], - REGISTER_RAW_SIZE (FP_REGNUM)); - if (addr == 0) - return (CORE_ADDR) 0; - - return d10v_make_daddr (addr); -} - -static int next_addr, uses_frame; + CORE_ADDR return_pc; + int frameless; + int size; + CORE_ADDR *saved_regs; + CORE_ADDR next_addr; + int uses_frame; + void **regs; +}; static int -prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) +prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, + CORE_ADDR addr) { int n; @@ -727,8 +635,8 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) if ((op & 0x7E1F) == 0x6C1F) { n = (op & 0x1E0) >> 5; - next_addr -= 2; - get_frame_saved_regs (fi)[n] = next_addr; + info->next_addr -= 2; + info->saved_regs[n] = info->next_addr; return 1; } @@ -736,9 +644,9 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) else if ((op & 0x7E3F) == 0x6E1F) { n = (op & 0x1E0) >> 5; - next_addr -= 4; - get_frame_saved_regs (fi)[n] = next_addr; - get_frame_saved_regs (fi)[n + 1] = next_addr + 2; + info->next_addr -= 4; + info->saved_regs[n] = info->next_addr; + info->saved_regs[n + 1] = info->next_addr + 2; return 1; } @@ -748,14 +656,14 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) n = (op & 0x1E) >> 1; if (n == 0) n = 16; - next_addr -= n; + info->next_addr -= n; return 1; } /* mv r11, sp */ if (op == 0x417E) { - uses_frame = 1; + info->uses_frame = 1; return 1; } @@ -767,7 +675,7 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) if ((op & 0x7E1F) == 0x681E) { n = (op & 0x1E0) >> 5; - get_frame_saved_regs (fi)[n] = next_addr; + info->saved_regs[n] = info->next_addr; return 1; } @@ -775,8 +683,8 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) if ((op & 0x7E3F) == 0x3A1E) { n = (op & 0x1E0) >> 5; - get_frame_saved_regs (fi)[n] = next_addr; - get_frame_saved_regs (fi)[n + 1] = next_addr + 2; + info->saved_regs[n] = info->next_addr; + info->saved_regs[n + 1] = info->next_addr + 2; return 1; } @@ -789,21 +697,33 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -static void -d10v_frame_init_saved_regs (struct frame_info *fi) +struct d10v_unwind_cache * +d10v_frame_unwind_cache (struct frame_info *fi, + void **cache) { CORE_ADDR fp, pc; unsigned long op; unsigned short op1, op2; int i; + struct d10v_unwind_cache *info; + + if ((*cache)) + return (*cache); + + info = FRAME_OBSTACK_ZALLOC (struct d10v_unwind_cache); + (*cache) = info; + info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); + + info->frameless = 0; + info->size = 0; + info->return_pc = 0; fp = get_frame_base (fi); - memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS); - next_addr = 0; + info->next_addr = 0; pc = get_pc_function_start (get_frame_pc (fi)); - uses_frame = 0; + info->uses_frame = 0; while (1) { op = (unsigned long) read_memory_integer (pc, 4); @@ -814,22 +734,22 @@ d10v_frame_init_saved_regs (struct frame_info *fi) { /* add3 sp,sp,n */ short n = op & 0xFFFF; - next_addr += n; + info->next_addr += n; } else if ((op & 0x3F0F0000) == 0x340F0000) { /* st rn, @(offset,sp) */ short offset = op & 0xFFFF; short n = (op >> 20) & 0xF; - get_frame_saved_regs (fi)[n] = next_addr + offset; + info->saved_regs[n] = info->next_addr + offset; } else if ((op & 0x3F1F0000) == 0x350F0000) { /* st2w rn, @(offset,sp) */ short offset = op & 0xFFFF; short n = (op >> 20) & 0xF; - get_frame_saved_regs (fi)[n] = next_addr + offset; - get_frame_saved_regs (fi)[n + 1] = next_addr + offset + 2; + info->saved_regs[n] = info->next_addr + offset; + info->saved_regs[n + 1] = info->next_addr + offset + 2; } else break; @@ -847,141 +767,142 @@ d10v_frame_init_saved_regs (struct frame_info *fi) op1 = (op & 0x3FFF8000) >> 15; op2 = op & 0x7FFF; } - if (!prologue_find_regs (op1, fi, pc) - || !prologue_find_regs (op2, fi, pc)) + if (!prologue_find_regs (info, op1, pc) + || !prologue_find_regs (info, op2, pc)) break; } pc += 4; } - get_frame_extra_info (fi)->size = -next_addr; + info->size = -info->next_addr; if (!(fp & 0xffff)) fp = d10v_read_sp (); for (i = 0; i < NUM_REGS - 1; i++) - if (get_frame_saved_regs (fi)[i]) + if (info->saved_regs[i]) { - get_frame_saved_regs (fi)[i] = fp - (next_addr - get_frame_saved_regs (fi)[i]); + info->saved_regs[i] = fp - (info->next_addr - info->saved_regs[i]); } - if (get_frame_saved_regs (fi)[LR_REGNUM]) + if (info->saved_regs[LR_REGNUM]) { CORE_ADDR return_pc - = read_memory_unsigned_integer (get_frame_saved_regs (fi)[LR_REGNUM], + = read_memory_unsigned_integer (info->saved_regs[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM)); - get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (return_pc); + info->return_pc = d10v_make_iaddr (return_pc); } else { - get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (read_register (LR_REGNUM)); + ULONGEST return_pc; + frame_read_unsigned_register (fi, LR_REGNUM, &return_pc); + info->return_pc = d10v_make_iaddr (return_pc); } /* The SP is not normally (ever?) saved, but check anyway */ - if (!get_frame_saved_regs (fi)[SP_REGNUM]) + if (!info->saved_regs[SP_REGNUM]) { /* if the FP was saved, that means the current FP is valid, */ /* otherwise, it isn't being used, so we use the SP instead */ - if (uses_frame) - get_frame_saved_regs (fi)[SP_REGNUM] - = d10v_read_fp () + get_frame_extra_info (fi)->size; + if (info->uses_frame) + info->saved_regs[SP_REGNUM] + = d10v_read_fp () + info->size; else { - get_frame_saved_regs (fi)[SP_REGNUM] = fp + get_frame_extra_info (fi)->size; - get_frame_extra_info (fi)->frameless = 1; - get_frame_saved_regs (fi)[FP_REGNUM] = 0; + info->saved_regs[SP_REGNUM] = fp + info->size; + info->frameless = 1; + info->saved_regs[FP_REGNUM] = 0; } } + + return info; } static void -d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi) -{ - frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - frame_saved_regs_zalloc (fi); - - get_frame_extra_info (fi)->frameless = 0; - get_frame_extra_info (fi)->size = 0; - get_frame_extra_info (fi)->return_pc = 0; - - /* If get_frame_pc (fi) is zero, but this is not the outermost frame, - then let's snatch the return_pc from the callee, so that - DEPRECATED_PC_IN_CALL_DUMMY will work. */ - if (get_frame_pc (fi) == 0 - && frame_relative_level (fi) != 0 && get_next_frame (fi) != NULL) - deprecated_update_frame_pc_hack (fi, d10v_frame_saved_pc (get_next_frame (fi))); - - /* The call dummy doesn't save any registers on the stack, so we can - return now. */ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), - get_frame_base (fi))) +d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame, int regnum, int all) +{ + if (regnum >= 0) { + default_print_registers_info (gdbarch, file, frame, regnum, all); return; } - else - { - d10v_frame_init_saved_regs (fi); - } + + { + ULONGEST pc, psw, rpt_s, rpt_e, rpt_c; + frame_read_unsigned_register (frame, PC_REGNUM, &pc); + frame_read_unsigned_register (frame, PSW_REGNUM, &psw); + frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_s", -1), &rpt_s); + frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_e", -1), &rpt_e); + frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_c", -1), &rpt_c); + fprintf_filtered (file, "PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n", + (long) pc, (long) d10v_make_iaddr (pc), (long) psw, + (long) rpt_s, (long) rpt_e, (long) rpt_c); + } + + { + int group; + for (group = 0; group < 16; group += 8) + { + int r; + fprintf_filtered (file, "R%d-R%-2d", group, group + 7); + for (r = group; r < group + 8; r++) + { + ULONGEST tmp; + frame_read_unsigned_register (frame, r, &tmp); + fprintf_filtered (file, " %04lx", (long) tmp); + } + fprintf_filtered (file, "\n"); + } + } + + /* Note: The IMAP/DMAP registers don't participate in function + calls. Don't bother trying to unwind them. */ + + { + int a; + for (a = 0; a < NR_IMAP_REGS; a++) + { + if (a > 0) + fprintf_filtered (file, " "); + fprintf_filtered (file, "IMAP%d %04lx", a, d10v_imap_register (a)); + } + if (NR_DMAP_REGS == 1) + /* Registers DMAP0 and DMAP1 are constant. Just return dmap2. */ + fprintf_filtered (file, " DMAP %04lx\n", d10v_dmap_register (2)); + else + { + for (a = 0; a < NR_DMAP_REGS; a++) + { + fprintf_filtered (file, " DMAP%d %04lx", a, d10v_dmap_register (a)); + } + fprintf_filtered (file, "\n"); + } + } + + { + char *num = alloca (max_register_size (gdbarch)); + int a; + fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1); + for (a = A0_REGNUM; a < A0_REGNUM + NR_A_REGS; a++) + { + int i; + fprintf_filtered (file, " "); + frame_register_read (frame, a, num); + for (i = 0; i < MAX_REGISTER_RAW_SIZE; i++) + { + fprintf_filtered (file, "%02x", (num[i] & 0xff)); + } + } + } + fprintf_filtered (file, "\n"); } static void show_regs (char *args, int from_tty) { - int a; - printf_filtered ("PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n", - (long) read_register (PC_REGNUM), - (long) d10v_make_iaddr (read_register (PC_REGNUM)), - (long) read_register (PSW_REGNUM), - (long) read_register (24), - (long) read_register (25), - (long) read_register (23)); - printf_filtered ("R0-R7 %04lx %04lx %04lx %04lx %04lx %04lx %04lx %04lx\n", - (long) read_register (0), - (long) read_register (1), - (long) read_register (2), - (long) read_register (3), - (long) read_register (4), - (long) read_register (5), - (long) read_register (6), - (long) read_register (7)); - printf_filtered ("R8-R15 %04lx %04lx %04lx %04lx %04lx %04lx %04lx %04lx\n", - (long) read_register (8), - (long) read_register (9), - (long) read_register (10), - (long) read_register (11), - (long) read_register (12), - (long) read_register (13), - (long) read_register (14), - (long) read_register (15)); - for (a = 0; a < NR_IMAP_REGS; a++) - { - if (a > 0) - printf_filtered (" "); - printf_filtered ("IMAP%d %04lx", a, d10v_imap_register (a)); - } - if (NR_DMAP_REGS == 1) - printf_filtered (" DMAP %04lx\n", d10v_dmap_register (2)); - else - { - for (a = 0; a < NR_DMAP_REGS; a++) - { - printf_filtered (" DMAP%d %04lx", a, d10v_dmap_register (a)); - } - printf_filtered ("\n"); - } - printf_filtered ("A0-A%d", NR_A_REGS - 1); - for (a = A0_REGNUM; a < A0_REGNUM + NR_A_REGS; a++) - { - char num[MAX_REGISTER_RAW_SIZE]; - int i; - printf_filtered (" "); - deprecated_read_register_gen (a, (char *) &num); - for (i = 0; i < MAX_REGISTER_RAW_SIZE; i++) - { - printf_filtered ("%02x", (num[i] & 0xff)); - } - } - printf_filtered ("\n"); + d10v_print_registers_info (current_gdbarch, gdb_stdout, + get_current_frame (), -1, 1); } static CORE_ADDR @@ -1149,8 +1070,8 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, extract and copy its value into `valbuf'. */ static void -d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES], - char *valbuf) +d10v_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { int len; #if 0 @@ -1159,25 +1080,34 @@ d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES], (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM))); #endif - len = TYPE_LENGTH (type); - if (len == 1) + if (TYPE_LENGTH (type) == 1) { - unsigned short c; - - c = extract_unsigned_integer (regbuf + REGISTER_BYTE (RET1_REGNUM), - REGISTER_RAW_SIZE (RET1_REGNUM)); + ULONGEST c; + regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &c); store_unsigned_integer (valbuf, 1, c); } - else if ((len & 1) == 0) - memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM), len); else { /* For return values of odd size, the first byte is in the least significant part of the first register. The - remaining bytes in remaining registers. Interestingly, - when such values are passed in, the last byte is in the - most significant byte of that same register - wierd. */ - memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM) + 1, len); + remaining bytes in remaining registers. Interestingly, when + such values are passed in, the last byte is in the most + significant byte of that same register - wierd. */ + int reg = RET1_REGNUM; + int off = 0; + if (TYPE_LENGTH (type) & 1) + { + regcache_cooked_read_part (regcache, RET1_REGNUM, 1, 1, + (bfd_byte *)valbuf + off); + off++; + reg++; + } + /* Transfer the remaining registers. */ + for (; off < TYPE_LENGTH (type); reg++, off += 2) + { + regcache_cooked_read (regcache, RET1_REGNUM + reg, + (bfd_byte *) valbuf + off); + } } } @@ -1492,6 +1422,171 @@ display_trace (int low, int high) } +static CORE_ADDR +d10v_frame_pc_unwind (struct frame_info *frame, + void **cache) +{ + struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache); + return info->return_pc; +} + +/* Given a GDB frame, determine the address of the calling function's + frame. This will be used to create a new GDB frame struct. */ + +static void +d10v_frame_id_unwind (struct frame_info *frame, + void **cache, + struct frame_id *id) +{ + struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache); + CORE_ADDR addr; + + /* Start with a NULL frame ID. */ + (*id) = null_frame_id; + + if (info->return_pc == IMEM_START + || info->return_pc <= IMEM_START + || inside_entry_file (info->return_pc)) + { + /* This is meant to halt the backtrace at "_start". + Make sure we don't halt it at a generic dummy frame. */ + return; + } + + if (!info->saved_regs[FP_REGNUM]) + { + if (!info->saved_regs[SP_REGNUM] + || info->saved_regs[SP_REGNUM] == STACK_START) + return; + + id->base = info->saved_regs[SP_REGNUM]; + id->pc = info->return_pc; + } + + addr = read_memory_unsigned_integer (info->saved_regs[FP_REGNUM], + REGISTER_RAW_SIZE (FP_REGNUM)); + if (addr == 0) + return; + + id->base = d10v_make_daddr (addr); + id->pc = info->return_pc; +} + +static void +saved_regs_unwinder (struct frame_info *frame, + CORE_ADDR *saved_regs, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) +{ + /* 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 (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && (get_frame_type (frame) == DUMMY_FRAME))); + + if (saved_regs[regnum] != 0) + { + if (regnum == SP_REGNUM) + { + /* SP register treated specially. */ + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + if (bufferp != NULL) + store_address (bufferp, REGISTER_RAW_SIZE (regnum), + saved_regs[regnum]); + } + else + { + /* Any other register is saved in memory, fetch it but cache + a local copy of its value. */ + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = saved_regs[regnum]; + *realnump = -1; + if (bufferp != NULL) + { + /* Read the value in from memory. */ + read_memory (saved_regs[regnum], bufferp, + REGISTER_RAW_SIZE (regnum)); + } + } + return; + } + + /* No luck, assume this and the next frame have the same register + value. If a value is needed, pass the request on down the chain; + otherwise just return an indication that the value is in the same + register as the next frame. */ + frame_register (frame, regnum, optimizedp, lvalp, addrp, + realnump, bufferp); +} + + +static void +d10v_frame_register_unwind (struct frame_info *frame, + void **cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) +{ + struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache); + saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp, + lvalp, addrp, realnump, bufferp); +} + + +static void +d10v_frame_pop (struct frame_info *fi, void **unwind_cache, + struct regcache *regcache) +{ + struct d10v_unwind_cache *info = d10v_frame_unwind_cache (fi, unwind_cache); + CORE_ADDR fp; + int regnum; + char raw_buffer[8]; + + fp = get_frame_base (fi); + + /* now update the current registers with the old values */ + for (regnum = A0_REGNUM; regnum < A0_REGNUM + NR_A_REGS; regnum++) + { + frame_unwind_register (fi, regnum, raw_buffer); + regcache_cooked_write (regcache, regnum, raw_buffer); + } + for (regnum = 0; regnum < SP_REGNUM; regnum++) + { + frame_unwind_register (fi, regnum, raw_buffer); + regcache_cooked_write (regcache, regnum, raw_buffer); + } + frame_unwind_register (fi, PSW_REGNUM, raw_buffer); + regcache_cooked_write (regcache, PSW_REGNUM, raw_buffer); + + frame_unwind_register (fi, LR_REGNUM, raw_buffer); + regcache_cooked_write (regcache, PC_REGNUM, raw_buffer); + + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (SP_REGNUM), + fp + info->size); + regcache_cooked_write (regcache, SP_REGNUM, raw_buffer); + + target_store_registers (-1); + flush_cached_frames (); +} + +static struct frame_unwind d10v_frame_unwind = { + d10v_frame_pop, + d10v_frame_pc_unwind, + d10v_frame_id_unwind, + d10v_frame_register_unwind +}; + +const struct frame_unwind * +d10v_frame_p (CORE_ADDR pc) +{ + return &d10v_frame_unwind; +} + static gdbarch_init_ftype d10v_gdbarch_init; static struct gdbarch * @@ -1515,10 +1610,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); - /* NOTE: cagney/2002-12-06: This can be deleted when this arch is - ready to unwind the PC first (see frame.c:get_prev_frame()). */ - set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); - switch (info.bfd_arch_info->mach) { case bfd_mach_d10v_ts2: @@ -1604,21 +1695,16 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_deprecated_extract_return_value (gdbarch, d10v_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value); set_gdbarch_push_arguments (gdbarch, d10v_push_arguments); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, d10v_push_return_address); set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return); - 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_store_return_value (gdbarch, d10v_store_return_value); + set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention); - set_gdbarch_frame_init_saved_regs (gdbarch, d10v_frame_init_saved_regs); - set_gdbarch_init_extra_frame_info (gdbarch, d10v_init_extra_frame_info); - - set_gdbarch_pop_frame (gdbarch, d10v_pop_frame); - set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_decr_pc_after_break (gdbarch, 4); @@ -1629,9 +1715,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); - set_gdbarch_frame_chain (gdbarch, d10v_frame_chain); - set_gdbarch_frame_chain_valid (gdbarch, d10v_frame_chain_valid); - set_gdbarch_frame_saved_pc (gdbarch, d10v_frame_saved_pc); set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); @@ -1640,6 +1723,10 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno); set_gdbarch_extra_stack_alignment_needed (gdbarch, 0); + set_gdbarch_print_registers_info (gdbarch, d10v_print_registers_info); + + frame_unwind_append_predicate (gdbarch, d10v_frame_p); + return gdbarch; } @@ -1657,7 +1744,8 @@ _initialize_d10v_tdep (void) target_resume_hook = d10v_eva_prepare_to_trace; target_wait_loop_hook = d10v_eva_get_trace_data; - add_com ("regs", class_vars, show_regs, "Print all registers"); + deprecate_cmd (add_com ("regs", class_vars, show_regs, "Print all registers"), + "info registers"); add_com ("itrace", class_support, trace_command, "Enable tracing of instruction execution."); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 4fcb968..2a1d4e2 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1,6 +1,6 @@ /* Read dbx symbol tables and convert to internal format, for GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003. Free Software Foundation, Inc. This file is part of GDB. @@ -257,7 +257,9 @@ static int bincls_allocated; extern void _initialize_dbxread (void); -static void process_now (struct objfile *); +#if 0 /* OBSOLETE CFront */ +// OBSOLETE static void process_now (struct objfile *); +#endif /* OBSOLETE CFront */ static void read_ofile_symtab (struct partial_symtab *); @@ -636,7 +638,7 @@ dbx_symfile_init (struct objfile *objfile) /* Allocate struct to keep track of the symfile */ objfile->sym_stab_info = (struct dbx_symfile_info *) xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); - memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); + memset (objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text"); DBX_DATA_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".data"); @@ -688,8 +690,8 @@ dbx_symfile_init (struct objfile *objfile) if (val < 0) perror_with_name (name); - memset ((PTR) size_temp, 0, sizeof (size_temp)); - val = bfd_bread ((PTR) size_temp, sizeof (size_temp), sym_bfd); + memset (size_temp, 0, sizeof (size_temp)); + val = bfd_bread (size_temp, sizeof (size_temp), sym_bfd); if (val < 0) { perror_with_name (name); @@ -770,105 +772,106 @@ static struct external_nlist symbuf[4096]; static int symbuf_idx; static int symbuf_end; -/* cont_elem is used for continuing information in cfront. - It saves information about which types need to be fixed up and - completed after all the stabs are read. */ -struct cont_elem - { - /* sym and stabstring for continuing information in cfront */ - struct symbol *sym; - char *stabs; - /* state dependencies (statics that must be preserved) */ - int sym_idx; - int sym_end; - int symnum; - int (*func) (struct objfile *, struct symbol *, char *); - /* other state dependencies include: - (assumption is that these will not change since process_now FIXME!!) - stringtab_global - n_stabs - objfile - symfile_bfd */ - }; - -static struct cont_elem *cont_list = 0; -static int cont_limit = 0; -static int cont_count = 0; - -/* Arrange for function F to be called with arguments SYM and P later - in the stabs reading process. */ -void -process_later (struct symbol *sym, char *p, - int (*f) (struct objfile *, struct symbol *, char *)) -{ - - /* Allocate more space for the deferred list. */ - if (cont_count >= cont_limit - 1) - { - cont_limit += 32; /* chunk size */ - - cont_list - = (struct cont_elem *) xrealloc (cont_list, - (cont_limit - * sizeof (struct cont_elem))); - if (!cont_list) - error ("Virtual memory exhausted\n"); - } - - /* Save state variables so we can process these stabs later. */ - cont_list[cont_count].sym_idx = symbuf_idx; - cont_list[cont_count].sym_end = symbuf_end; - cont_list[cont_count].symnum = symnum; - cont_list[cont_count].sym = sym; - cont_list[cont_count].stabs = p; - cont_list[cont_count].func = f; - cont_count++; -} - -/* Call deferred funtions in CONT_LIST. */ - -static void -process_now (struct objfile *objfile) -{ - int i; - int save_symbuf_idx; - int save_symbuf_end; - int save_symnum; - struct symbol *sym; - char *stabs; - int err; - int (*func) (struct objfile *, struct symbol *, char *); - - /* Save the state of our caller, we'll want to restore it before - returning. */ - save_symbuf_idx = symbuf_idx; - save_symbuf_end = symbuf_end; - save_symnum = symnum; - - /* Iterate over all the deferred stabs. */ - for (i = 0; i < cont_count; i++) - { - /* Restore the state for this deferred stab. */ - symbuf_idx = cont_list[i].sym_idx; - symbuf_end = cont_list[i].sym_end; - symnum = cont_list[i].symnum; - sym = cont_list[i].sym; - stabs = cont_list[i].stabs; - func = cont_list[i].func; - - /* Call the function to handle this deferrd stab. */ - err = (*func) (objfile, sym, stabs); - if (err) - error ("Internal error: unable to resolve stab.\n"); - } - - /* Restore our caller's state. */ - symbuf_idx = save_symbuf_idx; - symbuf_end = save_symbuf_end; - symnum = save_symnum; - cont_count = 0; -} - +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* cont_elem is used for continuing information in cfront. +// OBSOLETE It saves information about which types need to be fixed up and +// OBSOLETE completed after all the stabs are read. */ +// OBSOLETE struct cont_elem +// OBSOLETE { +// OBSOLETE /* sym and stabstring for continuing information in cfront */ +// OBSOLETE struct symbol *sym; +// OBSOLETE char *stabs; +// OBSOLETE /* state dependencies (statics that must be preserved) */ +// OBSOLETE int sym_idx; +// OBSOLETE int sym_end; +// OBSOLETE int symnum; +// OBSOLETE int (*func) (struct objfile *, struct symbol *, char *); +// OBSOLETE /* other state dependencies include: +// OBSOLETE (assumption is that these will not change since process_now FIXME!!) +// OBSOLETE stringtab_global +// OBSOLETE n_stabs +// OBSOLETE objfile +// OBSOLETE symfile_bfd */ +// OBSOLETE }; + +// OBSOLETE static struct cont_elem *cont_list = 0; +// OBSOLETE static int cont_limit = 0; +// OBSOLETE static int cont_count = 0; + +// OBSOLETE /* Arrange for function F to be called with arguments SYM and P later +// OBSOLETE in the stabs reading process. */ +// OBSOLETE void +// OBSOLETE process_later (struct symbol *sym, char *p, +// OBSOLETE int (*f) (struct objfile *, struct symbol *, char *)) +// OBSOLETE { + +// OBSOLETE /* Allocate more space for the deferred list. */ +// OBSOLETE if (cont_count >= cont_limit - 1) +// OBSOLETE { +// OBSOLETE cont_limit += 32; /* chunk size */ + +// OBSOLETE cont_list +// OBSOLETE = (struct cont_elem *) xrealloc (cont_list, +// OBSOLETE (cont_limit +// OBSOLETE * sizeof (struct cont_elem))); +// OBSOLETE if (!cont_list) +// OBSOLETE error ("Virtual memory exhausted\n"); +// OBSOLETE } + +// OBSOLETE /* Save state variables so we can process these stabs later. */ +// OBSOLETE cont_list[cont_count].sym_idx = symbuf_idx; +// OBSOLETE cont_list[cont_count].sym_end = symbuf_end; +// OBSOLETE cont_list[cont_count].symnum = symnum; +// OBSOLETE cont_list[cont_count].sym = sym; +// OBSOLETE cont_list[cont_count].stabs = p; +// OBSOLETE cont_list[cont_count].func = f; +// OBSOLETE cont_count++; +// OBSOLETE } + +// OBSOLETE /* Call deferred funtions in CONT_LIST. */ + +// OBSOLETE static void +// OBSOLETE process_now (struct objfile *objfile) +// OBSOLETE { +// OBSOLETE int i; +// OBSOLETE int save_symbuf_idx; +// OBSOLETE int save_symbuf_end; +// OBSOLETE int save_symnum; +// OBSOLETE struct symbol *sym; +// OBSOLETE char *stabs; +// OBSOLETE int err; +// OBSOLETE int (*func) (struct objfile *, struct symbol *, char *); + +// OBSOLETE /* Save the state of our caller, we'll want to restore it before +// OBSOLETE returning. */ +// OBSOLETE save_symbuf_idx = symbuf_idx; +// OBSOLETE save_symbuf_end = symbuf_end; +// OBSOLETE save_symnum = symnum; + +// OBSOLETE /* Iterate over all the deferred stabs. */ +// OBSOLETE for (i = 0; i < cont_count; i++) +// OBSOLETE { +// OBSOLETE /* Restore the state for this deferred stab. */ +// OBSOLETE symbuf_idx = cont_list[i].sym_idx; +// OBSOLETE symbuf_end = cont_list[i].sym_end; +// OBSOLETE symnum = cont_list[i].symnum; +// OBSOLETE sym = cont_list[i].sym; +// OBSOLETE stabs = cont_list[i].stabs; +// OBSOLETE func = cont_list[i].func; + +// OBSOLETE /* Call the function to handle this deferrd stab. */ +// OBSOLETE err = (*func) (objfile, sym, stabs); +// OBSOLETE if (err) +// OBSOLETE error ("Internal error: unable to resolve stab.\n"); +// OBSOLETE } + +// OBSOLETE /* Restore our caller's state. */ +// OBSOLETE symbuf_idx = save_symbuf_idx; +// OBSOLETE symbuf_end = save_symbuf_end; +// OBSOLETE symnum = save_symnum; +// OBSOLETE cont_count = 0; +// OBSOLETE } +#endif /* OBSOLETE CFront */ /* Name of last function encountered. Used in Solaris to approximate object file boundaries. */ @@ -890,6 +893,10 @@ static struct stab_section_list *symbuf_sections; static unsigned int symbuf_left; static unsigned int symbuf_read; +/* This variable stores a global stabs buffer, if we read stabs into + memory in one chunk in order to process relocations. */ +static bfd_byte *stabs_data; + /* Refill the symbol table input buffer and set the variables that control fetching entries from it. Reports an error if no data available. @@ -902,8 +909,18 @@ fill_symbuf (bfd *sym_bfd) unsigned int count; int nbytes; - if (symbuf_sections == NULL) - count = sizeof (symbuf); + if (stabs_data) + { + nbytes = sizeof (symbuf); + if (nbytes > symbuf_left) + nbytes = symbuf_left; + memcpy (symbuf, stabs_data + symbuf_read, nbytes); + } + else if (symbuf_sections == NULL) + { + count = sizeof (symbuf); + nbytes = bfd_bread (symbuf, count, sym_bfd); + } else { if (symbuf_left <= 0) @@ -919,9 +936,9 @@ fill_symbuf (bfd *sym_bfd) count = symbuf_left; if (count > sizeof (symbuf)) count = sizeof (symbuf); + nbytes = bfd_bread (symbuf, count, sym_bfd); } - nbytes = bfd_bread ((PTR) symbuf, count, sym_bfd); if (nbytes < 0) perror_with_name (bfd_get_filename (sym_bfd)); else if (nbytes == 0) @@ -932,6 +949,18 @@ fill_symbuf (bfd *sym_bfd) symbuf_read += nbytes; } +static void +stabs_seek (int sym_offset) +{ + if (stabs_data) + { + symbuf_read += sym_offset; + symbuf_left -= sym_offset; + } + else + bfd_seek (symfile_bfd, sym_offset, SEEK_CUR); +} + #define INTERNALIZE_SYMBOL(intern, extern, abfd) \ { \ (intern).n_type = bfd_h_get_8 (abfd, (extern)->e_type); \ @@ -1022,7 +1051,7 @@ find_corresponding_bincl_psymtab (char *name, int instance) static void free_bincl_list (struct objfile *objfile) { - xmfree (objfile->md, (PTR) bincl_list); + xmfree (objfile->md, bincl_list); bincls_allocated = 0; } @@ -1673,7 +1702,7 @@ read_dbx_symtab (struct objfile *objfile) psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - memcpy ((PTR) psymtab_include_list, (PTR) orig, + memcpy (psymtab_include_list, orig, includes_used * sizeof (char *)); } continue; @@ -1775,20 +1804,22 @@ read_dbx_symtab (struct objfile *objfile) psymtab_language, objfile); p += 1; } - /* The semantics of C++ state that "struct foo { ... }" - also defines a typedef for "foo". Unfortuantely, cfront - never makes the typedef when translating from C++ to C. - We make the typedef here so that "ptype foo" works as - expected for cfront translated code. */ - else if (psymtab_language == language_cplus) - { - /* Also a typedef with the same name. */ - add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, - &objfile->static_psymbols, - nlist.n_value, 0, - psymtab_language, objfile); - } +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* The semantics of C++ state that "struct foo { ... }" +// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront +// OBSOLETE never makes the typedef when translating from C++ to C. +// OBSOLETE We make the typedef here so that "ptype foo" works as +// OBSOLETE expected for cfront translated code. */ +// OBSOLETE else if (psymtab_language == language_cplus) +// OBSOLETE { +// OBSOLETE /* Also a typedef with the same name. */ +// OBSOLETE add_psymbol_to_list (namestring, p - namestring, +// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE &objfile->static_psymbols, +// OBSOLETE nlist.n_value, 0, +// OBSOLETE psymtab_language, objfile); +// OBSOLETE } +#endif /* OBSOLETE CFront */ } goto check_enum; case 't': @@ -2023,9 +2054,11 @@ read_dbx_symtab (struct objfile *objfile) case '9': case '-': case '#': /* for symbol identification (used in live ranges) */ - /* added to support cfront stabs strings */ - case 'Z': /* for definition continuations */ - case 'P': /* for prototypes */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* added to support cfront stabs strings */ +// OBSOLETE case 'Z': /* for definition continuations */ +// OBSOLETE case 'P': /* for prototypes */ +#endif /* OBSOLETE CFront */ continue; case ':': @@ -2093,7 +2126,7 @@ read_dbx_symtab (struct objfile *objfile) (struct partial_symtab **) alloca ((dependencies_allocated *= 2) * sizeof (struct partial_symtab *)); - memcpy ((PTR) dependency_list, (PTR) orig, + memcpy (dependency_list, orig, (dependencies_used * sizeof (struct partial_symtab *))); #ifdef DEBUG_INFO @@ -2466,6 +2499,7 @@ static void dbx_psymtab_to_symtab (struct partial_symtab *pst) { bfd *sym_bfd; + struct cleanup *back_to = NULL; if (!pst) return; @@ -2491,8 +2525,21 @@ dbx_psymtab_to_symtab (struct partial_symtab *pst) next_symbol_text_func = dbx_next_symbol_text; + if (DBX_STAB_SECTION (pst->objfile)) + { + stabs_data + = symfile_relocate_debug_section (pst->objfile->obfd, + DBX_STAB_SECTION (pst->objfile), + NULL); + if (stabs_data) + back_to = make_cleanup (free_current_contents, (void *) &stabs_data); + } + dbx_psymtab_to_symtab_1 (pst); + if (back_to) + do_cleanups (back_to); + /* Match with global symbols. This only needs to be done once, after all of the symtabs and dependencies have been read in. */ scan_file_globals (pst->objfile); @@ -2541,6 +2588,8 @@ read_ofile_symtab (struct partial_symtab *pst) abfd = objfile->obfd; symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */ symbuf_end = symbuf_idx = 0; + symbuf_read = 0; + symbuf_left = sym_offset + sym_size; /* It is necessary to actually read one symbol *before* the start of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL @@ -2550,7 +2599,7 @@ read_ofile_symtab (struct partial_symtab *pst) would slow down initial readin, so we look for it here instead. */ if (!processing_acc_compilation && sym_offset >= (int) symbol_size) { - bfd_seek (symfile_bfd, sym_offset - symbol_size, SEEK_CUR); + stabs_seek (sym_offset - symbol_size); fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); @@ -2593,7 +2642,7 @@ read_ofile_symtab (struct partial_symtab *pst) /* The N_SO starting this symtab is the first symbol, so we better not check the symbol before it. I'm not this can happen, but it doesn't hurt to check for it. */ - bfd_seek (symfile_bfd, sym_offset, SEEK_CUR); + stabs_seek (sym_offset); processing_gcc_compilation = 0; } @@ -2682,10 +2731,11 @@ read_ofile_symtab (struct partial_symtab *pst) pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); - /* Process items which we had to "process_later" due to dependencies - on other stabs. */ - process_now (objfile); - +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* Process items which we had to "process_later" due to dependencies +// OBSOLETE on other stabs. */ +// OBSOLETE process_now (objfile); +#endif /* OBSOLETE CFront */ end_stabs (); } @@ -3452,8 +3502,7 @@ coffstab_build_psymtabs (struct objfile *objfile, int mainline, the base address of the text segment). MAINLINE is true if we are reading the main symbol table (as opposed to a shared lib or dynamically loaded file). - STABOFFSET and STABSIZE define the location in OBJFILE where the .stab - section exists. + STABSECT is the BFD section information for the .stab section. STABSTROFFSET and STABSTRSIZE define the location in OBJFILE where the .stabstr section exists. @@ -3462,13 +3511,14 @@ coffstab_build_psymtabs (struct objfile *objfile, int mainline, void elfstab_build_psymtabs (struct objfile *objfile, int mainline, - file_ptr staboffset, unsigned int stabsize, + asection *stabsect, file_ptr stabstroffset, unsigned int stabstrsize) { int val; bfd *sym_bfd = objfile->obfd; char *name = bfd_get_filename (sym_bfd); struct dbx_symfile_info *info; + struct cleanup *back_to = NULL; /* There is already a dbx_symfile_info allocated by our caller. It might even contain some info from the ELF symtab to help us. */ @@ -3480,9 +3530,11 @@ elfstab_build_psymtabs (struct objfile *objfile, int mainline, #define ELF_STABS_SYMBOL_SIZE 12 /* XXX FIXME XXX */ DBX_SYMBOL_SIZE (objfile) = ELF_STABS_SYMBOL_SIZE; - DBX_SYMCOUNT (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile); + DBX_SYMCOUNT (objfile) + = bfd_section_size (objfile->obfd, stabsect) / DBX_SYMBOL_SIZE (objfile); DBX_STRINGTAB_SIZE (objfile) = stabstrsize; - DBX_SYMTAB_OFFSET (objfile) = staboffset; + DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos; + DBX_STAB_SECTION (objfile) = stabsect; if (stabstrsize > bfd_get_size (sym_bfd)) error ("ridiculous string table size: %d bytes", stabstrsize); @@ -3507,10 +3559,19 @@ elfstab_build_psymtabs (struct objfile *objfile, int mainline, processing_acc_compilation = 1; + symbuf_read = 0; + symbuf_left = bfd_section_size (objfile->obfd, stabsect); + stabs_data = symfile_relocate_debug_section (objfile->obfd, stabsect, NULL); + if (stabs_data) + back_to = make_cleanup (free_current_contents, (void *) &stabs_data); + /* In an elf file, we've already installed the minimal symbols that came from the elf (non-stab) symbol table, so always act like an incremental load here. */ dbx_symfile_read (objfile, 0); + + if (back_to) + do_cleanups (back_to); } /* Scan and build partial symbols for a file with special sections for stabs diff --git a/gdb/defs.h b/gdb/defs.h index 3ca6847..d2a1615 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -1,7 +1,7 @@ /* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */ /* Basic, host-specific, and target-specific definitions for GDB. Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2001, 2002 + 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -169,6 +169,9 @@ extern int xdb_commands; /* enable dbx commands if set */ extern int dbx_commands; +/* System root path, used to find libraries etc. */ +extern char *gdb_sysroot; + extern int quit_flag; extern int immediate_quit; extern int sevenbit_strings; @@ -242,8 +245,8 @@ enum auto_boolean struct cleanup { struct cleanup *next; - void (*function) (PTR); - PTR arg; + void (*function) (void *); + void *arg; }; @@ -371,12 +374,12 @@ extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2); extern void init_page_info (void); -extern CORE_ADDR host_pointer_to_address (void *ptr); -extern void *address_to_host_pointer (CORE_ADDR addr); - extern char *gdb_realpath (const char *); extern char *xfullpath (const char *); +extern unsigned long gnu_debuglink_crc32 (unsigned long crc, + unsigned char *buf, size_t len); + /* From demangle.c */ extern void set_demangling_style (char *); @@ -964,7 +967,7 @@ extern int catch_exceptions (struct ui_out *uiout, This function is superseeded by catch_exceptions(). */ -typedef int (catch_errors_ftype) (PTR); +typedef int (catch_errors_ftype) (void *); extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask); /* Template to catch_errors() that wraps calls to command diff --git a/gdb/demangle.c b/gdb/demangle.c index 3df9684..bcf9b77 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -1,6 +1,8 @@ /* Basic C++ demangling support for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, + 2001, 2003 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support. This file is part of GDB. diff --git a/gdb/disasm.c b/gdb/disasm.c index e69458d..4ac22a2 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -1,5 +1,6 @@ /* Disassemble support for GDB. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 612af11..832ac37 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,74 @@ +2003-02-01 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + description of ADDITIONAL_OPTIONS, ADDITIONAL_OPTION_CASES, + ADDITIONAL_OPTION_HANDLER, and ADDITIONAL_OPTION_HELP, and + BEFORE_MAIN_LOOP_HOOK, and DBX_PARM_SYMBOL_CLASS along with + references to nindy and i960. + * gdb.texinfo (i960): Delete all references to i960 and nindy. + +2003-02-01 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + FLOAT_INFO. + +2003-01-30 Andrew Cagney + + * stabs.texinfo (Member Type Descriptor): Clarify description of + `@'. Suggested by Ben Hutchings. + +2003-01-29 Andrew Cagney + + * gdb.texinfo (M68K): Delete reference to es1800. + +2003-01-29 Andrew Cagney + + * gdb.texinfo (Maintenance Commands): Document `maint print + reggroups' and `maint print register-groups'. + * gdbint.texinfo (Target Architecture Definition): Document + register_reggroup_p. + +2003-01-23 Jim Blandy + + * gdb.texinfo (Separate Debug Files): New section. + +2003-01-22 Daniel Jacobowitz + + * gdb.texinfo (Maintenance Commands): Add "maint set profile" + and "maint show profile". + +2003-01-16 Michael Chastain + + * gdb.texinfo (Installing GDB): Warn against + ".../gdb-VERSION/gdb/configure". + (Separate Objdir): Likewise. + +2003-01-15 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + definition of PRINT_REGISTER_HOOK. + +2003-01-15 Elena Zannoni + + (OpenRISC 1000): Fix formatting of command names. + +2003-01-15 Elena Zannoni + + * gdb.texinfo (Continuing and Stepping): Add new command + 'advance'. Clarify behavior of 'until'. + +2003-01-13 Daniel Jacobowitz + + * gdb.texinfo (Files): Document solib-absolute-prefix and + solib-search-path. + +2003-01-09 Michael Chastain + + * gdbint.texinfo (Configuring @value{GDBN} for Release): Delete. + (Create a Release): Add new instructions for new @file{src-release}. + Document existing instructions for @file{Makefile.in} as + being for @value{GDBN} 5.3.1 or earlier. + 2003-01-09 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Mention diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8bfce2f..b3dd7a7 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3462,8 +3462,35 @@ argument. Continue running your program until either the specified location is reached, or the current stack frame returns. @var{location} is any of the forms of argument acceptable to @code{break} (@pxref{Set Breaks, -,Setting breakpoints}). This form of the command uses breakpoints, -and hence is quicker than @code{until} without an argument. +,Setting breakpoints}). This form of the command uses breakpoints, and +hence is quicker than @code{until} without an argument. The specified +location is actually reached only if it is in the current frame. This +implies that @code{until} can be used to skip over recursive function +invocations. For instance in the code below, if the current location is +line @code{96}, issuing @code{until 99} will execute the program up to +line @code{99} in the same invocation of factorial, i.e. after the inner +invocations have returned. + +@smallexample +94 int factorial (int value) +95 @{ +96 if (value > 1) @{ +97 value *= factorial (value - 1); +98 @} +99 return (value); +100 @} +@end smallexample + + +@kindex advance @var{location} +@itemx advance @var{location} +Continue running the program up to the given location. An argument is +required, anything of the same form as arguments for the @code{break} +command. Execution will also stop upon exit from the current stack +frame. This command is similar to @code{until}, but @code{advance} will +not skip over recursive function calls, and the target location doesn't +have to be in the same frame as the current one. + @kindex stepi @kindex si @r{(@code{stepi})} @@ -9315,6 +9342,7 @@ program. To debug a core dump of a previous run, you must also tell @menu * Files:: Commands to specify files +* Separate Debug Files:: Debugging information in separate files * Symbol Errors:: Errors reading symbol files @end menu @@ -9719,6 +9747,233 @@ Mb). Display the current autoloading size threshold, in megabytes. @end table +Shared libraries are also supported in many cross or remote debugging +configurations. A copy of the target's libraries need to be present on the +host system; they need to be the same as the target libraries, although the +copies on the target can be stripped as long as the copies on the host are +not. + +You need to tell @value{GDBN} where the target libraries are, so that it can +load the correct copies---otherwise, it may try to load the host's libraries. +@value{GDBN} has two variables to specify the search directories for target +libraries. + +@table @code +@kindex set solib-absolute-prefix +@item set solib-absolute-prefix @var{path} +If this variable is set, @var{path} will be used as a prefix for any +absolute shared library paths; many runtime loaders store the absolute +paths to the shared library in the target program's memory. If you use +@samp{solib-absolute-prefix} to find shared libraries, they need to be laid +out in the same way that they are on the target, with e.g.@: a +@file{/usr/lib} hierarchy under @var{path}. + +You can set the default value of @samp{solib-absolute-prefix} by using the +configure-time @samp{--with-sysroot} option. + +@kindex show solib-absolute-prefix +@item show solib-absolute-prefix +Display the current shared library prefix. + +@kindex set solib-search-path +@item set solib-search-path @var{path} +If this variable is set, @var{path} is a colon-separated list of directories +to search for shared libraries. @samp{solib-search-path} is used after +@samp{solib-absolute-prefix} fails to locate the library, or if the path to +the library is relative instead of absolute. If you want to use +@samp{solib-search-path} instead of @samp{solib-absolute-prefix}, be sure to +set @samp{solib-absolute-prefix} to a nonexistant directory to prevent +@value{GDBN} from finding your host's libraries. + +@kindex show solib-search-path +@item show solib-search-path +Display the current shared library search path. +@end table + + +@node Separate Debug Files +@section Debugging Information in Separate Files +@cindex separate debugging information files +@cindex debugging information in separate files +@cindex @file{.debug} subdirectories +@cindex debugging information directory, global +@cindex global debugging information directory + +@value{GDBN} allows you to put a program's debugging information in a +file separate from the executable itself, in a way that allows +@value{GDBN} to find and load the debugging information automatically. +Since debugging information can be very large --- sometimes larger +than the executable code itself --- some systems distribute debugging +information for their executables in separate files, which users can +install only when they need to debug a problem. + +If an executable's debugging information has been extracted to a +separate file, the executable should contain a @dfn{debug link} giving +the name of the debugging information file (with no directory +components), and a checksum of its contents. (The exact form of a +debug link is described below.) If the full name of the directory +containing the executable is @var{execdir}, and the executable has a +debug link that specifies the name @var{debugfile}, then @value{GDBN} +will automatically search for the debugging information file in three +places: + +@itemize @bullet +@item +the directory containing the executable file (that is, it will look +for a file named @file{@var{execdir}/@var{debugfile}}, +@item +a subdirectory of that directory named @file{.debug} (that is, the +file @file{@var{execdir}/.debug/@var{debugfile}}, and +@item +a subdirectory of the global debug file directory that includes the +executable's full path, and the name from the link (that is, the file +@file{@var{globaldebugdir}/@var{execdir}/@var{debugfile}}, where +@var{globaldebugdir} is the global debug file directory, and +@var{execdir} has been turned into a relative path). +@end itemize +@noindent +@value{GDBN} checks under each of these names for a debugging +information file whose checksum matches that given in the link, and +reads the debugging information from the first one it finds. + +So, for example, if you ask @value{GDBN} to debug @file{/usr/bin/ls}, +which has a link containing the name @file{ls.debug}, and the global +debug directory is @file{/usr/lib/debug}, then @value{GDBN} will look +for debug information in @file{/usr/bin/ls.debug}, +@file{/usr/bin/.debug/ls.debug}, and +@file{/usr/lib/debug/usr/bin/ls.debug}. + +You can set the global debugging info directory's name, and view the +name @value{GDBN} is currently using. + +@table @code + +@kindex set debug-file-directory +@item set debug-file-directory @var{directory} +Set the directory which @value{GDBN} searches for separate debugging +information files to @var{directory}. + +@kindex show debug-file-directory +@item show debug-file-directory +Show the directory @value{GDBN} searches for separate debugging +information files. + +@end table + +@cindex @code{.gnu_debuglink} sections +@cindex debug links +A debug link is a special section of the executable file named +@code{.gnu_debuglink}. The section must contain: + +@itemize +@item +A filename, with any leading directory components removed, followed by +a zero byte, +@item +zero to three bytes of padding, as needed to reach the next four-byte +boundary within the section, and +@item +a four-byte CRC checksum, stored in the same endianness used for the +executable file itself. The checksum is computed on the debugging +information file's full contents by the function given below, passing +zero as the @var{crc} argument. +@end itemize + +Any executable file format can carry a debug link, as long as it can +contain a section named @code{.gnu_debuglink} with the contents +described above. + +The debugging information file itself should be an ordinary +executable, containing a full set of linker symbols, sections, and +debugging information. The sections of the debugging information file +should have the same names, addresses and sizes as the original file, +but they need not contain any data --- much like a @code{.bss} section +in an ordinary executable. + +As of December 2002, there is no standard GNU utility to produce +separated executable / debugging information file pairs. Ulrich +Drepper's @file{elfutils} package, starting with version 0.53, +contains a version of the @code{strip} command such that the command +@kbd{strip foo -f foo.debug} removes the debugging information from +the executable file @file{foo}, places it in the file +@file{foo.debug}, and leaves behind a debug link in @file{foo}. + +Since there are many different ways to compute CRC's (different +polynomials, reversals, byte ordering, etc.), the simplest way to +describe the CRC used in @code{.gnu_debuglink} sections is to give the +complete code for a function that computes it: + +@kindex @code{gnu_debuglink_crc32} +@smallexample +unsigned long +gnu_debuglink_crc32 (unsigned long crc, + unsigned char *buf, size_t len) +@{ + static const unsigned long crc32_table[256] = + @{ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + @}; + unsigned char *end; + + crc = ~crc & 0xffffffff; + for (end = buf + len; buf < end; ++buf) + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); + return ~crc & 0xffffffff;; +@} +@end smallexample + + @node Symbol Errors @section Errors reading symbol files @@ -11159,7 +11414,6 @@ configurations. * ARM:: ARM * H8/300:: Hitachi H8/300 * H8/500:: Hitachi H8/500 -* i960:: Intel i960 * M32R/D:: Mitsubishi M32R/D * M68K:: Motorola M68K * MIPS Embedded:: MIPS Embedded @@ -11413,128 +11667,6 @@ memory}. The accepted values for @var{mod} are @code{small}, @end table -@node i960 -@subsection Intel i960 - -@table @code - -@kindex target mon960 -@item target mon960 @var{dev} -MON960 monitor for Intel i960. - -@kindex target nindy -@item target nindy @var{devicename} -An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is -the name of the serial device to use for the connection, e.g. -@file{/dev/ttya}. - -@end table - -@cindex Nindy -@cindex i960 -@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When -@value{GDBN} is configured to control a remote Intel 960 using Nindy, you can -tell @value{GDBN} how to connect to the 960 in several ways: - -@itemize @bullet -@item -Through command line options specifying serial port, version of the -Nindy protocol, and communications speed; - -@item -By responding to a prompt on startup; - -@item -By using the @code{target} command at any point during your @value{GDBN} -session. @xref{Target Commands, ,Commands for managing targets}. - -@end itemize - -@cindex download to Nindy-960 -With the Nindy interface to an Intel 960 board, @code{load} -downloads @var{filename} to the 960 as well as adding its symbols in -@value{GDBN}. - -@menu -* Nindy Startup:: Startup with Nindy -* Nindy Options:: Options for Nindy -* Nindy Reset:: Nindy reset command -@end menu - -@node Nindy Startup -@subsubsection Startup with Nindy - -If you simply start @code{@value{GDBP}} without using any command-line -options, you are prompted for what serial port to use, @emph{before} you -reach the ordinary @value{GDBN} prompt: - -@smallexample -Attach /dev/ttyNN -- specify NN, or "quit" to quit: -@end smallexample - -@noindent -Respond to the prompt with whatever suffix (after @samp{/dev/tty}) -identifies the serial port you want to use. You can, if you choose, -simply start up with no Nindy connection by responding to the prompt -with an empty line. If you do this and later wish to attach to Nindy, -use @code{target} (@pxref{Target Commands, ,Commands for managing targets}). - -@node Nindy Options -@subsubsection Options for Nindy - -These are the startup options for beginning your @value{GDBN} session with a -Nindy-960 board attached: - -@table @code -@item -r @var{port} -Specify the serial port name of a serial interface to be used to connect -to the target system. This option is only available when @value{GDBN} is -configured for the Intel 960 target architecture. You may specify -@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a -device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique -suffix for a specific @code{tty} (e.g. @samp{-r a}). - -@item -O -(An uppercase letter ``O'', not a zero.) Specify that @value{GDBN} should use -the ``old'' Nindy monitor protocol to connect to the target system. -This option is only available when @value{GDBN} is configured for the Intel 960 -target architecture. - -@quotation -@emph{Warning:} if you specify @samp{-O}, but are actually trying to -connect to a target system that expects the newer protocol, the connection -fails, appearing to be a speed mismatch. @value{GDBN} repeatedly -attempts to reconnect at several different line speeds. You can abort -this process with an interrupt. -@end quotation - -@item -brk -Specify that @value{GDBN} should first send a @code{BREAK} signal to the target -system, in an attempt to reset it, before connecting to a Nindy target. - -@quotation -@emph{Warning:} Many target systems do not have the hardware that this -requires; it only works with a few boards. -@end quotation -@end table - -The standard @samp{-b} option controls the line speed used on the serial -port. - -@c @group -@node Nindy Reset -@subsubsection Nindy reset command - -@table @code -@item reset -@kindex reset -For a Nindy target, this command sends a ``break'' to the remote target -system; this is only useful if the target has been equipped with a -circuit to perform a hard reset (or some other interesting action) when -a break is detected. -@end table -@c @end group - @node M32R/D @subsection Mitsubishi M32R/D @@ -11576,19 +11708,6 @@ ROM 68K monitor, running on an M68K IDP board. @end table -If @value{GDBN} is configured with @code{m68*-ericsson-*}, it will -instead have only a single special target command: - -@table @code - -@kindex target es1800 -@item target es1800 @var{dev} -ES-1800 emulator for M68K. - -@end table - -[context?] - @table @code @kindex target rombug @@ -11834,7 +11953,7 @@ Set acquisition qualifier for HW trace. Set HW trace stopping criteria. @kindex htrace record -@item htrace record @var{[data]*} +@item htrace record [@var{data}]* Selects the data to be recorded, when qualifier is met and HW trace was triggered. @@ -11845,14 +11964,14 @@ triggered. Enables/disables the HW trace. @kindex htrace rewind -@item htrace rewind @var{[filename]} +@item htrace rewind [@var{filename}] Clears currently recorded trace data. If filename is specified, new trace file is made and any newly collected data will be written there. @kindex htrace print -@item htrace print @var{[start [len]]} +@item htrace print [@var{start} [@var{len}]] Prints trace buffer, using current record configuration. @kindex htrace mode continuous @@ -14015,6 +14134,7 @@ Then give @file{gdb.dvi} to your @sc{dvi} printing program. @appendix Installing @value{GDBN} @cindex configuring @value{GDBN} @cindex installation +@cindex configuring @value{GDBN}, and source tree subdirectories @value{GDBN} comes with a @code{configure} script that automates the process of preparing @value{GDBN} for installation; you can then use @code{make} to @@ -14105,19 +14225,15 @@ directories for multiple libraries or programs, such as the creates configuration files for every directory level underneath (unless you tell it not to, with the @samp{--norecursion} option). -You can run the @code{configure} script from any of the -subordinate directories in the @value{GDBN} distribution if you only want to -configure that subdirectory, but be sure to specify a path to it. - -For example, with version @value{GDBVN}, type the following to configure only -the @code{bfd} subdirectory: - -@smallexample -@group -cd gdb-@value{GDBVN}/bfd -../configure @var{host} -@end group -@end smallexample +You should run the @code{configure} script from the top directory in the +source tree, the @file{gdb-@var{version-number}} directory. If you run +@code{configure} from one of the subdirectories, you will configure only +that subdirectory. That is usually not what you want. In particular, +if you run the first @code{configure} from the @file{gdb} subdirectory +of the @file{gdb-@var{version-number}} directory, you will omit the +configuration of @file{bfd}, @file{readline}, and other sibling +directories of the @file{gdb} subdirectory. This leads to build errors +about missing include files such as @file{bfd/bfd.h}. You can install @code{@value{GDBP}} anywhere; it has no hardwired paths. However, you should make sure that the shell on your path (named by @@ -14170,6 +14286,12 @@ the example, you'd find the Sun 4 library @file{libiberty.a} in the directory @file{gdb-sun4/libiberty}, and @value{GDBN} itself in @file{gdb-sun4/gdb}. +Make sure that your path to the @file{configure} script has just one +instance of @file{gdb} in it. If your path to @file{configure} looks +like @file{../gdb-@value{GDBVN}/gdb/configure}, you are configuring only +one subdirectory of @value{GDBN}, not the whole package. This leads to +build errors about missing include files such as @file{bfd/bfd.h}. + One popular reason to build several @value{GDBN} configurations in separate directories is to configure @value{GDBN} for cross-compiling (where @value{GDBN} runs on one machine---the @dfn{host}---while debugging @@ -14373,18 +14495,58 @@ warning message. @kindex maint print registers @kindex maint print raw-registers @kindex maint print cooked-registers +@kindex maint print register-groups @item maint print registers @itemx maint print raw-registers @itemx maint print cooked-registers +@itemx maint print register-groups 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}. +The command @code{maint print raw-registers} includes the contents of +the raw register cache; the command @code{maint print cooked-registers} +includes the (cooked) value of all registers; and the command +@code{maint print register-groups} includes the groups that each +register is a member of. @xref{Registers,, Registers, gdbint, +@value{GDBN} Internals}. + +Takes an optional file parameter. + +@kindex maint print reggroups +@item maint print reggroups +Print @value{GDBN}'s internal register group data structures. Takes an optional file parameter. +@smallexample +(gdb) @kbd{maint print reggroups} + Group Type + general user + float user + all user + vector user + system user + save internal + restore internal +@end smallexample + +@kindex maint set profile +@kindex maint show profile +@cindex profiling GDB +@item maint set profile +@itemx maint show profile +Control profiling of @value{GDBN}. + +Profiling will be disabled until you use the @samp{maint set profile} +command to enable it. When you enable profiling, the system will begin +collecting timing and execution count data; when you disable profiling or +exit @value{GDBN}, the results will be written to a log file. Remember that +if you use profiling, @value{GDBN} will overwrite the profiling log file +(often called @file{gmon.out}). If you have a record of important profiling +data in a @file{gmon.out} file, be sure to move it to a safe location. + +Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be +compiled with the @samp{-pg} compiler option. + @end table diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 3b6293f..cf35a28 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2295,9 +2295,8 @@ always linked in.) @item USG Means that System V (prior to SVR4) include files are in use. (FIXME: -This symbol is abused in @file{infrun.c}, @file{regex.c}, -@file{remote-nindy.c}, and @file{utils.c} for other things, at the -moment.) +This symbol is abused in @file{infrun.c}, @file{regex.c}, and +@file{utils.c} for other things, at the moment.) @item lint Define this to help placate @code{lint} in some situations. @@ -2913,18 +2912,6 @@ machine. @table @code -@item ADDITIONAL_OPTIONS -@itemx ADDITIONAL_OPTION_CASES -@itemx ADDITIONAL_OPTION_HANDLER -@itemx ADDITIONAL_OPTION_HELP -@findex ADDITIONAL_OPTION_HELP -@findex ADDITIONAL_OPTION_HANDLER -@findex ADDITIONAL_OPTION_CASES -@findex ADDITIONAL_OPTIONS -These are a set of macros that allow the addition of additional command -line options to @value{GDBN}. They are currently used only for the unsupported -i960 Nindy target, and should not be used in any other configuration. - @item ADDR_BITS_REMOVE (addr) @findex ADDR_BITS_REMOVE If a raw machine instruction address includes any bits that are not @@ -2990,16 +2977,6 @@ This macro may safely assume that @var{type} is either a pointer or a C@t{++} reference type. @xref{Target Architecture Definition, , Pointers Are Not Always Addresses}. -@item BEFORE_MAIN_LOOP_HOOK -@findex BEFORE_MAIN_LOOP_HOOK -Define this to expand into any code that you want to execute before the -main loop starts. Although this is not, strictly speaking, a target -conditional, that is how it is currently being used. Note that if a -configuration were to define it one way for a host and a different way -for the target, @value{GDBN} will probably not compile, let alone run -correctly. This macro is currently used only for the unsupported i960 Nindy -target, and should not be used in any other configuration. - @item BELIEVE_PCC_PROMOTION @findex BELIEVE_PCC_PROMOTION Define if the compiler promotes a @code{short} or @code{char} @@ -3150,12 +3127,6 @@ Return non-zero if register @var{regnum} can represent data values in a non-standard form. @xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. -@item DBX_PARM_SYMBOL_CLASS -@findex DBX_PARM_SYMBOL_CLASS -Hook for the @code{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. - @item DECR_PC_AFTER_BREAK @findex DECR_PC_AFTER_BREAK Define this to be the amount by which to decrement the PC after the @@ -3232,10 +3203,6 @@ If not defined, @code{EXTRACT_RETURN_VALUE} is used. @findex EXTRACT_STRUCT_VALUE_ADDRESS_P Predicate for @code{EXTRACT_STRUCT_VALUE_ADDRESS}. -@item FLOAT_INFO -@findex FLOAT_INFO -Deprecated in favor of @code{PRINT_FLOAT_INFO}. - @item FP_REGNUM @findex FP_REGNUM If the virtual frame pointer is kept in a register, then define this @@ -3510,6 +3477,28 @@ Return the raw size of @var{reg}; defaults to the size of the register's virtual type. @xref{Target Architecture Definition, , Raw and Virtual Register Representations}. +@item register_reggroup_p (@var{gdbarch}, @var{regnum}, @var{reggroup}) +@findex register_reggroup_p +@cindex register groups +Return non-zero if register @var{regnum} is a member of the register +group @var{reggroup}. + +By default, registers are grouped as follows: + +@table @code +@item float_reggroup +Any register with a valid name and a floating-point type. +@item vector_reggroup +Any register with a valid name and a vector type. +@item general_reggroup +Any register with a valid name and a type other than vector or +floating-point. @samp{float_reggroup}. +@item save_reggroup +@itemx restore_reggroup +@itemx all_reggroup +Any register with a valid name. +@end table + @item REGISTER_VIRTUAL_SIZE (@var{reg}) @findex REGISTER_VIRTUAL_SIZE Return the virtual size of @var{reg}; defaults to the size of the @@ -3652,11 +3641,6 @@ The number of the ``next program counter'' register, if defined. If non-zero, round arguments to a boundary of this many bits before pushing them on the stack. -@item PRINT_REGISTER_HOOK (@var{regno}) -@findex PRINT_REGISTER_HOOK -If defined, this must be a function that prints the contents of the -given register to standard output. - @item PRINT_TYPELESS_INTEGER @findex PRINT_TYPELESS_INTEGER This is an obscure substitute for @code{print_longest} that seems to @@ -5396,62 +5380,6 @@ target-dependent @file{.h} and @file{.c} files used for your configuration. @end itemize -@section Configuring @value{GDBN} for Release - -@cindex preparing a release -@cindex making a distribution tarball -From the top level directory (containing @file{gdb}, @file{bfd}, -@file{libiberty}, and so on): - -@smallexample -make -f Makefile.in gdb.tar.gz -@end smallexample - -@noindent -This will properly configure, clean, rebuild any files that are -distributed pre-built (e.g. @file{c-exp.tab.c} or @file{refcard.ps}), -and will then make a tarfile. (If the top level directory has already -been configured, you can just do @code{make gdb.tar.gz} instead.) - -This procedure requires: - -@itemize @bullet - -@item -symbolic links; - -@item -@code{makeinfo} (texinfo2 level); - -@item -@TeX{}; - -@item -@code{dvips}; - -@item -@code{yacc} or @code{bison}. -@end itemize - -@noindent -@dots{} and the usual slew of utilities (@code{sed}, @code{tar}, etc.). - -@subheading TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION - -@file{gdb.texinfo} is currently marked up using the texinfo-2 macros, -which are not yet a default for anything (but we have to start using -them sometime). - -For making paper, the only thing this implies is the right generation of -@file{texinfo.tex} needs to be included in the distribution. - -For making info files, however, rather than duplicating the texinfo2 -distribution, generate @file{gdb-all.texinfo} locally, and include the -files @file{gdb.info*} in the distribution. Note the plural; -@code{makeinfo} will split the document into one overall file and five -or so included files. - - @node Releasing GDB @chapter Releasing @value{GDBN} @@ -5987,6 +5915,17 @@ This is identical to the process used to create the daily snapshot. @smallexample $ for m in gdb insight do +( cd $m/src && gmake -f src-release $m.tar ) +done +$ ( m=dejagnu; cd $m/src && gmake -f src-release $m.tar.bz2 ) +@end smallexample + +If the top level source directory does not have @file{src-release} +(@value{GDBN} version 5.3.1 or earlier), try these commands instead: + +@smallexample +$ for m in gdb insight +do ( cd $m/src && gmake -f Makefile.in $m.tar ) done $ ( m=dejagnu; cd $m/src && gmake -f Makefile.in $m.tar.bz2 ) diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index 52b88b4..c334d45 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -2724,11 +2724,22 @@ compiler it can also be used in other contexts. @node Member Type Descriptor @section The @samp{@@} Type Descriptor -The @samp{@@} type descriptor is for a member (class and variable) type. -It is followed by type information for the offset basetype, a comma, and -type information for the type of the field being pointed to. (FIXME: -this is acknowledged to be gibberish. Can anyone say what really goes -here?). +The @samp{@@} type descriptor is used together with the @samp{*} type +descriptor for a pointer-to-non-static-member-data type. It is followed +by type information for the class (or union), a comma, and type +information for the member data. + +The following C++ source: + +@smallexample +typedef int A::*int_in_a; +@end smallexample + +generates the following stab: + +@smallexample +.stabs "int_in_a:t20=*21=@@19,1",128,0,0,0 +@end smallexample Note that there is a conflict between this and type attributes (@pxref{String Field}); both use type descriptor @samp{@@}. diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index fab10c0..5b63830 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -28,6 +28,7 @@ #include "frame.h" #include "inferior.h" #include "gdb_assert.h" +#include "frame-unwind.h" /* Dummy frame. This saves the processor state just prior to setting up the inferior function call. Older targets save the registers @@ -269,8 +270,48 @@ generic_pop_current_frame (void (*popper) (struct frame_info * frame)) (*popper) (frame); } -/* Function: pop_dummy_frame - Restore the machine state from a saved dummy stack frame. */ +/* Discard the innermost dummy frame from the dummy frame stack + (passed in as a parameter). */ + +static void +discard_innermost_dummy (struct dummy_frame **stack) +{ + struct dummy_frame *tbd = (*stack); + (*stack) = (*stack)->next; + regcache_xfree (tbd->regcache); + xfree (tbd); +} + +/* Function: dummy_frame_pop. Restore the machine state from a saved + dummy stack frame. */ + +static void +dummy_frame_pop (struct frame_info *fi, void **cache, + struct regcache *regcache) +{ + struct dummy_frame *dummy = cached_find_dummy_frame (fi, cache); + + /* If it isn't, what are we even doing here? */ + gdb_assert (get_frame_type (fi) == DUMMY_FRAME); + + if (dummy == NULL) + error ("Can't pop dummy frame!"); + + /* Discard all dummy frames up-to but not including this one. */ + while (dummy_frame_stack != dummy) + discard_innermost_dummy (&dummy_frame_stack); + + /* Restore this one. */ + regcache_cpy (regcache, dummy->regcache); + flush_cached_frames (); + + /* Now discard it. */ + discard_innermost_dummy (&dummy_frame_stack); + + /* Note: target changed would be better. Registers, memory and + frame are all invalid. */ + flush_cached_frames (); +} void generic_pop_dummy_frame (void) @@ -282,12 +323,10 @@ generic_pop_dummy_frame (void) if (!dummy_frame) error ("Can't pop dummy frame!"); - dummy_frame_stack = dummy_frame->next; regcache_cpy (current_regcache, dummy_frame->regcache); flush_cached_frames (); - regcache_xfree (dummy_frame->regcache); - xfree (dummy_frame); + discard_innermost_dummy (&dummy_frame_stack); } /* Function: fix_call_dummy @@ -304,7 +343,7 @@ generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, /* Given a call-dummy dummy-frame, return the registers. Here the register value is taken from the local copy of the register buffer. */ -void +static void dummy_frame_register_unwind (struct frame_info *frame, void **cache, int regnum, int *optimized, enum lval_type *lvalp, CORE_ADDR *addrp, @@ -331,7 +370,10 @@ dummy_frame_register_unwind (struct frame_info *frame, void **cache, } } -CORE_ADDR +/* Assuming that FRAME is a dummy, return the resume address for the + previous frame. */ + +static CORE_ADDR dummy_frame_pc_unwind (struct frame_info *frame, void **cache) { @@ -345,16 +387,39 @@ dummy_frame_pc_unwind (struct frame_info *frame, } -struct frame_id +/* Assuming that FRAME is a dummy, return the ID of the calling frame + (the frame that the dummy has the saved state of). */ + +static void dummy_frame_id_unwind (struct frame_info *frame, - void **cache) + void **cache, + struct frame_id *id) { struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache); /* Oops! In a dummy-frame but can't find the stack dummy. Pretend that the frame doesn't unwind. Should this function instead return a has-no-caller indication? */ if (dummy == NULL) - return null_frame_id; - return dummy->id; + (*id) = null_frame_id; + else + (*id) = dummy->id; } +static struct frame_unwind dummy_frame_unwind = +{ + dummy_frame_pop, + dummy_frame_pc_unwind, + dummy_frame_id_unwind, + dummy_frame_register_unwind +}; + +const struct frame_unwind * +dummy_frame_p (CORE_ADDR pc) +{ + if (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) + : pc_in_dummy_frame (pc)) + return &dummy_frame_unwind; + else + return NULL; +} diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index cfa2709..2d03421 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -24,6 +24,8 @@ struct frame_info; struct regcache; +struct frame_unwind; +struct frame_id; /* GENERIC DUMMY FRAMES @@ -42,29 +44,10 @@ struct regcache; generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as generic_fix_call_dummy. */ -/* Assuming that FRAME is a dummy, return a register value for the - previous frame. */ +/* If the PC falls in a dummy frame, return a dummy frame + unwinder. */ -extern void dummy_frame_register_unwind (struct frame_info *frame, - void **unwind_cache, - int regnum, - int *optimized, - enum lval_type *lvalp, - CORE_ADDR *addrp, - int *realnump, - void *valuep); - -/* Assuming that FRAME is a dummy, return the resume address for the - previous frame. */ - -extern CORE_ADDR dummy_frame_pc_unwind (struct frame_info *frame, - void **unwind_cache); - -/* Assuming that FRAME is a dummy, return the ID of the calling frame - (the frame that the dummy has the saved state of). */ - -extern struct frame_id dummy_frame_id_unwind (struct frame_info *frame, - void **unwind_cache); +extern const struct frame_unwind *dummy_frame_p (CORE_ADDR pc); /* Does the PC fall in a dummy frame? diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c index c8834e9..e7329f8 100644 --- a/gdb/dve3900-rom.c +++ b/gdb/dve3900-rom.c @@ -32,7 +32,7 @@ /* Type of function passed to bfd_map_over_sections. */ -typedef void (*section_map_func) (bfd * abfd, asection * sect, PTR obj); +typedef void (*section_map_func) (bfd * abfd, asection * sect, void *obj); /* Packet escape character used by Densan monitor. */ @@ -455,7 +455,7 @@ static void fetch_bitmapped_register (int regno, struct bit_field *bf) { unsigned long val; - unsigned char regbuf[MAX_REGISTER_RAW_SIZE]; + unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); char *regname = NULL; if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0])) diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 8c5d39c..c928855 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -1,5 +1,7 @@ /* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger. - Copyright 2001, 2002 Free Software Foundation, Inc. + + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Jiri Smid, SuSE Labs. Based on code written by Daniel Berlin (dan@dberlin.org). @@ -168,10 +170,13 @@ extern file_ptr dwarf_frame_offset; extern unsigned int dwarf_frame_size; extern file_ptr dwarf_eh_frame_offset; extern unsigned int dwarf_eh_frame_size; +extern asection *dwarf_frame_section; +extern asection *dwarf_eh_frame_section; + extern char *dwarf2_read_section (struct objfile *objfile, file_ptr offset, - unsigned int size); + unsigned int size, asection* sectp); static struct fde_unit *fde_unit_alloc (void); static struct cie_unit *cie_unit_alloc (void); @@ -1366,7 +1371,8 @@ compare_fde_unit (const void *a, const void *b) -- mludvig */ static void parse_frame_info (struct objfile *objfile, file_ptr frame_offset, - unsigned int frame_size, int eh_frame) + unsigned int frame_size, asection *frame_section, + int eh_frame) { bfd *abfd = objfile->obfd; asection *curr_section_ptr; @@ -1381,7 +1387,8 @@ parse_frame_info (struct objfile *objfile, file_ptr frame_offset, unwind_tmp_obstack_init (); - frame_buffer = dwarf2_read_section (objfile, frame_offset, frame_size); + frame_buffer = dwarf2_read_section (objfile, frame_offset, frame_size, + frame_section); start = frame_buffer; end = frame_buffer + frame_size; @@ -1634,12 +1641,14 @@ dwarf2_build_frame_info (struct objfile *objfile) if (dwarf_frame_offset) { parse_frame_info (objfile, dwarf_frame_offset, - dwarf_frame_size, 0 /* = debug_frame */ ); + dwarf_frame_size, dwarf_frame_section, + 0 /* = debug_frame */ ); after_debug_frame = 1; } if (dwarf_eh_frame_offset) parse_frame_info (objfile, dwarf_eh_frame_offset, dwarf_eh_frame_size, + dwarf_eh_frame_section, 1 /* = eh_frame */ + after_debug_frame); } diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e0f6eb2..62f0fee 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1,5 +1,5 @@ /* DWARF 2 debugging format support for GDB. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, @@ -133,6 +133,7 @@ static file_ptr dwarf_aranges_offset; static file_ptr dwarf_loc_offset; static file_ptr dwarf_macinfo_offset; static file_ptr dwarf_str_offset; +static file_ptr dwarf_ranges_offset; file_ptr dwarf_frame_offset; file_ptr dwarf_eh_frame_offset; @@ -144,9 +145,22 @@ static unsigned int dwarf_aranges_size; static unsigned int dwarf_loc_size; static unsigned int dwarf_macinfo_size; static unsigned int dwarf_str_size; +static unsigned int dwarf_ranges_size; unsigned int dwarf_frame_size; unsigned int dwarf_eh_frame_size; +static asection *dwarf_info_section; +static asection *dwarf_abbrev_section; +static asection *dwarf_line_section; +static asection *dwarf_pubnames_section; +static asection *dwarf_aranges_section; +static asection *dwarf_loc_section; +static asection *dwarf_macinfo_section; +static asection *dwarf_str_section; +static asection *dwarf_ranges_section; +asection *dwarf_frame_section; +asection *dwarf_eh_frame_section; + /* names of the debugging sections */ #define INFO_SECTION ".debug_info" @@ -157,6 +171,7 @@ unsigned int dwarf_eh_frame_size; #define LOC_SECTION ".debug_loc" #define MACINFO_SECTION ".debug_macinfo" #define STR_SECTION ".debug_str" +#define RANGES_SECTION ".debug_ranges" #define FRAME_SECTION ".debug_frame" #define EH_FRAME_SECTION ".eh_frame" @@ -202,6 +217,10 @@ struct comp_unit_head /* DWARF abbreviation table associated with this compilation unit */ struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE]; + + /* Pointer to the DIE associated with the compilation unit. */ + + struct die_info *die; }; /* The line number information for a compilation unit (found in the @@ -373,6 +392,7 @@ static char *dwarf_abbrev_buffer; static char *dwarf_line_buffer; static char *dwarf_str_buffer; static char *dwarf_macinfo_buffer; +static char *dwarf_ranges_buffer; /* A zeroed version of a partial die for initialization purposes. */ static struct partial_die_info zeroed_partial_die; @@ -481,6 +501,14 @@ struct dwarf2_pinfo unsigned int dwarf_macinfo_size; + /* Pointer to start of dwarf ranges buffer for the objfile. */ + + char *dwarf_ranges_buffer; + + /* Size of dwarf ranges buffer for the objfile. */ + + unsigned int dwarf_ranges_size; + }; #define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private) @@ -494,6 +522,8 @@ struct dwarf2_pinfo #define DWARF_STR_SIZE(p) (PST_PRIVATE(p)->dwarf_str_size) #define DWARF_MACINFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_macinfo_buffer) #define DWARF_MACINFO_SIZE(p) (PST_PRIVATE(p)->dwarf_macinfo_size) +#define DWARF_RANGES_BUFFER(p) (PST_PRIVATE(p)->dwarf_ranges_buffer) +#define DWARF_RANGES_SIZE(p) (PST_PRIVATE(p)->dwarf_ranges_size) /* Maintain an array of referenced fundamental types for the current compilation unit being read. For DWARF version 1, we have to construct @@ -621,7 +651,7 @@ dwarf2_invalid_attrib_class_complaint (const char *arg1, const char *arg2) /* local function prototypes */ -static void dwarf2_locate_sections (bfd *, asection *, PTR); +static void dwarf2_locate_sections (bfd *, asection *, void *); #if 0 static void dwarf2_build_psymtabs_easy (struct objfile *, int); @@ -640,11 +670,12 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); -char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int); +char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int, + asection *); static void dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header); -static void dwarf2_empty_abbrev_table (PTR); +static void dwarf2_empty_abbrev_table (void *); static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int, const struct comp_unit_head *cu_header); @@ -751,7 +782,8 @@ static void read_lexical_block_scope (struct die_info *, struct objfile *, const struct comp_unit_head *); static int dwarf2_get_pc_bounds (struct die_info *, - CORE_ADDR *, CORE_ADDR *, struct objfile *); + CORE_ADDR *, CORE_ADDR *, struct objfile *, + const struct comp_unit_head *); static void dwarf2_add_field (struct field_info *, struct die_info *, struct objfile *, const struct comp_unit_head *); @@ -855,7 +887,7 @@ static struct type *dwarf2_fundamental_type (struct objfile *, int); /* memory allocation interface */ -static void dwarf2_free_tmp_obstack (PTR); +static void dwarf2_free_tmp_obstack (void *); static struct dwarf_block *dwarf_alloc_block (void); @@ -886,6 +918,8 @@ dwarf2_has_info (bfd *abfd) dwarf_macinfo_offset = 0; dwarf_frame_offset = 0; dwarf_eh_frame_offset = 0; + dwarf_ranges_offset = 0; + bfd_map_over_sections (abfd, dwarf2_locate_sections, NULL); if (dwarf_info_offset && dwarf_abbrev_offset) { @@ -902,57 +936,73 @@ dwarf2_has_info (bfd *abfd) in. */ static void -dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, PTR ignore_ptr) +dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr) { if (STREQ (sectp->name, INFO_SECTION)) { dwarf_info_offset = sectp->filepos; dwarf_info_size = bfd_get_section_size_before_reloc (sectp); + dwarf_info_section = sectp; } else if (STREQ (sectp->name, ABBREV_SECTION)) { dwarf_abbrev_offset = sectp->filepos; dwarf_abbrev_size = bfd_get_section_size_before_reloc (sectp); + dwarf_abbrev_section = sectp; } else if (STREQ (sectp->name, LINE_SECTION)) { dwarf_line_offset = sectp->filepos; dwarf_line_size = bfd_get_section_size_before_reloc (sectp); + dwarf_line_section = sectp; } else if (STREQ (sectp->name, PUBNAMES_SECTION)) { dwarf_pubnames_offset = sectp->filepos; dwarf_pubnames_size = bfd_get_section_size_before_reloc (sectp); + dwarf_pubnames_section = sectp; } else if (STREQ (sectp->name, ARANGES_SECTION)) { dwarf_aranges_offset = sectp->filepos; dwarf_aranges_size = bfd_get_section_size_before_reloc (sectp); + dwarf_aranges_section = sectp; } else if (STREQ (sectp->name, LOC_SECTION)) { dwarf_loc_offset = sectp->filepos; dwarf_loc_size = bfd_get_section_size_before_reloc (sectp); + dwarf_loc_section = sectp; } else if (STREQ (sectp->name, MACINFO_SECTION)) { dwarf_macinfo_offset = sectp->filepos; dwarf_macinfo_size = bfd_get_section_size_before_reloc (sectp); + dwarf_loc_section = sectp; } else if (STREQ (sectp->name, STR_SECTION)) { dwarf_str_offset = sectp->filepos; dwarf_str_size = bfd_get_section_size_before_reloc (sectp); + dwarf_str_section = sectp; } else if (STREQ (sectp->name, FRAME_SECTION)) { dwarf_frame_offset = sectp->filepos; dwarf_frame_size = bfd_get_section_size_before_reloc (sectp); + dwarf_frame_section = sectp; } else if (STREQ (sectp->name, EH_FRAME_SECTION)) { dwarf_eh_frame_offset = sectp->filepos; dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp); + dwarf_eh_frame_section = sectp; + } + else if (STREQ (sectp->name, RANGES_SECTION)) + { + dwarf_ranges_offset = sectp->filepos; + dwarf_ranges_size = bfd_get_section_size_before_reloc (sectp); + dwarf_ranges_section = sectp; } } @@ -966,32 +1016,45 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline) dwarf_info_buffer = dwarf2_read_section (objfile, dwarf_info_offset, - dwarf_info_size); + dwarf_info_size, + dwarf_info_section); dwarf_abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_offset, - dwarf_abbrev_size); + dwarf_abbrev_size, + dwarf_abbrev_section); if (dwarf_line_offset) dwarf_line_buffer = dwarf2_read_section (objfile, dwarf_line_offset, - dwarf_line_size); + dwarf_line_size, + dwarf_line_section); else dwarf_line_buffer = NULL; if (dwarf_str_offset) dwarf_str_buffer = dwarf2_read_section (objfile, dwarf_str_offset, - dwarf_str_size); + dwarf_str_size, + dwarf_str_section); else dwarf_str_buffer = NULL; if (dwarf_macinfo_offset) dwarf_macinfo_buffer = dwarf2_read_section (objfile, dwarf_macinfo_offset, - dwarf_macinfo_size); + dwarf_macinfo_size, + dwarf_macinfo_section); else dwarf_macinfo_buffer = NULL; + if (dwarf_ranges_offset) + dwarf_ranges_buffer = dwarf2_read_section (objfile, + dwarf_ranges_offset, + dwarf_ranges_size, + dwarf_ranges_section); + else + dwarf_ranges_buffer = NULL; + if (mainline || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) @@ -1030,7 +1093,8 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline) pubnames_buffer = dwarf2_read_section (objfile, dwarf_pubnames_offset, - dwarf_pubnames_size); + dwarf_pubnames_size, + dwarf_pubnames_section); pubnames_ptr = pubnames_buffer; while ((pubnames_ptr - pubnames_buffer) < dwarf_pubnames_size) { @@ -1050,7 +1114,8 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline) aranges_buffer = dwarf2_read_section (objfile, dwarf_aranges_offset, - dwarf_aranges_size); + dwarf_aranges_size, + dwarf_aranges_section); } #endif @@ -1207,6 +1272,8 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) DWARF_STR_SIZE (pst) = dwarf_str_size; DWARF_MACINFO_BUFFER (pst) = dwarf_macinfo_buffer; DWARF_MACINFO_SIZE (pst) = dwarf_macinfo_size; + DWARF_RANGES_BUFFER (pst) = dwarf_ranges_buffer; + DWARF_RANGES_SIZE (pst) = dwarf_ranges_size; baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); /* Store the function that reads in the rest of the symbol table */ @@ -1543,6 +1610,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) dwarf_str_size = DWARF_STR_SIZE (pst); dwarf_macinfo_buffer = DWARF_MACINFO_BUFFER (pst); dwarf_macinfo_size = DWARF_MACINFO_SIZE (pst); + dwarf_ranges_buffer = DWARF_RANGES_BUFFER (pst); + dwarf_ranges_size = DWARF_RANGES_SIZE (pst); baseaddr = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (objfile)); cu_header_offset = offset; info_ptr = dwarf_info_buffer + offset; @@ -1565,9 +1634,10 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) make_cleanup_free_die_list (dies); /* Do line number decoding in read_file_scope () */ + cu_header.die = dies; process_die (dies, objfile, &cu_header); - if (!dwarf2_get_pc_bounds (dies, &lowpc, &highpc, objfile)) + if (!dwarf2_get_pc_bounds (dies, &lowpc, &highpc, objfile, &cu_header)) { /* Some compilers don't define a DW_AT_high_pc attribute for the compilation unit. If the DW_AT_high_pc is missing, @@ -1582,7 +1652,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) { CORE_ADDR low, high; - if (dwarf2_get_pc_bounds (child_die, &low, &high, objfile)) + if (dwarf2_get_pc_bounds (child_die, &low, &high, + objfile, &cu_header)) { highpc = max (highpc, high); } @@ -1711,7 +1782,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile, bfd *abfd = objfile->obfd; struct line_header *line_header = 0; - if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile)) + if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile, cu_header)) { if (die->has_children) { @@ -1722,7 +1793,8 @@ read_file_scope (struct die_info *die, struct objfile *objfile, { CORE_ADDR low, high; - if (dwarf2_get_pc_bounds (child_die, &low, &high, objfile)) + if (dwarf2_get_pc_bounds (child_die, &low, &high, + objfile, cu_header)) { lowpc = min (lowpc, low); highpc = max (highpc, high); @@ -1868,7 +1940,7 @@ read_func_scope (struct die_info *die, struct objfile *objfile, /* Ignore functions with missing or empty names and functions with missing or invalid low and high pc attributes. */ - if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile)) + if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile, cu_header)) return; lowpc += baseaddr; @@ -1966,7 +2038,11 @@ read_lexical_block_scope (struct die_info *die, struct objfile *objfile, struct die_info *child_die; /* Ignore blocks with missing or invalid low and high pc attributes. */ - if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile)) + /* ??? Perhaps consider discontiguous blocks defined by DW_AT_ranges + as multiple lexical blocks? Handling children in a sane way would + be nasty. Might be easier to properly extend generic blocks to + describe ranges. */ + if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile, cu_header)) return; lowpc += baseaddr; highpc += baseaddr; @@ -1991,27 +2067,159 @@ read_lexical_block_scope (struct die_info *die, struct objfile *objfile, local_symbols = new->locals; } -/* Get low and high pc attributes from a die. - Return 1 if the attributes are present and valid, otherwise, return 0. */ - +/* Get low and high pc attributes from a die. Return 1 if the attributes + are present and valid, otherwise, return 0. Return -1 if the range is + discontinuous, i.e. derived from DW_AT_ranges information. */ static int -dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, CORE_ADDR *highpc, - struct objfile *objfile) +dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, + CORE_ADDR *highpc, struct objfile *objfile, + const struct comp_unit_head *cu_header) { struct attribute *attr; - CORE_ADDR low; - CORE_ADDR high; + bfd *obfd = objfile->obfd; + CORE_ADDR low = 0; + CORE_ADDR high = 0; + int ret = 0; - attr = dwarf_attr (die, DW_AT_low_pc); - if (attr) - low = DW_ADDR (attr); - else - return 0; attr = dwarf_attr (die, DW_AT_high_pc); if (attr) - high = DW_ADDR (attr); + { + high = DW_ADDR (attr); + attr = dwarf_attr (die, DW_AT_low_pc); + if (attr) + low = DW_ADDR (attr); + else + /* Found high w/o low attribute. */ + return 0; + + /* Found consecutive range of addresses. */ + ret = 1; + } else - return 0; + { + attr = dwarf_attr (die, DW_AT_ranges); + if (attr != NULL) + { + unsigned int addr_size = cu_header->addr_size; + CORE_ADDR mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); + /* Value of the DW_AT_ranges attribute is the offset in the + .debug_renges section. */ + unsigned int offset = DW_UNSND (attr); + /* Base address selection entry. */ + CORE_ADDR base = 0; + int found_base = 0; + int dummy; + unsigned int i; + char *buffer; + CORE_ADDR marker; + int low_set; + + /* The applicable base address is determined by (1) the closest + preceding base address selection entry in the range list or + (2) the DW_AT_low_pc of the compilation unit. */ + + /* ??? Was in dwarf3 draft4, and has since been removed. + GCC still uses it though. */ + attr = dwarf_attr (cu_header->die, DW_AT_entry_pc); + if (attr) + { + base = DW_ADDR (attr); + found_base = 1; + } + + if (!found_base) + { + attr = dwarf_attr (cu_header->die, DW_AT_low_pc); + if (attr) + { + base = DW_ADDR (attr); + found_base = 1; + } + } + + buffer = dwarf_ranges_buffer + offset; + + + /* Read in the largest possible address. */ + marker = read_address (obfd, buffer, cu_header, &dummy); + if ((marker & mask) == mask) + { + /* If we found the largest possible address, then + read the base address. */ + base = read_address (obfd, buffer + addr_size, + cu_header, &dummy); + buffer += 2 * addr_size; + offset += 2 * addr_size; + found_base = 1; + } + + low_set = 0; + + while (1) + { + CORE_ADDR range_beginning, range_end; + + range_beginning = read_address (obfd, buffer, + cu_header, &dummy); + buffer += addr_size; + range_end = read_address (obfd, buffer, cu_header, &dummy); + buffer += addr_size; + offset += 2 * addr_size; + + /* An end of list marker is a pair of zero addresses. */ + if (range_beginning == 0 && range_end == 0) + /* Found the end of list entry. */ + break; + + /* Each base address selection entry is a pair of 2 values. + The first is the largest possible address, the second is + the base address. Check for a base address here. */ + if ((range_beginning & mask) == mask) + { + /* If we found the largest possible address, then + read the base address. */ + base = read_address (obfd, buffer + addr_size, + cu_header, &dummy); + found_base = 1; + continue; + } + + if (!found_base) + { + /* We have no valid base address for the ranges + data. */ + complaint (&symfile_complaints, + "Invalid .debug_ranges data (no base address)"); + return 0; + } + + /* FIXME: This is recording everything as a low-high + segment of consecutive addresses. We should have a + data structure for discontiguous block ranges + instead. */ + if (! low_set) + { + low = range_beginning; + high = range_end; + low_set = 1; + } + else + { + if (range_beginning < low) + low = range_beginning; + if (range_end > high) + high = range_end; + } + } + + if (! low_set) + /* If the first entry is an end-of-list marker, the range + describes an empty scope, i.e. no instructions. */ + return 0; + + ret = -1; + } + } if (high < low) return 0; @@ -2024,12 +2232,12 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, CORE_ADDR *highpc, labels are not in the output, so the relocs get a value of 0. If this is a discarded function, mark the pc bounds as invalid, so that GDB will ignore it. */ - if (low == 0 && (bfd_get_file_flags (objfile->obfd) & HAS_RELOC) == 0) + if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0) return 0; *lowpc = low; *highpc = high; - return 1; + return ret; } /* Add an aggregate field to the field list. */ @@ -3408,15 +3616,20 @@ make_cleanup_free_die_list (struct die_info *dies) char * dwarf2_read_section (struct objfile *objfile, file_ptr offset, - unsigned int size) + unsigned int size, asection *sectp) { bfd *abfd = objfile->obfd; - char *buf; + char *buf, *retbuf; if (size == 0) return NULL; buf = (char *) obstack_alloc (&objfile->psymbol_obstack, size); + retbuf + = (char *) symfile_relocate_debug_section (abfd, sectp, (bfd_byte *) buf); + if (retbuf != NULL) + return retbuf; + if ((bfd_seek (abfd, offset, SEEK_SET) != 0) || (bfd_bread (buf, size, abfd) != size)) { @@ -3507,7 +3720,7 @@ dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header) /* ARGSUSED */ static void -dwarf2_empty_abbrev_table (PTR ptr_to_abbrevs_table) +dwarf2_empty_abbrev_table (void *ptr_to_abbrevs_table) { int i; struct abbrev_info *abbrev, *next; @@ -6700,7 +6913,7 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile, /* ARGSUSED */ static void -dwarf2_free_tmp_obstack (PTR ignore) +dwarf2_free_tmp_obstack (void *ignore) { obstack_free (&dwarf2_tmp_obstack, NULL); } diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index f0c9be8..5c50b99 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -1,7 +1,8 @@ /* DWARF debugging format support for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support. Portions based on dbxread.c, mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port. @@ -359,7 +360,7 @@ static const struct language_defn *cu_language_defn; /* Forward declarations of static functions so we don't have to worry about ordering within this file. */ -static void free_utypes (PTR); +static void free_utypes (void *); static int attribute_size (unsigned int); @@ -369,19 +370,19 @@ static void add_enum_psymbol (struct dieinfo *, struct objfile *); static void handle_producer (char *); -static void -read_file_scope (struct dieinfo *, char *, char *, struct objfile *); +static void read_file_scope (struct dieinfo *, char *, char *, + struct objfile *); -static void -read_func_scope (struct dieinfo *, char *, char *, struct objfile *); +static void read_func_scope (struct dieinfo *, char *, char *, + struct objfile *); -static void -read_lexical_block_scope (struct dieinfo *, char *, char *, struct objfile *); +static void read_lexical_block_scope (struct dieinfo *, char *, char *, + struct objfile *); static void scan_partial_symbols (char *, char *, struct objfile *); -static void -scan_compilation_units (char *, char *, file_ptr, file_ptr, struct objfile *); +static void scan_compilation_units (char *, char *, file_ptr, file_ptr, + struct objfile *); static void add_partial_symbol (struct dieinfo *, struct objfile *); @@ -397,8 +398,8 @@ static void read_ofile_symtab (struct partial_symtab *); static void process_dies (char *, char *, struct objfile *); -static void -read_structure_scope (struct dieinfo *, char *, char *, struct objfile *); +static void read_structure_scope (struct dieinfo *, char *, char *, + struct objfile *); static struct type *decode_array_element_type (char *); @@ -412,8 +413,8 @@ static void read_tag_string_type (struct dieinfo *dip); static void read_subroutine_type (struct dieinfo *, char *, char *); -static void -read_enumeration (struct dieinfo *, char *, char *, struct objfile *); +static void read_enumeration (struct dieinfo *, char *, char *, + struct objfile *); static struct type *struct_type (struct dieinfo *, char *, char *, struct objfile *); @@ -440,8 +441,8 @@ static struct type *alloc_utype (DIE_REF, struct type *); static struct symbol *new_symbol (struct dieinfo *, struct objfile *); -static void -synthesize_typedef (struct dieinfo *, struct objfile *, struct type *); +static void synthesize_typedef (struct dieinfo *, struct objfile *, + struct type *); static int locval (struct dieinfo *); @@ -771,7 +772,7 @@ alloc_utype (DIE_REF die_ref, struct type *utypep) SYNOPSIS - static void free_utypes (PTR dummy) + static void free_utypes (void *dummy) DESCRIPTION @@ -781,7 +782,7 @@ alloc_utype (DIE_REF die_ref, struct type *utypep) */ static void -free_utypes (PTR dummy) +free_utypes (void *dummy) { xfree (utypes); utypes = NULL; @@ -2211,7 +2212,7 @@ read_ofile_symtab (struct partial_symtab *pst) if (LNFOFF (pst)) { if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) || - (bfd_bread ((PTR) lnsizedata, sizeof (lnsizedata), abfd) + (bfd_bread (lnsizedata, sizeof (lnsizedata), abfd) != sizeof (lnsizedata))) { error ("can't read DWARF line number table size"); diff --git a/gdb/elfread.c b/gdb/elfread.c index 9ddf3d4..b96d6e7 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1,7 +1,8 @@ /* Read ELF (Executable and Linking Format) object files for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support. This file is part of GDB. @@ -590,8 +591,7 @@ elf_symfile_read (struct objfile *objfile, int mainline) if (str_sect) elfstab_build_psymtabs (objfile, mainline, - ei.stabsect->filepos, - bfd_section_size (abfd, ei.stabsect), + ei.stabsect, str_sect->filepos, bfd_section_size (abfd, str_sect)); } diff --git a/gdb/eval.c b/gdb/eval.c index 18b29bd..a456e9c 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1,7 +1,8 @@ /* Evaluate expressions for GDB. - Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/exec.c b/gdb/exec.c index b495a00..0bde096 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -55,7 +55,7 @@ void (*file_changed_hook) (char *); /* Prototypes for local functions */ -static void add_to_section_table (bfd *, sec_ptr, PTR); +static void add_to_section_table (bfd *, sec_ptr, void *); static void exec_close (int); @@ -65,7 +65,7 @@ static void set_section_command (char *, int); static void exec_files_info (struct target_ops *); -static void bfdsec_to_vmap (bfd *, sec_ptr, PTR); +static void bfdsec_to_vmap (bfd *, sec_ptr, void *); static int ignore (CORE_ADDR, char *); @@ -90,7 +90,6 @@ int write_files = 0; #ifndef NEED_TEXT_START_END #define NEED_TEXT_START_END (0) #endif -CORE_ADDR text_start = 0; CORE_ADDR text_end = 0; struct vmap *vmap; @@ -279,7 +278,7 @@ exec_file_attach (char *filename, int from_tty) /* FIXME: The comment above does not match the code. The code checks for sections with are either code *or* readonly. */ - text_start = ~(CORE_ADDR) 0; + CORE_ADDR text_start = ~(CORE_ADDR) 0; text_end = (CORE_ADDR) 0; for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++) if (bfd_get_section_flags (p->bfd, p->the_bfd_section) @@ -366,7 +365,7 @@ file_command (char *arg, int from_tty) we cast it back to its proper type. */ static void -add_to_section_table (bfd *abfd, sec_ptr asect, PTR table_pp_char) +add_to_section_table (bfd *abfd, sec_ptr asect, void *table_pp_char) { struct section_table **table_pp = (struct section_table **) table_pp_char; flagword aflag; @@ -405,7 +404,7 @@ build_section_table (bfd *some_bfd, struct section_table **start, } static void -bfdsec_to_vmap (bfd *abfd, sec_ptr sect, PTR arg3) +bfdsec_to_vmap (bfd *abfd, sec_ptr sect, void *arg3) { struct vmap_and_bfd *vmap_bfd = (struct vmap_and_bfd *) arg3; struct vmap *vp; @@ -485,7 +484,7 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, int res; struct section_table *p; CORE_ADDR nextsectaddr, memend; - int (*xfer_fn) (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type); + int (*xfer_fn) (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); asection *section = NULL; if (len <= 0) diff --git a/gdb/expprint.c b/gdb/expprint.c index a59a86a..69d4559 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -1,6 +1,7 @@ /* Print in infix form a struct expression. + Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000 Free Software Foundation, Inc. + 1998, 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/expression.h b/gdb/expression.h index 7268979..60e61d9 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -1,5 +1,7 @@ /* Definitions for expressions stored in reversed prefix form, for GDB. - Copyright 1986, 1989, 1992, 1994, 2000 Free Software Foundation, Inc. + + Copyright 1986, 1989, 1992, 1994, 2000, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 56fd70a..6966231 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -564,7 +564,7 @@ direct_abs_decl: '(' abs_decl ')' func_mod: '(' ')' { $$ = 0; } | '(' nonempty_typelist ')' - { free ((PTR)$2); $$ = 0; } + { free ($2); $$ = 0; } ; typebase /* Implements (approximately): (type-qualifier)* type-specifier */ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index bd34b93..44850e3 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -1,7 +1,8 @@ /* Support for printing Fortran types for GDB, the GNU debugger. - Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 2000, - 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Motorola. Adapted from the C version by Farooq Butt (fmbutt@engage.sps.mot.com). diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 1be07e7..6b4b36d 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -562,7 +562,7 @@ list_all_visible_commons (char *funname) while (tmp != NULL) { - if (STREQ (tmp->owning_function, funname)) + if (strcmp (tmp->owning_function, funname) == 0) printf_filtered ("%s\n", tmp->name); tmp = tmp->next; @@ -643,7 +643,7 @@ info_common_command (char *comname, int from_tty) if (the_common) { - if (STREQ (comname, BLANK_COMMON_NAME_LOCAL)) + if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0) printf_filtered ("Contents of blank COMMON block:\n"); else printf_filtered ("Contents of F77 COMMON block '%s':\n", comname); diff --git a/gdb/findvar.c b/gdb/findvar.c index 980bb57..ccdb18d 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -1,7 +1,8 @@ /* Find a variable's value in memory, for GDB, the GNU debugger. - Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c new file mode 100644 index 0000000..a889f95 --- /dev/null +++ b/gdb/frame-unwind.c @@ -0,0 +1,103 @@ +/* Definitions for frame unwinder, for GDB, the GNU debugger. + + Copyright 2003 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "frame-unwind.h" +#include "gdb_assert.h" +#include "dummy-frame.h" + +static struct gdbarch_data *frame_unwind_data; + +struct frame_unwind_table +{ + frame_unwind_p_ftype **p; + int middle; + int nr; +}; + +/* Append a predicate to the end of the table. */ +static void +append_predicate (struct frame_unwind_table *table, frame_unwind_p_ftype *p) +{ + table->p = xrealloc (table->p, ((table->nr + 1) + * sizeof (frame_unwind_p_ftype *))); + table->p[table->nr] = p; + table->nr++; +} + +static void * +frame_unwind_init (struct gdbarch *gdbarch) +{ + struct frame_unwind_table *table = XCALLOC (1, struct frame_unwind_table); + append_predicate (table, dummy_frame_p); + return table; +} + +static void +frame_unwind_free (struct gdbarch *gdbarch, void *data) +{ + struct frame_unwind_table *table = + gdbarch_data (gdbarch, frame_unwind_data); + xfree (table->p); + xfree (table); +} + +void +frame_unwind_append_predicate (struct gdbarch *gdbarch, + frame_unwind_p_ftype *p) +{ + struct frame_unwind_table *table = + gdbarch_data (gdbarch, frame_unwind_data); + if (table == NULL) + { + /* ULGH, called during architecture initialization. Patch + things up. */ + table = frame_unwind_init (gdbarch); + set_gdbarch_data (gdbarch, frame_unwind_data, table); + } + append_predicate (table, p); +} + +const struct frame_unwind * +frame_unwind_find_by_pc (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + int i; + struct frame_unwind_table *table = + gdbarch_data (gdbarch, frame_unwind_data); + /* Seriously old code. Don't even try to use this new mechanism. */ + if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES) + return trad_frame_unwind; + for (i = 0; i < table->nr; i++) + { + const struct frame_unwind *desc = table->p[i] (pc); + if (desc != NULL) + return desc; + } + return trad_frame_unwind; +} + +void +_initialize_frame_unwind (void) +{ + frame_unwind_data = register_gdbarch_data (frame_unwind_init, + frame_unwind_free); +} diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h new file mode 100644 index 0000000..2c67c96 --- /dev/null +++ b/gdb/frame-unwind.h @@ -0,0 +1,111 @@ +/* Definitions for a frame unwinder, for GDB, the GNU debugger. + + Copyright 2003 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#if !defined (FRAME_UNWIND_H) +#define FRAME_UNWIND_H 1 + +struct frame_info; +struct frame_id; +struct frame_unwind; +struct gdbarch; +struct regcache; + +/* Return the frame unwind methods for the function that contains PC, + or NULL if this this unwinder can't handle this frame. */ + +typedef const struct frame_unwind *(frame_unwind_p_ftype) (CORE_ADDR pc); + +/* Add a frame unwinder to the list. The predicates are polled in the + order that they are appended. The initial list contains the dummy + frame's predicate. */ + +extern void frame_unwind_append_predicate (struct gdbarch *gdbarch, + frame_unwind_p_ftype *p); + +/* Iterate through the list of frame unwinders until one returns an + implementation. */ + +extern const struct frame_unwind *frame_unwind_find_by_pc (struct gdbarch + *gdbarch, + CORE_ADDR pc); + +/* Return the location (and possibly value) of REGNUM for the previous + (older, up) frame. All parameters except VALUEP can be assumed to + be non NULL. When VALUEP is NULL, just the location of the + register should be returned. + + UNWIND_CACHE is provided as mechanism for implementing a per-frame + local cache. It's initial value being NULL. Memory for that cache + should be allocated using frame_obstack_zalloc(). + + Register window architectures (eg SPARC) should note that REGNUM + identifies the register for the previous frame. For instance, a + request for the value of "o1" for the previous frame would be found + in the register "i1" in this FRAME. */ + +typedef void (frame_unwind_reg_ftype) (struct frame_info * frame, + void **unwind_cache, + int regnum, + int *optimized, + enum lval_type * lvalp, + CORE_ADDR *addrp, + int *realnump, void *valuep); + +/* Same as for registers above, but return the address at which the + calling frame would resume. */ + +typedef CORE_ADDR (frame_unwind_pc_ftype) (struct frame_info * frame, + void **unwind_cache); + +/* Same as for registers above, but return the ID of the frame that + called this one. */ + +typedef void (frame_unwind_id_ftype) (struct frame_info * frame, + void **unwind_cache, + struct frame_id * id); + +/* Discard the frame by restoring the registers (in regcache) back to + that of the caller. */ +/* NOTE: cagney/2003-01-19: While at present the callers all pop each + frame in turn, the implementor should try to code things so that + any frame can be popped directly. */ +/* FIXME: cagney/2003-01-19: Since both FRAME and REGCACHE refer to a + common register cache, care must be taken when restoring the + registers. The `correct fix' is to first first save the registers + in a scratch cache, and second write that scratch cache back to to + the real register cache. */ + +typedef void (frame_unwind_pop_ftype) (struct frame_info *frame, + void **unwind_cache, + struct regcache *regcache); + +struct frame_unwind +{ + /* Should the frame's type go here? */ + /* Should an attribute indicating the frame's address-in-block go + here? */ + frame_unwind_pop_ftype *pop; + frame_unwind_pc_ftype *pc; + frame_unwind_id_ftype *id; + frame_unwind_reg_ftype *reg; +}; + +#endif diff --git a/gdb/frame.c b/gdb/frame.c index acc163e..0c3009c 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -31,9 +31,17 @@ #include "builtin-regs.h" #include "gdb_obstack.h" #include "dummy-frame.h" +#include "sentinel-frame.h" #include "gdbcore.h" #include "annotate.h" #include "language.h" +#include "frame-unwind.h" +#include "command.h" +#include "gdbcmd.h" + +/* Flag to indicate whether backtraces should stop at main. */ + +static int backtrace_below_main; /* Return a frame uniq ID that can be used to, later, re-find the frame. */ @@ -127,7 +135,7 @@ frame_pc_unwind (struct frame_info *frame) { if (!frame->pc_unwind_cache_p) { - frame->pc_unwind_cache = frame->pc_unwind (frame, &frame->unwind_cache); + frame->pc_unwind_cache = frame->unwind->pc (frame, &frame->unwind_cache); frame->pc_unwind_cache_p = 1; } return frame->pc_unwind_cache; @@ -138,13 +146,24 @@ frame_id_unwind (struct frame_info *frame) { if (!frame->id_unwind_cache_p) { - frame->id_unwind_cache = - frame->id_unwind (frame, &frame->unwind_cache); + frame->unwind->id (frame, &frame->unwind_cache, &frame->id_unwind_cache); frame->id_unwind_cache_p = 1; } return frame->id_unwind_cache; } +void +frame_pop (struct frame_info *frame) +{ + /* FIXME: cagney/2003-01-18: There is probably a chicken-egg problem + with passing in current_regcache. The pop function needs to be + written carefully so as to not overwrite registers whose [old] + values are needed to restore other registers. Instead, this code + should pass in a scratch cache and, as a second step, restore the + registers using that. */ + frame->unwind->pop (frame, &frame->unwind_cache, current_regcache); + flush_cached_frames (); +} void frame_register_unwind (struct frame_info *frame, int regnum, @@ -161,33 +180,15 @@ frame_register_unwind (struct frame_info *frame, int regnum, gdb_assert (realnump != NULL); /* gdb_assert (bufferp != NULL); */ - /* NOTE: cagney/2002-04-14: It would be nice if, instead of a - special case, there was always an inner frame dedicated to the - hardware registers. Unfortunatly, there is too much unwind code - around that looks up/down the frame chain while making the - assumption that each frame level is using the same unwind code. */ - - if (frame == NULL) - { - /* We're in the inner-most frame, get the value direct from the - register cache. */ - *optimizedp = 0; - *lvalp = lval_register; - /* 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? */ - *realnump = regnum; - if (bufferp) - deprecated_read_register_gen (regnum, bufferp); - return; - } + /* NOTE: cagney/2002-11-27: A program trying to unwind a NULL frame + is broken. There is always a frame. If there, for some reason, + isn't, there is some pretty busted code as it should have + detected the problem before calling here. */ + gdb_assert (frame != NULL); /* Ask this frame to unwind its register. */ - frame->register_unwind (frame, &frame->unwind_cache, regnum, - optimizedp, lvalp, addrp, realnump, bufferp); + frame->unwind->reg (frame, &frame->unwind_cache, regnum, + optimizedp, lvalp, addrp, realnump, bufferp); } void @@ -229,38 +230,30 @@ frame_register (struct frame_info *frame, int regnum, return; } - /* Reached the the bottom (youngest, inner most) of the frame chain - (youngest, inner most) frame, go direct to the hardware register - cache (do not pass go, do not try to cache the value, ...). The - unwound value would have been cached in frame->next but that - doesn't exist. This doesn't matter as the hardware register - cache is stopping any unnecessary accesses to the target. */ - - /* NOTE: cagney/2002-04-14: It would be nice if, instead of a - special case, there was always an inner frame dedicated to the - hardware registers. Unfortunatly, there is too much unwind code - around that looks up/down the frame chain while making the - assumption that each frame level is using the same unwind code. */ - - if (frame == NULL) - frame_register_unwind (NULL, regnum, optimizedp, lvalp, addrp, realnump, - bufferp); - else - frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, - realnump, bufferp); + /* Obtain the register value by unwinding the register from the next + (more inner frame). */ + gdb_assert (frame != NULL && frame->next != NULL); + frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, + realnump, bufferp); } void -frame_unwind_signed_register (struct frame_info *frame, int regnum, - LONGEST *val) +frame_unwind_register (struct frame_info *frame, int regnum, void *buf) { int optimized; CORE_ADDR addr; int realnum; enum lval_type lval; - void *buf = alloca (MAX_REGISTER_RAW_SIZE); frame_register_unwind (frame, regnum, &optimized, &lval, &addr, &realnum, buf); +} + +void +frame_unwind_signed_register (struct frame_info *frame, int regnum, + LONGEST *val) +{ + void *buf = alloca (MAX_REGISTER_RAW_SIZE); + frame_unwind_register (frame, regnum, buf); (*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); } @@ -268,17 +261,19 @@ void frame_unwind_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val) { - int optimized; - CORE_ADDR addr; - int realnum; - enum lval_type lval; void *buf = alloca (MAX_REGISTER_RAW_SIZE); - frame_register_unwind (frame, regnum, &optimized, &lval, &addr, - &realnum, buf); + frame_unwind_register (frame, regnum, buf); (*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); } void +frame_read_register (struct frame_info *frame, int regnum, void *buf) +{ + gdb_assert (frame != NULL && frame->next != NULL); + frame_unwind_register (frame->next, regnum, buf); +} + +void frame_read_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val) { @@ -299,17 +294,17 @@ frame_read_unsigned_register (struct frame_info *frame, int regnum, tests like ``if get_next_frame() == NULL'' and instead just rely on recursive frame calls (like the below code) when manipulating a frame chain. */ - gdb_assert (frame != NULL); - frame_unwind_unsigned_register (get_next_frame (frame), regnum, val); + gdb_assert (frame != NULL && frame->next != NULL); + frame_unwind_unsigned_register (frame->next, regnum, val); } void frame_read_signed_register (struct frame_info *frame, int regnum, LONGEST *val) { - /* See note in frame_read_unsigned_register(). */ - gdb_assert (frame != NULL); - frame_unwind_signed_register (get_next_frame (frame), regnum, val); + /* See note above in frame_read_unsigned_register(). */ + gdb_assert (frame != NULL && frame->next != NULL); + frame_unwind_signed_register (frame->next, regnum, val); } static void @@ -337,25 +332,9 @@ generic_unwind_get_saved_register (char *raw_buffer, if (addrp == NULL) addrp = &addrx; - /* Reached the the bottom (youngest, inner most) of the frame chain - (youngest, inner most) frame, go direct to the hardware register - cache (do not pass go, do not try to cache the value, ...). The - unwound value would have been cached in frame->next but that - doesn't exist. This doesn't matter as the hardware register - cache is stopping any unnecessary accesses to the target. */ - - /* NOTE: cagney/2002-04-14: It would be nice if, instead of a - special case, there was always an inner frame dedicated to the - hardware registers. Unfortunatly, there is too much unwind code - around that looks up/down the frame chain while making the - assumption that each frame level is using the same unwind code. */ - - if (frame == NULL) - frame_register_unwind (NULL, regnum, optimizedp, lvalp, addrp, &realnumx, - raw_buffer); - else - frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, - &realnumx, raw_buffer); + gdb_assert (frame != NULL && frame->next != NULL); + frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, + &realnumx, raw_buffer); } void @@ -414,6 +393,9 @@ frame_map_name_to_regnum (const char *name, int len) { int i; + if (len < 0) + len = strlen (name); + /* Search register name space. */ for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) if (REGISTER_NAME (i) && len == strlen (REGISTER_NAME (i)) @@ -445,6 +427,32 @@ frame_map_regnum_to_name (int regnum) return builtin_reg_map_regnum_to_name (regnum); } +/* Create a sentinel frame. */ + +struct frame_info * +create_sentinel_frame (struct regcache *regcache) +{ + struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info); + frame->type = NORMAL_FRAME; + frame->level = -1; + /* Explicitly initialize the sentinel frame's cache. Provide it + with the underlying regcache. In the future additional + information, such as the frame's thread will be added. */ + frame->unwind_cache = sentinel_frame_cache (regcache); + /* For the moment there is only one sentinel frame implementation. */ + frame->unwind = sentinel_frame_unwind; + /* Link this frame back to itself. The frame is self referential + (the unwound PC is the same as the pc), so make it so. */ + frame->next = frame; + /* Always unwind the PC as part of creating this frame. This + ensures that the frame's PC points at something valid. */ + /* FIXME: cagney/2003-01-10: Problem here. Unwinding a sentinel + frame's PC may require information such as the frame's thread's + stop reason. Is it possible to get to that? */ + frame->pc = frame_pc_unwind (frame); + return frame; +} + /* Info about the innermost stack frame (contents of FP register) */ static struct frame_info *current_frame; @@ -477,17 +485,43 @@ get_frame_saved_regs (struct frame_info *fi) return fi->saved_regs; } -/* Return the innermost (currently executing) stack frame. */ +/* Return the innermost (currently executing) stack frame. This is + split into two functions. The function unwind_to_current_frame() + is wrapped in catch exceptions so that, even when the unwind of the + sentinel frame fails, the function still returns a stack frame. */ + +static int +unwind_to_current_frame (struct ui_out *ui_out, void *args) +{ + struct frame_info *frame = get_prev_frame (args); + /* A sentinel frame can fail to unwind, eg, because it's PC value + lands in somewhere like start. */ + if (frame == NULL) + return 1; + current_frame = frame; + return 0; +} struct frame_info * get_current_frame (void) { + if (!target_has_stack) + error ("No stack."); + if (!target_has_registers) + error ("No registers."); + if (!target_has_memory) + error ("No memory."); if (current_frame == NULL) { - if (target_has_stack) - current_frame = create_new_frame (read_fp (), read_pc ()); - else - error ("No stack."); + struct frame_info *sentinel_frame = + create_sentinel_frame (current_regcache); + if (catch_exceptions (uiout, unwind_to_current_frame, sentinel_frame, + NULL, RETURN_MASK_ERROR) != 0) + { + /* Oops! Fake a current frame? Is this useful? It has a PC + of zero, for instance. */ + current_frame = sentinel_frame; + } } return current_frame; } @@ -570,12 +604,16 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, gdb_assert (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES && (get_frame_type (frame) == DUMMY_FRAME))); + /* Only (older) architectures that implement the + FRAME_INIT_SAVED_REGS method should be using this function. */ + gdb_assert (FRAME_INIT_SAVED_REGS_P ()); + /* Load the saved_regs register cache. */ - if (frame->saved_regs == NULL) + if (get_frame_saved_regs (frame) == NULL) FRAME_INIT_SAVED_REGS (frame); - if (frame->saved_regs != NULL - && frame->saved_regs[regnum] != 0) + if (get_frame_saved_regs (frame) != NULL + && get_frame_saved_regs (frame)[regnum] != 0) { if (regnum == SP_REGNUM) { @@ -586,7 +624,7 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, *realnump = -1; if (bufferp != NULL) store_address (bufferp, REGISTER_RAW_SIZE (regnum), - frame->saved_regs[regnum]); + get_frame_saved_regs (frame)[regnum]); } else { @@ -594,7 +632,7 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, a local copy of its value. */ *optimizedp = 0; *lvalp = lval_memory; - *addrp = frame->saved_regs[regnum]; + *addrp = get_frame_saved_regs (frame)[regnum]; *realnump = -1; if (bufferp != NULL) { @@ -613,13 +651,13 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, { regs[regnum] = frame_obstack_zalloc (REGISTER_RAW_SIZE (regnum)); - read_memory (frame->saved_regs[regnum], regs[regnum], + read_memory (get_frame_saved_regs (frame)[regnum], regs[regnum], REGISTER_RAW_SIZE (regnum)); } memcpy (bufferp, regs[regnum], REGISTER_RAW_SIZE (regnum)); #else /* Read the value in from memory. */ - read_memory (frame->saved_regs[regnum], bufferp, + read_memory (get_frame_saved_regs (frame)[regnum], bufferp, REGISTER_RAW_SIZE (regnum)); #endif } @@ -628,36 +666,32 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, } /* No luck, assume this and the next frame have the same register - value. If a value is needed, pass the request on down the chain; - otherwise just return an indication that the value is in the same - register as the next frame. */ - if (bufferp == NULL) - { - *optimizedp = 0; - *lvalp = lval_register; - *addrp = 0; - *realnump = regnum; - } - else - { - frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, - realnump, bufferp); - } + value. Pass the request down the frame chain to the next frame. + Hopefully that will find the register's location, either in a + register or in memory. */ + frame_register (frame, regnum, optimizedp, lvalp, addrp, realnump, + bufferp); } static CORE_ADDR frame_saved_regs_pc_unwind (struct frame_info *frame, void **cache) { + gdb_assert (FRAME_SAVED_PC_P ()); return FRAME_SAVED_PC (frame); } -static struct frame_id -frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache) +static void +frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache, + struct frame_id *id) { int fromleaf; - struct frame_id id; + CORE_ADDR base; + CORE_ADDR pc; + + /* Start out by assuming it's NULL. */ + (*id) = null_frame_id; - if (next_frame->next == NULL) + if (frame_relative_level (next_frame) <= 0) /* FIXME: 2002-11-09: Frameless functions can occure anywhere in the frame chain, not just the inner most frame! The generic, per-architecture, frame code should handle this and the below @@ -673,7 +707,7 @@ frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache) /* FIXME: 2002-11-09: There isn't any reason to special case this edge condition. Instead the per-architecture code should hande it locally. */ - id.base = get_frame_base (next_frame); + base = get_frame_base (next_frame); else { /* Two macros defined in tm.h specify the machine-dependent @@ -691,20 +725,39 @@ frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache) this to after the ffi test; I'd rather have backtraces from start go curfluy than have an abort called from main not show main. */ - id.base = FRAME_CHAIN (next_frame); + gdb_assert (FRAME_CHAIN_P ()); + base = FRAME_CHAIN (next_frame); - if (!frame_chain_valid (id.base, next_frame)) - return null_frame_id; + if (!frame_chain_valid (base, next_frame)) + return; } - if (id.base == 0) - return null_frame_id; + if (base == 0) + return; /* FIXME: cagney/2002-06-08: This should probably return the frame's function and not the PC (a.k.a. resume address). */ - id.pc = frame_pc_unwind (next_frame); - return id; + pc = frame_pc_unwind (next_frame); + id->pc = pc; + id->base = base; } +static void +frame_saved_regs_pop (struct frame_info *fi, void **cache, + struct regcache *regcache) +{ + gdb_assert (POP_FRAME_P ()); + POP_FRAME; +} + +const struct frame_unwind trad_frame_unwinder = { + frame_saved_regs_pop, + frame_saved_regs_pc_unwind, + frame_saved_regs_id_unwind, + frame_saved_regs_register_unwind +}; +const struct frame_unwind *trad_frame_unwind = &trad_frame_unwinder; + + /* Function: get_saved_register Find register number REGNUM relative to FRAME and put its (raw, target format) contents in *RAW_BUFFER. @@ -738,6 +791,8 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, if (!target_has_registers) error ("No registers."); + gdb_assert (FRAME_INIT_SAVED_REGS_P ()); + /* Normal systems don't optimize out things with register numbers. */ if (optimized != NULL) *optimized = 0; @@ -750,44 +805,50 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, the current frame itself: otherwise, we would be getting the previous frame's registers which were saved by the current frame. */ - while (frame && ((frame = frame->next) != NULL)) + if (frame != NULL) { - if (get_frame_type (frame) == DUMMY_FRAME) - { - if (lval) /* found it in a CALL_DUMMY frame */ - *lval = not_lval; - if (raw_buffer) - /* FIXME: cagney/2002-06-26: This should be via the - gdbarch_register_read() method so that it, on the fly, - constructs either a raw or pseudo register from the raw - register cache. */ - regcache_raw_read (generic_find_dummy_frame (frame->pc, - frame->frame), - regnum, raw_buffer); - return; - } - - FRAME_INIT_SAVED_REGS (frame); - if (frame->saved_regs != NULL - && frame->saved_regs[regnum] != 0) + for (frame = get_next_frame (frame); + frame_relative_level (frame) >= 0; + frame = get_next_frame (frame)) { - if (lval) /* found it saved on the stack */ - *lval = lval_memory; - if (regnum == SP_REGNUM) + if (get_frame_type (frame) == DUMMY_FRAME) { - if (raw_buffer) /* SP register treated specially */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - frame->saved_regs[regnum]); + if (lval) /* found it in a CALL_DUMMY frame */ + *lval = not_lval; + if (raw_buffer) + /* FIXME: cagney/2002-06-26: This should be via the + gdbarch_register_read() method so that it, on the + fly, constructs either a raw or pseudo register + from the raw register cache. */ + regcache_raw_read + (generic_find_dummy_frame (get_frame_pc (frame), + get_frame_base (frame)), + regnum, raw_buffer); + return; } - else + + FRAME_INIT_SAVED_REGS (frame); + if (get_frame_saved_regs (frame) != NULL + && get_frame_saved_regs (frame)[regnum] != 0) { - if (addrp) /* any other register */ - *addrp = frame->saved_regs[regnum]; - if (raw_buffer) - read_memory (frame->saved_regs[regnum], raw_buffer, - REGISTER_RAW_SIZE (regnum)); + if (lval) /* found it saved on the stack */ + *lval = lval_memory; + if (regnum == SP_REGNUM) + { + if (raw_buffer) /* SP register treated specially */ + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); + } + else + { + if (addrp) /* any other register */ + *addrp = get_frame_saved_regs (frame)[regnum]; + if (raw_buffer) + read_memory (get_frame_saved_regs (frame)[regnum], raw_buffer, + REGISTER_RAW_SIZE (regnum)); + } + return; } - return; } } @@ -802,39 +863,26 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, deprecated_read_register_gen (regnum, raw_buffer); } -/* Using the PC, select a mechanism for unwinding a frame returning - the previous frame. The register unwind function should, on - demand, initialize the ->context object. */ +/* Determine the frame's type based on its PC. */ -static void -set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp, - frame_register_unwind_ftype **unwind_register, - frame_pc_unwind_ftype **unwind_pc, - frame_id_unwind_ftype **unwind_id) +static enum frame_type +frame_type_from_pc (CORE_ADDR pc) { - if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - { - /* Still need to set this to something. The ``info frame'' code - calls this function to find out where the saved registers are. - Hopefully this is robust enough to stop any core dumps and - return vaguely correct values.. */ - *unwind_register = frame_saved_regs_register_unwind; - *unwind_pc = frame_saved_regs_pc_unwind; - *unwind_id = frame_saved_regs_id_unwind; - } - else if (DEPRECATED_PC_IN_CALL_DUMMY_P () - ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) - : pc_in_dummy_frame (pc)) - { - *unwind_register = dummy_frame_register_unwind; - *unwind_pc = dummy_frame_pc_unwind; - *unwind_id = dummy_frame_id_unwind; - } + /* FIXME: cagney/2002-11-24: Can't yet directly call + pc_in_dummy_frame() as some architectures don't set + PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the + latter is implemented by simply calling pc_in_dummy_frame). */ + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) + return DUMMY_FRAME; else { - *unwind_register = frame_saved_regs_register_unwind; - *unwind_pc = frame_saved_regs_pc_unwind; - *unwind_id = frame_saved_regs_id_unwind; + char *name; + find_pc_partial_function (pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (pc, name)) + return SIGTRAMP_FRAME; + else + return NORMAL_FRAME; } } @@ -845,54 +893,34 @@ struct frame_info * create_new_frame (CORE_ADDR addr, CORE_ADDR pc) { struct frame_info *fi; - enum frame_type type; fi = frame_obstack_zalloc (sizeof (struct frame_info)); fi->frame = addr; fi->pc = pc; - /* NOTE: cagney/2002-11-18: The code segments, found in - create_new_frame and get_prev_frame(), that initializes the - frames type is subtly different. The latter only updates ->type - when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops - get_prev_frame() overriding the frame's type when the INIT code - has previously set it. This is really somewhat bogus. The - initialization, as seen in create_new_frame(), should occur - before the INIT function has been called. */ - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && (DEPRECATED_PC_IN_CALL_DUMMY_P () - ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) - : pc_in_dummy_frame (pc))) - /* NOTE: cagney/2002-11-11: Does this even occure? */ - type = DUMMY_FRAME; - else - { - char *name; - find_pc_partial_function (pc, &name, NULL, NULL); - if (PC_IN_SIGTRAMP (fi->pc, name)) - type = SIGTRAMP_FRAME; - else - type = NORMAL_FRAME; - } - fi->type = type; + fi->next = create_sentinel_frame (current_regcache); + fi->type = frame_type_from_pc (pc); if (INIT_EXTRA_FRAME_INFO_P ()) INIT_EXTRA_FRAME_INFO (0, fi); /* Select/initialize an unwind function. */ - set_unwind_by_pc (fi->pc, fi->frame, &fi->register_unwind, - &fi->pc_unwind, &fi->id_unwind); + fi->unwind = frame_unwind_find_by_pc (current_gdbarch, fi->pc); return fi; } /* Return the frame that FRAME calls (NULL if FRAME is the innermost - frame). */ + frame). Be careful to not fall off the bottom of the frame chain + and onto the sentinel frame. */ struct frame_info * get_next_frame (struct frame_info *frame) { - return frame->next; + if (frame->level > 0) + return frame->next; + else + return NULL; } /* Flush the entire frame cache. */ @@ -923,43 +951,19 @@ reinit_frame_cache (void) } } -/* Return a structure containing various interesting information - about the frame that called NEXT_FRAME. Returns NULL - if there is no such frame. */ +/* Create the previous frame using the deprecated methods + INIT_EXTRA_INFO, INIT_FRAME_PC and INIT_FRAME_PC_FIRST. */ -struct frame_info * -get_prev_frame (struct frame_info *next_frame) +static struct frame_info * +legacy_get_prev_frame (struct frame_info *next_frame) { CORE_ADDR address = 0; struct frame_info *prev; int fromleaf; - /* Return the inner-most frame, when the caller passes in NULL. */ - /* NOTE: cagney/2002-11-09: Not sure how this would happen. The - caller should have previously obtained a valid frame using - get_selected_frame() and then called this code - only possibility - I can think of is code behaving badly. */ - if (next_frame == NULL) - { - /* NOTE: cagney/2002-11-09: There was a code segment here that - would error out when CURRENT_FRAME was NULL. The comment - that went with it made the claim ... - - ``This screws value_of_variable, which just wants a nice - clean NULL return from block_innermost_frame if there are no - frames. I don't think I've ever seen this message happen - otherwise. And returning NULL here is a perfectly legitimate - thing to do.'' - - Per the above, this code shouldn't even be called with a NULL - NEXT_FRAME. */ - return current_frame; - } - - /* Only try to do the unwind once. */ - if (next_frame->prev_p) - return next_frame->prev; - next_frame->prev_p = 1; + /* This code only works on normal frames. A sentinel frame, where + the level is -1, should never reach this code. */ + gdb_assert (next_frame->level >= 0); /* On some machines it is possible to call a function without setting up a stack frame for it. On these machines, we @@ -970,7 +974,7 @@ get_prev_frame (struct frame_info *next_frame) /* Still don't want to worry about this except on the innermost frame. This macro will set FROMLEAF if NEXT_FRAME is a frameless function invocation. */ - if (next_frame->next == NULL) + if (next_frame->level == 0) /* FIXME: 2002-11-09: Frameless functions can occure anywhere in the frame chain, not just the inner most frame! The generic, per-architecture, frame code should handle this and the below @@ -1004,6 +1008,7 @@ get_prev_frame (struct frame_info *next_frame) this to after the ffi test; I'd rather have backtraces from start go curfluy than have an abort called from main not show main. */ + gdb_assert (FRAME_CHAIN_P ()); address = FRAME_CHAIN (next_frame); if (!frame_chain_valid (address, next_frame)) @@ -1124,8 +1129,7 @@ get_prev_frame (struct frame_info *next_frame) (and probably other architectural information). The PC lets you check things like the debug info at that point (dwarf2cfi?) and use that to decide how the frame should be unwound. */ - set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind, - &prev->pc_unwind, &prev->id_unwind); + prev->unwind = frame_unwind_find_by_pc (current_gdbarch, prev->pc); /* NOTE: cagney/2002-11-18: The code segments, found in create_new_frame and get_prev_frame(), that initializes the @@ -1163,6 +1167,163 @@ get_prev_frame (struct frame_info *next_frame) return prev; } +/* Return a structure containing various interesting information + about the frame that called NEXT_FRAME. Returns NULL + if there is no such frame. */ + +struct frame_info * +get_prev_frame (struct frame_info *next_frame) +{ + struct frame_info *prev_frame; + + /* Return the inner-most frame, when the caller passes in NULL. */ + /* NOTE: cagney/2002-11-09: Not sure how this would happen. The + caller should have previously obtained a valid frame using + get_selected_frame() and then called this code - only possibility + I can think of is code behaving badly. + + NOTE: cagney/2003-01-10: Talk about code behaving badly. Check + block_innermost_frame(). It does the sequence: frame = NULL; + while (1) { frame = get_prev_frame (frame); .... }. Ulgh! Why + it couldn't be written better, I don't know. + + NOTE: cagney/2003-01-11: I suspect what is happening is + block_innermost_frame() is, when the target has no state + (registers, memory, ...), still calling this function. The + assumption being that this function will return NULL indicating + that a frame isn't possible, rather than checking that the target + has state and then calling get_current_frame() and + get_prev_frame(). This is a guess mind. */ + if (next_frame == NULL) + { + /* NOTE: cagney/2002-11-09: There was a code segment here that + would error out when CURRENT_FRAME was NULL. The comment + that went with it made the claim ... + + ``This screws value_of_variable, which just wants a nice + clean NULL return from block_innermost_frame if there are no + frames. I don't think I've ever seen this message happen + otherwise. And returning NULL here is a perfectly legitimate + thing to do.'' + + Per the above, this code shouldn't even be called with a NULL + NEXT_FRAME. */ + return current_frame; + } + + /* There is always a frame. If this assertion fails, suspect that + something should be calling get_selected_frame() or + get_current_frame(). */ + gdb_assert (next_frame != NULL); + + if (next_frame->level >= 0 + && !backtrace_below_main + && inside_main_func (get_frame_pc (next_frame))) + /* Don't unwind past main(), bug always unwind the sentinel frame. + Note, this is done _before_ the frame has been marked as + previously unwound. That way if the user later decides to + allow unwinds past main(), that just happens. */ + return NULL; + + /* Only try to do the unwind once. */ + if (next_frame->prev_p) + return next_frame->prev; + next_frame->prev_p = 1; + + /* If we're inside the entry file, it isn't valid. */ + /* NOTE: drow/2002-12-25: should there be a way to disable this + check? It assumes a single small entry file, and the way some + debug readers (e.g. dbxread) figure out which object is the + entry file is somewhat hokey. */ + /* NOTE: cagney/2003-01-10: If there is a way of disabling this test + then it should probably be moved to before the ->prev_p test, + above. */ + if (inside_entry_file (get_frame_pc (next_frame))) + return NULL; + + /* If any of the old frame initialization methods are around, use + the legacy get_prev_frame method. Just don't try to unwind a + sentinel frame using that method - it doesn't work. All sentinal + frames use the new unwind code. */ + if ((DEPRECATED_INIT_FRAME_PC_P () + || DEPRECATED_INIT_FRAME_PC_FIRST_P () + || INIT_EXTRA_FRAME_INFO_P () + || FRAME_CHAIN_P ()) + && next_frame->level >= 0) + return legacy_get_prev_frame (next_frame); + + /* Allocate the new frame but do not wire it in to the frame chain. + Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along + frame->next to pull some fancy tricks (of course such code is, by + definition, recursive). Try to prevent it. + + There is no reason to worry about memory leaks, should the + remainder of the function fail. The allocated memory will be + quickly reclaimed when the frame cache is flushed, and the `we've + been here before' check above will stop repeated memory + allocation calls. */ + prev_frame = FRAME_OBSTACK_ZALLOC (struct frame_info); + prev_frame->level = next_frame->level + 1; + + /* Try to unwind the PC. If that doesn't work, assume we've reached + the oldest frame and simply return. Is there a better sentinal + value? The unwound PC value is then used to initialize the new + previous frame's type. + + Note that the pc-unwind is intentionally performed before the + frame chain. This is ok since, for old targets, both + frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume + NEXT_FRAME's data structures have already been initialized (using + INIT_EXTRA_FRAME_INFO) and hence the call order doesn't matter. + + By unwinding the PC first, it becomes possible to, in the case of + a dummy frame, avoid also unwinding the frame ID. This is + because (well ignoring the PPC) a dummy frame can be located + using NEXT_FRAME's frame ID. */ + + prev_frame->pc = frame_pc_unwind (next_frame); + if (prev_frame->pc == 0) + /* The allocated PREV_FRAME will be reclaimed when the frame + obstack is next purged. */ + return NULL; + prev_frame->type = frame_type_from_pc (prev_frame->pc); + + /* Set the unwind functions based on that identified PC. */ + prev_frame->unwind = frame_unwind_find_by_pc (current_gdbarch, + prev_frame->pc); + + /* FIXME: cagney/2003-01-13: A dummy frame doesn't need to unwind + the frame ID because the frame ID comes from the previous frame. + The other frames do though. True? */ + { + /* FIXME: cagney/2002-12-18: Instead of this hack, should just + save the frame ID directly. */ + struct frame_id id = frame_id_unwind (next_frame); + if (!frame_id_p (id)) + return NULL; + prev_frame->frame = id.base; + } + + /* Link it in. */ + next_frame->prev = prev_frame; + prev_frame->next = next_frame; + + /* FIXME: cagney/2002-01-19: This call will go away. Instead of + initializing extra info, all frames will use the frame_cache + (passed to the unwind functions) to store additional frame info. + Unfortunatly legacy targets can't use legacy_get_prev_frame() to + unwind the sentinel frame and, consequently, are forced to take + this code path and rely on the below call to INIT_EXTR_FRAME_INFO + to initialize the inner-most frame. */ + if (INIT_EXTRA_FRAME_INFO_P ()) + { + gdb_assert (prev_frame->level == 0); + INIT_EXTRA_FRAME_INFO (0, prev_frame); + } + + return prev_frame; +} + CORE_ADDR get_frame_pc (struct frame_info *frame) { @@ -1275,6 +1436,7 @@ void deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) { /* See comment in "frame.h". */ + gdb_assert (frame->next != NULL); frame->pc = pc; } @@ -1357,4 +1519,21 @@ void _initialize_frame (void) { obstack_init (&frame_cache_obstack); + + /* FIXME: cagney/2003-01-19: This command needs a rename. Suggest + `set backtrace {past,beyond,...}-main'. Also suggest adding `set + backtrace ...-start' to control backtraces past start. The + problem with `below' is that it stops the `up' command. */ + + add_setshow_boolean_cmd ("backtrace-below-main", class_obscure, + &backtrace_below_main, "\ +Set whether backtraces should continue past \"main\".\n\ +Normally the caller of \"main\" is not of interest, so GDB will terminate\n\ +the backtrace at \"main\". Set this variable if you need to see the rest\n\ +of the stack trace.", "\ +Show whether backtraces should continue past \"main\".\n\ +Normally the caller of \"main\" is not of interest, so GDB will terminate\n\ +the backtrace at \"main\". Set this variable if you need to see the rest\n\ +of the stack trace.", + NULL, NULL, &setlist, &showlist); } diff --git a/gdb/frame.h b/gdb/frame.h index fbe6275..8169173 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -24,6 +24,10 @@ #define FRAME_H 1 struct symtab_and_line; +struct frame_unwind; + +/* The traditional frame unwinder. */ +extern const struct frame_unwind *trad_frame_unwind; /* The frame object. */ @@ -259,6 +263,9 @@ extern void frame_register_unwind (struct frame_info *frame, int regnum, /* NOTE: cagney/2002-09-13: Return void as one day these functions may be changed to return an indication that the read succeeded. */ +extern void frame_unwind_register (struct frame_info *frame, + int regnum, void *buf); + extern void frame_unwind_signed_register (struct frame_info *frame, int regnum, LONGEST *val); @@ -279,6 +286,9 @@ extern void frame_register (struct frame_info *frame, int regnum, /* NOTE: cagney/2002-09-13: Return void as one day these functions may be changed to return an indication that the read succeeded. */ +extern void frame_read_register (struct frame_info *frame, int regnum, + void *buf); + extern void frame_read_signed_register (struct frame_info *frame, int regnum, LONGEST *val); @@ -287,9 +297,10 @@ extern void frame_read_unsigned_register (struct frame_info *frame, /* Map between a frame register number and its name. A frame register space is a superset of the cooked register space --- it also - includes builtin registers. */ + includes builtin registers. If NAMELEN is negative, use the NAME's + length when doing the comparison. */ -extern int frame_map_name_to_regnum (const char *name, int strlen); +extern int frame_map_name_to_regnum (const char *name, int namelen); extern const char *frame_map_regnum_to_name (int regnum); /* Unwind the PC. Strictly speaking return the resume address of the @@ -302,41 +313,9 @@ extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); caller's frame. */ extern struct frame_id frame_id_unwind (struct frame_info *frame); - -/* Return the location (and possibly value) of REGNUM for the previous - (older, up) frame. All parameters except VALUEP can be assumed to - be non NULL. When VALUEP is NULL, just the location of the - register should be returned. - - UNWIND_CACHE is provided as mechanism for implementing a per-frame - local cache. It's initial value being NULL. Memory for that cache - should be allocated using frame_obstack_zalloc(). - - Register window architectures (eg SPARC) should note that REGNUM - identifies the register for the previous frame. For instance, a - request for the value of "o1" for the previous frame would be found - in the register "i1" in this FRAME. */ - -typedef void (frame_register_unwind_ftype) (struct frame_info *frame, - void **unwind_cache, - int regnum, - int *optimized, - enum lval_type *lvalp, - CORE_ADDR *addrp, - int *realnump, - void *valuep); - -/* Same as for registers above, but return the address at which the - calling frame would resume. */ - -typedef CORE_ADDR (frame_pc_unwind_ftype) (struct frame_info *frame, - void **unwind_cache); - -/* Same as for registers above, but return the ID of the frame that - called this one. */ - -typedef struct frame_id (frame_id_unwind_ftype) (struct frame_info *frame, - void **unwind_cache); +/* Discard the specified frame. Restoring the registers to the state + of the caller. */ +extern void frame_pop (struct frame_info *frame); /* Describe the saved registers of a frame. */ @@ -425,18 +404,14 @@ struct frame_info better all agree as to the contents. */ void *unwind_cache; - /* See description above. The previous frame's registers. */ - frame_register_unwind_ftype *register_unwind; + /* The frame's unwinder. */ + const struct frame_unwind *unwind; - /* See description above. The previous frame's resume address. - Save the previous PC in a local cache. */ - frame_pc_unwind_ftype *pc_unwind; + /* Cached copy of the previous frame's resume address. */ int pc_unwind_cache_p; CORE_ADDR pc_unwind_cache; - /* See description above. The previous frame's resume address. - Save the previous PC in a local cache. */ - frame_id_unwind_ftype *id_unwind; + /* Cached copy of the previous frame's ID. */ int id_unwind_cache_p; struct frame_id id_unwind_cache; @@ -477,6 +452,7 @@ enum print_what allocate memory using this method. */ extern void *frame_obstack_zalloc (unsigned long size); +#define FRAME_OBSTACK_ZALLOC(TYPE) ((TYPE *) frame_obstack_zalloc (sizeof (TYPE))) /* If FRAME_CHAIN_VALID returns zero it means that the given frame is the outermost one and has no caller. */ @@ -546,8 +522,6 @@ extern void show_and_print_stack_frame (struct frame_info *fi, int level, extern void print_stack_frame (struct frame_info *, int, int); -extern void print_only_stack_frame (struct frame_info *, int, int); - extern void show_stack_frame (struct frame_info *); extern void print_frame_info (struct frame_info *, int, int, int); @@ -595,6 +569,16 @@ extern void get_saved_register (char *raw_buffer, int *optimized, struct frame_info *frame, int regnum, enum lval_type *lval); +/* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a + function called frame_read_register_p(). This slightly weird (and + older) variant of frame_read_register() returns zero (indicating + the register is unavailable) if either: the register isn't cached; + or the register has been optimized out. Problem is, neither check + is exactly correct. A register can't be optimized out (it may not + have been saved as part of a function call); The fact that a + register isn't in the register cache doesn't mean that the register + isn't available (it could have been fetched from memory). */ + extern int frame_register_read (struct frame_info *frame, int regnum, void *buf); diff --git a/gdb/gcore.c b/gdb/gcore.c index a2f10d7..5ad17e8 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -1,5 +1,6 @@ /* Generate a core file for the inferior process. - Copyright 2001, 2002 Free Software Foundation, Inc. + + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/gdb-stabs.h b/gdb/gdb-stabs.h index d2da2d1..abe2d33 100644 --- a/gdb/gdb-stabs.h +++ b/gdb/gdb-stabs.h @@ -70,6 +70,9 @@ struct dbx_symfile_info asection *text_section; asection *data_section; asection *bss_section; + + /* Pointer to the separate ".stab" section, if there is one. */ + asection *stab_section; }; #define DBX_SYMFILE_INFO(o) ((o)->sym_stab_info) @@ -83,5 +86,6 @@ struct dbx_symfile_info #define DBX_TEXT_SECTION(o) (DBX_SYMFILE_INFO(o)->text_section) #define DBX_DATA_SECTION(o) (DBX_SYMFILE_INFO(o)->data_section) #define DBX_BSS_SECTION(o) (DBX_SYMFILE_INFO(o)->bss_section) +#define DBX_STAB_SECTION(o) (DBX_SYMFILE_INFO(o)->stab_section) #endif /* GDBSTABS_H */ diff --git a/gdb/gdb_dirent.h b/gdb/gdb_dirent.h index eb14767..ba28ca5 100644 --- a/gdb/gdb_dirent.h +++ b/gdb/gdb_dirent.h @@ -23,11 +23,11 @@ /* See description of `AC_HEADER_DIRENT' in the Autoconf manual. */ #ifdef HAVE_DIRENT_H -# include -# define NAMELEN(dirent) strlen((dirent)->d_name) +# include /* OK: dirent.h */ +# define NAMELEN(dirent) strlen ((dirent)->d_name) /* OK: strlen d_name */ #else # define dirent direct -# define NAMELEN(dirent) (dirent)->d_namelen +# define NAMELEN(dirent) (dirent)->d_namelen /* OK: d_namelen */ # ifdef HAVE_SYS_NDIR_H # include # endif diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh index c47ef95..ee0d0fb 100755 --- a/gdb/gdb_indent.sh +++ b/gdb/gdb_indent.sh @@ -36,12 +36,29 @@ fi # Check that the indent found is both GNU and a reasonable version. # Different indent versions give different indentation. -case `${indent} --version 2>/dev/null < /dev/null` in - GNU*2.2* ) ;; - *GNU* ) echo "Incorrect version of GNU indent" 1>&2 ;; - * ) echo "Indent is not GNU" 1>&2 ;; +m1=2 +m2=2 +m3=9 + +version=`${indent} --version 2>/dev/null < /dev/null` +case "${version}" in + *GNU* ) ;; + * ) echo "error: GNU indent $m1.$m2.$m3 expected" 1>&2 ; exit 1;; esac +v1=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\1/'` +v2=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\2/'` +v3=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3/'` + +if test $m1 -ne $v1 -o $m2 -ne $v2 -o $m3 -gt $v3 +then + echo "error: Must be GNU indent version $m1.$m2.$m3 or later" 1>&2 + exit 1 +fi +if test $m3 -ne $v3 +then + echo "warning: GNU indent version $m1.$m2.$m3 recommended" 1>&2 +fi # Check that we're in the GDB source directory @@ -56,6 +73,7 @@ esac types="\ -T FILE \ +-T bfd -T asection \ -T prgregset_t -T fpregset_t -T gregset_t \ `cat *.h | sed -n \ -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \ diff --git a/gdb/gdb_mbuild.sh b/gdb/gdb_mbuild.sh index a108de0..a23ea5e 100755 --- a/gdb/gdb_mbuild.sh +++ b/gdb/gdb_mbuild.sh @@ -3,7 +3,7 @@ # Multi-build script for testing compilation of all maintained # configs of GDB. -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 2002, 2003 Free Software Foundation, Inc. # Contributed by Richard Earnshaw (rearnsha@arm.com) diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 9519bb3..10f6397 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -728,9 +728,7 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->push_dummy_frame == 0)) fprintf_unfiltered (log, "\n\tpush_dummy_frame"); /* Skip verify of push_return_address, has predicate */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->pop_frame == 0)) - fprintf_unfiltered (log, "\n\tpop_frame"); + /* Skip verify of pop_frame, has predicate */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->store_struct_return == 0)) fprintf_unfiltered (log, "\n\tstore_struct_return"); @@ -739,9 +737,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* 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 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_init_saved_regs == 0)) - fprintf_unfiltered (log, "\n\tframe_init_saved_regs"); + /* Skip verify of frame_init_saved_regs, has predicate */ /* Skip verify of init_extra_frame_info, has predicate */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->skip_prologue == 0)) @@ -765,13 +761,9 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->frame_args_skip == -1)) fprintf_unfiltered (log, "\n\tframe_args_skip"); /* Skip verify of frameless_function_invocation, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_chain == 0)) - fprintf_unfiltered (log, "\n\tframe_chain"); + /* Skip verify of frame_chain, has predicate */ /* Skip verify of frame_chain_valid, has predicate */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_saved_pc == 0)) - fprintf_unfiltered (log, "\n\tframe_saved_pc"); + /* Skip verify of frame_saved_pc, has predicate */ /* Skip verify of frame_args_address, invalid_p == 0 */ /* Skip verify of frame_locals_address, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) @@ -990,7 +982,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n", XSTRING (CALL_DUMMY_LENGTH)); - if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END) + if (gdbarch->call_dummy_length >= 0) fprintf_unfiltered (file, "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n", CALL_DUMMY_LENGTH); @@ -1433,6 +1425,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", (long) FRAME_ARGS_SKIP); #endif +#ifdef FRAME_CHAIN_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "FRAME_CHAIN_P()", + XSTRING (FRAME_CHAIN_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: FRAME_CHAIN_P() = %d\n", + FRAME_CHAIN_P ()); +#endif #ifdef FRAME_CHAIN fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1464,6 +1465,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->frame_chain_valid /*FRAME_CHAIN_VALID ()*/); #endif +#ifdef FRAME_INIT_SAVED_REGS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "FRAME_INIT_SAVED_REGS_P()", + XSTRING (FRAME_INIT_SAVED_REGS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: FRAME_INIT_SAVED_REGS_P() = %d\n", + FRAME_INIT_SAVED_REGS_P ()); +#endif #ifdef FRAME_INIT_SAVED_REGS #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1500,6 +1510,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->frame_num_args /*FRAME_NUM_ARGS ()*/); #endif +#ifdef FRAME_SAVED_PC_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "FRAME_SAVED_PC_P()", + XSTRING (FRAME_SAVED_PC_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: FRAME_SAVED_PC_P() = %d\n", + FRAME_SAVED_PC_P ()); +#endif #ifdef FRAME_SAVED_PC fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1754,6 +1773,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->pointer_to_address /*POINTER_TO_ADDRESS ()*/); #endif +#ifdef POP_FRAME_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "POP_FRAME_P()", + XSTRING (POP_FRAME_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: POP_FRAME_P() = %d\n", + POP_FRAME_P ()); +#endif #ifdef POP_FRAME #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -4171,6 +4199,13 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch->push_return_address = push_return_address; } +int +gdbarch_pop_frame_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->pop_frame != 0; +} + void gdbarch_pop_frame (struct gdbarch *gdbarch) { @@ -4356,6 +4391,13 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch->use_struct_convention = use_struct_convention; } +int +gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->frame_init_saved_regs != 0; +} + void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) { @@ -4629,6 +4671,13 @@ set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch->frameless_function_invocation = frameless_function_invocation; } +int +gdbarch_frame_chain_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->frame_chain != 0; +} + CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) { @@ -4674,6 +4723,13 @@ set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch->frame_chain_valid = frame_chain_valid; } +int +gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->frame_saved_pc != 0; +} + CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index bc5d9ca..0680916 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -111,7 +111,7 @@ extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch); /* Number of bits in a char or unsigned char for the target machine. Just like CHAR_BIT in but describes the target machine. - v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: + v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: Number of bits in a short or unsigned short for the target machine. */ @@ -1278,11 +1278,9 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) #error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE) +#if !defined (BELIEVE_PCC_PROMOTION_TYPE) #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) #endif -#endif #if defined (GET_SAVED_REGISTER) /* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */ @@ -1577,6 +1575,32 @@ extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_pu #endif #endif +#if defined (POP_FRAME) +/* Legacy for systems yet to multi-arch POP_FRAME */ +#if !defined (POP_FRAME_P) +#define POP_FRAME_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME_P) +#define POP_FRAME_P() (0) +#endif + +extern int gdbarch_pop_frame_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME_P) +#error "Non multi-arch definition of POP_FRAME" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME_P) +#define POP_FRAME_P() (gdbarch_pop_frame_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME) +#define POP_FRAME (internal_error (__FILE__, __LINE__, "POP_FRAME"), 0) +#define POP_FRAME (gdbarch_pop_frame (current_gdbarch)) +#endif + typedef void (gdbarch_pop_frame_ftype) (void); extern void gdbarch_pop_frame (struct gdbarch *gdbarch); extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame); @@ -1750,6 +1774,31 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_ #endif #endif +#if defined (FRAME_INIT_SAVED_REGS) +/* Legacy for systems yet to multi-arch FRAME_INIT_SAVED_REGS */ +#if !defined (FRAME_INIT_SAVED_REGS_P) +#define FRAME_INIT_SAVED_REGS_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_INIT_SAVED_REGS_P) +#define FRAME_INIT_SAVED_REGS_P() (0) +#endif + +extern int gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS_P) +#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS_P) +#define FRAME_INIT_SAVED_REGS_P() (gdbarch_frame_init_saved_regs_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_INIT_SAVED_REGS) +#define FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "FRAME_INIT_SAVED_REGS"), 0) +#endif + typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); @@ -1975,6 +2024,31 @@ extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, #endif #endif +#if defined (FRAME_CHAIN) +/* Legacy for systems yet to multi-arch FRAME_CHAIN */ +#if !defined (FRAME_CHAIN_P) +#define FRAME_CHAIN_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_P) +#define FRAME_CHAIN_P() (0) +#endif + +extern int gdbarch_frame_chain_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_P) +#error "Non multi-arch definition of FRAME_CHAIN" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_P) +#define FRAME_CHAIN_P() (gdbarch_frame_chain_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN) +#define FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "FRAME_CHAIN"), 0) +#endif + typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); @@ -2024,6 +2098,31 @@ extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_fram #endif #endif +#if defined (FRAME_SAVED_PC) +/* Legacy for systems yet to multi-arch FRAME_SAVED_PC */ +#if !defined (FRAME_SAVED_PC_P) +#define FRAME_SAVED_PC_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_SAVED_PC_P) +#define FRAME_SAVED_PC_P() (0) +#endif + +extern int gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC_P) +#error "Non multi-arch definition of FRAME_SAVED_PC" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC_P) +#define FRAME_SAVED_PC_P() (gdbarch_frame_saved_pc_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_SAVED_PC) +#define FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "FRAME_SAVED_PC"), 0) +#endif + typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 12131d8..2408299 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -85,7 +85,7 @@ EOF case "${level}" in 1 ) gt_level=">= GDB_MULTI_ARCH_PARTIAL" ;; 2 ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;; - "" ) ;; + "" ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;; * ) error "Error: bad level for ${function}" 1>&2 ; kill $$ ; exit 1 ;; esac @@ -391,23 +391,23 @@ i:2:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG i:2:TARGET_OSABI:enum gdb_osabi:osabi::::GDB_OSABI_UNKNOWN # Number of bits in a char or unsigned char for the target machine. # Just like CHAR_BIT in but describes the target machine. -# v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: +# v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0: # # Number of bits in a short or unsigned short for the target machine. -v::TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0 +v:2:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0 # Number of bits in an int or unsigned int for the target machine. -v::TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0 +v:2:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0 # Number of bits in a long or unsigned long for the target machine. -v::TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0 +v:2:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0 # Number of bits in a long long or unsigned long long for the target # machine. -v::TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0 +v:2:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0 # Number of bits in a float for the target machine. -v::TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0 +v:2:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0 # Number of bits in a double for the target machine. -v::TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0 +v:2:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0 # Number of bits in a long double for the target machine. -v::TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0 +v:2:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0 # For most targets, a pointer on the target and its representation as an # address in GDB have the same size and "look the same". For such a # target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT @@ -417,24 +417,24 @@ v::TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARG # also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well. # # ptr_bit is the size of a pointer on the target -v::TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0 +v:2:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0 # addr_bit is the size of a target address as represented in gdb -v::TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT: +v:2:TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT: # Number of bits in a BFD_VMA for the target object file format. -v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0 +v:2:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0 # # One if \`char' acts like \`signed char', zero if \`unsigned char'. -v::TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1:::: +v:2:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1:::: # -f::TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0 -f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0 -f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0 -f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0 -f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0 +f:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0 +f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0 +f:2:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0 +f:2:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0 +f:2:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0 # Function for getting target's idea of a frame pointer. FIXME: GDB's # whole scheme for dealing with "frames" and "frame pointers" needs a # serious shakedown. -f::TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0 +f:2:TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0 # M:::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf: M:::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf: @@ -502,7 +502,7 @@ f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_du v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1 -v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END +v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::gdbarch->call_dummy_length >= 0 # NOTE: cagney/2002-11-24: This function with predicate has a valid # (callable) initial value. As a consequence, even when the predicate # is false, the corresponding function works. This simplifies the @@ -516,10 +516,10 @@ v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0 F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev -F::DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev +F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev # v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: -v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: +v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: F:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval # f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0 @@ -538,20 +538,20 @@ f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::gen 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: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::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_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0 +f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0 +f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf +f:2: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 # -f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0 +F:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame:::0 F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0 # f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0 @@ -561,16 +561,16 @@ f:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1 -f::PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0 +f:2:PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0 v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1 # f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0 # v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1 f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0 -f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 +F:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0 -f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0 +F:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0 f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0 f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0 f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0 @@ -643,7 +643,7 @@ f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char # does not. f:2:PC_IN_SIGTRAMP:int:pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp::0 F:2:SIGTRAMP_START:CORE_ADDR:sigtramp_start:CORE_ADDR pc:pc -F::SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc +F:2:SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc # A target might have problems with watchpoints as soon as the stack # frame of the current function has been destroyed. This mostly happens # as the first action in a funtion's epilogue. in_function_epilogue_p() @@ -666,9 +666,9 @@ m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:construct_inferior_arguments:int argc, ch F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile:objfile:::0 f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0 f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0 -v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC -v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0 -v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0 +v:2:NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC +v:2:CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0 +v:2:HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0 F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags: M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr @@ -891,11 +891,18 @@ do printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n" printf "#error \"Non multi-arch definition of ${macro}\"\n" printf "#endif\n" - printf "#if GDB_MULTI_ARCH\n" - printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n" - printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" - printf "#endif\n" - printf "#endif\n" + if test "${level}" = "" + then + printf "#if !defined (${macro})\n" + printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" + printf "#endif\n" + else + printf "#if GDB_MULTI_ARCH\n" + printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n" + printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" + printf "#endif\n" + printf "#endif\n" + fi fi if class_is_function_p then @@ -907,7 +914,13 @@ do printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n" if [ "x${fallbackdefault}" = "x0" ] then - printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" + if [ "x${actual}" = "x-" ] + then + printf "#define ${macro} (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" + printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" + else + printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" + fi else # FIXME: Should be passing current_gdbarch through! echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \ diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index 5c10c58..e359b3d 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -70,8 +70,7 @@ extern void read_memory_string (CORE_ADDR, char *, int); /* Read the pointer of type TYPE at ADDR, and return the address it represents. */ -CORE_ADDR -read_memory_typed_address (CORE_ADDR addr, struct type *type); +CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type); /* This takes a char *, not void *. This is probably right, because passing in an int * or whatever is wrong with respect to diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 2a8817d..679822f 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1,5 +1,5 @@ /* Support routines for manipulating internal types for GDB. - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Support, using pieces from other GDB modules. @@ -128,9 +128,9 @@ struct extra static void add_name (struct extra *, char *); static void add_mangled_type (struct extra *, struct type *); -#if 0 -static void cfront_mangle_name (struct type *, int, int); -#endif +#if 0 /* OBSOLETE CFront */ +// OBSOLETE static void cfront_mangle_name (struct type *, int, int); +#endif /* OBSOLETE CFront */ static void print_bit_vector (B_TYPE *, int); static void print_arg_types (struct field *, int, int); static void dump_fn_fieldlists (struct type *, int); @@ -1021,7 +1021,7 @@ lookup_primitive_typename (char *name) for (p = current_language->la_builtin_type_vector; *p != NULL; p++) { - if (STREQ (TYPE_NAME (**p), name)) + if (strcmp (TYPE_NAME (**p), name) == 0) { return (**p); } @@ -1228,7 +1228,7 @@ lookup_struct_elt_type (struct type *type, char *name, int noerr) char *typename; typename = type_name_no_tag (type); - if (typename != NULL && STREQ (typename, name)) + if (typename != NULL && strcmp (typename, name) == 0) return type; } #endif @@ -1458,193 +1458,193 @@ check_typedef (struct type *type) return type; } -/* New code added to support parsing of Cfront stabs strings */ -#define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; } -#define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; } - -static void -add_name (struct extra *pextras, char *n) -{ - int nlen; - - if ((nlen = (n ? strlen (n) : 0)) == 0) - return; - sprintf (pextras->str + pextras->len, "%d%s", nlen, n); - pextras->len = strlen (pextras->str); -} - -static void -add_mangled_type (struct extra *pextras, struct type *t) -{ - enum type_code tcode; - int tlen, tflags; - char *tname; - - tcode = TYPE_CODE (t); - tlen = TYPE_LENGTH (t); - tflags = TYPE_FLAGS (t); - tname = TYPE_NAME (t); - /* args of "..." seem to get mangled as "e" */ - - switch (tcode) - { - case TYPE_CODE_INT: - if (tflags == 1) - ADD_EXTRA ('U'); - switch (tlen) - { - case 1: - ADD_EXTRA ('c'); - break; - case 2: - ADD_EXTRA ('s'); - break; - case 4: - { - char *pname; - if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long")) - { - ADD_EXTRA ('l'); - } - else - { - ADD_EXTRA ('i'); - } - } - break; - default: - { - complaint (&symfile_complaints, "Bad int type code length x%x", - tlen); - } - } - break; - case TYPE_CODE_FLT: - switch (tlen) - { - case 4: - ADD_EXTRA ('f'); - break; - case 8: - ADD_EXTRA ('d'); - break; - case 16: - ADD_EXTRA ('r'); - break; - default: - { - complaint (&symfile_complaints, "Bad float type code length x%x", - tlen); - } - } - break; - case TYPE_CODE_REF: - ADD_EXTRA ('R'); - /* followed by what it's a ref to */ - break; - case TYPE_CODE_PTR: - ADD_EXTRA ('P'); - /* followed by what it's a ptr to */ - break; - case TYPE_CODE_TYPEDEF: - { - complaint (&symfile_complaints, - "Typedefs in overloaded functions not yet supported"); - } - /* followed by type bytes & name */ - break; - case TYPE_CODE_FUNC: - ADD_EXTRA ('F'); - /* followed by func's arg '_' & ret types */ - break; - case TYPE_CODE_VOID: - ADD_EXTRA ('v'); - break; - case TYPE_CODE_METHOD: - ADD_EXTRA ('M'); - /* followed by name of class and func's arg '_' & ret types */ - add_name (pextras, tname); - ADD_EXTRA ('F'); /* then mangle function */ - break; - case TYPE_CODE_STRUCT: /* C struct */ - case TYPE_CODE_UNION: /* C union */ - case TYPE_CODE_ENUM: /* Enumeration type */ - /* followed by name of type */ - add_name (pextras, tname); - break; - - /* errors possible types/not supported */ - case TYPE_CODE_CHAR: - case TYPE_CODE_ARRAY: /* Array type */ - case TYPE_CODE_MEMBER: /* Member type */ - case TYPE_CODE_BOOL: - case TYPE_CODE_COMPLEX: /* Complex float */ - case TYPE_CODE_UNDEF: - case TYPE_CODE_SET: /* Pascal sets */ - case TYPE_CODE_RANGE: - case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: - case TYPE_CODE_ERROR: - default: - { - complaint (&symfile_complaints, "Unknown type code x%x", tcode); - } - } - if (TYPE_TARGET_TYPE (t)) - add_mangled_type (pextras, TYPE_TARGET_TYPE (t)); -} - -#if 0 -void -cfront_mangle_name (struct type *type, int i, int j) -{ - struct fn_field *f; - char *mangled_name = gdb_mangle_name (type, i, j); - - f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */ - - /* kludge to support cfront methods - gdb expects to find "F" for - ARM_mangled names, so when we mangle, we have to add it here */ - if (ARM_DEMANGLING) - { - int k; - char *arm_mangled_name; - struct fn_field *method = &f[j]; - char *field_name = TYPE_FN_FIELDLIST_NAME (type, i); - char *physname = TYPE_FN_FIELD_PHYSNAME (f, j); - char *newname = type_name_no_tag (type); - - struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); - int nargs = TYPE_NFIELDS (ftype); /* number of args */ - struct extra extras, *pextras = &extras; - INIT_EXTRA - - if (TYPE_FN_FIELD_STATIC_P (f, j)) /* j for sublist within this list */ - ADD_EXTRA ('S') - ADD_EXTRA ('F') - /* add args here! */ - if (nargs <= 1) /* no args besides this */ - ADD_EXTRA ('v') - else - { - for (k = 1; k < nargs; k++) - { - struct type *t; - t = TYPE_FIELD_TYPE (ftype, k); - add_mangled_type (pextras, t); - } - } - ADD_EXTRA ('\0') - printf ("add_mangled_type: %s\n", extras.str); /* FIXME */ - xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str); - xfree (mangled_name); - mangled_name = arm_mangled_name; - } -} -#endif /* 0 */ - -#undef ADD_EXTRA -/* End of new code added to support parsing of Cfront stabs strings */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* New code added to support parsing of Cfront stabs strings */ +// OBSOLETE #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; } +// OBSOLETE #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; } + +// OBSOLETE static void +// OBSOLETE add_name (struct extra *pextras, char *n) +// OBSOLETE { +// OBSOLETE int nlen; + +// OBSOLETE if ((nlen = (n ? strlen (n) : 0)) == 0) +// OBSOLETE return; +// OBSOLETE sprintf (pextras->str + pextras->len, "%d%s", nlen, n); +// OBSOLETE pextras->len = strlen (pextras->str); +// OBSOLETE } + +// OBSOLETE static void +// OBSOLETE add_mangled_type (struct extra *pextras, struct type *t) +// OBSOLETE { +// OBSOLETE enum type_code tcode; +// OBSOLETE int tlen, tflags; +// OBSOLETE char *tname; + +// OBSOLETE tcode = TYPE_CODE (t); +// OBSOLETE tlen = TYPE_LENGTH (t); +// OBSOLETE tflags = TYPE_FLAGS (t); +// OBSOLETE tname = TYPE_NAME (t); +// OBSOLETE /* args of "..." seem to get mangled as "e" */ + +// OBSOLETE switch (tcode) +// OBSOLETE { +// OBSOLETE case TYPE_CODE_INT: +// OBSOLETE if (tflags == 1) +// OBSOLETE ADD_EXTRA ('U'); +// OBSOLETE switch (tlen) +// OBSOLETE { +// OBSOLETE case 1: +// OBSOLETE ADD_EXTRA ('c'); +// OBSOLETE break; +// OBSOLETE case 2: +// OBSOLETE ADD_EXTRA ('s'); +// OBSOLETE break; +// OBSOLETE case 4: +// OBSOLETE { +// OBSOLETE char *pname; +// OBSOLETE if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long")) +// OBSOLETE { +// OBSOLETE ADD_EXTRA ('l'); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE ADD_EXTRA ('i'); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, "Bad int type code length x%x", +// OBSOLETE tlen); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_FLT: +// OBSOLETE switch (tlen) +// OBSOLETE { +// OBSOLETE case 4: +// OBSOLETE ADD_EXTRA ('f'); +// OBSOLETE break; +// OBSOLETE case 8: +// OBSOLETE ADD_EXTRA ('d'); +// OBSOLETE break; +// OBSOLETE case 16: +// OBSOLETE ADD_EXTRA ('r'); +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, "Bad float type code length x%x", +// OBSOLETE tlen); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_REF: +// OBSOLETE ADD_EXTRA ('R'); +// OBSOLETE /* followed by what it's a ref to */ +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_PTR: +// OBSOLETE ADD_EXTRA ('P'); +// OBSOLETE /* followed by what it's a ptr to */ +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_TYPEDEF: +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, +// OBSOLETE "Typedefs in overloaded functions not yet supported"); +// OBSOLETE } +// OBSOLETE /* followed by type bytes & name */ +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_FUNC: +// OBSOLETE ADD_EXTRA ('F'); +// OBSOLETE /* followed by func's arg '_' & ret types */ +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_VOID: +// OBSOLETE ADD_EXTRA ('v'); +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_METHOD: +// OBSOLETE ADD_EXTRA ('M'); +// OBSOLETE /* followed by name of class and func's arg '_' & ret types */ +// OBSOLETE add_name (pextras, tname); +// OBSOLETE ADD_EXTRA ('F'); /* then mangle function */ +// OBSOLETE break; +// OBSOLETE case TYPE_CODE_STRUCT: /* C struct */ +// OBSOLETE case TYPE_CODE_UNION: /* C union */ +// OBSOLETE case TYPE_CODE_ENUM: /* Enumeration type */ +// OBSOLETE /* followed by name of type */ +// OBSOLETE add_name (pextras, tname); +// OBSOLETE break; + +// OBSOLETE /* errors possible types/not supported */ +// OBSOLETE case TYPE_CODE_CHAR: +// OBSOLETE case TYPE_CODE_ARRAY: /* Array type */ +// OBSOLETE case TYPE_CODE_MEMBER: /* Member type */ +// OBSOLETE case TYPE_CODE_BOOL: +// OBSOLETE case TYPE_CODE_COMPLEX: /* Complex float */ +// OBSOLETE case TYPE_CODE_UNDEF: +// OBSOLETE case TYPE_CODE_SET: /* Pascal sets */ +// OBSOLETE case TYPE_CODE_RANGE: +// OBSOLETE case TYPE_CODE_STRING: +// OBSOLETE case TYPE_CODE_BITSTRING: +// OBSOLETE case TYPE_CODE_ERROR: +// OBSOLETE default: +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, "Unknown type code x%x", tcode); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE if (TYPE_TARGET_TYPE (t)) +// OBSOLETE add_mangled_type (pextras, TYPE_TARGET_TYPE (t)); +// OBSOLETE } + +// OBSOLETE void +// OBSOLETE cfront_mangle_name (struct type *type, int i, int j) +// OBSOLETE { +// OBSOLETE struct fn_field *f; +// OBSOLETE char *mangled_name = gdb_mangle_name (type, i, j); + +// OBSOLETE f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */ + +// OBSOLETE /* kludge to support cfront methods - gdb expects to find "F" for +// OBSOLETE ARM_mangled names, so when we mangle, we have to add it here */ +// OBSOLETE if (ARM_DEMANGLING) +// OBSOLETE { +// OBSOLETE int k; +// OBSOLETE char *arm_mangled_name; +// OBSOLETE struct fn_field *method = &f[j]; +// OBSOLETE char *field_name = TYPE_FN_FIELDLIST_NAME (type, i); +// OBSOLETE char *physname = TYPE_FN_FIELD_PHYSNAME (f, j); +// OBSOLETE char *newname = type_name_no_tag (type); + +// OBSOLETE struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); +// OBSOLETE int nargs = TYPE_NFIELDS (ftype); /* number of args */ +// OBSOLETE struct extra extras, *pextras = &extras; +// OBSOLETE INIT_EXTRA + +// OBSOLETE if (TYPE_FN_FIELD_STATIC_P (f, j)) /* j for sublist within this list */ +// OBSOLETE ADD_EXTRA ('S') +// OBSOLETE ADD_EXTRA ('F') +// OBSOLETE /* add args here! */ +// OBSOLETE if (nargs <= 1) /* no args besides this */ +// OBSOLETE ADD_EXTRA ('v') +// OBSOLETE else +// OBSOLETE { +// OBSOLETE for (k = 1; k < nargs; k++) +// OBSOLETE { +// OBSOLETE struct type *t; +// OBSOLETE t = TYPE_FIELD_TYPE (ftype, k); +// OBSOLETE add_mangled_type (pextras, t); +// OBSOLETE } +// OBSOLETE } +// OBSOLETE ADD_EXTRA ('\0') +// OBSOLETE printf ("add_mangled_type: %s\n", extras.str); /* FIXME */ +// OBSOLETE xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str); +// OBSOLETE xfree (mangled_name); +// OBSOLETE mangled_name = arm_mangled_name; +// OBSOLETE } +// OBSOLETE } + +// OBSOLETE #undef ADD_EXTRA +// OBSOLETE /* End of new code added to support parsing of Cfront stabs strings */ +#endif /* OBSOLETE CFront */ /* Parse a type expression in the string [P..P+LENGTH). If an error occurs, silently return builtin_type_void. */ @@ -1874,6 +1874,9 @@ init_type (enum type_code code, int length, int flags, char *name, /* C++ fancies. */ + if (name && strcmp (name, "char") == 0) + TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN; + if (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION) { INIT_CPLUS_SPECIFIC (type); @@ -2441,6 +2444,43 @@ rank_function (struct type **parms, int nparms, struct type **args, int nargs) return bv; } +/* Compare the names of two integer types, assuming that any sign + qualifiers have been checked already. We do it this way because + there may be an "int" in the name of one of the types. */ + +static int +integer_types_same_name_p (const char *first, const char *second) +{ + int first_p, second_p; + + /* If both are shorts, return 1; if neither is a short, keep checking. */ + first_p = (strstr (first, "short") != NULL); + second_p = (strstr (second, "short") != NULL); + if (first_p && second_p) + return 1; + if (first_p || second_p) + return 0; + + /* Likewise for long. */ + first_p = (strstr (first, "long") != NULL); + second_p = (strstr (second, "long") != NULL); + if (first_p && second_p) + return 1; + if (first_p || second_p) + return 0; + + /* Likewise for char. */ + first_p = (strstr (first, "char") != NULL); + second_p = (strstr (second, "char") != NULL); + if (first_p && second_p) + return 1; + if (first_p || second_p) + return 0; + + /* They must both be ints. */ + return 1; +} + /* Compare one type (PARM) for compatibility with another (ARG). * PARM is intended to be the parameter type of a function; and * ARG is the supplied argument's type. This function tests if @@ -2557,16 +2597,19 @@ rank_one_type (struct type *parm, struct type *arg) { if (TYPE_UNSIGNED (arg)) { - if (!strcmp_iw (TYPE_NAME (parm), TYPE_NAME (arg))) - return 0; /* unsigned int -> unsigned int, or unsigned long -> unsigned long */ - else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (TYPE_NAME (parm), "long")) + /* unsigned int -> unsigned int, or unsigned long -> unsigned long */ + if (integer_types_same_name_p (TYPE_NAME (parm), TYPE_NAME (arg))) + return 0; + else if (integer_types_same_name_p (TYPE_NAME (arg), "int") + && integer_types_same_name_p (TYPE_NAME (parm), "long")) return INTEGER_PROMOTION_BADNESS; /* unsigned int -> unsigned long */ else return INTEGER_COERCION_BADNESS; /* unsigned long -> unsigned int */ } else { - if (!strcmp_iw (TYPE_NAME (arg), "long") && !strcmp_iw (TYPE_NAME (parm), "int")) + if (integer_types_same_name_p (TYPE_NAME (arg), "long") + && integer_types_same_name_p (TYPE_NAME (parm), "int")) return INTEGER_COERCION_BADNESS; /* signed long -> unsigned int */ else return INTEGER_CONVERSION_BADNESS; /* signed int/long -> unsigned int/long */ @@ -2574,9 +2617,10 @@ rank_one_type (struct type *parm, struct type *arg) } else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg)) { - if (!strcmp_iw (TYPE_NAME (parm), TYPE_NAME (arg))) + if (integer_types_same_name_p (TYPE_NAME (parm), TYPE_NAME (arg))) return 0; - else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (TYPE_NAME (parm), "long")) + else if (integer_types_same_name_p (TYPE_NAME (arg), "int") + && integer_types_same_name_p (TYPE_NAME (parm), "long")) return INTEGER_PROMOTION_BADNESS; else return INTEGER_COERCION_BADNESS; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 4c754d6..30cdb5f 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1,6 +1,8 @@ /* Internal type definitions for GDB. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support, using pieces from other GDB modules. This file is part of GDB. @@ -1100,8 +1102,7 @@ smash_to_method_type (struct type *type, struct type *domain, struct type *to_type, struct field *args, int nargs, int varargs); -extern void -smash_to_member_type (struct type *, struct type *, struct type *); +extern void smash_to_member_type (struct type *, struct type *, struct type *); extern struct type *allocate_stub_method (struct type *); diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 8ac7811..cb80c95 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -1,6 +1,8 @@ /* Abstraction of GNU v2 abi. + + Copyright 2001, 2003 Free Software Foundation, Inc. + Contributed by Daniel Berlin - Copyright 2001 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/hp300ux-nat.c b/gdb/hp300ux-nat.c deleted file mode 100644 index 7ef3e34..0000000 --- a/gdb/hp300ux-nat.c +++ /dev/null @@ -1,226 +0,0 @@ -/* HP/UX native interface for HP 300's, for GDB when running under Unix. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 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 "regcache.h" - -/* Defining this means some system include files define some extra stuff. */ -#define WOPR -#include -#include -#include -#include - -#include -#include -#include - -#include - -static void fetch_inferior_register (int, unsigned int); - -static void store_inferior_register_1 (int, unsigned int, int); - -static void store_inferior_register (int, unsigned int); - -/* Get kernel_u_addr using HPUX-style nlist(). */ -CORE_ADDR kernel_u_addr; - -struct hpnlist - { - char *n_name; - long n_value; - unsigned char n_type; - unsigned char n_length; - short n_almod; - short n_unused; - }; -static struct hpnlist nl[] = -{ - {"_u", -1,}, - {(char *) 0,}}; - -/* read the value of the u area from the hp-ux kernel */ -void -_initialize_hp300ux_nat (void) -{ -#ifndef HPUX_VERSION_5 - nlist ("/hp-ux", nl); - kernel_u_addr = nl[0].n_value; -#else /* HPUX version 5. */ - kernel_u_addr = (CORE_ADDR) 0x0097900; -#endif -} - -#define INFERIOR_AR0(u) \ - ((ptrace \ - (PT_RUAREA, PIDGET (inferior_ptid), \ - (PTRACE_ARG3_TYPE) ((char *) &u.u_ar0 - (char *) &u), 0, 0)) \ - - kernel_u_addr) - -static void -fetch_inferior_register (register int regno, register unsigned int regaddr) -{ -#ifndef HPUX_VERSION_5 - if (regno == PS_REGNUM) - { - union - { - int i; - short s[2]; - } - ps_val; - int regval; - - ps_val.i = (ptrace (PT_RUAREA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) regaddr, 0, 0)); - regval = ps_val.s[0]; - supply_register (regno, (char *) ®val); - } - else -#endif /* not HPUX_VERSION_5 */ - { - char buf[MAX_REGISTER_RAW_SIZE]; - register int i; - - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - *(int *) &buf[i] = ptrace (PT_RUAREA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) regaddr, 0, 0); - regaddr += sizeof (int); - } - supply_register (regno, buf); - } - return; -} - -static void -store_inferior_register_1 (int regno, unsigned int regaddr, int val) -{ - errno = 0; - ptrace (PT_WUAREA, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, - val, 0); -#if 0 - /* HP-UX randomly sets errno to non-zero for regno == 25. - However, the value is correctly written, so ignore errno. */ - if (errno != 0) - { - char string_buf[64]; - - sprintf (string_buf, "writing register number %d", regno); - perror_with_name (string_buf); - } -#endif - return; -} - -static void -store_inferior_register (register int regno, register unsigned int regaddr) -{ -#ifndef HPUX_VERSION_5 - if (regno == PS_REGNUM) - { - union - { - int i; - short s[2]; - } - ps_val; - - ps_val.i = (ptrace (PT_RUAREA, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) regaddr, 0, 0)); - ps_val.s[0] = (read_register (regno)); - store_inferior_register_1 (regno, regaddr, ps_val.i); - } - else -#endif /* not HPUX_VERSION_5 */ - { - register int i; - - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - store_inferior_register_1 - (regno, regaddr, - (*(int *) &deprecated_registers[(REGISTER_BYTE (regno)) + i])); - regaddr += sizeof (int); - } - } - return; -} - -void -fetch_inferior_registers (int regno) -{ - struct user u; - register unsigned int ar0_offset; - - ar0_offset = (INFERIOR_AR0 (u)); - if (regno == -1) - { - for (regno = 0; (regno < FP0_REGNUM); regno++) - fetch_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); - for (; (regno < NUM_REGS); regno++) - fetch_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); - } - else - fetch_inferior_register (regno, - (regno < FP0_REGNUM - ? REGISTER_ADDR (ar0_offset, regno) - : FP_REGISTER_ADDR (u, regno))); -} - -/* 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 (register int regno) -{ - struct user u; - register unsigned int ar0_offset; - - if (regno >= FP0_REGNUM) - { - store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); - return; - } - - ar0_offset = (INFERIOR_AR0 (u)); - if (regno >= 0) - { - store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); - return; - } - - for (regno = 0; (regno < FP0_REGNUM); regno++) - store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); - for (; (regno < NUM_REGS); regno++) - store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); - return; -} - -int -getpagesize (void) -{ - return 4096; -} diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 6364dbc..db497ef 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -184,7 +184,7 @@ typedef struct } args_for_find_stub; -static int cover_find_stub_with_shl_get (PTR); +static int cover_find_stub_with_shl_get (void *); static int is_pa_2 = 0; /* False */ @@ -373,7 +373,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, if (TARGET_PTR_BIT == 64 && text_offset == 0) { bfd_map_over_sections (objfile->obfd, - record_text_segment_lowaddr, (PTR) NULL); + record_text_segment_lowaddr, NULL); /* ?!? Mask off some low bits. Should this instead subtract out the lowest section's filepos or something like that? @@ -574,7 +574,7 @@ read_unwind_info (struct objfile *objfile) obj_private->so_info = NULL; obj_private->dp = 0; - objfile->obj_private = (PTR) obj_private; + objfile->obj_private = obj_private; } obj_private = (obj_private_data_t *) objfile->obj_private; obj_private->unwind_info = ui; @@ -2032,7 +2032,7 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle) /* Cover routine for find_stub_with_shl_get to pass to catch_errors */ static int -cover_find_stub_with_shl_get (PTR args_untyped) +cover_find_stub_with_shl_get (void *args_untyped) { args_for_find_stub *args = args_untyped; args->return_val = find_stub_with_shl_get (args->msym, args->solib_handle); @@ -2636,7 +2636,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val) int start; - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); long long reg_val; if (!know_which) @@ -2833,8 +2833,8 @@ pa_strcat_registers (char *raw_regs, int regnum, int fpregs, static void pa_print_fp_reg (int i) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; - char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; + char *raw_buffer = alloca (max_register_size (current_gdbarch)); + char *virtual_buffer = alloca (max_register_size (current_gdbarch)); /* Get 32bits of data. */ frame_register_read (deprecated_selected_frame, i, raw_buffer); @@ -2876,8 +2876,8 @@ pa_print_fp_reg (int i) static void pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; - char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; + char *raw_buffer = alloca (max_register_size (current_gdbarch)); + char *virtual_buffer = alloca (max_register_size (current_gdbarch)); fputs_filtered (REGISTER_NAME (i), stream); print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream); @@ -2891,7 +2891,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) if (precision == double_precision && (i % 2) == 0) { - char raw_buf[MAX_REGISTER_RAW_SIZE]; + char *raw_buf = alloca (max_register_size (current_gdbarch)); /* Get the data in raw format for the 2nd half. */ frame_register_read (deprecated_selected_frame, i + 1, raw_buf); @@ -4300,7 +4300,7 @@ initialize_hp_cxx_exception_support (void) args.return_val = 0; recurse++; - catch_errors (cover_find_stub_with_shl_get, (PTR) &args, message, + catch_errors (cover_find_stub_with_shl_get, &args, message, RETURN_MASK_ALL); eh_notify_callback_addr = args.return_val; recurse--; @@ -4555,6 +4555,16 @@ child_get_current_exception_event (void) return ¤t_ex_event; } +/* Instead of this nasty cast, add a method pvoid() that prints out a + host VOID data type (remember %p isn't portable). */ + +static CORE_ADDR +hppa_pointer_to_address_hack (void *ptr) +{ + gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); + return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr); +} + static void unwind_command (char *exp, int from_tty) { @@ -4577,7 +4587,7 @@ unwind_command (char *exp, int from_tty) } printf_unfiltered ("unwind_table_entry (0x%s):\n", - paddr_nz (host_pointer_to_address (u))); + paddr_nz (hppa_pointer_to_address_hack (u))); printf_unfiltered ("\tregion_start = "); print_address (u->region_start, gdb_stdout); diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c index d859587..3ec3a57 100644 --- a/gdb/hppab-nat.c +++ b/gdb/hppab-nat.c @@ -55,7 +55,7 @@ static void fetch_register (int regno) { register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); register int i; /* Offset of registers within the u area. */ diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 84d1f3f..51b74fc 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -189,7 +189,7 @@ store_inferior_registers (int regno) static void fetch_register (int regno) { - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); unsigned int addr, len, offset; int i; @@ -1334,7 +1334,7 @@ child_pid_to_exec_file (int pid) int name_index; int i; ptid_t saved_inferior_ptid; - boolean done; + int done; #ifdef PT_GET_PROCESS_PATHNAME /* As of 10.x HP-UX, there's an explicit request to get the pathname. */ diff --git a/gdb/hpread.c b/gdb/hpread.c index 0323f02..bf53266 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -87,23 +87,6 @@ struct hpread_symfile_info #define WITHIN_FUNCTION(o) (HPUX_SYMFILE_INFO(o)->within_function) #define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value) -/* Given the native debug symbol SYM, set NAMEP to the name associated - with the debug symbol. Note we may be called with a debug symbol which - has no associated name, in that case we return an empty string. - - Also note we "know" that the name for any symbol is always in the - same place. Hence we don't have to conditionalize on the symbol type. */ -#define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \ - if (! hpread_has_name ((SYM)->dblock.kind)) \ - *NAMEP = ""; \ - else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \ - { \ - complaint (&symfile_complaints, "bad string table offset in symbol %d", \ - (char *) symnum); \ - *NAMEP = ""; \ - } \ - else \ - *NAMEP = (SYM)->dsfile.name + VT (OBJFILE) /* We put a pointer to this structure in the read_symtab_private field of the psymtab. */ @@ -155,6 +138,9 @@ lbrac_mismatch_complaint (int arg1) /* Forward procedure declarations */ +static void set_namestring (union dnttentry *sym, char **namep, + struct objfile *objfile); + void hpread_symfile_init (struct objfile *); void do_pxdb (bfd *); @@ -302,6 +288,28 @@ trans_lang (enum hp_language in_lang) static char main_string[] = "main"; + +/* Given the native debug symbol SYM, set NAMEP to the name associated + with the debug symbol. Note we may be called with a debug symbol which + has no associated name, in that case we return an empty string. */ + +static void +set_namestring (union dnttentry *sym, char **namep, struct objfile *objfile) +{ + /* Note that we "know" that the name for any symbol is always in the same + place. Hence we don't have to conditionalize on the symbol type. */ + if (! hpread_has_name (sym->dblock.kind)) + *namep = ""; + else if ((unsigned) sym->dsfile.name >= VT_SIZE (objfile)) + { + complaint (&symfile_complaints, "bad string table offset in symbol %d", + symnum); + *namep = ""; + } + else + *namep = sym->dsfile.name + VT (objfile); +} + /* Call PXDB to process our file. Approach copied from DDE's "dbgk_run_pxdb". Note: we @@ -1656,7 +1664,7 @@ hpread_symfile_init (struct objfile *objfile) asection *vt_section, *slt_section, *lntt_section, *gntt_section; /* Allocate struct to keep track of the symfile */ - objfile->sym_private = (PTR) + objfile->sym_private = xmmalloc (objfile->md, sizeof (struct hpread_symfile_info)); memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info)); @@ -1917,7 +1925,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) /* A source file of some kind. Note this may simply be an included file. */ - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); /* Check if this is the source file we are already working with. */ @@ -1951,7 +1959,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - memcpy ((PTR) psymtab_include_list, (PTR) orig, + memcpy (psymtab_include_list, orig, includes_used * sizeof (char *)); } continue; @@ -2022,7 +2030,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) } /* Now begin a new module and a new psymtab for it */ - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); valu = hpread_get_textlow (i, hp_symnum, objfile, symcount); valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (!pst) @@ -2048,7 +2056,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) texthigh = valu; valu = dn_bufp->dfunc.lowaddr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); if (dn_bufp->dfunc.global) add_psymbol_to_list (namestring, strlen (namestring), VAR_NAMESPACE, LOC_BLOCK, @@ -2069,7 +2077,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) texthigh = valu; valu = dn_bufp->ddocfunc.lowaddr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); if (dn_bufp->ddocfunc.global) add_psymbol_to_list (namestring, strlen (namestring), VAR_NAMESPACE, LOC_BLOCK, @@ -2143,7 +2151,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) else storage = LOC_UNDEF; - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); if (!pst) { pst = hpread_start_psymtab (objfile, @@ -2227,7 +2235,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) case DNTT_TYPE_MEMENUM: case DNTT_TYPE_CONST: /* Constants and members of enumerated types. */ - SET_NAMESTRING (dn_bufp, &namestring, objfile); + set_namestring (dn_bufp, &namestring, objfile); if (!pst) { pst = hpread_start_psymtab (objfile, @@ -2827,8 +2835,8 @@ hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size, if (dn_bufp->dblock.extension) continue; - /* Yow! We call SET_NAMESTRING on things without names! */ - SET_NAMESTRING (dn_bufp, &namestring, objfile); + /* Yow! We call set_namestring on things without names! */ + set_namestring (dn_bufp, &namestring, objfile); hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets, objfile, text_offset, text_size, @@ -5233,7 +5241,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* Stack must be empty now. */ if (context_stack_depth != 0) - lbrac_unmatched_complaint ((char *) symnum); + lbrac_unmatched_complaint (symnum); new = push_context (0, valu); /* Built a type for the function. This includes processing @@ -5244,8 +5252,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* All functions in C++ have prototypes. For C we don't have enough information in the debug info. */ - if (SYMBOL_LANGUAGE (s) == language_cplus) - TYPE_FLAGS (SYMBOL_TYPE (s)) |= TYPE_FLAG_PROTOTYPED; + if (SYMBOL_LANGUAGE (sym) == language_cplus) + TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED; /* The "SYMBOL_NAME" field is expected to be the mangled name * (if any), which we get from the "alias" field of the SOM record @@ -5356,7 +5364,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, CURRENT_FUNCTION_VALUE (objfile) = valu; /* Stack must be empty now. */ if (context_stack_depth != 0) - lbrac_unmatched_complaint ((char *) symnum); + lbrac_unmatched_complaint (symnum); new = push_context (0, valu); /* Built a type for the function. This includes processing @@ -5584,7 +5592,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, new = pop_context (); desc = dn_bufp->dend.beginscope.dnttp.index; if (desc != new->depth) - lbrac_mismatch_complaint ((char *) symnum); + lbrac_mismatch_complaint (symnum); /* Make a block for the local symbols within. */ finish_block (new->name, &local_symbols, new->old_blocks, diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 26d57ba..29dce0b 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -285,7 +285,7 @@ hpux_thread_fetch_registers (int regno) child_ops.to_fetch_registers (regno); else { - unsigned char buf[MAX_REGISTER_RAW_SIZE]; + unsigned char *buf = alloca (max_register_size (current_gdbarch)); CORE_ADDR sp; sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; @@ -347,7 +347,7 @@ hpux_thread_store_registers (int regno) child_ops.to_store_registers (regno); else { - unsigned char buf[MAX_REGISTER_RAW_SIZE]; + unsigned char *buf = alloca (max_register_size (current_gdbarch)); CORE_ADDR sp; sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c index a6dc505..678eabc 100644 --- a/gdb/i386v-nat.c +++ b/gdb/i386v-nat.c @@ -120,11 +120,11 @@ static int debug_control_mirror; /* Record which address associates with which register. */ static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1]; -static int -i386_insert_aligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, int); +static int i386_insert_aligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, + int); -static int -i386_insert_nonaligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, int); +static int i386_insert_nonaligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, + int); /* Insert a watchpoint. */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 56bd75d..7a96900 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -114,7 +114,7 @@ void _initialize_infcmd (void); #define GO_USAGE "Usage: go \n" -static void breakpoint_auto_delete_contents (PTR); +static void breakpoint_auto_delete_contents (void *); #define ERROR_NO_INFERIOR \ if (!target_has_execution) error ("The program is not being run."); @@ -953,7 +953,7 @@ signal_command (char *signum_exp, int from_tty) pointed to by arg (which is really a bpstat *). */ static void -breakpoint_auto_delete_contents (PTR arg) +breakpoint_auto_delete_contents (void *arg) { breakpoint_auto_delete (*(bpstat *) arg); } @@ -1140,10 +1140,41 @@ until_command (char *arg, int from_tty) } if (arg) - until_break_command (arg, from_tty); + until_break_command (arg, from_tty, 0); else until_next_command (from_tty); } + +static void +advance_command (char *arg, int from_tty) +{ + int async_exec = 0; + + if (!target_has_execution) + error ("The program is not running."); + + if (arg == NULL) + error_no_arg ("a location"); + + /* Find out whether we must run in the background. */ + if (arg != NULL) + async_exec = strip_bg_char (&arg); + + /* If we must run in the background, but the target can't do it, + error out. */ + if (event_loop_p && async_exec && !target_can_async_p ()) + error ("Asynchronous execution not supported on this target."); + + /* If we are not asked to run in the bg, then prepare to run in the + foreground, synchronously. */ + if (event_loop_p && !async_exec && target_can_async_p ()) + { + /* Simulate synchronous execution. */ + async_disable_stdin (); + } + + until_break_command (arg, from_tty, 1); +} /* Print the result of a function at the end of a 'finish' command. */ @@ -1977,12 +2008,6 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file, 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; @@ -1997,7 +2022,6 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file, if (!printed_something) fprintf_filtered (file, "\ No floating-point info available for this processor.\n"); -#endif } } @@ -2130,11 +2154,15 @@ Argument N means do this N times (or till program stops for another reason)."); c = add_com ("until", class_run, until_command, "Execute until the program reaches a source line greater than the current\n\ -or a specified line or address or function (same args as break command).\n\ -Execution will also stop upon exit from the current stack frame."); +or a specified location (same args as break command) within the current frame."); set_cmd_completer (c, location_completer); add_com_alias ("u", "until", class_run, 1); + c = add_com ("advance", class_run, advance_command, + "Continue the program up to the given location (same form as args for break command).\n\ +Execution will also stop upon exit from the current stack frame."); + set_cmd_completer (c, location_completer); + c = add_com ("jump", class_run, jump_command, "Continue program being debugged at specified line or address.\n\ Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\ diff --git a/gdb/inferior.h b/gdb/inferior.h index 79ca670..4616a1f 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -1,7 +1,8 @@ /* Variables that describe the inferior process running under GDB: Where it is, why it stopped, and how to step it. - Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -417,8 +418,6 @@ extern int attach_flag; /* Possible values for CALL_DUMMY_LOCATION. */ #define ON_STACK 1 -#define BEFORE_TEXT_END 2 -#define AFTER_TEXT_END 3 #define AT_ENTRY_POINT 4 #if !defined (CALL_DUMMY_ADDRESS) @@ -481,24 +480,6 @@ extern int attach_flag; version should be able to handle all cases since that code works by saving the address of the dummy's breakpoint (where ever it is). */ -extern int deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc, - CORE_ADDR sp, - CORE_ADDR frame_address); - -/* NOTE: cagney/2002-11-24: Targets need to both switch to generic - dummy frames, and use generic_pc_in_call_dummy(). The generic - version should be able to handle all cases since that code works by - saving the address of the dummy's breakpoint (where ever it is). */ - -extern int deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, - CORE_ADDR sp, - CORE_ADDR frame_address); - -/* NOTE: cagney/2002-11-24: Targets need to both switch to generic - dummy frames, and use generic_pc_in_call_dummy(). The generic - version should be able to handle all cases since that code works by - saving the address of the dummy's breakpoint (where ever it is). */ - extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); diff --git a/gdb/infrun.c b/gdb/infrun.c index 704e033..f864442 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2,7 +2,7 @@ process. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -1172,7 +1172,7 @@ context_switch (struct execution_control_state *ecs) void handle_inferior_event (struct execution_control_state *ecs) { - CORE_ADDR tmp; + CORE_ADDR real_stop_pc; int stepped_after_stopped_by_watchpoint; int sw_single_step_trap_p = 0; @@ -2407,19 +2407,19 @@ process_event_stop_test: function. That's what tells us (a) whether we want to step into it at all, and (b) what prologue we want to run to the end of, if we do step into it. */ - tmp = SKIP_TRAMPOLINE_CODE (stop_pc); - if (tmp != 0) - ecs->stop_func_start = tmp; + real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + if (real_stop_pc != 0) + ecs->stop_func_start = real_stop_pc; else { - tmp = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc); - if (tmp) + real_stop_pc = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc); + if (real_stop_pc) { struct symtab_and_line xxx; /* Why isn't this s_a_l called "sr_sal", like all of the other s_a_l's where this code is duplicated? */ init_sal (&xxx); /* initialize to zeroes */ - xxx.pc = tmp; + xxx.pc = real_stop_pc; xxx.section = find_pc_overlay (xxx.pc); check_for_old_step_resume_breakpoint (); step_resume_breakpoint = @@ -2482,19 +2482,17 @@ process_event_stop_test: we want to proceed through the trampoline when stepping. */ if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) { - CORE_ADDR tmp; - /* Determine where this trampoline returns. */ - tmp = SKIP_TRAMPOLINE_CODE (stop_pc); + real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); /* Only proceed through if we know where it's going. */ - if (tmp) + if (real_stop_pc) { /* And put the step-breakpoint there and go until there. */ struct symtab_and_line sr_sal; init_sal (&sr_sal); /* initialize to zeroes */ - sr_sal.pc = tmp; + sr_sal.pc = real_stop_pc; sr_sal.section = find_pc_overlay (sr_sal.pc); /* Do not specify what the fp should be when we stop since on some machines the prologue @@ -3093,7 +3091,7 @@ normal_stop (void) LOCATION: Print only location SRC_AND_LOC: Print location and source line */ if (do_frame_printing) - show_and_print_stack_frame (deprecated_selected_frame, -1, source_flag); + print_stack_frame (deprecated_selected_frame, -1, source_flag); /* Display the auto-display expressions. */ do_displays (); @@ -3109,10 +3107,10 @@ normal_stop (void) if (stop_stack_dummy) { - /* Pop the empty frame that contains the stack dummy. - POP_FRAME ends with a setting of the current frame, so we - can use that next. */ - POP_FRAME; + /* Pop the empty frame that contains the stack dummy. POP_FRAME + ends with a setting of the current frame, so we can use that + next. */ + frame_pop (get_current_frame ()); /* Set stop_pc to what it was before we called the function. Can't rely on restore_inferior_status because that only gets called if we don't stop in the called function. */ diff --git a/gdb/inftarg.c b/gdb/inftarg.c index e12e8bd..629f37d 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -1,7 +1,8 @@ /* Target-vector operations for controlling Unix child processes, for GDB. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, + 2000, 2002, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. ## Contains temporary hacks.. diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c index 2283887..b44c5bb 100644 --- a/gdb/irix4-nat.c +++ b/gdb/irix4-nat.c @@ -51,8 +51,8 @@ supply_gregset (gregset_t *gregsetp) { register int regi; register greg_t *regp = (greg_t *) (gregsetp->gp_regs); - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); /* FIXME: somewhere, there should be a #define for the meaning of this magic number 32; we should use that. */ @@ -104,8 +104,8 @@ void supply_fpregset (fpregset_t *fpregsetp) { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index 893082c..b6dac57 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -216,7 +216,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show, n_overloads = TYPE_FN_FIELDLIST_LENGTH (type, i); method_name = TYPE_FN_FIELDLIST_NAME (type, i); name = type_name_no_tag (type); - is_constructor = name && STREQ (method_name, name); + is_constructor = name && strcmp (method_name, name) == 0; for (j = 0; j < n_overloads; j++) { diff --git a/gdb/language.c b/gdb/language.c index a343290..258152c 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -1,6 +1,8 @@ /* Multiple source language support for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, + 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by the Department of Computer Science at the State University of New York at Buffalo. diff --git a/gdb/language.h b/gdb/language.h index a04bc74..b786959 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -1,6 +1,8 @@ /* Source-language-related definitions for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000 - Free Software Foundation, Inc. + + Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2003 Free + Software Foundation, Inc. + Contributed by the Department of Computer Science at the State University of New York at Buffalo. diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index aad8c19..9f9dd81 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -536,25 +536,6 @@ lin_lwp_detach (char *args, int from_tty) } -struct private_thread_info -{ - int lwpid; -}; - -/* Return non-zero if TP corresponds to the LWP specified by DATA - (which is assumed to be a pointer to a `struct lwp_info'. */ - -static int -find_lwp_callback (struct thread_info *tp, void *data) -{ - struct lwp_info *lp = data; - - if (tp->private->lwpid == GET_LWP (lp->ptid)) - return 1; - - return 0; -} - /* Resume LP. */ static int @@ -564,27 +545,6 @@ resume_callback (struct lwp_info *lp, void *data) { struct thread_info *tp; -#if 0 - /* FIXME: kettenis/2000-08-26: This should really be handled - properly by core GDB. */ - - tp = find_thread_pid (lp->ptid); - if (tp == NULL) - tp = iterate_over_threads (find_lwp_callback, lp); - gdb_assert (tp); - - /* If we were previously stepping the thread, and now continue - the thread we must invalidate the stepping range. However, - if there is a step_resume breakpoint for this thread, we must - preserve the stepping range to make it possible to continue - stepping once we hit it. */ - if (tp->step_range_end && tp->step_resume_breakpoint == NULL) - { - gdb_assert (lp->step); - tp->step_range_start = tp->step_range_end = 0; - } -#endif - child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0); if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, diff --git a/gdb/linespec.c b/gdb/linespec.c index 942a5ac..37633cc 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1,6 +1,6 @@ /* Parser for linespec for the GNU debugger, GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001 + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -78,26 +78,26 @@ symtabs_and_lines decode_all_digits (char **argptr, struct symtab *default_symtab, int default_line, char ***canonical, - struct symtab *s, + struct symtab *file_symtab, char *q); static struct symtabs_and_lines decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, char ***canonical, - struct symtab *s); + struct symtab *file_symtab); static struct symtabs_and_lines decode_variable (char *copy, int funfirstline, char ***canonical, - struct symtab *s); + struct symtab *file_symtab); static struct symtabs_and_lines symbol_found (int funfirstline, char ***canonical, char *copy, struct symbol *sym, - struct symtab *s, + struct symtab *file_symtab, struct symtab *sym_symtab); static struct @@ -229,7 +229,8 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr) else phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); - /* Destructor is handled by caller, dont add it to the list */ + /* Destructor is handled by caller, don't add it to + the list. */ if (is_destructor_name (phys_name) != 0) continue; @@ -255,9 +256,10 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr) && (class_name[name_len] == '\0' || class_name[name_len] == '<')) { - /* For GCC 3.x and stabs, constructors and destructors have names - like __base_ctor and __complete_dtor. Check the physname for now - if we're looking for a constructor. */ + /* For GCC 3.x and stabs, constructors and destructors + have names like __base_ctor and __complete_dtor. + Check the physname for now if we're looking for a + constructor. */ for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1; field_counter >= 0; @@ -268,8 +270,8 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr) f = TYPE_FN_FIELDLIST1 (t, method_counter); - /* GCC 3.x will never produce stabs stub methods, so we don't need - to handle this case. */ + /* GCC 3.x will never produce stabs stub methods, so + we don't need to handle this case. */ if (TYPE_FN_FIELD_STUB (f, field_counter)) continue; phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); @@ -358,7 +360,7 @@ find_toplevel_char (char *s, char c) int quoted = 0; /* zero if we're not in quotes; '"' if we're in a double-quoted string; '\'' if we're in a single-quoted string. */ - int depth = 0; /* number of unclosed parens we've seen */ + int depth = 0; /* Number of unclosed parens we've seen. */ char *scan; for (scan = s; *scan; scan++) @@ -418,7 +420,7 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline, printf_unfiltered ("[0] cancel\n[1] all\n"); while (i < nelts) { - init_sal (&return_values.sals[i]); /* initialize to zeroes */ + init_sal (&return_values.sals[i]); /* Initialize to zeroes. */ init_sal (&values.sals[i]); if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK) { @@ -561,7 +563,8 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, { char *p; char *q; - struct symtab *s = NULL; + /* If a file name is specified, this is its symtab. */ + struct symtab *file_symtab = NULL; char *copy; /* This is NULL if there are no parens in *ARGPTR, or a pointer to @@ -578,16 +581,15 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, initialize_defaults (&default_symtab, &default_line); - /* See if arg is *PC */ + /* See if arg is *PC. */ if (**argptr == '*') return decode_indirect (argptr); - /* Set various flags. - * 'paren_pointer' is important for overload checking, where - * we allow things like: - * (gdb) break c::f(int) - */ + /* Set various flags. 'paren_pointer' is important for overload + checking, where we allow things like: + (gdb) break c::f(int) + */ set_flags (*argptr, &is_quoted, &paren_pointer); @@ -614,7 +616,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* No, the first part is a filename; set s to be that file's symtab. Also, move argptr past the filename. */ - s = symtab_from_filename (argptr, p, is_quote_enclosed); + file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed); } #if 0 /* No one really seems to know why this was added. It certainly @@ -654,7 +656,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* S is specified file's symtab, or 0 if no file specified. arg no longer contains the file name. */ - /* Check whether arg is all digits (and sign) */ + /* Check whether arg is all digits (and sign). */ q = *argptr; if (*q == '-' || *q == '+') @@ -665,13 +667,14 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, if (q != *argptr && (*q == 0 || *q == ' ' || *q == '\t' || *q == ',')) /* We found a token consisting of all digits -- at least one digit. */ return decode_all_digits (argptr, default_symtab, default_line, - canonical, s, q); + canonical, file_symtab, q); /* Arg token is not digits => try it as a variable name Find the next token (everything up to end or next whitespace). */ - if (**argptr == '$') /* May be a convenience variable */ - p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1)); /* One or two $ chars possible */ + if (**argptr == '$') /* May be a convenience variable. */ + /* One or two $ chars possible. */ + p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1)); else if (is_quoted) { p = skip_quoted (*argptr); @@ -704,16 +707,16 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* If it starts with $: may be a legitimate variable or routine name (e.g. HP-UX millicode routines such as $$dyncall), or it may - be history value, or it may be a convenience variable */ + be history value, or it may be a convenience variable. */ if (*copy == '$') return decode_dollar (copy, funfirstline, default_symtab, - canonical, s); + canonical, file_symtab); /* Look up that token as a variable. If file specified, use that file's per-file block to start with. */ - return decode_variable (copy, funfirstline, canonical, s); + return decode_variable (copy, funfirstline, canonical, file_symtab); } @@ -768,8 +771,8 @@ set_flags (char *arg, int *is_quoted, char **paren_pointer) int has_if = 0; /* 'has_if' is for the syntax: - * (gdb) break foo if (a==b) - */ + (gdb) break foo if (a==b) + */ if ((ii = strstr (arg, " if ")) != NULL || (ii = strstr (arg, "\tif ")) != NULL || (ii = strstr (arg, " if\t")) != NULL || @@ -777,10 +780,9 @@ set_flags (char *arg, int *is_quoted, char **paren_pointer) (ii = strstr (arg, " if(")) != NULL || (ii = strstr (arg, "\tif( ")) != NULL) has_if = 1; - /* Temporarily zap out "if (condition)" to not - * confuse the parenthesis-checking code below. - * This is undone below. Do not change ii!! - */ + /* Temporarily zap out "if (condition)" to not confuse the + parenthesis-checking code below. This is undone below. Do not + change ii!! */ if (has_if) { *ii = '\0'; @@ -794,9 +796,8 @@ set_flags (char *arg, int *is_quoted, char **paren_pointer) if (*paren_pointer != NULL) *paren_pointer = strrchr (*paren_pointer, ')'); - /* Now that we're safely past the paren_pointer check, - * put back " if (condition)" so outer layers can see it - */ + /* Now that we're safely past the paren_pointer check, put back " if + (condition)" so outer layers can see it. */ if (has_if) *ii = ' '; } @@ -849,18 +850,16 @@ locate_first_half (char **argptr, int *is_quote_enclosed) ii = find_toplevel_char (*argptr, ','); has_comma = (ii != 0); - /* Temporarily zap out second half to not - * confuse the code below. - * This is undone below. Do not change ii!! - */ + /* Temporarily zap out second half to not confuse the code below. + This is undone below. Do not change ii!! */ if (has_comma) { *ii = '\0'; } - /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */ - /* May also be CLASS::MEMBER, or NAMESPACE::NAME */ - /* Look for ':', but ignore inside of <> */ + /* Maybe arg is FILE : LINENUM or FILE : FUNCTION. May also be + CLASS::MEMBER, or NAMESPACE::NAME. Look for ':', but ignore + inside of <>. */ p = *argptr; if (p[0] == '"') @@ -880,18 +879,20 @@ locate_first_half (char **argptr, int *is_quote_enclosed) error ("malformed template specification in command"); p = temp_end; } - /* Check for the end of the first half of the linespec. End of line, - a tab, a double colon or the last single colon, or a space. But - if enclosed in double quotes we do not break on enclosed spaces */ + /* Check for the end of the first half of the linespec. End of + line, a tab, a double colon or the last single colon, or a + space. But if enclosed in double quotes we do not break on + enclosed spaces. */ if (!*p || p[0] == '\t' || ((p[0] == ':') && ((p[1] == ':') || (strchr (p + 1, ':') == NULL))) || ((p[0] == ' ') && !*is_quote_enclosed)) break; - if (p[0] == '.' && strchr (p, ':') == NULL) /* Java qualified method. */ + if (p[0] == '.' && strchr (p, ':') == NULL) { - /* Find the *last* '.', since the others are package qualifiers. */ + /* Java qualified method. Find the *last* '.', since the + others are package qualifiers. */ for (p1 = p; *p1; p1++) { if (*p1 == '.') @@ -903,7 +904,7 @@ locate_first_half (char **argptr, int *is_quote_enclosed) while (p[0] == ' ' || p[0] == '\t') p++; - /* if the closing double quote was left at the end, remove it */ + /* If the closing double quote was left at the end, remove it. */ if (*is_quote_enclosed) { char *closing_quote = strchr (p - 1, '"'); @@ -911,9 +912,8 @@ locate_first_half (char **argptr, int *is_quote_enclosed) *closing_quote = '\0'; } - /* Now that we've safely parsed the first half, - * put back ',' so outer layers can see it - */ + /* Now that we've safely parsed the first half, put back ',' so + outer layers can see it. */ if (has_comma) *ii = ','; @@ -946,8 +946,8 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, struct type *t; /* First check for "global" namespace specification, - of the form "::foo". If found, skip over the colons - and jump to normal symbol processing */ + of the form "::foo". If found, skip over the colons + and jump to normal symbol processing. */ if (p[0] == ':' && ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))) saved_arg2 += 2; @@ -970,9 +970,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, Note that namespaces can nest only inside other namespaces, and not inside classes. So we need only consider *prefixes* of the string; there is no need to look up - "B::C" separately as a symbol in the previous example. */ + "B::C" separately as a symbol in the previous example. */ - p2 = p; /* save for restart */ + p2 = p; /* Save for restart. */ while (1) { /* Extract the class name. */ @@ -997,8 +997,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, (TYPE_CODE (t) == TYPE_CODE_STRUCT || TYPE_CODE (t) == TYPE_CODE_UNION))) { - /* Arg token is not digits => try it as a function name - Find the next token(everything up to end or next blank). */ + /* Arg token is not digits => try it as a function name. + Find the next token (everything up to end or next + blank). */ if (**argptr && strchr (get_gdb_completer_quote_characters (), **argptr) != NULL) @@ -1042,13 +1043,13 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, copy[p - *argptr - 1] = '\0'; } - /* no line number may be specified */ + /* No line number may be specified. */ while (*p == ' ' || *p == '\t') p++; *argptr = p; sym = 0; - i1 = 0; /* counter for the symbol array */ + i1 = 0; /* Counter for the symbol array. */ sym_arr = (struct symbol **) alloca (total_number_of_methods (t) * sizeof (struct symbol *)); @@ -1119,9 +1120,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, } } - /* Move pointer up to next possible class/namespace token */ - p = p2 + 1; /* restart with old value +1 */ - /* Move pointer ahead to next double-colon */ + /* Move pointer up to next possible class/namespace token. */ + p = p2 + 1; /* Restart with old value +1. */ + /* Move pointer ahead to next double-colon. */ while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\'')) { if (p[0] == '<') @@ -1132,26 +1133,27 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, p = temp_end; } else if ((p[0] == ':') && (p[1] == ':')) - break; /* found double-colon */ + break; /* Found double-colon. */ else p++; } if (*p != ':') - break; /* out of the while (1) */ + break; /* Out of the while (1). */ - p2 = p; /* save restart for next time around */ - *argptr = saved_arg2; /* restore argptr */ + p2 = p; /* Save restart for next time around. */ + *argptr = saved_arg2; /* Restore argptr. */ } /* while (1) */ - /* Last chance attempt -- check entire name as a symbol */ - /* Use "copy" in preparation for jumping out of this block, - to be consistent with usage following the jump target */ + /* Last chance attempt -- check entire name as a symbol. Use "copy" + in preparation for jumping out of this block, to be consistent + with usage following the jump target. */ copy = (char *) alloca (p - saved_arg2 + 1); memcpy (copy, saved_arg2, p - saved_arg2); - /* Note: if is_quoted should be true, we snuff out quote here anyway */ + /* Note: if is_quoted should be true, we snuff out quote here + anyway. */ copy[p - saved_arg2] = '\000'; - /* Set argptr to skip over the name */ + /* Set argptr to skip over the name. */ *argptr = (*p == '\'') ? p + 1 : p; /* Look up entire name */ sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab); @@ -1159,8 +1161,8 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, return symbol_found (funfirstline, canonical, copy, sym, NULL, sym_symtab); - /* Couldn't find any interpretation as classes/namespaces, so give up */ - /* The quotes are important if copy is empty. */ + /* Couldn't find any interpretation as classes/namespaces, so give + up. The quotes are important if copy is empty. */ cplusplus_error (saved_arg, "Can't find member of namespace, class, struct, or union named \"%s\"\n", copy); @@ -1176,7 +1178,7 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed) { char *p1; char *copy; - struct symtab *s; + struct symtab *file_symtab; p1 = p; while (p != *argptr && p[-1] == ' ') @@ -1185,15 +1187,15 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed) --p; copy = (char *) alloca (p - *argptr + 1); memcpy (copy, *argptr, p - *argptr); - /* It may have the ending quote right after the file name */ + /* It may have the ending quote right after the file name. */ if (is_quote_enclosed && copy[p - *argptr - 1] == '"') copy[p - *argptr - 1] = 0; else copy[p - *argptr] = 0; /* Find that file's data. */ - s = lookup_symtab (copy); - if (s == 0) + file_symtab = lookup_symtab (copy); + if (file_symtab == 0) { if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); @@ -1206,7 +1208,7 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed) p++; *argptr = p; - return s; + return file_symtab; } @@ -1218,7 +1220,7 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed) static struct symtabs_and_lines decode_all_digits (char **argptr, struct symtab *default_symtab, int default_line, char ***canonical, - struct symtab *s, char *q) + struct symtab *file_symtab, char *q) { struct symtabs_and_lines values; @@ -1231,7 +1233,7 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, sign = none; /* We might need a canonical line spec if no file was specified. */ - int need_canonical = (s == 0) ? 1 : 0; + int need_canonical = (file_symtab == 0) ? 1 : 0; init_sal (&val); @@ -1239,11 +1241,11 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, We must guarantee that this section of code is never executed when we are called with just a function name, since set_default_source_symtab_and_line uses - select_source_symtab that calls us with such an argument */ + select_source_symtab that calls us with such an argument. */ - if (s == 0 && default_symtab == 0) + if (file_symtab == 0 && default_symtab == 0) { - /* Make sure we have at least a default source file. */ + /* Make sure we have at least a default source file. */ set_default_source_symtab_and_line (); initialize_defaults (&default_symtab, &default_line); } @@ -1258,13 +1260,13 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, case plus: if (q == *argptr) val.line = 5; - if (s == 0) + if (file_symtab == 0) val.line = default_line + val.line; break; case minus: if (q == *argptr) val.line = 15; - if (s == 0) + if (file_symtab == 0) val.line = default_line - val.line; else val.line = 1; @@ -1276,15 +1278,15 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, while (*q == ' ' || *q == '\t') q++; *argptr = q; - if (s == 0) - s = default_symtab; + if (file_symtab == 0) + file_symtab = default_symtab; /* It is possible that this source file has more than one symtab, and that the new line number specification has moved us from the - default (in s) to a new one. */ - val.symtab = find_line_symtab (s, val.line, NULL, NULL); + default (in file_symtab) to a new one. */ + val.symtab = find_line_symtab (file_symtab, val.line, NULL, NULL); if (val.symtab == 0) - val.symtab = s; + val.symtab = file_symtab; val.pc = 0; values.sals = (struct symtab_and_line *) @@ -1302,7 +1304,7 @@ decode_all_digits (char **argptr, struct symtab *default_symtab, static struct symtabs_and_lines decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, - char ***canonical, struct symtab *s) + char ***canonical, struct symtab *file_symtab) { struct value *valx; int index = 0; @@ -1318,9 +1320,9 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, p = (copy[1] == '$') ? copy + 2 : copy + 1; while (*p >= '0' && *p <= '9') p++; - if (!*p) /* reached end of token without hitting non-digit */ + if (!*p) /* Reached end of token without hitting non-digit. */ { - /* We have a value history reference */ + /* We have a value history reference. */ sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &index); valx = access_value_history ((copy[1] == '$') ? -index : index); if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT) @@ -1329,25 +1331,25 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, else { /* Not all digits -- may be user variable/function or a - convenience variable */ + convenience variable. */ - /* Look up entire name as a symbol first */ + /* Look up entire name as a symbol first. */ sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab); - s = (struct symtab *) 0; + file_symtab = (struct symtab *) 0; need_canonical = 1; /* Symbol was found --> jump to normal symbol processing. */ if (sym) return symbol_found (funfirstline, canonical, copy, sym, NULL, sym_symtab); - /* If symbol was not found, look in minimal symbol tables */ + /* If symbol was not found, look in minimal symbol tables. */ msymbol = lookup_minimal_symbol (copy, NULL, NULL); - /* Min symbol was found --> jump to minsym processing. */ + /* Min symbol was found --> jump to minsym processing. */ if (msymbol) return minsym_found (funfirstline, msymbol); - /* Not a user variable or function -- must be convenience variable */ - need_canonical = (s == 0) ? 1 : 0; + /* Not a user variable or function -- must be convenience variable. */ + need_canonical = (file_symtab == 0) ? 1 : 0; valx = value_of_internalvar (lookup_internalvar (copy + 1)); if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT) error ("Convenience variables used in line specs must have integer values."); @@ -1355,8 +1357,8 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, init_sal (&val); - /* Either history value or convenience value from above, in valx */ - val.symtab = s ? s : default_symtab; + /* Either history value or convenience value from above, in valx. */ + val.symtab = file_symtab ? file_symtab : default_symtab; val.line = value_as_long (valx); val.pc = 0; @@ -1372,12 +1374,12 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab, -/* Decode a linespec that's a variable. If S is non-NULL, +/* Decode a linespec that's a variable. If FILE_SYMTAB is non-NULL, look in that symtab's static variables first. */ static struct symtabs_and_lines decode_variable (char *copy, int funfirstline, char ***canonical, - struct symtab *s) + struct symtab *file_symtab) { struct symbol *sym; /* The symtab that SYM was found in. */ @@ -1386,12 +1388,15 @@ decode_variable (char *copy, int funfirstline, char ***canonical, struct minimal_symbol *msymbol; sym = lookup_symbol (copy, - (s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK) + (file_symtab + ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), + STATIC_BLOCK) : get_selected_block (0)), VAR_NAMESPACE, 0, &sym_symtab); if (sym != NULL) - return symbol_found (funfirstline, canonical, copy, sym, s, sym_symtab); + return symbol_found (funfirstline, canonical, copy, sym, + file_symtab, sym_symtab); msymbol = lookup_minimal_symbol (copy, NULL, NULL); @@ -1416,7 +1421,7 @@ decode_variable (char *copy, int funfirstline, char ***canonical, static struct symtabs_and_lines symbol_found (int funfirstline, char ***canonical, char *copy, - struct symbol *sym, struct symtab *s, + struct symbol *sym, struct symtab *file_symtab, struct symtab *sym_symtab) { struct symtabs_and_lines values; @@ -1435,7 +1440,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, /* We might need a canonical line spec if it is a static function. */ - if (s == 0) + if (file_symtab == 0) { struct blockvector *bv = BLOCKVECTOR (sym_symtab); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index 37edc2b..b5cb29a 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -282,7 +282,7 @@ fetch_inferior_registers (int regno) if (whatregs & WHATREGS_GEN) { struct econtext ec; /* general regs */ - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); int retval; int i; @@ -510,29 +510,31 @@ fetch_inferior_registers (int regno) ecp = registers_addr (PIDGET (inferior_ptid)); - for (regno = reglo; regno <= reghi; regno++) - { - char buf[MAX_REGISTER_RAW_SIZE]; - int ptrace_fun = PTRACE_PEEKTHREAD; - + { + char *buf = alloca (max_register_size (current_gdbarch)); + for (regno = reglo; regno <= reghi; regno++) + { + int ptrace_fun = PTRACE_PEEKTHREAD; + #ifdef M68K - ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD; + ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD; #endif - - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - unsigned int reg; - - errno = 0; - reg = ptrace (ptrace_fun, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) (ecp + regmap[regno] + i), 0); - if (errno) - perror_with_name ("ptrace(PTRACE_PEEKUSP)"); - - *(int *) &buf[i] = reg; - } - supply_register (regno, buf); - } + + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + unsigned int reg; + + errno = 0; + reg = ptrace (ptrace_fun, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) (ecp + regmap[regno] + i), 0); + if (errno) + perror_with_name ("ptrace(PTRACE_PEEKUSP)"); + + *(int *) &buf[i] = reg; + } + supply_register (regno, buf); + } + } } /* Store our register values back into the inferior. diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 400f0a9..6484234 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -1,5 +1,7 @@ /* Target-dependent code for the Mitsubishi m32r for GDB, the GNU debugger. - Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1996, 1998, 1999, 2000, 2001, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index cf47dd1..0f0a7d1 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -135,7 +135,7 @@ fetch_register (int regno) char mess[128]; /* For messages */ register int i; unsigned int offset; /* Offset of registers within the u area. */ - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); int tid; if (CANNOT_FETCH_REGISTER (regno)) diff --git a/gdb/main.c b/gdb/main.c index eb88747..7da4ac4 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -1,6 +1,6 @@ /* Top level stuff for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -65,6 +65,9 @@ int xdb_commands = 0; /* Whether dbx commands will be handled */ int dbx_commands = 0; +/* System root path, used to find libraries etc. */ +char *gdb_sysroot = 0; + struct ui_file *gdb_stdout; struct ui_file *gdb_stderr; struct ui_file *gdb_stdlog; @@ -170,7 +173,7 @@ captured_main (void *data) #endif /* MPW */ /* This needs to happen before the first use of malloc. */ - init_malloc ((PTR) NULL); + init_malloc (NULL); #if defined (ALIGN_STACK_ON_STARTUP) i = (int) &count & 0x3; @@ -201,6 +204,34 @@ captured_main (void *data) /* initialize error() */ error_init (); + /* Set the sysroot path. */ +#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE + gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT); + if (gdb_sysroot) + { + struct stat s; + int res = 0; + + if (stat (gdb_sysroot, &s) == 0) + if (S_ISDIR (s.st_mode)) + res = 1; + + if (res == 0) + { + xfree (gdb_sysroot); + gdb_sysroot = TARGET_SYSTEM_ROOT; + } + } + else + gdb_sysroot = TARGET_SYSTEM_ROOT; +#else +#if defined (TARGET_SYSTEM_ROOT) + gdb_sysroot = TARGET_SYSTEM_ROOT; +#else + gdb_sysroot = ""; +#endif +#endif + /* Parse arguments and options. */ { int c; @@ -269,10 +300,6 @@ captured_main (void *data) {"statistics", no_argument, 0, 13}, {"write", no_argument, &write_files, 1}, {"args", no_argument, &set_args, 1}, -/* Allow machine descriptions to add more options... */ -#ifdef ADDITIONAL_OPTIONS - ADDITIONAL_OPTIONS -#endif {0, no_argument, 0, 0} }; @@ -413,9 +440,6 @@ extern int gdbtk_test (char *); } break; -#ifdef ADDITIONAL_OPTION_CASES - ADDITIONAL_OPTION_CASES -#endif case '?': fprintf_unfiltered (gdb_stderr, _("Use `%s --help' for a complete list of options.\n"), @@ -612,10 +636,6 @@ extern int gdbtk_test (char *); if (ttyarg != NULL) catch_command_errors (tty_command, ttyarg, !batch, RETURN_MASK_ALL); -#ifdef ADDITIONAL_OPTION_HANDLER - ADDITIONAL_OPTION_HANDLER; -#endif - /* Error messages should no longer be distinguished with extra output. */ error_pre_print = NULL; quit_pre_print = NULL; @@ -804,9 +824,6 @@ Options:\n\n\ --write Set writing into executable and core files.\n\ --xdb XDB compatibility mode.\n\ "), stream); -#ifdef ADDITIONAL_OPTION_HELP - fputs_unfiltered (ADDITIONAL_OPTION_HELP, stream); -#endif fputs_unfiltered (_("\n\ For more information, type \"help\" from within GDB, or consult the\n\ GDB manual (available as on-line info or a printed manual).\n\ diff --git a/gdb/maint.c b/gdb/maint.c index db7d42d..3595e18 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -1,5 +1,5 @@ /* Support for GDB maintenance commands. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Fred Fish at Cygnus Support. @@ -639,16 +639,60 @@ maintenance_show_cmd (char *args, int from_tty) cmd_show_list (maintenance_show_cmdlist, from_tty, ""); } -#ifdef NOTYET /* Profiling support. */ static int maintenance_profile_p; +#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP) + +static int profiling_state; + +static void +mcleanup_wrapper (void) +{ + extern void _mcleanup (void); + + if (profiling_state) + _mcleanup (); +} + +static void +maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c) +{ + if (maintenance_profile_p == profiling_state) + return; + + profiling_state = maintenance_profile_p; + + if (maintenance_profile_p) + { + static int profiling_initialized; + + extern void monstartup (unsigned long, unsigned long); + extern char _etext; + extern int main(); + + if (!profiling_initialized) + { + atexit (mcleanup_wrapper); + profiling_initialized = 1; + } + + /* "main" is now always the first function in the text segment, so use + its address for monstartup. */ + monstartup ((unsigned long) &main, (unsigned long) &_etext); + } + else + { + extern void _mcleanup (void); + _mcleanup (); + } +} +#else static void maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c) { - maintenance_profile_p = 0; - warning ("\"maintenance set profile\" command not supported.\n"); + error ("Profiling support is not available on this system."); } #endif @@ -807,16 +851,12 @@ passes without a response from the target, an error occurs.", &setlist), &showlist); -#ifdef NOTYET - /* FIXME: cagney/2002-06-15: A patch implementing profiling is - pending, this just sets up the framework. */ - tmpcmd = add_setshow_boolean_cmd ("profile", class_maintenance, - var_boolean, &maintenance_profile_p, "\ -Set internal profiling.\n\ -When enabled GDB is profiled.", "\ -Show internal profiling.\n", - maintenance_set_profile_cmd, NULL, - &maintenance_set_cmdlist, - &maintenance_show_cmdlist); -#endif + add_setshow_boolean_cmd ("profile", class_maintenance, + &maintenance_profile_p, + "Set internal profiling.\n" + "When enabled GDB is profiled.", + "Show internal profiling.\n", + maintenance_set_profile_cmd, NULL, + &maintenance_set_cmdlist, + &maintenance_show_cmdlist); } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index bd0e124..30e94c7 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1517,9 +1517,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, if (t->fBitfield) { int width = AUX_GET_WIDTH (bigend, ax); - - /* Inhibit core dumps with some cfront generated objects that - corrupt the TIR. */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* Inhibit core dumps with some cfront generated objects that +// OBSOLETE corrupt the TIR. */ +#endif /* OBSOLETE CFront */ + /* Inhibit core dumps if TIR is corrupted. */ if (bs == (int *) NULL) { /* Alpha cc -migrate encodes char and unsigned char types @@ -2948,7 +2950,7 @@ parse_partial_symbols (struct objfile *objfile) psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - memcpy ((PTR) psymtab_include_list, (PTR) orig, + memcpy (psymtab_include_list, orig, includes_used * sizeof (char *)); } continue; @@ -3036,20 +3038,22 @@ parse_partial_symbols (struct objfile *objfile) psymtab_language, objfile); p += 1; } - /* The semantics of C++ state that "struct foo { ... }" - also defines a typedef for "foo". Unfortuantely, cfront - never makes the typedef when translating from C++ to C. - We make the typedef here so that "ptype foo" works as - expected for cfront translated code. */ - else if (psymtab_language == language_cplus) - { - /* Also a typedef with the same name. */ - add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, - &objfile->static_psymbols, - sh.value, 0, - psymtab_language, objfile); - } +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* The semantics of C++ state that "struct foo { ... }" +// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront +// OBSOLETE never makes the typedef when translating from C++ to C. +// OBSOLETE We make the typedef here so that "ptype foo" works as +// OBSOLETE expected for cfront translated code. */ +// OBSOLETE else if (psymtab_language == language_cplus) +// OBSOLETE { +// OBSOLETE /* Also a typedef with the same name. */ +// OBSOLETE add_psymbol_to_list (namestring, p - namestring, +// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE &objfile->static_psymbols, +// OBSOLETE sh.value, 0, +// OBSOLETE psymtab_language, objfile); +// OBSOLETE } +#endif /* OBSOLETE CFront */ } goto check_enum; case 't': @@ -3196,9 +3200,11 @@ parse_partial_symbols (struct objfile *objfile) case '9': case '-': case '#': /* for symbol identification (used in live ranges) */ - /* added to support cfront stabs strings */ - case 'Z': /* for definition continuations */ - case 'P': /* for prototypes */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* added to support cfront stabs strings */ +// OBSOLETE case 'Z': /* for definition continuations */ +// OBSOLETE case 'P': /* for prototypes */ +#endif /* OBSOLETE CFront */ continue; case ':': diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 7bc2ce8..e25430e 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,19 @@ +2003-02-02 Andrew Cagney + + From 2002-11-10 Jason Molenda (jason-cl@molenda.com): + * mi-cmd-var.c (mi_cmd_var_list_children): CHILDREN field is + now a list; still a tuple when in mi1. + * gdbmi.texinfo: Update var-list-children example. + +2003-01-13 Andrew Cagney + + * mi-cmd-env.c: Update copyright. + +2003-01-13 Elena Zannoni + + * mi-main.c (mi_cmd_exec_return): Use print_stack_frame instead of + show_and_print_stack_frame. + 2003-01-09 Andrew Cagney * mi-cmd-env.c: Include "gdb_string.h" instead of . diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo index 4cf34c2..8326bca 100644 --- a/gdb/mi/gdbmi.texinfo +++ b/gdb/mi/gdbmi.texinfo @@ -3756,8 +3756,8 @@ Returns the number of children of a variable object @var{name}: Returns a list of the children of the specified variable object: @example - numchild=@var{n},children=@{@{name=@var{name}, - numchild=@var{n},type=@var{type}@},@r{(repeats N times)}@} + numchild=@var{n},children=[@{name=@var{name}, + numchild=@var{n},type=@var{type}@},@r{(repeats N times)}] @end example diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c index a8b4afd..8fc673f 100644 --- a/gdb/mi/mi-cmd-env.c +++ b/gdb/mi/mi-cmd-env.c @@ -1,5 +1,7 @@ /* MI Command Set - environment commands. - Copyright 2002 Free Software Foundation, Inc. + + Copyright 2002, 2003 Free Software Foundation, Inc. + Contributed by Red Hat Inc. This file is part of GDB. diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 990b278..0da6106 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -272,7 +272,10 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) if (numchild <= 0) return MI_CMD_DONE; - cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children"); + if (mi_version (uiout) == 1) + cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children"); + else + cleanup_children = make_cleanup_ui_out_list_begin_end (uiout, "children"); cc = childlist; while (*cc != NULL) { diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 536e8a5..96030b7 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1,5 +1,5 @@ /* MI Command Set. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Solutions (a Red Hat company). This file is part of GDB. @@ -183,9 +183,9 @@ mi_cmd_exec_return (char *args, int from_tty) /* Because we have called return_command with from_tty = 0, we need to print the frame here. */ - show_and_print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), - LOC_AND_ADDRESS); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), + LOC_AND_ADDRESS); return MI_CMD_DONE; } diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c index 16009c2..f893e33 100644 --- a/gdb/mips-nat.c +++ b/gdb/mips-nat.c @@ -62,9 +62,6 @@ : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \ : 0) -static char zerobuf[MAX_REGISTER_RAW_SIZE] = -{0}; - static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); /* Get all registers from the inferior */ @@ -73,8 +70,10 @@ void fetch_inferior_registers (int regno) { register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); register int i; + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); deprecated_registers_fetched (); @@ -175,6 +174,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, int bad_reg = -1; register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); + + /* If u.u_ar0 was an absolute address in the core file, relativize it now, so we can use it as an offset into core_reg_sect. When we're done, "register 0" will be at core_reg_sect+reg_ptr, and we can use diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 4615b3b..5898e57 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -320,8 +320,8 @@ int gdb_print_insn_mips (bfd_vma, disassemble_info *); static void mips_print_register (int, int); -static mips_extra_func_info_t -heuristic_proc_desc (CORE_ADDR, CORE_ADDR, struct frame_info *, int); +static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR, + struct frame_info *, int); static CORE_ADDR heuristic_proc_start (CORE_ADDR); @@ -333,8 +333,9 @@ static void mips_show_processor_type_command (char *, int); static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); -static mips_extra_func_info_t -find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame); +static mips_extra_func_info_t find_proc_desc (CORE_ADDR pc, + struct frame_info *next_frame, + int cur_frame); static CORE_ADDR after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc); @@ -2467,9 +2468,13 @@ static void mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) { int regnum; + mips_extra_func_info_t proc_desc; + + if (get_frame_type (fci) == DUMMY_FRAME) + return; /* Use proc_desc calculated in frame_chain */ - mips_extra_func_info_t proc_desc = + proc_desc = get_next_frame (fci) ? cached_proc_desc : find_proc_desc (get_frame_pc (fci), get_next_frame (fci), 1); diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c index ec46df6..2695f1f 100644 --- a/gdb/mipsv4-nat.c +++ b/gdb/mipsv4-nat.c @@ -47,8 +47,8 @@ supply_gregset (gregset_t *gregsetp) { register int regi; register greg_t *regp = &(*gregsetp)[0]; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); for (regi = 0; regi <= CXT_RA; regi++) supply_register (regi, (char *) (regp + regi)); @@ -102,8 +102,8 @@ void supply_fpregset (fpregset_t *fpregsetp) { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = - {0}; + char *zerobuf = alloca (max_register_size (current_gdbarch)); + memset (zerobuf, 0, max_register_size (current_gdbarch)); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c index da83eb2..c75bd58 100644 --- a/gdb/mn10200-tdep.c +++ b/gdb/mn10200-tdep.c @@ -1,5 +1,7 @@ /* Target-dependent code for the Matsushita MN10200 for GDB, the GNU debugger. - Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1997, 1998, 1999, 2000, 2001, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/mon960-rom.c b/gdb/mon960-rom.c deleted file mode 100644 index 46f5784..0000000 --- a/gdb/mon960-rom.c +++ /dev/null @@ -1,261 +0,0 @@ -/* Remote target glue for the Intel 960 MON960 ROM monitor. - Copyright 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 "gdbcore.h" -#include "target.h" -#include "monitor.h" -#include "serial.h" -#include "srec.h" -#include "xmodem.h" -#include "symtab.h" -#include "symfile.h" /* for generic_load */ -#include "inferior.h" /* for write_pc() */ -#include "gdb_string.h" - -#define USE_GENERIC_LOAD - -static struct target_ops mon960_ops; - -static void mon960_open (char *args, int from_tty); - -#ifdef USE_GENERIC_LOAD - -static void -mon960_load_gen (char *filename, int from_tty) -{ - generic_load (filename, from_tty); - /* Finally, make the PC point at the start address */ - if (exec_bfd) - write_pc (bfd_get_start_address (exec_bfd)); - - inferior_ptid = null_ptid; /* No process now */ -} - -#else - -static void -mon960_load (struct serial *desc, char *file, int hashmark) -{ - bfd *abfd; - asection *s; - char *buffer; - int i; - - buffer = alloca (XMODEM_PACKETSIZE); - abfd = bfd_openr (file, 0); - if (!abfd) - { - printf_filtered ("Unable to open file %s\n", file); - return; - } - if (bfd_check_format (abfd, bfd_object) == 0) - { - printf_filtered ("File is not an object file\n"); - return; - } - for (s = abfd->sections; s; s = s->next) - if (s->flags & SEC_LOAD) - { - bfd_size_type section_size; - printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, s->vma, - s->vma + s->_raw_size); - gdb_flush (gdb_stdout); - monitor_printf (current_monitor->load, s->vma); - if (current_monitor->loadresp) - monitor_expect (current_monitor->loadresp, NULL, 0); - xmodem_init_xfer (desc); - section_size = bfd_section_size (abfd, s); - for (i = 0; i < section_size; i += XMODEM_DATASIZE) - { - int numbytes; - numbytes = min (XMODEM_DATASIZE, section_size - i); - bfd_get_section_contents (abfd, s, buffer + XMODEM_DATAOFFSET, i, - numbytes); - xmodem_send_packet (desc, buffer, numbytes, hashmark); - if (hashmark) - { - putchar_unfiltered ('#'); - gdb_flush (gdb_stdout); - } - } /* Per-packet (or S-record) loop */ - xmodem_finish_xfer (desc); - monitor_expect_prompt (NULL, 0); - putchar_unfiltered ('\n'); - } /* Loadable sections */ - if (hashmark) - putchar_unfiltered ('\n'); -} - -#endif /* USE_GENERIC_LOAD */ - -/* This array of registers need to match the indexes used by GDB. - This exists because the various ROM monitors use different strings - than does GDB, and don't necessarily support all the registers - either. So, typing "info reg sp" becomes a "r30". */ - -/* these correspond to the offsets from tm-* files from config directories */ -/* g0-g14, fp, pfp, sp, rip,r3-15, pc, ac, tc, fp0-3 */ -/* NOTE: "ip" is documented as "ir" in the Mon960 UG. */ -/* NOTE: "ir" can't be accessed... but there's an ip and rip. */ -static char *full_regnames[NUM_REGS] = -{ - /* 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", -}; - -static char *mon960_regnames[NUM_REGS]; - -/* Define the monitor command strings. Since these are passed directly - through to a printf style function, we may include formatting - strings. We also need a CR or LF on the end. */ - -/* need to pause the monitor for timing reasons, so slow it down */ - -#if 0 -/* FIXME: this extremely long init string causes MON960 to return two NAKS - instead of performing the autobaud recognition, at least when gdb - is running on GNU/Linux. The short string below works on Linux, and on - SunOS using a tcp serial connection. Must retest on SunOS using a - direct serial connection; if that works, get rid of the long string. */ -static char *mon960_inits[] = -{"\n\r\r\r\r\r\r\r\r\r\r\r\r\r\r\n\r\n\r\n", NULL}; -#else -static char *mon960_inits[] = -{"\r", NULL}; -#endif - -static struct monitor_ops mon960_cmds; - -static void -init_mon960_cmds (void) -{ - mon960_cmds.flags = MO_CLR_BREAK_USES_ADDR - | MO_NO_ECHO_ON_OPEN | MO_SEND_BREAK_ON_STOP | MO_GETMEM_READ_SINGLE; /* flags */ - mon960_cmds.init = mon960_inits; /* Init strings */ - mon960_cmds.cont = "go\n\r"; /* continue command */ - mon960_cmds.step = "st\n\r"; /* single step */ - mon960_cmds.stop = NULL; /* break interrupts the program */ - mon960_cmds.set_break = NULL; /* set a breakpoint */ - mon960_cmds.clr_break = /* can't use "br" because only 2 hw bps are supported */ - mon960_cmds.clr_all_break = NULL; /* clear a breakpoint - "de" is for hw bps */ - NULL, /* clear all breakpoints */ - mon960_cmds.fill = NULL; /* fill (start end val) */ - /* can't use "fi" because it takes words, not bytes */ - /* can't use "mb", "md" or "mo" because they require interaction */ - mon960_cmds.setmem.cmdb = NULL; /* setmem.cmdb (addr, value) */ - mon960_cmds.setmem.cmdw = NULL; /* setmem.cmdw (addr, value) */ - mon960_cmds.setmem.cmdl = "md %x %x\n\r"; /* setmem.cmdl (addr, value) */ - mon960_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ - mon960_cmds.setmem.resp_delim = NULL; /* setmem.resp_delim */ - mon960_cmds.setmem.term = NULL; /* setmem.term */ - mon960_cmds.setmem.term_cmd = NULL; /* setmem.term_cmd */ - /* since the parsing of multiple bytes is difficult due to - interspersed addresses, we'll only read 1 value at a time, - even tho these can handle a count */ - mon960_cmds.getmem.cmdb = "db %x\n\r"; /* getmem.cmdb (addr, #bytes) */ - mon960_cmds.getmem.cmdw = "ds %x\n\r"; /* getmem.cmdw (addr, #swords) */ - mon960_cmds.getmem.cmdl = "di %x\n\r"; /* getmem.cmdl (addr, #words) */ - mon960_cmds.getmem.cmdll = "dd %x\n\r"; /* getmem.cmdll (addr, #dwords) */ - mon960_cmds.getmem.resp_delim = " : "; /* getmem.resp_delim */ - mon960_cmds.getmem.term = NULL; /* getmem.term */ - mon960_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ - mon960_cmds.setreg.cmd = "md %s %x\n\r"; /* setreg.cmd (name, value) */ - mon960_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */ - mon960_cmds.setreg.term = NULL; /* setreg.term */ - mon960_cmds.setreg.term_cmd = NULL, /* setreg.term_cmd */ - mon960_cmds.getreg.cmd = "di %s\n\r"; /* getreg.cmd (name) */ - mon960_cmds.getreg.resp_delim = " : "; /* getreg.resp_delim */ - mon960_cmds.getreg.term = NULL; /* getreg.term */ - mon960_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ - mon960_cmds.dump_registers = "re\n\r"; /* dump_registers */ - mon960_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */ - mon960_cmds.supply_register = NULL; /* supply_register */ -#ifdef USE_GENERIC_LOAD - mon960_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ - mon960_cmds.load = NULL; /* download command */ - mon960_cmds.loadresp = NULL; /* load response */ -#else - mon960_cmds.load_routine = mon960_load; /* load_routine (defaults to SRECs) */ - mon960_cmds.load = "do\n\r"; /* download command */ - mon960_cmds.loadresp = "Downloading\n\r"; /* load response */ -#endif - mon960_cmds.prompt = "=>"; /* monitor command prompt */ - mon960_cmds.line_term = "\n\r"; /* end-of-command delimitor */ - mon960_cmds.cmd_end = NULL; /* optional command terminator */ - mon960_cmds.target = &mon960_ops; /* target operations */ - mon960_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ - mon960_cmds.regnames = mon960_regnames; /* registers names */ - mon960_cmds.magic = MONITOR_OPS_MAGIC; /* magic */ -}; - -static void -mon960_open (char *args, int from_tty) -{ - char buf[64]; - - monitor_open (args, &mon960_cmds, from_tty); - - /* Attempt to fetch the value of the first floating point register (fp0). - If the monitor returns a string containing the word "Bad" we'll assume - this processor has no floating point registers, and nullify the - regnames entries that refer to FP registers. */ - - monitor_printf (mon960_cmds.getreg.cmd, full_regnames[FP0_REGNUM]); /* di fp0 */ - if (monitor_expect_prompt (buf, sizeof (buf)) != -1) - if (strstr (buf, "Bad") != NULL) - { - int i; - - for (i = FP0_REGNUM; i < FP0_REGNUM + 4; i++) - mon960_regnames[i] = NULL; - } -} - -void -_initialize_mon960 (void) -{ - memcpy (mon960_regnames, full_regnames, sizeof (full_regnames)); - - init_mon960_cmds (); - - init_monitor_ops (&mon960_ops); - - mon960_ops.to_shortname = "mon960"; /* for the target command */ - mon960_ops.to_longname = "Intel 960 MON960 monitor"; -#ifdef USE_GENERIC_LOAD - mon960_ops.to_load = mon960_load_gen; /* FIXME - should go back and try "do" */ -#endif - /* use SW breaks; target only supports 2 HW breakpoints */ - mon960_ops.to_insert_breakpoint = memory_insert_breakpoint; - mon960_ops.to_remove_breakpoint = memory_remove_breakpoint; - - mon960_ops.to_doc = - "Use an Intel 960 board running the MON960 debug monitor.\n\ -Specify the serial device it is connected to (e.g. /dev/ttya)."; - - mon960_ops.to_open = mon960_open; - add_target (&mon960_ops); -} diff --git a/gdb/monitor.c b/gdb/monitor.c index 5a9bb60..8f14500 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -894,7 +894,7 @@ char * monitor_supply_register (int regno, char *valstr) { ULONGEST val; - unsigned char regbuf[MAX_REGISTER_RAW_SIZE]; + unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); char *p; val = 0; diff --git a/gdb/monitor.h b/gdb/monitor.h index 5d6138c..7b87f95 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -245,9 +245,7 @@ extern char *monitor_supply_register (int regno, char *valstr); extern int monitor_expect (char *prompt, char *buf, int buflen); extern int monitor_expect_prompt (char *buf, int buflen); extern void monitor_printf (char *, ...) ATTR_FORMAT (printf, 1, 2); -extern void -monitor_printf_noecho (char *, ...) -ATTR_FORMAT (printf, 1, 2); +extern void monitor_printf_noecho (char *, ...) ATTR_FORMAT (printf, 1, 2); extern void monitor_write (char *buf, int buflen); extern int monitor_readchar (void); extern char *monitor_get_dev_name (void); diff --git a/gdb/nindy-share/Makefile b/gdb/nindy-share/Makefile deleted file mode 100644 index 5ec99ba..0000000 --- a/gdb/nindy-share/Makefile +++ /dev/null @@ -1,117 +0,0 @@ -#Copyright 1992 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. - -#----------------------------------------------------------------------------- -# Makefile for toolib.a -- host code shAred by more than one tool -#----------------------------------------------------------------------------- - -RANLIB = ranlib - -# The following lines should be uncommented for system V (i386v). -#__i386v__#USG = -DUSG -#__i386v__#SYSV_INCL = ${IPATH}/sysv.h -#__i386v__#RANLIB = echo >/dev/null - -# The following line should be uncommented for HP-UX -#__hp9000__#USG = -DUSG -#__hp9000__#SYSV_INCL = ${IPATH}/sysv.h -#__hp9000__#RANLIB = echo >/dev/null - -# Essential under System V, harmless elsewhere -SHELL = /bin/sh - -#'HOST' will be defined in the host-specific makefile by 'make make' - -TARG = toolib.a -OPT = -g -IPATH = ../../include -CFLAGS = ${OPT} ${USG} -I${IPATH} -DHOST=\"${HOST}\" -OBJS = coffstrip.o nindy.o ttybreak.o ttyflush.o Onindy.o - -${TARG}: ${OBJS} VERSION - make ver960.o - rm -f ${TARG} - ar cvr ${TARG} ${OBJS} ver960.o - ${RANLIB} ${TARG} - -coffstrip.o: ${IPATH}/b.out.h ${IPATH}/coff.h ${IPATH}/sysv.h -nindy.o: ${IPATH}/block_io.h ${IPATH}/env.h ${IPATH}/sysv.h -nindy.o: ${IPATH}/ttycntl.h ${IPATH}/wait.h -ttybreak.o: ${IPATH}/ttycntl.h -ttyflush.o: ${IPATH}/ttycntl.h -Onindy.o: ${IPATH}/block_io.h ${IPATH}/env.h ${IPATH}/sysv.h -Onindy.o: ${IPATH}/ttycntl.h ${IPATH}/wait.h - - -#----------------------------------------------------------------------------- -# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT -# -# 'VERSION' file must be present and contain a string of the form "x.y" -#----------------------------------------------------------------------------- - -ver960.c: FORCE - rm -f ver960.c - echo "char toolib_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c - - -# This target should be invoked before building a new release. -# 'VERSION' file must be present and contain a string of the form "x.y" -# -roll: - @V=`cat VERSION` ; \ - MAJ=`sed 's/\..*//' VERSION` ; \ - MIN=`sed 's/.*\.//' VERSION` ; \ - V=$$MAJ.`expr $$MIN + 1` ; \ - rm -f VERSION ; \ - echo $$V >VERSION ; \ - echo Version $$V - -# Dummy target to force execution of dependent targets. -# -FORCE: - -# 'G960BASE' will be defined at invocation -# -install: - make ${TARG} - mv -f ${TARG} ${G960BASE}/lib - -clean: - rm -f ${TARG} *.o core - -# Target to uncomment host-specific lines in this makefile. Such lines must -# have the following string beginning in column 1: #____# -# Original Makefile is backed up as 'Makefile.old'. -# -# Invoke with: make make HOST=xxx -# -make: - -@if test $(HOST)x = x ; then \ - echo 'Specify "make make HOST=???"'; \ - exit 1; \ - fi ; \ - grep -s "^#The next line was generated by 'make make'" Makefile; \ - if test $$? = 0 ; then \ - echo "Makefile has already been processed with 'make make'";\ - exit 1; \ - fi ; \ - mv -f Makefile Makefile.old; \ - echo "#The next line was generated by 'make make'" >Makefile ; \ - echo "HOST=$(HOST)" >>Makefile ; \ - echo >>Makefile ; \ - sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile diff --git a/gdb/nindy-share/Onindy.c b/gdb/nindy-share/Onindy.c deleted file mode 100644 index f544183..0000000 --- a/gdb/nindy-share/Onindy.c +++ /dev/null @@ -1,743 +0,0 @@ -/* 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 started out life as code shared between the nindy monitor and - GDB. For various reasons, this is no longer true. Eventually, it - probably should be merged into remote-nindy.c. */ - -/****************************************************************************** - * - * NINDY INTERFACE ROUTINES - * - * This version of the NINDY interface routines supports NINDY versions - * 2.13 and older. The older versions used a hex communication protocol, - * instead of the (faster) current binary protocol. These routines have - * been renamed by prepending the letter 'O' to their names, to avoid - * conflict with the current version. The old versions are kept only for - * backward compatibility, and well disappear in a future release. - * - **************************************************************************/ - -/* Having these in a separate file from nindy.c is really ugly, and should - be merged with nindy.c. */ - -#include -#if 0 -#include -#include /* Needed by file.h on Sys V */ -#include -#include -#include -#include /* Needed on Sys V */ -#include "ttycntl.h" -#endif -#include "defs.h" -#include "serial.h" - -#include "block_io.h" -#include "gdb_wait.h" -#include "env.h" - -/* Number of bytes that we send to nindy. I believe this is defined by - the protocol (it does not agree with REGISTER_BYTES). */ -#define OLD_NINDY_REGISTER_BYTES ((36*4) + (4*8)) - -extern int quiet; /* 1 => stifle unnecessary messages */ - -/* tty connected to 960/NINDY board. */ -extern struct serial *nindy_serial; - -static OninStrGet(); - - /**************************** - * * - * MISCELLANEOUS UTILTIES * - * * - ****************************/ - - -/****************************************************************************** - * fromhex: - * Convert a hex ascii digit h to a binary integer - ******************************************************************************/ -static -int -fromhex( h ) - int h; -{ - if (h >= '0' && h <= '9'){ - h -= '0'; - } else if (h >= 'a' && h <= 'f'){ - h -= 'a' - 10; - } else { - h = 0; - } - return (h & 0xff); -} - - -/****************************************************************************** - * hexbin: - * Convert a string of ASCII hex digits to a string of binary bytes. - ******************************************************************************/ -static -hexbin( n, hexp, binp ) - int n; /* Number of bytes to convert (twice this many digits)*/ - char *hexp; /* Get hex from here */ - char *binp; /* Put binary here */ -{ - while ( n-- ){ - *binp++ = (fromhex(*hexp) << 4) | fromhex(*(hexp+1)); - hexp += 2; - } -} - - -/****************************************************************************** - * binhex: - * Convert a string of binary bytes to a string of ASCII hex digits - ******************************************************************************/ -static -binhex( n, binp, hexp ) - int n; /* Number of bytes to convert */ - char *binp; /* Get binary from here */ - char *hexp; /* Place hex here */ -{ - static char tohex[] = "0123456789abcdef"; - - while ( n-- ){ - *hexp++ = tohex[ (*binp >> 4) & 0xf ]; - *hexp++ = tohex[ *binp & 0xf ]; - binp++; - } -} - -/****************************************************************************** - * byte_order: - * If the host byte order is different from 960 byte order (i.e., the - * host is big-endian), reverse the bytes in the passed value; otherwise, - * return the passed value unchanged. - * - ******************************************************************************/ -static -long -byte_order( n ) - long n; -{ - long rev; - int i; - static short test = 0x1234; - - if (*((char *) &test) == 0x12) { - /* - * Big-endian host, swap the bytes. - */ - rev = 0; - for ( i = 0; i < sizeof(n); i++ ){ - rev <<= 8; - rev |= n & 0xff; - n >>= 8; - } - n = rev; - } - return n; -} - -/****************************************************************************** - * say: - * This is a printf that takes at most two arguments (in addition to the - * format string) and that outputs nothing if verbose output has been - * suppressed. - ******************************************************************************/ -static -say( fmt, arg1, arg2 ) - char *fmt; - int arg1, arg2; -{ - if ( !quiet ){ - printf( fmt, arg1, arg2 ); - fflush( stdout ); - } -} - - /***************************** - * * - * LOW-LEVEL COMMUNICATION * - * * - *****************************/ - -/* Read a single character from the remote end. */ - -static int -readchar() -{ - /* FIXME: Do we really want to be reading without a timeout? */ - return serial_readchar (nindy_serial, -1); -} - -/****************************************************************************** - * getpkt: - * Read a packet from a remote NINDY, with error checking, and return - * it in the indicated buffer. - ******************************************************************************/ -static -getpkt (buf) - char *buf; -{ - unsigned char recv; /* Checksum received */ - unsigned char csum; /* Checksum calculated */ - char *bp; /* Poointer into the buffer */ - int c; - - while (1){ - csum = 0; - bp = buf; - /* FIXME: check for error from readchar (). */ - while ( (c = readchar()) != '#' ){ - *bp++ = c; - csum += c; - } - *bp = 0; - - /* FIXME: check for error from readchar (). */ - recv = fromhex(readchar()) << 4; - recv |= fromhex(readchar()); - if ( csum == recv ){ - break; - } - - fprintf(stderr, - "Bad checksum (recv=0x%02x; calc=0x%02x); retrying\r\n", - recv, csum ); - serial_write (nindy_serial, "-", 1); - } - - serial_write (nindy_serial, "+", 1); -} - - -/****************************************************************************** - * putpkt: - * Checksum and send a gdb command to a remote NINDY, and wait for - * positive acknowledgement. - * - ******************************************************************************/ -static -putpkt( cmd ) - char *cmd; /* Command to be sent, without lead ^P (\020) - * or trailing checksum - */ -{ - char ack; /* Response received from NINDY */ - char checksum[4]; - char *p; - unsigned int s; - char resend; - - for ( s='\020', p=cmd; *p; p++ ){ - s += *p; - } - sprintf( checksum, "#%02x", s & 0xff ); - - /* Send checksummed message over and over until we get a positive ack - */ - resend = 1; - do { - if ( resend ) { - serial_write ( nindy_serial, "\020", 1 ); - serial_write( nindy_serial, cmd, strlen(cmd) ); - serial_write( nindy_serial, checksum, strlen(checksum) ); - } - /* FIXME: do we really want to be reading without timeout? */ - ack = serial_readchar (nindy_serial, -1); - if (ack < 0) - { - fprintf (stderr, "error reading from serial port\n"); - } - if ( ack == '-' ){ - fprintf( stderr, "Remote NAK, resending\r\n" ); - resend = 1; - } else if ( ack != '+' ){ - fprintf( stderr, "Bad ACK, ignored: <%c>\r\n", ack ); - resend = 0; - } - } while ( ack != '+' ); -} - - - -/****************************************************************************** - * send: - * Send a message to a remote NINDY and return the reply in the same - * buffer (clobbers the input message). Check for error responses - * as indicated by the second argument. - * - ******************************************************************************/ -static -send( buf, ack_required ) - char *buf; /* Message to be sent to NINDY; replaced by - * NINDY's response. - */ - int ack_required; /* 1 means NINDY's response MUST be either "X00" (no - * error) or an error code "Xnn". - * 0 means the it's OK as long as it doesn't - * begin with "Xnn". - */ -{ - int errnum; - static char *errmsg[] = { - "", /* X00 */ - "Buffer overflow", /* X01 */ - "Unknown command", /* X02 */ - "Wrong amount of data to load register(s)", /* X03 */ - "Missing command argument(s)", /* X04 */ - "Odd number of digits sent to load memory", /* X05 */ - "Unknown register name", /* X06 */ - "No such memory segment", /* X07 */ - "No breakpoint available", /* X08 */ - "Can't set requested baud rate", /* X09 */ - }; -# define NUMERRS ( sizeof(errmsg) / sizeof(errmsg[0]) ) - - static char err0[] = "NINDY failed to acknowledge command: <%s>\r\n"; - static char err1[] = "Unknown error response from NINDY: <%s>\r\n"; - static char err2[] = "Error response %s from NINDY: %s\r\n"; - - putpkt (buf); - getpkt (buf); - - if ( buf[0] != 'X' ){ - if ( ack_required ){ - fprintf( stderr, err0, buf ); - abort(); - } - - } else if ( strcmp(buf,"X00") ){ - sscanf( &buf[1], "%x", &errnum ); - if ( errnum > NUMERRS ){ - fprintf( stderr, err1, buf ); - } else{ - fprintf( stderr, err2, buf, errmsg[errnum] ); - } - abort(); - } -} - - /********************************** - * * - * NINDY INTERFACE ROUTINES * - * * - * ninConnect *MUST* be the first * - * one of these routines called. * - **********************************/ - -/****************************************************************************** - * ninBptDel: - * Ask NINDY to delete the specified type of *hardware* breakpoint at - * the specified address. If the 'addr' is -1, all breakpoints of - * the specified type are deleted. - ******************************************************************************/ -OninBptDel( addr, data ) - long addr; /* Address in 960 memory */ - int data; /* '1' => data bkpt, '0' => instruction breakpoint */ -{ - char buf[100]; - - if ( addr == -1 ){ - sprintf( buf, "b%c", data ? '1' : '0' ); - } else { - sprintf( buf, "b%c%x", data ? '1' : '0', addr ); - } - return send( buf, 0 ); -} - - -/****************************************************************************** - * ninBptSet: - * Ask NINDY to set the specified type of *hardware* breakpoint at - * the specified address. - ******************************************************************************/ -OninBptSet( addr, data ) - long addr; /* Address in 960 memory */ - int data; /* '1' => data bkpt, '0' => instruction breakpoint */ -{ - char buf[100]; - - sprintf( buf, "B%c%x", data ? '1' : '0', addr ); - return send( buf, 0 ); -} - -/****************************************************************************** - * ninGdbExit: - * Ask NINDY to leave GDB mode and print a NINDY prompt. - * Since it'll no longer be in GDB mode, don't wait for a response. - ******************************************************************************/ -OninGdbExit() -{ - putpkt( "E" ); -} - -/****************************************************************************** - * ninGo: - * Ask NINDY to start or continue execution of an application program - * in it's memory at the current ip. - ******************************************************************************/ -OninGo( step_flag ) - int step_flag; /* 1 => run in single-step mode */ -{ - putpkt( step_flag ? "s" : "c" ); -} - - -/****************************************************************************** - * ninMemGet: - * Read a string of bytes from NINDY's address space (960 memory). - ******************************************************************************/ -OninMemGet(ninaddr, hostaddr, len) - long ninaddr; /* Source address, in the 960 memory space */ - char *hostaddr; /* Destination address, in our memory space */ - int len; /* Number of bytes to read */ -{ - /* How much do we send at a time? */ -#define OLD_NINDY_MEMBYTES 1024 - /* Buffer: hex in, binary out */ - char buf[2*OLD_NINDY_MEMBYTES+20]; - - int cnt; /* Number of bytes in next transfer */ - - for ( ; len > 0; len -= OLD_NINDY_MEMBYTES ){ - cnt = len > OLD_NINDY_MEMBYTES ? OLD_NINDY_MEMBYTES : len; - - sprintf( buf, "m%x,%x", ninaddr, cnt ); - send( buf, 0 ); - hexbin( cnt, buf, hostaddr ); - - ninaddr += cnt; - hostaddr += cnt; - } -} - - -/****************************************************************************** - * ninMemPut: - * Write a string of bytes into NINDY's address space (960 memory). - ******************************************************************************/ -OninMemPut( destaddr, srcaddr, len ) - long destaddr; /* Destination address, in NINDY memory space */ - char *srcaddr; /* Source address, in our memory space */ - int len; /* Number of bytes to write */ -{ - char buf[2*OLD_NINDY_MEMBYTES+20]; /* Buffer: binary in, hex out */ - char *p; /* Pointer into buffer */ - int cnt; /* Number of bytes in next transfer */ - - for ( ; len > 0; len -= OLD_NINDY_MEMBYTES ){ - cnt = len > OLD_NINDY_MEMBYTES ? OLD_NINDY_MEMBYTES : len; - - sprintf( buf, "M%x,", destaddr ); - p = buf + strlen(buf); - binhex( cnt, srcaddr, p ); - *(p+(2*cnt)) = '\0'; - send( buf, 1 ); - - srcaddr += cnt; - destaddr += cnt; - } -} - -/****************************************************************************** - * ninRegGet: - * Retrieve the contents of a 960 register, and return them as a long - * in host byte order. - * - * THIS ROUTINE CAN ONLY BE USED TO READ THE LOCAL, GLOBAL, AND - * ip/ac/pc/tc REGISTERS. - * - ******************************************************************************/ -long -OninRegGet( regname ) - char *regname; /* Register name recognized by NINDY, subject to the - * above limitations. - */ -{ - char buf[200]; - long val; - - sprintf( buf, "u%s", regname ); - send( buf, 0 ); - hexbin( 4, buf, (char *)&val ); - return byte_order(val); -} - -/****************************************************************************** - * ninRegPut: - * Set the contents of a 960 register. - * - * THIS ROUTINE CAN ONLY BE USED TO SET THE LOCAL, GLOBAL, AND - * ip/ac/pc/tc REGISTERS. - * - ******************************************************************************/ -OninRegPut( regname, val ) - char *regname; /* Register name recognized by NINDY, subject to the - * above limitations. - */ - long val; /* New contents of register, in host byte-order */ -{ - char buf[200]; - - sprintf( buf, "U%s,%08x", regname, byte_order(val) ); - send( buf, 1 ); -} - -/****************************************************************************** - * ninRegsGet: - * Get a dump of the contents of the entire 960 register set. The - * individual registers appear in the dump in the following order: - * - * pfp sp rip r3 r4 r5 r6 r7 - * r8 r9 r10 r11 r12 r13 r14 r15 - * g0 g1 g2 g3 g4 g5 g6 g7 - * g8 g9 g10 g11 g12 g13 g14 fp - * pc ac ip tc fp0 fp1 fp2 fp3 - * - * Each individual register comprises exactly 4 bytes, except for - * fp0-fp3, which are 8 bytes. - * - * WARNING: - * Each register value is in 960 (little-endian) byte order. - * - ******************************************************************************/ -OninRegsGet( regp ) - char *regp; /* Where to place the register dump */ -{ - char buf[(2*OLD_NINDY_REGISTER_BYTES)+10]; /* Registers in ASCII hex */ - - strcpy( buf, "r" ); - send( buf, 0 ); - hexbin( OLD_NINDY_REGISTER_BYTES, buf, regp ); -} - -/****************************************************************************** - * ninRegsPut: - * Initialize the entire 960 register set to a specified set of values. - * The format of the register value data should be the same as that - * returned by ninRegsGet. - * - * WARNING: - * Each register value should be in 960 (little-endian) byte order. - * - ******************************************************************************/ -OninRegsPut( regp ) - char *regp; /* Pointer to desired values of registers */ -{ - char buf[(2*OLD_NINDY_REGISTER_BYTES)+10]; /* Registers in ASCII hex */ - - buf[0] = 'R'; - binhex( OLD_NINDY_REGISTER_BYTES, regp, buf+1 ); - buf[ (2*OLD_NINDY_REGISTER_BYTES)+1 ] = '\0'; - - send( buf, 1 ); -} - - -/****************************************************************************** - * ninReset: - * Ask NINDY to perform a soft reset; wait for the reset to complete. - ******************************************************************************/ -OninReset() -{ - - putpkt( "X" ); - /* FIXME: check for error from readchar (). */ - while ( readchar() != '+' ){ - ; - } -} - - -/****************************************************************************** - * ninSrq: - * Assume NINDY has stopped execution of the 960 application program in - * order to process a host service request (srq). Ask NINDY for the - * srq arguments, perform the requested service, and send an "srq - * complete" message so NINDY will return control to the application. - * - ******************************************************************************/ -OninSrq() -{ - /* FIXME: Imposes arbitrary limits on lengths of pathnames and such. */ - char buf[BUFSIZE]; - int retcode; - unsigned char srqnum; - char *p; - char *argp; - int nargs; - int arg[MAX_SRQ_ARGS]; - - - /* Get srq number and arguments - */ - strcpy( buf, "!" ); - send( buf, 0 ); - hexbin( 1, buf, (char *)&srqnum ); - - /* Set up array of pointers the each of the individual - * comma-separated args - */ - nargs=0; - argp = p = buf+2; - while ( 1 ){ - while ( *p != ',' && *p != '\0' ){ - p++; - } - sscanf( argp, "%x", &arg[nargs++] ); - if ( *p == '\0' || nargs == MAX_SRQ_ARGS ){ - break; - } - argp = ++p; - } - - /* Process Srq - */ - switch( srqnum ){ - case BS_CLOSE: - /* args: file descriptor */ - if ( arg[0] > 2 ){ - retcode = close( arg[0] ); - } else { - retcode = 0; - } - break; - case BS_CREAT: - /* args: filename, mode */ - OninStrGet( arg[0], buf ); - retcode = creat(buf,arg[1]); - break; - case BS_OPEN: - /* args: filename, flags, mode */ - OninStrGet( arg[0], buf ); - retcode = open(buf,arg[1],arg[2]); - break; - case BS_READ: - /* args: file descriptor, buffer, count */ - retcode = read(arg[0],buf,arg[2]); - if ( retcode > 0 ){ - OninMemPut( arg[1], buf, retcode ); - } - break; - case BS_SEEK: - /* args: file descriptor, offset, whence */ - retcode = lseek(arg[0],arg[1],arg[2]); - break; - case BS_WRITE: - /* args: file descriptor, buffer, count */ - OninMemGet( arg[1], buf, arg[2] ); - retcode = write(arg[0],buf,arg[2]); - break; - default: - retcode = -1; - break; - } - - /* Tell NINDY to continue - */ - sprintf( buf, "e%x", retcode ); - send( buf, 1 ); -} - - -/****************************************************************************** - * ninStopWhy: - * Assume the application program has stopped (i.e., a DLE was received - * from NINDY). Ask NINDY for status information describing the - * reason for the halt. - * - * Returns a non-zero value if the user program has exited, 0 otherwise. - * Also returns the following information, through passed pointers: - * - why: an exit code if program the exited; otherwise the reason - * why the program halted (see stop.h for values). - * - contents of register ip (little-endian byte order) - * - contents of register sp (little-endian byte order) - * - contents of register fp (little-endian byte order) - ******************************************************************************/ -char -OninStopWhy( whyp, ipp, fpp, spp ) - char *whyp; /* Return the 'why' code through this pointer */ - char *ipp; /* Return contents of register ip through this pointer */ - char *fpp; /* Return contents of register fp through this pointer */ - char *spp; /* Return contents of register sp through this pointer */ -{ - char buf[30]; - char stop_exit; - - strcpy( buf, "?" ); - send( buf, 0 ); - hexbin( 1, buf, &stop_exit ); - hexbin( 1, buf+2, whyp ); - hexbin( 4, buf+4, ipp ); - hexbin( 4, buf+12, fpp ); - hexbin( 4, buf+20, spp ); - return stop_exit; -} - -/****************************************************************************** - * ninStrGet: - * Read a '\0'-terminated string of data out of the 960 memory space. - * - ******************************************************************************/ -static -OninStrGet( ninaddr, hostaddr ) - unsigned long ninaddr; /* Address of string in NINDY memory space */ - char *hostaddr; /* Address of the buffer to which string should - * be copied. - */ -{ - /* FIXME: seems to be an arbitrary limit on the length of the string. */ - char buf[BUFSIZE]; /* String as 2 ASCII hex digits per byte */ - int numchars; /* Length of string in bytes. */ - - sprintf( buf, "\"%x", ninaddr ); - send( buf, 0 ); - numchars = strlen(buf)/2; - hexbin( numchars, buf, hostaddr ); - hostaddr[numchars] = '\0'; -} - -#if 0 -/* never used. */ - -/****************************************************************************** - * ninVersion: - * Ask NINDY for version information about itself. - * The information is sent as an ascii string in the form "x.xx,", - * where, - * x.xx is the version number - * is the processor architecture: "KA", "KB", "MC", "CA" * - * - ******************************************************************************/ -int -OninVersion( p ) - char *p; /* Where to place version string */ -{ - /* FIXME: this is an arbitrary limit on the length of version string. */ - char buf[BUFSIZE]; - - strcpy( buf, "v" ); - send( buf, 0 ); - strcpy( p, buf ); - return strlen( buf ); -} -#endif diff --git a/gdb/nindy-share/README b/gdb/nindy-share/README deleted file mode 100644 index 3f217ad..0000000 --- a/gdb/nindy-share/README +++ /dev/null @@ -1,3 +0,0 @@ -The files in this directory started out life as code shared between -the nindy monitor and GDB. For various reasons, this is no longer -true. Eventually, they probably should be merged into remote-nindy.c. diff --git a/gdb/nindy-share/VERSION b/gdb/nindy-share/VERSION deleted file mode 100644 index 5625e59..0000000 --- a/gdb/nindy-share/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.2 diff --git a/gdb/nindy-share/b.out.h b/gdb/nindy-share/b.out.h deleted file mode 100644 index a82c261..0000000 --- a/gdb/nindy-share/b.out.h +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright 1992 Free Software Foundation, Inc. - * - * This file is a modified version of 'a.out.h'. It is to be used in all - * all GNU tools modified to support the i80960 (or tools that operate on - * object files created by such tools). - * - * All i80960 development is done in a CROSS-DEVELOPMENT environment. I.e., - * object code is generated on, and executed under the direction of a symbolic - * debugger running on, a host system. We do not want to be subject to the - * vagaries of which host it is or whether it supports COFF or a.out format, - * or anything else. We DO want to: - * - * o always generate the same format object files, regardless of host. - * - * o have an 'a.out' header that we can modify for our own purposes - * (the 80960 is typically an embedded processor and may require - * enhanced linker support that the normal a.out.h header can't - * accommodate). - * - * As for byte-ordering, the following rules apply: - * - * o Text and data that is actually downloaded to the target is always - * in i80960 (little-endian) order. - * - * o All other numbers (in the header, symbols, relocation directives) - * are in host byte-order: object files CANNOT be lifted from a - * little-end host and used on a big-endian (or vice versa) without - * modification. - * - * o The downloader ('comm960') takes care to generate a pseudo-header - * with correct (i80960) byte-ordering before shipping text and data - * off to the NINDY monitor in the target systems. Symbols and - * relocation info are never sent to the target. - */ - - -#define BMAGIC 0415 -/* We don't accept the following (see N_BADMAG macro). - * They're just here so GNU code will compile. - */ -#define OMAGIC 0407 /* old impure format */ -#define NMAGIC 0410 /* read-only text */ -#define ZMAGIC 0413 /* demand load format */ - -/* FILE HEADER - * All 'lengths' are given as a number of bytes. - * All 'alignments' are for relinkable files only; an alignment of - * 'n' indicates the corresponding segment must begin at an - * address that is a multiple of (2**n). - */ -struct exec { - /* Standard stuff */ - unsigned long a_magic; /* Identifies this as a b.out file */ - unsigned long a_text; /* Length of text */ - unsigned long a_data; /* Length of data */ - unsigned long a_bss; /* Length of runtime uninitialized data area */ - unsigned long a_syms; /* Length of symbol table */ - unsigned long a_entry; /* Runtime start address */ - unsigned long a_trsize; /* Length of text relocation info */ - unsigned long a_drsize; /* Length of data relocation info */ - - /* Added for i960 */ - unsigned long a_tload; /* Text runtime load address */ - unsigned long a_dload; /* Data runtime load address */ - unsigned char a_talign; /* Alignment of text segment */ - unsigned char a_dalign; /* Alignment of data segment */ - unsigned char a_balign; /* Alignment of bss segment */ - unsigned char unused; /* (Just to make struct size a multiple of 4) */ -}; - -#define N_BADMAG(x) (((x).a_magic)!=BMAGIC) -#define N_TXTOFF(x) ( sizeof(struct exec) ) -#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) -#define N_TROFF(x) ( N_DATOFF(x) + (x).a_data ) -#define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize ) -#define N_SYMOFF(x) ( N_DROFF(x) + (x).a_drsize ) -#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms ) - -/* A single entry in the symbol table - */ -struct nlist { - union { - char *n_name; - struct nlist *n_next; - long n_strx; /* Index into string table */ - } n_un; - unsigned char n_type; /* See below */ - char n_other; /* Used in i80960 support -- see below */ - short n_desc; - unsigned long n_value; -}; - - -/* Legal values of n_type - */ -#define N_UNDF 0 /* Undefined symbol */ -#define N_ABS 2 /* Absolute symbol */ -#define N_TEXT 4 /* Text symbol */ -#define N_DATA 6 /* Data symbol */ -#define N_BSS 8 /* BSS symbol */ -#define N_FN 31 /* Filename symbol */ - -#define N_EXT 1 /* External symbol (OR'd in with one of above) */ -#define N_TYPE 036 /* Mask for all the type bits */ -#define N_STAB 0340 /* Mask for all bits used for SDB entries */ - -/* MEANING OF 'n_other' - * - * If non-zero, the 'n_other' fields indicates either a leaf procedure or - * a system procedure, as follows: - * - * 1 <= n_other <= 32 : - * The symbol is the entry point to a system procedure. - * 'n_value' is the address of the entry, as for any other - * procedure. The system procedure number (which can be used in - * a 'calls' instruction) is (n_other-1). These entries come from - * '.sysproc' directives. - * - * n_other == N_CALLNAME - * the symbol is the 'call' entry point to a leaf procedure. - * The *next* symbol in the symbol table must be the corresponding - * 'bal' entry point to the procedure (see following). These - * entries come from '.leafproc' directives in which two different - * symbols are specified (the first one is represented here). - * - * - * n_other == N_BALNAME - * the symbol is the 'bal' entry point to a leaf procedure. - * These entries result from '.leafproc' directives in which only - * one symbol is specified, or in which the same symbol is - * specified twice. - * - * Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry, - * but not every N_BALNAME entry must have an N_CALLNAME entry. - */ -#define N_CALLNAME -1 -#define N_BALNAME -2 - - -struct relocation_info { - int r_address; /* File address of item to be relocated */ - unsigned - r_symbolnum:24,/* Index of symbol on which relocation is based*/ - r_pcrel:1, /* 1 => relocate PC-relative; else absolute - * On i960, pc-relative implies 24-bit - * address, absolute implies 32-bit. - */ - r_length:2, /* Number of bytes to relocate: - * 0 => 1 byte - * 1 => 2 bytes - * 2 => 4 bytes -- only value used for i960 - */ - r_extern:1, - r_bsr:1, /* Something for the GNU NS32K assembler */ - r_disp:1, /* Something for the GNU NS32K assembler */ - r_callj:1, /* 1 if relocation target is an i960 'callj' */ - nuthin:1; /* Unused */ -}; diff --git a/gdb/nindy-share/block_io.h b/gdb/nindy-share/block_io.h deleted file mode 100644 index 6521cdb..0000000 --- a/gdb/nindy-share/block_io.h +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************** - Copyright 1990, 1992 Free Software Foundation, Inc. - - This code was donated by Intel Corp. - - Intel hereby grants you permission to copy, modify, and - distribute this software and its documentation. Intel grants - this permission provided that the above copyright notice - appears in all copies and that both the copyright notice and - this permission notice appear in supporting documentation. In - addition, Intel grants this permission provided that you - prominently mark as not part of the original any modifications - made to this software or documentation, and that the name of - Intel Corporation not be used in advertising or publicity - pertaining to distribution of the software or the documentation - without specific, written prior permission. - - Intel Corporation does not warrant, guarantee or make any - representations regarding the use of, or the results of the use - of, the software and documentation in terms of correctness, - accuracy, reliability, currentness, or otherwise; and you rely - on the software, documentation and results solely at your own - risk. */ -/******************************************************************/ - -/***************************************************************************** - * Structures and definitions supporting NINDY requests for services by a - * remote host. Used by NINDY monitor, library libnin, comm960, gdb960, - * etc. Also contains some defines for NINDY console I/O requests. - *****************************************************************************/ - -/* the following four are hardware dependent */ -#define BIT_16 short -#define BIT_32 int -#define UBIT_16 unsigned short -#define UBIT_32 unsigned int - -/* Service request numbers -- these are the services that can be asked of the - * host. - */ -#define BS_ACCESS 0x10 -#define BS_CLOSE 0x20 -#define BS_CREAT 0x30 -#define BS_SEEK 0x40 -#define BS_OPEN 0x50 -#define BS_READ 0x60 -#define BS_STAT 0x70 -#define BS_SYSTEMD 0x80 -#define BS_TIME 0x90 -#define BS_UNMASK 0xa0 -#define BS_UNLINK 0xb0 -#define BS_WRITE 0xc0 - - -/* Maximum number of arguments to any of the above service requests - * (in addition to the request number). - */ -#define MAX_SRQ_ARGS 3 - -/* Number of bytes of data that can be read or written by a single I/O request - */ -#define BUFSIZE 1024 - -/* NINDY console I/O requests: CO sends a single character to stdout, - * CI reads one. - */ -#define CI 0 -#define CO 1 diff --git a/gdb/nindy-share/coff.h b/gdb/nindy-share/coff.h deleted file mode 100644 index b169b71..0000000 --- a/gdb/nindy-share/coff.h +++ /dev/null @@ -1,336 +0,0 @@ -/* Copyright 1990, 1992 Free Software Foundation, Inc. - * - * This code was donated by Intel Corp. - * - * This is a coff version of a.out.h to support 80960 debugging from - * a Unix (possibly BSD) host. It's used by: - * o gdb960 to symbols in code generated with Intel (non-GNU) tools. - * o comm960 to convert a b.out file to a coff file for download. - */ - - -/********************** FILE HEADER **********************/ - -struct filehdr { - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* number of sections */ - long f_timdat; /* time & date stamp */ - long f_symptr; /* file pointer to symtab */ - long f_nsyms; /* number of symtab entries */ - unsigned short f_opthdr; /* sizeof(optional hdr) */ - unsigned short f_flags; /* flags */ -}; - - -/* Bits for f_flags: - * F_RELFLG relocation info stripped from file - * F_EXEC file is executable (no unresolved externel references) - * F_LNNO line nunbers stripped from file - * F_LSYMS local symbols stripped from file - * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) - */ -#define F_RELFLG 0000001 -#define F_EXEC 0000002 -#define F_LNNO 0000004 -#define F_LSYMS 0000010 -#define F_AR32WR 0000400 - - -/* - * Intel 80960 (I960) processor flags. - * F_I960TYPE == mask for processor type field. - */ -#define F_I960TYPE 0170000 -#define F_I960CA 0010000 -#define F_I960FLOAT 0020000 -#define F_I960BA 0030000 -#define F_I960XA 0040000 - -/* - * i80960 Magic Numbers - */ -#define I960ROMAGIC 0540 /* read-only text segments */ -#define I960RWMAGIC 0541 /* read-write text segments */ - -#define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC)) - -#define FILHDR struct filehdr -#define FILHSZ sizeof(FILHDR) - - -/********************** AOUT "OPTIONAL HEADER" **********************/ - -typedef struct { - unsigned long phys_addr; - unsigned long bitarray; -} TAGBITS; - -typedef struct aouthdr { - short magic; /* type of file */ - short vstamp; /* version stamp */ - unsigned long tsize; /* text size in bytes, padded to FW bdry*/ - unsigned long dsize; /* initialized data " " */ - unsigned long bsize; /* uninitialized data " " */ -#if U3B - unsigned long dum1; - unsigned long dum2; /* pad to entry point */ -#endif - unsigned long entry; /* entry pt. */ - unsigned long text_start; /* base of text used for this file */ - unsigned long data_start; /* base of data used for this file */ - unsigned long tagentries; /* number of tag entries to follow */ -} AOUTHDR; - -/* return a pointer to the tag bits array */ - -#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1)) - -/* compute size of a header */ - -#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS))) - -/********************** STORAGE CLASSES **********************/ - -#define C_EFCN -1 /* physical end of function */ -#define C_NULL 0 -#define C_AUTO 1 /* automatic variable */ -#define C_EXT 2 /* external symbol */ -#define C_STAT 3 /* static */ -#define C_REG 4 /* register variable */ -#define C_EXTDEF 5 /* external definition */ -#define C_LABEL 6 /* label */ -#define C_ULABEL 7 /* undefined label */ -#define C_MOS 8 /* member of structure */ -#define C_ARG 9 /* function argument */ -#define C_STRTAG 10 /* structure tag */ -#define C_MOU 11 /* member of union */ -#define C_UNTAG 12 /* union tag */ -#define C_TPDEF 13 /* type definition */ -#define C_USTATIC 14 /* undefined static */ -#define C_ENTAG 15 /* enumeration tag */ -#define C_MOE 16 /* member of enumeration */ -#define C_REGPARM 17 /* register parameter */ -#define C_FIELD 18 /* bit field */ -#define C_BLOCK 100 /* ".bb" or ".eb" */ -#define C_FCN 101 /* ".bf" or ".ef" */ -#define C_EOS 102 /* end of structure */ -#define C_FILE 103 /* file name */ -#define C_LINE 104 /* line # reformatted as symbol table entry */ -#define C_ALIAS 105 /* duplicate tag */ -#define C_HIDDEN 106 /* ext symbol in dmert public lib */ - - /* New storage classes for 80960 */ - -#define C_SCALL 107 /* Procedure reachable via system call */ -#define C_LEAFPROC 108 /* Leaf procedure, "call" via BAL */ - - -/********************** SECTION HEADER **********************/ - -struct scnhdr { - char s_name[8]; /* section name */ - long s_paddr; /* physical address, aliased s_nlib */ - long s_vaddr; /* virtual address */ - long s_size; /* section size */ - long s_scnptr; /* file ptr to raw data for section */ - long s_relptr; /* file ptr to relocation */ - long s_lnnoptr; /* file ptr to line numbers */ - unsigned short s_nreloc; /* number of relocation entries */ - unsigned short s_nlnno; /* number of line number entries*/ - long s_flags; /* flags */ - unsigned long s_align; /* section alignment */ -}; - -/* - * names of "special" sections - */ -#define _TEXT ".text" -#define _DATA ".data" -#define _BSS ".bss" - -/* - * s_flags "type" - */ -#define STYP_TEXT 0x20 /* section contains text only */ -#define STYP_DATA 0x40 /* section contains data only */ -#define STYP_BSS 0x80 /* section contains bss only */ - -#define SCNHDR struct scnhdr -#define SCNHSZ sizeof(SCNHDR) - - -/********************** LINE NUMBERS **********************/ - -/* 1 line number entry for every "breakpointable" source line in a section. - * Line numbers are grouped on a per function basis; first entry in a function - * grouping will have l_lnno = 0 and in place of physical address will be the - * symbol table index of the function name. - */ -struct lineno{ - union { - long l_symndx; /* function name symbol index, iff l_lnno == 0*/ - long l_paddr; /* (physical) address of line number */ - } l_addr; - unsigned short l_lnno; /* line number */ - char padding[2]; /* force alignment */ -}; - -#define LINENO struct lineno -#define LINESZ sizeof(LINENO) - - -/********************** SYMBOLS **********************/ - -#define SYMNMLEN 8 /* # characters in a symbol name */ -#define FILNMLEN 14 /* # characters in a file name */ -#define DIMNUM 4 /* # array dimensions in auxiliary entry */ - - -struct syment { - union { - char _n_name[SYMNMLEN]; /* old COFF version */ - struct { - long _n_zeroes; /* new == 0 */ - long _n_offset; /* offset into string table */ - } _n_n; - char *_n_nptr[2]; /* allows for overlaying */ - } _n; - long n_value; /* value of symbol */ - short n_scnum; /* section number */ - char pad1[2]; /* force alignment */ - unsigned long n_type; /* type and derived type */ - char n_sclass; /* storage class */ - char n_numaux; /* number of aux. entries */ - char pad2[2]; /* force alignment */ -}; - -#define n_name _n._n_name -#define n_zeroes _n._n_n._n_zeroes -#define n_offset _n._n_n._n_offset - -/* - * Relocatable symbols have number of the section in which they are defined, - * or one of the following: - */ -#define N_UNDEF 0 /* undefined symbol */ -#define N_ABS -1 /* value of symbol is absolute */ -#define N_DEBUG -2 /* debugging symbol -- symbol value is meaningless */ - -/* - * Type of a symbol, in low 4 bits of the word - */ -#define T_NULL 0 -#define T_VOID 1 /* function argument (only used by compiler) */ -#define T_CHAR 2 /* character */ -#define T_SHORT 3 /* short integer */ -#define T_INT 4 /* integer */ -#define T_LONG 5 /* long integer */ -#define T_FLOAT 6 /* floating point */ -#define T_DOUBLE 7 /* double word */ -#define T_STRUCT 8 /* structure */ -#define T_UNION 9 /* union */ -#define T_ENUM 10 /* enumeration */ -#define T_MOE 11 /* member of enumeration*/ -#define T_UCHAR 12 /* unsigned character */ -#define T_USHORT 13 /* unsigned short */ -#define T_UINT 14 /* unsigned integer */ -#define T_ULONG 15 /* unsigned long */ -#define T_LNGDBL 16 /* long double */ - - -/* - * derived types - */ -#define DT_PTR 1 /* pointer */ -#define DT_FCN 2 /* function */ -#define DT_ARY 3 /* array */ - -#define N_BTMASK 037 -#define N_TMASK 0140 -#define N_BTSHFT 5 -#define N_TSHIFT 2 - -#define BTYPE(x) ((x) & N_BTMASK) - - -#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) -#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) -#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) - -#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) - -union auxent { - struct { - long x_tagndx; /* str, un, or enum tag indx */ - union { - struct { - unsigned short x_lnno; /* declaration line number */ - unsigned short x_size; /* str/union/array size */ - } x_lnsz; - long x_fsize; /* size of function */ - } x_misc; - union { - struct { /* if ISFCN, tag, or .bb */ - long x_lnnoptr; /* ptr to fcn line # */ - long x_endndx; /* entry ndx past block end */ - } x_fcn; - struct { /* if ISARY, up to 4 dimen. */ - unsigned short x_dimen[DIMNUM]; - } x_ary; - } x_fcnary; - unsigned short x_tvndx; /* tv index */ - } x_sym; - - union { - char x_fname[FILNMLEN]; - struct { - long x_zeroes; - long x_offset; - } x_n; - } x_file; - - struct { - long x_scnlen; /* section length */ - unsigned short x_nreloc; /* # relocation entries */ - unsigned short x_nlinno; /* # line numbers */ - } x_scn; - - struct { - long x_stdindx; - } x_sc; - - struct { - unsigned long x_balntry; - } x_bal; - - char a[sizeof(struct syment)]; /* force auxent/syment sizes to match */ -}; - -#define SYMENT struct syment -#define SYMESZ sizeof(SYMENT) -#define AUXENT union auxent -#define AUXESZ sizeof(AUXENT) - -#if VAX || I960 -# define _ETEXT "_etext" -#else -# define _ETEXT "etext" -#endif - -/********************** RELOCATION DIRECTIVES **********************/ - -struct reloc { - long r_vaddr; /* Virtual address of reference */ - long r_symndx; /* Index into symbol table */ - unsigned short r_type; /* Relocation type */ - char pad[2]; /* Unused */ -}; - -/* Only values of r_type GNU/960 cares about */ -#define R_RELLONG 17 /* Direct 32-bit relocation */ -#define R_IPRMED 25 /* 24-bit ip-relative relocation */ -#define R_OPTCALL 27 /* 32-bit optimizable call (leafproc/sysproc) */ - - -#define RELOC struct reloc -#define RELSZ sizeof(RELOC) diff --git a/gdb/nindy-share/env.h b/gdb/nindy-share/env.h deleted file mode 100644 index 4343d8b..0000000 --- a/gdb/nindy-share/env.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright 1990, 1991 Free Software Foundation, Inc. - * - * This code was donated by Intel Corp. - * - * GNU/960 tool runtime environment - */ - - -/* Base directory at which GNU/960 tools are assumed to be installed, if - * the environment variable G960BASE is not defined. - */ -#define DEFAULT_BASE "/usr/local/g960" diff --git a/gdb/nindy-share/nindy.c b/gdb/nindy-share/nindy.c deleted file mode 100644 index 77dd734..0000000 --- a/gdb/nindy-share/nindy.c +++ /dev/null @@ -1,1154 +0,0 @@ -/* 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 started out life as code shared between the nindy monitor and - GDB. For various reasons, this is no longer true. Eventually, it - probably should be merged into remote-nindy.c. */ - -/****************************************************************************** - * - * NINDY INTERFACE ROUTINES - * - * The caller of these routines should be aware that: - * - * (1) ninConnect() should be called to open communications with the - * remote NINDY board before any of the other routines are invoked. - * - * (2) almost all interactions are driven by the host: nindy sends information - * in response to host commands. - * - * (3) the lone exception to (2) is the single character DLE (^P, 0x10). - * Receipt of a DLE from NINDY indicates that the application program - * running under NINDY has stopped execution and that NINDY is now - * available to talk to the host (all other communication received after - * the application has been started should be presumed to come from the - * application and should be passed on by the host to stdout). - * - * (4) the reason the application program stopped can be determined with the - * ninStopWhy() function. There are three classes of stop reasons: - * - * (a) the application has terminated execution. - * The host should take appropriate action. - * - * (b) the application had a fault or trace event. - * The host should take appropriate action. - * - * (c) the application wishes to make a service request (srq) of the host; - * e.g., to open/close a file, read/write a file, etc. The ninSrq() - * function should be called to determine the nature of the request - * and process it. - */ - -#include -#include "defs.h" -#include "serial.h" -#ifdef ANSI_PROTOTYPES -#include -#else -#include -#endif - -#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY) -#define HAVE_SGTTY -#endif - -#ifdef HAVE_SGTTY -#include -#endif - -#include /* Needed by file.h on Sys V */ -#include -#include -#include - -#if 0 -#include "ttycntl.h" -#endif -#include "block_io.h" -#include "gdb_wait.h" -#include "env.h" - -#define DLE 0x10 /* ^P */ -#define XON 0x11 /* ^Q */ -#define XOFF 0x13 /* ^S */ -#define ESC 0x1b - -#define TIMEOUT -1 - -int quiet = 0; /* 1 => stifle unnecessary messages */ -struct serial *nindy_serial; - -static int old_nindy = 0; /* 1 => use old (hex) communication protocol */ -static ninStrGet(); - - /**************************** - * * - * MISCELLANEOUS UTILTIES * - * * - ****************************/ - -/****************************************************************************** - * say: - * This is a printf that takes at most two arguments (in addition to the - * format string) and that outputs nothing if verbose output has been - * suppressed. - *****************************************************************************/ - -/* VARARGS */ -static void -#ifdef ANSI_PROTOTYPES -say (char *fmt, ...) -#else -say (va_alist) - va_dcl -#endif -{ - va_list args; -#ifdef ANSI_PROTOTYPES - va_start(args, fmt); -#else - char *fmt; - - va_start (args); - fmt = va_arg (args, char *); -#endif - - if (!quiet) - { - vfprintf_unfiltered (gdb_stdout, fmt, args); - gdb_flush (gdb_stdout); - } - va_end (args); -} - -/****************************************************************************** - * exists: - * Creates a full pathname by concatenating up to three name components - * onto a specified base name; optionally looks up the base name as a - * runtime environment variable; and checks to see if the file or - * directory specified by the pathname actually exists. - * - * Returns: the full pathname if it exists, NULL otherwise. - * (returned pathname is in malloc'd memory and must be freed - * by caller). - *****************************************************************************/ -static char * -exists( base, c1, c2, c3, env ) - char *base; /* Base directory of path */ - char *c1, *c2, *c3; /* Components (subdirectories and/or file name) to be - * appended onto the base directory name. One or - * more may be omitted by passing NULL pointers. - */ - int env; /* If 1, '*base' is the name of an environment variable - * to be examined for the base directory name; - * otherwise, '*base' is the actual name of the - * base directory. - */ -{ - struct stat buf;/* For call to 'stat' -- never examined */ - char *path; /* Pointer to full pathname (malloc'd memory) */ - int len; /* Length of full pathname (incl. terminator) */ - extern char *getenv(); - - - if ( env ){ - base = getenv( base ); - if ( base == NULL ){ - return NULL; - } - } - - len = strlen(base) + 4; - /* +4 for terminator and "/" before each component */ - if ( c1 != NULL ){ - len += strlen(c1); - } - if ( c2 != NULL ){ - len += strlen(c2); - } - if ( c3 != NULL ){ - len += strlen(c3); - } - - path = xmalloc (len); - - strcpy( path, base ); - if ( c1 != NULL ){ - strcat( path, "/" ); - strcat( path, c1 ); - if ( c2 != NULL ){ - strcat( path, "/" ); - strcat( path, c2 ); - if ( c3 != NULL ){ - strcat( path, "/" ); - strcat( path, c3 ); - } - } - } - - if ( stat(path,&buf) != 0 ){ - free( path ); - path = NULL; - } - return path; -} - - /***************************** - * * - * LOW-LEVEL COMMUNICATION * - * * - *****************************/ - -/* Read *exactly* N characters from the NINDY tty, and put them in - *BUF. Translate escape sequences into single characters, counting - each such sequence as 1 character. - - An escape sequence consists of ESC and a following character. The - ESC is discarded and the other character gets bit 0x40 cleared -- - thus ESC P == ^P, ESC S == ^S, ESC [ == ESC, etc. - - Return 1 if successful, 0 if more than TIMEOUT seconds pass without - any input. */ - -static int -rdnin (buf,n,timeout) - unsigned char * buf; /* Where to place characters read */ - int n; /* Number of characters to read */ - int timeout; /* Timeout, in seconds */ -{ - int escape_seen; /* 1 => last character of a read was an ESC */ - int c; - - escape_seen = 0; - while (n) - { - c = serial_readchar (nindy_serial, timeout); - switch (c) - { - case SERIAL_ERROR: - case SERIAL_TIMEOUT: - case SERIAL_EOF: - return 0; - - case ESC: - escape_seen = 1; - break; - - default: - if (escape_seen) - { - escape_seen = 0; - c &= ~0x40; - } - *buf++ = c; - --n; - break; - } - } - return 1; -} - - -/****************************************************************************** - * getpkt: - * Read a packet from a remote NINDY, with error checking, into the - * indicated buffer. - * - * Return packet status byte on success, TIMEOUT on failure. - ******************************************************************************/ -static -int -getpkt(buf) - unsigned char *buf; -{ - int i; - unsigned char hdr[3]; /* Packet header: - * hdr[0] = low byte of message length - * hdr[1] = high byte of message length - * hdr[2] = message status - */ - int cnt; /* Message length (status byte + data) */ - unsigned char cs_calc; /* Checksum calculated */ - unsigned char cs_recv; /* Checksum received */ - static char errfmt[] = - "Bad checksum (recv=0x%02x; calc=0x%02x); retrying\r\n"; - - while (1){ - if ( !rdnin(hdr,3,5) ){ - return TIMEOUT; - } - cnt = (hdr[1]<<8) + hdr[0] - 1; - /* -1 for status byte (already read) */ - - /* Caller's buffer may only be big enough for message body, - * without status byte and checksum, so make sure to read - * checksum into a separate buffer. - */ - if ( !rdnin(buf,cnt,5) || !rdnin(&cs_recv,1,5) ){ - return TIMEOUT; - } - - /* Calculate checksum - */ - cs_calc = hdr[0] + hdr[1] + hdr[2]; - for ( i = 0; i < cnt; i++ ){ - cs_calc += buf[i]; - } - if ( cs_calc == cs_recv ){ - serial_write (nindy_serial, "+", 1); - return hdr[2]; - } - - /* Bad checksum: report, send NAK, and re-receive - */ - fprintf(stderr, errfmt, cs_recv, cs_calc ); - serial_write (nindy_serial, "-", 1); - } -} - - -/****************************************************************************** - * putpkt: - * Send a packet to NINDY, checksumming it and converting special - * characters to escape sequences. - ******************************************************************************/ - -/* This macro puts the character 'c' into the buffer pointed at by 'p', - * and increments the pointer. If 'c' is one of the 4 special characters - * in the transmission protocol, it is converted into a 2-character - * escape sequence. - */ -#define PUTBUF(c,p) \ - if ( c == DLE || c == ESC || c == XON || c == XOFF ){ \ - *p++ = ESC; \ - *p++ = c | 0x40; \ - } else { \ - *p++ = c; \ - } - -static -putpkt( msg, len ) - unsigned char *msg; /* Command to be sent, without lead ^P (\020) or checksum */ - int len; /* Number of bytes in message */ -{ - static char *buf = NULL;/* Local buffer -- build packet here */ - static int maxbuf = 0; /* Current length of buffer */ - unsigned char ack; /* Response received from NINDY */ - unsigned char checksum; /* Packet checksum */ - char *p; /* Pointer into buffer */ - int lenhi, lenlo; /* High and low bytes of message length */ - int i; - - - /* Make sure local buffer is big enough. Must include space for - * packet length, message body, and checksum. And in the worst - * case, each character would expand into a 2-character escape - * sequence. - */ - if ( maxbuf < ((2*len)+10) ){ - if ( buf ){ - free( buf ); - } - buf = xmalloc( maxbuf=((2*len)+10) ); - } - - /* Attention, NINDY! - */ - serial_write (nindy_serial, "\020", 1); - - - lenlo = len & 0xff; - lenhi = (len>>8) & 0xff; - checksum = lenlo + lenhi; - p = buf; - - PUTBUF( lenlo, p ); - PUTBUF( lenhi, p ); - - for ( i=0; i\r\n", ack ); - } - } -} - - - -/****************************************************************************** - * send: - * Send a message to a remote NINDY. Check message status byte - * for error responses. If no error, return NINDY reponse (if any). - ******************************************************************************/ -static -send( out, len, in ) - unsigned char *out; /* Message to be sent to NINDY */ - int len; /* Number of meaningful bytes in out buffer */ - unsigned char *in; /* Where to put response received from NINDY */ -{ - char *fmt; - int status; - static char *errmsg[] = { - "", /* 0 */ - "Buffer overflow", /* 1 */ - "Unknown command", /* 2 */ - "Wrong amount of data to load register(s)", /* 3 */ - "Missing command argument(s)", /* 4 */ - "Odd number of digits sent to load memory", /* 5 */ - "Unknown register name", /* 6 */ - "No such memory segment", /* 7 */ - "No breakpoint available", /* 8 */ - "Can't set requested baud rate", /* 9 */ - }; -# define NUMERRS ( sizeof(errmsg) / sizeof(errmsg[0]) ) - - static char err1[] = "Unknown error response from NINDY: #%d\r\n"; - static char err2[] = "Error response #%d from NINDY: %s\r\n"; - - while (1){ - putpkt(out,len); - status = getpkt(in); - if ( status == TIMEOUT ){ - fprintf( stderr, "Response timed out; resending\r\n" ); - } else { - break; - } - } - - if ( status ){ - fmt = status > NUMERRS ? err1 : err2; - fprintf( stderr, fmt, status, errmsg[status] ); - abort(); - } -} - - /************************ - * * - * BAUD RATE ROUTINES * - * * - ************************/ - -/* Table of baudrates known to be acceptable to NINDY. Each baud rate - * appears both as character string and as a Unix baud rate constant. - */ -struct baudrate { - char *string; - int rate; -}; - -static struct baudrate baudtab[] = { - "1200", 1200, - "2400", 2400, - "4800", 4800, - "9600", 9600, - "19200", 19200, - "38400", 38400, - NULL, 0 /* End of table */ -}; - -/****************************************************************************** - * parse_baudrate: - * Look up the passed baud rate in the baudrate table. If found, change - * our internal record of the current baud rate, but don't do anything - * about the tty just now. - * - * Return pointer to baudrate structure on success, NULL on failure. - ******************************************************************************/ -static -struct baudrate * -parse_baudrate(s) - char *s; /* Desired baud rate, as an ASCII (decimal) string */ -{ - int i; - - for ( i=0; baudtab[i].string != NULL; i++ ){ - if ( !strcmp(baudtab[i].string,s) ){ - return &baudtab[i]; - } - } - return NULL; -} - -/****************************************************************************** - * try_baudrate: - * Try speaking to NINDY via the specified file descriptor at the - * specified baudrate. Assume success if we can send an empty command - * with a bogus checksum and receive a NAK (response of '-') back within - * one second. - * - * Return 1 on success, 0 on failure. - ***************************************************************************/ - -static int -try_baudrate (serial, brp) - struct serial *serial; - struct baudrate *brp; -{ - unsigned char c; - - /* Set specified baud rate and flush all pending input */ - serial_setbaudrate (serial, brp->rate); - tty_flush (serial); - - /* Send empty command with bad checksum, hope for NAK ('-') response */ - serial_write (serial, "\020\0\0\001", 4); - - /* Anything but a quick '-', including error, eof, or timeout, means that - this baudrate doesn't work. */ - return serial_readchar (serial, 1) == '-'; -} - -/****************************************************************************** - * autobaud: - * Get NINDY talking over the specified file descriptor at the specified - * baud rate. First see if NINDY's already talking at 'baudrate'. If - * not, run through all the legal baudrates in 'baudtab' until one works, - * and then tell NINDY to talk at 'baudrate' instead. - ******************************************************************************/ -static -autobaud( serial, brp ) - struct serial *serial; - struct baudrate *brp; -{ - int i; - int failures; - - say("NINDY at wrong baud rate? Trying to autobaud...\n"); - failures = i = 0; - while (1) - { - say( "\r%s... ", baudtab[i].string ); - if (try_baudrate(serial, &baudtab[i])) - { - break; - } - if (baudtab[++i].string == NULL) - { - /* End of table -- wraparound */ - i = 0; - if ( failures++ ) - { - say("\nAutobaud failed again. Giving up.\n"); - exit(1); - } - else - { - say("\nAutobaud failed. Trying again...\n"); - } - } - } - - /* Found NINDY's current baud rate; now change it. */ - say("Changing NINDY baudrate to %s\n", brp->string); - ninBaud (brp->string); - - /* Change our baud rate back to rate to which we just set NINDY. */ - serial_setbaudrate (serial, brp->rate); -} - - /********************************** - * * - * NINDY INTERFACE ROUTINES * - * * - * ninConnect *MUST* be the first * - * one of these routines called. * - **********************************/ - - -/****************************************************************************** - * ninBaud: - * Ask NINDY to change the baud rate on its serial port. - * Assumes we know the baud rate at which NINDY's currently talking. - ******************************************************************************/ -ninBaud( baudrate ) - char *baudrate; /* Desired baud rate, as a string of ASCII decimal - * digits. - */ -{ - unsigned char msg[100]; - - tty_flush (nindy_serial); - - if (old_nindy) - { - char *p; /* Pointer into buffer */ - unsigned char csum; /* Calculated checksum */ - - /* Can't use putpkt() because after the baudrate change NINDY's - ack/nak will look like gibberish. */ - - for (p=baudrate, csum=020+'z'; *p; p++) - { - csum += *p; - } - sprintf (msg, "\020z%s#%02x", baudrate, csum); - serial_write (nindy_serial, msg, strlen (msg)); - } - else - { - /* Can't use "send" because NINDY reply will be unreadable after - baud rate change. */ - sprintf( msg, "z%s", baudrate ); - putpkt( msg, strlen(msg)+1 ); /* "+1" to send terminator too */ - } -} - -/****************************************************************************** - * ninBptDel: - * Ask NINDY to delete the specified type of *hardware* breakpoint at - * the specified address. If the 'addr' is -1, all breakpoints of - * the specified type are deleted. - ***************************************************************************/ -ninBptDel( addr, type ) - long addr; /* Address in 960 memory */ - char type; /* 'd' => data bkpt, 'i' => instruction breakpoint */ -{ - unsigned char buf[10]; - - if ( old_nindy ){ - OninBptDel( addr, type == 'd' ? 1 : 0 ); - return; - } - - buf[0] = 'b'; - buf[1] = type; - - if ( addr == -1 ){ - send( buf, 2, NULL ); - } else { - store_unsigned_integer (&buf[2], 4, addr); - send( buf, 6, NULL ); - } -} - - -/****************************************************************************** - * ninBptSet: - * Ask NINDY to set the specified type of *hardware* breakpoint at - * the specified address. - ******************************************************************************/ -ninBptSet( addr, type ) - long addr; /* Address in 960 memory */ - char type; /* 'd' => data bkpt, 'i' => instruction breakpoint */ -{ - unsigned char buf[10]; - - if ( old_nindy ){ - OninBptSet( addr, type == 'd' ? 1 : 0 ); - return; - } - - - buf[0] = 'B'; - buf[1] = type; - store_unsigned_integer (&buf[2], 4, addr); - send( buf, 6, NULL ); -} - - -/****************************************************************************** - * ninConnect: - * Open the specified tty. Get communications working at the specified - * baud rate. Flush any pending I/O on the tty. - * - * Return the file descriptor, or -1 on failure. - ******************************************************************************/ -int -ninConnect( name, baudrate, brk, silent, old_protocol ) - char *name; /* "/dev/ttyXX" to be opened */ - char *baudrate;/* baud rate: a string of ascii decimal digits (eg,"9600")*/ - int brk; /* 1 => send break to tty first thing after opening it*/ - int silent; /* 1 => stifle unnecessary messages when talking to - * this tty. - */ - int old_protocol; -{ - int i; - char *p; - struct baudrate *brp; - - /* We will try each of the following paths when trying to open the tty - */ - static char *prefix[] = { "", "/dev/", "/dev/tty", NULL }; - - if ( old_protocol ){ - old_nindy = 1; - } - - quiet = silent; /* Make global to this file */ - - for ( i=0; prefix[i] != NULL; i++ ){ - p = xmalloc(strlen(prefix[i]) + strlen(name) + 1 ); - strcpy( p, prefix[i] ); - strcat( p, name ); - nindy_serial = serial_open (p); - if (nindy_serial != NULL) { -#ifdef TIOCEXCL - /* Exclusive use mode (hp9000 does not support it) */ - ioctl(nindy_serial->fd,TIOCEXCL,NULL); -#endif - serial_raw (nindy_serial); - - if (brk) - { - serial_send_break (nindy_serial); - } - - brp = parse_baudrate( baudrate ); - if ( brp == NULL ){ - say("Illegal baudrate %s ignored; using 9600\n", - baudrate); - brp = parse_baudrate( "9600" ); - } - - if ( !try_baudrate(nindy_serial, brp) ){ - autobaud(nindy_serial, brp); - } - tty_flush (nindy_serial); - say( "Connected to %s\n", p ); - free(p); - break; - } - free(p); - } - return 0; -} - -#if 0 - -/* Currently unused; shouldn't we be doing this on target_kill and -perhaps target_mourn? FIXME. */ - -/****************************************************************************** - * ninGdbExit: - * Ask NINDY to leave GDB mode and print a NINDY prompt. - ****************************************************************************/ -ninGdbExit() -{ - if ( old_nindy ){ - OninGdbExit(); - return; - } - putpkt((unsigned char *) "E", 1 ); -} -#endif - -/****************************************************************************** - * ninGo: - * Ask NINDY to start or continue execution of an application program - * in it's memory at the current ip. - ******************************************************************************/ -ninGo( step_flag ) - int step_flag; /* 1 => run in single-step mode */ -{ - if ( old_nindy ){ - OninGo( step_flag ); - return; - } - putpkt((unsigned char *) (step_flag ? "s" : "c"), 1 ); -} - - -/****************************************************************************** - * ninMemGet: - * Read a string of bytes from NINDY's address space (960 memory). - ******************************************************************************/ -int -ninMemGet(ninaddr, hostaddr, len) - long ninaddr; /* Source address, in the 960 memory space */ - unsigned char *hostaddr; /* Destination address, in our memory space */ - int len; /* Number of bytes to read */ -{ - unsigned char buf[BUFSIZE+20]; - int cnt; /* Number of bytes in next transfer */ - int origlen = len; - - if ( old_nindy ){ - OninMemGet(ninaddr, hostaddr, len); - return; - } - - for ( ; len > 0; len -= BUFSIZE ){ - cnt = len > BUFSIZE ? BUFSIZE : len; - - buf[0] = 'm'; - store_unsigned_integer (&buf[1], 4, ninaddr); - buf[5] = cnt & 0xff; - buf[6] = (cnt>>8) & 0xff; - - send( buf, 7, hostaddr ); - - ninaddr += cnt; - hostaddr += cnt; - } - return origlen; -} - - -/****************************************************************************** - * ninMemPut: - * Write a string of bytes into NINDY's address space (960 memory). - ******************************************************************************/ -int -ninMemPut( ninaddr, hostaddr, len ) - long ninaddr; /* Destination address, in NINDY memory space */ - unsigned char *hostaddr; /* Source address, in our memory space */ - int len; /* Number of bytes to write */ -{ - unsigned char buf[BUFSIZE+20]; - int cnt; /* Number of bytes in next transfer */ - int origlen = len; - - if ( old_nindy ){ - OninMemPut( ninaddr, hostaddr, len ); - return; - } - for ( ; len > 0; len -= BUFSIZE ){ - cnt = len > BUFSIZE ? BUFSIZE : len; - - buf[0] = 'M'; - store_unsigned_integer (&buf[1], 4, ninaddr); - memcpy(buf + 5, hostaddr, cnt); - send( buf, cnt+5, NULL ); - - ninaddr += cnt; - hostaddr += cnt; - } - return origlen; -} - -/****************************************************************************** - * ninRegGet: - * Retrieve the contents of a 960 register, and return them as a long - * in host byte order. - * - * THIS ROUTINE CAN ONLY BE USED TO READ THE LOCAL, GLOBAL, AND - * ip/ac/pc/tc REGISTERS. - * - ******************************************************************************/ -long -ninRegGet( regname ) - char *regname; /* Register name recognized by NINDY, subject to the - * above limitations. - */ -{ - unsigned char outbuf[10]; - unsigned char inbuf[20]; - - if ( old_nindy ){ - return OninRegGet( regname ); - } - - sprintf( outbuf, "u%s:", regname ); - send( outbuf, strlen(outbuf), inbuf ); - return extract_unsigned_integer (inbuf, 4); -} - -/****************************************************************************** - * ninRegPut: - * Set the contents of a 960 register. - * - * THIS ROUTINE CAN ONLY BE USED TO SET THE LOCAL, GLOBAL, AND - * ip/ac/pc/tc REGISTERS. - * - ******************************************************************************/ -ninRegPut( regname, val ) - char *regname; /* Register name recognized by NINDY, subject to the - * above limitations. - */ - long val; /* New contents of register, in host byte-order */ -{ - unsigned char buf[20]; - int len; - - if ( old_nindy ){ - OninRegPut( regname, val ); - return; - } - - sprintf( buf, "U%s:", regname ); - len = strlen(buf); - store_unsigned_integer (&buf[len], 4, val); - send( buf, len+4, NULL ); -} - -/****************************************************************************** - * ninRegsGet: - * Get a dump of the contents of the entire 960 register set. The - * individual registers appear in the dump in the following order: - * - * pfp sp rip r3 r4 r5 r6 r7 - * r8 r9 r10 r11 r12 r13 r14 r15 - * g0 g1 g2 g3 g4 g5 g6 g7 - * g8 g9 g10 g11 g12 g13 g14 fp - * pc ac ip tc fp0 fp1 fp2 fp3 - * - * Each individual register comprises exactly 4 bytes, except for - * fp0-fp3, which are 8 bytes. All register values are in 960 - * (little-endian) byte order. - * - ******************************************************************************/ -ninRegsGet( regp ) - unsigned char *regp; /* Where to place the register dump */ -{ - if ( old_nindy ){ - OninRegsGet( regp ); - return; - } - send( (unsigned char *) "r", 1, regp ); -} - - -/****************************************************************************** - * ninRegsPut: - * Initialize the entire 960 register set to a specified set of values. - * The format of the register value data should be the same as that - * returned by ninRegsGet. - * - * WARNING: - * All register values must be in 960 (little-endian) byte order. - * - ******************************************************************************/ -ninRegsPut( regp ) - char *regp; /* Pointer to desired values of registers */ -{ -/* Number of bytes that we send to nindy. I believe this is defined by - the protocol (it does not agree with REGISTER_BYTES). */ -#define NINDY_REGISTER_BYTES ((36*4) + (4*8)) - unsigned char buf[NINDY_REGISTER_BYTES+10]; - - if ( old_nindy ){ - OninRegsPut( regp ); - return; - } - - buf[0] = 'R'; - memcpy(buf+1, regp, NINDY_REGISTER_BYTES ); - send( buf, NINDY_REGISTER_BYTES+1, NULL ); -} - - -/****************************************************************************** - * ninReset: - * Ask NINDY to perform a soft reset; wait for the reset to complete. - * - ******************************************************************************/ -ninReset() -{ - unsigned char ack; - - if ( old_nindy ){ - OninReset(); - return; - } - - while (1){ - putpkt((unsigned char *) "X", 1 ); - while (1){ - if ( !rdnin(&ack,1,5) ){ - /* Timed out */ - break; /* Resend */ - } - if ( ack == '+' ){ - return; - } - } - } -} - - -/****************************************************************************** - * ninSrq: - * Assume NINDY has stopped execution of the 960 application program in - * order to process a host service request (srq). Ask NINDY for the - * srq arguments, perform the requested service, and send an "srq - * complete" message so NINDY will return control to the application. - * - ******************************************************************************/ -ninSrq() -{ - /* FIXME: Imposes arbitrary limits on lengths of pathnames and such. */ - unsigned char buf[BUFSIZE]; - int retcode; - unsigned char srqnum; - int i; - int offset; - int arg[MAX_SRQ_ARGS]; - - if ( old_nindy ){ - OninSrq(); - return; - } - - - /* Get srq number and arguments - */ - send((unsigned char *) "!", 1, buf ); - - srqnum = buf[0]; - for ( i=0, offset=1; i < MAX_SRQ_ARGS; i++, offset+=4 ){ - arg[i] = extract_unsigned_integer (&buf[offset], 4); - } - - /* Process Srq - */ - switch( srqnum ){ - case BS_CLOSE: - /* args: file descriptor */ - if ( arg[0] > 2 ){ - retcode = close( arg[0] ); - } else { - retcode = 0; - } - break; - case BS_CREAT: - /* args: filename, mode */ - ninStrGet( arg[0], buf ); - retcode = creat(buf,arg[1]); - break; - case BS_OPEN: - /* args: filename, flags, mode */ - ninStrGet( arg[0], buf ); - retcode = open(buf,arg[1],arg[2]); - break; - case BS_READ: - /* args: file descriptor, buffer, count */ - retcode = read(arg[0],buf,arg[2]); - if ( retcode > 0 ){ - ninMemPut( arg[1], buf, retcode ); - } - break; - case BS_SEEK: - /* args: file descriptor, offset, whence */ - retcode = lseek(arg[0],arg[1],arg[2]); - break; - case BS_WRITE: - /* args: file descriptor, buffer, count */ - ninMemGet( arg[1], buf, arg[2] ); - retcode = write(arg[0],buf,arg[2]); - break; - default: - retcode = -1; - break; - } - - /* Send request termination status to NINDY - */ - buf[0] = 'e'; - store_unsigned_integer (&buf[1], 4, retcode); - send( buf, 5, NULL ); -} - - -/****************************************************************************** - * ninStopWhy: - * Assume the application program has stopped (i.e., a DLE was received - * from NINDY). Ask NINDY for status information describing the - * reason for the halt. - * - * Returns a non-zero value if the user program has exited, 0 otherwise. - * Also returns the following information, through passed pointers: - * - why: an exit code if program the exited; otherwise the reason - * why the program halted (see stop.h for values). - * - contents of register ip (little-endian byte order) - * - contents of register sp (little-endian byte order) - * - contents of register fp (little-endian byte order) - ******************************************************************************/ -char -ninStopWhy( whyp, ipp, fpp, spp ) - unsigned char *whyp; /* Return the 'why' code through this pointer */ - long *ipp; /* Return contents of register ip through this pointer */ - long *fpp; /* Return contents of register fp through this pointer */ - long *spp; /* Return contents of register sp through this pointer */ -{ - unsigned char buf[30]; - extern char OninStopWhy (); - - if ( old_nindy ){ - return OninStopWhy( whyp, ipp, fpp, spp ); - } - send((unsigned char *) "?", 1, buf ); - - *whyp = buf[1]; - memcpy ((char *)ipp, &buf[2], sizeof (*ipp)); - memcpy ((char *)fpp, &buf[6], sizeof (*ipp)); - memcpy ((char *)spp, &buf[10], sizeof (*ipp)); - return buf[0]; -} - -/****************************************************************************** - * ninStrGet: - * Read a '\0'-terminated string of data out of the 960 memory space. - * - ******************************************************************************/ -static -ninStrGet( ninaddr, hostaddr ) - unsigned long ninaddr; /* Address of string in NINDY memory space */ - unsigned char *hostaddr; /* Address of the buffer to which string should - * be copied. - */ -{ - unsigned char cmd[5]; - - cmd[0] = '"'; - store_unsigned_integer (&cmd[1], 4, ninaddr); - send( cmd, 5, hostaddr ); -} - -#if 0 -/* Not used. */ - -/****************************************************************************** - * ninVersion: - * Ask NINDY for version information about itself. - * The information is sent as an ascii string in the form "x.xx,", - * where, - * x.xx is the version number - * is the processor architecture: "KA", "KB", "MC", "CA" * - * - ******************************************************************************/ -int -ninVersion( p ) - unsigned char *p; /* Where to place version string */ -{ - - if ( old_nindy ){ - return OninVersion( p ); - } - send((unsigned char *) "v", 1, p ); - return strlen(p); -} -#endif /* 0 */ diff --git a/gdb/nindy-share/stop.h b/gdb/nindy-share/stop.h deleted file mode 100644 index 82a90a5..0000000 --- a/gdb/nindy-share/stop.h +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************** - Copyright 1990, 1992 Free Software Foundation, Inc. - - This code was donated by Intel Corp. - - Intel hereby grants you permission to copy, modify, and - distribute this software and its documentation. Intel grants - this permission provided that the above copyright notice - appears in all copies and that both the copyright notice and - this permission notice appear in supporting documentation. In - addition, Intel grants this permission provided that you - prominently mark as not part of the original any modifications - made to this software or documentation, and that the name of - Intel Corporation not be used in advertising or publicity - pertaining to distribution of the software or the documentation - without specific, written prior permission. - - Intel Corporation does not warrant, guarantee or make any - representations regarding the use of, or the results of the use - of, the software and documentation in terms of correctness, - accuracy, reliability, currentness, or otherwise; and you rely - on the software, documentation and results solely at your own - risk. */ -/******************************************************************/ - - -/****************************************************************** - * - * REASONS WHY NINDY CAN STOP EXECUTING AN APPLICATION PROGRAM - * - * When NINDY stops executing an application program that was running - * under remote host ("gdb") control, it signals the host by sending - * a single ^P. The host can then query as to the reason for the halt. - * NINDY responds with two bytes of information. - * - * The first byte is a boolean flag that indicates whether or not - * the application has exited. - * - * If the flag is true, the second byte contains the exit code. - * - * If the flag is false, the second byte contains a "reason for - * stopping" code. This file defines the possible values of that - * code. - * - * There are three categories of reasons why the halt may have occurred: - * faults, traces, and software interactions. The first two categories - * are processor-dependent; the values of these codes are tightly coupled - * to the hardware and should not be changed without first examining - * src/nindy/common/fault.c. The software interactions involve - * communication between NINDY and the host debugger; their codes are - * arbitrary. - * - ******************************************************************/ - -#define FAULT_PARALLEL 0x00 -#define FAULT_UNKNOWN 0x01 -#define FAULT_OPERATION 0x02 -#define FAULT_ARITH 0x03 -#define FAULT_FP 0x04 -#define FAULT_CONSTR 0x05 -#define FAULT_VM 0x06 -#define FAULT_PROTECT 0x07 -#define FAULT_MACHINE 0x08 -#define FAULT_STRUCT 0x09 -#define FAULT_TYPE 0x0a - /* 0x0b reserved */ -#define FAULT_PROCESS 0x0c -#define FAULT_DESC 0x0d -#define FAULT_EVENT 0x0e - /* 0x0f reserved */ - -#define LAST_FAULT 0x0f - -#define TRACE_STEP 0x10 -#define TRACE_BRANCH 0x11 -#define TRACE_CALL 0x12 -#define TRACE_RET 0x13 -#define TRACE_PRERET 0x14 -#define TRACE_SVC 0x15 -#define TRACE_BKPT 0x16 - -#define STOP_SRQ 0xfe - /* Application program has service request to make of host */ - -#define STOP_GDB_BPT 0xff - /* Application program has reached breakpoint (fmark) set by host */ diff --git a/gdb/nindy-share/ttyflush.c b/gdb/nindy-share/ttyflush.c deleted file mode 100644 index f9aaa2e..0000000 --- a/gdb/nindy-share/ttyflush.c +++ /dev/null @@ -1,48 +0,0 @@ -/* 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 started out life as code shared between the nindy monitor and - GDB. For various reasons, this is no longer true. Eventually, it - probably should be merged into remote-nindy.c. */ - -#include -#include "defs.h" -#include "serial.h" - -/* Flush all pending input and output for SERIAL, wait for a second, and - then if there is a character pending, discard it and flush again. */ - -int -tty_flush (serial) - struct serial *serial; -{ - while (1) - { - serial_flush_input (serial); - serial_flush_output (serial); - sleep(1); - switch (serial_readchar (serial, 0)) - { - case SERIAL_TIMEOUT: - case SERIAL_ERROR: - case SERIAL_EOF: - return 0; - default: - /* We read something. Eeek. Try again. */ - break; - } - } -} diff --git a/gdb/nindy-tdep.c b/gdb/nindy-tdep.c deleted file mode 100644 index 1f35062..0000000 --- a/gdb/nindy-tdep.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Target-machine dependent code for the NINDY monitor running on the Intel 960 - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 2000 - 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. */ - -/* Miscellaneous NINDY-dependent routines. - Some replace macros normally defined in "tm.h". */ - -#include "defs.h" -#include "symtab.h" -#include "frame.h" -#include "gdbcore.h" - -/* 'start_frame' is a variable in the NINDY 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 -nindy_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe) -{ - struct symbol *sym; - struct minimal_symbol *msymbol; - - /* crtnindy.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 crtnindy.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)); -} diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 78f207d..1a7c5f0 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -842,7 +842,7 @@ array_mod: '[' ']' func_mod: '(' ')' { $$ = 0; } | '(' nonempty_typelist ')' - { free ((PTR)$2); $$ = 0; } + { free ($2); $$ = 0; } ; /* We used to try to recognize more pointer to member types here, but diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 9c5e49f..d62b28f 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -52,11 +52,11 @@ static int open_existing_mapped_file (char *, long, int); static int open_mapped_file (char *filename, long mtime, int flags); -static PTR map_to_file (int); +static void *map_to_file (int); #endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */ -static void add_to_objfile_sections (bfd *, sec_ptr, PTR); +static void add_to_objfile_sections (bfd *, sec_ptr, void *); /* Externally visible variables that are owned by this module. See declarations in objfile.h for more info. */ @@ -82,7 +82,7 @@ int mapped_symbol_files; /* Try to use mapped symbol files */ the end of the table (objfile->sections_end). */ static void -add_to_objfile_sections (bfd *abfd, sec_ptr asect, PTR objfile_p_char) +add_to_objfile_sections (bfd *abfd, sec_ptr asect, void *objfile_p_char) { struct objfile *objfile = (struct objfile *) objfile_p_char; struct obj_section section; @@ -178,7 +178,7 @@ allocate_objfile (bfd *abfd, int flags) flags); if (fd >= 0) { - PTR md; + void *md; if ((md = map_to_file (fd)) == NULL) { @@ -333,6 +333,30 @@ allocate_objfile (bfd *abfd, int flags) return (objfile); } +/* Put one object file before a specified on in the global list. + This can be used to make sure an object file is destroyed before + another when using ALL_OBJFILES_SAFE to free all objfiles. */ +void +put_objfile_before (struct objfile *objfile, struct objfile *before_this) +{ + struct objfile **objp; + + unlink_objfile (objfile); + + for (objp = &object_files; *objp != NULL; objp = &((*objp)->next)) + { + if (*objp == before_this) + { + objfile->next = *objp; + *objp = objfile; + return; + } + } + + internal_error (__FILE__, __LINE__, + "put_objfile_before: before objfile not in list"); +} + /* Put OBJFILE at the front of the list. */ void @@ -405,6 +429,18 @@ unlink_objfile (struct objfile *objfile) void free_objfile (struct objfile *objfile) { + if (objfile->separate_debug_objfile) + { + free_objfile (objfile->separate_debug_objfile); + } + + if (objfile->separate_debug_objfile_backlink) + { + /* We freed the separate debug file, make sure the base objfile + doesn't reference it. */ + objfile->separate_debug_objfile_backlink->separate_debug_objfile = NULL; + } + /* First do any symbol file specific actions required when we are finished with a particular symbol file. Note that if the objfile is using reusable symbol information (via mmalloc) then each of @@ -900,13 +936,13 @@ open_mapped_file (char *filename, long mtime, int flags) return (fd); } -static PTR +static void * map_to_file (int fd) { - PTR md; + void *md; CORE_ADDR mapto; - md = mmalloc_attach (fd, (PTR) 0); + md = mmalloc_attach (fd, 0); if (md != NULL) { mapto = (CORE_ADDR) mmalloc_getkey (md, 1); @@ -919,7 +955,7 @@ map_to_file (int fd) else if (mapto != (CORE_ADDR) NULL) { /* This mapping file needs to be remapped at "mapto" */ - md = mmalloc_attach (fd, (PTR) mapto); + md = mmalloc_attach (fd, mapto); } else { @@ -931,10 +967,10 @@ map_to_file (int fd) address selected by mmap, we must truncate it before trying to do an attach at the address we want. */ ftruncate (fd, 0); - md = mmalloc_attach (fd, (PTR) mapto); + md = mmalloc_attach (fd, mapto); if (md != NULL) { - mmalloc_setkey (md, 1, (PTR) mapto); + mmalloc_setkey (md, 1, mapto); } } } diff --git a/gdb/objfiles.h b/gdb/objfiles.h index d472efc..587e71c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -238,7 +238,8 @@ struct objfile struct objfile *next; - /* The object file's name. Malloc'd; free it if you free this struct. */ + /* The object file's name, tilde-expanded and absolute. + Malloc'd; free it if you free this struct. */ char *name; @@ -328,7 +329,7 @@ struct objfile the memory mapped malloc() package to manage storage for this objfile's data. NULL if we are not. */ - PTR md; + void *md; /* The file descriptor that was used to obtain the mmalloc descriptor for this objfile. If we call mmalloc_detach with the malloc descriptor @@ -359,7 +360,7 @@ struct objfile typically a pointer to malloc'd memory. The symbol reader's finish function is responsible for freeing the memory thusly allocated. */ - PTR sym_private; + void *sym_private; /* Hook for target-architecture-specific information. This must point to memory allocated on one of the obstacks in this objfile, @@ -414,6 +415,15 @@ struct objfile ExportEntry *export_list; int export_list_size; + /* Link to objfile that contains the debug symbols for this one. + One is loaded if this file has an debug link to an existing + debug file with the right checksum */ + struct objfile *separate_debug_objfile; + + /* If this is a separate debug object, this is used as a link to the + actual executable objfile. */ + struct objfile *separate_debug_objfile_backlink; + /* Place to stash various statistics about this objfile */ OBJSTATS; }; @@ -505,6 +515,8 @@ extern struct objfile *allocate_objfile (bfd *, int); extern int build_objfile_section_table (struct objfile *); +extern void put_objfile_before (struct objfile *, struct objfile *); + extern void objfile_to_front (struct objfile *); extern void unlink_objfile (struct objfile *); diff --git a/gdb/ocd.c b/gdb/ocd.c index e735fe0..4dfda5d 100644 --- a/gdb/ocd.c +++ b/gdb/ocd.c @@ -42,7 +42,7 @@ static int ocd_read_bytes (CORE_ADDR memaddr, char *myaddr, int len); -static int ocd_start_remote (PTR dummy); +static int ocd_start_remote (void *dummy); static int readchar (int timeout); @@ -171,7 +171,7 @@ ocd_close (int quitting) /* Stub for catch_errors. */ static int -ocd_start_remote (PTR dummy) +ocd_start_remote (void *dummy) { unsigned char buf[10], *p; int pktlen; diff --git a/gdb/parse.c b/gdb/parse.c index 8cdd87e..45a9597 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -89,8 +89,8 @@ static void free_funcalls (void *ignore); static void prefixify_expression (struct expression *); -static void -prefixify_subexp (struct expression *, struct expression *, int, int); +static void prefixify_subexp (struct expression *, struct expression *, int, + int); void _initialize_parse (void); diff --git a/gdb/proc-utils.h b/gdb/proc-utils.h index 1c41964..d9f38a8 100644 --- a/gdb/proc-utils.h +++ b/gdb/proc-utils.h @@ -22,44 +22,37 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ * Pretty-print functions for /proc data */ -extern void -proc_prettyprint_why (unsigned long why, unsigned long what, int verbose); +extern void proc_prettyprint_why (unsigned long why, unsigned long what, + int verbose); -extern void -proc_prettyprint_syscalls (sysset_t *sysset, int verbose); +extern void proc_prettyprint_syscalls (sysset_t *sysset, int verbose); -extern void -proc_prettyprint_syscall (int num, int verbose); +extern void proc_prettyprint_syscall (int num, int verbose); extern void proc_prettyprint_flags (unsigned long flags, int verbose); -extern void -proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose); +extern void proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, + int verbose); -extern void -proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose); +extern void proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, + int verbose); -extern void -proc_prettyfprint_syscall (FILE *file, int num, int verbose); +extern void proc_prettyfprint_syscall (FILE *file, int num, int verbose); -extern void -proc_prettyfprint_signal (FILE *file, int signo, int verbose); +extern void proc_prettyfprint_signal (FILE *file, int signo, int verbose); -extern void -proc_prettyfprint_flags (FILE *file, unsigned long flags, int verbose); +extern void proc_prettyfprint_flags (FILE *file, unsigned long flags, + int verbose); -extern void -proc_prettyfprint_why (FILE *file, unsigned long why, - unsigned long what, int verbose); +extern void proc_prettyfprint_why (FILE *file, unsigned long why, + unsigned long what, int verbose); -extern void -proc_prettyfprint_fault (FILE *file, int faultno, int verbose); +extern void proc_prettyfprint_fault (FILE *file, int faultno, int verbose); -extern void -proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose); +extern void proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, + int verbose); -extern void -proc_prettyfprint_status (long, int, int, int); +extern void proc_prettyfprint_status (long, int, int, int); /* * Trace functions for /proc api. diff --git a/gdb/procfs.c b/gdb/procfs.c index fe59876..bf488a6 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2841,6 +2841,19 @@ proc_parent_pid (procinfo *pi) } +/* Convert a target address (a.k.a. CORE_ADDR) into a host address + (a.k.a void pointer)! */ + +static void * +procfs_address_to_host_pointer (CORE_ADDR addr) +{ + void *ptr; + + gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr); + return ptr; +} + /* * Function: proc_set_watchpoint * @@ -2863,10 +2876,13 @@ proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags) prwatch_t *pwatch; pwatch = (prwatch_t *) &arg.watch; + /* NOTE: cagney/2003-02-01: Even more horrible hack. Need to + convert a target address into something that can be stored in a + native data structure. */ #ifdef PCAGENT /* Horrible hack: only defined on Solaris 2.6+ */ - pwatch->pr_vaddr = (uintptr_t) address_to_host_pointer (addr); + pwatch->pr_vaddr = (uintptr_t) procfs_address_to_host_pointer (addr); #else - pwatch->pr_vaddr = (caddr_t) address_to_host_pointer (addr); + pwatch->pr_vaddr = (caddr_t) procfs_address_to_host_pointer (addr); #endif pwatch->pr_size = len; pwatch->pr_wflags = wflags; @@ -5163,10 +5179,11 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype) /* 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. */ + fact that proc_set_watchpoint() calls + procfs_address_to_host_pointer(); a close inspection of + procfs_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; diff --git a/gdb/ptx4-nat.c b/gdb/ptx4-nat.c deleted file mode 100644 index 1798b50..0000000 --- a/gdb/ptx4-nat.c +++ /dev/null @@ -1,211 +0,0 @@ -/* Native-dependent code for ptx 4.0 - Copyright 1988, 1989, 1991, 1992, 1994, 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 "inferior.h" -#include "gdbcore.h" -#include "regcache.h" -#include -#include -#include -#include - -/* Prototypes for supply_gregset etc. */ -#include "gregset.h" - -/* Given a pointer to a general register set in /proc format (gregset_t *), - unpack the register contents and supply them as gdb's idea of the current - register values. */ - -void -supply_gregset (gregset_t *gregsetp) -{ - supply_register (EAX_REGNUM, (char *) &(*gregsetp)[EAX]); - supply_register (EDX_REGNUM, (char *) &(*gregsetp)[EDX]); - supply_register (ECX_REGNUM, (char *) &(*gregsetp)[ECX]); - supply_register (EBX_REGNUM, (char *) &(*gregsetp)[EBX]); - supply_register (ESI_REGNUM, (char *) &(*gregsetp)[ESI]); - supply_register (EDI_REGNUM, (char *) &(*gregsetp)[EDI]); - supply_register (ESP_REGNUM, (char *) &(*gregsetp)[UESP]); - supply_register (EBP_REGNUM, (char *) &(*gregsetp)[EBP]); - supply_register (EIP_REGNUM, (char *) &(*gregsetp)[EIP]); - supply_register (EFLAGS_REGNUM, (char *) &(*gregsetp)[EFL]); -} - -void -fill_gregset (gregset_t *gregsetp, int regno) -{ - int regi; - - for (regi = 0; regi < NUM_REGS; regi++) - { - if ((regno == -1) || (regno == regi)) - { - (*gregsetp)[regi] = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)]; - } - } -} - -/* Given a pointer to a floating point register set in /proc format - (fpregset_t *), unpack the register contents and supply them as gdb's - idea of the current floating point register values. */ - -void -supply_fpregset (fpregset_t *fpregsetp) -{ - supply_fpu_registers ((struct fpusave *) &fpregsetp->fp_reg_set); - supply_fpa_registers ((struct fpasave *) &fpregsetp->f_wregs); -} - -/* Given a pointer to a floating point register set in /proc format - (fpregset_t *), update the register specified by REGNO from gdb's idea - of the current floating point register set. If REGNO is -1, update - them all. */ - -void -fill_fpregset (fpregset_t *fpregsetp, int regno) -{ - int regi; - char *to; - char *from; - - /* FIXME: see m68k-tdep.c for an example, for the m68k. */ -} - -/* - * This doesn't quite do the same thing as the procfs.c version, but give - * it the same name so we don't have to put an ifdef in solib.c. - */ -/* this could use elf_interpreter() from elfread.c */ -int -proc_iterate_over_mappings (int (*func) (int, CORE_ADDR)) -{ - vaddr_t curseg, memptr; - pt_vseg_t pv; - int rv, cmperr; - sec_ptr interp_sec; - char *interp_content; - int interp_fd, funcstat; - unsigned int size; - char buf1[NBPG], buf2[NBPG]; - - /* - * The following is really vile. We can get the name of the - * shared library from the exec_bfd, and we can get a list of - * each virtual memory segment, but there is no simple way to - * find the mapped segment from the shared library (ala - * procfs's PIOCOPENMEM). As a pretty nasty kludge, we - * compare the virtual memory segment to the contents of the - * .interp file. If they match, we assume that we've got the - * right one. - */ - - /* - * TODO: for attach, use XPT_OPENT to get the executable, in - * case we're attached without knowning the executable's - * filename. - */ - -#ifdef VERBOSE_DEBUG - printf ("proc_iter\n"); -#endif - interp_sec = bfd_get_section_by_name (exec_bfd, ".interp"); - if (!interp_sec) - { - return 0; - } - - size = bfd_section_size (exec_bfd, interp_sec); - interp_content = alloca (size); - if (0 == bfd_get_section_contents (exec_bfd, interp_sec, - interp_content, (file_ptr) 0, size)) - { - return 0; - } - -#ifdef VERBOSE_DEBUG - printf ("proc_iter: \"%s\"\n", interp_content); -#endif - interp_fd = open (interp_content, O_RDONLY, 0); - if (-1 == interp_fd) - { - return 0; - } - - curseg = 0; - while (1) - { - rv = ptrace (PT_NEXT_VSEG, PIDGET (inferior_ptid), &pv, curseg); -#ifdef VERBOSE_DEBUG - printf ("PT_NEXT_VSEG: rv %d errno %d\n", rv, errno); -#endif - if (-1 == rv) - break; - if (0 == rv) - break; -#ifdef VERBOSE_DEBUG - printf ("pv.pv_start 0x%x pv_size 0x%x pv_prot 0x%x\n", - pv.pv_start, pv.pv_size, pv.pv_prot); -#endif - curseg = pv.pv_start + pv.pv_size; - - rv = lseek (interp_fd, 0, SEEK_SET); - if (-1 == rv) - { - perror ("lseek"); - close (interp_fd); - return 0; - } - for (memptr = pv.pv_start; memptr < pv.pv_start + pv.pv_size; - memptr += NBPG) - { -#ifdef VERBOSE_DEBUG - printf ("memptr 0x%x\n", memptr); -#endif - rv = read (interp_fd, buf1, NBPG); - if (-1 == rv) - { - perror ("read"); - close (interp_fd); - return 0; - } - rv = ptrace (PT_RDATA_PAGE, PIDGET (inferior_ptid), buf2, - memptr); - if (-1 == rv) - { - perror ("ptrace"); - close (interp_fd); - return 0; - } - cmperr = memcmp (buf1, buf2, NBPG); - if (cmperr) - break; - } - if (0 == cmperr) - { - /* this is it */ - funcstat = (*func) (interp_fd, pv.pv_start); - break; - } - } - close (interp_fd); - return 0; -} diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 49909b1..efacde3 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -785,7 +785,7 @@ void fetch_regs_from_dump (int (*nextchar) (), char *want) { int regno; - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); int thischar = nextchar (); diff --git a/gdb/remote-es.c b/gdb/remote-es.c deleted file mode 100644 index 72e6171..0000000 --- a/gdb/remote-es.c +++ /dev/null @@ -1,2047 +0,0 @@ -/* Memory-access and commands for remote es1800 processes, for GDB. - - Copyright 1988, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. - - This file is added to GDB to make it possible to do debugging via an - ES-1800 emulator. The code was originally written by Johan Holmberg - TT/SJ Ericsson Telecom AB and later modified by Johan Henriksson - TT/SJ. It was modified for gdb 4.0 by TX/DK Jan Nordenand by TX/DKG - Harald Johansen. - - This file is part of GDB. - - GDB 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 1, or (at your option) - any later version. - - GDB 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. */ - - -/* Emulator communication protocol. - All values are encoded in ascii hex digits. - - Request - Command - Reply - read registers: - DR - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - -- 6 - - 7 - - D = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - A = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - PC = XXXXXX SSP = XXXXXX USP = XXXXXX SR = XXXXXXXX - > - Each byte of register data is described by two hex digits. - - write regs - D0=XXXXXXXX - >D1=XXXXXXXX - >D2=XXXXXXXX - >D3=XXXXXXXX - >D4=XXXXXXXX - >D5=XXXXXXXX - >D6=XXXXXXXX - >D7=XXXXXXXX - >A0=XXXXXXXX - >A1=XXXXXXXX - >A2=XXXXXXXX - >A3=XXXXXXXX - >A4=XXXXXXXX - >A5=XXXXXXXX - >A6=XXXXXXXX - >A7=XXXXXXXX - >SR=XXXXXXXX - >PC=XXXXXX - > - Each byte of register data is described by two hex digits. - - read mem - @.BAA..AA - $FFFFFFXX - > - AA..AA is address, XXXXXXX is the contents - - write mem - @.BAA..AA=$XXXXXXXX - > - AA..AA is address, XXXXXXXX is data - - cont - PC=$AA..AA - >RBK - R> - AA..AA is address to resume. If AA..AA is omitted, resume at same address. - - step - PC=$AA..AA - >STP - R> - AA..AA is address to resume. If AA..AA is omitted, resume at same address. - - kill req - STP - > - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include "defs.h" -#include "gdb_string.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" -#include "command.h" -#include "symfile.h" -#include "remote-utils.h" -#include "gdbcore.h" -#include "serial.h" -#include "regcache.h" -#include "value.h" - -/* Prototypes for local functions */ - -static void es1800_child_detach (char *, int); - -static void es1800_child_open (char *, int); - -static void es1800_transparent (char *, int); - -static void es1800_create_inferior (char *, char *, char **); - -static void es1800_load (char *, int); - -static void es1800_kill (void); - -static int verify_break (int); - -static int es1800_remove_breakpoint (CORE_ADDR, char *); - -static int es1800_insert_breakpoint (CORE_ADDR, char *); - -static void es1800_files_info (struct target_ops *); - -static int es1800_xfer_inferior_memory (CORE_ADDR, char *, int, int, - struct mem_attrib *, - struct target_ops *); - -static void es1800_prepare_to_store (void); - -static ptid_t es1800_wait (ptid_t, struct target_waitstatus *); - -static void es1800_resume (ptid_t, int, enum target_signal); - -static void es1800_detach (char *, int); - -static void es1800_attach (char *, int); - -static int damn_b (char *); - -static void es1800_open (char *, int); - -static void es1800_timer (void); - -static void es1800_reset (char *); - -static void es1800_request_quit (void); - -static int readchar (void); - -static void expect (char *, int); - -static void expect_prompt (void); - -static void download (FILE *, int, int); - -#if 0 -static void bfd_copy (bfd *, bfd *); -#endif - -static void get_break_addr (int, CORE_ADDR *); - -static int fromhex (int); - -static int tohex (int); - -static void es1800_close (int); - -static void es1800_fetch_registers (void); - -static void es1800_fetch_register (int); - -static void es1800_store_register (int); - -static void es1800_read_bytes (CORE_ADDR, char *, int); - -static void es1800_write_bytes (CORE_ADDR, char *, int); - -static void send_with_reply (char *, char *, int); - -static void send_command (char *); - -static void send (char *); - -static void getmessage (char *, int); - -static void es1800_mourn_inferior (void); - -static void es1800_create_break_insn (char *, int); - -static void es1800_init_break (char *, int); - -/* Local variables */ - -/* FIXME: Convert this to use "set remotedebug" instead. */ -#define LOG_FILE "es1800.log" -#if defined (LOG_FILE) -static FILE *log_file; -#endif - -extern struct target_ops es1800_ops; /* Forward decl */ -extern struct target_ops es1800_child_ops; /* Forward decl */ - -static int kiodebug; -static int timeout = 100; -static char *savename; /* Name of i/o device used */ -static serial_ttystate es1800_saved_ttystate; -static int es1800_fc_save; /* Save fcntl state */ - -/* indicates that the emulator uses 32-bit data-adress (68020-mode) - instead of 24-bit (68000 -mode) */ - -static int m68020; - -#define MODE (m68020 ? "M68020" : "M68000" ) -#define ES1800_BREAK_VEC (0xf) - -/* Descriptor for I/O to remote machine. Initialize it to NULL so that - es1800_open knows that we don't have a file open when the program - starts. */ - -static struct serial *es1800_desc = NULL; - -#define PBUFSIZ 1000 -#define HDRLEN sizeof("@.BAAAAAAAA=$VV\r") - -/* Maximum number of bytes to read/write at once. The value here - is chosen to fill up a packet. */ - -#define MAXBUFBYTES ((PBUFSIZ-150)*16/75 ) - -static int es1800_break_vec = 0; -static char es1800_break_insn[2]; -static long es1800_break_address; -static void (*old_sigint) (); /* Old signal-handler for sigint */ -static jmp_buf interrupt; - -/* Local signalhandler to allow breaking tranfers or program run. - Rely on global variables: old_sigint(), interrupt */ - -static void -es1800_request_quit (void) -{ - /* restore original signalhandler */ - signal (SIGINT, old_sigint); - longjmp (interrupt, 1); -} - - -/* Reset emulator. - Sending reset character(octal 32) to emulator. - quit - return to '(esgdb)' prompt or continue */ - -static void -es1800_reset (char *quit) -{ - char buf[80]; - - if (quit) - { - printf ("\nResetting emulator... "); - } - strcpy (buf, "\032"); - send (buf); - expect_prompt (); - if (quit) - { - error ("done\n"); - } -} - - -/* Open a connection to a remote debugger and push the new target - onto the stack. Check if the emulator is responding and find out - what kind of processor the emulator is connected to. - Initiate the breakpoint handling in the emulator. - - name - the filename used for communication (ex. '/dev/tta') - from_tty - says whether to be verbose or not */ - -static void -es1800_open (char *name, int from_tty) -{ - char buf[PBUFSIZ]; - char *p; - int i, fcflag; - - m68020 = 0; - - if (!name) /* no device name given in target command */ - { - error_no_arg ("serial port device name"); - } - - target_preopen (from_tty); - es1800_close (0); - - /* open the device and configure it for communication */ - -#ifndef DEBUG_STDIN - - es1800_desc = serial_open (name); - if (es1800_desc == NULL) - { - perror_with_name (name); - } - savename = savestring (name, strlen (name)); - - es1800_saved_ttystate = serial_get_tty_state (es1800_desc); - - if ((fcflag = fcntl (deprecated_serial_fd (es1800_desc), F_GETFL, 0)) == -1) - { - perror_with_name ("fcntl serial"); - } - es1800_fc_save = fcflag; - - fcflag = (fcflag & (FREAD | FWRITE)); /* mask out any funny stuff */ - if (fcntl (deprecated_serial_fd (es1800_desc), F_SETFL, fcflag) == -1) - { - perror_with_name ("fcntl serial"); - } - - if (baud_rate != -1) - { - if (serial_setbaudrate (es1800_desc, baud_rate)) - { - serial_close (es1800_desc); - perror_with_name (name); - } - } - - serial_raw (es1800_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 (es1800_desc); - -#endif /* DEBUG_STDIN */ - - push_target (&es1800_ops); /* Switch to using remote target now */ - if (from_tty) - { - printf ("Remote ES1800 debugging using %s\n", name); - } - -#if defined (LOG_FILE) - - log_file = fopen (LOG_FILE, "w"); - if (log_file == NULL) - { - perror_with_name (LOG_FILE); - } - -#endif /* LOG_FILE */ - - /* Hello? Are you there?, also check mode */ - - /* send_with_reply( "DB 0 TO 1", buf, sizeof(buf)); */ - /* for (p = buf, i = 0; *p++ =='0';) *//* count the number of zeros */ - /* i++; */ - - send ("\032"); - getmessage (buf, sizeof (buf)); /* send reset character */ - - if (from_tty) - { - printf ("Checking mode.... "); - } - /* m68020 = (i==8); *//* if eight zeros then we are in m68020 mode */ - - /* What kind of processor am i talking to ? */ - p = buf; - while (*p++ != '\n') - {; - } - while (*p++ != '\n') - {; - } - while (*p++ != '\n') - {; - } - for (i = 0; i < 20; i++, p++) - {; - } - m68020 = !strncmp (p, "68020", 5); - if (from_tty) - { - printf ("You are in %s(%c%c%c%c%c)-mode\n", MODE, p[0], p[1], p[2], - p[3], p[4]); - } - - /* if no init_break statement is present in .gdb file we have to check - whether to download a breakpoint routine or not */ - -#if 0 - if ((es1800_break_vec == 0) || (verify_break (es1800_break_vec) != 0) - && query ("No breakpoint routine in ES 1800 emulator!\nDownload a breakpoint routine to the emulator? ")) - { - CORE_ADDR memaddress; - printf ("Give the start address of the breakpoint routine: "); - scanf ("%li", &memaddress); - es1800_init_break ((es1800_break_vec ? es1800_break_vec : - ES1800_BREAK_VEC), memaddress); - } -#endif - -} - -/* Close out all files and local state before this target loses control. - quitting - are we quitting gdb now? */ - -static void -es1800_close (int quitting) -{ - if (es1800_desc != NULL) - { - printf ("\nClosing connection to emulator...\n"); - if (serial_set_tty_state (es1800_desc, es1800_saved_ttystate) < 0) - print_sys_errmsg ("warning: unable to restore tty state", errno); - fcntl (deprecated_serial_fd (es1800_desc), F_SETFL, es1800_fc_save); - serial_close (es1800_desc); - es1800_desc = NULL; - } - if (savename != NULL) - { - xfree (savename); - } - savename = NULL; - -#if defined (LOG_FILE) - - if (log_file != NULL) - { - if (ferror (log_file)) - { - printf ("Error writing log file.\n"); - } - if (fclose (log_file) != 0) - { - printf ("Error closing log file.\n"); - } - log_file = NULL; - } - -#endif /* LOG_FILE */ - -} - -/* Attaches to a process on the target side - proc_id - the id of the process to be attached. - from_tty - says whether to be verbose or not */ - -static void -es1800_attach (char *args, int from_tty) -{ - error ("Cannot attach to pid %s, this feature is not implemented yet.", - args); -} - - -/* Takes a program previously attached to and detaches it. - We better not have left any breakpoints - in the program or it'll die when it hits one. - Close the open connection to the remote debugger. - Use this when you want to detach and do something else - with your gdb. - - args - arguments given to the 'detach' command - from_tty - says whether to be verbose or not */ - -static void -es1800_detach (char *args, int from_tty) -{ - if (args) - { - error ("Argument given to \"detach\" when remotely debugging."); - } - pop_target (); - if (from_tty) - { - printf ("Ending es1800 remote debugging.\n"); - } -} - - -/* Tell the remote machine to resume. - step - single-step or run free - siggnal - the signal value to be given to the target (0 = no signal) */ - -static void -es1800_resume (ptid_t ptid, int step, enum target_signal siggnal) -{ - char buf[PBUFSIZ]; - - if (siggnal) - { - error ("Can't send signals to a remote system."); - } - if (step) - { - strcpy (buf, "STP\r"); - send (buf); - } - else - { - send_command ("RBK"); - } -} - -/* Wait until the remote machine stops, then return, - storing status in STATUS just as `wait' would. - status - */ - -static ptid_t -es1800_wait (ptid_t ptid, struct target_waitstatus *status) -{ - unsigned char buf[PBUFSIZ]; - int old_timeout = timeout; - - status->kind = TARGET_WAITKIND_EXITED; - status->value.integer = 0; - - timeout = 0; /* Don't time out -- user program is running. */ - if (!setjmp (interrupt)) - { - old_sigint = signal (SIGINT, es1800_request_quit); - while (1) - { - getmessage (buf, sizeof (buf)); - if (strncmp (buf, "\r\n* BREAK *", 11) == 0) - { - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_TRAP; - send_command ("STP"); /* Restore stack and PC and such */ - if (m68020) - { - send_command ("STP"); - } - break; - } - if (strncmp (buf, "STP\r\n ", 6) == 0) - { - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_TRAP; - break; - } - if (buf[strlen (buf) - 2] == 'R') - { - printf ("Unexpected emulator reply: \n%s\n", buf); - } - else - { - printf ("Unexpected stop: \n%s\n", buf); - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_QUIT; - break; - } - } - } - else - { - fflush (stdin); - printf ("\nStopping emulator..."); - if (!setjmp (interrupt)) - { - old_sigint = signal (SIGINT, es1800_request_quit); - send_command ("STP"); - printf (" emulator stopped\n"); - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_INT; - } - else - { - fflush (stdin); - es1800_reset ((char *) 1); - } - } - signal (SIGINT, old_sigint); - timeout = old_timeout; - return inferior_ptid; -} - - -/* Fetch register values from remote machine. - regno - the register to be fetched (fetch all registers if -1) */ - -static void -es1800_fetch_register (int regno) -{ - char buf[PBUFSIZ]; - int k; - int r; - char *p; - static char regtab[18][4] = - { - "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ", - "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP", - "SR ", "PC " - }; - - if ((regno < 15) || (regno == 16) || (regno == 17)) - { - r = regno * 4; - send_with_reply (regtab[regno], buf, sizeof (buf)); - p = buf; - for (k = 0; k < 4; k++) - { - if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0)) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]); - } - } - else - { - es1800_fetch_registers (); - } -} - -/* Read the remote registers into REGISTERS. - Always fetches all registers. */ - -static void -es1800_fetch_registers (void) -{ - char buf[PBUFSIZ]; - char SR_buf[PBUFSIZ]; - int i; - int k; - int r; - char *p; - - send_with_reply ("DR", buf, sizeof (buf)); - - /* Reply is edited to a string that describes registers byte by byte, - each byte encoded as two hex characters. */ - - p = buf; - r = 0; - - /* parsing row one - D0-D7-registers */ - - while (*p++ != '\n') - {; - } - for (i = 4; i < 70; i += (i == 39 ? 3 : 1)) - { - for (k = 0; k < 4; k++) - { - if (p[i + 0] == 0 || p[i + 1] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = (fromhex (p[i + 0]) * 16) + fromhex (p[i + 1]); - i += 2; - } - } - p += i; - - /* parsing row two - A0-A6-registers */ - - while (*p++ != '\n') - {; - } - for (i = 4; i < 61; i += (i == 39 ? 3 : 1)) - { - for (k = 0; k < 4; k++) - { - if (p[i + 0] == 0 || p[i + 1] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = (fromhex (p[i + 0])) * 16 + fromhex (p[i + 1]); - i += 2; - } - } - p += i; - - while (*p++ != '\n') - {; - } - - /* fetch SSP-, SR- and PC-registers */ - - /* first - check STATUS-word and decide which stackpointer to use */ - - send_with_reply ("SR", SR_buf, sizeof (SR_buf)); - p = SR_buf; - p += 5; - - if (m68020) - { - if (*p == '3') /* use masterstackpointer MSP */ - { - send_with_reply ("MSP", buf, sizeof (buf)); - } - else if (*p == '2') /* use interruptstackpointer ISP */ - { - send_with_reply ("ISP", buf, sizeof (buf)); - } - else - /* use userstackpointer USP */ - { - send_with_reply ("USP", buf, sizeof (buf)); - } - p = buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]); - } - - p = SR_buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = - fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]); - } - send_with_reply ("PC", buf, sizeof (buf)); - p = buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]); - } - } - else - /* 68000-mode */ - { - if (*p == '2') /* use supervisorstackpointer SSP */ - { - send_with_reply ("SSP", buf, sizeof (buf)); - } - else - /* use userstackpointer USP */ - { - send_with_reply ("USP", buf, sizeof (buf)); - } - - /* fetch STACKPOINTER */ - - p = buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]); - } - - /* fetch STATUS */ - - p = SR_buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = - fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]); - } - - /* fetch PC */ - - send_with_reply ("PC", buf, sizeof (buf)); - p = buf; - for (k = 0; k < 4; k++) - { - if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0) - { - error ("Emulator reply is too short: %s", buf); - } - deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]); - } - } -} - -/* Store register value, located in REGISTER, on the target processor. - regno - the register-number of the register to store - (-1 means store them all) - FIXME: Return errno value. */ - -static void -es1800_store_register (int regno) -{ - - static char regtab[18][4] = - { - "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ", - "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP", - "SR ", "PC " - }; - - char buf[PBUFSIZ]; - char SR_buf[PBUFSIZ]; - char stack_pointer[4]; - char *p; - int i; - int j; - int k; - unsigned char *r; - - r = (unsigned char *) deprecated_registers; - - if (regno == -1) /* write all registers */ - { - j = 0; - k = 18; - } - else - /* write one register */ - { - j = regno; - k = regno + 1; - r += regno * 4; - } - - if ((regno == -1) || (regno == 15)) - { - /* fetch current status */ - send_with_reply ("SR", SR_buf, sizeof (SR_buf)); - p = SR_buf; - p += 5; - if (m68020) - { - if (*p == '3') /* use masterstackpointer MSP */ - { - strcpy (stack_pointer, "MSP"); - } - else - { - if (*p == '2') /* use interruptstackpointer ISP */ - { - strcpy (stack_pointer, "ISP"); - } - else - { - strcpy (stack_pointer, "USP"); /* use userstackpointer USP */ - } - } - } - else - /* 68000-mode */ - { - if (*p == '2') /* use supervisorstackpointer SSP */ - { - strcpy (stack_pointer, "SSP"); - } - else - { - strcpy (stack_pointer, "USP"); /* use userstackpointer USP */ - } - } - strcpy (regtab[15], stack_pointer); - } - - for (i = j; i < k; i++) - { - buf[0] = regtab[i][0]; - buf[1] = regtab[i][1]; - buf[2] = regtab[i][2]; - buf[3] = '='; - buf[4] = '$'; - buf[5] = tohex ((*r >> 4) & 0x0f); - buf[6] = tohex (*r++ & 0x0f); - buf[7] = tohex ((*r >> 4) & 0x0f); - buf[8] = tohex (*r++ & 0x0f); - buf[9] = tohex ((*r >> 4) & 0x0f); - buf[10] = tohex (*r++ & 0x0f); - buf[11] = tohex ((*r >> 4) & 0x0f); - buf[12] = tohex (*r++ & 0x0f); - buf[13] = 0; - - send_with_reply (buf, buf, sizeof (buf)); /* FIXME, reply not used? */ - } -} - - -/* Prepare to store registers. */ - -static void -es1800_prepare_to_store (void) -{ - /* Do nothing, since we can store individual regs */ -} - -/* Convert hex digit A to a number. */ - -static int -fromhex (int a) -{ - if (a >= '0' && a <= '9') - { - return a - '0'; - } - else if (a >= 'a' && a <= 'f') - { - return a - 'a' + 10; - } - else if (a >= 'A' && a <= 'F') - { - return a - 'A' + 10; - } - else - { - error ("Reply contains invalid hex digit"); - } - return (-1); -} - - -/* Convert number NIB to a hex digit. */ - -static int -tohex (int nib) -{ - if (nib < 10) - { - return ('0' + nib); - } - else - { - return ('A' + nib - 10); - } -} - -/* Read or write LEN bytes from inferior memory at MEMADDR, transferring - to or from debugger address MYADDR. Write to inferior if WRITE is - nonzero. Returns length of data written or read; 0 for error. - - memaddr - the target's address - myaddr - gdb's address - len - number of bytes - write - write if != 0 otherwise read - tops - unused */ - -static int -es1800_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, - int write, struct mem_attrib *attrib, - struct target_ops *target) -{ - int origlen = len; - int xfersize; - - while (len > 0) - { - xfersize = len > MAXBUFBYTES ? MAXBUFBYTES : len; - if (write) - { - es1800_write_bytes (memaddr, myaddr, xfersize); - } - else - { - es1800_read_bytes (memaddr, myaddr, xfersize); - } - memaddr += xfersize; - myaddr += xfersize; - len -= xfersize; - } - return (origlen); /* no error possible */ -} - - -/* Write memory data directly to the emulator. - This does not inform the data cache; the data cache uses this. - MEMADDR is the address in the remote memory space. - MYADDR is the address of the buffer in our space. - LEN is the number of bytes. - - memaddr - the target's address - myaddr - gdb's address - len - number of bytes */ - -static void -es1800_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) -{ - char buf[PBUFSIZ]; - int i; - char *p; - - p = myaddr; - for (i = 0; i < len; i++) - { - sprintf (buf, "@.B$%x=$%x", memaddr + i, (*p++) & 0xff); - send_with_reply (buf, buf, sizeof (buf)); /* FIXME send_command? */ - } -} - - -/* Read memory data directly from the emulator. - This does not use the data cache; the data cache uses this. - - memaddr - the target's address - myaddr - gdb's address - len - number of bytes */ - -static void -es1800_read_bytes (CORE_ADDR memaddr, char *myaddr, int len) -{ - static int DB_tab[16] = - {8, 11, 14, 17, 20, 23, 26, 29, 34, 37, 40, 43, 46, 49, 52, 55}; - char buf[PBUFSIZ]; - int i; - int low_addr; - char *p; - char *b; - - if (len > PBUFSIZ / 2 - 1) - { - internal_error (__FILE__, __LINE__, "failed internal consistency check"); - } - - if (len == 1) /* The emulator does not like expressions like: */ - { - len = 2; /* DB.B $20018 TO $20018 */ - } - - /* Reply describes registers byte by byte, each byte encoded as two hex - characters. */ - - sprintf (buf, "DB.B $%x TO $%x", memaddr, memaddr + len - 1); - send_with_reply (buf, buf, sizeof (buf)); - b = buf; - low_addr = memaddr & 0x0f; - for (i = low_addr; i < low_addr + len; i++) - { - if ((!(i % 16)) && i) - { /* if (i = 16,32,48) */ - while (*p++ != '\n') - {; - } - b = p; - } - p = b + DB_tab[i % 16] + (m68020 ? 2 : 0); - if (p[0] == 32 || p[1] == 32) - { - error ("Emulator reply is too short: %s", buf); - } - myaddr[i - low_addr] = fromhex (p[0]) * 16 + fromhex (p[1]); - } -} - -/* Display information about the current target. TOPS is unused. */ - -static void -es1800_files_info (struct target_ops *tops) -{ - printf ("ES1800 Attached to %s at %d baud in %s mode\n", savename, 19200, - MODE); -} - - -/* We read the contents of the target location and stash it, - then overwrite it with a breakpoint instruction. - - addr - is the target location in the target machine. - contents_cache - is a pointer to memory allocated for saving the target contents. - It is guaranteed by the caller to be long enough to save sizeof - BREAKPOINT bytes. - - FIXME: This size is target_arch dependent and should be available in - the target_arch transfer vector, if we ever have one... */ - -static int -es1800_insert_breakpoint (CORE_ADDR addr, char *contents_cache) -{ - int val; - - val = target_read_memory (addr, contents_cache, sizeof (es1800_break_insn)); - - if (val == 0) - { - val = target_write_memory (addr, es1800_break_insn, - sizeof (es1800_break_insn)); - } - - return (val); -} - - -/* Write back the stashed instruction - - addr - is the target location in the target machine. - contents_cache - is a pointer to memory allocated for saving the target contents. - It is guaranteed by the caller to be long enough to save sizeof - BREAKPOINT bytes. */ - -static int -es1800_remove_breakpoint (CORE_ADDR addr, char *contents_cache) -{ - - return (target_write_memory (addr, contents_cache, - sizeof (es1800_break_insn))); -} - -/* create_break_insn () - Primitive datastructures containing the es1800 breakpoint instruction */ - -static void -es1800_create_break_insn (char *ins, int vec) -{ - if (vec == 15) - { - ins[0] = 0x4e; - ins[1] = 0x4f; - } -} - - -/* verify_break () - Seach for breakpoint routine in emulator memory. - returns non-zero on failure - vec - trap vector used for breakpoints */ - -static int -verify_break (int vec) -{ - CORE_ADDR memaddress; - char buf[8]; - char *instr = "NqNqNqNs"; /* breakpoint routine */ - int status; - - get_break_addr (vec, &memaddress); - - if (memaddress) - { - status = target_read_memory (memaddress, buf, 8); - if (status != 0) - { - memory_error (status, memaddress); - } - return (strcmp (instr, buf)); - } - return (-1); -} - - -/* get_break_addr () - find address of breakpoint routine - vec - trap vector used for breakpoints - addrp - store the address here */ - -static void -get_break_addr (int vec, CORE_ADDR *addrp) -{ - CORE_ADDR memaddress = 0; - int status; - int k; - char buf[PBUFSIZ]; - char base_addr[4]; - char *p; - - if (m68020) - { - send_with_reply ("VBR ", buf, sizeof (buf)); - p = buf; - for (k = 0; k < 4; k++) - { - if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0)) - { - error ("Emulator reply is too short: %s", buf); - } - base_addr[k] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]); - } - /* base addr of exception vector table */ - memaddress = *((CORE_ADDR *) base_addr); - } - - memaddress += (vec + 32) * 4; /* address of trap vector */ - status = target_read_memory (memaddress, (char *) addrp, 4); - if (status != 0) - { - memory_error (status, memaddress); - } -} - - -/* Kill an inferior process */ - -static void -es1800_kill (void) -{ - if (!ptid_equal (inferior_ptid, null_ptid)) - { - inferior_ptid = null_ptid; - es1800_mourn_inferior (); - } -} - - -/* Load a file to the ES1800 emulator. - Converts the file from a.out format into Extended Tekhex format - before the file is loaded. - Also loads the trap routine, and sets the ES1800 breakpoint on it - filename - the a.out to be loaded - from_tty - says whether to be verbose or not - FIXME Uses emulator overlay memory for trap routine */ - -static void -es1800_load (char *filename, int from_tty) -{ - - FILE *instream; - char loadname[15]; - char buf[160]; - struct cleanup *old_chain; - int es1800_load_format = 5; - - if (es1800_desc == NULL) - { - printf ("No emulator attached, type emulator-command first\n"); - return; - } - - filename = tilde_expand (filename); - make_cleanup (xfree, filename); - - switch (es1800_load_format) - { - case 2: /* Extended Tekhex */ - if (from_tty) - { - printf ("Converting \"%s\" to Extended Tekhex Format\n", filename); - } - sprintf (buf, "tekhex %s", filename); - system (buf); - sprintf (loadname, "out.hex"); - break; - - case 5: /* Motorola S-rec */ - if (from_tty) - { - printf ("Converting \"%s\" to Motorola S-record format\n", - filename); - } - /* in the future the source code in copy (part of binutils-1.93) will - be included in this file */ - sprintf (buf, - "copy -s \"a.out-sunos-big\" -d \"srec\" %s /tmp/out.hex", - filename); - system (buf); - sprintf (loadname, "/tmp/out.hex"); - break; - - default: - error ("Downloading format not defined\n"); - } - - breakpoint_init_inferior (); - inferior_ptid = null_ptid; - if (from_tty) - { - printf ("Downloading \"%s\" to the ES 1800\n", filename); - } - if ((instream = fopen (loadname, "r")) == NULL) - { - perror_with_name ("fopen:"); - } - - old_chain = make_cleanup (fclose, instream); - immediate_quit++; - - es1800_reset (0); - - download (instream, from_tty, es1800_load_format); - - /* if breakpoint routine is not present anymore we have to check - whether to download a new breakpoint routine or not */ - - if ((verify_break (es1800_break_vec) != 0) - && query ("No breakpoint routine in ES 1800 emulator!\nDownload a breakpoint routine to the emulator? ")) - { - char buf[128]; - printf ("Using break vector 0x%x\n", es1800_break_vec); - sprintf (buf, "0x%x ", es1800_break_vec); - printf ("Give the start address of the breakpoint routine: "); - fgets (buf + strlen (buf), sizeof (buf) - strlen (buf), stdin); - es1800_init_break (buf, 0); - } - - do_cleanups (old_chain); - expect_prompt (); - readchar (); /* FIXME I am getting a ^G = 7 after the prompt */ - printf ("\n"); - - if (fclose (instream) == EOF) - { - ; - } - - if (es1800_load_format != 2) - { - sprintf (buf, "/usr/bin/rm %s", loadname); - system (buf); - } - - symbol_file_add_main (filename, from_tty); /* reading symbol table */ - immediate_quit--; -} - -#if 0 - -#define NUMCPYBYTES 20 - -static void -bfd_copy (bfd *from_bfd, bfd *to_bfd) -{ - asection *p, *new; - int i; - char buf[NUMCPYBYTES]; - - for (p = from_bfd->sections; p != NULL; p = p->next) - { - printf (" Copying section %s. Size = %x.\n", p->name, p->_cooked_size); - printf (" vma = %x, offset = %x, output_sec = %x\n", - p->vma, p->output_offset, p->output_section); - new = bfd_make_section (to_bfd, p->name); - if (p->_cooked_size && - !bfd_set_section_size (to_bfd, new, p->_cooked_size)) - { - error ("Wrong BFD size!\n"); - } - if (!bfd_set_section_flags (to_bfd, new, p->flags)) - { - error ("bfd_set_section_flags"); - } - new->vma = p->vma; - - for (i = 0; (i + NUMCPYBYTES) < p->_cooked_size; i += NUMCPYBYTES) - { - if (!bfd_get_section_contents (from_bfd, p, (PTR) buf, (file_ptr) i, - (bfd_size_type) NUMCPYBYTES)) - { - error ("bfd_get_section_contents\n"); - } - if (!bfd_set_section_contents (to_bfd, new, (PTR) buf, (file_ptr) i, - (bfd_size_type) NUMCPYBYTES)) - { - error ("bfd_set_section_contents\n"); - } - } - bfd_get_section_contents (from_bfd, p, (PTR) buf, (file_ptr) i, - (bfd_size_type) (p->_cooked_size - i)); - bfd_set_section_contents (to_bfd, new, (PTR) buf, (file_ptr) i, - (bfd_size_type) (p->_cooked_size - i)); - } -} - -#endif - -/* Start an process on the es1800 and set inferior_ptid to the new - process' pid. - execfile - the file to run - args - arguments passed to the program - env - the environment vector to pass */ - -static void -es1800_create_inferior (char *execfile, char *args, char **env) -{ - int entry_pt; - int pid; -#if 0 - struct expression *expr; - register struct cleanup *old_chain = 0; - register value val; -#endif - - if (args && *args) - { - error ("Can't pass arguments to remote ES1800 process"); - } - -#if 0 - if (query ("Use 'start' as entry point? ")) - { - expr = parse_c_expression ("start"); - old_chain = make_cleanup (free_current_contents, &expr); - val = evaluate_expression (expr); - entry_pt = (val->location).address; - } - else - { - printf ("Enter the program's entry point (in hexadecimal): "); - scanf ("%x", &entry_pt); - } -#endif - - if (execfile == 0 || exec_bfd == 0) - { - error ("No executable file specified"); - } - - entry_pt = (int) bfd_get_start_address (exec_bfd); - - pid = 42; - - /* Now that we have a child process, make it our target. */ - - push_target (&es1800_child_ops); - - /* 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 (); - - /* remote_start (args); */ - /* trap_expected = 0; */ - /* insert_step_breakpoint (); FIXME, do we need this? */ - - /* Let 'er rip... */ - proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); - -} - - -/* The process has died, clean up. */ - -static void -es1800_mourn_inferior (void) -{ - remove_breakpoints (); - unpush_target (&es1800_child_ops); - generic_mourn_inferior (); /* Do all the proper things now */ -} - -/* ES1800-protocol specific routines */ - -/* Keep discarding input from the remote system, until STRING is found. - Let the user break out immediately. - string - the string to expect - nowait - break out if string not the emulator's first respond otherwise - read until string is found (== 0) */ - -static void -expect (char *string, int nowait) -{ - char c; - char *p = string; - - immediate_quit++; - while (1) - { - c = readchar (); - if (isalpha (c)) - { - c = toupper (c); - } - if (c == toupper (*p)) - { - p++; - if (*p == '\0') - { - immediate_quit--; - return; - } - } - else if (!nowait) - { - p = string; - } - else - { - printf ("\'%s\' expected\n", string); - printf ("char %d is %d", p - string, c); - error ("\n"); - } - } -} - -/* Keep discarding input until we see the prompt. */ - -static void -expect_prompt (void) -{ - expect (">", 0); -} - - -/* Read one character */ - -#ifdef DEBUG_STDIN - -/* read from stdin */ - -static int -readchar (void) -{ - char buf[1]; - - buf[0] = '\0'; - printf ("readchar, give one character\n"); - read (0, buf, 1); - -#if defined (LOG_FILE) - putc (buf[0] & 0x7f, log_file); -#endif - - return (buf[0] & 0x7f); -} - -#else /* !DEBUG_STDIN */ - -/* Read a character from the remote system, doing all the fancy - timeout stuff. */ - -static int -readchar (void) -{ - int ch; - - ch = serial_readchar (es1800_desc, timeout); - - /* FIXME: doing an error() here will probably cause trouble, at least if from - es1800_wait. */ - if (ch == SERIAL_TIMEOUT) - error ("Timeout reading from remote system."); - else if (ch == SERIAL_ERROR) - perror_with_name ("remote read"); - -#if defined (LOG_FILE) - putc (ch & 0x7f, log_file); - fflush (log_file); -#endif - - return (ch); -} - -#endif /* DEBUG_STDIN */ - - -/* Send a command to the emulator and save the reply. - Report an error if we get an error reply. - string - the es1800 command - buf - containing the emulator reply on return - len - size of buf */ - -static void -send_with_reply (char *string, char *buf, int len) -{ - send (string); - serial_write (es1800_desc, "\r", 1); - -#ifndef DEBUG_STDIN - expect (string, 1); - expect ("\r\n", 0); -#endif - - getmessage (buf, len); -} - - -/* Send the command in STR to the emulator adding \r. check - the echo for consistency. - string - the es1800 command */ - -static void -send_command (char *string) -{ - send (string); - serial_write (es1800_desc, "\r", 1); - -#ifndef DEBUG_STDIN - expect (string, 0); - expect_prompt (); -#endif - -} - -/* Send a string - string - the es1800 command */ - -static void -send (char *string) -{ - if (kiodebug) - { - fprintf_unfiltered (gdb_stderr, "Sending: %s\n", string); - } - serial_write (es1800_desc, string, strlen (string)); -} - - -/* Read a message from the emulator and store it in BUF. - buf - containing the emulator reply on return - len - size of buf */ - -static void -getmessage (char *buf, int len) -{ - char *bp; - int c; - int prompt_found = 0; - extern kiodebug; - -#if defined (LOG_FILE) - /* This is a convenient place to do this. The idea is to do it often - enough that we never lose much data if we terminate abnormally. */ - fflush (log_file); -#endif - - bp = buf; - c = readchar (); - do - { - if (c) - { - if (len-- < 2) /* char and terminaling NULL */ - { - error ("input buffer overrun\n"); - } - *bp++ = c; - } - c = readchar (); - if ((c == '>') && (*(bp - 1) == ' ')) - { - prompt_found = 1; - } - } - while (!prompt_found); - *bp = 0; - - if (kiodebug) - { - fprintf_unfiltered (gdb_stderr, "message received :%s\n", buf); - } -} - -static void -download (FILE *instream, int from_tty, int format) -{ - char c; - char buf[160]; - int i = 0; - - send_command ("SET #2,$1A"); /* reset char = ^Z */ - send_command ("SET #3,$11,$13"); /* XON XOFF */ - if (format == 2) - { - send_command ("SET #26,#2"); - } - else - { - send_command ("SET #26,#5"); /* Format=Extended Tekhex */ - } - send_command ("DFB = $10"); - send_command ("PUR"); - send_command ("CES"); - send ("DNL\r"); - expect ("DNL", 1); - if (from_tty) - { - printf (" 0 records loaded...\r"); - } - while (fgets (buf, 160, instream)) - { - send (buf); - if (from_tty) - { - printf ("%5d\b\b\b\b\b", ++i); - fflush (stdout); - } - if ((c = readchar ()) != 006) - { - error ("expected ACK"); - } - } - if (from_tty) - { - printf ("- All"); - } -} - -/* Additional commands */ - -#if defined (TIOCGETP) && defined (FNDELAY) && defined (EWOULDBLOCK) -#define PROVIDE_TRANSPARENT -#endif - -#ifdef PROVIDE_TRANSPARENT -/* Talk directly to the emulator - FIXME, uses busy wait, and is SUNOS (or at least BSD) specific */ - -/*ARGSUSED */ -static void -es1800_transparent (char *args, int from_tty) -{ - int console; - struct sgttyb modebl; - int fcflag; - int cc; - struct sgttyb console_mode_save; - int console_fc_save; - int es1800_fc_save; - int inputcnt = 80; - char inputbuf[80]; - int consolecnt = 0; - char consolebuf[80]; - int es1800_cnt = 0; - char es1800_buf[80]; - int i; - - dont_repeat (); - if (es1800_desc == NULL) - { - printf ("No emulator attached, type emulator-command first\n"); - return; - } - - printf ("\n"); - printf ("You are now communicating directly with the ES 1800 emulator.\n"); - printf ("To leave this mode (transparent mode), press ^E.\n"); - printf ("\n"); - printf (" >"); - fflush (stdout); - - if ((console = open ("/dev/tty", O_RDWR)) == -1) - { - perror_with_name ("/dev/tty:"); - } - - if ((fcflag = fcntl (console, F_GETFL, 0)) == -1) - { - perror_with_name ("fcntl console"); - } - - console_fc_save = fcflag; - fcflag = fcflag | FNDELAY; - - if (fcntl (console, F_SETFL, fcflag) == -1) - { - perror_with_name ("fcntl console"); - } - - if (ioctl (console, TIOCGETP, &modebl)) - { - perror_with_name ("ioctl console"); - } - - console_mode_save = modebl; - modebl.sg_flags = RAW; - - if (ioctl (console, TIOCSETP, &modebl)) - { - perror_with_name ("ioctl console"); - } - - if ((fcflag = fcntl (deprecated_serial_fd (es1800_desc), F_GETFL, 0)) == -1) - { - perror_with_name ("fcntl serial"); - } - - es1800_fc_save = fcflag; - fcflag = fcflag | FNDELAY; - - if (fcntl (deprecated_serial_fd (es1800_desc), F_SETFL, fcflag) == -1) - { - perror_with_name ("fcntl serial"); - } - - while (1) - { - cc = read (console, inputbuf, inputcnt); - if (cc != -1) - { - if ((*inputbuf & 0x7f) == 0x05) - { - break; - } - for (i = 0; i < cc;) - { - es1800_buf[es1800_cnt++] = inputbuf[i++]; - } - if ((cc = serial_write (es1800_desc, es1800_buf, es1800_cnt)) == -1) - { - perror_with_name ("FEL! write:"); - } - es1800_cnt -= cc; - if (es1800_cnt && cc) - { - for (i = 0; i < es1800_cnt; i++) - { - es1800_buf[i] = es1800_buf[cc + i]; - } - } - } - else if (errno != EWOULDBLOCK) - { - perror_with_name ("FEL! read:"); - } - - cc = read (deprecated_serial_fd (es1800_desc), inputbuf, inputcnt); - if (cc != -1) - { - for (i = 0; i < cc;) - { - consolebuf[consolecnt++] = inputbuf[i++]; - } - if ((cc = write (console, consolebuf, consolecnt)) == -1) - { - perror_with_name ("FEL! write:"); - } - consolecnt -= cc; - if (consolecnt && cc) - { - for (i = 0; i < consolecnt; i++) - { - consolebuf[i] = consolebuf[cc + i]; - } - } - } - else if (errno != EWOULDBLOCK) - { - perror_with_name ("FEL! read:"); - } - } - - console_fc_save = console_fc_save & !FNDELAY; - if (fcntl (console, F_SETFL, console_fc_save) == -1) - { - perror_with_name ("FEL! fcntl"); - } - - if (ioctl (console, TIOCSETP, &console_mode_save)) - { - perror_with_name ("FEL! ioctl"); - } - - close (console); - - if (fcntl (deprecated_serial_fd (es1800_desc), F_SETFL, es1800_fc_save) == -1) - { - perror_with_name ("FEL! fcntl"); - } - - printf ("\n"); - -} -#endif /* PROVIDE_TRANSPARENT */ - -static void -es1800_init_break (char *args, int from_tty) -{ - CORE_ADDR memaddress = 0; - char buf[PBUFSIZ]; - char base_addr[4]; - char *space_index; - char *p; - int k; - - if (args == NULL) - { - error_no_arg ("a trap vector"); - } - - if (!(space_index = strchr (args, ' '))) - { - error ("Two arguments needed (trap vector and address of break routine).\n"); - } - - *space_index = '\0'; - - es1800_break_vec = strtol (args, (char **) NULL, 0); - es1800_break_address = parse_and_eval_address (space_index + 1); - - es1800_create_break_insn (es1800_break_insn, es1800_break_vec); - - if (m68020) - { - send_with_reply ("VBR ", buf, sizeof (buf)); - p = buf; - for (k = 0; k < 4; k++) - { - if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0)) - { - error ("Emulator reply is too short: %s", buf); - } - base_addr[k] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]); - } - /* base addr of exception vector table */ - memaddress = *((CORE_ADDR *) base_addr); - } - - memaddress += (es1800_break_vec + 32) * 4; /* address of trap vector */ - - sprintf (buf, "@.L%lx=$%lx", memaddress, es1800_break_address); - send_command (buf); /* set the address of the break routine in the */ - /* trap vector */ - - sprintf (buf, "@.L%lx=$4E714E71", es1800_break_address); /* NOP; NOP */ - send_command (buf); - sprintf (buf, "@.L%lx=$4E714E73", es1800_break_address + 4); /* NOP; RTE */ - send_command (buf); - - sprintf (buf, "AC2=$%lx", es1800_break_address + 4); - /* breakpoint at es1800-break_address */ - send_command (buf); - send_command ("WHEN AC2 THEN BRK"); /* ie in exception routine */ - - if (from_tty) - { - printf ("Breakpoint (trap $%x) routine at address: %lx\n", - es1800_break_vec, es1800_break_address); - } -} - -static void -es1800_child_open (char *arg, int from_tty) -{ - error ("Use the \"run\" command to start a child process."); -} - -static void -es1800_child_detach (char *args, int from_tty) -{ - if (args) - { - error ("Argument given to \"detach\" when remotely debugging."); - } - - pop_target (); - if (from_tty) - { - printf ("Ending debugging the process %d.\n", PIDGET (inferior_ptid)); - } -} - - -/* Define the target subroutine names */ - -struct target_ops es1800_ops; - -static void -init_es1800_ops (void) -{ - es1800_ops.to_shortname = "es1800"; - es1800_ops.to_longname = "Remote serial target in ES1800-emulator protocol"; - es1800_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\ -Specify the serial device it is connected to (e.g. /dev/ttya)."; - es1800_ops.to_open = es1800_open; - es1800_ops.to_close = es1800_close; - es1800_ops.to_attach = es1800_attach; - es1800_ops.to_detach = es1800_detach; - es1800_ops.to_resume = es1800_resume; - es1800_ops.to_prepare_to_store = es1800_prepare_to_store; - es1800_ops.to_xfer_memory = es1800_xfer_inferior_memory; - es1800_ops.to_files_info = es1800_files_info; - es1800_ops.to_insert_breakpoint = es1800_insert_breakpoint; - es1800_ops.to_remove_breakpoint = es1800_remove_breakpoint; - es1800_ops.to_load = es1800_load; - es1800_ops.to_create_inferior = es1800_create_inferior; - es1800_ops.to_stratum = core_stratum; - es1800_ops.to_has_memory = 1; - es1800_ops.to_magic = OPS_MAGIC; -} - -/* Define the target subroutine names */ - -struct target_ops es1800_child_ops; - -static void -init_es1800_child_ops (void) -{ - es1800_child_ops.to_shortname = "es1800_process"; - es1800_child_ops.to_longname = "Remote serial target in ES1800-emulator protocol"; - es1800_child_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\ -Specify the serial device it is connected to (e.g. /dev/ttya)."; - es1800_child_ops.to_open = es1800_child_open; - es1800_child_ops.to_attach = es1800_attach; - es1800_child_ops.to_detach = es1800_child_detach; - es1800_child_ops.to_resume = es1800_resume; - es1800_child_ops.to_wait = es1800_wait; - es1800_child_ops.to_fetch_registers = es1800_fetch_register; - es1800_child_ops.to_store_registers = es1800_store_register; - es1800_child_ops.to_prepare_to_store = es1800_prepare_to_store; - es1800_child_ops.to_xfer_memory = es1800_xfer_inferior_memory; - es1800_child_ops.to_files_info = es1800_files_info; - es1800_child_ops.to_insert_breakpoint = es1800_insert_breakpoint; - es1800_child_ops.to_remove_breakpoint = es1800_remove_breakpoint; - es1800_child_ops.to_kill = es1800_kill; - es1800_child_ops.to_load = es1800_load; - es1800_child_ops.to_create_inferior = es1800_create_inferior; - es1800_child_ops.to_mourn_inferior = es1800_mourn_inferior; - es1800_child_ops.to_stratum = process_stratum; - es1800_child_ops.to_has_all_memory = 1; - es1800_child_ops.to_has_memory = 1; - es1800_child_ops.to_has_stack = 1; - es1800_child_ops.to_has_registers = 1; - es1800_child_ops.to_has_execution = 1; - es1800_child_ops.to_magic = OPS_MAGIC; -} - -void -_initialize_es1800 (void) -{ - init_es1800_ops (); - init_es1800_child_ops (); - add_target (&es1800_ops); - add_target (&es1800_child_ops); -#ifdef PROVIDE_TRANSPARENT - add_com ("transparent", class_support, es1800_transparent, - "Start transparent communication with the ES 1800 emulator."); -#endif /* PROVIDE_TRANSPARENT */ - add_com ("init_break", class_support, es1800_init_break, - "Download break routine and initialize break facility on ES 1800"); -} diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 044746d..a23f72d 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1283,13 +1283,13 @@ mips_request (int cmd, } static void -mips_initialize_cleanups (PTR arg) +mips_initialize_cleanups (void *arg) { mips_initializing = 0; } static void -mips_exit_cleanups (PTR arg) +mips_exit_cleanups (void *arg) { mips_exiting = 0; } @@ -1791,7 +1791,7 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status) &rpc, &rfp, &rsp, flags); if (nfields >= 3) { - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); store_unsigned_integer (buf, REGISTER_RAW_SIZE (PC_REGNUM), rpc); supply_register (PC_REGNUM, buf); @@ -1972,7 +1972,7 @@ mips_fetch_registers (int regno) } { - char buf[MAX_REGISTER_RAW_SIZE]; + char *buf = alloca (max_register_size (current_gdbarch)); /* We got the number the register holds, but gdb expects to see a value in the target byte ordering. */ diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index 6797d05..ac97cde 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -66,7 +66,7 @@ static void sds_fetch_registers (int); static void sds_resume (ptid_t, int, enum target_signal); -static int sds_start_remote (PTR); +static int sds_start_remote (void *); static void sds_open (char *, int); @@ -160,7 +160,7 @@ sds_close (int quitting) /* Stub for catch_errors. */ static int -sds_start_remote (PTR dummy) +sds_start_remote (void *dummy) { int c; unsigned char buf[200]; diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 3e2a7cd..cc21649 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -359,7 +359,7 @@ gdbsim_store_register (int regno) } else if (REGISTER_SIM_REGNO (regno) >= 0) { - char tmp[MAX_REGISTER_RAW_SIZE]; + char *tmp = alloca (max_register_size (current_gdbarch)); int nr_bytes; deprecated_read_register_gen (regno, tmp); nr_bytes = sim_store_register (gdbsim_desc, diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index 39d18e4..19153cf 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -638,7 +638,7 @@ struct find_sect_args static void find_sect (bfd *, asection *, void *); static void -find_sect (bfd *abfd, asection *sect, PTR obj) +find_sect (bfd *abfd, asection *sect, void *obj) { struct find_sect_args *args = (struct find_sect_args *) obj; diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index c065a87..57c0a18 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -88,7 +88,7 @@ static char * rom68k_supply_one_register (int regno, unsigned char *hex) { ULONGEST value; - unsigned char regbuf[MAX_REGISTER_RAW_SIZE]; + unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); value = 0; while (*hex != '\0') diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 65256f4..4aed8d8 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -143,8 +143,7 @@ static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR); static void exec_one_dummy_insn (void); -extern void -fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta); +extern void fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta); /* Given REGNO, a gdb register number, return the corresponding number suitable for use as a ptrace() parameter. Return -1 if @@ -685,7 +684,7 @@ objfile_symbol_add (void *arg) { struct objfile *obj = (struct objfile *) arg; - syms_from_objfile (obj, NULL, 0, 0); + syms_from_objfile (obj, NULL, 0, 0, 0, 0); new_symfile_objfile (obj, 0, 0); return 1; } diff --git a/gdb/saber.suppress b/gdb/saber.suppress deleted file mode 100644 index 6dda1c5..0000000 --- a/gdb/saber.suppress +++ /dev/null @@ -1,451 +0,0 @@ - - -/* Options for project */ -unsetopt ansi -setopt auto_compile -unsetopt auto_reload -setopt auto_replace -unsetopt batch_load -unsetopt batch_run -unsetopt cc_prog -setopt ccargs -g -unsetopt create_file -unsetopt debug_child -unsetopt echo -setopt edit_jobs 5 -unsetopt eight_bit -setopt line_edit -setopt line_meta -setopt lint_load 2 -setopt lint_run 2 -setopt list_action -setopt load_flags -I. -g -I.. -I../vx-share -unsetopt long_not_int -unsetopt make_args -setopt make_hfiles -unsetopt make_offset -unsetopt make_prog -setopt make_symbol # -setopt mem_config 16384 -unsetopt mem_trace -setopt num_proc 1 -unsetopt page_cmds -setopt page_list 19 -unsetopt page_load -unsetopt path -setopt proto_path . /s2/saber_dir30/sun4-40/proto /s2/saber_dir30/sun4-40/../common/proto -unsetopt preprocessor -setopt program_name a.out -unsetopt print_custom -setopt print_pointer -setopt print_string 20 -unsetopt save_memory -setopt sbrk_size 1048576 -setopt src_err 3 -setopt src_step 1 -setopt src_stop 3 -setopt sys_load_flags -L/lib -L/usr/lib -L/usr/local/lib -I/usr/include -Dunix -Dsun -Dsparc -unsetopt tab_stop -unsetopt terse_suppress -unsetopt terse_where -setopt unset_value 191 -unsetopt win_fork_nodup -setopt win_no_raise -unsetopt win_message_list -unsetopt win_project_list -/* Suppressions for project */ -suppress 6 in read_huge_number -/* Over/underflow */ -suppress 8 in read_huge_number -/* Over/underflow */ -suppress 22 -/* Pointer subtraction */ -suppress 22 in free_all_psymtabs -/* Pointer subtraction */ -suppress 22 in free_all_symtabs -/* Pointer subtraction */ -suppress 56 in print_string -/* Information lost */ -suppress 65 "../bfd/bfd.c":379 -/* Too many function arguments */ -suppress 65 on printf_filtered -/* Too many function arguments */ -suppress 65 on fprintf_filtered -/* Too many function arguments */ -suppress 65 on vfprintf_filtered -/* Too many function arguments */ -suppress 65 on query -/* Too many function arguments */ -suppress 65 on fatal_dump_core -/* Too many function arguments */ -suppress 65 on fatal -/* Too many function arguments */ -suppress 65 on error -/* Too many function arguments */ -suppress 65 on noprocess -/* Too many function arguments */ -suppress 65 -/* Too many function arguments */ -suppress 66 on say -/* Too few function arguments */ -suppress 66 on printf_filtered -/* Too few function arguments */ -suppress 66 on fprintf_filtered -/* Too few function arguments */ -suppress 66 on vfprintf_filtered -/* Too few function arguments */ -suppress 66 on query -/* Too few function arguments */ -suppress 66 on fatal_dump_core -/* Too few function arguments */ -suppress 66 on fatal -/* Too few function arguments */ -suppress 66 on error -/* Too few function arguments */ -suppress 67 on printf_filtered -/* Signed/unsigned argument mismatch */ -suppress 67 on fprintf_filtered -/* Signed/unsigned argument mismatch */ -suppress 67 on vfprintf_filtered -/* Signed/unsigned argument mismatch */ -suppress 67 on query -/* Signed/unsigned argument mismatch */ -suppress 67 on fatal_dump_core -/* Signed/unsigned argument mismatch */ -suppress 67 on fatal -/* Signed/unsigned argument mismatch */ -suppress 67 on error -/* Signed/unsigned argument mismatch */ -suppress 67 -/* Signed/unsigned argument mismatch */ -suppress 68 on bfd_get_section_contents -/* Benign argument mismatch */ -suppress 68 on _do_getblong -/* Benign argument mismatch */ -suppress 68 on supply_register -/* Benign argument mismatch */ -suppress 68 on target_write_memory -/* Benign argument mismatch */ -suppress 68 on write_register_bytes -/* Benign argument mismatch */ -suppress 68 on read_register_bytes -/* Benign argument mismatch */ -suppress 68 on read_memory -/* Benign argument mismatch */ -suppress 68 on say -/* Benign argument mismatch */ -suppress 68 on printf_filtered -/* Benign argument mismatch */ -suppress 68 on fprintf_filtered -/* Benign argument mismatch */ -suppress 68 on vfprintf_filtered -/* Benign argument mismatch */ -suppress 68 on query -/* Benign argument mismatch */ -suppress 68 on fatal_dump_core -/* Benign argument mismatch */ -suppress 68 on fatal -/* Benign argument mismatch */ -suppress 68 on error -/* Benign argument mismatch */ -suppress 68 in find_solib -/* Benign argument mismatch */ -suppress 68 on child_wait -/* Benign argument mismatch */ -suppress 68 on xrealloc -/* Benign argument mismatch */ -suppress 68 on myread -/* Benign argument mismatch */ -suppress 68 in do_cleanups -/* Benign argument mismatch */ -suppress 68 on make_cleanup -/* Benign argument mismatch */ -suppress 68 on target_read_memory -/* Benign argument mismatch */ -suppress 69 on printf_filtered -/* Serious argument mismatch */ -suppress 69 on fprintf_filtered -/* Serious argument mismatch */ -suppress 69 on vfprintf_filtered -/* Serious argument mismatch */ -suppress 69 on query -/* Serious argument mismatch */ -suppress 69 on fatal_dump_core -/* Serious argument mismatch */ -suppress 69 on fatal -/* Serious argument mismatch */ -suppress 69 on error -/* Serious argument mismatch */ -suppress 70 on printf_filtered -/* Passing illegal enumeration value */ -suppress 70 on fprintf_filtered -/* Passing illegal enumeration value */ -suppress 70 on vfprintf_filtered -/* Passing illegal enumeration value */ -suppress 70 on query -/* Passing illegal enumeration value */ -suppress 70 on fatal_dump_core -/* Passing illegal enumeration value */ -suppress 70 on fatal -/* Passing illegal enumeration value */ -suppress 70 on error -/* Passing illegal enumeration value */ -suppress 80 on first_link_map_member -/* Returning invalid pointer */ -suppress 110 in printf_filtered -/* Signed/unsigned memory retrieval */ -suppress 110 in fprintf_filtered -/* Signed/unsigned memory retrieval */ -suppress 110 in vfprintf_filtered -/* Signed/unsigned memory retrieval */ -suppress 110 in query -/* Signed/unsigned memory retrieval */ -suppress 110 in fatal_dump_core -/* Signed/unsigned memory retrieval */ -suppress 110 in fatal -/* Signed/unsigned memory retrieval */ -suppress 110 in error -/* Signed/unsigned memory retrieval */ -suppress 112 in printf_filtered -/* Memory retrieval */ -suppress 112 in fprintf_filtered -/* Memory retrieval */ -suppress 112 in vfprintf_filtered -/* Memory retrieval */ -suppress 112 in query -/* Memory retrieval */ -suppress 112 in fatal_dump_core -/* Memory retrieval */ -suppress 112 in fatal -/* Memory retrieval */ -suppress 112 in error -/* Memory retrieval */ -suppress 112 -/* Memory retrieval */ -suppress 112 ../symtab.c -/* Memory retrieval */ -suppress 112 in child_xfer_memory -/* Memory retrieval */ -suppress 165 in frame_saved_pc -/* Dereference */ -suppress 165 in get_prev_frame_info -/* Dereference */ -suppress 167 in get_prev_frame_info -/* Selection */ -suppress 167 in frame_saved_pc -/* Selection */ -suppress 442 in try_baudrate -/* Escape has null value */ -suppress 529 in read_range_type -/* Statement not reached */ -suppress 529 in process_one_symbol -/* Statement not reached */ -suppress 529 in unpack_double -/* Statement not reached */ -suppress 529 in wait_for_inferior -/* Statement not reached */ -suppress 529 in do_registers_info -/* Statement not reached */ -suppress 529 in value_from_register -/* Statement not reached */ -suppress 529 in solib_create_inferior_hook -/* Constant in conditional */ -suppress 530 -/* Empty body of statement */ -suppress 546 in net_quit -/* Function exits through bottom */ -suppress 546 in net_wait -/* Function exits through bottom */ -suppress 546 in vx_remove_breakpoint -/* Function exits through bottom */ -suppress 546 in vx_insert_breakpoint -/* Function exits through bottom */ -suppress 546 in value_less -/* Function exits through bottom */ -suppress 546 in value_equal -/* Function exits through bottom */ -suppress 546 in unpack_long -/* Function exits through bottom */ -suppress 558 in solib_create_inferior_hook -/* Constant in conditional */ -suppress 558 in read_range_type -/* Constant in conditional */ -suppress 558 in process_one_symbol -/* Constant in conditional */ -suppress 558 in read_dbx_symtab -/* Constant in conditional */ -suppress 558 in vx_write_register -/* Constant in conditional */ -suppress 558 in vx_read_register -/* Constant in conditional */ -suppress 558 in unpack_double -/* Constant in conditional */ -suppress 558 in wait_for_inferior -/* Constant in conditional */ -suppress 558 in do_registers_info -/* Constant in conditional */ -suppress 558 in value_from_register -/* Constant in conditional */ -suppress 558 in add_enum_psymbol -/* Constant in conditional */ -suppress 558 in add_partial_symbol -/* Constant in conditional */ -suppress 558 mfree.c -/* Constant in conditional */ -suppress 558 mmalloc.c -/* Constant in conditional */ -suppress 558 mrealloc.c -/* Constant in conditional */ -suppress 560 in solib_address -/* Assignment within conditional */ -suppress 560 in solib_info -/* Assignment within conditional */ -suppress 560 in solib_add -/* Assignment within conditional */ -suppress 560 in read_type -/* Assignment within conditional */ -suppress 560 in type_print_base -/* Assignment within conditional */ -suppress 560 in type_print_derivation_info -/* Assignment within conditional */ -suppress 560 in block_depth -/* Assignment within conditional */ -suppress 560 in select_source_symtab -/* Assignment within conditional */ -suppress 560 in clear_value_history -/* Assignment within conditional */ -suppress 560 in clear_displays -/* Assignment within conditional */ -suppress 560 in initialize_main -/* Assignment within conditional */ -suppress 560 in echo_command -/* Assignment within conditional */ -suppress 560 in unset_in_environ -/* Assignment within conditional */ -suppress 560 in set_in_environ -/* Assignment within conditional */ -suppress 560 in get_in_environ -/* Assignment within conditional */ -suppress 560 in do_setshow_command -/* Assignment within conditional */ -suppress 560 in breakpoint_1 -/* Assignment within conditional */ -suppress 590 on sig -/* Unused formal parameter */ -suppress 590 in nindy_create_inferior -/* Unused formal parameter */ -suppress 590 in add_to_section_table -/* Unused formal parameter */ -suppress 590 in vx_create_inferior -/* Unused formal parameter */ -suppress 590 in host_convert_from_virtual -/* Unused formal parameter */ -suppress 590 in host_convert_to_virtual -/* Unused formal parameter */ -suppress 590 on siggnal -/* Unused formal parameter */ -suppress 590 in init_sig -/* Unused formal parameter */ -suppress 590 in nindy_resume -/* Unused formal parameter */ -suppress 590 in set_history_size_command -/* Unused formal parameter */ -suppress 590 in not_just_help_class_command -/* Unused formal parameter */ -suppress 590 on regno -/* Unused formal parameter */ -suppress 590 on from_tty -/* Unused formal parameter */ -suppress 590 on args -/* Unused formal parameter */ -suppress 590 in process_symbol_pair -/* Unused formal parameter */ -suppress 591 in print_scalar_formatted -/* Unused automatic variable */ -suppress 592 on rcsid -/* Unused static */ -suppress 594 in call_function_by_hand -/* Set but not used */ -suppress 594 in record_latest_value -/* Set but not used */ -suppress 594 in bpstat_stop_status -/* Set but not used */ -suppress 595 in coffstrip -/* Used before set */ -suppress 652 ../include/bfd.h -/* Declaration has no effect */ -suppress 652 /usr/include/machine/reg.h -/* Declaration has no effect */ -suppress 652 /usr/include/sun4/reg.h -/* Declaration has no effect */ -suppress 68 on complain -/* Benign type mismatch */ -suppress 3 in read_range_type -/* Over/underflow unary minus */ -suppress 442 ../bfd/archive.c -/* \0 in string */ -suppress 558 ../bfd/b.out.c -/* Conditional if always true */ -suppress 558 ../bfd/coffswap.c -/* Conditional if always true -- bfd_h_put_x */ -suppress 529 ../bfd/coffswap.c -/* Stmt unreach -- bfd_h_put_x */ -suppress 590 ../bfd/ecoff.c -/* Formal parameter not used */ -suppress 590 on ignore -/* Formal param not used */ -suppress 590 on ignore_exec_bfd -/* Formal param not used */ -suppress 590 on ignore_core_bfd -/* Formal param not used */ -suppress 590 on ignore_input_section -/* Formal param not used */ -suppress 590 on ignore_newsect -/* Formal param not used */ -suppress 590 on ignore_abfd -/* Formal param not used */ -suppress 590 on ignore_symbol -/* Formal param not used */ -suppress 590 on ignore_symbols -/* Formal param not used */ -suppress 590 on signo -/* Formal param not used */ -suppress 652 -/* The declaration has no effect */ -suppress 442 in ../bfd/archive.c -/* Escape sequence in string literal has null value */ - -/* Signals caught and ignored */ -catch HUP -catch QUIT -catch ILL -catch TRAP -catch IOT -catch EMT -catch FPE -catch KILL -catch BUS -catch SEGV -catch SYS -catch PIPE -catch TERM -catch URG -catch STOP -catch TSTP -catch TTIN -catch TTOU -catch IO -catch XCPU -catch XFSZ -catch VTALRM -catch PROF -catch LOST -catch USR1 -catch USR2 -ignore INT -ignore ALRM -ignore CONT -ignore CHLD -ignore WINCH - -/* Status of project */ diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 4d3f2c1..4bbcd8e 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -1,6 +1,7 @@ /* Scheme/Guile language support routines for GDB, the GNU debugger. - Copyright 1995, 1996, 1998, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/scm-lang.h b/gdb/scm-lang.h index e3af0a1..6e24be5 100644 --- a/gdb/scm-lang.h +++ b/gdb/scm-lang.h @@ -1,5 +1,7 @@ /* Scheme/Guile language support routines for GDB, the GNU debugger. - Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + + Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c new file mode 100644 index 0000000..fe11d8a --- /dev/null +++ b/gdb/sentinel-frame.c @@ -0,0 +1,113 @@ +/* Code dealing with register stack frames, for GDB, the GNU debugger. + + Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 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 "regcache.h" +#include "sentinel-frame.h" +#include "inferior.h" +#include "frame-unwind.h" + +struct frame_unwind_cache +{ + struct regcache *regcache; +}; + +void * +sentinel_frame_cache (struct regcache *regcache) +{ + struct frame_unwind_cache *cache = + FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache); + cache->regcache = regcache; + return cache; +} + +/* Here the register value is taken direct from the register cache. */ + +void +sentinel_frame_register_unwind (struct frame_info *frame, + void **unwind_cache, + int regnum, int *optimized, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnum, void *bufferp) +{ + struct frame_unwind_cache *cache = *unwind_cache; + /* Describe the register's location. A reg-frame maps all registers + onto the corresponding hardware register. */ + *optimized = 0; + *lvalp = lval_register; + *addrp = REGISTER_BYTE (regnum); + *realnum = regnum; + + /* If needed, find and return the value of the register. */ + if (bufferp != NULL) + { + /* Return the actual value. */ + /* 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_cooked_read (cache->regcache, regnum, bufferp); + } +} + +CORE_ADDR +sentinel_frame_pc_unwind (struct frame_info *frame, + void **cache) +{ + /* FIXME: cagney/2003-01-08: This should be using a per-architecture + method that doesn't suffer from DECR_PC_AFTER_BREAK problems. + Such a method would take unwind_cache, regcache and stop reason + parameters. */ + return read_pc (); +} + +void +sentinel_frame_id_unwind (struct frame_info *frame, + void **cache, + struct frame_id *id) +{ + /* FIXME: cagney/2003-01-08: This should be using a per-architecture + method that doesn't suffer from DECR_PC_AFTER_BREAK problems. + Such a method would take unwind_cache, regcache and stop reason + parameters. */ + id->base = read_fp (); + id->pc = read_pc (); +} + +static void +sentinel_frame_pop (struct frame_info *frame, + void **cache, + struct regcache *regcache) +{ + internal_error (__FILE__, __LINE__, "Function sentinal_frame_pop called"); +} + +const struct frame_unwind sentinel_frame_unwinder = +{ + sentinel_frame_pop, + sentinel_frame_pc_unwind, + sentinel_frame_id_unwind, + sentinel_frame_register_unwind +}; + +const struct frame_unwind *const sentinel_frame_unwind = &sentinel_frame_unwinder; diff --git a/gdb/config/i386/xm-i386v32.h b/gdb/sentinel-frame.h similarity index 50% rename from gdb/config/i386/xm-i386v32.h rename to gdb/sentinel-frame.h index 706822f..9b69f42 100644 --- a/gdb/config/i386/xm-i386v32.h +++ b/gdb/sentinel-frame.h @@ -1,5 +1,6 @@ -/* Macro defintions for i386, running System V 3.2. - Copyright (C) 1989 Free Software Foundation, Inc. +/* Code dealing with register stack frames, for GDB, the GNU debugger. + + Copyright 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -18,8 +19,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "i386/xm-i386v.h" +#if !defined (SENTINEL_FRAME_H) +#define SENTINEL_FRAME_H 1 + +struct frame_unwind; +struct regcache; + +/* Implement the sentinel frame. The sentinel frame terminates the + inner most end of the frame chain. If unwound, it returns the + information need to construct an inner-most frame. */ + +/* Pump prime the sentinel frame's cache. Since this needs the + REGCACHE provide that here. */ + +extern void *sentinel_frame_cache (struct regcache *regcache); + +/* At present there is only one type of sentinel frame. */ + +extern const struct frame_unwind *const sentinel_frame_unwind; -/* Apparently there is inconsistency among various System V's about what - the name of this field is. */ -#define U_FPSTATE(u) u.u_fps.u_fpstate +#endif /* !defined (SENTINEL_FRAME_H) */ diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 0642b5a..cea01cd 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -356,8 +356,8 @@ dos_comisr (int irq) #define ISRNAME(x) dos_comisr##x #define ISR(x) static void ISRNAME(x)(void) {dos_comisr(x);} -ISR (0) ISR (1) ISR (2) ISR (3) -ISR (4) ISR (5) ISR (6) ISR (7) +ISR (0) ISR (1) ISR (2) ISR (3) /* OK */ +ISR (4) ISR (5) ISR (6) ISR (7) /* OK */ typedef void (*isr_t) (void); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 08281ba..1f044d0 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -33,7 +33,7 @@ #include "gdbcore.h" #include "value.h" #include "dis-asm.h" -#include "inferior.h" /* for BEFORE_TEXT_END etc. */ +#include "inferior.h" #include "gdb_string.h" #include "arch-utils.h" #include "floatformat.h" @@ -4009,7 +4009,7 @@ sh64_do_pseudo_register (int regnum) static void sh_do_register (int regnum) { - char raw_buffer[MAX_REGISTER_RAW_SIZE]; + char *raw_buffer = alloca (max_register_size (current_gdbarch)); fputs_filtered (REGISTER_NAME (regnum), gdb_stdout); print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout); diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 8ced5f0..7831108 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -197,7 +197,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname) if (storage_needed > 0) { symbol_table = (asymbol **) xmalloc (storage_needed); - back_to = make_cleanup (xfree, (PTR) symbol_table); + back_to = make_cleanup (xfree, symbol_table); number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); for (i = 0; i < number_of_symbols; i++) @@ -224,7 +224,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname) if (storage_needed > 0) { symbol_table = (asymbol **) xmalloc (storage_needed); - back_to = make_cleanup (xfree, (PTR) symbol_table); + back_to = make_cleanup (xfree, symbol_table); number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table); for (i = 0; i < number_of_symbols; i++) diff --git a/gdb/solib.c b/gdb/solib.c index 639788b..a49614b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1,7 +1,7 @@ /* Handle shared libraries for GDB, the GNU Debugger. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -57,7 +57,7 @@ static int solib_cleanup_queued = 0; /* make_run_cleanup called */ /* Local function prototypes */ -static void do_clear_solib (PTR); +static void do_clear_solib (void *); /* If non-zero, this is a prefix that will be added to the front of the name shared libraries with an absolute filename for loading. */ @@ -207,7 +207,7 @@ solib_open (char *in_pathname, char **found_pathname) */ static int -solib_map_sections (PTR arg) +solib_map_sections (void *arg) { struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */ char *filename; @@ -324,7 +324,7 @@ free_so (struct so_list *so) /* A small stub to get us past the arg-passing pinhole of catch_errors. */ static int -symbol_add_stub (PTR arg) +symbol_add_stub (void *arg) { register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ struct section_addr_info *sap; @@ -387,7 +387,7 @@ update_solib_list (int from_tty, struct target_ops *target) symbols now! */ if (attach_flag && symfile_objfile == NULL) - catch_errors (TARGET_SO_OPEN_SYMBOL_FILE_OBJECT, (PTR) &from_tty, + catch_errors (TARGET_SO_OPEN_SYMBOL_FILE_OBJECT, &from_tty, "Error reading attached process's symbol file.\n", RETURN_MASK_ALL); @@ -755,7 +755,7 @@ clear_solib (void) } static void -do_clear_solib (PTR dummy) +do_clear_solib (void *dummy) { solib_cleanup_queued = 0; clear_solib (); @@ -875,6 +875,10 @@ For other (relative) files, you can add values using `set solib-search-path'.", add_show_from_set (c, &showlist); set_cmd_completer (c, filename_completer); + /* Set the default value of "solib-absolute-prefix" from the sysroot, if + one is set. */ + solib_absolute_prefix = xstrdup (gdb_sysroot); + c = add_set_cmd ("solib-search-path", class_support, var_string, (char *) &solib_search_path, "Set the search path for loading non-absolute shared library symbol files.\n\ diff --git a/gdb/somread.c b/gdb/somread.c index 38e35b2..6ba95a6 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -45,11 +45,10 @@ static void som_symfile_read (struct objfile *, int); static void som_symfile_finish (struct objfile *); -static void -som_symtab_read (bfd *, struct objfile *, struct section_offsets *); +static void som_symtab_read (bfd *, struct objfile *, + struct section_offsets *); -static void -som_symfile_offsets (struct objfile *, struct section_addr_info *); +static void som_symfile_offsets (struct objfile *, struct section_addr_info *); /* FIXME: These should really be in a common header somewhere */ diff --git a/gdb/somsolib.c b/gdb/somsolib.c index 3f74dce..c66946b 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -1,7 +1,7 @@ /* Handle HP SOM shared libraries for GDB, the GNU Debugger. - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free - Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -401,6 +401,21 @@ som_solib_load_symbols (struct so_list *so, char *name, int from_tty, } +/* FIXME: cagney/2003-02-01: This just isn't right. Given an address + within the target's address space, this converts the value into an + address within the host's (i.e., GDB's) address space. Given that + the host/target address spaces are separate, this can't be right. */ + +static void * +hpux_address_to_host_pointer_hack (CORE_ADDR addr) +{ + void *ptr; + + gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr); + return ptr; +} + /* Add symbols from shared libraries into the symtab list, unless the size threshold specified by auto_solib_limit (in megabytes) would be exceeded. */ @@ -715,8 +730,10 @@ som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int re if (status != 0) goto err; + /* FIXME: cagney/2003-02-01: I think som_solib.next should be a + CORE_ADDR. */ new_so->som_solib.next = - address_to_host_pointer (extract_unsigned_integer (buf, 4)); + hpux_address_to_host_pointer_hack (extract_unsigned_integer (buf, 4)); /* Note that we don't re-set "addr" to the next pointer * until after we've read the trailing data. diff --git a/gdb/somsolib.h b/gdb/somsolib.h index 60118b2..0840067 100644 --- a/gdb/somsolib.h +++ b/gdb/somsolib.h @@ -1,6 +1,7 @@ /* HP SOM Shared library declarations for GDB, the GNU Debugger. - Copyright 1992, 1994, 1995, 1998, 1999, 2000 - Free Software Foundation, Inc. + + Copyright 1992, 1994, 1995, 1998, 1999, 2000, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/source.c b/gdb/source.c index c2991b5..c2269fa 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1,6 +1,6 @@ /* List lines of source files for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -674,14 +674,24 @@ openp (const char *path, int try_cwd_first, const char *string, mode |= O_BINARY; #endif - if ((try_cwd_first || IS_ABSOLUTE_PATH (string)) && is_regular_file (string)) + if (try_cwd_first || IS_ABSOLUTE_PATH (string)) { int i; - filename = alloca (strlen (string) + 1); - strcpy (filename, string); - fd = open (filename, mode, prot); - if (fd >= 0) - goto done; + + if (is_regular_file (string)) + { + filename = alloca (strlen (string) + 1); + strcpy (filename, string); + fd = open (filename, mode, prot); + if (fd >= 0) + goto done; + } + else + { + filename = NULL; + fd = -1; + } + for (i = 0; string[i]; i++) if (IS_DIR_SEPARATOR (string[i])) goto done; diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index b8a014f..3fe4dfc 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1862,8 +1862,7 @@ decode_asi (int val) } } -/* PRINT_REGISTER_HOOK routine. - Pretty print various registers. */ +/* Pretty print various registers. */ /* FIXME: Would be nice if this did some fancy things for 32 bit sparc. */ static void diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 7d4459e..b873be6 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -134,8 +134,8 @@ read_tilde_fields (struct field_info *, char **, struct type *, static int attach_fn_fields_to_type (struct field_info *, struct type *); -static int -attach_fields_to_type (struct field_info *, struct type *, struct objfile *); +static int attach_fields_to_type (struct field_info *, struct type *, + struct objfile *); static struct type *read_struct_type (char **, struct type *, enum type_code, @@ -149,32 +149,33 @@ static struct field *read_args (char **, int, struct objfile *, int *, int *); static int read_cpp_abbrev (struct field_info *, char **, struct type *, struct objfile *); +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* new functions added for cfront support */ -/* new functions added for cfront support */ +// OBSOLETE static int +// OBSOLETE copy_cfront_struct_fields (struct field_info *, struct type *, +// OBSOLETE struct objfile *); -static int -copy_cfront_struct_fields (struct field_info *, struct type *, - struct objfile *); +// OBSOLETE static char *get_cfront_method_physname (char *); -static char *get_cfront_method_physname (char *); +// OBSOLETE static int +// OBSOLETE read_cfront_baseclasses (struct field_info *, char **, +// OBSOLETE struct type *, struct objfile *); -static int -read_cfront_baseclasses (struct field_info *, char **, - struct type *, struct objfile *); +// OBSOLETE static int +// OBSOLETE read_cfront_static_fields (struct field_info *, char **, +// OBSOLETE struct type *, struct objfile *); +// OBSOLETE static int +// OBSOLETE read_cfront_member_functions (struct field_info *, char **, +// OBSOLETE struct type *, struct objfile *); -static int -read_cfront_static_fields (struct field_info *, char **, - struct type *, struct objfile *); -static int -read_cfront_member_functions (struct field_info *, char **, - struct type *, struct objfile *); +// OBSOLETE /* end new functions added for cfront support */ +#endif /* OBSOLETE CFront */ static char *find_name_end (char *name); -/* end new functions added for cfront support */ - -static void -add_live_range (struct objfile *, struct symbol *, CORE_ADDR, CORE_ADDR); +static void add_live_range (struct objfile *, struct symbol *, CORE_ADDR, + CORE_ADDR); static int resolve_live_range (struct objfile *, struct symbol *, char *); @@ -182,8 +183,8 @@ static int process_reference (char **string); static CORE_ADDR ref_search_value (int refnum); -static int -resolve_symbol_reference (struct objfile *, struct symbol *, char *); +static int resolve_symbol_reference (struct objfile *, struct symbol *, + char *); void stabsread_clear_cache (void); @@ -198,9 +199,6 @@ static const char vb_name[] = "_vb$"; #if !defined (BELIEVE_PCC_PROMOTION) #define BELIEVE_PCC_PROMOTION 0 #endif -#if !defined (BELIEVE_PCC_PROMOTION_TYPE) -#define BELIEVE_PCC_PROMOTION_TYPE 0 -#endif static void invalid_cpp_abbrev_complaint (const char *arg1) @@ -495,487 +493,488 @@ read_type_number (register char **pp, register int *typenums) #define VISIBILITY_PUBLIC '2' /* Stabs character for public field */ #define VISIBILITY_IGNORE '9' /* Optimized out or zero length */ -#define CFRONT_VISIBILITY_PRIVATE '2' /* Stabs character for private field */ -#define CFRONT_VISIBILITY_PUBLIC '1' /* Stabs character for public field */ - -/* This code added to support parsing of ARM/Cfront stabs strings */ - -/* Get substring from string up to char c, advance string pointer past - suibstring. */ - -static char * -get_substring (char **p, int c) -{ - char *str; - str = *p; - *p = strchr (*p, c); - if (*p) - { - **p = 0; - (*p)++; - } - else - str = 0; - return str; -} - -/* Physname gets strcat'd onto sname in order to recreate the mangled - name (see funtion gdb_mangle_name in gdbtypes.c). For cfront, make - the physname look like that of g++ - take out the initial mangling - eg: for sname="a" and fname="foo__1aFPFs_i" return "FPFs_i" */ - -static char * -get_cfront_method_physname (char *fname) -{ - int len = 0; - /* FIXME would like to make this generic for g++ too, but - that is already handled in read_member_funcctions */ - char *p = fname; - - /* search ahead to find the start of the mangled suffix */ - if (*p == '_' && *(p + 1) == '_') /* compiler generated; probably a ctor/dtor */ - p += 2; - while (p && (unsigned) ((p + 1) - fname) < strlen (fname) && *(p + 1) != '_') - p = strchr (p, '_'); - if (!(p && *p == '_' && *(p + 1) == '_')) - error ("Invalid mangled function name %s", fname); - p += 2; /* advance past '__' */ - - /* struct name length and name of type should come next; advance past it */ - while (isdigit (*p)) - { - len = len * 10 + (*p - '0'); - p++; - } - p += len; - - return p; -} - -static void -msg_unknown_complaint (const char *arg1) -{ - complaint (&symfile_complaints, "Unsupported token in stabs string %s", arg1); -} - -/* Read base classes within cfront class definition. - eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; - ^^^^^^^^^^^^^^^^^^ - - A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; - ^ - */ - -static int -read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, - struct objfile *objfile) -{ - int bnum = 0; - char *p; - int i; - struct nextfield *new; - - if (**pp == ';') /* no base classes; return */ - { - ++(*pp); - return 1; - } - - /* first count base classes so we can allocate space before parsing */ - for (p = *pp; p && *p && *p != ';'; p++) - { - if (*p == ' ') - bnum++; - } - bnum++; /* add one more for last one */ - - /* now parse the base classes until we get to the start of the methods - (code extracted and munged from read_baseclasses) */ - ALLOCATE_CPLUS_STRUCT_TYPE (type); - TYPE_N_BASECLASSES (type) = bnum; - - /* allocate space */ - { - int num_bytes = B_BYTES (TYPE_N_BASECLASSES (type)); - char *pointer; - - pointer = (char *) TYPE_ALLOC (type, num_bytes); - TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *) pointer; - } - B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type)); - - for (i = 0; i < TYPE_N_BASECLASSES (type); i++) - { - new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); - make_cleanup (xfree, new); - memset (new, 0, sizeof (struct nextfield)); - new->next = fip->list; - fip->list = new; - FIELD_BITSIZE (new->field) = 0; /* this should be an unpacked field! */ - - STABS_CONTINUE (pp, objfile); - - /* virtual? eg: v2@Bvir */ - if (**pp == 'v') - { - SET_TYPE_FIELD_VIRTUAL (type, i); - ++(*pp); - } - - /* access? eg: 2@Bvir */ - /* Note: protected inheritance not supported in cfront */ - switch (*(*pp)++) - { - case CFRONT_VISIBILITY_PRIVATE: - new->visibility = VISIBILITY_PRIVATE; - break; - case CFRONT_VISIBILITY_PUBLIC: - new->visibility = VISIBILITY_PUBLIC; - break; - default: - /* Bad visibility format. Complain and treat it as - public. */ - { - complaint (&symfile_complaints, - "Unknown visibility `%c' for baseclass", - new->visibility); - new->visibility = VISIBILITY_PUBLIC; - } - } - - /* "@" comes next - eg: @Bvir */ - if (**pp != '@') - { - msg_unknown_complaint (*pp); - return 1; - } - ++(*pp); - - - /* Set the bit offset of the portion of the object corresponding - to this baseclass. Always zero in the absence of - multiple inheritance. */ - /* Unable to read bit position from stabs; - Assuming no multiple inheritance for now FIXME! */ - /* We may have read this in the structure definition; - now we should fixup the members to be the actual base classes */ - FIELD_BITPOS (new->field) = 0; - - /* Get the base class name and type */ - { - char *bname; /* base class name */ - struct symbol *bsym; /* base class */ - char *p1, *p2; - p1 = strchr (*pp, ' '); - p2 = strchr (*pp, ';'); - if (p1 < p2) - bname = get_substring (pp, ' '); - else - bname = get_substring (pp, ';'); - if (!bname || !*bname) - { - msg_unknown_complaint (*pp); - return 1; - } - /* FIXME! attach base info to type */ - bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name */ - if (bsym) - { - new->field.type = SYMBOL_TYPE (bsym); - new->field.name = type_name_no_tag (new->field.type); - } - else - { - complaint (&symfile_complaints, "Unable to find base type for %s", - *pp); - return 1; - } - } - - /* If more base classes to parse, loop again. - We ate the last ' ' or ';' in get_substring, - so on exit we will have skipped the trailing ';' */ - /* if invalid, return 0; add code to detect - FIXME! */ - } - return 1; -} - -/* read cfront member functions. - pp points to string starting with list of functions - eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - */ - -static int -read_cfront_member_functions (struct field_info *fip, char **pp, - struct type *type, struct objfile *objfile) -{ - /* This code extracted from read_member_functions - so as to do the similar thing for our funcs */ - - int nfn_fields = 0; - int length = 0; - /* Total number of member functions defined in this class. If the class - defines two `f' functions, and one `g' function, then this will have - the value 3. */ - int total_length = 0; - int i; - struct next_fnfield - { - struct next_fnfield *next; - struct fn_field fn_field; - } - *sublist; - struct type *look_ahead_type; - struct next_fnfieldlist *new_fnlist; - struct next_fnfield *new_sublist; - char *main_fn_name; - char *fname; - struct symbol *ref_func = 0; - - /* Process each list until we find the end of the member functions. - eg: p = "__ct__1AFv foo__1AFv ;;;" */ - - STABS_CONTINUE (pp, objfile); /* handle \\ */ - - while (**pp != ';' && (fname = get_substring (pp, ' '), fname)) - { - int is_static = 0; - int sublist_count = 0; - char *pname; - if (fname[0] == '*') /* static member */ - { - is_static = 1; - sublist_count++; - fname++; - } - ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */ - if (!ref_func) - { - complaint (&symfile_complaints, - "Unable to find function symbol for %s", fname); - continue; - } - sublist = NULL; - look_ahead_type = NULL; - length = 0; - - new_fnlist = (struct next_fnfieldlist *) - xmalloc (sizeof (struct next_fnfieldlist)); - make_cleanup (xfree, new_fnlist); - memset (new_fnlist, 0, sizeof (struct next_fnfieldlist)); - - /* The following is code to work around cfront generated stabs. - The stabs contains full mangled name for each field. - We try to demangle the name and extract the field name out of it. */ - { - char *dem, *dem_p, *dem_args; - int dem_len; - dem = cplus_demangle (fname, DMGL_ANSI | DMGL_PARAMS); - if (dem != NULL) - { - dem_p = strrchr (dem, ':'); - if (dem_p != 0 && *(dem_p - 1) == ':') - dem_p++; - /* get rid of args */ - dem_args = strchr (dem_p, '('); - if (dem_args == NULL) - dem_len = strlen (dem_p); - else - dem_len = dem_args - dem_p; - main_fn_name = - obsavestring (dem_p, dem_len, &objfile->type_obstack); - } - else - { - main_fn_name = - obsavestring (fname, strlen (fname), &objfile->type_obstack); - } - } /* end of code for cfront work around */ - - new_fnlist->fn_fieldlist.name = main_fn_name; - -/*-------------------------------------------------*/ - /* Set up the sublists - Sublists are stuff like args, static, visibility, etc. - so in ARM, we have to set that info some other way. - Multiple sublists happen if overloading - eg: foo::26=##1;:;2A.; - In g++, we'd loop here thru all the sublists... */ - - new_sublist = - (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield)); - make_cleanup (xfree, new_sublist); - memset (new_sublist, 0, sizeof (struct next_fnfield)); - - /* eat 1; from :;2A.; */ - new_sublist->fn_field.type = SYMBOL_TYPE (ref_func); /* normally takes a read_type */ - /* Make this type look like a method stub for gdb */ - TYPE_FLAGS (new_sublist->fn_field.type) |= TYPE_FLAG_STUB; - TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD; - - /* If this is just a stub, then we don't have the real name here. */ - if (TYPE_STUB (new_sublist->fn_field.type)) - { - if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type)) - TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type; - new_sublist->fn_field.is_stub = 1; - } - - /* physname used later in mangling; eg PFs_i,5 for foo__1aFPFs_i - physname gets strcat'd in order to recreate the onto mangled name */ - pname = get_cfront_method_physname (fname); - new_sublist->fn_field.physname = savestring (pname, strlen (pname)); - - - /* Set this member function's visibility fields. - Unable to distinguish access from stabs definition! - Assuming public for now. FIXME! - (for private, set new_sublist->fn_field.is_private = 1, - for public, set new_sublist->fn_field.is_protected = 1) */ - - /* Unable to distinguish const/volatile from stabs definition! - Assuming normal for now. FIXME! */ - - new_sublist->fn_field.is_const = 0; - new_sublist->fn_field.is_volatile = 0; /* volatile not implemented in cfront */ - - /* Set virtual/static function info - How to get vtable offsets ? - Assuming normal for now FIXME!! - For vtables, figure out from whence this virtual function came. - It may belong to virtual function table of - one of its baseclasses. - set: - new_sublist -> fn_field.voffset = vtable offset, - new_sublist -> fn_field.fcontext = look_ahead_type; - where look_ahead_type is type of baseclass */ - if (is_static) - new_sublist->fn_field.voffset = VOFFSET_STATIC; - else /* normal member function. */ - new_sublist->fn_field.voffset = 0; - new_sublist->fn_field.fcontext = 0; - - - /* Prepare new sublist */ - new_sublist->next = sublist; - sublist = new_sublist; - length++; - - /* In g++, we loop thu sublists - now we set from functions. */ - new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *) - obstack_alloc (&objfile->type_obstack, - sizeof (struct fn_field) * length); - memset (new_fnlist->fn_fieldlist.fn_fields, 0, - sizeof (struct fn_field) * length); - for (i = length; (i--, sublist); sublist = sublist->next) - { - new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field; - } - - new_fnlist->fn_fieldlist.length = length; - new_fnlist->next = fip->fnlist; - fip->fnlist = new_fnlist; - nfn_fields++; - total_length += length; - STABS_CONTINUE (pp, objfile); /* handle \\ */ - } /* end of loop */ - - if (nfn_fields) - { - /* type should already have space */ - TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *) - TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields); - memset (TYPE_FN_FIELDLISTS (type), 0, - sizeof (struct fn_fieldlist) * nfn_fields); - TYPE_NFN_FIELDS (type) = nfn_fields; - TYPE_NFN_FIELDS_TOTAL (type) = total_length; - } - - /* end of scope for reading member func */ - - /* eg: ";;" */ - - /* Skip trailing ';' and bump count of number of fields seen */ - if (**pp == ';') - (*pp)++; - else - return 0; - return 1; -} - -/* This routine fixes up partial cfront types that were created - while parsing the stabs. The main need for this function is - to add information such as methods to classes. - Examples of "p": "sA;;__ct__1AFv foo__1AFv ;;;" */ -int -resolve_cfront_continuation (struct objfile *objfile, struct symbol *sym, - char *p) -{ - struct symbol *ref_sym = 0; - char *sname; - /* snarfed from read_struct_type */ - struct field_info fi; - struct type *type; - struct cleanup *back_to; - - /* Need to make sure that fi isn't gunna conflict with struct - in case struct already had some fnfs */ - fi.list = NULL; - fi.fnlist = NULL; - back_to = make_cleanup (null_cleanup, 0); - - /* We only accept structs, classes and unions at the moment. - Other continuation types include t (typedef), r (long dbl), ... - We may want to add support for them as well; - right now they are handled by duplicating the symbol information - into the type information (see define_symbol) */ - if (*p != 's' /* structs */ - && *p != 'c' /* class */ - && *p != 'u') /* union */ - return 0; /* only handle C++ types */ - p++; - - /* Get symbol typs name and validate - eg: p = "A;;__ct__1AFv foo__1AFv ;;;" */ - sname = get_substring (&p, ';'); - if (!sname || strcmp (sname, SYMBOL_NAME (sym))) - error ("Internal error: base symbol type name does not match\n"); - - /* Find symbol's internal gdb reference using demangled_name. - This is the real sym that we want; - sym was a temp hack to make debugger happy */ - ref_sym = lookup_symbol (SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0); - type = SYMBOL_TYPE (ref_sym); - - - /* Now read the baseclasses, if any, read the regular C struct or C++ - class member fields, attach the fields to the type, read the C++ - member functions, attach them to the type, and then read any tilde - field (baseclass specifier for the class holding the main vtable). */ - - if (!read_cfront_baseclasses (&fi, &p, type, objfile) - /* g++ does this next, but cfront already did this: - || !read_struct_fields (&fi, &p, type, objfile) */ - || !copy_cfront_struct_fields (&fi, type, objfile) - || !read_cfront_member_functions (&fi, &p, type, objfile) - || !read_cfront_static_fields (&fi, &p, type, objfile) - || !attach_fields_to_type (&fi, type, objfile) - || !attach_fn_fields_to_type (&fi, type) - /* g++ does this next, but cfront doesn't seem to have this: - || !read_tilde_fields (&fi, &p, type, objfile) */ - ) - { - type = error_type (&p, objfile); - } - - do_cleanups (back_to); - return 0; -} -/* End of code added to support parsing of ARM/Cfront stabs strings */ - +#if 0 /* OBSOLETE CFront */ +// OBSOLETE #define CFRONT_VISIBILITY_PRIVATE '2' /* Stabs character for private field */ +// OBSOLETE #define CFRONT_VISIBILITY_PUBLIC '1' /* Stabs character for public field */ + +// OBSOLETE /* This code added to support parsing of ARM/Cfront stabs strings */ + +// OBSOLETE /* Get substring from string up to char c, advance string pointer past +// OBSOLETE suibstring. */ + +// OBSOLETE static char * +// OBSOLETE get_substring (char **p, int c) +// OBSOLETE { +// OBSOLETE char *str; +// OBSOLETE str = *p; +// OBSOLETE *p = strchr (*p, c); +// OBSOLETE if (*p) +// OBSOLETE { +// OBSOLETE **p = 0; +// OBSOLETE (*p)++; +// OBSOLETE } +// OBSOLETE else +// OBSOLETE str = 0; +// OBSOLETE return str; +// OBSOLETE } + +// OBSOLETE /* Physname gets strcat'd onto sname in order to recreate the mangled +// OBSOLETE name (see funtion gdb_mangle_name in gdbtypes.c). For cfront, make +// OBSOLETE the physname look like that of g++ - take out the initial mangling +// OBSOLETE eg: for sname="a" and fname="foo__1aFPFs_i" return "FPFs_i" */ + +// OBSOLETE static char * +// OBSOLETE get_cfront_method_physname (char *fname) +// OBSOLETE { +// OBSOLETE int len = 0; +// OBSOLETE /* FIXME would like to make this generic for g++ too, but +// OBSOLETE that is already handled in read_member_funcctions */ +// OBSOLETE char *p = fname; + +// OBSOLETE /* search ahead to find the start of the mangled suffix */ +// OBSOLETE if (*p == '_' && *(p + 1) == '_') /* compiler generated; probably a ctor/dtor */ +// OBSOLETE p += 2; +// OBSOLETE while (p && (unsigned) ((p + 1) - fname) < strlen (fname) && *(p + 1) != '_') +// OBSOLETE p = strchr (p, '_'); +// OBSOLETE if (!(p && *p == '_' && *(p + 1) == '_')) +// OBSOLETE error ("Invalid mangled function name %s", fname); +// OBSOLETE p += 2; /* advance past '__' */ + +// OBSOLETE /* struct name length and name of type should come next; advance past it */ +// OBSOLETE while (isdigit (*p)) +// OBSOLETE { +// OBSOLETE len = len * 10 + (*p - '0'); +// OBSOLETE p++; +// OBSOLETE } +// OBSOLETE p += len; + +// OBSOLETE return p; +// OBSOLETE } + +// OBSOLETE static void +// OBSOLETE msg_unknown_complaint (const char *arg1) +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, "Unsupported token in stabs string %s", arg1); +// OBSOLETE } + +// OBSOLETE /* Read base classes within cfront class definition. +// OBSOLETE eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; +// OBSOLETE ^^^^^^^^^^^^^^^^^^ + +// OBSOLETE A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; +// OBSOLETE ^ +// OBSOLETE */ + +// OBSOLETE static int +// OBSOLETE read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, +// OBSOLETE struct objfile *objfile) +// OBSOLETE { +// OBSOLETE int bnum = 0; +// OBSOLETE char *p; +// OBSOLETE int i; +// OBSOLETE struct nextfield *new; + +// OBSOLETE if (**pp == ';') /* no base classes; return */ +// OBSOLETE { +// OBSOLETE ++(*pp); +// OBSOLETE return 1; +// OBSOLETE } + +// OBSOLETE /* first count base classes so we can allocate space before parsing */ +// OBSOLETE for (p = *pp; p && *p && *p != ';'; p++) +// OBSOLETE { +// OBSOLETE if (*p == ' ') +// OBSOLETE bnum++; +// OBSOLETE } +// OBSOLETE bnum++; /* add one more for last one */ + +// OBSOLETE /* now parse the base classes until we get to the start of the methods +// OBSOLETE (code extracted and munged from read_baseclasses) */ +// OBSOLETE ALLOCATE_CPLUS_STRUCT_TYPE (type); +// OBSOLETE TYPE_N_BASECLASSES (type) = bnum; + +// OBSOLETE /* allocate space */ +// OBSOLETE { +// OBSOLETE int num_bytes = B_BYTES (TYPE_N_BASECLASSES (type)); +// OBSOLETE char *pointer; + +// OBSOLETE pointer = (char *) TYPE_ALLOC (type, num_bytes); +// OBSOLETE TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *) pointer; +// OBSOLETE } +// OBSOLETE B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type)); + +// OBSOLETE for (i = 0; i < TYPE_N_BASECLASSES (type); i++) +// OBSOLETE { +// OBSOLETE new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); +// OBSOLETE make_cleanup (xfree, new); +// OBSOLETE memset (new, 0, sizeof (struct nextfield)); +// OBSOLETE new->next = fip->list; +// OBSOLETE fip->list = new; +// OBSOLETE FIELD_BITSIZE (new->field) = 0; /* this should be an unpacked field! */ + +// OBSOLETE STABS_CONTINUE (pp, objfile); + +// OBSOLETE /* virtual? eg: v2@Bvir */ +// OBSOLETE if (**pp == 'v') +// OBSOLETE { +// OBSOLETE SET_TYPE_FIELD_VIRTUAL (type, i); +// OBSOLETE ++(*pp); +// OBSOLETE } + +// OBSOLETE /* access? eg: 2@Bvir */ +// OBSOLETE /* Note: protected inheritance not supported in cfront */ +// OBSOLETE switch (*(*pp)++) +// OBSOLETE { +// OBSOLETE case CFRONT_VISIBILITY_PRIVATE: +// OBSOLETE new->visibility = VISIBILITY_PRIVATE; +// OBSOLETE break; +// OBSOLETE case CFRONT_VISIBILITY_PUBLIC: +// OBSOLETE new->visibility = VISIBILITY_PUBLIC; +// OBSOLETE break; +// OBSOLETE default: +// OBSOLETE /* Bad visibility format. Complain and treat it as +// OBSOLETE public. */ +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, +// OBSOLETE "Unknown visibility `%c' for baseclass", +// OBSOLETE new->visibility); +// OBSOLETE new->visibility = VISIBILITY_PUBLIC; +// OBSOLETE } +// OBSOLETE } + +// OBSOLETE /* "@" comes next - eg: @Bvir */ +// OBSOLETE if (**pp != '@') +// OBSOLETE { +// OBSOLETE msg_unknown_complaint (*pp); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE ++(*pp); + + +// OBSOLETE /* Set the bit offset of the portion of the object corresponding +// OBSOLETE to this baseclass. Always zero in the absence of +// OBSOLETE multiple inheritance. */ +// OBSOLETE /* Unable to read bit position from stabs; +// OBSOLETE Assuming no multiple inheritance for now FIXME! */ +// OBSOLETE /* We may have read this in the structure definition; +// OBSOLETE now we should fixup the members to be the actual base classes */ +// OBSOLETE FIELD_BITPOS (new->field) = 0; + +// OBSOLETE /* Get the base class name and type */ +// OBSOLETE { +// OBSOLETE char *bname; /* base class name */ +// OBSOLETE struct symbol *bsym; /* base class */ +// OBSOLETE char *p1, *p2; +// OBSOLETE p1 = strchr (*pp, ' '); +// OBSOLETE p2 = strchr (*pp, ';'); +// OBSOLETE if (p1 < p2) +// OBSOLETE bname = get_substring (pp, ' '); +// OBSOLETE else +// OBSOLETE bname = get_substring (pp, ';'); +// OBSOLETE if (!bname || !*bname) +// OBSOLETE { +// OBSOLETE msg_unknown_complaint (*pp); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE /* FIXME! attach base info to type */ +// OBSOLETE bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name */ +// OBSOLETE if (bsym) +// OBSOLETE { +// OBSOLETE new->field.type = SYMBOL_TYPE (bsym); +// OBSOLETE new->field.name = type_name_no_tag (new->field.type); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, "Unable to find base type for %s", +// OBSOLETE *pp); +// OBSOLETE return 1; +// OBSOLETE } +// OBSOLETE } + +// OBSOLETE /* If more base classes to parse, loop again. +// OBSOLETE We ate the last ' ' or ';' in get_substring, +// OBSOLETE so on exit we will have skipped the trailing ';' */ +// OBSOLETE /* if invalid, return 0; add code to detect - FIXME! */ +// OBSOLETE } +// OBSOLETE return 1; +// OBSOLETE } + +// OBSOLETE /* read cfront member functions. +// OBSOLETE pp points to string starting with list of functions +// OBSOLETE eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; +// OBSOLETE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// OBSOLETE A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; +// OBSOLETE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// OBSOLETE */ + +// OBSOLETE static int +// OBSOLETE read_cfront_member_functions (struct field_info *fip, char **pp, +// OBSOLETE struct type *type, struct objfile *objfile) +// OBSOLETE { +// OBSOLETE /* This code extracted from read_member_functions +// OBSOLETE so as to do the similar thing for our funcs */ + +// OBSOLETE int nfn_fields = 0; +// OBSOLETE int length = 0; +// OBSOLETE /* Total number of member functions defined in this class. If the class +// OBSOLETE defines two `f' functions, and one `g' function, then this will have +// OBSOLETE the value 3. */ +// OBSOLETE int total_length = 0; +// OBSOLETE int i; +// OBSOLETE struct next_fnfield +// OBSOLETE { +// OBSOLETE struct next_fnfield *next; +// OBSOLETE struct fn_field fn_field; +// OBSOLETE } +// OBSOLETE *sublist; +// OBSOLETE struct type *look_ahead_type; +// OBSOLETE struct next_fnfieldlist *new_fnlist; +// OBSOLETE struct next_fnfield *new_sublist; +// OBSOLETE char *main_fn_name; +// OBSOLETE char *fname; +// OBSOLETE struct symbol *ref_func = 0; + +// OBSOLETE /* Process each list until we find the end of the member functions. +// OBSOLETE eg: p = "__ct__1AFv foo__1AFv ;;;" */ + +// OBSOLETE STABS_CONTINUE (pp, objfile); /* handle \\ */ + +// OBSOLETE while (**pp != ';' && (fname = get_substring (pp, ' '), fname)) +// OBSOLETE { +// OBSOLETE int is_static = 0; +// OBSOLETE int sublist_count = 0; +// OBSOLETE char *pname; +// OBSOLETE if (fname[0] == '*') /* static member */ +// OBSOLETE { +// OBSOLETE is_static = 1; +// OBSOLETE sublist_count++; +// OBSOLETE fname++; +// OBSOLETE } +// OBSOLETE ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */ +// OBSOLETE if (!ref_func) +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, +// OBSOLETE "Unable to find function symbol for %s", fname); +// OBSOLETE continue; +// OBSOLETE } +// OBSOLETE sublist = NULL; +// OBSOLETE look_ahead_type = NULL; +// OBSOLETE length = 0; + +// OBSOLETE new_fnlist = (struct next_fnfieldlist *) +// OBSOLETE xmalloc (sizeof (struct next_fnfieldlist)); +// OBSOLETE make_cleanup (xfree, new_fnlist); +// OBSOLETE memset (new_fnlist, 0, sizeof (struct next_fnfieldlist)); + +// OBSOLETE /* The following is code to work around cfront generated stabs. +// OBSOLETE The stabs contains full mangled name for each field. +// OBSOLETE We try to demangle the name and extract the field name out of it. */ +// OBSOLETE { +// OBSOLETE char *dem, *dem_p, *dem_args; +// OBSOLETE int dem_len; +// OBSOLETE dem = cplus_demangle (fname, DMGL_ANSI | DMGL_PARAMS); +// OBSOLETE if (dem != NULL) +// OBSOLETE { +// OBSOLETE dem_p = strrchr (dem, ':'); +// OBSOLETE if (dem_p != 0 && *(dem_p - 1) == ':') +// OBSOLETE dem_p++; +// OBSOLETE /* get rid of args */ +// OBSOLETE dem_args = strchr (dem_p, '('); +// OBSOLETE if (dem_args == NULL) +// OBSOLETE dem_len = strlen (dem_p); +// OBSOLETE else +// OBSOLETE dem_len = dem_args - dem_p; +// OBSOLETE main_fn_name = +// OBSOLETE obsavestring (dem_p, dem_len, &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE main_fn_name = +// OBSOLETE obsavestring (fname, strlen (fname), &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE } /* end of code for cfront work around */ + +// OBSOLETE new_fnlist->fn_fieldlist.name = main_fn_name; + +// OBSOLETE /*-------------------------------------------------*/ +// OBSOLETE /* Set up the sublists +// OBSOLETE Sublists are stuff like args, static, visibility, etc. +// OBSOLETE so in ARM, we have to set that info some other way. +// OBSOLETE Multiple sublists happen if overloading +// OBSOLETE eg: foo::26=##1;:;2A.; +// OBSOLETE In g++, we'd loop here thru all the sublists... */ + +// OBSOLETE new_sublist = +// OBSOLETE (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield)); +// OBSOLETE make_cleanup (xfree, new_sublist); +// OBSOLETE memset (new_sublist, 0, sizeof (struct next_fnfield)); + +// OBSOLETE /* eat 1; from :;2A.; */ +// OBSOLETE new_sublist->fn_field.type = SYMBOL_TYPE (ref_func); /* normally takes a read_type */ +// OBSOLETE /* Make this type look like a method stub for gdb */ +// OBSOLETE TYPE_FLAGS (new_sublist->fn_field.type) |= TYPE_FLAG_STUB; +// OBSOLETE TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD; + +// OBSOLETE /* If this is just a stub, then we don't have the real name here. */ +// OBSOLETE if (TYPE_STUB (new_sublist->fn_field.type)) +// OBSOLETE { +// OBSOLETE if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type)) +// OBSOLETE TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type; +// OBSOLETE new_sublist->fn_field.is_stub = 1; +// OBSOLETE } + +// OBSOLETE /* physname used later in mangling; eg PFs_i,5 for foo__1aFPFs_i +// OBSOLETE physname gets strcat'd in order to recreate the onto mangled name */ +// OBSOLETE pname = get_cfront_method_physname (fname); +// OBSOLETE new_sublist->fn_field.physname = savestring (pname, strlen (pname)); + + +// OBSOLETE /* Set this member function's visibility fields. +// OBSOLETE Unable to distinguish access from stabs definition! +// OBSOLETE Assuming public for now. FIXME! +// OBSOLETE (for private, set new_sublist->fn_field.is_private = 1, +// OBSOLETE for public, set new_sublist->fn_field.is_protected = 1) */ + +// OBSOLETE /* Unable to distinguish const/volatile from stabs definition! +// OBSOLETE Assuming normal for now. FIXME! */ + +// OBSOLETE new_sublist->fn_field.is_const = 0; +// OBSOLETE new_sublist->fn_field.is_volatile = 0; /* volatile not implemented in cfront */ + +// OBSOLETE /* Set virtual/static function info +// OBSOLETE How to get vtable offsets ? +// OBSOLETE Assuming normal for now FIXME!! +// OBSOLETE For vtables, figure out from whence this virtual function came. +// OBSOLETE It may belong to virtual function table of +// OBSOLETE one of its baseclasses. +// OBSOLETE set: +// OBSOLETE new_sublist -> fn_field.voffset = vtable offset, +// OBSOLETE new_sublist -> fn_field.fcontext = look_ahead_type; +// OBSOLETE where look_ahead_type is type of baseclass */ +// OBSOLETE if (is_static) +// OBSOLETE new_sublist->fn_field.voffset = VOFFSET_STATIC; +// OBSOLETE else /* normal member function. */ +// OBSOLETE new_sublist->fn_field.voffset = 0; +// OBSOLETE new_sublist->fn_field.fcontext = 0; + + +// OBSOLETE /* Prepare new sublist */ +// OBSOLETE new_sublist->next = sublist; +// OBSOLETE sublist = new_sublist; +// OBSOLETE length++; + +// OBSOLETE /* In g++, we loop thu sublists - now we set from functions. */ +// OBSOLETE new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *) +// OBSOLETE obstack_alloc (&objfile->type_obstack, +// OBSOLETE sizeof (struct fn_field) * length); +// OBSOLETE memset (new_fnlist->fn_fieldlist.fn_fields, 0, +// OBSOLETE sizeof (struct fn_field) * length); +// OBSOLETE for (i = length; (i--, sublist); sublist = sublist->next) +// OBSOLETE { +// OBSOLETE new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field; +// OBSOLETE } + +// OBSOLETE new_fnlist->fn_fieldlist.length = length; +// OBSOLETE new_fnlist->next = fip->fnlist; +// OBSOLETE fip->fnlist = new_fnlist; +// OBSOLETE nfn_fields++; +// OBSOLETE total_length += length; +// OBSOLETE STABS_CONTINUE (pp, objfile); /* handle \\ */ +// OBSOLETE } /* end of loop */ + +// OBSOLETE if (nfn_fields) +// OBSOLETE { +// OBSOLETE /* type should already have space */ +// OBSOLETE TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *) +// OBSOLETE TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields); +// OBSOLETE memset (TYPE_FN_FIELDLISTS (type), 0, +// OBSOLETE sizeof (struct fn_fieldlist) * nfn_fields); +// OBSOLETE TYPE_NFN_FIELDS (type) = nfn_fields; +// OBSOLETE TYPE_NFN_FIELDS_TOTAL (type) = total_length; +// OBSOLETE } + +// OBSOLETE /* end of scope for reading member func */ + +// OBSOLETE /* eg: ";;" */ + +// OBSOLETE /* Skip trailing ';' and bump count of number of fields seen */ +// OBSOLETE if (**pp == ';') +// OBSOLETE (*pp)++; +// OBSOLETE else +// OBSOLETE return 0; +// OBSOLETE return 1; +// OBSOLETE } + +// OBSOLETE /* This routine fixes up partial cfront types that were created +// OBSOLETE while parsing the stabs. The main need for this function is +// OBSOLETE to add information such as methods to classes. +// OBSOLETE Examples of "p": "sA;;__ct__1AFv foo__1AFv ;;;" */ +// OBSOLETE int +// OBSOLETE resolve_cfront_continuation (struct objfile *objfile, struct symbol *sym, +// OBSOLETE char *p) +// OBSOLETE { +// OBSOLETE struct symbol *ref_sym = 0; +// OBSOLETE char *sname; +// OBSOLETE /* snarfed from read_struct_type */ +// OBSOLETE struct field_info fi; +// OBSOLETE struct type *type; +// OBSOLETE struct cleanup *back_to; + +// OBSOLETE /* Need to make sure that fi isn't gunna conflict with struct +// OBSOLETE in case struct already had some fnfs */ +// OBSOLETE fi.list = NULL; +// OBSOLETE fi.fnlist = NULL; +// OBSOLETE back_to = make_cleanup (null_cleanup, 0); + +// OBSOLETE /* We only accept structs, classes and unions at the moment. +// OBSOLETE Other continuation types include t (typedef), r (long dbl), ... +// OBSOLETE We may want to add support for them as well; +// OBSOLETE right now they are handled by duplicating the symbol information +// OBSOLETE into the type information (see define_symbol) */ +// OBSOLETE if (*p != 's' /* structs */ +// OBSOLETE && *p != 'c' /* class */ +// OBSOLETE && *p != 'u') /* union */ +// OBSOLETE return 0; /* only handle C++ types */ +// OBSOLETE p++; + +// OBSOLETE /* Get symbol typs name and validate +// OBSOLETE eg: p = "A;;__ct__1AFv foo__1AFv ;;;" */ +// OBSOLETE sname = get_substring (&p, ';'); +// OBSOLETE if (!sname || strcmp (sname, SYMBOL_NAME (sym))) +// OBSOLETE error ("Internal error: base symbol type name does not match\n"); + +// OBSOLETE /* Find symbol's internal gdb reference using demangled_name. +// OBSOLETE This is the real sym that we want; +// OBSOLETE sym was a temp hack to make debugger happy */ +// OBSOLETE ref_sym = lookup_symbol (SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0); +// OBSOLETE type = SYMBOL_TYPE (ref_sym); + + +// OBSOLETE /* Now read the baseclasses, if any, read the regular C struct or C++ +// OBSOLETE class member fields, attach the fields to the type, read the C++ +// OBSOLETE member functions, attach them to the type, and then read any tilde +// OBSOLETE field (baseclass specifier for the class holding the main vtable). */ + +// OBSOLETE if (!read_cfront_baseclasses (&fi, &p, type, objfile) +// OBSOLETE /* g++ does this next, but cfront already did this: +// OBSOLETE || !read_struct_fields (&fi, &p, type, objfile) */ +// OBSOLETE || !copy_cfront_struct_fields (&fi, type, objfile) +// OBSOLETE || !read_cfront_member_functions (&fi, &p, type, objfile) +// OBSOLETE || !read_cfront_static_fields (&fi, &p, type, objfile) +// OBSOLETE || !attach_fields_to_type (&fi, type, objfile) +// OBSOLETE || !attach_fn_fields_to_type (&fi, type) +// OBSOLETE /* g++ does this next, but cfront doesn't seem to have this: +// OBSOLETE || !read_tilde_fields (&fi, &p, type, objfile) */ +// OBSOLETE ) +// OBSOLETE { +// OBSOLETE type = error_type (&p, objfile); +// OBSOLETE } + +// OBSOLETE do_cleanups (back_to); +// OBSOLETE return 0; +// OBSOLETE } +// OBSOLETE /* End of code added to support parsing of ARM/Cfront stabs strings */ +#endif /* OBSOLETE CFront */ /* This routine fixes up symbol references/aliases to point to the original symbol definition. Returns 0 on failure, non-zero on success. */ @@ -1644,13 +1643,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, else SYMBOL_TYPE (sym) = read_type (&p, objfile); - /* Normally this is a parameter, a LOC_ARG. On the i960, it - can also be a LOC_LOCAL_ARG depending on symbol type. */ -#ifndef DBX_PARM_SYMBOL_CLASS -#define DBX_PARM_SYMBOL_CLASS(type) LOC_ARG -#endif - - SYMBOL_CLASS (sym) = DBX_PARM_SYMBOL_CLASS (type); + SYMBOL_CLASS (sym) = LOC_ARG; SYMBOL_VALUE (sym) = valu; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; add_symbol_to_list (sym, &local_symbols); @@ -1948,16 +1941,18 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, if (synonym) p++; - /* The semantics of C++ state that "struct foo { ... }" also defines - a typedef for "foo". Unfortunately, cfront never makes the typedef - when translating C++ into C. We make the typedef here so that - "ptype foo" works as expected for cfront translated code. */ - else if ((current_subfile->language == language_cplus) - || (current_subfile->language == language_objc)) - synonym = 1; +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* The semantics of C++ state that "struct foo { ... }" also defines +// OBSOLETE a typedef for "foo". Unfortunately, cfront never makes the typedef +// OBSOLETE when translating C++ into C. We make the typedef here so that +// OBSOLETE "ptype foo" works as expected for cfront translated code. */ +// OBSOLETE else if ((current_subfile->language == language_cplus) +// OBSOLETE || (current_subfile->language == language_objc)) +// OBSOLETE synonym = 1; +#endif /* OBSOLETE CFront */ SYMBOL_TYPE (sym) = read_type (&p, objfile); - + /* For a nameless type, we don't want a create a symbol, thus we did not use `sym'. Return without further processing. */ if (nameless) @@ -2044,31 +2039,32 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; add_symbol_to_list (sym, &local_symbols); break; - - /* New code added to support cfront stabs strings. - Note: case 'P' already handled above */ - case 'Z': - /* Cfront type continuation coming up! - Find the original definition and add to it. - We'll have to do this for the typedef too, - since we cloned the symbol to define a type in read_type. - Stabs info examples: - __1C :Ztl - foo__1CFv :ZtF (first def foo__1CFv:F(0,3);(0,24)) - C:ZsC;;__ct__1CFv func1__1CFv func2__1CFv ... ;;; - where C is the name of the class. - Unfortunately, we can't lookup the original symbol yet 'cuz - we haven't finished reading all the symbols. - Instead, we save it for processing later */ - process_later (sym, p, resolve_cfront_continuation); - SYMBOL_TYPE (sym) = error_type (&p, objfile); /* FIXME! change later */ - SYMBOL_CLASS (sym) = LOC_CONST; - SYMBOL_VALUE (sym) = 0; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; - /* Don't add to list - we'll delete it later when - we add the continuation to the real sym */ - return sym; - /* End of new code added to support cfront stabs strings */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* New code added to support cfront stabs strings. +// OBSOLETE Note: case 'P' already handled above */ +// OBSOLETE case 'Z': +// OBSOLETE /* Cfront type continuation coming up! +// OBSOLETE Find the original definition and add to it. +// OBSOLETE We'll have to do this for the typedef too, +// OBSOLETE since we cloned the symbol to define a type in read_type. +// OBSOLETE Stabs info examples: +// OBSOLETE __1C :Ztl +// OBSOLETE foo__1CFv :ZtF (first def foo__1CFv:F(0,3);(0,24)) +// OBSOLETE C:ZsC;;__ct__1CFv func1__1CFv func2__1CFv ... ;;; +// OBSOLETE where C is the name of the class. +// OBSOLETE Unfortunately, we can't lookup the original symbol yet 'cuz +// OBSOLETE we haven't finished reading all the symbols. +// OBSOLETE Instead, we save it for processing later */ +// OBSOLETE process_later (sym, p, resolve_cfront_continuation); +// OBSOLETE SYMBOL_TYPE (sym) = error_type (&p, objfile); /* FIXME! change later */ +// OBSOLETE SYMBOL_CLASS (sym) = LOC_CONST; +// OBSOLETE SYMBOL_VALUE (sym) = 0; +// OBSOLETE SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; +// OBSOLETE /* Don't add to list - we'll delete it later when +// OBSOLETE we add the continuation to the real sym */ +// OBSOLETE return sym; +// OBSOLETE /* End of new code added to support cfront stabs strings */ +#endif /* OBSOLETE CFront */ default: SYMBOL_TYPE (sym) = error_type (&p, objfile); @@ -3590,35 +3586,37 @@ static void read_one_struct_field (struct field_info *fip, char **pp, char *p, struct type *type, struct objfile *objfile) { - /* The following is code to work around cfront generated stabs. - The stabs contains full mangled name for each field. - We try to demangle the name and extract the field name out of it. - */ - if (ARM_DEMANGLING && current_subfile->language == language_cplus) - { - char save_p; - char *dem, *dem_p; - save_p = *p; - *p = '\0'; - dem = cplus_demangle (*pp, DMGL_ANSI | DMGL_PARAMS); - if (dem != NULL) - { - dem_p = strrchr (dem, ':'); - if (dem_p != 0 && *(dem_p - 1) == ':') - dem_p++; - FIELD_NAME (fip->list->field) = - obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack); - } - else - { - FIELD_NAME (fip->list->field) = - obsavestring (*pp, p - *pp, &objfile->type_obstack); - } - *p = save_p; - } - /* end of code for cfront work around */ - - else +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* The following is code to work around cfront generated stabs. +// OBSOLETE The stabs contains full mangled name for each field. +// OBSOLETE We try to demangle the name and extract the field name out of it. +// OBSOLETE */ +// OBSOLETE if (ARM_DEMANGLING && current_subfile->language == language_cplus) +// OBSOLETE { +// OBSOLETE char save_p; +// OBSOLETE char *dem, *dem_p; +// OBSOLETE save_p = *p; +// OBSOLETE *p = '\0'; +// OBSOLETE dem = cplus_demangle (*pp, DMGL_ANSI | DMGL_PARAMS); +// OBSOLETE if (dem != NULL) +// OBSOLETE { +// OBSOLETE dem_p = strrchr (dem, ':'); +// OBSOLETE if (dem_p != 0 && *(dem_p - 1) == ':') +// OBSOLETE dem_p++; +// OBSOLETE FIELD_NAME (fip->list->field) = +// OBSOLETE obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE FIELD_NAME (fip->list->field) = +// OBSOLETE obsavestring (*pp, p - *pp, &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE *p = save_p; +// OBSOLETE } +// OBSOLETE /* end of code for cfront work around */ + +// OBSOLETE else +#endif /* OBSOLETE CFront */ fip->list->field.name = obsavestring (*pp, p - *pp, &objfile->type_obstack); *pp = p + 1; @@ -4071,135 +4069,137 @@ attach_fn_fields_to_type (struct field_info *fip, register struct type *type) return 1; } -/* read cfront class static data. - pp points to string starting with the list of static data - eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; - ^^^^^^^^ - - A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; - ^ - */ - -static int -read_cfront_static_fields (struct field_info *fip, char **pp, struct type *type, - struct objfile *objfile) -{ - struct nextfield *new; - struct type *stype; - char *sname; - struct symbol *ref_static = 0; - - if (**pp == ';') /* no static data; return */ - { - ++(*pp); - return 1; - } - - /* Process each field in the list until we find the terminating ";" */ - - /* eg: p = "as__1A ;;;" */ - STABS_CONTINUE (pp, objfile); /* handle \\ */ - while (**pp != ';' && (sname = get_substring (pp, ' '), sname)) - { - ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */ - if (!ref_static) - { - complaint (&symfile_complaints, - "Unable to find symbol for static data field %s", sname); - continue; - } - stype = SYMBOL_TYPE (ref_static); - - /* allocate a new fip */ - new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); - make_cleanup (xfree, new); - memset (new, 0, sizeof (struct nextfield)); - new->next = fip->list; - fip->list = new; - - /* set visibility */ - /* FIXME! no way to tell visibility from stabs??? */ - new->visibility = VISIBILITY_PUBLIC; - - /* set field info into fip */ - fip->list->field.type = stype; - - /* set bitpos & bitsize */ - SET_FIELD_PHYSNAME (fip->list->field, savestring (sname, strlen (sname))); - - /* set name field */ - /* The following is code to work around cfront generated stabs. - The stabs contains full mangled name for each field. - We try to demangle the name and extract the field name out of it. - */ - if (ARM_DEMANGLING) - { - char *dem, *dem_p; - dem = cplus_demangle (sname, DMGL_ANSI | DMGL_PARAMS); - if (dem != NULL) - { - dem_p = strrchr (dem, ':'); - if (dem_p != 0 && *(dem_p - 1) == ':') - dem_p++; - fip->list->field.name = - obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack); - } - else - { - fip->list->field.name = - obsavestring (sname, strlen (sname), &objfile->type_obstack); - } - } /* end of code for cfront work around */ - } /* loop again for next static field */ - return 1; -} - -/* Copy structure fields to fip so attach_fields_to_type will work. - type has already been created with the initial instance data fields. - Now we want to be able to add the other members to the class, - so we want to add them back to the fip and reattach them again - once we have collected all the class members. */ - -static int -copy_cfront_struct_fields (struct field_info *fip, struct type *type, - struct objfile *objfile) -{ - int nfields = TYPE_NFIELDS (type); - int i; - struct nextfield *new; - - /* Copy the fields into the list of fips and reset the types - to remove the old fields */ - - for (i = 0; i < nfields; i++) - { - /* allocate a new fip */ - new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); - make_cleanup (xfree, new); - memset (new, 0, sizeof (struct nextfield)); - new->next = fip->list; - fip->list = new; - - /* copy field info into fip */ - new->field = TYPE_FIELD (type, i); - /* set visibility */ - if (TYPE_FIELD_PROTECTED (type, i)) - new->visibility = VISIBILITY_PROTECTED; - else if (TYPE_FIELD_PRIVATE (type, i)) - new->visibility = VISIBILITY_PRIVATE; - else - new->visibility = VISIBILITY_PUBLIC; - } - /* Now delete the fields from the type since we will be - allocing new space once we get the rest of the fields - in attach_fields_to_type. - The pointer TYPE_FIELDS(type) is left dangling but should - be freed later by objstack_free */ - TYPE_FIELDS (type) = 0; - TYPE_NFIELDS (type) = 0; - - return 1; -} +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* read cfront class static data. +// OBSOLETE pp points to string starting with the list of static data +// OBSOLETE eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; +// OBSOLETE ^^^^^^^^ + +// OBSOLETE A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;; +// OBSOLETE ^ +// OBSOLETE */ + +// OBSOLETE static int +// OBSOLETE read_cfront_static_fields (struct field_info *fip, char **pp, struct type *type, +// OBSOLETE struct objfile *objfile) +// OBSOLETE { +// OBSOLETE struct nextfield *new; +// OBSOLETE struct type *stype; +// OBSOLETE char *sname; +// OBSOLETE struct symbol *ref_static = 0; + +// OBSOLETE if (**pp == ';') /* no static data; return */ +// OBSOLETE { +// OBSOLETE ++(*pp); +// OBSOLETE return 1; +// OBSOLETE } + +// OBSOLETE /* Process each field in the list until we find the terminating ";" */ + +// OBSOLETE /* eg: p = "as__1A ;;;" */ +// OBSOLETE STABS_CONTINUE (pp, objfile); /* handle \\ */ +// OBSOLETE while (**pp != ';' && (sname = get_substring (pp, ' '), sname)) +// OBSOLETE { +// OBSOLETE ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */ +// OBSOLETE if (!ref_static) +// OBSOLETE { +// OBSOLETE complaint (&symfile_complaints, +// OBSOLETE "Unable to find symbol for static data field %s", sname); +// OBSOLETE continue; +// OBSOLETE } +// OBSOLETE stype = SYMBOL_TYPE (ref_static); + +// OBSOLETE /* allocate a new fip */ +// OBSOLETE new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); +// OBSOLETE make_cleanup (xfree, new); +// OBSOLETE memset (new, 0, sizeof (struct nextfield)); +// OBSOLETE new->next = fip->list; +// OBSOLETE fip->list = new; + +// OBSOLETE /* set visibility */ +// OBSOLETE /* FIXME! no way to tell visibility from stabs??? */ +// OBSOLETE new->visibility = VISIBILITY_PUBLIC; + +// OBSOLETE /* set field info into fip */ +// OBSOLETE fip->list->field.type = stype; + +// OBSOLETE /* set bitpos & bitsize */ +// OBSOLETE SET_FIELD_PHYSNAME (fip->list->field, savestring (sname, strlen (sname))); + +// OBSOLETE /* set name field */ +// OBSOLETE /* The following is code to work around cfront generated stabs. +// OBSOLETE The stabs contains full mangled name for each field. +// OBSOLETE We try to demangle the name and extract the field name out of it. +// OBSOLETE */ +// OBSOLETE if (ARM_DEMANGLING) +// OBSOLETE { +// OBSOLETE char *dem, *dem_p; +// OBSOLETE dem = cplus_demangle (sname, DMGL_ANSI | DMGL_PARAMS); +// OBSOLETE if (dem != NULL) +// OBSOLETE { +// OBSOLETE dem_p = strrchr (dem, ':'); +// OBSOLETE if (dem_p != 0 && *(dem_p - 1) == ':') +// OBSOLETE dem_p++; +// OBSOLETE fip->list->field.name = +// OBSOLETE obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE else +// OBSOLETE { +// OBSOLETE fip->list->field.name = +// OBSOLETE obsavestring (sname, strlen (sname), &objfile->type_obstack); +// OBSOLETE } +// OBSOLETE } /* end of code for cfront work around */ +// OBSOLETE } /* loop again for next static field */ +// OBSOLETE return 1; +// OBSOLETE } + +// OBSOLETE /* Copy structure fields to fip so attach_fields_to_type will work. +// OBSOLETE type has already been created with the initial instance data fields. +// OBSOLETE Now we want to be able to add the other members to the class, +// OBSOLETE so we want to add them back to the fip and reattach them again +// OBSOLETE once we have collected all the class members. */ + +// OBSOLETE static int +// OBSOLETE copy_cfront_struct_fields (struct field_info *fip, struct type *type, +// OBSOLETE struct objfile *objfile) +// OBSOLETE { +// OBSOLETE int nfields = TYPE_NFIELDS (type); +// OBSOLETE int i; +// OBSOLETE struct nextfield *new; + +// OBSOLETE /* Copy the fields into the list of fips and reset the types +// OBSOLETE to remove the old fields */ + +// OBSOLETE for (i = 0; i < nfields; i++) +// OBSOLETE { +// OBSOLETE /* allocate a new fip */ +// OBSOLETE new = (struct nextfield *) xmalloc (sizeof (struct nextfield)); +// OBSOLETE make_cleanup (xfree, new); +// OBSOLETE memset (new, 0, sizeof (struct nextfield)); +// OBSOLETE new->next = fip->list; +// OBSOLETE fip->list = new; + +// OBSOLETE /* copy field info into fip */ +// OBSOLETE new->field = TYPE_FIELD (type, i); +// OBSOLETE /* set visibility */ +// OBSOLETE if (TYPE_FIELD_PROTECTED (type, i)) +// OBSOLETE new->visibility = VISIBILITY_PROTECTED; +// OBSOLETE else if (TYPE_FIELD_PRIVATE (type, i)) +// OBSOLETE new->visibility = VISIBILITY_PRIVATE; +// OBSOLETE else +// OBSOLETE new->visibility = VISIBILITY_PUBLIC; +// OBSOLETE } +// OBSOLETE /* Now delete the fields from the type since we will be +// OBSOLETE allocing new space once we get the rest of the fields +// OBSOLETE in attach_fields_to_type. +// OBSOLETE The pointer TYPE_FIELDS(type) is left dangling but should +// OBSOLETE be freed later by objstack_free */ +// OBSOLETE TYPE_FIELDS (type) = 0; +// OBSOLETE TYPE_NFIELDS (type) = 0; + +// OBSOLETE return 1; +// OBSOLETE } +#endif /* OBSOLETE CFront */ /* Create the vector of fields, and record how big it is. We need this info to record proper virtual function table information @@ -4930,7 +4930,7 @@ read_range_type (char **pp, int typenums[2], struct objfile *objfile) /* Special case: char is defined (Who knows why) as a subrange of itself with range 0-127. */ else if (self_subrange && n2 == 0 && n3 == 127) - return init_type (TYPE_CODE_INT, 1, 0, NULL, objfile); + return init_type (TYPE_CODE_INT, 1, TYPE_FLAG_NOSIGN, NULL, objfile); /* We used to do this only for subrange of self or subrange of int. */ else if (n2 == 0) diff --git a/gdb/stabsread.h b/gdb/stabsread.h index e959e7a..62fd776 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -1,6 +1,6 @@ /* Include file for stabs debugging format support functions. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -181,7 +181,7 @@ extern void process_one_symbol (int, int, CORE_ADDR, char *, extern void elfstab_build_psymtabs (struct objfile *objfile, int mainline, - file_ptr staboff, unsigned int stabsize, + asection *stabsect, file_ptr stabstroffset, unsigned int stabstrsize); @@ -198,10 +198,11 @@ extern void stabsect_build_psymtabs extern void elfstab_offset_sections (struct objfile *, struct partial_symtab *); - -extern void process_later - (struct symbol *, char *, - int (*f) (struct objfile *, struct symbol *, char *)); +#if 0 /* OBSOLETE CFront */ +// OBSOLETE extern void process_later +// OBSOLETE (struct symbol *, char *, +// OBSOLETE int (*f) (struct objfile *, struct symbol *, char *)); +#endif /* OBSOLETE CFront */ extern int symbol_reference_defined (char **); @@ -209,9 +210,10 @@ extern void ref_add (int, struct symbol *, char *, CORE_ADDR); extern struct symbol *ref_search (int); -extern int resolve_cfront_continuation - (struct objfile *objfile, struct symbol *sym, char *p); - +#if 0 /* OBSOLETE CFront */ +// OBSOLETE extern int resolve_cfront_continuation +// OBSOLETE (struct objfile *objfile, struct symbol *sym, char *p); +#endif /* OBSOLETE CFront */ extern void free_header_files (void); extern void init_header_files (void); diff --git a/gdb/stack.c b/gdb/stack.c index 6ce7366..6b242b2 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1,7 +1,7 @@ /* Print and select stack frames for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -98,10 +98,6 @@ static void print_frame (struct frame_info *fi, int args, struct symtab_and_line sal); -static void print_frame_info_base (struct frame_info *, int, int, int); - -static void print_stack_frame_base (struct frame_info *, int, int); - static void backtrace_command (char *, int); struct frame_info *parse_frame_specification (char *); @@ -127,21 +123,6 @@ struct print_stack_frame_args int args; }; -static int print_stack_frame_base_stub (char *); - -/* Show and print the frame arguments. - Pass the args the way catch_errors wants them. */ -static int show_and_print_stack_frame_stub (void *args); -static int -show_and_print_stack_frame_stub (void *args) -{ - struct print_stack_frame_args *p = (struct print_stack_frame_args *) args; - - print_frame_info (p->fi, p->level, p->source, p->args); - - return 0; -} - /* Show or print the frame arguments. Pass the args the way catch_errors wants them. */ static int print_stack_frame_stub (void *args); @@ -150,83 +131,10 @@ print_stack_frame_stub (void *args) { struct print_stack_frame_args *p = (struct print_stack_frame_args *) args; - print_frame_info_base (p->fi, p->level, p->source, p->args); - return 0; -} - -/* Print a stack frame briefly. FRAME_INFI should be the frame info - and LEVEL should be its level in the stack (or -1 for level not - defined). */ - -/* Pass the args the way catch_errors wants them. */ -static int -print_stack_frame_base_stub (char *args) -{ - struct print_stack_frame_args *p = (struct print_stack_frame_args *) args; - - print_frame_info_base (p->fi, p->level, p->source, p->args); - return 0; -} - -/* print the frame arguments to the terminal. - Pass the args the way catch_errors wants them. */ -static int print_only_stack_frame_stub (void *); -static int -print_only_stack_frame_stub (void *args) -{ - struct print_stack_frame_args *p = (struct print_stack_frame_args *) args; - - print_frame_info_base (p->fi, p->level, p->source, p->args); + print_frame_info (p->fi, p->level, p->source, p->args); return 0; } -/* Print a stack frame briefly. FRAME_INFI should be the frame info - and LEVEL should be its level in the stack (or -1 for level not defined). - This prints the level, the function executing, the arguments, - and the file name and line number. - If the pc is not at the beginning of the source line, - the actual pc is printed at the beginning. - - If SOURCE is 1, print the source line as well. - If SOURCE is -1, print ONLY the source line. */ - -static void -print_stack_frame_base (struct frame_info *fi, int level, int source) -{ - struct print_stack_frame_args args; - - args.fi = fi; - args.level = level; - args.source = source; - args.args = 1; - - catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ALL); -} - -/* Show and print a stack frame briefly. FRAME_INFI should be the frame info - and LEVEL should be its level in the stack (or -1 for level not defined). - This prints the level, the function executing, the arguments, - and the file name and line number. - If the pc is not at the beginning of the source line, - the actual pc is printed at the beginning. - - If SOURCE is 1, print the source line as well. - If SOURCE is -1, print ONLY the source line. */ - -void -show_and_print_stack_frame (struct frame_info *fi, int level, int source) -{ - struct print_stack_frame_args args; - - args.fi = fi; - args.level = level; - args.source = source; - args.args = 1; - - catch_errors (show_and_print_stack_frame_stub, &args, "", RETURN_MASK_ALL); -} - - /* Show or print a stack frame briefly. FRAME_INFI should be the frame info and LEVEL should be its level in the stack (or -1 for level not defined). This prints the level, the function executing, the arguments, @@ -248,30 +156,7 @@ print_stack_frame (struct frame_info *fi, int level, int source) args.args = 1; catch_errors (print_stack_frame_stub, (char *) &args, "", RETURN_MASK_ALL); -} - -/* Print a stack frame briefly. FRAME_INFI should be the frame info - and LEVEL should be its level in the stack (or -1 for level not defined). - This prints the level, the function executing, the arguments, - and the file name and line number. - If the pc is not at the beginning of the source line, - the actual pc is printed at the beginning. - - If SOURCE is 1, print the source line as well. - If SOURCE is -1, print ONLY the source line. */ - -void -print_only_stack_frame (struct frame_info *fi, int level, int source) -{ - struct print_stack_frame_args args; - - args.fi = fi; - args.level = level; - args.source = source; - args.args = 1; - - catch_errors (print_only_stack_frame_stub, &args, "", RETURN_MASK_ALL); -} +} struct print_args_args { @@ -280,12 +165,12 @@ struct print_args_args struct ui_file *stream; }; -static int print_args_stub (PTR); +static int print_args_stub (void *); /* Pass the args the way catch_errors wants them. */ static int -print_args_stub (PTR args) +print_args_stub (void *args) { int numargs; struct print_args_args *p = (struct print_args_args *) args; @@ -305,15 +190,19 @@ print_args_stub (PTR args) LOCATION: Print only location LOC_AND_SRC: Print location and source line. */ -static void -print_frame_info_base (struct frame_info *fi, int level, int source, int args) +void +print_frame_info (struct frame_info *fi, int level, int source, int args) { struct symtab_and_line sal; int source_print; int location_print; - if (get_frame_type (fi) == DUMMY_FRAME) + if (get_frame_type (fi) == DUMMY_FRAME + || get_frame_type (fi) == SIGTRAMP_FRAME) { + struct cleanup *uiout_cleanup + = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); + annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); /* Do this regardless of SOURCE because we don't have any source @@ -323,25 +212,27 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) ui_out_text (uiout, "#"); ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); } - annotate_function_call (); - printf_filtered ("\n"); - annotate_frame_end (); - return; - } - if ((get_frame_type (fi) == SIGTRAMP_FRAME)) - { - annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); + if (ui_out_is_mi_like_p (uiout)) + { + annotate_frame_address (); + ui_out_field_core_addr (uiout, "addr", fi->pc); + annotate_frame_address_end (); + } - /* Do this regardless of SOURCE because we don't have any source - to list for this frame. */ - if (level >= 0) + if (get_frame_type (fi) == DUMMY_FRAME) { - ui_out_text (uiout, "#"); - ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); + annotate_function_call (); + ui_out_field_string (uiout, "func", ""); + } + else if (get_frame_type (fi) == SIGTRAMP_FRAME) + { + annotate_signal_handler_caller (); + ui_out_field_string (uiout, "func", ""); } - annotate_signal_handler_caller (); - printf_filtered ("\n"); + ui_out_text (uiout, "\n"); annotate_frame_end (); + + do_cleanups (uiout_cleanup); return; } @@ -581,16 +472,6 @@ print_frame (struct frame_info *fi, do_cleanups (old_chain); } - -/* Show or print the frame info. If this is the tui, it will be shown in - the source display */ -void -print_frame_info (struct frame_info *fi, register int level, int source, - int args) -{ - print_frame_info_base (fi, level, source, args); -} - /* Show the frame info. If this is the tui, it will be shown in the source display otherwise, nothing is done */ void @@ -900,7 +781,8 @@ frame_info (char *addr_exp, int from_tty) } } - if (get_frame_saved_regs (fi) == NULL) + if (FRAME_INIT_SAVED_REGS_P () + && get_frame_saved_regs (fi) == NULL) FRAME_INIT_SAVED_REGS (fi); /* Print as much information as possible on the location of all the registers. */ @@ -1098,7 +980,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty) means further attempts to backtrace would fail (on the other hand, perhaps the code does or could be fixed to make sure the frame->prev field gets set to NULL in that case). */ - print_frame_info_base (fi, trailing_level + i, 0, 1); + print_frame_info (fi, trailing_level + i, 0, 1); if (show_locals) print_frame_local_vars (fi, 1, gdb_stdout); } @@ -1598,8 +1480,8 @@ void frame_command (char *level_exp, int from_tty) { select_frame_command (level_exp, from_tty); - show_and_print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } /* The XDB Compatibility command to print the current frame. */ @@ -1609,7 +1491,7 @@ current_frame_command (char *level_exp, int from_tty) { if (target_has_stack == 0 || deprecated_selected_frame == 0) error ("No stack."); - print_only_stack_frame (deprecated_selected_frame, + print_stack_frame (deprecated_selected_frame, frame_relative_level (deprecated_selected_frame), 1); } @@ -1646,8 +1528,8 @@ static void up_command (char *count_exp, int from_tty) { up_silently_base (count_exp); - show_and_print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } /* Select the frame down one or COUNT stack levels @@ -1693,8 +1575,8 @@ static void down_command (char *count_exp, int from_tty) { down_silently_base (count_exp); - show_and_print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } void @@ -1749,6 +1631,10 @@ return_command (char *retval_exp, int from_tty) error ("Not confirmed."); } + /* FIXME: cagney/2003-01-18: Rather than pop each frame in turn, + this code should just go straight to the relevant frame and pop + that. */ + /* Do the real work. Pop until the specified frame is current. We use this method because the deprecated_selected_frame is not valid after a POP_FRAME. The pc comparison makes this work even if the @@ -1756,11 +1642,11 @@ return_command (char *retval_exp, int from_tty) while (selected_frame_addr != get_frame_base (frame = get_current_frame ()) || selected_frame_pc != get_frame_pc (frame)) - POP_FRAME; + frame_pop (get_current_frame ()); /* Then pop that frame. */ - POP_FRAME; + frame_pop (get_current_frame ()); /* Compute the return value (if any) and store in the place for return values. */ @@ -1770,9 +1656,14 @@ return_command (char *retval_exp, int from_tty) /* If we are at the end of a call dummy now, pop the dummy frame too. */ + /* FIXME: cagney/2003-01-18: This is silly. Instead of popping all + the frames except the dummy, and then, as an afterthought, + popping the dummy frame, this code should just pop through to the + dummy frame. */ + if (CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (), get_frame_base (get_current_frame ()))) - POP_FRAME; + frame_pop (get_current_frame ()); /* If interactive, print the frame that is now current. */ diff --git a/gdb/symfile.c b/gdb/symfile.c index d2e8dd3..c83c025 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1,7 +1,7 @@ /* Generic symbol file reading for the GNU debugger, GDB. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Support, using pieces from other GDB modules. @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "bfdlink.h" #include "symtab.h" #include "gdbtypes.h" #include "gdbcore.h" @@ -38,11 +39,13 @@ #include "complaints.h" #include "demangle.h" #include "inferior.h" /* for write_pc */ +#include "filenames.h" /* for DOSish file names */ #include "gdb-stabs.h" #include "gdb_obstack.h" #include "completer.h" #include "bcache.h" #include +#include "gdb_assert.h" #include #include @@ -104,6 +107,8 @@ static void add_symbol_file_command (char *, int); static void add_shared_symbol_files_command (char *, int); +static void reread_separate_symbols (struct objfile *objfile); + static void cashier_psymtab (struct partial_symtab *); bfd *symfile_bfd_open (char *); @@ -148,6 +153,8 @@ static void set_ext_lang_command (char *args, int from_tty); static void info_ext_lang_command (char *args, int from_tty); +static char *find_separate_debug_file (struct objfile *objfile); + static void init_filename_language_table (void); void _initialize_symfile (void); @@ -411,7 +418,7 @@ entry_point_address (void) lowest-addressed loadable section. */ void -find_lowest_section (bfd *abfd, asection *sect, PTR obj) +find_lowest_section (bfd *abfd, asection *sect, void *obj) { asection **lowest = (asection **) obj; @@ -572,8 +579,26 @@ default_symfile_offsets (struct objfile *objfile, OBJFILE is where the symbols are to be read from. - ADDR is the address where the text segment was loaded, unless the - objfile is the main symbol file, in which case it is zero. + ADDRS is the list of section load addresses. If the user has given + an 'add-symbol-file' command, then this is the list of offsets and + addresses he or she provided as arguments to the command; or, if + we're handling a shared library, these are the actual addresses the + sections are loaded at, according to the inferior's dynamic linker + (as gleaned by GDB's shared library code). We convert each address + into an offset from the section VMA's as it appears in the object + file, and then call the file's sym_offsets function to convert this + into a format-specific offset table --- a `struct section_offsets'. + If ADDRS is non-zero, OFFSETS must be zero. + + OFFSETS is a table of section offsets already in the right + format-specific representation. NUM_OFFSETS is the number of + elements present in OFFSETS->offsets. If OFFSETS is non-zero, we + assume this is the proper table the call to sym_offsets described + above would produce. Instead of calling sym_offsets, we just dump + it right into objfile->section_offsets. (When we're re-reading + symbols from an objfile, we don't have the original load address + list any more; all we have is the section offset table.) If + OFFSETS is non-zero, ADDRS must be zero. MAINLINE is nonzero if this is the main symbol file, or zero if it's an extra symbol file such as dynamically loaded code. @@ -582,8 +607,12 @@ default_symfile_offsets (struct objfile *objfile, the symbol reading (and complaints can be more terse about it). */ void -syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, - int mainline, int verbo) +syms_from_objfile (struct objfile *objfile, + struct section_addr_info *addrs, + struct section_offsets *offsets, + int num_offsets, + int mainline, + int verbo) { asection *lower_sect; asection *sect; @@ -592,16 +621,19 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, struct cleanup *old_chain; int i; - /* If ADDRS is NULL, initialize the local section_addr_info struct and - point ADDRS to it. We now establish the convention that an addr of - zero means no load address was specified. */ + gdb_assert (! (addrs && offsets)); - if (addrs == NULL) + /* If ADDRS and OFFSETS are both NULL, put together a dummy address + list. We now establish the convention that an addr of zero means + no load address was specified. */ + if (! addrs && ! offsets) { memset (&local_addr, 0, sizeof (local_addr)); addrs = &local_addr; } + /* Now either addrs or offsets is non-zero. */ + init_entry_point_info (objfile); find_sym_fns (objfile); @@ -648,7 +680,7 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); if (lower_sect == NULL) bfd_map_over_sections (objfile->obfd, find_lowest_section, - (PTR) &lower_sect); + &lower_sect); if (lower_sect == NULL) warning ("no loadable sections found in added symbol-file %s", objfile->name); @@ -674,30 +706,32 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, this_offset = lower_offset = lower_addr - lower_orig_addr */ /* Calculate offsets for sections. */ - for (i=0 ; i < MAX_SECTIONS && addrs->other[i].name; i++) - { - if (addrs->other[i].addr != 0) - { - sect = bfd_get_section_by_name (objfile->obfd, - addrs->other[i].name); - if (sect) - { - addrs->other[i].addr - -= bfd_section_vma (objfile->obfd, sect); - lower_offset = addrs->other[i].addr; - /* This is the index used by BFD. */ - addrs->other[i].sectindex = sect->index ; - } - else - { - warning ("section %s not found in %s", addrs->other[i].name, - objfile->name); - addrs->other[i].addr = 0; - } - } - else - addrs->other[i].addr = lower_offset; - } + if (addrs) + for (i=0 ; i < MAX_SECTIONS && addrs->other[i].name; i++) + { + if (addrs->other[i].addr != 0) + { + sect = bfd_get_section_by_name (objfile->obfd, + addrs->other[i].name); + if (sect) + { + addrs->other[i].addr + -= bfd_section_vma (objfile->obfd, sect); + lower_offset = addrs->other[i].addr; + /* This is the index used by BFD. */ + addrs->other[i].sectindex = sect->index ; + } + else + { + warning ("section %s not found in %s", + addrs->other[i].name, + objfile->name); + addrs->other[i].addr = 0; + } + } + else + addrs->other[i].addr = lower_offset; + } } /* Initialize symbol reading routines for this objfile, allow complaints to @@ -707,7 +741,21 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, (*objfile->sf->sym_init) (objfile); clear_complaints (&symfile_complaints, 1, verbo); - (*objfile->sf->sym_offsets) (objfile, addrs); + if (addrs) + (*objfile->sf->sym_offsets) (objfile, addrs); + else + { + size_t size = SIZEOF_N_SECTION_OFFSETS (num_offsets); + + /* Just copy in the offset table directly as given to us. */ + objfile->num_sections = num_offsets; + objfile->section_offsets + = ((struct section_offsets *) + obstack_alloc (&objfile->psymbol_obstack, size)); + memcpy (objfile->section_offsets, offsets, size); + + init_objfile_sect_indices (objfile); + } #ifndef IBM6000_TARGET /* This is a SVR4/SunOS specific hack, I think. In any event, it @@ -761,13 +809,6 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, (*objfile->sf->sym_read) (objfile, mainline); - if (!have_partial_symbols () && !have_full_symbols ()) - { - wrap_here (""); - printf_filtered ("(no debugging symbols found)..."); - wrap_here (""); - } - /* Don't allow char * to have a typename (else would get caddr_t). Ditto void *. FIXME: Check whether this is now done by all the symbol readers themselves (many of them now do), and if so remove @@ -825,21 +866,33 @@ new_symfile_objfile (struct objfile *objfile, int mainline, int verbo) NAME is the file name (which will be tilde-expanded and made absolute herein) (but we don't free or modify NAME itself). - FROM_TTY says how verbose to be. MAINLINE specifies whether this - is the main symbol file, or whether it's an extra symbol file such - as dynamically loaded code. If !mainline, ADDR is the address - where the text segment was loaded. + + FROM_TTY says how verbose to be. + + MAINLINE specifies whether this is the main symbol file, or whether + it's an extra symbol file such as dynamically loaded code. + + ADDRS, OFFSETS, and NUM_OFFSETS are as described for + syms_from_objfile, above. ADDRS is ignored when MAINLINE is + non-zero. Upon success, returns a pointer to the objfile that was added. Upon failure, jumps back to command level (never returns). */ - -struct objfile * -symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, - int mainline, int flags) +static struct objfile * +symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, + struct section_addr_info *addrs, + struct section_offsets *offsets, + int num_offsets, + int mainline, int flags) { struct objfile *objfile; struct partial_symtab *psymtab; + char *debugfile; bfd *abfd; + struct section_addr_info orig_addrs; + + if (addrs) + orig_addrs = *addrs; /* Open a bfd for the file, and give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -888,7 +941,8 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, gdb_flush (gdb_stdout); } } - syms_from_objfile (objfile, addrs, mainline, from_tty); + syms_from_objfile (objfile, addrs, offsets, num_offsets, + mainline, from_tty); } /* We now have at least a partial symbol table. Check to see if the @@ -913,6 +967,36 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, } } + debugfile = find_separate_debug_file (objfile); + if (debugfile) + { + if (addrs != NULL) + { + objfile->separate_debug_objfile + = symbol_file_add (debugfile, from_tty, &orig_addrs, 0, flags); + } + else + { + objfile->separate_debug_objfile + = symbol_file_add (debugfile, from_tty, NULL, 0, flags); + } + objfile->separate_debug_objfile->separate_debug_objfile_backlink + = objfile; + + /* Put the separate debug object before the normal one, this is so that + usage of the ALL_OBJFILES_SAFE macro will stay safe. */ + put_objfile_before (objfile->separate_debug_objfile, objfile); + + xfree (debugfile); + } + + if (!have_partial_symbols () && !have_full_symbols ()) + { + wrap_here (""); + printf_filtered ("(no debugging symbols found)..."); + wrap_here (""); + } + if (from_tty || info_verbose) { if (post_add_symbol_hook) @@ -939,6 +1023,19 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, return (objfile); } + +/* Process a symbol file, as either the main file or as a dynamically + loaded file. See symbol_file_add_with_addrs_or_offsets's comments + for details. */ +struct objfile * +symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, + int mainline, int flags) +{ + return symbol_file_add_with_addrs_or_offsets (name, from_tty, addrs, 0, 0, + mainline, flags); +} + + /* Call symbol_file_add() with default values and update whatever is affected by the loading of a new main(). Used when the file is supplied in the gdb command line @@ -995,6 +1092,144 @@ symbol_file_clear (int from_tty) #endif } +static char * +get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) +{ + asection *sect; + bfd_size_type debuglink_size; + unsigned long crc32; + char *contents; + int crc_offset; + unsigned char *p; + + sect = bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink"); + + if (sect == NULL) + return NULL; + + debuglink_size = bfd_section_size (objfile->obfd, sect); + + contents = xmalloc (debuglink_size); + bfd_get_section_contents (objfile->obfd, sect, contents, + (file_ptr)0, (bfd_size_type)debuglink_size); + + /* Crc value is stored after the filename, aligned up to 4 bytes. */ + crc_offset = strlen (contents) + 1; + crc_offset = (crc_offset + 3) & ~3; + + crc32 = bfd_get_32 (objfile->obfd, (bfd_byte *) (contents + crc_offset)); + + *crc32_out = crc32; + return contents; +} + +static int +separate_debug_file_exists (const char *name, unsigned long crc) +{ + unsigned long file_crc = 0; + int fd; + char buffer[8*1024]; + int count; + + fd = open (name, O_RDONLY | O_BINARY); + if (fd < 0) + return 0; + + while ((count = read (fd, buffer, sizeof (buffer))) > 0) + file_crc = gnu_debuglink_crc32 (file_crc, buffer, count); + + close (fd); + + return crc == file_crc; +} + +static char *debug_file_directory = NULL; + +#if ! defined (DEBUG_SUBDIRECTORY) +#define DEBUG_SUBDIRECTORY ".debug" +#endif + +static char * +find_separate_debug_file (struct objfile *objfile) +{ + asection *sect; + char *basename; + char *dir; + char *debugfile; + char *name_copy; + bfd_size_type debuglink_size; + unsigned long crc32; + int i; + + basename = get_debug_link_info (objfile, &crc32); + + if (basename == NULL) + return NULL; + + dir = xstrdup (objfile->name); + + /* Strip off the final filename part, leaving the directory name, + followed by a slash. Objfile names should always be absolute and + tilde-expanded, so there should always be a slash in there + somewhere. */ + for (i = strlen(dir) - 1; i >= 0; i--) + { + if (IS_DIR_SEPARATOR (dir[i])) + break; + } + gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); + dir[i+1] = '\0'; + + debugfile = alloca (strlen (debug_file_directory) + 1 + + strlen (dir) + + strlen (DEBUG_SUBDIRECTORY) + + strlen ("/") + + strlen (basename) + + 1); + + /* First try in the same directory as the original file. */ + strcpy (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + xfree (basename); + xfree (dir); + return xstrdup (debugfile); + } + + /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */ + strcpy (debugfile, dir); + strcat (debugfile, DEBUG_SUBDIRECTORY); + strcat (debugfile, "/"); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + xfree (basename); + xfree (dir); + return xstrdup (debugfile); + } + + /* Then try in the global debugfile directory. */ + strcpy (debugfile, debug_file_directory); + strcat (debugfile, "/"); + strcat (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + xfree (basename); + xfree (dir); + return xstrdup (debugfile); + } + + xfree (basename); + xfree (dir); + return NULL; +} + + /* This is the symbol-file command. Read the file, analyze its symbols, and add a struct symtab to a symtab list. The syntax of the command is rather bizarre--(1) buildargv implements various @@ -1417,11 +1652,11 @@ generic_load (char *args, int from_tty) for other targets too. */ write_pc (entry); - /* FIXME: are we supposed to call symbol_file_add or not? According to - a comment from remote-mips.c (where a call to symbol_file_add was - commented out), making the call confuses GDB if more than one file is - loaded in. remote-nindy.c had no call to symbol_file_add, but remote-vx.c - does. */ + /* FIXME: are we supposed to call symbol_file_add or not? According + to a comment from remote-mips.c (where a call to symbol_file_add + was commented out), making the call confuses GDB if more than one + file is loaded in. Some targets do (e.g., remote-vx.c) but + others don't (or didn't - perhaphs they have all been deleted). */ print_transfer_performance (gdb_stdout, cbdata.data_count, cbdata.write_count, end_time - start_time); @@ -1840,6 +2075,8 @@ reread_symbols (void) needs to keep track of (such as _sigtramp, or whatever). */ TARGET_SYMFILE_POSTREAD (objfile); + + reread_separate_symbols (objfile); } } } @@ -1847,6 +2084,73 @@ reread_symbols (void) if (reread_one) clear_symtab_users (); } + + +/* Handle separate debug info for OBJFILE, which has just been + re-read: + - If we had separate debug info before, but now we don't, get rid + of the separated objfile. + - If we didn't have separated debug info before, but now we do, + read in the new separated debug info file. + - If the debug link points to a different file, toss the old one + and read the new one. + This function does *not* handle the case where objfile is still + using the same separate debug info file, but that file's timestamp + has changed. That case should be handled by the loop in + reread_symbols already. */ +static void +reread_separate_symbols (struct objfile *objfile) +{ + char *debug_file; + unsigned long crc32; + + /* Does the updated objfile's debug info live in a + separate file? */ + debug_file = find_separate_debug_file (objfile); + + if (objfile->separate_debug_objfile) + { + /* There are two cases where we need to get rid of + the old separated debug info objfile: + - if the new primary objfile doesn't have + separated debug info, or + - if the new primary objfile has separate debug + info, but it's under a different filename. + + If the old and new objfiles both have separate + debug info, under the same filename, then we're + okay --- if the separated file's contents have + changed, we will have caught that when we + visited it in this function's outermost + loop. */ + if (! debug_file + || strcmp (debug_file, objfile->separate_debug_objfile->name) != 0) + free_objfile (objfile->separate_debug_objfile); + } + + /* If the new objfile has separate debug info, and we + haven't loaded it already, do so now. */ + if (debug_file + && ! objfile->separate_debug_objfile) + { + /* Use the same section offset table as objfile itself. + Preserve the flags from objfile that make sense. */ + objfile->separate_debug_objfile + = (symbol_file_add_with_addrs_or_offsets + (debug_file, + info_verbose, /* from_tty: Don't override the default. */ + 0, /* No addr table. */ + objfile->section_offsets, objfile->num_sections, + 0, /* Not mainline. See comments about this above. */ + objfile->flags & (OBJF_MAPPED | OBJF_REORDERED + | OBJF_SHARED | OBJF_READNOW + | OBJF_USERLOADED))); + objfile->separate_debug_objfile->separate_debug_objfile_backlink + = objfile; + } +} + + @@ -2483,11 +2787,11 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) if (objfile->global_psymbols.list) { - xmfree (objfile->md, (PTR) objfile->global_psymbols.list); + xmfree (objfile->md, objfile->global_psymbols.list); } if (objfile->static_psymbols.list) { - xmfree (objfile->md, (PTR) objfile->static_psymbols.list); + xmfree (objfile->md, objfile->static_psymbols.list); } /* Current best guess is that approximately a twentieth @@ -3259,6 +3563,45 @@ simple_overlay_update (struct obj_section *osect) } } +/* Set the output sections and output offsets for section SECTP in + ABFD. The relocation code in BFD will read these offsets, so we + need to be sure they're initialized. We map each section to itself, + with no offset; this means that SECTP->vma will be honored. */ + +static void +symfile_dummy_outputs (bfd *abfd, asection *sectp, void *dummy) +{ + sectp->output_section = sectp; + sectp->output_offset = 0; +} + +/* Relocate the contents of a debug section SECTP in ABFD. The + contents are stored in BUF if it is non-NULL, or returned in a + malloc'd buffer otherwise. + + For some platforms and debug info formats, shared libraries contain + relocations against the debug sections (particularly for DWARF-2; + one affected platform is PowerPC GNU/Linux, although it depends on + the version of the linker in use). Also, ELF object files naturally + have unresolved relocations for their debug sections. We need to apply + the relocations in order to get the locations of symbols correct. */ + +bfd_byte * +symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf) +{ + /* We're only interested in debugging sections with relocation + information. */ + if ((sectp->flags & SEC_RELOC) == 0) + return NULL; + if ((sectp->flags & SEC_DEBUGGING) == 0) + return NULL; + + /* We will handle section offsets properly elsewhere, so relocate as if + all sections begin at 0. */ + bfd_map_over_sections (abfd, symfile_dummy_outputs, NULL); + + return bfd_simple_get_relocated_section_contents (abfd, sectp, buf); +} void _initialize_symfile (void) @@ -3348,4 +3691,19 @@ Usage: set extension-language .foo bar", "cache.\n", &setlist), &showlist); + + debug_file_directory = xstrdup (DEBUGDIR); + c = (add_set_cmd + ("debug-file-directory", class_support, var_string, + (char *) &debug_file_directory, + "Set the directory where separate debug symbols are searched for.\n" + "Separate debug symbols are first searched for in the same\n" + "directory as the binary, then in the `" DEBUG_SUBDIRECTORY + "' subdirectory,\n" + "and lastly at the path of the directory of the binary with\n" + "the global debug-file directory prepended\n", + &setlist)); + add_show_from_set (c, &showlist); + set_cmd_completer (c, filename_completer); + } diff --git a/gdb/symfile.h b/gdb/symfile.h index 62dfcef..2671463 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -1,6 +1,6 @@ /* Definitions for reading symbol files into GDB. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -136,12 +136,12 @@ struct sym_fns /* The default version of sym_fns.sym_offsets for readers that don't do anything special. */ -extern void -default_symfile_offsets (struct objfile *objfile, struct section_addr_info *); +extern void default_symfile_offsets (struct objfile *objfile, + struct section_addr_info *); -extern void -extend_psymbol_list (struct psymbol_allocation_list *, struct objfile *); +extern void extend_psymbol_list (struct psymbol_allocation_list *, + struct objfile *); /* Add any kind of symbol to a psymbol_allocation_list. */ @@ -174,8 +174,10 @@ extern void add_symtab_fns (struct sym_fns *); extern void init_entry_point_info (struct objfile *); -extern void -syms_from_objfile (struct objfile *, struct section_addr_info *, int, int); +extern void syms_from_objfile (struct objfile *, + struct section_addr_info *, + struct section_offsets *, int, + int, int); extern void new_symfile_objfile (struct objfile *, int, int); @@ -192,8 +194,7 @@ build_section_addr_info_from_section_table (const struct section_table *start, /* Free all memory allocated by build_section_addr_info_from_section_table. */ -extern void -free_section_addr_info (struct section_addr_info *); +extern void free_section_addr_info (struct section_addr_info *); extern struct partial_symtab *start_psymtab_common (struct objfile *, @@ -252,7 +253,7 @@ extern struct partial_symtab *allocate_psymtab (char *, struct objfile *); extern void discard_psymtab (struct partial_symtab *); -extern void find_lowest_section (bfd *, asection *, PTR); +extern void find_lowest_section (bfd *, asection *, void *); extern bfd *symfile_bfd_open (char *); @@ -299,6 +300,9 @@ extern void symbol_file_add_main (char *args, int from_tty); /* Clear GDB symbol tables. */ extern void symbol_file_clear (int from_tty); +extern bfd_byte *symfile_relocate_debug_section (bfd *abfd, asection *sectp, + bfd_byte *buf); + /* From dwarfread.c */ extern void diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 87722ba..995372d 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -78,7 +78,7 @@ struct print_symbol_args struct ui_file *outfile; }; -static int print_symbol (PTR); +static int print_symbol (void *); static void free_symtab_block (struct objfile *, struct block *); @@ -98,10 +98,10 @@ free_symtab_block (struct objfile *objfile, struct block *b) { next_sym = sym->hash_next; xmfree (objfile->md, SYMBOL_NAME (sym)); - xmfree (objfile->md, (PTR) sym); + xmfree (objfile->md, sym); } } - xmfree (objfile->md, (PTR) b); + xmfree (objfile->md, b); } /* Free all the storage associated with the struct symtab <- S. @@ -135,7 +135,7 @@ free_symtab (register struct symtab *s) for (i = 0; i < n; i++) free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i)); /* Free the blockvector itself. */ - xmfree (s->objfile->md, (PTR) bv); + xmfree (s->objfile->md, bv); /* Also free the linetable. */ case free_linetable: @@ -143,7 +143,7 @@ free_symtab (register struct symtab *s) or by some other symtab, except for our linetable. Free that now. */ if (LINETABLE (s)) - xmfree (s->objfile->md, (PTR) LINETABLE (s)); + xmfree (s->objfile->md, LINETABLE (s)); break; } @@ -153,12 +153,12 @@ free_symtab (register struct symtab *s) /* Free source-related stuff */ if (s->line_charpos != NULL) - xmfree (s->objfile->md, (PTR) s->line_charpos); + xmfree (s->objfile->md, s->line_charpos); if (s->fullname != NULL) xmfree (s->objfile->md, s->fullname); if (s->debugformat != NULL) xmfree (s->objfile->md, s->debugformat); - xmfree (s->objfile->md, (PTR) s); + xmfree (s->objfile->md, s); } void @@ -368,7 +368,7 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab, " Full symtab was read (at "); gdb_print_host_address (psymtab->symtab, outfile); fprintf_filtered (outfile, " by function at "); - gdb_print_host_address ((PTR) psymtab->read_symtab, outfile); + gdb_print_host_address (psymtab->read_symtab, outfile); fprintf_filtered (outfile, ")\n"); } @@ -565,7 +565,7 @@ Arguments missing: an output file name and an optional symbol file name"); 1 for success. */ static int -print_symbol (PTR args) +print_symbol (void *args) { struct symbol *symbol = ((struct print_symbol_args *) args)->symbol; int depth = ((struct print_symbol_args *) args)->depth; diff --git a/gdb/symtab.c b/gdb/symtab.c index 7eab19f..9d8bdc0 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1,8 +1,8 @@ /* Symbol table lookup for the GNU debugger, GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software - Foundation, Inc. + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -716,11 +716,11 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile) attractive to put in some QUIT's (though I'm not really sure whether it can run long enough to be really important). But there are a few calls for which it would appear to be bad news to quit - out of here: find_proc_desc in alpha-tdep.c and mips-tdep.c, and - nindy_frame_chain_valid in nindy-tdep.c. (Note that there is C++ - code below which can error(), but that probably doesn't affect - these calls since they are looking for a known variable and thus - can probably assume it will never hit the C++ code). */ + out of here: find_proc_desc in alpha-tdep.c and mips-tdep.c. (Note + that there is C++ code below which can error(), but that probably + doesn't affect these calls since they are looking for a known + variable and thus can probably assume it will never hit the C++ + code). */ struct symbol * lookup_symbol (const char *name, const struct block *block, @@ -2012,9 +2012,11 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) the first line, prev will not be set. */ /* Is this file's best line closer than the best in the other files? - If so, record this file, and its best line, as best so far. */ + If so, record this file, and its best line, as best so far. Don't + save prev if it represents the end of a function (i.e. line number + 0) instead of a real line. */ - if (prev && (!best || prev->pc > best->pc)) + if (prev && prev->line && (!best || prev->pc > best->pc)) { best = prev; best_symtab = s; diff --git a/gdb/symtab.h b/gdb/symtab.h index 1d44ace..8d851a2 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1,7 +1,8 @@ /* Symbol table definitions for GDB. - Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. @@ -1073,8 +1074,8 @@ extern struct symbol *find_pc_sect_function (CORE_ADDR, asection *); /* lookup function from address, return name, start addr and end addr */ -extern int -find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, CORE_ADDR *); +extern int find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, + CORE_ADDR *); extern void clear_pc_function_cache (void); @@ -1257,8 +1258,8 @@ extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, asection *, int); extern int find_line_pc (struct symtab *, int, CORE_ADDR *); -extern int -find_line_pc_range (struct symtab_and_line, CORE_ADDR *, CORE_ADDR *); +extern int find_line_pc_range (struct symtab_and_line, CORE_ADDR *, + CORE_ADDR *); extern void resolve_sal_pc (struct symtab_and_line *); diff --git a/gdb/target.c b/gdb/target.c index e19ad6d..683561f 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -82,8 +82,8 @@ static void normal_target_post_startup_inferior (ptid_t ptid); partial transfers, try either target_read_memory_partial or target_write_memory_partial). */ -static int -target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write); +static int target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, + int write); static void init_dummy_target (void); diff --git a/gdb/target.h b/gdb/target.h index 8c6dce1..80e6538 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -488,11 +488,11 @@ extern int child_xfer_memory (CORE_ADDR, char *, int, int, of bytes actually transfered is not defined) and ERR is set to a non-zero error indication. */ -extern int -target_read_memory_partial (CORE_ADDR addr, char *buf, int len, int *err); +extern int target_read_memory_partial (CORE_ADDR addr, char *buf, int len, + int *err); -extern int -target_write_memory_partial (CORE_ADDR addr, char *buf, int len, int *err); +extern int target_write_memory_partial (CORE_ADDR addr, char *buf, int len, + int *err); extern char *child_pid_to_exec_file (int); @@ -1101,8 +1101,8 @@ struct section_table /* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR. Returns 0 if OK, 1 on error. */ -extern int -build_section_table (bfd *, struct section_table **, struct section_table **); +extern int build_section_table (bfd *, struct section_table **, + struct section_table **); /* From mem-break.c */ @@ -1134,8 +1134,8 @@ extern struct target_ops *find_core_target (void); extern struct target_ops *find_target_beneath (struct target_ops *); -extern int -target_resize_to_sections (struct target_ops *target, int num_added); +extern int target_resize_to_sections (struct target_ops *target, + int num_added); extern void remove_target_sections (bfd *abfd); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 992e8e8..82f3843 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,154 @@ +2003-02-02 Andrew Cagney + + 2002-11-10 Jason Molenda (jason-cl@molenda.com): + * gdb.mi/mi-var-child.exp: -var-list-children's CHILDREN field is + now a list, not a tuple. + * gdb.mi/mi-var-display.exp: Ditto. + * gdb.mi/gdb792.exp: Ditto. + +2003-02-01 Andrew Cagney + + From 2002-11-09 Jason Molenda (jason-cl@molenda.com): + * gdb.mi/mi-syn-frame.exp: New tests for synthetic frames in + stack backtraces. + * gdb.mi/mi-syn-frame.c: Part of same. + +2003-02-01 Mark Kettenis + + * gdb.mi/gdb669.exp, gdb.mi/mi-pthreads.exp, + gdb.mi/mi1-pthreads.exp: Return instead of calling + gdb_suppress_entire_file. + +2003-02-01 Mark Salter + + * gdb.asm/arm.inc (gdbasm_startup): Clear frame pointer, not sp. + +2003-01-31 Mark Salter + + * lib/mi-support.exp (mi_gdb_load): Support remote targets. + Support empty arg. + +2003-01-30 Michael Chastain + + * lib/gdb.exp: Revert patch of 2003-01-06, which set LC_ALL. + This was a workaround for a UTF-8 bug in readline 4.3. The bug + has been fixed in gdb/readline on 2003-01-09. + +2003-01-29 Michael Snyder + + * gdb.base/args.exp: Skip if target does not support args passing. + +2003-01-22 Daniel Jacobowitz + + * lib/gdb.exp (gdb_test_multiple): New function, cloned from + gdb_test. Accept a list of expect arguments as the third + parameter. + (gdb_test): Use it. + +2003-01-20 Elena Zannoni + + * gdb.arch/altivec-abi.exp: Set variable 'srcfile' differently, to + allow for different test tree configurations. Update some + tescases accordingly. + * gdb.arch/altivec-regs.exp: Ditto. + * gdb.asm/asm-source.exp: Ditto. + * gdb.base/advance.exp: Ditto. + * gdb.base/display.exp: Ditto. + * gdb.base/long_long.exp: Ditto. + * gdb.base/mips_pro.exp: Ditto. + * gdb.base/overlays.exp: Ditto. + * gdb.base/relocate.exp: Ditto. + * gdb.base/setshow.exp: Ditto. + * gdb.base/step-line.exp: Ditto. + * gdb.base/step-test.exp: Ditto. + * gdb.base/until.exp: Ditto. + * gdb.c++/virtfunc.exp: Get rid of variable 'src'. + +2003-01-17 David Carlton + + * gdb.c++/demangle.exp (test_lucid_style_demangling): KFAIL test + corresponding to PR c++/945. + Update copyright. + +2003-01-17 David Carlton + + * gdb.c++/inherit.exp (test_print_mi_members): KFAIL tests + corresponding to PR c++/68. + +2003-01-17 David Carlton + + * gdb.c++/cplusfuncs.exp (print_addr_2_kfail): New procedure. + (test_paddr_hairy_functions): Call print_addr_2_kfail for + hairyfunc5 through hairyfunc7. KFAIL for PR c++/19. + +2003-01-15 Elena Zannoni + + * gdb.base/break.exp: Fix change of default location, because of + removal of until tests. + * gdb.base/help.exp: Update test for new 'until' help message. + Add test for help on 'advance'. + * gdb.base/args.exp: Fix foobar with GDBFLAGS global. + +2003-01-15 Mark Kettenis + + * gdb.base/default.exp: Adapt "info float" test for recent changes + to that command. Add test for "info vector". + * gdb.base/float.exp: New file. Add test for "info float" that + resembles the old test in gdb.base/default.exp. + +2003-01-15 David Carlton + + * gdb.base/selftest.exp (do_steps_and_nexts): Allow gdb_sysroot. + +2003-01-15 Elena Zannoni + + * gdb.base/break.exp: Move the tests of until command from here... + * gdb.base/until.exp: ... to here. New file. Add other tests. + * gdb.base/advance.c: New file. + * gdb.base/advance.exp: New file. + +2003-01-14 Elena Zannoni + + * gdb.base/args.c: New file. + * gdb.base/args.exp: New file. + +2003-01-14 Daniel Jacobowitz + + * gdb.c++/virtfunc.exp: Remove fixed XFAIL. + +2003-01-14 Daniel Jacobowitz + + * gdb.threads/killed.exp: Use KFAIL for gdb/568. + +2003-01-14 Daniel Jacobowitz + + * gdb.base/constvars.exp: Remove two extra XFAILs. Update copyright + dates. + +2003-01-13 Daniel Jacobowitz + + * gdb.c++/printmethod.exp (print virtual method): Accept "(void)". + +2003-01-13 Daniel Jacobowitz + + * gdb.base/printcmds.exp: Enable setup_kfail for gdb/538 + (ptype &*"foo"). + * gdb.c++/local.exp: Enable setup_kfail for gdb/482. + +2002-01-13 Daniel Jacobowitz + + * gdb.mi/mi-console.exp: Remove extra "(known bug)". + * gdb.mi/mi1-console.exp: Likewise. + +2002-01-13 Daniel Jacobowitz + + * gdb.mi/mi-console.exp: Add KFAIL for "Hello message (known bug)". + * gdb.mi/mi1-console.exp: Likewise. + +2003-01-13 Daniel Jacobowitz + + * gdb.c++/overload.exp: Remove some fixed XFAILs. + 2003-01-09 Daniel Jacobowitz * gdb.base/detach.exp: New test. diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp index 2e4504a..70fc3e0 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.exp +++ b/gdb/testsuite/gdb.arch/altivec-abi.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,10 +39,9 @@ if ![istarget "powerpc-*altivec"] then { set testfile "altivec-abi" set binfile ${objdir}/${subdir}/${testfile} +set srcfile ${testfile}.c -set src1 ${srcdir}/${subdir}/${testfile}.c - -if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } { +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp index 80433bf..fe8ec21 100644 --- a/gdb/testsuite/gdb.arch/altivec-regs.exp +++ b/gdb/testsuite/gdb.arch/altivec-regs.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,9 +39,9 @@ if ![istarget "powerpc-*altivec"] then { set testfile "altivec-regs" set binfile ${objdir}/${subdir}/${testfile} -set src1 ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c -if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } { +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.asm/arm.inc b/gdb/testsuite/gdb.asm/arm.inc index 701ecbf..6550227 100644 --- a/gdb/testsuite/gdb.asm/arm.inc +++ b/gdb/testsuite/gdb.asm/arm.inc @@ -29,6 +29,7 @@ comment "crt0 startup" .macro gdbasm_startup - mov sp, #0 + mov fp, #0 + mov r7, #0 .endm diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index 641a7c1..a42c61a 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 2000, 2002 Free Software Foundation, Inc. +# Copyright 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -99,8 +99,8 @@ if [board_info $dest exists multilib_flags] { set testfile "asm-source" set binfile ${objdir}/${subdir}/${testfile} -set src1 ${srcdir}/${subdir}/asmsrc1.s -set src2 ${srcdir}/${subdir}/asmsrc2.s +set srcfile1 asmsrc1.s +set srcfile2 asmsrc2.s remote_exec build "rm -f ${subdir}/arch.inc" remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc @@ -110,10 +110,10 @@ if { "${asm-flags}" == "" } { set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}" } -if {[target_assemble ${src1} asmsrc1.o "${asm-flags}"] != ""} then { +if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags}"] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if {[target_assemble ${src2} asmsrc2.o "${asm-flags}"] != ""} then { +if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags}"] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/advance.c b/gdb/testsuite/gdb.base/advance.c new file mode 100644 index 0000000..2ae3cc5 --- /dev/null +++ b/gdb/testsuite/gdb.base/advance.c @@ -0,0 +1,45 @@ + +static int x; + +int foo (int a) +{ + int b = a + 10; + return b; +} + +int bar (int y) +{ + int z = y + 20; + return z; +} + +void func() +{ + x = x + 5; + func2 (); +} + +int func2 () +{ + x = 6; +} + +int func3 () +{ + x = 4; +} + +int +main () +{ + int result; + int b, c; + c = 5; + b = 3; /* advance this location */ + + func (c); /* stop here after leaving current frame */ + func3 (); /* break here */ + result = bar (b + foo (c)); + return 0; /* advance malformed */ +} + diff --git a/gdb/testsuite/gdb.base/advance.exp b/gdb/testsuite/gdb.base/advance.exp new file mode 100644 index 0000000..aea5a6d --- /dev/null +++ b/gdb/testsuite/gdb.base/advance.exp @@ -0,0 +1,91 @@ +# Copyright 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# advance.exp -- Expect script to test 'advance' in gdb + +if $tracelevel then { + strace $tracelevel +} + +set testfile advance +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +remote_exec build "rm -f ${binfile}" +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +# Verify that "advance " works. (This is really just syntactic +# sugar for "tbreak ; continue".) +# +gdb_test "advance [gdb_get_line_number "advance this location"]" \ + "main .* at .*:.*b = 3.*advance this location.*" \ + "advance line number" + +# Verify that a malformed "advance" is gracefully caught. +# +gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \ + "Junk at end of arguments." "malformed advance" + +# Verify that "advance " works. +# +gdb_test "advance func" \ + "func.*at.*x = x \\+ 5." \ + "advance func" + +# Verify that "advance " when funcname is NOT called by the current +# frame, stops at the end of the current frame. +# +gdb_test "advance func3" \ + "in main.*func \\(c\\).*stop here after leaving current frame..."\ + "advance function not called by current frame" + +# break at main again +# +gdb_test "break [gdb_get_line_number "break here"]" \ + ".*Breakpoint.* at .*" \ + "set breakpoint at call to func3" +gdb_test "continue" \ + ".*Breakpoint ${decimal}, main.*func3.*break here.*" \ + "continue to call to func3 in main" + +# Verify that "advance " when funcname is called as parameter to +# another function works. +# +gdb_test "advance foo" \ + "foo \\(a=5\\).*int b = a \\+ 10;"\ + "advance function called as param" + +# Verify that we get an error if we use 'advance' w/o argument +# +gdb_test "advance" \ + "Argument required \\(a location\\)."\ + "advance with no argument" + diff --git a/gdb/testsuite/gdb.base/args.c b/gdb/testsuite/gdb.base/args.c new file mode 100644 index 0000000..d564120 --- /dev/null +++ b/gdb/testsuite/gdb.base/args.c @@ -0,0 +1,12 @@ +#include + +int +main (int argc, char **argv) +{ + int i = 0; + printf ("%d\n", argc); + while (i < argc) + printf ("%s\n", argv[i++]); + + return 0; +} diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp new file mode 100644 index 0000000..ff7ccab --- /dev/null +++ b/gdb/testsuite/gdb.base/args.exp @@ -0,0 +1,77 @@ +# Copyright 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# This is a test for the gdb invocation option --args. + +if $tracelevel then { + strace $tracelevel +} + + +global GDBFLAGS + +# Skip test if target does not support argument passing. +if [target_info exists noargs] { + return; +} + +set testfile "args" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +# +# Test that the --args are processed correctly. +# +set old_gdbflags $GDBFLAGS +set GDBFLAGS "--args $binfile 1 3" +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_test "run" \ + "Starting program.*args 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally." \ + "correct args printed" + +# +# Test that the --args are processed correctly even if one of them is empty. +# +set GDBFLAGS "--args $binfile 1 '' 3" +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_test "run" \ + "Starting program.*args 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally." \ + "correct args printed, one empty" + +# +# try with 2 empty args +# +set GDBFLAGS "--args $binfile 1 '' '' 3" +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_test "run" \ + "Starting program.*args 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally." \ + "correct args printed, two empty" + +set GDBFLAGS $old_gdbflags + diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index e3aa922..fbc0e11 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -1,5 +1,5 @@ # Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2002 +# 2000, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -154,6 +154,7 @@ if {$hp_aCC_compiler} { } else { set proto "" } + gdb_test "info break" \ "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.* @@ -166,7 +167,6 @@ gdb_test "info break" \ \[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:124" \ "breakpoint info" - # FIXME: The rest of this test doesn't work with anything that can't # handle arguments. # Huh? There doesn't *appear* to be anything that passes arguments @@ -363,29 +363,6 @@ gdb_expect { timeout {fail "(timeout) $name"} } -# Verify that "until " works. (This is really just syntactic -# sugar for "tbreak ; continue".) -# -send_gdb "until 79\n" -gdb_expect { - -re "main .* at .*:79.*$gdb_prompt $"\ - {pass "until 79"} - -re "$gdb_prompt $"\ - {fail "until 79"} - timeout {fail "(timeout) until 79"} -} - -# Verify that a malformed "until" is gracefully caught. -# -send_gdb "until 80 then stop\n" -gdb_expect { - -re "Junk at end of arguments..*$gdb_prompt $"\ - {pass "malformed until"} - -re "$gdb_prompt $"\ - {fail "malformed until"} - timeout {fail "(timeout) malformed until"} -} - # Verify that GDB responds gracefully when asked to set a breakpoint # on a nonexistent source line. # @@ -398,6 +375,12 @@ gdb_expect { timeout {fail "(timeout) break on non-existent source line"} } +# Run to the desired default location. If not positioned here, the +# tests below don't work. +# +gdb_test "until 79" "main .* at .*:79.*" "until 79" + + # Verify that GDB allows one to just say "break", which is treated # as the "default" breakpoint. Note that GDB gets cute when printing # the informational message about other breakpoints at the same diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp index 897a025..d58b9b6 100644 --- a/gdb/testsuite/gdb.base/constvars.exp +++ b/gdb/testsuite/gdb.base/constvars.exp @@ -1,4 +1,5 @@ -# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -146,12 +147,10 @@ proc do_constvar_tests {} { gdb_test "print lax" " = 20" gdb_test "ptype lax" "type = short.*" gdb_test "print lecherous" " = 30" - local_compiler_xfail_check gdb_test "ptype lecherous" "type = (unsigned short|short unsigned)( int)?" gdb_test "print lechery" " = 40" gdb_test "ptype lechery" "type = long.*" gdb_test "print lectern" " = 50" - local_compiler_xfail_check gdb_test "ptype lectern" "type = (unsigned long|long unsigned)( int)?" gdb_test "print leeway" " = 60" gdb_test "ptype leeway" "type = float" diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 3fc6f0d..7e3ed44 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -1,5 +1,5 @@ # Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 +# 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -320,15 +320,7 @@ gdb_test "info frame" "No stack.|No selected frame." "info frame" #test info files gdb_test "info files" "" "info files" #test info float -if { [istarget "arm*-*-*"] || \ - [istarget "xscale*-*-*"] || \ - [istarget "strongarm*-*-*"] } then { - gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float" -} elseif [istarget "i\[3456\]86-*-*"] then { - gdb_test "info float" "R7:.*Status Word:.*Opcode:.*" "info float" -} else { - gdb_test "info float" "No floating.point info available for this processor." "info float" -} +gdb_test "info float" "The program has no registers now." "info float" #test info functions gdb_test "info functions" "All defined functions:" "info functions" #test info locals @@ -359,6 +351,8 @@ gdb_test "info terminal" "No saved terminal information." "info terminal" gdb_test "info types" "All defined types:" "info types" #test info variables gdb_test "info variables" "All defined variables:" "info variables" +#test info vector +gdb_test "info vector" "The program has no registers now." "info vector" #test info warranty gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty" #test info watchpoints diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index e285729..c39ee36 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 1999, 2000 +# Copyright 1997, 1998, 1999, 2000, 2001, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -26,12 +26,12 @@ if $tracelevel then { } set testfile display -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } if [target_info exists gdb_stub] { diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp new file mode 100644 index 0000000..66943ef --- /dev/null +++ b/gdb/testsuite/gdb.base/float.exp @@ -0,0 +1,62 @@ +# Copyright 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@gnu.org + +# This file is part of the gdb testsuite. + +if $tracelevel { + strace $tracelevel +} + +# +# Test floating-point related functionality. +# + +set prms_id 0 +set bug_id 0 + +set testfile "run" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +# Set it up at a breakpoint so we have its registers. + +if ![runto_main] then { + perror "couldn't run to breakpoint" + continue +} + +# Test "info float". + +if { [istarget "arm*-*-*"] || \ + [istarget "xscale*-*-*"] || \ + [istarget "strongarm*-*-*"] } then { + gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float" +} elseif [istarget "i?86-*-*"] then { + gdb_test "info float" "R7:.*Status Word:.*Opcode:.*" "info float" +} else { + gdb_test "info float" "No floating.point info available for this processor." "info float" +} diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp index 50da677..69cf40d 100644 --- a/gdb/testsuite/gdb.base/help.exp +++ b/gdb/testsuite/gdb.base/help.exp @@ -36,6 +36,8 @@ gdb_test "set height 400" "" "test set height" # use a larger expect input buffer for long help outputs. # test help add-symbol-file gdb_test "help add-symbol-file" "Usage: add-symbol-file FILE ADDR \\\[-s -s \.\.\.\\\]\[\r\n\]+Load the symbols from FILE, assuming FILE has been dynamically loaded\.\[\r\n\]+ADDR is the starting address of the file's text\.\[\r\n\]+The optional arguments are section-name section-address pairs and\[\r\n\]+should be specified if the data and bss segments are not contiguous\[\r\n\]+with the text\. SECT is a section name to be loaded at SECT_ADDR\." "help add-symbol-file" +# test help advance +gdb_test "help advance" "Continue the program up to the given location \\(same form as args for break command\\)\.\[\r\n]+Execution will also stop upon exit from the current stack frame\." "help advance" # test help aliases gdb_test "help aliases" "Aliases of other commands\.\[\r\n\]+List of commands\:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help aliases" # test help append @@ -562,9 +564,9 @@ gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak" # test help tty gdb_test "help tty" "Set terminal for future runs of program being debugged\." "help tty" # test help until "u" abbreviation -gdb_test "help u" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until \"u\" abbreviation" +gdb_test "help u" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified location \\(same args as break command\\) within the current frame\." "help until \"u\" abbreviation" # test help until -gdb_test "help until" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until" +gdb_test "help until" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified location \\(same args as break command\\) within the current frame\." "help until" # test help undisplay gdb_test "help undisplay" "Cancel some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means cancel all automatic-display expressions\.\[\r\n\]+\"delete display\" has the same effect as this command\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help undisplay" # test help unset environment diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp index 55086d7..11308db 100644 --- a/gdb/testsuite/gdb.base/long_long.exp +++ b/gdb/testsuite/gdb.base/long_long.exp @@ -1,4 +1,5 @@ -# Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +31,7 @@ if [target_info exists no_long_long] { } set testfile long_long -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} # What compiler are we using? @@ -45,7 +46,7 @@ if {$hp_cc_compiler} { set flag "" } -if { [gdb_compile "${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/mips_pro.exp b/gdb/testsuite/gdb.base/mips_pro.exp index 1697eee..a860e63 100644 --- a/gdb/testsuite/gdb.base/mips_pro.exp +++ b/gdb/testsuite/gdb.base/mips_pro.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1999 Free Software Foundation, Inc. +# Copyright 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ set prms_id 0 set bug_id 0 set testfile mips_pro -set srcfile ${srcdir}/$subdir/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} # Create and source the file that provides information about the compiler @@ -38,11 +38,11 @@ if [get_compiler_info ${binfile}] { # This test must be compiled with -O2 if using gcc. if {$gcc_compiled} then { - if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } { + if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } } else { - if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } { + if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } } diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp index c31da4e..37bfbaa 100644 --- a/gdb/testsuite/gdb.base/overlays.exp +++ b/gdb/testsuite/gdb.base/overlays.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1998, 2001, 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,29 +41,25 @@ if [istarget "d10v-*-*"] then { set testfile "overlays" set binfile ${objdir}/${subdir}/${testfile} -set srcfile ${srcdir}/${subdir}/${testfile}.c -set foo ${srcdir}/${subdir}/foo.c -set bar ${srcdir}/${subdir}/bar.c -set baz ${srcdir}/${subdir}/baz.c -set grbx ${srcdir}/${subdir}/grbx.c +set srcfile ${testfile}.c -if {[gdb_compile "${srcfile}" "${testfile}.o" object {debug}] != ""} then { +if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if {[gdb_compile "${foo}" foo.o object {debug} ] != ""} then { +if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if {[gdb_compile "${bar}" bar.o object {debug}] != ""} then { +if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if {[gdb_compile "${baz}" baz.o object {debug}] != ""} then { +if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if {[gdb_compile "${grbx}" grbx.o object {debug}] != ""} then { +if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } { diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index b0232dd..8f3ba89 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002 Free +# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -627,7 +627,7 @@ proc test_print_string_constants {} { gdb_test "p *\"foo\"" " = 102 'f'" gdb_test "ptype *\"foo\"" " = char" gdb_test "p &*\"foo\"" " = \"foo\"" - # setup_kfail "gdb/538" + setup_kfail "gdb/538" *-*-* gdb_test "ptype &*\"foo\"" "type = char \\*" gdb_test "p (char *)\"foo\"" " = \"foo\"" } diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp index c4e25de..bcaa48a 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,11 +25,11 @@ if $tracelevel then { } set testfile relocate -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile}.o remote_exec build "rm -f ${binfile}" -if { [gdb_compile "${srcfile}" "${binfile}" object {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp index bf71c49..5d9419e 100644 --- a/gdb/testsuite/gdb.base/selftest.exp +++ b/gdb/testsuite/gdb.base/selftest.exp @@ -170,6 +170,12 @@ proc do_steps_and_nexts {} { set description "step over current_directory initialization" set command "step" } + -re ".*gdb_sysroot = .*$gdb_prompt $" { + # NOTE: carlton/2003-01-15: More optimization reordering, + # observed on GCC 3.1. + set description "step over gdb_sysroot initialization" + set command "step" + } -re "\[ \t\]+\{\r\n$gdb_prompt $" { setup_xfail "mips-*-irix5*" fail "$description ended up at odd location" diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index a1070fd..a406824 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -1,4 +1,5 @@ -# Copyright 1992, 1994, 1996, 1997, 1998 Free Software Foundation, Inc. +# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,9 +28,9 @@ set prms_id 0 set bug_id 0 set testfile "setshow" -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile ${srcfile} ${binfile} executable {debug}] != "" } { +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/step-line.exp b/gdb/testsuite/gdb.base/step-line.exp index cac3128..9754fdd 100644 --- a/gdb/testsuite/gdb.base/step-line.exp +++ b/gdb/testsuite/gdb.base/step-line.exp @@ -1,4 +1,4 @@ -# Copyright 2001 Free Software Foundation, Inc. +# Copyright 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,11 +28,11 @@ if $tracelevel then { } set testfile step-line -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} remote_exec build "rm -f ${binfile}" -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp index 32af949..7a6bd19 100644 --- a/gdb/testsuite/gdb.base/step-test.exp +++ b/gdb/testsuite/gdb.base/step-test.exp @@ -1,4 +1,5 @@ -# Copyright 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2000, 2002, 2001, 2003 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,11 +29,11 @@ if $tracelevel then { } set testfile step-test -set srcfile ${srcdir}/${subdir}/${testfile}.c +set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} remote_exec build "rm -f ${binfile}" -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/until.exp b/gdb/testsuite/gdb.base/until.exp new file mode 100644 index 0000000..8159332 --- /dev/null +++ b/gdb/testsuite/gdb.base/until.exp @@ -0,0 +1,81 @@ +# Copyright 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# until.exp -- Expect script to test 'until' in gdb + +if $tracelevel then { + strace $tracelevel +} + +set testfile break +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +remote_exec build "rm -f ${binfile}" +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +# Verify that "until " works. (This is really just syntactic +# sugar for "tbreak ; continue".) +# +gdb_test "until 79" \ + "main .* at .*:79.*" \ + "until line number" + +# Verify that a malformed "advance" is gracefully caught. +# +gdb_test "until 80 then stop" \ + "Junk at end of arguments." "malformed until" + +# Rerun up to factorial, outer invocation +if { ![runto factorial] } then { gdb_suppress_tests; } +delete_breakpoints + +# At this point, 'until' should continue the inferior up to when all the +# inner invocations of factorial() are completed and we are back at this +# frame. +# +gdb_test "until 99" \ + "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \ + "until factorial, recursive function" + +# Run to a function called by main +# +if { ![runto marker2] } then { gdb_suppress_tests; } +delete_breakpoints + +# Now issue an until with another function, not called by the current +# frame, as argument. This should not work, i.e. the program should +# stop at main, the caller, where we put the 'guard' breakpoint. +# +gdb_test "until marker3" \ + "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \ + "until func, not called by current frame" + diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp index 9057cc2..6f92817 100644 --- a/gdb/testsuite/gdb.c++/cplusfuncs.exp +++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1997, 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1992, 1997, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -269,7 +269,9 @@ proc info_func { name demangled } { # Print the address of a function. # This checks that I can lookup a fully qualified C++ function. # This also checks the argument types on the return string. -# + +# Note: carlton/2003-01-16: If you modify this, make a corresponding +# modification to print_addr_2_kfail. proc print_addr_2 { name good } { global gdb_prompt @@ -291,6 +293,37 @@ proc print_addr_2 { name good } { } } +# NOTE: carlton/2003-01-16: hairyfunc5-6 fail on GCC 3.x (for at least +# x=1 and x=2.1). So I'm modifying print_addr_2 to accept a failure +# condition. FIXME: It would be nice if the failure condition were +# conditional on the compiler version, but I'm not sufficiently +# motivated. I did hardwire in the versions of char * and int *, +# which will give some compiler-specificity to the failure. + +proc print_addr_2_kfail { name good bad bugid } { + global gdb_prompt + global hex + + set good_pattern [string_to_regexp $good] + set bad_pattern [string_to_regexp $bad] + + send_gdb "print &'$name'\n" + gdb_expect { + -re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" { + pass "print &'$name'" + } + -re ".* = .* $hex <$bad_pattern>\r\n$gdb_prompt $" { + kfail $bugid "print &'$name'" + } + -re ".*$gdb_prompt $" { + fail "print &'$name'" + } + timeout { + fail "print &'$name' (timeout)" + } + } +} + # # Simple interfaces to print_addr_2. # @@ -490,9 +523,9 @@ proc test_paddr_hairy_functions {} { # gdb-gnats bug gdb/19: # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7" - print_addr_2 "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))" - print_addr_2 "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))" - print_addr_2 "hairyfunc7" "hairyfunc7(int (*(*)(int (*)($dm_type_char_star)))(long))" + print_addr_2_kfail "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))" "hairyfunc5(int (*)(long) (*)(char*))" "gdb/19" + print_addr_2_kfail "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))" "hairyfunc6(int (*)(long) (*)(int*))" "gdb/19" + print_addr_2_kfail "hairyfunc7" "hairyfunc7(int (*(*)(int (*)($dm_type_char_star)))(long))" "hairyfunc7(int (*)(long) (*)(int (*)(char*)))" "gdb/19" } proc do_tests {} { diff --git a/gdb/testsuite/gdb.c++/demangle.exp b/gdb/testsuite/gdb.c++/demangle.exp index 45a89bd..7bd9fc5 100644 --- a/gdb/testsuite/gdb.c++/demangle.exp +++ b/gdb/testsuite/gdb.c++/demangle.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1992, 1997, 1999 Free Software Foundation, Inc. +# Copyright (C) 1992, 1997, 1999, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -694,7 +694,10 @@ proc test_lucid_style_demangling {} { # GDB 930701 gets into an infinite loop. # GDB 930727 says "Can't demangle". # What is the correct demangling? FIXME. - setup_xfail "*-*-*" + + # NOTE: carlton/2003-01-17: No, don't FIXME, just obsolete lucid. + # I'm KFAILing this rather than deleting it for form's sake. + setup_kfail "gdb/945" "*-*-*" test_demangling_exact "lucid: __vtbl__3foo__vt_cc_main_" "" test_demangling_exact "lucid: abs__F7complex" "abs(complex)" diff --git a/gdb/testsuite/gdb.c++/inherit.exp b/gdb/testsuite/gdb.c++/inherit.exp index 286c27b..66c2a52 100644 --- a/gdb/testsuite/gdb.c++/inherit.exp +++ b/gdb/testsuite/gdb.c++/inherit.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -349,7 +349,6 @@ proc test_print_mi_members {} { # For now, accept gdb's behavior as an expected failure if it # simply prints either member correctly. - if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "print g_D.A::a\n" gdb_expect { -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 15$nl$gdb_prompt $" { @@ -359,10 +358,10 @@ proc test_print_mi_members {} { pass "print g_D.A::a (using B)" } -re ".* = 15$nl$gdb_prompt $" { - fail "print g_D.A::a (FIXME)" + kfail "gdb/68" "print g_D.A::a" } -re ".* = 11$nl$gdb_prompt $" { - fail "print g_D.A::a (FIXME)" + kfail "gdb/68" "print g_D.A::a" } -re ".*$gdb_prompt $" { fail "print g_D.A::a" } timeout { fail "print g_D.A::a (timeout)" ; return } @@ -372,7 +371,6 @@ proc test_print_mi_members {} { # For now, accept gdb's behavior as an expected failure if it # simply prints either member correctly. - if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "print g_D.A::x\n" gdb_expect { -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 16$nl$gdb_prompt $" { @@ -382,10 +380,10 @@ proc test_print_mi_members {} { pass "print g_D.A::x (using B)" } -re ".* = 16$nl$gdb_prompt $" { - fail "print g_D.A::x (FIXME)" + kfail "gdb/68" "print g_D.A::x" } -re ".* = 12$nl$gdb_prompt $" { - fail "print g_D.A::x (FIXME)" + kfail "gdb/68" "print g_D.A::x" } -re ".*$gdb_prompt $" { fail "print g_D.A::x" } timeout { fail "print g_D.A::x (timeout)" ; return } @@ -411,14 +409,13 @@ proc test_print_mi_members {} { # For now, accept gdb's behavior as an expected failure if it # simply prints either member correctly. - setup_xfail "*-*-*" send_gdb "print g_E.A::a\n" gdb_expect { -re ".* = 21$nl$gdb_prompt $" { - fail "print g_E.A::a (FIXME)" + kfail "gdb/68" "print g_E.A::a" } -re ".* = 25$nl$gdb_prompt $" { - fail "print g_E.A::a (FIXME)" + kfail "gdb/68" "print g_E.A::a" } -re ".*$gdb_prompt $" { fail "print g_E.A::a" } timeout { fail "print g_E.A::a (timeout)" ; return } @@ -428,7 +425,6 @@ proc test_print_mi_members {} { # For now, accept gdb's behavior as an expected failure if it # simply prints either member correctly. - if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "print g_E.A::x\n" gdb_expect { -re "warning: A ambiguous; using E::D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 26$nl$gdb_prompt $" { @@ -438,10 +434,10 @@ proc test_print_mi_members {} { pass "print g_E.A::x (using B)" } -re ".* = 26$nl$gdb_prompt $" { - fail "print g_E.A::x (FIXME)" + kfail "gdb/68" "print g_E.A::x" } -re ".* = 22$nl$gdb_prompt $" { - fail "print g_E.A::x (FIXME)" + kfail "gdb/68" "print g_E.A::x" } -re ".*$gdb_prompt $" { fail "print g_E.A::x" } timeout { fail "print g_E.A::x (timeout)" ; return } diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp index 3ec2d5e..971567d 100644 --- a/gdb/testsuite/gdb.c++/local.exp +++ b/gdb/testsuite/gdb.c++/local.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -190,8 +190,8 @@ gdb_expect { -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" } -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" } -re "There is no field named NestedInnerLocal.*$gdb_prompt $" { - # setup_kfail "gdb/482" - fail "ptype InnerLocal::NestedInnerLocal (gdb/482)" + setup_kfail "gdb/482" *-*-* + fail "ptype InnerLocal::NestedInnerLocal" } -re "No symbol .*NestedInnerLocal.* in current context.*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal (bogus symbol lookup)" } -re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" } diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp index e9aaae0..7bfae10 100644 --- a/gdb/testsuite/gdb.c++/overload.exp +++ b/gdb/testsuite/gdb.c++/overload.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -260,13 +260,6 @@ gdb_expect { } -# The overload resolver added by HP (valops.c:find_overload_match) doesn't -# work right for G++ output, since the list of parameters seems not to -# be filled in correctly. Until this gets fixed, don't expect to pass -# some of these tests. - -setup_xfail "*-*-*" CLLbs16901 - send_gdb "print foo_instance1.overload1arg((short)arg5)\n" gdb_expect { -re ".\[0-9\]* = 5\r\n$gdb_prompt $" { @@ -277,8 +270,6 @@ gdb_expect { } -setup_xfail "*-*-*" CLLbs16901 - send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n" gdb_expect { -re ".\[0-9\]* = 6\r\n$gdb_prompt $" { @@ -309,8 +300,6 @@ gdb_expect { } -setup_xfail "*-*-*" CLLbs16901 - send_gdb "print foo_instance1.overload1arg((long)arg9)\n" gdb_expect { -re ".\[0-9\]* = 9\r\n$gdb_prompt $" { @@ -321,8 +310,6 @@ gdb_expect { } -setup_xfail "*-*-*" CLLbs16901 - send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n" gdb_expect { -re ".\[0-9\]* = 10\r\n$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.c++/printmethod.exp b/gdb/testsuite/gdb.c++/printmethod.exp index 9b96cbf..a45393f 100644 --- a/gdb/testsuite/gdb.c++/printmethod.exp +++ b/gdb/testsuite/gdb.c++/printmethod.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ gdb_continue_to_breakpoint "end of constructors" # The first of these is for PR gdb/653. -gdb_test "print theA->virt" "\\$\[0-9\]* = &A::virt\\(\\)" "print virtual method." +gdb_test "print theA->virt" "\\$\[0-9\]* = &A::virt\\((void|)\\)" "print virtual method." gdb_test "print theA->nonvirt" "Cannot take address of a method" "print nonvirtual method." gdb_exit diff --git a/gdb/testsuite/gdb.c++/virtfunc.exp b/gdb/testsuite/gdb.c++/virtfunc.exp index e2befd3..2741cf6 100644 --- a/gdb/testsuite/gdb.c++/virtfunc.exp +++ b/gdb/testsuite/gdb.c++/virtfunc.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 +# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -39,8 +39,7 @@ if [get_compiler_info ${binfile} "c++"] { source ${binfile}.ci -set src "${srcdir}/${subdir}/${srcfile}" -if { [gdb_compile "${src}" "${binfile}" executable {c++ debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } @@ -836,12 +835,6 @@ proc test_virtual_calls {} { eof { fail "print pVB->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return } } - # fails on target=native, host=i686-pc-linux-gnu%rh-7.2, - # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gdwarf-2. - # -- chastain 2002-02-20 - - if {$gcc_compiled} then { setup_xfail "*-*-*" } - send_gdb "print pBe->vvb()\n" gdb_expect { -re ".* = 411$nl$gdb_prompt $" { pass "print pBe->vvb()" } diff --git a/gdb/testsuite/gdb.mi/gdb669.exp b/gdb/testsuite/gdb.mi/gdb669.exp index 1a78d07..d03ce35 100644 --- a/gdb/testsuite/gdb.mi/gdb669.exp +++ b/gdb/testsuite/gdb.mi/gdb669.exp @@ -179,10 +179,8 @@ set srcfile "$testfile.c" set binfile "$objdir/$subdir/$testfile" set options [list debug incdir=$objdir] -if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] - != "" } { - gdb_suppress_entire_file \ - "Testcase compile failed, so all tests in this file will automatically fail." +if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { + return -1 } mi_gdb_reinitialize_dir $srcdir/$subdir diff --git a/gdb/testsuite/gdb.mi/gdb792.exp b/gdb/testsuite/gdb.mi/gdb792.exp index ce5ac31..3fc6df0 100644 --- a/gdb/testsuite/gdb.mi/gdb792.exp +++ b/gdb/testsuite/gdb.mi/gdb792.exp @@ -51,31 +51,31 @@ mi_gdb_test "-var-create - * a" \ "create var for class A" mi_gdb_test "-var-list-children var1" \ - "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\{child=\{name=\"var1\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.private\",exp=\"private\",numchild=\"2\"\},child=\{name=\"var1\.protected\",exp=\"protected\",numchild=\"2\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\\\[child=\{name=\"var1\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.private\",exp=\"private\",numchild=\"2\"\},child=\{name=\"var1\.protected\",exp=\"protected\",numchild=\"2\"\}\\\]" \ "list children of class A" mi_gdb_test "-var-list-children var1.public" \ - "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.public\.x\",exp=\"x\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.public\.buffer\",exp=\"buffer\",numchild=\"10\",type=\"char \\\[10\\\]\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.public\.x\",exp=\"x\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.public\.buffer\",exp=\"buffer\",numchild=\"10\",type=\"char \\\[10\\\]\"\}\\\]" \ "list children of A.public" mi_gdb_test "-var-list-children var1.private" \ - "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.private\.u\",exp=\"u\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.private\.z\",exp=\"z\",numchild=\"0\",type=\"float\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.private\.u\",exp=\"u\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.private\.z\",exp=\"z\",numchild=\"0\",type=\"float\"\}\\\]" \ "list children of A.private" mi_gdb_test "-var-list-children var1.protected" \ - "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.y\",exp=\"y\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\",exp=\"b\",numchild=\"2\",type=\"B\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.y\",exp=\"y\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\",exp=\"b\",numchild=\"2\",type=\"B\"\}\\\]" \ "list children of A.protected" mi_gdb_test "-var-list-children var1.protected.b" \ - "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.b\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.protected\.b\.private\",exp=\"private\",numchild=\"1\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.b\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.protected\.b\.private\",exp=\"private\",numchild=\"1\"\}\\\]" \ "list children of A.protected.b" mi_gdb_test "-var-list-children var1.protected.b.public" \ - "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.b\.public\.bx\",exp=\"bx\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\.public\.by\",exp=\"by\",numchild=\"0\",type=\"int\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.b\.public\.bx\",exp=\"bx\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\.public\.by\",exp=\"by\",numchild=\"0\",type=\"int\"\}\\\]" \ "list children of A.protected.b.public" mi_gdb_test "-var-list-children var1.protected.b.private" \ - "(&\".*\"\r\n)*\\^done,numchild=\"1\",children=\{child=\{name=\"var1\.protected\.b\.private\.k\",exp=\"k\",numchild=\"0\",type=\"int\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"1\",children=\\\[child=\{name=\"var1\.protected\.b\.private\.k\",exp=\"k\",numchild=\"0\",type=\"int\"\}\\\]" \ "list children of A.protected.b.private" mi_gdb_test "-var-create - * c" \ @@ -83,7 +83,7 @@ mi_gdb_test "-var-create - * c" \ "create var for class C which has baseclass A" mi_gdb_test "-var-list-children var2" \ - "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\{child=\{name=\"var2\.A\",exp=\"A\",numchild=\"3\",type=\"A\"\},child=\{name=\"var2\.public\",exp=\"public\",numchild=\"1\"\},child=\{name=\"var2\.private\",exp=\"private\",numchild=\"1\"\}\}" \ + "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\\\[child=\{name=\"var2\.A\",exp=\"A\",numchild=\"3\",type=\"A\"\},child=\{name=\"var2\.public\",exp=\"public\",numchild=\"1\"\},child=\{name=\"var2\.private\",exp=\"private\",numchild=\"1\"\}\\\]" \ "list children of class C" mi_gdb_exit diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp index f611aa7..0fb85e0 100644 --- a/gdb/testsuite/gdb.mi/mi-console.exp +++ b/gdb/testsuite/gdb.mi/mi-console.exp @@ -77,7 +77,7 @@ gdb_expect { # multiple event sources to channel the output back through the # MI. - fail "Hello message (known bug)" + kfail "gdb/623" "Hello message" } timeout { fail "Hello message (timeout)" diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp index f2839c2..532134a 100644 --- a/gdb/testsuite/gdb.mi/mi-pthreads.exp +++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp @@ -208,10 +208,8 @@ set srcfile "$testfile.c" set binfile "$objdir/$subdir/$testfile" set options [list debug incdir=$objdir] -if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] - != "" } { - gdb_suppress_entire_file \ - "Testcase compile failed, so all tests in this file will automatically fail." +if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { + return -1 } mi_gdb_reinitialize_dir $srcdir/$subdir diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c new file mode 100644 index 0000000..83d2d46 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c @@ -0,0 +1,61 @@ +#include +#include +#include + +void foo (void); +void bar (void); + +void subroutine (int); +void handler (int); +void have_a_very_merry_interrupt (void); + +main () +{ + puts ("Starting up"); + + foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */ + + + have_a_very_merry_interrupt (); + + puts ("Shutting down"); +} + +void +foo (void) +{ + puts ("hi in foo"); +} + +void +bar (void) +{ + char *nuller = 0; + + puts ("hi in bar"); + + *nuller = 'a'; /* try to cause a segfault */ +} + +void +handler (int sig) +{ + subroutine (sig); +} + +void +subroutine (int in) +{ + while (in < 100) + in++; +} + +void +have_a_very_merry_interrupt (void) +{ + puts ("Waiting to get a signal"); + signal (SIGALRM, handler); + alarm (1); + sleep (2); /* We'll receive that signal while sleeping */ +} + diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp new file mode 100644 index 0000000..49f9772 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp @@ -0,0 +1,106 @@ +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# Test MI output with synthetic frames on the stack (call dummies, +# signal handlers). + +load_lib mi-support.exp +set MIFLAGS "-i=mi" + +set testfile "mi-syn-frame" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*" + +mi_gdb_exit +mi_gdb_start +mi_delete_breakpoints +mi_gdb_reinitialize_dir $srcdir/$subdir +mi_gdb_load ${binfile} +mi_run_to_main + +mi_gdb_test "400-break-insert foo" "400\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" + + +# +# Call foo() by hand, where we'll hit a breakpoint. +# + +mi_gdb_test "401-data-evaluate-expression foo()" "\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(foo\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.*\"" "call inferior's function with a breakpoint set in it" + +mi_gdb_test "402-stack-list-frames" "402\\^done,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" "backtrace from inferior function stopped at bp, showing gdb dummy frame" + +# +# Continue back to main() +# + +send_gdb "403-exec-continue\n" +gdb_expect { + -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" { + pass "403-exec-continue" + } + timeout { + fail "403-exec-continue" + } +} + +mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" + + +# +# Call have_a_very_merry_interrupt() which will eventually raise a signal +# that's caught by handler() which calls subroutine(). + +mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" + +mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" + +# We should have both a signal handler and a call dummy frame +# in this next output. + +mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" + + +send_gdb "408-exec-continue\n" +gdb_expect { + -re "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" { + pass "408-exec-continue" + } + timeout { + fail "408-exec-continue" + } +} + +mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" + +# +# Call bar() by hand, which should get an exception while running. +# + +mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception" + +mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception" + +mi_gdb_exit + +return 0 diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp index af058d5..15e3f79 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp @@ -62,7 +62,7 @@ mi_gdb_test "-var-create struct_declarations * struct_declarations" \ # STABS doesn't give us argument types for the func ptr structs, but # Dwarf 2 does. mi_gdb_test "-var-list-children struct_declarations" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \ "get children of struct_declarations" #gdbtk_test c_variable-4.3 {children of struct_declarations} { @@ -102,7 +102,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.character" \ # Test: c_variable-4.9 # Desc: children of struct_declarations.char_ptr mi_gdb_test "-var-list-children struct_declarations.char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of struct_declarations.char_ptr" # Test: c_variable-4.10 @@ -126,7 +126,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.long_int" \ # Test: c_variable-4.13 # Desc: children of int_ptr_ptr mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \ "get children of struct_declarations.int_ptr_ptr" #gdbtk_test c_variable-4.13 {children of int_ptr_ptr} { @@ -143,7 +143,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \ # Test: c_variable-4.15 # Desc: children of struct_declarations.long_array mi_gdb_test "-var-list-children struct_declarations.long_array" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of struct_declarations.long_array" # Test: c_variable-4.16 @@ -195,7 +195,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \ # Test: c_variable-4.23 # Desc: children of struct_declarations.u1 mi_gdb_test "-var-list-children struct_declarations.u1" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\\\]" \ "get children of struct_declarations.u1" # Test: c_variable-4.24 @@ -207,7 +207,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1" \ # Test: c_variable-4.25 # Desc: children of struct_declarations.s2 mi_gdb_test "-var-list-children struct_declarations.s2" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\\\]" \ "get children of struct_declarations.s2" #gdbtk_test c_variable-4.25 {children of struct_declarations.s2} { # get_children struct_declarations.s2 @@ -344,7 +344,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \ # Test: c_variable-4.47 # Desc: children of struct_declarations.u1.b mi_gdb_test "-var-list-children struct_declarations.u1.b" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of struct_declarations.u1.b" # Test: c_variable-4.48 @@ -382,7 +382,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \ # Test: c_variable-4.53 # Desc: children of struct_declarations.s2.u2 mi_gdb_test "-var-list-children struct_declarations.s2.u2" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"3\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \ "get children of struct_declarations.s2.u2" # Test: c_variable-4.54 @@ -420,7 +420,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \ # Test: c_variable-4.59 # Desc: children of struct_declarations.s2.i mi_gdb_test "-var-list-children struct_declarations.s2.i" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of struct_declarations.s2.i" # Test: c_variable-4.60 @@ -432,7 +432,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \ # Test: c_variable-4.61 # Desc: children of struct_declarations.s2.u2.u1s1 mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\\\]" \ "get children of struct_declarations.s2.u2.u1s1" # Test: c_variable-4.62 @@ -456,7 +456,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \ # Test: c_variable-4.65 # Desc: children of struct_declarations.s2.u2.u1s2 mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\}" \ + "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\\\]" \ "get children of struct_declarations.s2.u2.u1s2" # Test: c_variable-4.66 @@ -480,7 +480,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \ # Test: c_variable-4.69 # Desc: children of struct_declarations.s2.u2.u1s1.e mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of struct_declarations.s2.u2.u1s1.e" # Test: c_variable-4.70 @@ -519,7 +519,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \ # Test: c_variable-4.75 # Desc: children of struct_declarations.s2.u2.u1s2.array_ptr mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of struct_declarations.s2.u2.u1s2.array_ptr" # Test: c_variable-4.76 @@ -543,7 +543,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \ # Test: c_variable-4.79 # Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \ "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr" #} {**int_ptr_ptr} @@ -567,7 +567,7 @@ mi_gdb_test "-var-create weird * weird" \ # Test: c_variable-4.82 # Desc: children of weird mi_gdb_test "-var-list-children weird" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \ "get children of weird" # Test: c_variable-4.83 @@ -580,7 +580,7 @@ mi_gdb_test "-var-info-num-children weird" \ # Test: c_variable-4.84 # Desc: children of weird->long_array mi_gdb_test "-var-list-children weird.long_array" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"10\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of weird.long_array" #gdbtk_test c_variable-4.84 {children of weird->long_array} { # get_children weird.long_array @@ -595,7 +595,7 @@ mi_gdb_test "-var-info-num-children weird.long_array" \ # Test: c_variable-4.86 # Desc: children of weird.int_ptr_ptr mi_gdb_test "-var-list-children weird.int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \ "get children of weird.int_ptr_ptr" #gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} { # get_children weird.int_ptr_ptr @@ -610,7 +610,7 @@ mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \ # Test: c_variable-4.88 # Desc: children of *weird->int_ptr_ptr mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \ "get children of weird.int_ptr_ptr.*int_ptr_ptr" #gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} { # get_children weird.int_ptr_ptr.*int_ptr_ptr @@ -631,7 +631,7 @@ mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \ # Test: c_variable-4.91 # Desc: children of weird->int_ptr_ptr mi_gdb_test "-var-list-children weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \ "get children of weird->int_ptr_ptr" @@ -644,7 +644,7 @@ mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \ # Test: c_variable-4.93 # Desc: children of *(weird->int_ptr_ptr) mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr" # Test: c_variable-4.94 @@ -868,7 +868,7 @@ mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \ # Test: c_variable-5.11 # Desc: children of psnp->char_ptr mi_gdb_test "-var-list-children psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \ "get children of psnp->char_ptr" # Test: c_variable-5.12 @@ -880,7 +880,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr" \ # Test: c_variable-5.13 # Desc: children of *(psnp->char_ptr) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr" # Test: c_variable-5.14 @@ -892,13 +892,13 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \ # Test: c_variable-5.15 # Desc: children of *(*(psnp->char_ptr)) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" # Test: c_variable-5.15B # Desc: children of *(*(*(psnp->char_ptr))) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" # Test: c_variable-5.16 @@ -910,7 +910,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ # Test: c_variable-5.17 # Desc: children of *(*(*(psnp->char_ptr))) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" # Test: c_variable-5.18 @@ -941,7 +941,7 @@ mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \ # Test: c_variable-5.20 # Desc: children of psnp->long_ptr mi_gdb_test "-var-list-children psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\\\]" \ "get children of psnp->long_ptr" # Test: c_variable-5.21 @@ -953,7 +953,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr" \ # Test: c_variable-5.22 # Desc: children of *(psnp->long_ptr) mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\\\]" \ "get children of psnp->long_ptr.*psnp->long_ptr" @@ -966,7 +966,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \ # Test: c_variable-5.24 # Desc: children of *(*(psnp->long_ptr)) mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\\\]" \ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" # Test: c_variable-5.25 @@ -978,7 +978,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ # Test: c_variable-5.26 # Desc: children of *(*(*(psnp->long_ptr))) mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" # Test: c_variable-5.27 @@ -1008,7 +1008,7 @@ mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \ # Test: c_variable-5.31 # Desc: children of psnp->ptrs mi_gdb_test "-var-list-children psnp->ptrs" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ + "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \ "get children of psnp->ptrs" # Test: c_variable-5.32 @@ -1020,7 +1020,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs" \ # Test: c_variable-5.33 # Desc: children of psnp->ptrs[0] mi_gdb_test "-var-list-children psnp->ptrs.0" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \ "get children of psnp->ptrs.0" # Test: c_variable-5.34 @@ -1032,7 +1032,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0" \ # Test: c_variable-5.35 # Desc: children of psnp->ptrs[0]->next mi_gdb_test "-var-list-children psnp->ptrs.0.next" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \ "get children of psnp->ptrs.0.next" #} {char_ptr long_ptr ptrs next} @@ -1047,7 +1047,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \ # Test: c_variable-5.37 # Desc: children of psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \ "get children of psnp->ptrs.0.next.char_ptr" #gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} { @@ -1063,7 +1063,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \ # Test: c_variable-5.39 # Desc: children of *psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr" # Test: c_variable-5.40 @@ -1075,13 +1075,13 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ # Test: c_variable-5.41 # Desc: children of **psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" # Test: c_variable-5.41B # Desc: children of ***psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" # Test: c_variable-5.42 @@ -1093,7 +1093,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ # Test: c_variable-5.43 # Desc: children of ***psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" # Test: c_variable-5.44 @@ -1117,13 +1117,13 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ # Test: c_variable-5.45 # Desc: children of psnp->ptrs[0]->next->next mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ + "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \ "get children of psnp->ptrs.0.next.next" # Test: c_variable-5.46 # Desc: children of psnp->ptrs[0]->next->next->ptrs mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ + "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \ "get children of psnp->ptrs.0.next.next.ptrs" # Step over "snp0.char_ptr = &b3;" diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index 82ce1f8..fafa79a 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -183,7 +183,7 @@ mi_gdb_test "-var-create weird * weird" \ "create local variable weird" mi_gdb_test "-var-list-children weird" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \ "get children local variable weird" @@ -371,7 +371,7 @@ mi_gdb_test "-var-info-num-children u" \ # Test: c_variable-7.15 # Desc: children of u mi_gdb_test "-var-list-children u" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ + "\\^done,numchild=\"2\",children=\\\[child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \ "get children of u" # Test: c_variable-7.20 @@ -407,7 +407,7 @@ mi_gdb_test "-var-info-num-children anonu" \ # Test: c_variable-7.25 # Desc: children of anonu mi_gdb_test "-var-list-children anonu" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of anonu" # Test: c_variable-7.30 @@ -444,7 +444,7 @@ mi_gdb_test "-var-info-num-children s" \ # Test: c_variable-7.35 # Desc: children of s mi_gdb_test "-var-list-children s" \ - "\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \ + "\\^done,numchild=\"6\",children=\\\[child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\\\]" \ "get children of s" #} {integer unsigned_integer character signed_character char_ptr array_of_10} @@ -481,7 +481,7 @@ mi_gdb_test "-var-info-num-children anons" \ # Test: c_variable-7.45 # Desc: children of anons mi_gdb_test "-var-list-children anons" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \ + "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \ "get children of anons" diff --git a/gdb/testsuite/gdb.mi/mi1-console.exp b/gdb/testsuite/gdb.mi/mi1-console.exp index 25af50a..ab7f5ac 100644 --- a/gdb/testsuite/gdb.mi/mi1-console.exp +++ b/gdb/testsuite/gdb.mi/mi1-console.exp @@ -77,7 +77,7 @@ gdb_expect { # multiple event sources to channel the output back through the # MI. - fail "Hello message (known bug)" + kfail "gdb/623" "Hello message" } timeout { fail "Hello message (timeout)" diff --git a/gdb/testsuite/gdb.mi/mi1-pthreads.exp b/gdb/testsuite/gdb.mi/mi1-pthreads.exp index 480f057..f84f1fe 100644 --- a/gdb/testsuite/gdb.mi/mi1-pthreads.exp +++ b/gdb/testsuite/gdb.mi/mi1-pthreads.exp @@ -208,10 +208,8 @@ set srcfile "$testfile.c" set binfile "$objdir/$subdir/$testfile" set options [list debug incdir=$objdir] -if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] - != "" } { - gdb_suppress_entire_file \ - "Testcase compile failed, so all tests in this file will automatically fail." +if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { + return -1 } mi_gdb_reinitialize_dir $srcdir/$subdir diff --git a/gdb/testsuite/gdb.threads/killed.exp b/gdb/testsuite/gdb.threads/killed.exp index 5557d45..2e61e7c 100644 --- a/gdb/testsuite/gdb.threads/killed.exp +++ b/gdb/testsuite/gdb.threads/killed.exp @@ -88,8 +88,7 @@ gdb_expect { pass "GDB exits after multi-threaded program exits messily" } -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" { - # setup_kfail "gdb/568" - fail "GDB exits after multi-threaded program exits messily (not a regression; gdb/568)" + kfail "gdb/568" "GDB exits after multi-threaded program exits messily" } timeout { fail "GDB exits after multi-threaded program exits messily (timeout)" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f1cd16b..dca41dc 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -64,9 +64,6 @@ if ![info exists env(EXEEXT)] { set EXEEXT $env(EXEEXT) } -# Make sure we are using the C locale. -set env(LC_ALL) "C" - ### Only procedures should come after this point. # @@ -364,50 +361,93 @@ proc gdb_continue_to_breakpoint {name} { -# gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE +# gdb_test_multiple COMMAND MESSAGE EXPECT_ARGUMENTS # Send a command to gdb; test the result. # # COMMAND is the command to execute, send to GDB with send_gdb. If # this is the null string no command is sent. -# PATTERN is the pattern to match for a PASS, and must NOT include -# the \r\n sequence immediately before the gdb prompt. -# MESSAGE is an optional message to be printed. If this is -# omitted, then the pass/fail messages use the command string as the -# message. (If this is the empty string, then sometimes we don't -# call pass or fail at all; I don't understand this at all.) -# QUESTION is a question GDB may ask in response to COMMAND, like -# "are you sure?" -# RESPONSE is the response to send if QUESTION appears. +# MESSAGE is a message to be printed with the built-in failure patterns +# if one of them matches. If MESSAGE is empty COMMAND will be used. +# EXPECT_ARGUMENTS will be fed to expect in addition to the standard +# patterns. Pattern elements will be evaluated in the caller's +# context; action elements will be executed in the caller's context. +# Unlike patterns for gdb_test, these patterns should generally include +# the final newline and prompt. # # Returns: -# 1 if the test failed, -# 0 if the test passes, +# 1 if the test failed, according to a built-in failure pattern +# 0 if only user-supplied patterns matched # -1 if there was an internal error. # -proc gdb_test { args } { +proc gdb_test_multiple { command message user_code } { global verbose global gdb_prompt global GDB upvar timeout timeout - if [llength $args]>2 then { - set message [lindex $args 2] - } else { - set message [lindex $args 0] + if { $message == "" } { + set message $command } - set command [lindex $args 0] - set pattern [lindex $args 1] - if [llength $args]==5 { - set question_string [lindex $args 3]; - set response_string [lindex $args 4]; - } else { - set question_string "^FOOBAR$" - } + # TCL/EXPECT WART ALERT + # Expect does something very strange when it receives a single braced + # argument. It splits it along word separators and performs substitutions. + # This means that { "[ab]" } is evaluated as "[ab]", but { "\[ab\]" } is + # evaluated as "\[ab\]". But that's not how TCL normally works; inside a + # double-quoted list item, "\[ab\]" is just a long way of representing + # "[ab]", because the backslashes will be removed by lindex. + + # Unfortunately, there appears to be no easy way to duplicate the splitting + # that expect will do from within TCL. And many places make use of the + # "\[0-9\]" construct, so we need to support that; and some places make use + # of the "[func]" construct, so we need to support that too. In order to + # get this right we have to substitute quoted list elements differently + # from braced list elements. + + # We do this roughly the same way that Expect does it. We have to use two + # lists, because if we leave unquoted newlines in the argument to uplevel + # they'll be treated as command separators, and if we escape newlines + # we mangle newlines inside of command blocks. This assumes that the + # input doesn't contain a pattern which contains actual embedded newlines + # at this point! + + regsub -all {\n} ${user_code} { } subst_code + set subst_code [uplevel list $subst_code] + + set processed_code "" + set patterns "" + set expecting_action 0 + foreach item $user_code subst_item $subst_code { + if { $item == "-n" || $item == "-notransfer" || $item == "-nocase" } { + lappend processed_code $item + continue + } + if {$item == "-indices" || $item == "-re" || $item == "-ex"} { + lappend processed_code $item + continue + } + if { $expecting_action } { + lappend processed_code "uplevel [list $item]" + set expecting_action 0 + # Cosmetic, no effect on the list. + append processed_code "\n" + continue + } + set expecting_action 1 + lappend processed_code $subst_item + if {$patterns != ""} { + append patterns "; " + } + append patterns "\"$subst_item\"" + } + + # Also purely cosmetic. + regsub -all {\r} $patterns {\\r} patterns + regsub -all {\n} $patterns {\\n} patterns if $verbose>2 then { send_user "Sending \"$command\" to gdb\n" - send_user "Looking to match \"$pattern\"\n" + send_user "Looking to match \"$patterns\"\n" send_user "Message is \"$message\"\n" } @@ -469,13 +509,14 @@ proc gdb_test { args } { } } } - gdb_expect $tmt { + + set code { -re "\\*\\*\\* DOSEXIT code.*" { if { $message != "" } { fail "$message"; } gdb_suppress_entire_file "GDB died"; - return -1; + set result -1; } -re "Ending remote debugging.*$gdb_prompt $" { if ![isnative] then { @@ -485,16 +526,9 @@ proc gdb_test { args } { gdb_start set result -1 } - -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" { - if ![string match "" $message] then { - pass "$message" - } - set result 0 - } - -re "(${question_string})$" { - send_gdb "$response_string\n"; - exp_continue; - } + } + append code $processed_code + append code { -re "Undefined\[a-z\]* command:.*$gdb_prompt $" { perror "Undefined command \"$command\"." fail "$message" @@ -512,7 +546,7 @@ proc gdb_test { args } { set errmsg "$command: the program exited" } fail "$errmsg" - return -1 + set result -1 } -re "EXIT code \[0-9\r\n\]+Program exited normally.*$gdb_prompt $" { if ![string match "" $message] then { @@ -521,7 +555,7 @@ proc gdb_test { args } { set errmsg "$command: the program exited" } fail "$errmsg" - return -1 + set result -1 } -re "The program is not being run.*$gdb_prompt $" { if ![string match "" $message] then { @@ -530,7 +564,7 @@ proc gdb_test { args } { set errmsg "$command: the program is no longer running" } fail "$errmsg" - return -1 + set result -1 } -re ".*$gdb_prompt $" { if ![string match "" $message] then { @@ -542,11 +576,13 @@ proc gdb_test { args } { send_gdb "\n" perror "Window too small." fail "$message" + set result -1 } -re "\\(y or n\\) " { send_gdb "n\n" perror "Got interactive prompt." fail "$message" + set result -1 } eof { perror "Process no longer exists" @@ -558,6 +594,7 @@ proc gdb_test { args } { full_buffer { perror "internal buffer is full." fail "$message" + set result -1 } timeout { if ![string match "" $message] then { @@ -566,8 +603,65 @@ proc gdb_test { args } { set result 1 } } + + set result 0 + gdb_expect $tmt $code return $result } + +# gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE +# Send a command to gdb; test the result. +# +# COMMAND is the command to execute, send to GDB with send_gdb. If +# this is the null string no command is sent. +# PATTERN is the pattern to match for a PASS, and must NOT include +# the \r\n sequence immediately before the gdb prompt. +# MESSAGE is an optional message to be printed. If this is +# omitted, then the pass/fail messages use the command string as the +# message. (If this is the empty string, then sometimes we don't +# call pass or fail at all; I don't understand this at all.) +# QUESTION is a question GDB may ask in response to COMMAND, like +# "are you sure?" +# RESPONSE is the response to send if QUESTION appears. +# +# Returns: +# 1 if the test failed, +# 0 if the test passes, +# -1 if there was an internal error. +# +proc gdb_test { args } { + global verbose + global gdb_prompt + global GDB + upvar timeout timeout + + if [llength $args]>2 then { + set message [lindex $args 2] + } else { + set message [lindex $args 0] + } + set command [lindex $args 0] + set pattern [lindex $args 1] + + if [llength $args]==5 { + set question_string [lindex $args 3]; + set response_string [lindex $args 4]; + } else { + set question_string "^FOOBAR$" + } + + return [gdb_test_multiple $command $message { + -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" { + if ![string match "" $message] then { + pass "$message" + } + } + -re "(${question_string})$" { + send_gdb "$response_string\n"; + exp_continue; + } + }] +} # Test that a command gives an error. For pass or fail, return # a 1 to indicate that more tests can proceed. However a timeout diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 399aac6..4b057d4 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -291,8 +291,15 @@ proc mi_gdb_load { arg } { global loadfile global GDB global mi_gdb_prompt + global last_mi_gdb_file upvar timeout timeout + if { $arg == "" } { + set arg $last_mi_gdb_file; + } + + set last_mi_gdb_file $arg; + # ``gdb_unload'' # ``gdb_file_cmd'' @@ -388,6 +395,26 @@ proc mi_gdb_load { arg } { return -1 } } + } elseif { [target_info gdb_protocol] == "remote" } { + # remote targets + send_gdb "target [target_info gdb_protocol] [target_info netport]\n" + gdb_expect 60 { + -re "\\^done,.*$mi_gdb_prompt$" { + } + timeout { + perror "Unable to connect to remote target" + return -1 + } + } + send_gdb "48-target-download\n" + gdb_expect 10 { + -re "48\\^done.*$mi_gdb_prompt$" { + } + timeout { + perror "Unable to download to remote target" + return -1 + } + } } return 0 } diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 9f4cde7..808c295 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -1,5 +1,6 @@ /* libthread_db assisted debugging support, generic parts. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -126,6 +127,8 @@ static CORE_ADDR td_death_bp_addr; /* Prototypes for local functions. */ static void thread_db_find_new_threads (void); +static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, + const td_thrinfo_t *ti_p, int verbose); /* Building process ids. */ @@ -141,10 +144,17 @@ static void thread_db_find_new_threads (void); #define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid) +/* Use "struct private_thread_info" to cache thread state. This is + a substantial optimization. */ + struct private_thread_info { - /* Cached LWP id. Must come first, see lin-lwp.c. */ - lwpid_t lwpid; + /* Cached thread state. */ + unsigned int th_valid : 1; + unsigned int ti_valid : 1; + + td_thrhandle_t th; + td_thrinfo_t ti; }; @@ -228,15 +238,100 @@ thread_db_state_str (td_thr_state_e state) } } +/* A callback function for td_ta_thr_iter, which we use to map all + threads to LWPs. + + THP is a handle to the current thread; if INFOP is not NULL, the + struct thread_info associated with this thread is returned in + *INFOP. */ + +static int +thread_get_info_callback (const td_thrhandle_t *thp, void *infop) +{ + td_thrinfo_t ti; + td_err_e err; + struct thread_info *thread_info; + ptid_t thread_ptid; + + err = td_thr_get_info_p (thp, &ti); + if (err != TD_OK) + error ("thread_get_info_callback: cannot get thread info: %s", + thread_db_err_str (err)); + + /* Fill the cache. */ + thread_ptid = BUILD_THREAD (ti.ti_tid, GET_PID (inferior_ptid)); + thread_info = find_thread_pid (thread_ptid); + + if (thread_info == NULL) + { + /* New thread. Attach to it now (why wait?). */ + attach_thread (thread_ptid, thp, &ti, 1); + thread_info = find_thread_pid (thread_ptid); + gdb_assert (thread_info != NULL); + } + + memcpy (&thread_info->private->th, thp, sizeof (*thp)); + thread_info->private->th_valid = 1; + memcpy (&thread_info->private->ti, &ti, sizeof (ti)); + thread_info->private->ti_valid = 1; + + if (infop != NULL) + *(struct thread_info **) infop = thread_info; + + return 0; +} +/* Accessor functions for the thread_db information, with caching. */ + +static void +thread_db_map_id2thr (struct thread_info *thread_info, int fatal) +{ + td_err_e err; + + if (thread_info->private->th_valid) + return; + + err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (thread_info->ptid), + &thread_info->private->th); + if (err != TD_OK) + { + if (fatal) + error ("Cannot find thread %ld: %s", + (long) GET_THREAD (thread_info->ptid), thread_db_err_str (err)); + } + else + thread_info->private->th_valid = 1; +} + +static td_thrinfo_t * +thread_db_get_info (struct thread_info *thread_info) +{ + td_err_e err; + + if (thread_info->private->ti_valid) + return &thread_info->private->ti; + + if (! thread_info->private->th_valid) + thread_db_map_id2thr (thread_info, 1); + + err = td_thr_get_info_p (&thread_info->private->th, &thread_info->private->ti); + if (err != TD_OK) + error ("thread_db_get_info: cannot get thread info: %s", + thread_db_err_str (err)); + + thread_info->private->ti_valid = 1; + return &thread_info->private->ti; +} + /* Convert between user-level thread ids and LWP ids. */ static ptid_t thread_from_lwp (ptid_t ptid) { - td_thrinfo_t ti; td_thrhandle_t th; td_err_e err; + struct thread_info *thread_info; + ptid_t thread_ptid; if (GET_LWP (ptid) == 0) ptid = BUILD_LWP (GET_PID (ptid), GET_PID (ptid)); @@ -248,35 +343,26 @@ thread_from_lwp (ptid_t ptid) error ("Cannot find user-level thread for LWP %ld: %s", GET_LWP (ptid), thread_db_err_str (err)); - err = td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - error ("thread_from_lwp: cannot get thread info: %s", - thread_db_err_str (err)); + thread_info = NULL; + thread_get_info_callback (&th, &thread_info); + gdb_assert (thread_info && thread_info->private->ti_valid); - return BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); + return BUILD_THREAD (thread_info->private->ti.ti_tid, GET_PID (ptid)); } static ptid_t lwp_from_thread (ptid_t ptid) { - td_thrinfo_t ti; - td_thrhandle_t th; - td_err_e err; + struct thread_info *thread_info; + ptid_t thread_ptid; if (!is_thread (ptid)) return ptid; - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th); - if (err != TD_OK) - error ("Cannot find thread %ld: %s", - (long) GET_THREAD (ptid), thread_db_err_str (err)); - - err = td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - error ("lwp_from_thread: cannot get thread info: %s", - thread_db_err_str (err)); + thread_info = find_thread_pid (ptid); + thread_db_get_info (thread_info); - return BUILD_LWP (ti.ti_lid, GET_PID (ptid)); + return BUILD_LWP (thread_info->private->ti.ti_lid, GET_PID (ptid)); } @@ -581,13 +667,13 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, check_thread_signals (); - if (verbose) - printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid)); - /* Add the thread to GDB's thread list. */ tp = add_thread (ptid); tp->private = xmalloc (sizeof (struct private_thread_info)); - tp->private->lwpid = ti_p->ti_lid; + memset (tp->private, 0, sizeof (struct private_thread_info)); + + if (verbose) + printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid)); if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE) return; /* A zombie thread -- do not attach. */ @@ -644,6 +730,19 @@ thread_db_detach (char *args, int from_tty) target_beneath->to_detach (args, from_tty); } +static int +clear_lwpid_callback (struct thread_info *thread, void *dummy) +{ + /* If we know that our thread implementation is 1-to-1, we could save + a certain amount of information; it's not clear how much, so we + are always conservative. */ + + thread->private->th_valid = 0; + thread->private->ti_valid = 0; + + return 0; +} + static void thread_db_resume (ptid_t ptid, int step, enum target_signal signo) { @@ -654,6 +753,9 @@ thread_db_resume (ptid_t ptid, int step, enum target_signal signo) else if (is_thread (ptid)) ptid = lwp_from_thread (ptid); + /* Clear cached data which may not be valid after the resume. */ + iterate_over_threads (clear_lwpid_callback, NULL); + target_beneath->to_resume (ptid, step, signo); do_cleanups (old_chain); @@ -787,7 +889,7 @@ thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, static void thread_db_fetch_registers (int regno) { - td_thrhandle_t th; + struct thread_info *thread_info; prgregset_t gregset; gdb_prfpregset_t fpregset; td_err_e err; @@ -799,17 +901,15 @@ thread_db_fetch_registers (int regno) return; } - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th); - if (err != TD_OK) - error ("Cannot find thread %ld: %s", - (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); + thread_info = find_thread_pid (inferior_ptid); + thread_db_map_id2thr (thread_info, 1); - err = td_thr_getgregs_p (&th, gregset); + err = td_thr_getgregs_p (&thread_info->private->th, gregset); if (err != TD_OK) error ("Cannot fetch general-purpose registers for thread %ld: %s", (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); - err = td_thr_getfpregs_p (&th, &fpregset); + err = td_thr_getfpregs_p (&thread_info->private->th, &fpregset); if (err != TD_OK) error ("Cannot get floating-point registers for thread %ld: %s", (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); @@ -824,10 +924,10 @@ thread_db_fetch_registers (int regno) static void thread_db_store_registers (int regno) { - td_thrhandle_t th; prgregset_t gregset; gdb_prfpregset_t fpregset; td_err_e err; + struct thread_info *thread_info; if (!is_thread (inferior_ptid)) { @@ -836,14 +936,12 @@ thread_db_store_registers (int regno) return; } - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th); - if (err != TD_OK) - error ("Cannot find thread %ld: %s", - (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); + thread_info = find_thread_pid (inferior_ptid); + thread_db_map_id2thr (thread_info, 1); if (regno != -1) { - char raw[MAX_REGISTER_RAW_SIZE]; + char *raw = alloca (max_register_size (current_gdbarch)); deprecated_read_register_gen (regno, raw); thread_db_fetch_registers (-1); @@ -853,11 +951,11 @@ thread_db_store_registers (int regno) fill_gregset ((gdb_gregset_t *) gregset, -1); fill_fpregset (&fpregset, -1); - err = td_thr_setgregs_p (&th, gregset); + err = td_thr_setgregs_p (&thread_info->private->th, gregset); if (err != TD_OK) error ("Cannot store general-purpose registers for thread %ld: %s", (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); - err = td_thr_setfpregs_p (&th, &fpregset); + err = td_thr_setfpregs_p (&thread_info->private->th, &fpregset); if (err != TD_OK) error ("Cannot store floating-point registers for thread %ld: %s", (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); @@ -915,24 +1013,31 @@ static int thread_db_thread_alive (ptid_t ptid) { td_thrhandle_t th; - td_thrinfo_t ti; td_err_e err; if (is_thread (ptid)) { - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th); - if (err != TD_OK) - return 0; + struct thread_info *thread_info; + thread_info = find_thread_pid (ptid); - err = td_thr_validate_p (&th); - if (err != TD_OK) + thread_db_map_id2thr (thread_info, 0); + if (! thread_info->private->th_valid) return 0; - err = td_thr_get_info_p (&th, &ti); + err = td_thr_validate_p (&thread_info->private->th); if (err != TD_OK) return 0; - if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) + if (! thread_info->private->ti_valid) + { + err = td_thr_get_info_p (&thread_info->private->th, &thread_info->private->ti); + if (err != TD_OK) + return 0; + thread_info->private->ti_valid = 1; + } + + if (thread_info->private->ti.ti_state == TD_THR_UNKNOWN + || thread_info->private->ti.ti_state == TD_THR_ZOMBIE) return 0; /* A zombie thread. */ return 1; @@ -986,29 +1091,29 @@ thread_db_pid_to_str (ptid_t ptid) if (is_thread (ptid)) { static char buf[64]; - td_thrhandle_t th; - td_thrinfo_t ti; + td_thrinfo_t *ti_p; td_err_e err; + struct thread_info *thread_info; - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th); - if (err != TD_OK) - error ("Cannot find thread %ld: %s", - (long) GET_THREAD (ptid), thread_db_err_str (err)); + thread_info = find_thread_pid (ptid); + thread_db_map_id2thr (thread_info, 0); + if (! thread_info->private->th_valid) + { + snprintf (buf, sizeof (buf), "Thread %ld (Missing)", GET_THREAD (ptid)); + return buf; + } - err = td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - error ("thread_db_pid_to_str: cannot get thread info for %ld: %s", - (long) GET_THREAD (ptid), thread_db_err_str (err)); + ti_p = thread_db_get_info (thread_info); - if (ti.ti_state == TD_THR_ACTIVE && ti.ti_lid != 0) + if (ti_p->ti_state == TD_THR_ACTIVE && ti_p->ti_lid != 0) { snprintf (buf, sizeof (buf), "Thread %ld (LWP %d)", - (long) ti.ti_tid, ti.ti_lid); + (long) ti_p->ti_tid, ti_p->ti_lid); } else { snprintf (buf, sizeof (buf), "Thread %ld (%s)", - (long) ti.ti_tid, thread_db_state_str (ti.ti_state)); + (long) ti_p->ti_tid, thread_db_state_str (ti_p->ti_state)); } return buf; @@ -1031,9 +1136,9 @@ thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile, { int objfile_is_library = (objfile->flags & OBJF_SHARED); td_err_e err; - td_thrhandle_t th; void *address; CORE_ADDR lm; + struct thread_info *thread_info; /* glibc doesn't provide the needed interface. */ if (! td_thr_tls_get_addr_p) @@ -1054,13 +1159,12 @@ thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile, } /* Get info about the thread. */ - err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th); - if (err != TD_OK) - error ("Cannot find thread %ld: %s", - (long) GET_THREAD (ptid), thread_db_err_str (err)); - + thread_info = find_thread_pid (ptid); + thread_db_map_id2thr (thread_info, 1); + /* Finally, get the address of the variable. */ - err = td_thr_tls_get_addr_p (&th, (void *) lm, offset, &address); + err = td_thr_tls_get_addr_p (&thread_info->private->th, (void *) lm, + offset, &address); #ifdef THREAD_DB_HAS_TD_NOTALLOC /* The memory hasn't been allocated, yet. */ diff --git a/gdb/thread.c b/gdb/thread.c index 6ef4840..f36def1 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1,7 +1,7 @@ /* Multi-process/thread control for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. @@ -457,7 +457,7 @@ info_threads_command (char *arg, int from_tty) switch_to_thread (tp->ptid); if (deprecated_selected_frame) - print_only_stack_frame (deprecated_selected_frame, -1, 0); + print_stack_frame (deprecated_selected_frame, -1, 0); else printf_filtered ("[No stack.]\n"); } diff --git a/gdb/top.c b/gdb/top.c index d25bc3b..dcffb05 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1,7 +1,7 @@ /* Top level stuff for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -1357,7 +1357,7 @@ print_gdb_version (struct ui_file *stream) /* Second line is a copyright notice. */ - fprintf_filtered (stream, "Copyright 2002 Free Software Foundation, Inc.\n"); + fprintf_filtered (stream, "Copyright 2003 Free Software Foundation, Inc.\n"); /* Following the copyright is a brief statement that the program is free software, that users are free to copy and change it on diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 43f20ea..8e517a0 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -1,6 +1,7 @@ /* Language independent support for printing types for GDB, the GNU debugger. - Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999, - 2000, 2001 Free Software Foundation, Inc. + + Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/utils.c b/gdb/utils.c index bb695d5..0e92b21 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1,7 +1,8 @@ /* General utility routines for GDB, the GNU debugger. + Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. @@ -47,7 +48,7 @@ #include "annotate.h" #include "filenames.h" -#include "inferior.h" /* for signed_pointer_to_address */ +#include "inferior.h" /* for signed_pointer_to_address */ #include /* For MAXPATHLEN */ @@ -65,10 +66,10 @@ #endif #ifdef NEED_DECLARATION_MALLOC -extern PTR malloc (); +extern PTR malloc (); /* OK: PTR */ #endif #ifdef NEED_DECLARATION_REALLOC -extern PTR realloc (); +extern PTR realloc (); /* OK: PTR */ #endif #ifdef NEED_DECLARATION_FREE extern void free (); @@ -113,7 +114,7 @@ static struct cleanup *final_cleanup_chain; /* cleaned up when gdb exits */ static struct cleanup *run_cleanup_chain; /* cleaned up on each 'run' */ static struct cleanup *exec_cleanup_chain; /* cleaned up on each execution command */ /* cleaned up on each error from within an execution command */ -static struct cleanup *exec_error_cleanup_chain; +static struct cleanup *exec_error_cleanup_chain; /* Pointer to what is left to do for an execution command after the target stops. Used only in asynchronous mode, by targets that @@ -267,7 +268,7 @@ make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function, void *arg) { register struct cleanup *new - = (struct cleanup *) xmalloc (sizeof (struct cleanup)); + = (struct cleanup *) xmalloc (sizeof (struct cleanup)); register struct cleanup *old_chain = *pmy_chain; new->next = *pmy_chain; @@ -441,7 +442,8 @@ add_continuation (void (*continuation_hook) (struct continuation_arg *), { struct continuation *continuation_ptr; - continuation_ptr = (struct continuation *) xmalloc (sizeof (struct continuation)); + continuation_ptr = + (struct continuation *) xmalloc (sizeof (struct continuation)); continuation_ptr->continuation_hook = continuation_hook; continuation_ptr->arg_list = arg_list; continuation_ptr->next = cmd_continuation; @@ -471,12 +473,12 @@ do_all_continuations (void) /* Work now on the list we have set aside. */ while (continuation_ptr) - { - (continuation_ptr->continuation_hook) (continuation_ptr->arg_list); - saved_continuation = continuation_ptr; - continuation_ptr = continuation_ptr->next; - xfree (saved_continuation); - } + { + (continuation_ptr->continuation_hook) (continuation_ptr->arg_list); + saved_continuation = continuation_ptr; + continuation_ptr = continuation_ptr->next; + xfree (saved_continuation); + } } /* Walk down the cmd_continuation list, and get rid of all the @@ -503,7 +505,8 @@ add_intermediate_continuation (void (*continuation_hook) { struct continuation *continuation_ptr; - continuation_ptr = (struct continuation *) xmalloc (sizeof (struct continuation)); + continuation_ptr = + (struct continuation *) xmalloc (sizeof (struct continuation)); continuation_ptr->continuation_hook = continuation_hook; continuation_ptr->arg_list = arg_list; continuation_ptr->next = intermediate_continuation; @@ -533,12 +536,12 @@ do_all_intermediate_continuations (void) /* Work now on the list we have set aside. */ while (continuation_ptr) - { - (continuation_ptr->continuation_hook) (continuation_ptr->arg_list); - saved_continuation = continuation_ptr; - continuation_ptr = continuation_ptr->next; - xfree (saved_continuation); - } + { + (continuation_ptr->continuation_hook) (continuation_ptr->arg_list); + saved_continuation = continuation_ptr; + continuation_ptr = continuation_ptr->next; + xfree (saved_continuation); + } } /* Walk down the cmd_continuation list, and get rid of all the @@ -555,9 +558,9 @@ discard_all_intermediate_continuations (void) xfree (continuation_ptr); } } - + /* Print a warning message. The first argument STRING is the warning message, used as an fprintf format string, the second is the va_list of arguments for that string. A warning is unfiltered (not @@ -589,7 +592,7 @@ vwarning (const char *string, va_list args) does not force the return to command level. */ void -warning (const char *string,...) +warning (const char *string, ...) { va_list args; va_start (args, string); @@ -611,7 +614,7 @@ verror (const char *string, va_list args) } NORETURN void -error (const char *string,...) +error (const char *string, ...) { va_list args; va_start (args, string); @@ -656,7 +659,7 @@ error_last_message (void) long len; return ui_file_xstrdup (gdb_lasterr, &len); } - + /* This is to be called by main() at the very beginning */ void @@ -684,8 +687,7 @@ struct internal_problem static void internal_vproblem (struct internal_problem *problem, -const char *file, int line, - const char *fmt, va_list ap) + const char *file, int line, const char *fmt, va_list ap) { static char msg[] = "Recursive internal problem.\n"; static int dejavu; @@ -701,7 +703,7 @@ const char *file, int line, case 1: dejavu = 2; fputs_unfiltered (msg, gdb_stderr); - abort (); /* NOTE: GDB has only three calls to abort(). */ + abort (); /* NOTE: GDB has only three calls to abort(). */ default: dejavu = 3; write (STDERR_FILENO, msg, sizeof (msg)); @@ -728,8 +730,8 @@ debugging may prove unreliable.\n"); { case AUTO_BOOLEAN_AUTO: /* Default (yes/batch case) is to quit GDB. When in batch mode - this lessens the likelhood of GDB going into an infinate - loop. */ + this lessens the likelhood of GDB going into an infinate + loop. */ quit_p = query ("Quit this debugging session? "); break; case AUTO_BOOLEAN_TRUE: @@ -746,8 +748,8 @@ debugging may prove unreliable.\n"); { case AUTO_BOOLEAN_AUTO: /* Default (yes/batch case) is to dump core. This leaves a GDB - `dropping' so that it is easier to see that something went - wrong in GDB. */ + `dropping' so that it is easier to see that something went + wrong in GDB. */ dump_core_p = query ("Create a core file of GDB? "); break; break; @@ -764,7 +766,7 @@ debugging may prove unreliable.\n"); if (quit_p) { if (dump_core_p) - abort (); /* NOTE: GDB has only three calls to abort(). */ + abort (); /* NOTE: GDB has only three calls to abort(). */ else exit (1); } @@ -773,7 +775,7 @@ debugging may prove unreliable.\n"); if (dump_core_p) { if (fork () == 0) - abort (); /* NOTE: GDB has only three calls to abort(). */ + abort (); /* NOTE: GDB has only three calls to abort(). */ } } @@ -785,8 +787,7 @@ static struct internal_problem internal_error_problem = { }; NORETURN void -internal_verror (const char *file, int line, - const char *fmt, va_list ap) +internal_verror (const char *file, int line, const char *fmt, va_list ap) { internal_vproblem (&internal_error_problem, file, line, fmt, ap); throw_exception (RETURN_ERROR); @@ -806,8 +807,7 @@ static struct internal_problem internal_warning_problem = { }; void -internal_vwarning (const char *file, int line, - const char *fmt, va_list ap) +internal_vwarning (const char *file, int line, const char *fmt, va_list ap) { internal_vproblem (&internal_warning_problem, file, line, fmt, ap); } @@ -922,13 +922,13 @@ quit (void) fprintf_unfiltered (gdb_stderr, "Quit\n"); #else if (job_control - /* If there is no terminal switching for this target, then we can't - possibly get screwed by the lack of job control. */ + /* If there is no terminal switching for this target, then we can't + possibly get screwed by the lack of job control. */ || current_target.to_terminal_ours == NULL) fprintf_unfiltered (gdb_stderr, "Quit\n"); else fprintf_unfiltered (gdb_stderr, - "Quit (expect signal SIGINT when the program is resumed)\n"); + "Quit (expect signal SIGINT when the program is resumed)\n"); #endif throw_exception (RETURN_QUIT); } @@ -955,13 +955,10 @@ request_quit (int signo) #if !defined (USE_MMALLOC) -/* NOTE: These must use PTR so that their definition matches the - declaration found in "mmalloc.h". */ - static void * mmalloc (void *md, size_t size) { - return malloc (size); /* NOTE: GDB's only call to malloc() */ + return malloc (size); /* NOTE: GDB's only call to malloc() */ } static void * @@ -970,19 +967,19 @@ mrealloc (void *md, void *ptr, size_t size) if (ptr == 0) /* Guard against old realloc's */ return mmalloc (md, size); else - return realloc (ptr, size); /* NOTE: GDB's only call to ralloc() */ + return realloc (ptr, size); /* NOTE: GDB's only call to ralloc() */ } static void * mcalloc (void *md, size_t number, size_t size) { - return calloc (number, size); /* NOTE: GDB's only call to calloc() */ + return calloc (number, size); /* NOTE: GDB's only call to calloc() */ } static void mfree (void *md, void *ptr) { - free (ptr); /* NOTE: GDB's only call to free() */ + free (ptr); /* NOTE: GDB's only call to free() */ } #endif /* USE_MMALLOC */ @@ -1031,9 +1028,10 @@ init_malloc (void *md) initialize_all_files(). */ fprintf_unfiltered - (gdb_stderr, "warning: failed to install memory consistency checks; "); - fprintf_unfiltered - (gdb_stderr, "configuration should define NO_MMCHECK or MMCHECK_FORCE\n"); + (gdb_stderr, + "warning: failed to install memory consistency checks; "); + fprintf_unfiltered (gdb_stderr, + "configuration should define NO_MMCHECK or MMCHECK_FORCE\n"); } mmtrace (); @@ -1050,12 +1048,12 @@ nomem (long size) if (size > 0) { internal_error (__FILE__, __LINE__, - "virtual memory exhausted: can't allocate %ld bytes.", size); + "virtual memory exhausted: can't allocate %ld bytes.", + size); } else { - internal_error (__FILE__, __LINE__, - "virtual memory exhausted."); + internal_error (__FILE__, __LINE__, "virtual memory exhausted."); } } @@ -1149,19 +1147,19 @@ xmfree (void *md, void *ptr) /* NOTE: These are declared using PTR to ensure consistency with "libiberty.h". xfree() is GDB local. */ -PTR +PTR /* OK: PTR */ xmalloc (size_t size) { return xmmalloc (NULL, size); } -PTR -xrealloc (PTR ptr, size_t size) +PTR /* OK: PTR */ +xrealloc (PTR ptr, size_t size) /* OK: PTR */ { return xmrealloc (NULL, ptr, size); } -PTR +PTR /* OK: PTR */ xcalloc (size_t number, size_t size) { return xmcalloc (NULL, number, size); @@ -1194,14 +1192,12 @@ xvasprintf (char **ret, const char *format, va_list ap) badly format string; or something else. */ if ((*ret) == NULL) internal_error (__FILE__, __LINE__, - "vasprintf returned NULL buffer (errno %d)", - errno); + "vasprintf returned NULL buffer (errno %d)", errno); /* A negative status with a non-NULL buffer shouldn't never happen. But to be sure. */ if (status < 0) internal_error (__FILE__, __LINE__, - "vasprintf call failed (errno %d)", - errno); + "vasprintf call failed (errno %d)", errno); } @@ -1281,7 +1277,7 @@ gdb_print_host_address (void *addr, struct ui_file *stream) /* VARARGS */ int -query (const char *ctlstr,...) +query (const char *ctlstr, ...) { va_list args; register int answer; @@ -1327,7 +1323,7 @@ query (const char *ctlstr,...) if (answer != '\n') do { - ans2 = fgetc (stdin); + ans2 = fgetc (stdin); clearerr (stdin); } while (ans2 != EOF && ans2 != '\n' && ans2 != '\r'); @@ -1367,7 +1363,7 @@ no_control_char_error (const char *start, const char *end) copy[len] = '\0'; error ("There is no control character `\\%s' in the `%s' character set.", - copy, target_charset ()); + copy, target_charset ()); } /* Parse a C escape sequence. STRING_PTR points to a variable @@ -1392,86 +1388,86 @@ parse_escape (char **string_ptr) register int c = *(*string_ptr)++; if (c_parse_backslash (c, &target_char)) return target_char; - else switch (c) - { - case '\n': - return -2; - case 0: - (*string_ptr)--; - return 0; - case '^': + else + switch (c) { - /* Remember where this escape sequence started, for reporting - errors. */ - char *sequence_start_pos = *string_ptr - 1; - - c = *(*string_ptr)++; - - if (c == '?') - { - /* XXXCHARSET: What is `delete' in the host character set? */ - c = 0177; - - if (! host_char_to_target (c, &target_char)) - error ("There is no character corresponding to `Delete' " - "in the target character set `%s'.", - host_charset ()); - - return target_char; - } - else if (c == '\\') - target_char = parse_escape (string_ptr); - else - { - if (! host_char_to_target (c, &target_char)) - no_control_char_error (sequence_start_pos, *string_ptr); - } - - /* Now target_char is something like `c', and we want to find - its control-character equivalent. */ - if (! target_char_to_control_char (target_char, &target_char)) - no_control_char_error (sequence_start_pos, *string_ptr); - - return target_char; - } + case '\n': + return -2; + case 0: + (*string_ptr)--; + return 0; + case '^': + { + /* Remember where this escape sequence started, for reporting + errors. */ + char *sequence_start_pos = *string_ptr - 1; - /* XXXCHARSET: we need to use isdigit and value-of-digit - methods of the host character set here. */ - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { - register int i = c - '0'; - register int count = 0; - while (++count < 3) - { - if ((c = *(*string_ptr)++) >= '0' && c <= '7') - { - i *= 8; - i += c - '0'; - } - else - { - (*string_ptr)--; - break; - } - } - return i; + c = *(*string_ptr)++; + + if (c == '?') + { + /* XXXCHARSET: What is `delete' in the host character set? */ + c = 0177; + + if (!host_char_to_target (c, &target_char)) + error ("There is no character corresponding to `Delete' " + "in the target character set `%s'.", host_charset ()); + + return target_char; + } + else if (c == '\\') + target_char = parse_escape (string_ptr); + else + { + if (!host_char_to_target (c, &target_char)) + no_control_char_error (sequence_start_pos, *string_ptr); + } + + /* Now target_char is something like `c', and we want to find + its control-character equivalent. */ + if (!target_char_to_control_char (target_char, &target_char)) + no_control_char_error (sequence_start_pos, *string_ptr); + + return target_char; + } + + /* XXXCHARSET: we need to use isdigit and value-of-digit + methods of the host character set here. */ + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + { + register int i = c - '0'; + register int count = 0; + while (++count < 3) + { + if ((c = *(*string_ptr)++) >= '0' && c <= '7') + { + i *= 8; + i += c - '0'; + } + else + { + (*string_ptr)--; + break; + } + } + return i; + } + default: + if (!host_char_to_target (c, &target_char)) + error + ("The escape sequence `\%c' is equivalent to plain `%c', which" + " has no equivalent\n" "in the `%s' character set.", c, c, + target_charset ()); + return target_char; } - default: - if (! host_char_to_target (c, &target_char)) - error ("The escape sequence `\%c' is equivalent to plain `%c', which" - " has no equivalent\n" - "in the `%s' character set.", - c, c, target_charset ()); - return target_char; - } } /* Print the character C on STREAM as part of the contents of a literal @@ -1547,15 +1543,16 @@ fputstr_unfiltered (const char *str, int quoter, struct ui_file *stream) } void -fputstrn_unfiltered (const char *str, int n, int quoter, struct ui_file *stream) +fputstrn_unfiltered (const char *str, int n, int quoter, + struct ui_file *stream) { int i; for (i = 0; i < n; i++) printchar (str[i], fputs_unfiltered, fprintf_unfiltered, stream, quoter); } - + /* Number of lines per page or UINT_MAX if paging is disabled. */ static unsigned int lines_per_page; /* Number of chars per line or UINT_MAX if line folding is disabled. */ @@ -1905,8 +1902,7 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, while (*lineptr) { /* Possible new page. */ - if (filter && - (lines_printed >= lines_per_page - 1)) + if (filter && (lines_printed >= lines_per_page - 1)) prompt_for_continue (); while (*lineptr && *lineptr != '\n') @@ -1954,7 +1950,7 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, if (wrap_column) { fputs_unfiltered (wrap_indent, stream); - *wrap_pointer = '\0'; /* Null-terminate saved stuff */ + *wrap_pointer = '\0'; /* Null-terminate saved stuff */ fputs_unfiltered (wrap_buffer, stream); /* and eject it */ /* FIXME, this strlen is what prevents wrap_indent from containing tabs. However, if we recurse to print it @@ -2168,7 +2164,7 @@ vprintf_unfiltered (const char *format, va_list args) } void -fprintf_filtered (struct ui_file * stream, const char *format,...) +fprintf_filtered (struct ui_file *stream, const char *format, ...) { va_list args; va_start (args, format); @@ -2177,7 +2173,7 @@ fprintf_filtered (struct ui_file * stream, const char *format,...) } void -fprintf_unfiltered (struct ui_file * stream, const char *format,...) +fprintf_unfiltered (struct ui_file *stream, const char *format, ...) { va_list args; va_start (args, format); @@ -2189,7 +2185,8 @@ fprintf_unfiltered (struct ui_file * stream, const char *format,...) Called as fprintfi_filtered (spaces, stream, format, ...); */ void -fprintfi_filtered (int spaces, struct ui_file * stream, const char *format,...) +fprintfi_filtered (int spaces, struct ui_file *stream, const char *format, + ...) { va_list args; va_start (args, format); @@ -2201,7 +2198,7 @@ fprintfi_filtered (int spaces, struct ui_file * stream, const char *format,...) void -printf_filtered (const char *format,...) +printf_filtered (const char *format, ...) { va_list args; va_start (args, format); @@ -2211,7 +2208,7 @@ printf_filtered (const char *format,...) void -printf_unfiltered (const char *format,...) +printf_unfiltered (const char *format, ...) { va_list args; va_start (args, format); @@ -2223,7 +2220,7 @@ printf_unfiltered (const char *format,...) Called as printfi_filtered (spaces, format, ...); */ void -printfi_filtered (int spaces, const char *format,...) +printfi_filtered (int spaces, const char *format, ...) { va_list args; va_start (args, format); @@ -2287,8 +2284,8 @@ print_spaces_filtered (int n, struct ui_file *stream) demangling is off, the name is printed in its "raw" form. */ void -fprintf_symbol_filtered (struct ui_file *stream, char *name, enum language lang, - int arg_mode) +fprintf_symbol_filtered (struct ui_file *stream, char *name, + enum language lang, int arg_mode) { char *demangled; @@ -2311,8 +2308,8 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name, enum language lang, break; case language_objc: /* Commented out until ObjC handling is enabled. */ - /*demangled = objc_demangle (name);*/ - /*break;*/ + /*demangled = objc_demangle (name); */ + /*break; */ default: demangled = NULL; break; @@ -2372,11 +2369,11 @@ int subset_compare (char *string_to_compare, char *template_string) { int match; - if (template_string != (char *) NULL && string_to_compare != (char *) NULL && - strlen (string_to_compare) <= strlen (template_string)) - match = (strncmp (template_string, - string_to_compare, - strlen (string_to_compare)) == 0); + if (template_string != (char *) NULL && string_to_compare != (char *) NULL + && strlen (string_to_compare) <= strlen (template_string)) + match = + (strncmp + (template_string, string_to_compare, strlen (string_to_compare)) == 0); else match = 0; return match; @@ -2427,15 +2424,13 @@ initialize_utils (void) add_show_from_set (add_set_cmd ("demangle", class_support, var_boolean, (char *) &demangle, - "Set demangling of encoded C++/ObjC names when displaying symbols.", - &setprintlist), - &showprintlist); + "Set demangling of encoded C++/ObjC names when displaying symbols.", + &setprintlist), &showprintlist); add_show_from_set (add_set_cmd ("pagination", class_support, var_boolean, (char *) &pagination_enabled, - "Set state of pagination.", &setlist), - &showlist); + "Set state of pagination.", &setlist), &showlist); if (xdb_commands) { @@ -2449,15 +2444,13 @@ initialize_utils (void) (add_set_cmd ("sevenbit-strings", class_support, var_boolean, (char *) &sevenbit_strings, "Set printing of 8-bit characters in strings as \\nnn.", - &setprintlist), - &showprintlist); + &setprintlist), &showprintlist); add_show_from_set (add_set_cmd ("asm-demangle", class_support, var_boolean, (char *) &asm_demangle, "Set demangling of C++/ObjC names in disassembly listings.", - &setprintlist), - &showprintlist); + &setprintlist), &showprintlist); } /* Machine specific function to handle SIGWINCH signal. */ @@ -2465,9 +2458,7 @@ initialize_utils (void) #ifdef SIGWINCH_HANDLER_BODY SIGWINCH_HANDLER_BODY #endif - /* print routines to handle variable size regs, etc. */ - /* temporary storage using circular buffer */ #define NUMCELLS 16 #define CELLSIZE 32 @@ -2516,19 +2507,17 @@ decimal2str (char *paddr_str, char *sign, ULONGEST addr) switch (i) { case 1: - sprintf (paddr_str, "%s%lu", - sign, temp[0]); + sprintf (paddr_str, "%s%lu", sign, temp[0]); break; case 2: - sprintf (paddr_str, "%s%lu%09lu", - sign, temp[1], temp[0]); + sprintf (paddr_str, "%s%lu%09lu", sign, temp[1], temp[0]); break; case 3: - sprintf (paddr_str, "%s%lu%09lu%09lu", - sign, temp[2], temp[1], temp[0]); + sprintf (paddr_str, "%s%lu%09lu%09lu", sign, temp[2], temp[1], temp[0]); break; default: - internal_error (__FILE__, __LINE__, "failed internal consistency check"); + internal_error (__FILE__, __LINE__, + "failed internal consistency check"); } } @@ -2594,8 +2583,7 @@ phex_nz (ULONGEST l, int sizeof_l) if (high == 0) sprintf (str, "%lx", (unsigned long) (l & 0xffffffff)); else - sprintf (str, "%lx%08lx", - high, (unsigned long) (l & 0xffffffff)); + sprintf (str, "%lx%08lx", high, (unsigned long) (l & 0xffffffff)); break; } case 4: @@ -2614,25 +2602,6 @@ phex_nz (ULONGEST l, int sizeof_l) } -/* Convert to / from the hosts pointer to GDB's internal CORE_ADDR - using the target's conversion routines. */ -CORE_ADDR -host_pointer_to_address (void *ptr) -{ - gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); - return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr); -} - -void * -address_to_host_pointer (CORE_ADDR addr) -{ - void *ptr; - - gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); - ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr); - return ptr; -} - /* Convert a CORE_ADDR into a string. */ const char * core_addr_to_string (const CORE_ADDR addr) @@ -2665,7 +2634,7 @@ string_to_core_addr (const char *my_string) { if (isdigit (my_string[i])) addr = (my_string[i] - '0') + (addr * 16); - else if (isxdigit (my_string[i])) + else if (isxdigit (my_string[i])) addr = (tolower (my_string[i]) - 'a' + 0xa) + (addr * 16); else internal_error (__FILE__, __LINE__, "invalid hex"); @@ -2784,8 +2753,7 @@ xfullpath (const char *filename) #ifdef HAVE_DOS_BASED_FILE_SYSTEM /* We need to be careful when filename is of the form 'd:foo', which is equivalent of d:./foo, which is totally different from d:/foo. */ - if (strlen (dir_name) == 2 && - isalpha (dir_name[0]) && dir_name[1] == ':') + if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':') { dir_name[2] = '.'; dir_name[3] = '\000'; @@ -2804,3 +2772,74 @@ xfullpath (const char *filename) xfree (real_path); return result; } + + +/* This is the 32-bit CRC function used by the GNU separate debug + facility. An executable may contain a section named + .gnu_debuglink, which holds the name of a separate executable file + containing its debug info, and a checksum of that file's contents, + computed using this function. */ +unsigned long +gnu_debuglink_crc32 (unsigned long crc, unsigned char *buf, size_t len) +{ + static const unsigned long crc32_table[256] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }; + unsigned char *end; + + crc = ~crc & 0xffffffff; + for (end = buf + len; buf < end; ++buf) + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); + return ~crc & 0xffffffff;; +} diff --git a/gdb/v850ice.c b/gdb/v850ice.c index 2e68cff..770e942 100644 --- a/gdb/v850ice.c +++ b/gdb/v850ice.c @@ -289,13 +289,13 @@ v850ice_wndproc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) result = TRUE; break; case STATE_CHANGE_STEPI: - if (!catch_errors ((catch_errors_ftype *) ice_stepi, (PTR) (int) lParam, "", + if (!catch_errors ((catch_errors_ftype *) ice_stepi, (int) lParam, "", RETURN_MASK_ALL)) printf_unfiltered ("stepi errored\n"); result = TRUE; break; case STATE_CHANGE_NEXTI: - if (!catch_errors ((catch_errors_ftype *) ice_nexti, (PTR) (int) lParam, "", + if (!catch_errors ((catch_errors_ftype *) ice_nexti, (int) lParam, "", RETURN_MASK_ALL)) printf_unfiltered ("nexti errored\n"); result = TRUE; diff --git a/gdb/valarith.c b/gdb/valarith.c index 62ebc68..dcfd92c 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -1,7 +1,8 @@ /* Perform arithmetic and other operations on values, for GDB. + Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/valops.c b/gdb/valops.c index d3906f9..2304274 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -515,6 +515,7 @@ value_assign (struct value *toval, struct value *fromval) struct value *val; char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); int use_buffer = 0; + struct frame_id old_frame; if (!toval->modifiable) error ("Left operand of assignment is not a modifiable lvalue."); @@ -544,6 +545,11 @@ value_assign (struct value *toval, struct value *fromval) } } + /* Since modifying a register can trash the frame chain, and modifying memory + can trash the frame cache, we save the old frame and then restore the new + frame afterwards. */ + old_frame = get_frame_id (deprecated_selected_frame); + switch (VALUE_LVAL (toval)) { case lval_internalvar: @@ -612,7 +618,6 @@ value_assign (struct value *toval, struct value *fromval) case lval_reg_frame_relative: case lval_register: { - struct frame_id old_frame; /* value is stored in a series of registers in the frame specified by the structure. Copy that value out, modify it, and copy it back in. */ @@ -625,11 +630,6 @@ value_assign (struct value *toval, struct value *fromval) int regno; struct frame_info *frame; - /* Since modifying a register can trash the frame chain, we - save the old frame and then restore the new frame - afterwards. */ - old_frame = get_frame_id (deprecated_selected_frame); - /* Figure out which frame this is in currently. */ if (VALUE_LVAL (toval) == lval_register) { @@ -731,26 +731,6 @@ value_assign (struct value *toval, struct value *fromval) register_changed_hook (-1); target_changed_event (); - /* Assigning to the stack pointer, frame pointer, and other - (architecture and calling convention specific) registers - may cause the frame cache to be out of date. We just do - this on all assignments to registers for simplicity; I - doubt the slowdown matters. */ - reinit_frame_cache (); - - /* Having destoroyed the frame cache, restore the selected - frame. */ - /* FIXME: cagney/2002-11-02: There has to be a better way of - doing this. Instead of constantly saving/restoring the - frame. Why not create a get_selected_frame() function - that, having saved the selected frame's ID can - automatically re-find the previously selected frame - automatically. */ - { - struct frame_info *fi = frame_find_by_id (old_frame); - if (fi != NULL) - select_frame (fi); - } } break; @@ -759,6 +739,38 @@ value_assign (struct value *toval, struct value *fromval) error ("Left operand of assignment is not an lvalue."); } + /* Assigning to the stack pointer, frame pointer, and other + (architecture and calling convention specific) registers may + cause the frame cache to be out of date. Assigning to memory + also can. We just do this on all assignments to registers or + memory, for simplicity's sake; I doubt the slowdown matters. */ + switch (VALUE_LVAL (toval)) + { + case lval_memory: + case lval_register: + case lval_reg_frame_relative: + + reinit_frame_cache (); + + /* Having destoroyed the frame cache, restore the selected frame. */ + + /* FIXME: cagney/2002-11-02: There has to be a better way of + doing this. Instead of constantly saving/restoring the + frame. Why not create a get_selected_frame() function that, + having saved the selected frame's ID can automatically + re-find the previously selected frame automatically. */ + + { + struct frame_info *fi = frame_find_by_id (old_frame); + if (fi != NULL) + select_frame (fi); + } + + break; + default: + break; + } + /* If the field does not entirely fill a LONGEST, then zero the sign bits. If the field is signed, and is negative, then sign extend. */ if ((VALUE_BITSIZE (toval) > 0) @@ -1398,37 +1410,6 @@ hand_function_call (struct value *function, int nargs, struct value **args) generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); } - if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END) - { - /* Convex Unix prohibits executing in the stack segment. */ - /* Hope there is empty room at the top of the text segment. */ - extern CORE_ADDR text_end; - static int checked = 0; - if (!checked) - for (start_sp = text_end - sizeof_dummy1; start_sp < text_end; ++start_sp) - if (read_memory_integer (start_sp, 1) != 0) - error ("text segment full -- no place to put call"); - checked = 1; - sp = old_sp; - real_pc = text_end - sizeof_dummy1; - write_memory (real_pc, (char *) dummy1, sizeof_dummy1); - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1); - } - - if (CALL_DUMMY_LOCATION == AFTER_TEXT_END) - { - extern CORE_ADDR text_end; - int errcode; - sp = old_sp; - real_pc = text_end; - errcode = target_write_memory (real_pc, (char *) dummy1, sizeof_dummy1); - if (errcode != 0) - error ("Cannot write text segment -- call_function failed"); - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1); - } - if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) { real_pc = funaddr; @@ -1711,8 +1692,9 @@ You must use a pointer to function type variable. Command ignored.", arg_name); { /* The user wants the context restored. */ - /* We must get back to the frame we were before the dummy call. */ - POP_FRAME; + /* We must get back to the frame we were before the dummy + call. */ + frame_pop (get_current_frame ()); /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ diff --git a/gdb/value.h b/gdb/value.h index 1ba2864..8f222fc 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -489,8 +489,8 @@ extern void release_value (struct value *val); extern int record_latest_value (struct value *val); -extern void -modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize); +extern void modify_field (char *addr, LONGEST fieldval, int bitpos, + int bitsize); extern void type_print (struct type * type, char *varstring, struct ui_file * stream, int show); diff --git a/gdb/values.c b/gdb/values.c index 5b76d6c..a994862 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -1,7 +1,8 @@ /* Low level packing and unpacking of values for GDB, the GNU Debugger. + Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2002. - Free Software Foundation, Inc. + 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/version.in b/gdb/version.in index 50944f9..9e082a0 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-01-09-cvs +2003-02-02-cvs diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index f3fb0a7..d6bb27e 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1,6 +1,6 @@ /* Target-vector operations for controlling win32 child processes, for GDB. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Solutions, A Red Hat Company. @@ -124,7 +124,6 @@ static DEBUG_EVENT current_event; /* The current debug event from static HANDLE current_process_handle; /* Currently executing process */ static thread_info *current_thread; /* Info on currently selected thread */ static DWORD main_thread_id; /* Thread ID of the main thread */ -static pid_t cygwin_pid; /* pid of cygwin process */ /* Counts of things. */ static int exception_count = 0; @@ -383,7 +382,7 @@ static void do_child_store_inferior_registers (int r) { if (r >= 0) - deprecated_read_register_gen (r, ((char *) ¤t_thread->context) + mappings[r]); + regcache_collect (r, ((char *) ¤t_thread->context) + mappings[r]); else { for (r = 0; r < NUM_REGS; r++) @@ -850,10 +849,10 @@ display_selector (HANDLE thread, DWORD sel) int base, limit; printf_filtered ("0x%03lx: ", sel); if (!info.HighWord.Bits.Pres) - { - puts_filtered ("Segment not present\n"); - return 0; - } + { + puts_filtered ("Segment not present\n"); + return 0; + } base = (info.HighWord.Bits.BaseHi << 24) + (info.HighWord.Bits.BaseMid << 16) + info.BaseLow; @@ -862,46 +861,46 @@ display_selector (HANDLE thread, DWORD sel) limit = (limit << 12) | 0xfff; printf_filtered ("base=0x%08x limit=0x%08x", base, limit); if (info.HighWord.Bits.Default_Big) - puts_filtered(" 32-bit "); + puts_filtered(" 32-bit "); else - puts_filtered(" 16-bit "); + puts_filtered(" 16-bit "); switch ((info.HighWord.Bits.Type & 0xf) >> 1) { case 0: - puts_filtered ("Data (Read-Only, Exp-up"); - break; + puts_filtered ("Data (Read-Only, Exp-up"); + break; case 1: - puts_filtered ("Data (Read/Write, Exp-up"); - break; + puts_filtered ("Data (Read/Write, Exp-up"); + break; case 2: - puts_filtered ("Unused segment ("); - break; + puts_filtered ("Unused segment ("); + break; case 3: - puts_filtered ("Data (Read/Write, Exp-down"); - break; + puts_filtered ("Data (Read/Write, Exp-down"); + break; case 4: - puts_filtered ("Code (Exec-Only, N.Conf"); - break; + puts_filtered ("Code (Exec-Only, N.Conf"); + break; case 5: - puts_filtered ("Code (Exec/Read, N.Conf"); + puts_filtered ("Code (Exec/Read, N.Conf"); break; case 6: - puts_filtered ("Code (Exec-Only, Conf"); + puts_filtered ("Code (Exec-Only, Conf"); break; case 7: - puts_filtered ("Code (Exec/Read, Conf"); + puts_filtered ("Code (Exec/Read, Conf"); break; default: printf_filtered ("Unknown type 0x%x",info.HighWord.Bits.Type); } if ((info.HighWord.Bits.Type & 0x1) == 0) - puts_filtered(", N.Acc"); + puts_filtered(", N.Acc"); puts_filtered (")\n"); if ((info.HighWord.Bits.Type & 0x10) == 0) puts_filtered("System selector "); printf_filtered ("Priviledge level = %d. ", info.HighWord.Bits.Dpl); if (info.HighWord.Bits.Granularity) - puts_filtered ("Page granular.\n"); + puts_filtered ("Page granular.\n"); else puts_filtered ("Byte granular.\n"); return 1; @@ -926,22 +925,22 @@ display_selectors (char * args, int from_tty) puts_filtered ("Selector $cs\n"); display_selector (current_thread->h, - current_thread->context.SegCs); + current_thread->context.SegCs); puts_filtered ("Selector $ds\n"); display_selector (current_thread->h, - current_thread->context.SegDs); + current_thread->context.SegDs); puts_filtered ("Selector $es\n"); display_selector (current_thread->h, - current_thread->context.SegEs); + current_thread->context.SegEs); puts_filtered ("Selector $ss\n"); display_selector (current_thread->h, - current_thread->context.SegSs); + current_thread->context.SegSs); puts_filtered ("Selector $fs\n"); display_selector (current_thread->h, current_thread->context.SegFs); puts_filtered ("Selector $gs\n"); display_selector (current_thread->h, - current_thread->context.SegGs); + current_thread->context.SegGs); } else { @@ -1374,6 +1373,83 @@ has_detach_ability (void) return 0; } +/* Try to set or remove a user privilege to the current process. Return -1 + if that fails, the previous setting of that privilege otherwise. + + This code is copied from the Cygwin source code and rearranged to allow + dynamically loading of the needed symbols from advapi32 which is only + available on NT/2K/XP. */ +static int +set_process_privilege (const char *privilege, BOOL enable) +{ + static HMODULE advapi32 = NULL; + static BOOL WINAPI (*OpenProcessToken)(HANDLE, DWORD, PHANDLE); + static BOOL WINAPI (*LookupPrivilegeValue)(LPCSTR, LPCSTR, PLUID); + static BOOL WINAPI (*AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, + DWORD, PTOKEN_PRIVILEGES, PDWORD); + + HANDLE token_hdl = NULL; + LUID restore_priv; + TOKEN_PRIVILEGES new_priv, orig_priv; + int ret = -1; + DWORD size; + + if (GetVersion () >= 0x80000000) /* No security availbale on 9x/Me */ + return 0; + + if (!advapi32) + { + if (!(advapi32 = LoadLibrary ("advapi32.dll"))) + goto out; + if (!OpenProcessToken) + OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken"); + if (!LookupPrivilegeValue) + LookupPrivilegeValue = GetProcAddress (advapi32, + "LookupPrivilegeValueA"); + if (!AdjustTokenPrivileges) + AdjustTokenPrivileges = GetProcAddress (advapi32, + "AdjustTokenPrivileges"); + if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges) + { + advapi32 = NULL; + goto out; + } + } + + if (!OpenProcessToken (GetCurrentProcess (), + TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, + &token_hdl)) + goto out; + + if (!LookupPrivilegeValue (NULL, privilege, &restore_priv)) + goto out; + + new_priv.PrivilegeCount = 1; + new_priv.Privileges[0].Luid = restore_priv; + new_priv.Privileges[0].Attributes = enable ? SE_PRIVILEGE_ENABLED : 0; + + if (!AdjustTokenPrivileges (token_hdl, FALSE, &new_priv, + sizeof orig_priv, &orig_priv, &size)) + goto out; +#if 0 + /* Disabled, otherwise every `attach' in an unprivileged user session + would raise the "Failed to get SE_DEBUG_NAME privilege" warning in + child_attach(). */ + /* AdjustTokenPrivileges returns TRUE even if the privilege could not + be enabled. GetLastError () returns an correct error code, though. */ + if (enable && GetLastError () == ERROR_NOT_ALL_ASSIGNED) + goto out; +#endif + + ret = orig_priv.Privileges[0].Attributes == SE_PRIVILEGE_ENABLED ? 1 : 0; + +out: + if (token_hdl) + CloseHandle (token_hdl); + + return ret; +} + /* Attach to process PID, then initialize for debugging it. */ static void child_attach (char *args, int from_tty) @@ -1384,12 +1460,28 @@ child_attach (char *args, int from_tty) if (!args) error_no_arg ("process-id to attach"); - pid = strtoul (args, 0, 0); + if (set_process_privilege (SE_DEBUG_NAME, TRUE) < 0) + { + printf_unfiltered ("Warning: Failed to get SE_DEBUG_NAME privilege\n"); + printf_unfiltered ("This can cause attach to fail on Windows NT/2K/XP\n"); + } + + pid = strtoul (args, 0, 0); /* Windows pid */ + ok = DebugActiveProcess (pid); saw_create = 0; if (!ok) + { + /* Try fall back to Cygwin pid */ + pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); + + if (pid > 0) + ok = DebugActiveProcess (pid); + + if (!ok) error ("Can't attach to process."); + } if (has_detach_ability ()) { @@ -1923,11 +2015,11 @@ _initialize_win32_nat (void) add_info_alias ("sharedlibrary", "dll", 1); add_prefix_cmd ("w32", class_info, info_w32_command, - "Print information specific to Win32 debugging.", - &info_w32_cmdlist, "info w32 ", 0, &infolist); + "Print information specific to Win32 debugging.", + &info_w32_cmdlist, "info w32 ", 0, &infolist); add_cmd ("selector", class_info, display_selectors, - "Display selectors infos.", + "Display selectors infos.", &info_w32_cmdlist); add_target (&child_ops); diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c index 78e9c49..8676176 100644 --- a/gdb/x86-64-linux-nat.c +++ b/gdb/x86-64-linux-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for GNU/Linux x86-64. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Jiri Smid, SuSE Labs. diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c index c593abe..932e6d6 100644 --- a/gdb/x86-64-linux-tdep.c +++ b/gdb/x86-64-linux-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for GNU/Linux running on x86-64, for GDB. - Copyright 2001 Free Software Foundation, Inc. + Copyright 2001, 2003 Free Software Foundation, Inc. Contributed by Jiri Smid, SuSE Labs. diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 5bdb88c..991acdc 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1,6 +1,6 @@ /* Read AIX xcoff symbol tables and convert to internal format, for GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001 + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Derived from coffread.c, dbxread.c, and a lot of hacking. Contributed by IBM Corporation. @@ -190,10 +190,10 @@ static void xcoff_new_init (struct objfile *); static void xcoff_symfile_finish (struct objfile *); -static void -xcoff_symfile_offsets (struct objfile *, struct section_addr_info *addrs); +static void xcoff_symfile_offsets (struct objfile *, + struct section_addr_info *addrs); -static void find_linenos (bfd *, sec_ptr, PTR); +static void find_linenos (bfd *, sec_ptr, void *); static char *coff_getfilename (union internal_auxent *, struct objfile *); @@ -237,7 +237,7 @@ struct find_targ_sec_arg static void find_targ_sec (bfd *, asection *, void *); static void -find_targ_sec (bfd *abfd, asection *sect, PTR obj) +find_targ_sec (bfd *abfd, asection *sect, void *obj) { struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj; struct objfile *objfile = args->objfile; @@ -1699,7 +1699,7 @@ gotit: * mainline code can read the whole thing for efficiency. */ static void -find_linenos (bfd *abfd, sec_ptr asect, PTR vpinfo) +find_linenos (bfd *abfd, sec_ptr asect, void *vpinfo) { struct coff_symfile_info *info; int size, count; @@ -2554,7 +2554,7 @@ scan_xcoff_symtab (struct objfile *objfile) psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - memcpy ((PTR) psymtab_include_list, (PTR) orig, + memcpy (psymtab_include_list, orig, includes_used * sizeof (char *)); } continue; @@ -2636,20 +2636,22 @@ scan_xcoff_symtab (struct objfile *objfile) psymtab_language, objfile); p += 1; } - /* The semantics of C++ state that "struct foo { ... }" - also defines a typedef for "foo". Unfortuantely, cfront - never makes the typedef when translating from C++ to C. - We make the typedef here so that "ptype foo" works as - expected for cfront translated code. */ - else if (psymtab_language == language_cplus) - { - /* Also a typedef with the same name. */ - add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, - &objfile->static_psymbols, - symbol.n_value, 0, - psymtab_language, objfile); - } +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* The semantics of C++ state that "struct foo { ... }" +// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront +// OBSOLETE never makes the typedef when translating from C++ to C. +// OBSOLETE We make the typedef here so that "ptype foo" works as +// OBSOLETE expected for cfront translated code. */ +// OBSOLETE else if (psymtab_language == language_cplus) +// OBSOLETE { +// OBSOLETE /* Also a typedef with the same name. */ +// OBSOLETE add_psymbol_to_list (namestring, p - namestring, +// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE &objfile->static_psymbols, +// OBSOLETE symbol.n_value, 0, +// OBSOLETE psymtab_language, objfile); +// OBSOLETE } +#endif /* OBSOLETE CFront */ } goto check_enum; @@ -2798,9 +2800,11 @@ scan_xcoff_symtab (struct objfile *objfile) case '9': case '-': case '#': /* for symbol identification (used in live ranges) */ - /* added to support cfront stabs strings */ - case 'Z': /* for definition continuations */ - case 'P': /* for prototypes */ +#if 0 /* OBSOLETE CFront */ +// OBSOLETE /* added to support cfront stabs strings */ +// OBSOLETE case 'Z': /* for definition continuations */ +// OBSOLETE case 'P': /* for prototypes */ +#endif /* OBSOLETE CFront */ continue; case ':': diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c index be7561b..5b30940 100644 --- a/gdb/z8k-tdep.c +++ b/gdb/z8k-tdep.c @@ -1,7 +1,7 @@ /* Target-machine dependent code for Zilog Z8000, for GDB. Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. diff --git a/include/ChangeLog b/include/ChangeLog index 66790de..829d187 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,31 @@ +2003-01-31 Grant Grundler + + * hppa.h (ldwa, ldda): Add ordered opcodes. + +2003-01-26 Daniel Jacobowitz + + * hashtab.h (htab_alloc_with_arg, htab_free_with_arg): Add new types. + (struct htab): Add alloc_arg, alloc_with_arg_f, free_with_arg_f. + (htab_create_alloc_ex): New prototype. + (htab_set_functions_ex): New prototype. + +2003-01-25 Jakub Jelinek + + * elf/sparc.h: Add TLS relocs. Move R_SPARC_REV32 to 252. + +2003-01-20 Svein E. Seldal + + * coff/tic4x.h (TICOFF_TARGET_MACHINE_GET): Fixed define bug + * coff/ti.h (TICOFF_TARGET_MACHINE_GET): Added macros + +2002-07-17 Geoffrey Keating + + * splay-tree.h (GTY): Define if undefined. + (splay_tree_allocate_fn): Return PTR for compatibility, not void *. + (struct splay_tree_node_s): Support gengtype. + (struct splay_tree_s): Likewise. Make allocate_data a PTR, + not a void *. + 2002-01-02 Ben Elliston * dis-asm.h (print_insn_iq2000): Declare. diff --git a/include/coff/ti.h b/include/coff/ti.h index 0a59b22..8df1522 100644 --- a/include/coff/ti.h +++ b/include/coff/ti.h @@ -57,6 +57,14 @@ struct external_filehdr #error "TICOFF_TARGET_ARCH needs to be defined for your CPU" #endif +#ifndef TICOFF_TARGET_MACHINE_GET +#define TICOFF_TARGET_MACHINE_GET(FLAGS) 0 +#endif + +#ifndef TICOFF_TARGET_MACHINE_SET +#define TICOFF_TARGET_MACHINE_SET(FLAGSP, MACHINE) +#endif + /* Default to COFF2 for file output */ #ifndef TICOFF_DEFAULT_MAGIC #define TICOFF_DEFAULT_MAGIC TICOFF2MAGIC diff --git a/include/coff/tic4x.h b/include/coff/tic4x.h index 03215fb..083cc3b 100644 --- a/include/coff/tic4x.h +++ b/include/coff/tic4x.h @@ -30,14 +30,14 @@ /* We use COFF2. */ #define TICOFF_DEFAULT_MAGIC TICOFF2MAGIC -#define TICOFF_TARGET_MACHINE_GET (FLAGS) \ +#define TICOFF_TARGET_MACHINE_GET(FLAGS) \ (((FLAGS) & F_VERS) ? bfd_mach_c4x : bfd_mach_c3x) -#define TICOFF_TARGET_MACHINE_SET (FLAGSP, MACHINE) \ +#define TICOFF_TARGET_MACHINE_SET(FLAGSP, MACHINE) \ do \ { \ if ((MACHINE) == bfd_mach_c4x) \ - *(FLAGSP) = F_VERS; \ + *(FLAGSP) |= F_VERS; \ } \ while (0) diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 4303088..7b6f177 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,4 +1,55 @@ -2002-01-02 Ben Elliston +2003-01-27 Alexandre Oliva + + * mips.h (EF_MIPS_XGOT): Define. + +2003-01-24 Martin Schwidefsky + + * s390.h: Add s390 TLS relocations. + +2003-01-23 Nick Clifton + + * Add sh2e support: + + 2002-04-02 Alexandre Oliva + + * sh.h (EF_SH_MERGE_MACH): Handle SH2E. + + 2002-04-02 Elena Zannoni + + * sh.h (EF_SH2E): New. + +2003-01-23 Alan Modra + + * sh.h: Split out various bits to bfd/elf32-sh64.h. + +2003-01-20 Martin Schwidefsky + + * s390.h: Rename R_390_GOTOFF to R_390_GOTOFF32. Add new gotoff, + gotplt and pltoff relocations. + +2003-01-17 Alan Modra + + * common.h: Formatting, typo fixes. + (DT_ENCODING): Correct value. + +2003-01-17 Fabio Alemagna + + * common.h (ELFOSABI_AROS): Define. + (ELFOSABI_OPENVMS): Likewise. + (ELFOSABI_NSK): Likewise. + +2003-01-16 Alan Modra + + * ppc.h: Split out ppc64 definitions to.. + * pcc64.h: ..here. New file. + (R_PPC64_REL30): Rename from R_PPC64_ADDR30. + +2003-01-13 Dmitry Diky + + * elf/common.h (EM_MSP430): Change e_machine value to officially + assigned. + +2003-01-02 Ben Elliston * common.h (EM_IQ2000): Define. * iq2000.h: New file. @@ -65,10 +116,10 @@ * sh.h: Add SH TLS relocs. 2002-09-30 Gavin Romig-Koch - Ken Raeburn - Aldy Hernandez - Eric Christopher - Richard Sandiford + Ken Raeburn + Aldy Hernandez + Eric Christopher + Richard Sandiford * mips.h (E_MIPS_MACH_4120, E_MIPS_MACH_5400, E_MIPS_MACH_5500): New. @@ -106,9 +157,9 @@ Graham Stott Jeff Johnston - * common.h (EM_IP2K): New macro. + * common.h (EM_IP2K): New macro. (EM_IP2K_OLD): New macro. - * ip2k.h: New file. + * ip2k.h: New file. 2002-07-01 Matt Thomas diff --git a/include/elf/common.h b/include/elf/common.h index c8729f1..2315fa8 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1,6 +1,6 @@ /* ELF support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published @@ -35,46 +35,49 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Fields in e_ident[] */ #define EI_MAG0 0 /* File identification byte 0 index */ -#define ELFMAG0 0x7F /* Magic number byte 0 */ +#define ELFMAG0 0x7F /* Magic number byte 0 */ #define EI_MAG1 1 /* File identification byte 1 index */ -#define ELFMAG1 'E' /* Magic number byte 1 */ +#define ELFMAG1 'E' /* Magic number byte 1 */ #define EI_MAG2 2 /* File identification byte 2 index */ -#define ELFMAG2 'L' /* Magic number byte 2 */ +#define ELFMAG2 'L' /* Magic number byte 2 */ #define EI_MAG3 3 /* File identification byte 3 index */ -#define ELFMAG3 'F' /* Magic number byte 3 */ +#define ELFMAG3 'F' /* Magic number byte 3 */ #define EI_CLASS 4 /* File class */ -#define ELFCLASSNONE 0 /* Invalid class */ -#define ELFCLASS32 1 /* 32-bit objects */ -#define ELFCLASS64 2 /* 64-bit objects */ +#define ELFCLASSNONE 0 /* Invalid class */ +#define ELFCLASS32 1 /* 32-bit objects */ +#define ELFCLASS64 2 /* 64-bit objects */ #define EI_DATA 5 /* Data encoding */ -#define ELFDATANONE 0 /* Invalid data encoding */ -#define ELFDATA2LSB 1 /* 2's complement, little endian */ -#define ELFDATA2MSB 2 /* 2's complement, big endian */ +#define ELFDATANONE 0 /* Invalid data encoding */ +#define ELFDATA2LSB 1 /* 2's complement, little endian */ +#define ELFDATA2MSB 2 /* 2's complement, big endian */ #define EI_VERSION 6 /* File version */ -#define EI_OSABI 7 /* Operating System/ABI indication */ -#define ELFOSABI_NONE 0 /* UNIX System V ABI */ -#define ELFOSABI_HPUX 1 /* HP-UX operating system */ -#define ELFOSABI_NETBSD 2 /* NetBSD */ -#define ELFOSABI_LINUX 3 /* GNU/Linux */ -#define ELFOSABI_HURD 4 /* GNU/Hurd */ -#define ELFOSABI_SOLARIS 6 /* Solaris */ -#define ELFOSABI_AIX 7 /* AIX */ -#define ELFOSABI_IRIX 8 /* IRIX */ -#define ELFOSABI_FREEBSD 9 /* FreeBSD */ -#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ -#define ELFOSABI_MODESTO 11 /* Novell Modesto */ -#define ELFOSABI_OPENBSD 12 /* OpenBSD */ -#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ -#define ELFOSABI_ARM 97 /* ARM */ - -#define EI_ABIVERSION 8 /* ABI version */ +#define EI_OSABI 7 /* Operating System/ABI indication */ +#define ELFOSABI_NONE 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_AIX 7 /* AIX */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_OPENVMS 13 /* OpenVMS */ +#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */ +#define ELFOSABI_AROS 15 /* Amiga Research OS */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +#define EI_ABIVERSION 8 /* ABI version */ #define EI_PAD 9 /* Start of padding bytes */ @@ -86,8 +89,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ET_EXEC 2 /* Executable file */ #define ET_DYN 3 /* Shared object file */ #define ET_CORE 4 /* Core file */ -#define ET_LOOS 0xFE00 /* Operating system-specific */ -#define ET_HIOS 0xFEFF /* Operating system-specific */ +#define ET_LOOS 0xFE00 /* Operating system-specific */ +#define ET_HIOS 0xFEFF /* Operating system-specific */ #define ET_LOPROC 0xFF00 /* Processor-specific */ #define ET_HIPROC 0xFFFF /* Processor-specific */ @@ -95,88 +98,89 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ are officially assigned by registry@caldera.com. See below for a list of ad-hoc numbers used during initial development. */ -#define EM_NONE 0 /* No machine */ -#define EM_M32 1 /* AT&T WE 32100 */ -#define EM_SPARC 2 /* SUN SPARC */ -#define EM_386 3 /* Intel 80386 */ -#define EM_68K 4 /* Motorola m68k family */ -#define EM_88K 5 /* Motorola m88k family */ -#define EM_486 6 /* Intel 80486 *//* Reserved for future use */ -#define EM_860 7 /* Intel 80860 */ -#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ -#define EM_S370 9 /* IBM System/370 */ -#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian (Oct 4 1999 Draft)*/ /* Depreciated */ - -#define EM_PARISC 15 /* HPPA */ - -#define EM_VPP550 17 /* Fujitsu VPP500 */ -#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ -#define EM_960 19 /* Intel 80960 */ -#define EM_PPC 20 /* PowerPC */ -#define EM_PPC64 21 /* 64-bit PowerPC */ -#define EM_S390 22 /* IBM S/390 */ - -#define EM_V800 36 /* NEC V800 series */ -#define EM_FR20 37 /* Fujitsu FR20 */ -#define EM_RH32 38 /* TRW RH32 */ -#define EM_MCORE 39 /* Motorola M*Core */ /* May also be taken by Fujitsu MMA */ -#define EM_RCE 39 /* Old name for MCore */ -#define EM_ARM 40 /* ARM */ -#define EM_OLD_ALPHA 41 /* Digital Alpha */ -#define EM_SH 42 /* Hitachi SH */ -#define EM_SPARCV9 43 /* SPARC v9 64-bit */ -#define EM_TRICORE 44 /* Siemens Tricore embedded processor */ -#define EM_ARC 45 /* ARC Cores */ -#define EM_H8_300 46 /* Hitachi H8/300 */ -#define EM_H8_300H 47 /* Hitachi H8/300H */ -#define EM_H8S 48 /* Hitachi H8S */ -#define EM_H8_500 49 /* Hitachi H8/500 */ -#define EM_IA_64 50 /* Intel IA-64 Processor */ -#define EM_MIPS_X 51 /* Stanford MIPS-X */ -#define EM_COLDFIRE 52 /* Motorola Coldfire */ -#define EM_68HC12 53 /* Motorola M68HC12 */ -#define EM_MMA 54 /* Fujitsu Multimedia Accelerator */ -#define EM_PCP 55 /* Siemens PCP */ -#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */ -#define EM_NDR1 57 /* Denso NDR1 microprocesspr */ -#define EM_STARCORE 58 /* Motorola Star*Core processor */ -#define EM_ME16 59 /* Toyota ME16 processor */ -#define EM_ST100 60 /* STMicroelectronics ST100 processor */ -#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor */ -#define EM_X86_64 62 /* Advanced Micro Devices X86-64 processor */ - -#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */ -#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */ -#define EM_FX66 66 /* Siemens FX66 microcontroller */ -#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ -#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */ -#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */ -#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */ -#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */ -#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */ -#define EM_SVX 73 /* Silicon Graphics SVx */ -#define EM_ST19 74 /* STMicroelectronics ST19 8-bit cpu */ -#define EM_VAX 75 /* Digital VAX */ -#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ -#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded cpu */ -#define EM_FIREPATH 78 /* Element 14 64-bit DSP processor */ -#define EM_ZSP 79 /* LSI Logic's 16-bit DSP processor */ -#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ -#define EM_HUANY 81 /* Harvard's machine-independent format */ -#define EM_PRISM 82 /* SiTera Prism */ -#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ -#define EM_FR30 84 /* Fujitsu FR30 */ -#define EM_D10V 85 /* Mitsubishi D10V */ -#define EM_D30V 86 /* Mitsubishi D30V */ -#define EM_V850 87 /* NEC v850 */ -#define EM_M32R 88 /* Mitsubishi M32R */ -#define EM_MN10300 89 /* Matsushita MN10300 */ -#define EM_MN10200 90 /* Matsushita MN10200 */ -#define EM_PJ 91 /* picoJava */ -#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ -#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ -#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ -#define EM_IP2K 101 /* Ubicom IP2022 micro controller */ +#define EM_NONE 0 /* No machine */ +#define EM_M32 1 /* AT&T WE 32100 */ +#define EM_SPARC 2 /* SUN SPARC */ +#define EM_386 3 /* Intel 80386 */ +#define EM_68K 4 /* Motorola m68k family */ +#define EM_88K 5 /* Motorola m88k family */ +#define EM_486 6 /* Intel 80486 *//* Reserved for future use */ +#define EM_860 7 /* Intel 80860 */ +#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ +#define EM_S370 9 /* IBM System/370 */ +#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian (Oct 4 1999 Draft) Deprecated */ + +#define EM_PARISC 15 /* HPPA */ + +#define EM_VPP550 17 /* Fujitsu VPP500 */ +#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ +#define EM_960 19 /* Intel 80960 */ +#define EM_PPC 20 /* PowerPC */ +#define EM_PPC64 21 /* 64-bit PowerPC */ +#define EM_S390 22 /* IBM S/390 */ + +#define EM_V800 36 /* NEC V800 series */ +#define EM_FR20 37 /* Fujitsu FR20 */ +#define EM_RH32 38 /* TRW RH32 */ +#define EM_MCORE 39 /* Motorola M*Core */ /* May also be taken by Fujitsu MMA */ +#define EM_RCE 39 /* Old name for MCore */ +#define EM_ARM 40 /* ARM */ +#define EM_OLD_ALPHA 41 /* Digital Alpha */ +#define EM_SH 42 /* Hitachi SH */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit */ +#define EM_TRICORE 44 /* Siemens Tricore embedded processor */ +#define EM_ARC 45 /* ARC Cores */ +#define EM_H8_300 46 /* Hitachi H8/300 */ +#define EM_H8_300H 47 /* Hitachi H8/300H */ +#define EM_H8S 48 /* Hitachi H8S */ +#define EM_H8_500 49 /* Hitachi H8/500 */ +#define EM_IA_64 50 /* Intel IA-64 Processor */ +#define EM_MIPS_X 51 /* Stanford MIPS-X */ +#define EM_COLDFIRE 52 /* Motorola Coldfire */ +#define EM_68HC12 53 /* Motorola M68HC12 */ +#define EM_MMA 54 /* Fujitsu Multimedia Accelerator */ +#define EM_PCP 55 /* Siemens PCP */ +#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */ +#define EM_NDR1 57 /* Denso NDR1 microprocesspr */ +#define EM_STARCORE 58 /* Motorola Star*Core processor */ +#define EM_ME16 59 /* Toyota ME16 processor */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor */ +#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor */ +#define EM_X86_64 62 /* Advanced Micro Devices X86-64 processor */ + +#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */ +#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */ +#define EM_FX66 66 /* Siemens FX66 microcontroller */ +#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ +#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */ +#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */ +#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */ +#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */ +#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */ +#define EM_SVX 73 /* Silicon Graphics SVx */ +#define EM_ST19 74 /* STMicroelectronics ST19 8-bit cpu */ +#define EM_VAX 75 /* Digital VAX */ +#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ +#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded cpu */ +#define EM_FIREPATH 78 /* Element 14 64-bit DSP processor */ +#define EM_ZSP 79 /* LSI Logic's 16-bit DSP processor */ +#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ +#define EM_HUANY 81 /* Harvard's machine-independent format */ +#define EM_PRISM 82 /* SiTera Prism */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ +#define EM_FR30 84 /* Fujitsu FR30 */ +#define EM_D10V 85 /* Mitsubishi D10V */ +#define EM_D30V 86 /* Mitsubishi D30V */ +#define EM_V850 87 /* NEC v850 */ +#define EM_M32R 88 /* Mitsubishi M32R */ +#define EM_MN10300 89 /* Matsushita MN10300 */ +#define EM_MN10200 90 /* Matsushita MN10200 */ +#define EM_PJ 91 /* picoJava */ +#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ +#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ +#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ +#define EM_IP2K 101 /* Ubicom IP2022 micro controller */ +#define EM_MSP430 105 /* TI msp430 micro controller */ /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision @@ -188,9 +192,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Normally, each entity or maintainer responsible for a machine with an unofficial e_machine number should eventually ask registry@caldera.com for - an officially blessed number to be added to the list above. */ + an officially blessed number to be added to the list above. */ -#define EM_PJ_OLD 99 /* picoJava */ +#define EM_PJ_OLD 99 /* picoJava */ /* Cygnus PowerPC ELF backend. Written in the absence of an ABI. */ #define EM_CYGNUS_POWERPC 0x9025 @@ -202,11 +206,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Old version of PowerPC, this should be removed shortly. */ #define EM_PPC_OLD 17 -/* (Depreciated) Temporary number for the OpenRISC processor. */ -#define EM_OR32 0x8472 +/* (Deprecated) Temporary number for the OpenRISC processor. */ +#define EM_OR32 0x8472 /* Cygnus M32R ELF backend. Written in the absence of an ABI. */ -#define EM_CYGNUS_M32R 0x9041 +#define EM_CYGNUS_M32R 0x9041 /* Alpha backend magic number. Written in the absence of an ABI. */ #define EM_ALPHA 0x9026 @@ -243,22 +247,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Written in the absense of an ABI. */ #define EM_DLX 0x5aa5 -#define EM_XSTORMY16 0xad45 +#define EM_XSTORMY16 0xad45 /* FRV magic number - no EABI available??. */ #define EM_CYGNUS_FRV 0x5441 /* Ubicom IP2xxx; no ABI */ -#define EM_IP2K_OLD 0x8217 +#define EM_IP2K_OLD 0x8217 /* MSP430 magic number Written in the absense everything. */ #define EM_MSP430_OLD 0x1059 -/* TI msp430 micro controller. */ -#define EM_MSP430 0x430 - -/* Vitesse IQ2000 */ +/* Vitesse IQ2000. */ #define EM_IQ2000 0xFEBA /* See the above comment before you add a new EM_* value here. */ @@ -269,7 +270,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Values for program header, p_type field. */ -#define PT_NULL 0 /* Program header table entry unused */ +#define PT_NULL 0 /* Program header table entry unused */ #define PT_LOAD 1 /* Loadable program segment */ #define PT_DYNAMIC 2 /* Dynamic linking information */ #define PT_INTERP 3 /* Program interpreter */ @@ -277,8 +278,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PT_SHLIB 5 /* Reserved, unspecified semantics */ #define PT_PHDR 6 /* Entry for header table itself */ #define PT_TLS 7 /* Thread local storage segment */ -#define PT_LOOS 0x60000000 /* OS-specific */ -#define PT_HIOS 0x6fffffff /* OS-specific */ +#define PT_LOOS 0x60000000 /* OS-specific */ +#define PT_HIOS 0x6fffffff /* OS-specific */ #define PT_LOPROC 0x70000000 /* Processor-specific */ #define PT_HIPROC 0x7FFFFFFF /* Processor-specific */ @@ -308,14 +309,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SHT_SHLIB 10 /* Reserved, unspecified semantics */ #define SHT_DYNSYM 11 /* Dynamic linking symbol table */ -#define SHT_INIT_ARRAY 14 /* Array of ptrs to init functions */ -#define SHT_FINI_ARRAY 15 /* Array of ptrs to finish functions */ +#define SHT_INIT_ARRAY 14 /* Array of ptrs to init functions */ +#define SHT_FINI_ARRAY 15 /* Array of ptrs to finish functions */ #define SHT_PREINIT_ARRAY 16 /* Array of ptrs to pre-init funcs */ -#define SHT_GROUP 17 /* Section contains a section group */ +#define SHT_GROUP 17 /* Section contains a section group */ #define SHT_SYMTAB_SHNDX 18 /* Indicies for SHN_XINDEX entries */ -#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ -#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ +#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ +#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_GNU_LIBLIST 0x6ffffff7 /* List of prelink dependencies */ @@ -344,7 +345,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SHF_MERGE (1 << 4) /* Data in this section can be merged */ #define SHF_STRINGS (1 << 5) /* Contains null terminated character strings */ #define SHF_INFO_LINK (1 << 6) /* sh_info holds section header table index */ -#define SHF_LINK_ORDER (1 << 7) /* Preserve section ordering when linking */ +#define SHF_LINK_ORDER (1 << 7) /* Preserve section ordering when linking */ #define SHF_OS_NONCONFORMING (1 << 8) /* OS specific processing required */ #define SHF_GROUP (1 << 9) /* Member of a section group */ #define SHF_TLS (1 << 10) /* Thread local storage section */ @@ -359,7 +360,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NT_FPREGSET 2 /* Contains copy of fpregset struct */ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ -#define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ +#define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ /* Note segments for core files on dir-style procfs systems. */ @@ -432,8 +433,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define STB_LOCAL 0 /* Symbol not visible outside obj */ #define STB_GLOBAL 1 /* Symbol visible outside obj */ #define STB_WEAK 2 /* Like globals, lower precedence */ -#define STB_LOOS 10 /* OS-specific semantics */ -#define STB_HIOS 12 /* OS-specific semantics */ +#define STB_LOOS 10 /* OS-specific semantics */ +#define STB_HIOS 12 /* OS-specific semantics */ #define STB_LOPROC 13 /* Application-specific semantics */ #define STB_HIPROC 15 /* Application-specific semantics */ @@ -444,8 +445,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define STT_FILE 4 /* Symbol gives a file name */ #define STT_COMMON 5 /* An uninitialised common block */ #define STT_TLS 6 /* Thread local data object */ -#define STT_LOOS 10 /* OS-specific semantics */ -#define STT_HIOS 12 /* OS-specific semantics */ +#define STT_LOOS 10 /* OS-specific semantics */ +#define STT_HIOS 12 /* OS-specific semantics */ #define STT_LOPROC 13 /* Application-specific semantics */ #define STT_HIPROC 15 /* Application-specific semantics */ @@ -456,12 +457,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SHN_LORESERVE 0xFF00 /* Begin range of reserved indices */ #define SHN_LOPROC 0xFF00 /* Begin range of appl-specific */ #define SHN_HIPROC 0xFF1F /* End range of appl-specific */ -#define SHN_LOOS 0xFF20 /* OS specific semantics, lo */ -#define SHN_HIOS 0xFF3F /* OS specific semantics, hi */ -#define SHN_ABS 0xFFF1 /* Associated symbol is absolute */ -#define SHN_COMMON 0xFFF2 /* Associated symbol is in common */ -#define SHN_XINDEX 0xFFFF /* Section index is held elsewhere */ -#define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */ +#define SHN_LOOS 0xFF20 /* OS specific semantics, lo */ +#define SHN_HIOS 0xFF3F /* OS specific semantics, hi */ +#define SHN_ABS 0xFFF1 /* Associated symbol is absolute */ +#define SHN_COMMON 0xFFF2 /* Associated symbol is in common */ +#define SHN_XINDEX 0xFFFF /* Section index is held elsewhere */ +#define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */ #define SHN_BAD ((unsigned) -1) /* Used internally by bfd */ /* The following constants control how a symbol may be accessed once it has @@ -508,32 +509,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DT_DEBUG 21 #define DT_TEXTREL 22 #define DT_JMPREL 23 -#define DT_BIND_NOW 24 -#define DT_INIT_ARRAY 25 -#define DT_FINI_ARRAY 26 +#define DT_BIND_NOW 24 +#define DT_INIT_ARRAY 25 +#define DT_FINI_ARRAY 26 #define DT_INIT_ARRAYSZ 27 #define DT_FINI_ARRAYSZ 28 -#define DT_RUNPATH 29 -#define DT_FLAGS 30 - -#define DT_ENCODING 32 +#define DT_RUNPATH 29 +#define DT_FLAGS 30 +#define DT_ENCODING 31 #define DT_PREINIT_ARRAY 32 #define DT_PREINIT_ARRAYSZ 33 /* Note, the Oct 4, 1999 draft of the ELF ABI changed the values for DT_LOOS and DT_HIOS. Some implementations however, use - values outside of the new range (see below). */ + values outside of the new range (see below). */ #define OLD_DT_LOOS 0x60000000 -#define DT_LOOS 0x6000000d -#define DT_HIOS 0x6fff0000 -#define OLD_DT_HIOS 0x6fffffff +#define DT_LOOS 0x6000000d +#define DT_HIOS 0x6fff0000 +#define OLD_DT_HIOS 0x6fffffff -#define DT_LOPROC 0x70000000 -#define DT_HIPROC 0x7fffffff +#define DT_LOPROC 0x70000000 +#define DT_HIPROC 0x7fffffff /* The next four dynamic tags are used on Solaris. We support them - everywhere. Note these values lie outside of the (new) range for - OS specific values. This is a deliberate special case and we + everywhere. Note these values lie outside of the (new) range for + OS specific values. This is a deliberate special case and we maintain it for backwards compatability. */ #define DT_VALRNGLO 0x6ffffd00 #define DT_GNU_PRELINKED 0x6ffffdf5 @@ -592,7 +592,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ defined here is the same as the one in on Solaris 8. */ #define DTF_1_CONFEXP 0x00000002 -/* Flag values used in the DT_POSFLAG_1 .dynamic entry. */ +/* Flag values used in the DT_POSFLAG_1 .dynamic entry. */ #define DF_P1_LAZYLOAD 0x00000001 #define DF_P1_GROUPPERM 0x00000002 @@ -612,7 +612,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DF_1_NODUMP 0x00001000 #define DF_1_CONLFAT 0x00002000 -/* Flag values for the DT_FLAGS entry. */ +/* Flag values for the DT_FLAGS entry. */ #define DF_ORIGIN (1 << 0) #define DF_SYMBOLIC (1 << 1) #define DF_TEXTREL (1 << 2) @@ -679,7 +679,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SYMINFO_CURRENT 1 #define SYMINFO_NUM 2 -/* Section Group Flags. */ +/* Section Group Flags. */ #define GRP_COMDAT 0x1 /* A COMDAT group */ diff --git a/include/elf/mips.h b/include/elf/mips.h index 964c59a..44f7cb9 100644 --- a/include/elf/mips.h +++ b/include/elf/mips.h @@ -99,6 +99,9 @@ END_RELOC_NUMBERS (R_MIPS_maxext) position independent code. */ #define EF_MIPS_CPIC 0x00000004 +/* ??? Unknown flag, set in IRIX 6's BSDdup2.o in libbsd.a. */ +#define EF_MIPS_XGOT 0x00000008 + /* Code in file uses UCODE (obsolete) */ #define EF_MIPS_UCODE 0x00000010 diff --git a/include/elf/ppc.h b/include/elf/ppc.h index dfb43f4..9234860 100644 --- a/include/elf/ppc.h +++ b/include/elf/ppc.h @@ -1,5 +1,6 @@ /* PPC ELF support for BFD. - Copyright 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. By Michael Meissner, Cygnus Support, , from information in the System V Application Binary Interface, PowerPC Processor Supplement @@ -70,39 +71,6 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) RELOC_NUMBER (R_PPC_SECTOFF_HA, 36) RELOC_NUMBER (R_PPC_ADDR30, 37) -/* The following relocs are from the 64-bit PowerPC ELF ABI. */ - RELOC_NUMBER (R_PPC64_ADDR64, 38) - RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39) - RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40) - RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41) - RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42) - RELOC_NUMBER (R_PPC64_UADDR64, 43) - RELOC_NUMBER (R_PPC64_REL64, 44) - RELOC_NUMBER (R_PPC64_PLT64, 45) - RELOC_NUMBER (R_PPC64_PLTREL64, 46) - RELOC_NUMBER (R_PPC64_TOC16, 47) - RELOC_NUMBER (R_PPC64_TOC16_LO, 48) - RELOC_NUMBER (R_PPC64_TOC16_HI, 49) - RELOC_NUMBER (R_PPC64_TOC16_HA, 50) - RELOC_NUMBER (R_PPC64_TOC, 51) - RELOC_NUMBER (R_PPC64_PLTGOT16, 52) - RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53) - RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54) - RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55) - -/* The following relocs were added in the 64-bit PowerPC ELF ABI revision 1.2. */ - RELOC_NUMBER (R_PPC64_ADDR16_DS, 56) - RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57) - RELOC_NUMBER (R_PPC64_GOT16_DS, 58) - RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59) - RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60) - RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61) - RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62) - RELOC_NUMBER (R_PPC64_TOC16_DS, 63) - RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64) - RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65) - RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66) - /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ RELOC_NUMBER (R_PPC_EMB_NADDR32, 101) @@ -132,51 +100,6 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) END_RELOC_NUMBERS (R_PPC_max) -/* Aliases for R_PPC64-relocs. */ -#define R_PPC64_NONE R_PPC_NONE -#define R_PPC64_ADDR32 R_PPC_ADDR32 -#define R_PPC64_ADDR24 R_PPC_ADDR24 -#define R_PPC64_ADDR16 R_PPC_ADDR16 -#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO -#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI -#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA -#define R_PPC64_ADDR14 R_PPC_ADDR14 -#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN -#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN -#define R_PPC64_REL24 R_PPC_REL24 -#define R_PPC64_REL14 R_PPC_REL14 -#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN -#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN -#define R_PPC64_GOT16 R_PPC_GOT16 -#define R_PPC64_GOT16_LO R_PPC_GOT16_LO -#define R_PPC64_GOT16_HI R_PPC_GOT16_HI -#define R_PPC64_GOT16_HA R_PPC_GOT16_HA -#define R_PPC64_COPY R_PPC_COPY -#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT -#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT -#define R_PPC64_RELATIVE R_PPC_RELATIVE -#define R_PPC64_UADDR32 R_PPC_UADDR32 -#define R_PPC64_UADDR16 R_PPC_UADDR16 -#define R_PPC64_REL32 R_PPC_REL32 -#define R_PPC64_PLT32 R_PPC_PLT32 -#define R_PPC64_PLTREL32 R_PPC_PLTREL32 -#define R_PPC64_PLT16_LO R_PPC_PLT16_LO -#define R_PPC64_PLT16_HI R_PPC_PLT16_HI -#define R_PPC64_PLT16_HA R_PPC_PLT16_HA -#define R_PPC64_SECTOFF R_PPC_SECTOFF -#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO -#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI -#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA -#define R_PPC64_ADDR30 R_PPC_ADDR30 -#define R_PPC64_GNU_VTINHERIT R_PPC_GNU_VTINHERIT -#define R_PPC64_GNU_VTENTRY R_PPC_GNU_VTENTRY - -/* Specify the start of the .glink section. */ -#define DT_PPC64_GLINK DT_LOPROC - -/* Specify the start and size of the .opd section. */ -#define DT_PPC64_OPD (DT_LOPROC + 1) -#define DT_PPC64_OPDSZ (DT_LOPROC + 2) /* Processor specific flags for the ELF header e_flags field. */ diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h new file mode 100644 index 0000000..1cbb639 --- /dev/null +++ b/include/elf/ppc64.h @@ -0,0 +1,111 @@ +/* PPC64 ELF support for BFD. + Copyright 2003 Free Software Foundation, Inc. + +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 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 _ELF_PPC64_H +#define _ELF_PPC64_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +START_RELOC_NUMBERS (elf_ppc64_reloc_type) + RELOC_NUMBER (R_PPC64_NONE, 0) + RELOC_NUMBER (R_PPC64_ADDR32, 1) + RELOC_NUMBER (R_PPC64_ADDR24, 2) + RELOC_NUMBER (R_PPC64_ADDR16, 3) + RELOC_NUMBER (R_PPC64_ADDR16_LO, 4) + RELOC_NUMBER (R_PPC64_ADDR16_HI, 5) + RELOC_NUMBER (R_PPC64_ADDR16_HA, 6) + RELOC_NUMBER (R_PPC64_ADDR14, 7) + RELOC_NUMBER (R_PPC64_ADDR14_BRTAKEN, 8) + RELOC_NUMBER (R_PPC64_ADDR14_BRNTAKEN, 9) + RELOC_NUMBER (R_PPC64_REL24, 10) + RELOC_NUMBER (R_PPC64_REL14, 11) + RELOC_NUMBER (R_PPC64_REL14_BRTAKEN, 12) + RELOC_NUMBER (R_PPC64_REL14_BRNTAKEN, 13) + RELOC_NUMBER (R_PPC64_GOT16, 14) + RELOC_NUMBER (R_PPC64_GOT16_LO, 15) + RELOC_NUMBER (R_PPC64_GOT16_HI, 16) + RELOC_NUMBER (R_PPC64_GOT16_HA, 17) + /* 18 unused. 32-bit reloc is R_PPC_PLTREL24. */ + RELOC_NUMBER (R_PPC64_COPY, 19) + RELOC_NUMBER (R_PPC64_GLOB_DAT, 20) + RELOC_NUMBER (R_PPC64_JMP_SLOT, 21) + RELOC_NUMBER (R_PPC64_RELATIVE, 22) + /* 23 unused. 32-bit reloc is R_PPC_LOCAL24PC. */ + RELOC_NUMBER (R_PPC64_UADDR32, 24) + RELOC_NUMBER (R_PPC64_UADDR16, 25) + RELOC_NUMBER (R_PPC64_REL32, 26) + RELOC_NUMBER (R_PPC64_PLT32, 27) + RELOC_NUMBER (R_PPC64_PLTREL32, 28) + RELOC_NUMBER (R_PPC64_PLT16_LO, 29) + RELOC_NUMBER (R_PPC64_PLT16_HI, 30) + RELOC_NUMBER (R_PPC64_PLT16_HA, 31) + /* 32 unused. 32-bit reloc is R_PPC_SDAREL16. */ + RELOC_NUMBER (R_PPC64_SECTOFF, 33) + RELOC_NUMBER (R_PPC64_SECTOFF_LO, 34) + RELOC_NUMBER (R_PPC64_SECTOFF_HI, 35) + RELOC_NUMBER (R_PPC64_SECTOFF_HA, 36) + RELOC_NUMBER (R_PPC64_REL30, 37) + RELOC_NUMBER (R_PPC64_ADDR64, 38) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42) + RELOC_NUMBER (R_PPC64_UADDR64, 43) + RELOC_NUMBER (R_PPC64_REL64, 44) + RELOC_NUMBER (R_PPC64_PLT64, 45) + RELOC_NUMBER (R_PPC64_PLTREL64, 46) + RELOC_NUMBER (R_PPC64_TOC16, 47) + RELOC_NUMBER (R_PPC64_TOC16_LO, 48) + RELOC_NUMBER (R_PPC64_TOC16_HI, 49) + RELOC_NUMBER (R_PPC64_TOC16_HA, 50) + RELOC_NUMBER (R_PPC64_TOC, 51) + RELOC_NUMBER (R_PPC64_PLTGOT16, 52) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53) + RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54) + RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55) + +/* The following relocs were added in the 64-bit PowerPC ELF ABI + revision 1.2. */ + RELOC_NUMBER (R_PPC64_ADDR16_DS, 56) + RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57) + RELOC_NUMBER (R_PPC64_GOT16_DS, 58) + RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59) + RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60) + RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61) + RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62) + RELOC_NUMBER (R_PPC64_TOC16_DS, 63) + RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64) + RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66) + + /* These are GNU extensions to enable C++ vtable garbage collection. */ + RELOC_NUMBER (R_PPC64_GNU_VTINHERIT, 253) + RELOC_NUMBER (R_PPC64_GNU_VTENTRY, 254) + +END_RELOC_NUMBERS (R_PPC64_max) + +/* Specify the start of the .glink section. */ +#define DT_PPC64_GLINK DT_LOPROC + +/* Specify the start and size of the .opd section. */ +#define DT_PPC64_OPD (DT_LOPROC + 1) +#define DT_PPC64_OPDSZ (DT_LOPROC + 2) + +#endif /* _ELF_PPC64_H */ diff --git a/include/elf/s390.h b/include/elf/s390.h index 8b67c96..6a21c3b 100644 --- a/include/elf/s390.h +++ b/include/elf/s390.h @@ -49,7 +49,7 @@ START_RELOC_NUMBERS (elf_s390_reloc_type) RELOC_NUMBER (R_390_GLOB_DAT, 10) /* Create GOT entry. */ RELOC_NUMBER (R_390_JMP_SLOT, 11) /* Create PLT entry. */ RELOC_NUMBER (R_390_RELATIVE, 12) /* Adjust by program base. */ - RELOC_NUMBER (R_390_GOTOFF, 13) /* 32 bit offset to GOT. */ + RELOC_NUMBER (R_390_GOTOFF32, 13) /* 32 bit offset to GOT. */ RELOC_NUMBER (R_390_GOTPC, 14) /* 32 bit PC relative offset to GOT. */ RELOC_NUMBER (R_390_GOT16, 15) /* 16 bit GOT offset. */ RELOC_NUMBER (R_390_PC16, 16) /* PC relative 16 bit. */ @@ -63,6 +63,53 @@ START_RELOC_NUMBERS (elf_s390_reloc_type) RELOC_NUMBER (R_390_GOT64, 24) /* 64 bit GOT offset. */ RELOC_NUMBER (R_390_PLT64, 25) /* 64 bit PC relative PLT address. */ RELOC_NUMBER (R_390_GOTENT, 26) /* 32 bit PC rel. to GOT entry >> 1. */ + RELOC_NUMBER (R_390_GOTOFF16, 27) /* 16 bit offset to GOT. */ + RELOC_NUMBER (R_390_GOTOFF64, 28) /* 64 bit offset to GOT. */ + RELOC_NUMBER (R_390_GOTPLT12, 29) /* 12 bit offset to jump slot. */ + RELOC_NUMBER (R_390_GOTPLT16, 30) /* 16 bit offset to jump slot. */ + RELOC_NUMBER (R_390_GOTPLT32, 31) /* 32 bit offset to jump slot. */ + RELOC_NUMBER (R_390_GOTPLT64, 32) /* 64 bit offset to jump slot. */ + RELOC_NUMBER (R_390_GOTPLTENT, 33) /* 32 bit rel. offset to jump slot. */ + RELOC_NUMBER (R_390_PLTOFF16, 34) /* 16 bit offset from GOT to PLT. */ + RELOC_NUMBER (R_390_PLTOFF32, 35) /* 32 bit offset from GOT to PLT. */ + RELOC_NUMBER (R_390_PLTOFF64, 36) /* 16 bit offset from GOT to PLT. */ + RELOC_NUMBER (R_390_TLS_LOAD, 37) /* Tag for load insn in TLS code. */ + RELOC_NUMBER (R_390_TLS_GDCALL, 38) /* Tag for function call in general + dynamic TLS code. */ + RELOC_NUMBER (R_390_TLS_LDCALL, 39) /* Tag for function call in local + dynamic TLS code. */ + RELOC_NUMBER (R_390_TLS_GD32, 40) /* Direct 32 bit for general dynamic + thread local data. */ + RELOC_NUMBER (R_390_TLS_GD64, 41) /* Direct 64 bit for general dynamic + thread local data. */ + RELOC_NUMBER (R_390_TLS_GOTIE12, 42)/* 12 bit GOT offset for static TLS + block offset. */ + RELOC_NUMBER (R_390_TLS_GOTIE32, 43)/* 32 bit GOT offset for static TLS + block offset. */ + RELOC_NUMBER (R_390_TLS_GOTIE64, 44)/* 64 bit GOT offset for static TLS + block offset. */ + RELOC_NUMBER (R_390_TLS_LDM32, 45) /* Direct 32 bit for local dynamic + thread local data in LD code. */ + RELOC_NUMBER (R_390_TLS_LDM64, 46) /* Direct 64 bit for local dynamic + thread local data in LD code. */ + RELOC_NUMBER (R_390_TLS_IE32, 47) /* 32 bit address of GOT entry for + negated static TLS block offset. */ + RELOC_NUMBER (R_390_TLS_IE64, 48) /* 64 bit address of GOT entry for + negated static TLS block offset. */ + RELOC_NUMBER (R_390_TLS_IEENT, 49) /* 32 bit rel. offset to GOT entry for + negated static TLS block offset. */ + RELOC_NUMBER (R_390_TLS_LE32, 50) /* 32 bit negated offset relative to + static TLS block. */ + RELOC_NUMBER (R_390_TLS_LE64, 51) /* 64 bit negated offset relative to + static TLS block. */ + RELOC_NUMBER (R_390_TLS_LDO32, 52) /* 32 bit offset relative to TLS + block. */ + RELOC_NUMBER (R_390_TLS_LDO64, 53) /* 64 bit offset relative to TLS + block. */ + RELOC_NUMBER (R_390_TLS_DTPMOD, 54) /* ID of module containing symbol. */ + RELOC_NUMBER (R_390_TLS_DTPOFF, 55) /* Offset in TLS block. */ + RELOC_NUMBER (R_390_TLS_TPOFF, 56) /* Negate offset in static TLS + block. */ /* These are GNU extensions to enable C++ vtable garbage collection. */ RELOC_NUMBER (R_390_GNU_VTINHERIT, 250) RELOC_NUMBER (R_390_GNU_VTENTRY, 251) diff --git a/include/elf/sh.h b/include/elf/sh.h index 68a2c54..41bf0bf 100644 --- a/include/elf/sh.h +++ b/include/elf/sh.h @@ -1,5 +1,5 @@ /* SH ELF support for BFD. - Copyright 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,6 +33,7 @@ #define EF_SH_HAS_FP(flags) ((flags) & 8) #define EF_SH3E 8 #define EF_SH4 9 +#define EF_SH2E 11 /* This one can only mix in objects from other EF_SH5 objects. */ #define EF_SH5 10 @@ -45,6 +46,13 @@ : (((mach1) < EF_SH3 && (mach2) == EF_SH_UNKNOWN) \ || ((mach2) < EF_SH3 && (mach1) == EF_SH_UNKNOWN)) \ ? EF_SH3 \ + : ((mach1) == EF_SH2E && EF_SH_HAS_FP (mach2)) \ + ? (mach2) \ + : ((mach2) == EF_SH2E && EF_SH_HAS_FP (mach1)) \ + ? (mach1) \ + : (((mach1) == EF_SH2E && (mach2) == EF_SH_UNKNOWN) \ + || ((mach2) == EF_SH2E && (mach1) == EF_SH_UNKNOWN)) \ + ? EF_SH2E \ : (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \ || ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \ ? EF_SH4 \ @@ -71,61 +79,6 @@ symbols). */ #define STT_DATALABEL STT_LOPROC -#define SH64_CRANGES_SECTION_NAME ".cranges" -enum sh64_elf_cr_type { - CRT_NONE = 0, - CRT_DATA = 1, - CRT_SH5_ISA16 = 2, - CRT_SH5_ISA32 = 3 -}; - -/* The official definition is this: - - typedef struct { - Elf32_Addr cr_addr; - Elf32_Word cr_size; - Elf32_Half cr_type; - } Elf32_CRange; - - but we have no use for that exact type. Instead we use this struct for - the internal representation. */ -typedef struct { - bfd_vma cr_addr; - bfd_size_type cr_size; - enum sh64_elf_cr_type cr_type; -} sh64_elf_crange; - -#define SH64_CRANGE_SIZE (4 + 4 + 2) -#define SH64_CRANGE_CR_ADDR_OFFSET 0 -#define SH64_CRANGE_CR_SIZE_OFFSET 4 -#define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4) - -/* Get the contents type of an arbitrary address, or return CRT_NONE. */ -extern enum sh64_elf_cr_type sh64_get_contents_type - PARAMS ((asection *, bfd_vma, sh64_elf_crange *)); - -/* Simpler interface. - FIXME: This seems redundant now that we export the interface above. */ -extern bfd_boolean sh64_address_is_shmedia PARAMS ((asection *, bfd_vma)); - -extern int _bfd_sh64_crange_qsort_cmpb PARAMS ((const void *, const void *)); -extern int _bfd_sh64_crange_qsort_cmpl PARAMS ((const void *, const void *)); -extern int _bfd_sh64_crange_bsearch_cmpb PARAMS ((const void *, const void *)); -extern int _bfd_sh64_crange_bsearch_cmpl PARAMS ((const void *, const void *)); - -/* We put this in elf_section_data (section)->tdata. */ -struct sh64_section_data -{ - flagword contents_flags; - - /* Only used in the cranges section, but we don't have an official - backend-specific bfd field. */ - bfd_size_type cranges_growth; -}; - -#define sh64_elf_section_data(sec) \ - ((struct sh64_section_data *) ((elf_section_data (sec))->tdata)) - #include "elf/reloc-macros.h" /* Relocations. */ diff --git a/include/elf/sparc.h b/include/elf/sparc.h index 7c780f7..2d28d26 100644 --- a/include/elf/sparc.h +++ b/include/elf/sparc.h @@ -1,5 +1,5 @@ /* SPARC ELF support for BFD. - Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. By Doug Evans, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. @@ -126,13 +126,36 @@ START_RELOC_NUMBERS (elf_sparc_reloc_type) RELOC_NUMBER (R_SPARC_UA64, 54) RELOC_NUMBER (R_SPARC_UA16, 55) - /* little endian data relocs */ - RELOC_NUMBER (R_SPARC_REV32, 56) - + RELOC_NUMBER (R_SPARC_TLS_GD_HI22, 56) + RELOC_NUMBER (R_SPARC_TLS_GD_LO10, 57) + RELOC_NUMBER (R_SPARC_TLS_GD_ADD, 58) + RELOC_NUMBER (R_SPARC_TLS_GD_CALL, 59) + RELOC_NUMBER (R_SPARC_TLS_LDM_HI22, 60) + RELOC_NUMBER (R_SPARC_TLS_LDM_LO10, 61) + RELOC_NUMBER (R_SPARC_TLS_LDM_ADD, 62) + RELOC_NUMBER (R_SPARC_TLS_LDM_CALL, 63) + RELOC_NUMBER (R_SPARC_TLS_LDO_HIX22, 64) + RELOC_NUMBER (R_SPARC_TLS_LDO_LOX10, 65) + RELOC_NUMBER (R_SPARC_TLS_LDO_ADD, 66) + RELOC_NUMBER (R_SPARC_TLS_IE_HI22, 67) + RELOC_NUMBER (R_SPARC_TLS_IE_LO10, 68) + RELOC_NUMBER (R_SPARC_TLS_IE_LD, 69) + RELOC_NUMBER (R_SPARC_TLS_IE_LDX, 70) + RELOC_NUMBER (R_SPARC_TLS_IE_ADD, 71) + RELOC_NUMBER (R_SPARC_TLS_LE_HIX22, 72) + RELOC_NUMBER (R_SPARC_TLS_LE_LOX10, 73) + RELOC_NUMBER (R_SPARC_TLS_DTPMOD32, 74) + RELOC_NUMBER (R_SPARC_TLS_DTPMOD64, 75) + RELOC_NUMBER (R_SPARC_TLS_DTPOFF32, 76) + RELOC_NUMBER (R_SPARC_TLS_DTPOFF64, 77) + RELOC_NUMBER (R_SPARC_TLS_TPOFF32, 78) + RELOC_NUMBER (R_SPARC_TLS_TPOFF64, 79) + EMPTY_RELOC (R_SPARC_max_std) RELOC_NUMBER (R_SPARC_GNU_VTINHERIT, 250) RELOC_NUMBER (R_SPARC_GNU_VTENTRY, 251) + RELOC_NUMBER (R_SPARC_REV32, 252) END_RELOC_NUMBERS (R_SPARC_max) diff --git a/include/hashtab.h b/include/hashtab.h index be866b5..4995a9a 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -1,5 +1,5 @@ /* An expandable hash tables datatype. - Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). This program is free software; you can redistribute it and/or modify @@ -76,10 +76,16 @@ typedef PTR (*htab_alloc) PARAMS ((size_t, size_t)); /* We also need a free() routine. */ typedef void (*htab_free) PARAMS ((PTR)); +/* Memory allocation and deallocation; variants which take an extra + argument. */ +typedef PTR (*htab_alloc_with_arg) PARAMS ((void *, size_t, size_t)); +typedef void (*htab_free_with_arg) PARAMS ((void *, void *)); + /* Hash tables are of the following type. The structure (implementation) of this type is not needed for using the hash tables. All work with hash table should be executed only through - functions mentioned below. */ + functions mentioned below. The size of this structure is subject to + change. */ struct htab GTY(()) { @@ -115,6 +121,11 @@ struct htab GTY(()) /* Pointers to allocate/free functions. */ htab_alloc alloc_f; htab_free free_f; + + /* Alternate allocate/free functions, which take an extra argument. */ + PTR GTY((skip (""))) alloc_arg; + htab_alloc_with_arg alloc_with_arg_f; + htab_free_with_arg free_with_arg_f; }; typedef struct htab *htab_t; @@ -128,10 +139,20 @@ extern htab_t htab_create_alloc PARAMS ((size_t, htab_hash, htab_eq, htab_del, htab_alloc, htab_free)); +extern htab_t htab_create_alloc_ex PARAMS ((size_t, htab_hash, + htab_eq, htab_del, + PTR, htab_alloc_with_arg, + htab_free_with_arg)); + /* Backward-compatibility functions. */ extern htab_t htab_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); extern htab_t htab_try_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); +extern void htab_set_functions_ex PARAMS ((htab_t, htab_hash, + htab_eq, htab_del, + PTR, htab_alloc_with_arg, + htab_free_with_arg)); + extern void htab_delete PARAMS ((htab_t)); extern void htab_empty PARAMS ((htab_t)); diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index e40f056..c7c4484 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2003-01-23 Alan Modra + + * m68hc11.h (cpu6812s): Define. + 2003-01-07 Chris Demetriou * mips.h: Fix missing space in comment. diff --git a/include/opcode/hppa.h b/include/opcode/hppa.h index 4711617..8234664 100644 --- a/include/opcode/hppa.h +++ b/include/opcode/hppa.h @@ -407,6 +407,7 @@ static const struct pa_opcode pa_opcodes[] = { "ldbx", 0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, 0}, { "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT}, { "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT}, +{ "ldwa", 0x0c0011a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT}, { "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT}, { "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT}, { "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT}, @@ -417,6 +418,7 @@ static const struct pa_opcode pa_opcodes[] = { "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT}, { "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT}, { "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT}, +{ "ldda", 0x0c001120, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT}, { "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT}, { "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT}, { "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT}, diff --git a/include/opcode/m68hc11.h b/include/opcode/m68hc11.h index a538026..5d2fc9b 100644 --- a/include/opcode/m68hc11.h +++ b/include/opcode/m68hc11.h @@ -1,5 +1,5 @@ /* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table - Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -388,6 +388,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * /* CPU identification. */ #define cpu6811 0x01 #define cpu6812 0x02 +#define cpu6812s 0x04 /* The opcode table is an array of struct m68hc11_opcode. */ struct m68hc11_opcode { @@ -424,4 +425,3 @@ extern const struct m68hc12_opcode_alias m68hc12_alias[]; extern const int m68hc12_num_alias; #endif /* _OPCODE_M68HC11_H */ - diff --git a/include/splay-tree.h b/include/splay-tree.h index 23f7ac6..86707fc 100644 --- a/include/splay-tree.h +++ b/include/splay-tree.h @@ -36,6 +36,10 @@ extern "C" { #include "ansidecl.h" +#ifndef GTY +#define GTY(X) +#endif + /* Use typedefs for the key and data types to facilitate changing these types, if necessary. These types should be sufficiently wide that any pointer or scalar can be cast to these types, and then @@ -65,7 +69,7 @@ typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*)); node structures. The first argument is the number of bytes needed; the second is a data pointer the splay tree functions pass through to the allocator. This function must never return zero. */ -typedef void *(*splay_tree_allocate_fn) PARAMS((int, void *)); +typedef PTR (*splay_tree_allocate_fn) PARAMS((int, void *)); /* The type of a function used to free memory allocated using the corresponding splay_tree_allocate_fn. The first argument is the @@ -74,24 +78,24 @@ typedef void *(*splay_tree_allocate_fn) PARAMS((int, void *)); typedef void (*splay_tree_deallocate_fn) PARAMS((void *, void *)); /* The nodes in the splay tree. */ -struct splay_tree_node_s +struct splay_tree_node_s GTY(()) { /* The key. */ - splay_tree_key key; + splay_tree_key GTY ((use_param1 (""))) key; /* The value. */ - splay_tree_value value; + splay_tree_value GTY ((use_param2 (""))) value; /* The left and right children, respectively. */ - splay_tree_node left; - splay_tree_node right; + splay_tree_node GTY ((use_params (""))) left; + splay_tree_node GTY ((use_params (""))) right; }; /* The splay tree itself. */ -typedef struct splay_tree_s +struct splay_tree_s GTY(()) { /* The root of the tree. */ - splay_tree_node root; + splay_tree_node GTY ((use_params (""))) root; /* The comparision function. */ splay_tree_compare_fn comp; @@ -105,9 +109,10 @@ typedef struct splay_tree_s /* Allocate/free functions, and a data pointer to pass to them. */ splay_tree_allocate_fn allocate; splay_tree_deallocate_fn deallocate; - void *allocate_data; + PTR GTY((skip (""))) allocate_data; -} *splay_tree; +}; +typedef struct splay_tree_s *splay_tree; extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn, splay_tree_delete_key_fn, diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 3b236b0..9945c9c 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,61 @@ +2003-01-30 Christian Cornelssen + + * Makefile.in (libiberty_topdir): New subst. + (mkinstalldirs): Redefine in terms of the above. + * configure.in: AC_SUBST it. + * configure: Regenerate. + +2003-01-28 Christian Cornelssen + + * Makefile.in (all-subdir, check-subdir, installcheck-subdir) + (info-subdir, install-info-subdir, clean-info-subdir) + (dvi-subdir, install-subdir, etags-subdir, mostlyclean-subdir) + (clean-subdir, distclean-subdir, maintainer-clean-subdir): + Pass $(FLAGS_TO_PASS). + +2003-01-27 Alexandre Oliva + + * Makefile.in (install_to_tooldir): Instead of $(MULTISUBDIR), use + /`$$CC -print-multi-os-directory`. + +2003-01-26 Daniel Jacobowitz + + * hashtab.c (htab_create_alloc_ex): New function. + (hatab_set_functions_ex): New function. + (htab_delete, htab_expand): Support alternate allocation functions. + +2003-01-24 Christopher Faylor + + * configure.in: Remove special pex-cygwin consideration. + * configure: Regenerate. + * pex-cygwin.c: Remove. + * Makefile.in: Remove pex-cygwin.[co] lines. + +2003-01-24 Zack Weinberg + + * Makefile.in (CFILES): Add pex-*.c. + (REQUIRED_OFILES): Change pexecute.o to @pexecute@ + (CONFIGURED_OFILES): Add pex-*.o. + (TEXIFILES): Add pexecute.txh. + (pexecute.o): Delete rule. + (pex-cygwin.o, pex-djgpp.o, pex-mpw.o, pex-msdos.o, pex-os2.o, + pex-unix.o, pex-win32.o): New rules. + * configure.in: Change AC_INIT argument to xmalloc.c. + Compute appropriate pexecute implementation and substitute it + as @pexecute@. + + * pexecute.c: Split up into... + * pex-cygwin.c, pex-djgpp.c, pex-mpw.c, pex-msdos.c, pex-os2.c, + pex-unix.c, pex-win32.c, pex-common.h, pexecute.txh: ... these + new files. + + * functions.texi: Regenerate. + * configure: Regenerate. + +2003-01-20 Josef Zlomek + + * hashtab.c (htab_expand): Fix allocation of new entries. + 2003-01-09 Christian Cornelssen * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 1af4c32..761c674 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91-99, 2000, 2001, 2002 +# Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003 # Free Software Foundation # # This file is part of the libiberty library. @@ -26,6 +26,7 @@ # Makefile for libiberty directory # +libiberty_topdir = @libiberty_topdir@ srcdir = @srcdir@ VPATH = @srcdir@ @@ -50,7 +51,7 @@ MULTICLEAN = true INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs +mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs # Some compilers can't handle cc -c blah.c -o foo/blah.o. OUTPUT_OPTION = @OUTPUT_OPTION@ @@ -140,7 +141,10 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ memset.c mkstemps.c \ objalloc.c obstack.c \ - partition.c pexecute.c putenv.c \ + partition.c \ + pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \ + pex-unix.c pex-win32.c \ + putenv.c \ random.c regex.c rename.c rindex.c \ safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \ splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \ @@ -164,7 +168,7 @@ REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \ make-relative-prefix.o \ make-temp-file.o \ objalloc.o obstack.o \ - partition.o pexecute.o \ + partition.o @pexecute@ \ safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \ strsignal.o \ ternary.o \ @@ -181,7 +185,9 @@ CONFIGURED_OFILES = asprintf.o atexit.o \ getcwd.o getpagesize.o \ index.o insque.o \ memchr.o memcmp.o memcpy.o memmove.o memset.o mkstemps.o \ - putenv.o \ + pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ + pex-unix.o pex-win32.o \ + putenv.o \ random.o rename.o rindex.o \ setenv.o sigsetmask.o strcasecmp.o strchr.o strdup.o \ strncasecmp.o strncmp.o strrchr.o strstr.o strtod.o strtol.o \ @@ -240,7 +246,7 @@ TEXISRC = \ # Additional files that have texi snippets that need to be collected # and sorted. Some are here because the sources are imported from # elsewhere. Others represent headers in ../include. -TEXIFILES = fnmatch.txh +TEXIFILES = fnmatch.txh pexecute.txh libiberty.info : $(srcdir)/libiberty.texi $(TEXISRC) $(MAKEINFO) -I$(srcdir) $(srcdir)/libiberty.texi @@ -279,10 +285,10 @@ install_to_libdir: all @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install install_to_tooldir: all - ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR) - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n - ( cd $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) - mv -f $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) + ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n + ( cd $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` ; $(RANLIB) $(TARGETLIB)n ) + mv -f $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install # needed-list is used by libstdc++. NEEDED is the list of functions @@ -393,7 +399,7 @@ maintainer-clean-subdir: config.h @subdirs='$(SUBDIRS)'; \ target=`echo $@ | sed -e 's/-subdir//'`; \ for dir in $$subdirs ; do \ - cd $$dir && $(MAKE) $$target; \ + cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $$target; \ done $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir @@ -450,8 +456,13 @@ objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h obstack.o: config.h $(INCDIR)/obstack.h partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/partition.h -pexecute.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +pex-djgpp.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-mpw.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h +pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h putenv.o: config.h $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h diff --git a/libiberty/configure b/libiberty/configure index cac9f56..86037ae 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -465,7 +465,7 @@ echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=pexecute.c +ac_unique_file=xmalloc.c # Find the source files, if location was not specified. if test -z "$srcdir"; then @@ -583,6 +583,7 @@ if test "${srcdir}" = "."; then else libiberty_topdir="${srcdir}/.." fi + ac_aux_dir= for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do if test -f $ac_dir/install-sh; then @@ -605,7 +606,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:609: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:610: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -630,7 +631,7 @@ fi # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:634: checking for $ac_word" >&5 +echo "configure:635: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -676,7 +677,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:680: checking for $ac_word" >&5 +echo "configure:681: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -716,7 +717,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:720: checking host system type" >&5 +echo "configure:721: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -739,7 +740,7 @@ echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:743: checking build system type" >&5 +echo "configure:744: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -765,7 +766,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:769: checking for $ac_word" >&5 +echo "configure:770: 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 @@ -797,7 +798,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:801: checking for $ac_word" >&5 +echo "configure:802: 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 @@ -829,7 +830,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:833: checking for $ac_word" >&5 +echo "configure:834: 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 @@ -866,7 +867,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:870: checking for $ac_word" >&5 +echo "configure:871: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -896,7 +897,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:900: checking for $ac_word" >&5 +echo "configure:901: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -945,7 +946,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:949: checking whether we are using GNU C" >&5 +echo "configure:950: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -954,7 +955,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -970,7 +971,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:974: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:975: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1002,10 +1003,10 @@ fi if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1006: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1009: checking whether cc understands -c and -o together" >&5 +echo "configure:1010: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1017,16 +1018,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1062,7 +1063,7 @@ fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1066: checking for POSIXized ISC" >&5 +echo "configure:1067: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1083,12 +1084,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1087: checking for working const" >&5 +echo "configure:1088: 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:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1158,21 +1159,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1162: checking for inline" >&5 +echo "configure:1163: 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:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1215,7 +1216,7 @@ esac # 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:1219: checking for a BSD compatible install" >&5 +echo "configure:1220: 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 @@ -1276,7 +1277,7 @@ host_makefile_frag=${frag} # able to link anything, it had better be able to at least compile # something. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1280: checking how to run the C preprocessor" >&5 +echo "configure:1281: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1291,13 +1292,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1302: \"$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 : @@ -1308,13 +1309,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1319: \"$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 : @@ -1325,13 +1326,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1336: \"$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 : @@ -1359,17 +1360,17 @@ for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1363: checking for $ac_hdr" >&5 +echo "configure:1364: 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:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1374: \"$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* @@ -1396,12 +1397,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1400: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1417,7 +1418,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1438,12 +1439,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1442: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1452,7 +1453,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1474,19 +1475,19 @@ fi echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 -echo "configure:1478: checking whether errno must be declared" >&5 +echo "configure:1479: checking whether errno must be declared" >&5 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int x = errno; ; return 0; } EOF -if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_declare_errno=no else @@ -1508,12 +1509,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1512: checking for ANSI C header files" >&5 +echo "configure:1513: 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 @@ -1521,7 +1522,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1526: \"$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* @@ -1538,7 +1539,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 @@ -1556,7 +1557,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 @@ -1577,7 +1578,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1588,7 +1589,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1612,12 +1613,12 @@ EOF fi echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 -echo "configure:1616: checking for uintptr_t" >&5 +echo "configure:1617: checking for uintptr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1654,12 +1655,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1658: checking for pid_t" >&5 +echo "configure:1659: 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 @@ -1744,12 +1745,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1748: checking for $ac_func" >&5 +echo "configure:1749: 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:1777: \"$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 @@ -1799,12 +1800,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1803: checking for $ac_func" >&5 +echo "configure:1804: 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:1832: \"$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 @@ -1854,12 +1855,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1858: checking for $ac_func" >&5 +echo "configure:1859: 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:1887: \"$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 @@ -1909,12 +1910,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1913: checking for $ac_func" >&5 +echo "configure:1914: 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:1942: \"$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 @@ -1964,12 +1965,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1968: checking for $ac_func" >&5 +echo "configure:1969: 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:1997: \"$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 @@ -2019,12 +2020,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2023: checking for $ac_func" >&5 +echo "configure:2024: 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:2052: \"$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 @@ -2074,12 +2075,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2078: checking for $ac_func" >&5 +echo "configure:2079: 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:2107: \"$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 @@ -2332,7 +2333,7 @@ if test -z "${setobjs}"; then # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2336: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2337: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2343,12 +2344,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2347 "configure" +#line 2348 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2374,19 +2375,19 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2378: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2379: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2385: checking for $ac_func" >&5 +echo "configure:2386: 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:2414: \"$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 @@ -2436,12 +2437,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2440: checking whether alloca needs Cray hooks" >&5 +echo "configure:2441: 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:2470: checking for $ac_func" >&5 +echo "configure:2471: 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:2499: \"$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 @@ -2520,7 +2521,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2524: checking stack direction for C alloca" >&5 +echo "configure:2525: 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 @@ -2528,7 +2529,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:2552: \"$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 @@ -2569,17 +2570,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2573: checking for vfork.h" >&5 +echo "configure:2574: 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:2583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2584: \"$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* @@ -2604,18 +2605,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2608: checking for working vfork" >&5 +echo "configure:2609: 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:2614: checking for vfork" >&5 +echo "configure:2615: 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:2643: \"$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 @@ -2660,7 +2661,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2755,7 +2756,7 @@ main() { } } EOF -if { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2760: \"$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 @@ -2787,12 +2788,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2791: checking for $ac_func" >&5 +echo "configure:2792: 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:2820: \"$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 @@ -2845,12 +2846,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2849: checking for $ac_func" >&5 +echo "configure:2850: 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:2878: \"$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 @@ -2901,19 +2902,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2905: checking for $v" >&5 +echo "configure:2906: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+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:2918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2939,12 +2940,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2943: checking for $ac_func" >&5 +echo "configure:2944: 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:2972: \"$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 @@ -2993,21 +2994,31 @@ done fi +# Figure out which version of pexecute to use. +case "${host}" in + *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; + *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; + *-*-msdos*) pexecute=pex-msdos.o ;; + *-*-os2-emx*) pexecute=pex-os2.o ;; + *) pexecute=pex-unix.o ;; +esac + + for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3001: checking for $ac_hdr" >&5 +echo "configure:3012: 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:3011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3022: \"$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* @@ -3036,12 +3047,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3040: checking for $ac_func" >&5 +echo "configure:3051: 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:3079: \"$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 @@ -3089,7 +3100,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3093: checking for working mmap" >&5 +echo "configure:3104: 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 @@ -3097,7 +3108,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:3265: \"$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 @@ -3274,7 +3285,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3278: checking for working strncmp" >&5 +echo "configure:3289: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3282,7 +3293,7 @@ else ac_cv_func_strncmp_works=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:3361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else @@ -3510,6 +3521,7 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@libiberty_topdir@%$libiberty_topdir%g s%@MAINT@%$MAINT%g s%@NOTMAINT@%$NOTMAINT%g s%@MAKEINFO@%$MAKEINFO%g @@ -3541,6 +3553,7 @@ s%@CPP@%$CPP%g s%@CHECK@%$CHECK%g s%@target_header_dir@%$target_header_dir%g s%@LIBOBJS@%$LIBOBJS%g +s%@pexecute@%$pexecute%g s%@INSTALL_DEST@%$INSTALL_DEST%g CEOF diff --git a/libiberty/configure.in b/libiberty/configure.in index a8dc66f..1329f13 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_PREREQ(2.13) -AC_INIT(pexecute.c) +AC_INIT(xmalloc.c) # This works around the fact that libtool configuration may change LD # for this particular configuration, but some shells, instead of @@ -35,6 +35,7 @@ if test "${srcdir}" = "."; then else libiberty_topdir="${srcdir}/.." fi +AC_SUBST(libiberty_topdir) AC_CONFIG_AUX_DIR($libiberty_topdir) dnl Very limited version of automake's enable-maintainer-mode @@ -425,6 +426,16 @@ if test -z "${setobjs}"; then AC_CHECK_FUNCS($checkfuncs) fi +# Figure out which version of pexecute to use. +case "${host}" in + *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; + *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; + *-*-msdos*) pexecute=pex-msdos.o ;; + *-*-os2-emx*) pexecute=pex-os2.o ;; + *) pexecute=pex-unix.o ;; +esac +AC_SUBST(pexecute) + libiberty_AC_FUNC_STRNCMP # Install a library built with a cross compiler in $(tooldir) rather diff --git a/libiberty/functions.texi b/libiberty/functions.texi index 7d9c181..18b2480 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -483,7 +483,7 @@ reading and writing. @end deftypefn -@c pexecute.c:67 +@c pexecute.txh:1 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) Executes a program. @@ -498,14 +498,15 @@ use if needed. This is currently only needed for MS-DOS ports that don't use @code{go32} (do any still exist?). Ports that don't need it can pass @code{NULL}. -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched -(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & -PEXECUTE_FIRST}) is nonzero for the first process in chain. -(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process -in chain. The first/last flags could be simplified to only mark the -last of a chain of processes but that requires the caller to always -mark the last one (and not give up early if some error occurs). -It's more robust to require the caller to mark both ends of the chain. +(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} +should be searched (??? It's not clear that GCC passes this flag +correctly). (@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the +first process in chain. (@code{@var{flags} & PEXECUTE_FIRST}) is +nonzero for the last process in chain. The first/last flags could be +simplified to only mark the last of a chain of processes but that +requires the caller to always mark the last one (and not give up +early if some error occurs). It's more robust to require the caller +to mark both ends of the chain. The result is the pid on systems like Unix where we @code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we @@ -540,21 +541,23 @@ name is unset/removed. @end deftypefn -@c pexecute.c:104 +@c pexecute.txh:39 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) Waits for a program started by @code{pexecute} to finish. @var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused (allows -future enhancement without breaking upward compatibility). Pass 0 for now. +the `status' argument to wait. @var{flags} is currently unused +(allows future enhancement without breaking upward compatibility). +Pass 0 for now. The result is the pid of the child reaped, or -1 for failure (@code{errno} says why). -On systems that don't support waiting for a particular child, @var{pid} is -ignored. On systems like MS-DOS that don't really multitask @code{pwait} -is just a mechanism to provide a consistent interface for the caller. +On systems that don't support waiting for a particular child, +@var{pid} is ignored. On systems like MS-DOS that don't really +multitask @code{pwait} is just a mechanism to provide a consistent +interface for the caller. @end deftypefn diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 6bf59ff..0429936 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -1,5 +1,5 @@ /* An expandable hash tables datatype. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). This file is part of the libiberty library. @@ -191,6 +191,63 @@ htab_create_alloc (size, hash_f, eq_f, del_f, alloc_f, free_f) return result; } +/* As above, but use the variants of alloc_f and free_f which accept + an extra argument. */ + +htab_t +htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, + free_f) + size_t size; + htab_hash hash_f; + htab_eq eq_f; + htab_del del_f; + PTR alloc_arg; + htab_alloc_with_arg alloc_f; + htab_free_with_arg free_f; +{ + htab_t result; + + size = higher_prime_number (size); + result = (htab_t) (*alloc_f) (alloc_arg, 1, sizeof (struct htab)); + if (result == NULL) + return NULL; + result->entries = (PTR *) (*alloc_f) (alloc_arg, size, sizeof (PTR)); + if (result->entries == NULL) + { + if (free_f != NULL) + (*free_f) (alloc_arg, result); + return NULL; + } + result->size = size; + result->hash_f = hash_f; + result->eq_f = eq_f; + result->del_f = del_f; + result->alloc_arg = alloc_arg; + result->alloc_with_arg_f = alloc_f; + result->free_with_arg_f = free_f; + return result; +} + +/* Update the function pointers and allocation parameter in the htab_t. */ + +void +htab_set_functions_ex (htab, hash_f, eq_f, del_f, alloc_arg, alloc_f, free_f) + htab_t htab; + htab_hash hash_f; + htab_eq eq_f; + htab_del del_f; + PTR alloc_arg; + htab_alloc_with_arg alloc_f; + htab_free_with_arg free_f; +{ + htab->hash_f = hash_f; + htab->eq_f = eq_f; + htab->del_f = del_f; + htab->alloc_arg = alloc_arg; + htab->alloc_with_arg_f = alloc_f; + htab->free_with_arg_f = free_f; +} + /* These functions exist solely for backward compatibility. */ #undef htab_create @@ -234,6 +291,11 @@ htab_delete (htab) (*htab->free_f) (htab->entries); (*htab->free_f) (htab); } + else if (htab->free_with_arg_f != NULL) + { + (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries); + (*htab->free_with_arg_f) (htab->alloc_arg, htab); + } } /* This function clears all entries in the given hash table. */ @@ -306,16 +368,22 @@ htab_expand (htab) PTR *olimit; PTR *p; PTR *nentries; + size_t nsize; oentries = htab->entries; olimit = oentries + htab->size; - htab->size = higher_prime_number (htab->size * 2); + nsize = higher_prime_number (htab->size * 2); - nentries = (PTR *) (*htab->alloc_f) (htab->size, sizeof (PTR *)); + if (htab->alloc_with_arg_f != NULL) + nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, + sizeof (PTR *)); + else + nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR *)); if (nentries == NULL) return 0; htab->entries = nentries; + htab->size = nsize; htab->n_elements -= htab->n_deleted; htab->n_deleted = 0; @@ -338,6 +406,8 @@ htab_expand (htab) if (htab->free_f != NULL) (*htab->free_f) (oentries); + else if (htab->free_with_arg_f != NULL) + (*htab->free_with_arg_f) (htab->alloc_arg, oentries); return 1; } diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h new file mode 100644 index 0000000..da2f71e --- /dev/null +++ b/libiberty/pex-common.h @@ -0,0 +1,42 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Shared logic. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifndef PEX_COMMON_H +#define PEX_COMMON_H + +#include "config.h" +#include "libiberty.h" + +#define install_error_msg "installation problem, cannot exec `%s'" + +/* stdin file number. */ +#define STDIN_FILE_NO 0 + +/* stdout file number. */ +#define STDOUT_FILE_NO 1 + +/* value of `pipe': port index for reading. */ +#define READ_PORT 0 + +/* value of `pipe': port index for writing. */ +#define WRITE_PORT 1 + +#endif diff --git a/libiberty/pex-djgpp.c b/libiberty/pex-djgpp.c new file mode 100644 index 0000000..968e784 --- /dev/null +++ b/libiberty/pex-djgpp.c @@ -0,0 +1,103 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. DJGPP specialization. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#include +#include +#ifdef NEED_DECLARATION_ERRNO +extern int errno; +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#include + +/* Use ECHILD if available, otherwise use EINVAL. */ +#ifdef ECHILD +#define PWAIT_ERROR ECHILD +#else +#define PWAIT_ERROR EINVAL +#endif + +/* MSDOS doesn't multitask, but for the sake of a consistent interface + the code behaves like it does. pexecute runs the program, tucks the + exit code away, and returns a "pid". pwait must be called to fetch the + exit code. */ + +/* For communicating information from pexecute to pwait. */ +static int last_pid = 0; +static int last_status = 0; +static int last_reaped = 0; + +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + int rc; + + last_pid++; + if (last_pid < 0) + last_pid = 1; + + if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) + abort (); + + /* ??? What are the possible return values from spawnv? */ + rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv); + + if (rc == -1) + { + *errmsg_fmt = install_error_msg; + *errmsg_arg = (char *)program; + return -1; + } + + /* Tuck the status away for pwait, and return a "pid". */ + last_status = rc << 8; + return last_pid; +} + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags; +{ + /* On MSDOS each pexecute must be followed by its associated pwait. */ + if (pid != last_pid + /* Called twice for the same child? */ + || pid == last_reaped) + { + errno = PWAIT_ERROR; + return -1; + } + /* ??? Here's an opportunity to canonicalize the values in STATUS. + Needed? */ + *status = (last_status >> 8); + last_reaped = last_pid; + return last_pid; +} diff --git a/libiberty/pex-mpw.c b/libiberty/pex-mpw.c new file mode 100644 index 0000000..9a8879c --- /dev/null +++ b/libiberty/pex-mpw.c @@ -0,0 +1,161 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. MPW specialization. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#include +#ifdef HAVE_STRING_H +#include +#endif + +/* MPW pexecute doesn't actually run anything; instead, it writes out + script commands that, when run, will do the actual executing. + + For example, in GCC's case, GCC will write out several script commands: + + cpp ... + cc1 ... + as ... + ld ... + + and then exit. None of the above programs will have run yet. The task + that called GCC will then execute the script and cause cpp,etc. to run. + The caller must invoke pfinish before calling exit. This adds + the finishing touches to the generated script. */ + +static int first_time = 1; + +extern void mpwify_filename PARAMS ((const char *, char *)); + +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + char tmpprogram[255]; + char *cp, *tmpname; + int i; + + mpwify_filename (program, tmpprogram); + if (first_time) + { + printf ("Set Failed 0\n"); + first_time = 0; + } + + fputs ("If {Failed} == 0\n", stdout); + /* If being verbose, output a copy of the command. It should be + accurate enough and escaped enough to be "clickable". */ + if (flags & PEXECUTE_VERBOSE) + { + fputs ("\tEcho ", stdout); + fputc ('\'', stdout); + fputs (tmpprogram, stdout); + fputc ('\'', stdout); + fputc (' ', stdout); + for (i=1; argv[i]; i++) + { + fputc ('\'', stdout); + /* See if we have an argument that needs fixing. */ + if (strchr(argv[i], '/')) + { + tmpname = (char *) xmalloc (256); + mpwify_filename (argv[i], tmpname); + argv[i] = tmpname; + } + for (cp = argv[i]; *cp; cp++) + { + /* Write an Option-d escape char in front of special chars. */ + if (strchr("'+", *cp)) + fputc ('\266', stdout); + fputc (*cp, stdout); + } + fputc ('\'', stdout); + fputc (' ', stdout); + } + fputs ("\n", stdout); + } + fputs ("\t", stdout); + fputs (tmpprogram, stdout); + fputc (' ', stdout); + + for (i=1; argv[i]; i++) + { + /* See if we have an argument that needs fixing. */ + if (strchr(argv[i], '/')) + { + tmpname = (char *) xmalloc (256); + mpwify_filename (argv[i], tmpname); + argv[i] = tmpname; + } + if (strchr (argv[i], ' ')) + fputc ('\'', stdout); + for (cp = argv[i]; *cp; cp++) + { + /* Write an Option-d escape char in front of special chars. */ + if (strchr("'+", *cp)) + fputc ('\266', stdout); + fputc (*cp, stdout); + } + if (strchr (argv[i], ' ')) + fputc ('\'', stdout); + fputc (' ', stdout); + } + + fputs ("\n", stdout); + + /* Output commands that arrange to clean up and exit if a failure occurs. + We have to be careful to collect the status from the program that was + run, rather than some other script command. Also, we don't exit + immediately, since necessary cleanups are at the end of the script. */ + fputs ("\tSet TmpStatus {Status}\n", stdout); + fputs ("\tIf {TmpStatus} != 0\n", stdout); + fputs ("\t\tSet Failed {TmpStatus}\n", stdout); + fputs ("\tEnd\n", stdout); + fputs ("End\n", stdout); + + /* We're just composing a script, can't fail here. */ + return 0; +} + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags; +{ + *status = 0; + return 0; +} + +/* Write out commands that will exit with the correct error code + if something in the script failed. */ + +void +pfinish () +{ + printf ("\tExit \"{Failed}\"\n"); +} + diff --git a/libiberty/pex-msdos.c b/libiberty/pex-msdos.c new file mode 100644 index 0000000..d61c129 --- /dev/null +++ b/libiberty/pex-msdos.c @@ -0,0 +1,147 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Generic MSDOS specialization. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#include +#include +#ifdef NEED_DECLARATION_ERRNO +extern int errno; +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "safe-ctype.h" +#include + +/* MSDOS doesn't multitask, but for the sake of a consistent interface + the code behaves like it does. pexecute runs the program, tucks the + exit code away, and returns a "pid". pwait must be called to fetch the + exit code. */ + +/* For communicating information from pexecute to pwait. */ +static int last_pid = 0; +static int last_status = 0; +static int last_reaped = 0; + +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + int rc; + char *scmd, *rf; + FILE *argfile; + int i, el = flags & PEXECUTE_SEARCH ? 4 : 0; + + last_pid++; + if (last_pid < 0) + last_pid = 1; + + if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) + abort (); + + if (temp_base == 0) + temp_base = choose_temp_base (); + scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el); + rf = scmd + strlen(program) + 2 + el; + sprintf (scmd, "%s%s @%s.gp", program, + (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base); + argfile = fopen (rf, "w"); + if (argfile == 0) + { + int errno_save = errno; + free (scmd); + errno = errno_save; + *errmsg_fmt = "cannot open `%s.gp'"; + *errmsg_arg = temp_base; + return -1; + } + + for (i=1; argv[i]; i++) + { + char *cp; + for (cp = argv[i]; *cp; cp++) + { + if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp)) + fputc ('\\', argfile); + fputc (*cp, argfile); + } + fputc ('\n', argfile); + } + fclose (argfile); + + rc = system (scmd); + + { + int errno_save = errno; + remove (rf); + free (scmd); + errno = errno_save; + } + + if (rc == -1) + { + *errmsg_fmt = install_error_msg; + *errmsg_arg = (char *)program; + return -1; + } + + /* Tuck the status away for pwait, and return a "pid". */ + last_status = rc << 8; + return last_pid; +} + +/* Use ECHILD if available, otherwise use EINVAL. */ +#ifdef ECHILD +#define PWAIT_ERROR ECHILD +#else +#define PWAIT_ERROR EINVAL +#endif + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags; +{ + /* On MSDOS each pexecute must be followed by its associated pwait. */ + if (pid != last_pid + /* Called twice for the same child? */ + || pid == last_reaped) + { + errno = PWAIT_ERROR; + return -1; + } + /* ??? Here's an opportunity to canonicalize the values in STATUS. + Needed? */ + *status = last_status; + last_reaped = last_pid; + return last_pid; +} diff --git a/libiberty/pex-os2.c b/libiberty/pex-os2.c new file mode 100644 index 0000000..d9eacf1 --- /dev/null +++ b/libiberty/pex-os2.c @@ -0,0 +1,72 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. OS/2 specialization. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +/* ??? Does OS2 have process.h? */ +extern int spawnv (); +extern int spawnvp (); + +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + int pid; + + if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) + abort (); + /* ??? Presumably 1 == _P_NOWAIT. */ + pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv); + if (pid == -1) + { + *errmsg_fmt = install_error_msg; + *errmsg_arg = program; + return -1; + } + return pid; +} + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags; +{ + /* ??? Here's an opportunity to canonicalize the values in STATUS. + Needed? */ + int pid = wait (status); + return pid; +} diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c new file mode 100644 index 0000000..14fe71e --- /dev/null +++ b/libiberty/pex-unix.c @@ -0,0 +1,166 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Generic Unix version + (also used for UWIN and VMS). + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#include +#include +#ifdef NEED_DECLARATION_ERRNO +extern int errno; +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#ifndef HAVE_WAITPID +#define waitpid(pid, status, flags) wait(status) +#endif + +extern int execv (); +extern int execvp (); + +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base ATTRIBUTE_UNUSED; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); + int pid; + int pdes[2]; + int input_desc, output_desc; + int retries, sleep_interval; + /* Pipe waiting from last process, to be used as input for the next one. + Value is STDIN_FILE_NO if no pipe is waiting + (i.e. the next command is the first of a group). */ + static int last_pipe_input; + + /* If this is the first process, initialize. */ + if (flags & PEXECUTE_FIRST) + last_pipe_input = STDIN_FILE_NO; + + input_desc = last_pipe_input; + + /* If this isn't the last process, make a pipe for its output, + and record it as waiting to be the input to the next process. */ + if (! (flags & PEXECUTE_LAST)) + { + if (pipe (pdes) < 0) + { + *errmsg_fmt = "pipe"; + *errmsg_arg = NULL; + return -1; + } + output_desc = pdes[WRITE_PORT]; + last_pipe_input = pdes[READ_PORT]; + } + else + { + /* Last process. */ + output_desc = STDOUT_FILE_NO; + last_pipe_input = STDIN_FILE_NO; + } + + /* Fork a subprocess; wait and retry if it fails. */ + sleep_interval = 1; + pid = -1; + for (retries = 0; retries < 4; retries++) + { + pid = fork (); + if (pid >= 0) + break; + sleep (sleep_interval); + sleep_interval *= 2; + } + + switch (pid) + { + case -1: + *errmsg_fmt = "fork"; + *errmsg_arg = NULL; + return -1; + + case 0: /* child */ + /* Move the input and output pipes into place, if necessary. */ + if (input_desc != STDIN_FILE_NO) + { + close (STDIN_FILE_NO); + dup (input_desc); + close (input_desc); + } + if (output_desc != STDOUT_FILE_NO) + { + close (STDOUT_FILE_NO); + dup (output_desc); + close (output_desc); + } + + /* Close the parent's descs that aren't wanted here. */ + if (last_pipe_input != STDIN_FILE_NO) + close (last_pipe_input); + + /* Exec the program. */ + (*func) (program, argv); + + fprintf (stderr, "%s: ", this_pname); + fprintf (stderr, install_error_msg, program); + fprintf (stderr, ": %s\n", xstrerror (errno)); + exit (-1); + /* NOTREACHED */ + return 0; + + default: + /* In the parent, after forking. + Close the descriptors that we made for this child. */ + if (input_desc != STDIN_FILE_NO) + close (input_desc); + if (output_desc != STDOUT_FILE_NO) + close (output_desc); + + /* Return child's process number. */ + return pid; + } +} + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags ATTRIBUTE_UNUSED; +{ + /* ??? Here's an opportunity to canonicalize the values in STATUS. + Needed? */ + pid = waitpid (pid, status, 0); + return pid; +} diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c new file mode 100644 index 0000000..bd097a4 --- /dev/null +++ b/libiberty/pex-win32.c @@ -0,0 +1,243 @@ +/* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Generic Win32 specialization. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Free Software Foundation, Inc. + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with libiberty; see the file COPYING.LIB. If not, +write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "pex-common.h" + +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#include +#include +#include +#include + +/* mingw32 headers may not define the following. */ + +#ifndef _P_WAIT +# define _P_WAIT 0 +# define _P_NOWAIT 1 +# define _P_OVERLAY 2 +# define _P_NOWAITO 3 +# define _P_DETACH 4 + +# define WAIT_CHILD 0 +# define WAIT_GRANDCHILD 1 +#endif + +/* This is a kludge to get around the Microsoft C spawn functions' propensity + to remove the outermost set of double quotes from all arguments. */ + +static const char * const * +fix_argv (argvec) + char **argvec; +{ + int i; + + for (i = 1; argvec[i] != 0; i++) + { + int len, j; + char *temp, *newtemp; + + temp = argvec[i]; + len = strlen (temp); + for (j = 0; j < len; j++) + { + if (temp[j] == '"') + { + newtemp = xmalloc (len + 2); + strncpy (newtemp, temp, j); + newtemp [j] = '\\'; + strncpy (&newtemp [j+1], &temp [j], len-j); + newtemp [len+1] = 0; + temp = newtemp; + len++; + j++; + } + } + + argvec[i] = temp; + } + + for (i = 0; argvec[i] != 0; i++) + { + if (strpbrk (argvec[i], " \t")) + { + int len, trailing_backslash; + char *temp; + + len = strlen (argvec[i]); + trailing_backslash = 0; + + /* There is an added complication when an arg with embedded white + space ends in a backslash (such as in the case of -iprefix arg + passed to cpp). The resulting quoted strings gets misinterpreted + by the command interpreter -- it thinks that the ending quote + is escaped by the trailing backslash and things get confused. + We handle this case by escaping the trailing backslash, provided + it was not escaped in the first place. */ + if (len > 1 + && argvec[i][len-1] == '\\' + && argvec[i][len-2] != '\\') + { + trailing_backslash = 1; + ++len; /* to escape the final backslash. */ + } + + len += 2; /* and for the enclosing quotes. */ + + temp = xmalloc (len + 1); + temp[0] = '"'; + strcpy (temp + 1, argvec[i]); + if (trailing_backslash) + temp[len-2] = '\\'; + temp[len-1] = '"'; + temp[len] = '\0'; + + argvec[i] = temp; + } + } + + return (const char * const *) argvec; +} + +/* Win32 supports pipes */ +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + int pid; + int pdes[2], org_stdin, org_stdout; + int input_desc, output_desc; + int retries, sleep_interval; + + /* Pipe waiting from last process, to be used as input for the next one. + Value is STDIN_FILE_NO if no pipe is waiting + (i.e. the next command is the first of a group). */ + static int last_pipe_input; + + /* If this is the first process, initialize. */ + if (flags & PEXECUTE_FIRST) + last_pipe_input = STDIN_FILE_NO; + + input_desc = last_pipe_input; + + /* If this isn't the last process, make a pipe for its output, + and record it as waiting to be the input to the next process. */ + if (! (flags & PEXECUTE_LAST)) + { + if (_pipe (pdes, 256, O_BINARY) < 0) + { + *errmsg_fmt = "pipe"; + *errmsg_arg = NULL; + return -1; + } + output_desc = pdes[WRITE_PORT]; + last_pipe_input = pdes[READ_PORT]; + } + else + { + /* Last process. */ + output_desc = STDOUT_FILE_NO; + last_pipe_input = STDIN_FILE_NO; + } + + if (input_desc != STDIN_FILE_NO) + { + org_stdin = dup (STDIN_FILE_NO); + dup2 (input_desc, STDIN_FILE_NO); + close (input_desc); + } + + if (output_desc != STDOUT_FILE_NO) + { + org_stdout = dup (STDOUT_FILE_NO); + dup2 (output_desc, STDOUT_FILE_NO); + close (output_desc); + } + + pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) + (_P_NOWAIT, program, fix_argv(argv)); + + if (input_desc != STDIN_FILE_NO) + { + dup2 (org_stdin, STDIN_FILE_NO); + close (org_stdin); + } + + if (output_desc != STDOUT_FILE_NO) + { + dup2 (org_stdout, STDOUT_FILE_NO); + close (org_stdout); + } + + if (pid == -1) + { + *errmsg_fmt = install_error_msg; + *errmsg_arg = program; + return -1; + } + + return pid; +} + +/* MS CRTDLL doesn't return enough information in status to decide if the + child exited due to a signal or not, rather it simply returns an + integer with the exit code of the child; eg., if the child exited with + an abort() call and didn't have a handler for SIGABRT, it simply returns + with status = 3. We fix the status code to conform to the usual WIF* + macros. Note that WIFSIGNALED will never be true under CRTDLL. */ + +int +pwait (pid, status, flags) + int pid; + int *status; + int flags; +{ + int termstat; + + pid = _cwait (&termstat, pid, WAIT_CHILD); + + /* ??? Here's an opportunity to canonicalize the values in STATUS. + Needed? */ + + /* cwait returns the child process exit code in termstat. + A value of 3 indicates that the child caught a signal, but not + which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we + report SIGABRT. */ + if (termstat == 3) + *status = SIGABRT; + else + *status = (((termstat) & 0xff) << 8); + + return pid; +} diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c deleted file mode 100644 index 347c4db..0000000 --- a/libiberty/pexecute.c +++ /dev/null @@ -1,792 +0,0 @@ -/* Utilities to execute a program in a subprocess (possibly linked by pipes - with other subprocesses), and wait for it. - Copyright (C) 1996-2000 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This file exports two functions: pexecute and pwait. */ - -/* This file lives in at least two places: libiberty and gcc. - Don't change one without the other. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#ifdef NEED_DECLARATION_ERRNO -extern int errno; -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif - -#include "libiberty.h" -#include "safe-ctype.h" - -/* stdin file number. */ -#define STDIN_FILE_NO 0 - -/* stdout file number. */ -#define STDOUT_FILE_NO 1 - -/* value of `pipe': port index for reading. */ -#define READ_PORT 0 - -/* value of `pipe': port index for writing. */ -#define WRITE_PORT 1 - -static char *install_error_msg = "installation problem, cannot exec `%s'"; - -/* pexecute: execute a program. - -@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) - -Executes a program. - -@var{program} and @var{argv} are the arguments to -@code{execv}/@code{execvp}. - -@var{this_pname} is name of the calling program (i.e., @code{argv[0]}). - -@var{temp_base} is the path name, sans suffix, of a temporary file to -use if needed. This is currently only needed for MS-DOS ports that -don't use @code{go32} (do any still exist?). Ports that don't need it -can pass @code{NULL}. - -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched -(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & -PEXECUTE_FIRST}) is nonzero for the first process in chain. -(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process -in chain. The first/last flags could be simplified to only mark the -last of a chain of processes but that requires the caller to always -mark the last one (and not give up early if some error occurs). -It's more robust to require the caller to mark both ends of the chain. - -The result is the pid on systems like Unix where we -@code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we -use @code{spawn}. It is up to the caller to wait for the child. - -The result is the @code{WEXITSTATUS} on systems like MS-DOS where we -@code{spawn} and wait for the child here. - -Upon failure, @var{errmsg_fmt} and @var{errmsg_arg} are set to the -text of the error message with an optional argument (if not needed, -@var{errmsg_arg} is set to @code{NULL}), and @minus{}1 is returned. -@code{errno} is available to the caller to use. - -@end deftypefn - -@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) - -Waits for a program started by @code{pexecute} to finish. - -@var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused (allows -future enhancement without breaking upward compatibility). Pass 0 for now. - -The result is the pid of the child reaped, or -1 for failure -(@code{errno} says why). - -On systems that don't support waiting for a particular child, @var{pid} is -ignored. On systems like MS-DOS that don't really multitask @code{pwait} -is just a mechanism to provide a consistent interface for the caller. - -@end deftypefn - -@undocumented pfinish - - pfinish: finish generation of script - - pfinish is necessary for systems like MPW where a script is generated that - runs the requested programs. */ - -#ifdef __MSDOS__ - -/* MSDOS doesn't multitask, but for the sake of a consistent interface - the code behaves like it does. pexecute runs the program, tucks the - exit code away, and returns a "pid". pwait must be called to fetch the - exit code. */ - -#include - -/* For communicating information from pexecute to pwait. */ -static int last_pid = 0; -static int last_status = 0; -static int last_reaped = 0; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int rc; - - last_pid++; - if (last_pid < 0) - last_pid = 1; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - -#ifdef __DJGPP__ - /* ??? What are the possible return values from spawnv? */ - rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv); -#else - char *scmd, *rf; - FILE *argfile; - int i, el = flags & PEXECUTE_SEARCH ? 4 : 0; - - if (temp_base == 0) - temp_base = choose_temp_base (); - scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el); - rf = scmd + strlen(program) + 2 + el; - sprintf (scmd, "%s%s @%s.gp", program, - (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base); - argfile = fopen (rf, "w"); - if (argfile == 0) - { - int errno_save = errno; - free (scmd); - errno = errno_save; - *errmsg_fmt = "cannot open `%s.gp'"; - *errmsg_arg = temp_base; - return -1; - } - - for (i=1; argv[i]; i++) - { - char *cp; - for (cp = argv[i]; *cp; cp++) - { - if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp)) - fputc ('\\', argfile); - fputc (*cp, argfile); - } - fputc ('\n', argfile); - } - fclose (argfile); - - rc = system (scmd); - - { - int errno_save = errno; - remove (rf); - free (scmd); - errno = errno_save; - } -#endif - - if (rc == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = (char *)program; - return -1; - } - - /* Tuck the status away for pwait, and return a "pid". */ - last_status = rc << 8; - return last_pid; -} - -/* Use ECHILD if available, otherwise use EINVAL. */ -#ifdef ECHILD -#define PWAIT_ERROR ECHILD -#else -#define PWAIT_ERROR EINVAL -#endif - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* On MSDOS each pexecute must be followed by it's associated pwait. */ - if (pid != last_pid - /* Called twice for the same child? */ - || pid == last_reaped) - { - errno = PWAIT_ERROR; - return -1; - } - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ -#ifdef __DJGPP__ - *status = (last_status >> 8); -#else - *status = last_status; -#endif - last_reaped = last_pid; - return last_pid; -} - -#endif /* MSDOS */ - -#if defined (_WIN32) && ! defined (_UWIN) - -#include - -#ifdef __CYGWIN__ - -#define fix_argv(argvec) (argvec) - -extern int _spawnv (); -extern int _spawnvp (); - -#else /* ! __CYGWIN__ */ - -/* This is a kludge to get around the Microsoft C spawn functions' propensity - to remove the outermost set of double quotes from all arguments. */ - -static const char * const * -fix_argv (argvec) - char **argvec; -{ - int i; - - for (i = 1; argvec[i] != 0; i++) - { - int len, j; - char *temp, *newtemp; - - temp = argvec[i]; - len = strlen (temp); - for (j = 0; j < len; j++) - { - if (temp[j] == '"') - { - newtemp = xmalloc (len + 2); - strncpy (newtemp, temp, j); - newtemp [j] = '\\'; - strncpy (&newtemp [j+1], &temp [j], len-j); - newtemp [len+1] = 0; - temp = newtemp; - len++; - j++; - } - } - - argvec[i] = temp; - } - - for (i = 0; argvec[i] != 0; i++) - { - if (strpbrk (argvec[i], " \t")) - { - int len, trailing_backslash; - char *temp; - - len = strlen (argvec[i]); - trailing_backslash = 0; - - /* There is an added complication when an arg with embedded white - space ends in a backslash (such as in the case of -iprefix arg - passed to cpp). The resulting quoted strings gets misinterpreted - by the command interpreter -- it thinks that the ending quote - is escaped by the trailing backslash and things get confused. - We handle this case by escaping the trailing backslash, provided - it was not escaped in the first place. */ - if (len > 1 - && argvec[i][len-1] == '\\' - && argvec[i][len-2] != '\\') - { - trailing_backslash = 1; - ++len; /* to escape the final backslash. */ - } - - len += 2; /* and for the enclosing quotes. */ - - temp = xmalloc (len + 1); - temp[0] = '"'; - strcpy (temp + 1, argvec[i]); - if (trailing_backslash) - temp[len-2] = '\\'; - temp[len-1] = '"'; - temp[len] = '\0'; - - argvec[i] = temp; - } - } - - return (const char * const *) argvec; -} -#endif /* __CYGWIN__ */ - -#include -#include -#include - -/* mingw32 headers may not define the following. */ - -#ifndef _P_WAIT -# define _P_WAIT 0 -# define _P_NOWAIT 1 -# define _P_OVERLAY 2 -# define _P_NOWAITO 3 -# define _P_DETACH 4 - -# define WAIT_CHILD 0 -# define WAIT_GRANDCHILD 1 -#endif - -/* Win32 supports pipes */ -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - int pdes[2], org_stdin, org_stdout; - int input_desc, output_desc; - int retries, sleep_interval; - - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (_pipe (pdes, 256, O_BINARY) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - if (input_desc != STDIN_FILE_NO) - { - org_stdin = dup (STDIN_FILE_NO); - dup2 (input_desc, STDIN_FILE_NO); - close (input_desc); - } - - if (output_desc != STDOUT_FILE_NO) - { - org_stdout = dup (STDOUT_FILE_NO); - dup2 (output_desc, STDOUT_FILE_NO); - close (output_desc); - } - - pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) - (_P_NOWAIT, program, fix_argv(argv)); - - if (input_desc != STDIN_FILE_NO) - { - dup2 (org_stdin, STDIN_FILE_NO); - close (org_stdin); - } - - if (output_desc != STDOUT_FILE_NO) - { - dup2 (org_stdout, STDOUT_FILE_NO); - close (org_stdout); - } - - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - - return pid; -} - -/* MS CRTDLL doesn't return enough information in status to decide if the - child exited due to a signal or not, rather it simply returns an - integer with the exit code of the child; eg., if the child exited with - an abort() call and didn't have a handler for SIGABRT, it simply returns - with status = 3. We fix the status code to conform to the usual WIF* - macros. Note that WIFSIGNALED will never be true under CRTDLL. */ - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ -#ifdef __CYGWIN__ - return wait (status); -#else - int termstat; - - pid = _cwait (&termstat, pid, WAIT_CHILD); - - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - - /* cwait returns the child process exit code in termstat. - A value of 3 indicates that the child caught a signal, but not - which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we - report SIGABRT. */ - if (termstat == 3) - *status = SIGABRT; - else - *status = (((termstat) & 0xff) << 8); - - return pid; -#endif /* __CYGWIN__ */ -} - -#endif /* _WIN32 && ! _UWIN */ - -#ifdef OS2 - -/* ??? Does OS2 have process.h? */ -extern int spawnv (); -extern int spawnvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - /* ??? Presumably 1 == _P_NOWAIT. */ - pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv); - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - return pid; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - int pid = wait (status); - return pid; -} - -#endif /* OS2 */ - -#ifdef MPW - -/* MPW pexecute doesn't actually run anything; instead, it writes out - script commands that, when run, will do the actual executing. - - For example, in GCC's case, GCC will write out several script commands: - - cpp ... - cc1 ... - as ... - ld ... - - and then exit. None of the above programs will have run yet. The task - that called GCC will then execute the script and cause cpp,etc. to run. - The caller must invoke pfinish before calling exit. This adds - the finishing touches to the generated script. */ - -static int first_time = 1; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - char tmpprogram[255]; - char *cp, *tmpname; - int i; - - mpwify_filename (program, tmpprogram); - if (first_time) - { - printf ("Set Failed 0\n"); - first_time = 0; - } - - fputs ("If {Failed} == 0\n", stdout); - /* If being verbose, output a copy of the command. It should be - accurate enough and escaped enough to be "clickable". */ - if (flags & PEXECUTE_VERBOSE) - { - fputs ("\tEcho ", stdout); - fputc ('\'', stdout); - fputs (tmpprogram, stdout); - fputc ('\'', stdout); - fputc (' ', stdout); - for (i=1; argv[i]; i++) - { - fputc ('\'', stdout); - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - fputc ('\'', stdout); - fputc (' ', stdout); - } - fputs ("\n", stdout); - } - fputs ("\t", stdout); - fputs (tmpprogram, stdout); - fputc (' ', stdout); - - for (i=1; argv[i]; i++) - { - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - fputc (' ', stdout); - } - - fputs ("\n", stdout); - - /* Output commands that arrange to clean up and exit if a failure occurs. - We have to be careful to collect the status from the program that was - run, rather than some other script command. Also, we don't exit - immediately, since necessary cleanups are at the end of the script. */ - fputs ("\tSet TmpStatus {Status}\n", stdout); - fputs ("\tIf {TmpStatus} != 0\n", stdout); - fputs ("\t\tSet Failed {TmpStatus}\n", stdout); - fputs ("\tEnd\n", stdout); - fputs ("End\n", stdout); - - /* We're just composing a script, can't fail here. */ - return 0; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - *status = 0; - return 0; -} - -/* Write out commands that will exit with the correct error code - if something in the script failed. */ - -void -pfinish () -{ - printf ("\tExit \"{Failed}\"\n"); -} - -#endif /* MPW */ - -/* include for Unix-like environments but not for Dos-like environments */ -#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \ - && ! (defined (_WIN32) && ! defined (_UWIN)) - -extern int execv (); -extern int execvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base ATTRIBUTE_UNUSED; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); - int pid; - int pdes[2]; - int input_desc, output_desc; - int retries, sleep_interval; - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (pipe (pdes) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - /* Fork a subprocess; wait and retry if it fails. */ - sleep_interval = 1; - pid = -1; - for (retries = 0; retries < 4; retries++) - { - pid = fork (); - if (pid >= 0) - break; - sleep (sleep_interval); - sleep_interval *= 2; - } - - switch (pid) - { - case -1: - *errmsg_fmt = "fork"; - *errmsg_arg = NULL; - return -1; - - case 0: /* child */ - /* Move the input and output pipes into place, if necessary. */ - if (input_desc != STDIN_FILE_NO) - { - close (STDIN_FILE_NO); - dup (input_desc); - close (input_desc); - } - if (output_desc != STDOUT_FILE_NO) - { - close (STDOUT_FILE_NO); - dup (output_desc); - close (output_desc); - } - - /* Close the parent's descs that aren't wanted here. */ - if (last_pipe_input != STDIN_FILE_NO) - close (last_pipe_input); - - /* Exec the program. */ - (*func) (program, argv); - - fprintf (stderr, "%s: ", this_pname); - fprintf (stderr, install_error_msg, program); - fprintf (stderr, ": %s\n", xstrerror (errno)); - exit (-1); - /* NOTREACHED */ - return 0; - - default: - /* In the parent, after forking. - Close the descriptors that we made for this child. */ - if (input_desc != STDIN_FILE_NO) - close (input_desc); - if (output_desc != STDOUT_FILE_NO) - close (output_desc); - - /* Return child's process number. */ - return pid; - } -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags ATTRIBUTE_UNUSED; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ -#ifdef VMS - pid = waitpid (-1, status, 0); -#else - pid = wait (status); -#endif - return pid; -} - -#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! _UWIN) */ diff --git a/libiberty/pexecute.txh b/libiberty/pexecute.txh new file mode 100644 index 0000000..269f031 --- /dev/null +++ b/libiberty/pexecute.txh @@ -0,0 +1,63 @@ +@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) + +Executes a program. + +@var{program} and @var{argv} are the arguments to +@code{execv}/@code{execvp}. + +@var{this_pname} is name of the calling program (i.e., @code{argv[0]}). + +@var{temp_base} is the path name, sans suffix, of a temporary file to +use if needed. This is currently only needed for MS-DOS ports that +don't use @code{go32} (do any still exist?). Ports that don't need it +can pass @code{NULL}. + +(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} +should be searched (??? It's not clear that GCC passes this flag +correctly). (@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the +first process in chain. (@code{@var{flags} & PEXECUTE_FIRST}) is +nonzero for the last process in chain. The first/last flags could be +simplified to only mark the last of a chain of processes but that +requires the caller to always mark the last one (and not give up +early if some error occurs). It's more robust to require the caller +to mark both ends of the chain. + +The result is the pid on systems like Unix where we +@code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we +use @code{spawn}. It is up to the caller to wait for the child. + +The result is the @code{WEXITSTATUS} on systems like MS-DOS where we +@code{spawn} and wait for the child here. + +Upon failure, @var{errmsg_fmt} and @var{errmsg_arg} are set to the +text of the error message with an optional argument (if not needed, +@var{errmsg_arg} is set to @code{NULL}), and @minus{}1 is returned. +@code{errno} is available to the caller to use. + +@end deftypefn + +@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) + +Waits for a program started by @code{pexecute} to finish. + +@var{pid} is the process id of the task to wait for. @var{status} is +the `status' argument to wait. @var{flags} is currently unused +(allows future enhancement without breaking upward compatibility). +Pass 0 for now. + +The result is the pid of the child reaped, or -1 for failure +(@code{errno} says why). + +On systems that don't support waiting for a particular child, +@var{pid} is ignored. On systems like MS-DOS that don't really +multitask @code{pwait} is just a mechanism to provide a consistent +interface for the caller. + +@end deftypefn + +@undocumented pfinish + +pfinish: finish generation of script + +pfinish is necessary for systems like MPW where a script is generated +that runs the requested programs. diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index aaa97d3..a0c083b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,37 @@ +2003-01-29 Henric Jungheim + + * sparc-dis.c (print_insn_sparc): When examining values added in + to rs1, make sure that there are previous instructions. + +2003-01-23 Nick Clifton + + * Add sh2e support: + + 2002-04-02 Alexandre Oliva + + * sh-dis.c (print_insn_shx): Handle bfd_mach_sh2e. + * sh-opc.h (arch_sh2e, arch_sh2e_up): New. + (arch_sh2_up): Added sh2e. + (sh_table): Replaced all occurrences of arch_sh3e_up with + arch_sh2e_up, except in fsqrt. + +2003-01-23 Alan Modra + + * sh64-dis.c: Include elf32-sh64.h. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-17 Richard Henderson + + * alpha-opc.c (alpha_opcodes): Add bugchk, rduniq, wruniq, gentrap + PAL entry points. + +2003-01-16 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + 2003-01-08 Klee Dienes * Makefile.am (ALL_MACHINES): Add msp430-dis.lo. diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index 00afec3..d3ecd6f 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -518,7 +518,7 @@ arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/reloc-macros.h avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \ - $(INCDIR)/opcode/avr.h + $(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(BFD_H) \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h opintl.h @@ -553,10 +553,11 @@ fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h fr30-desc.lo: fr30-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h $(INCDIR)/opcode/cgen.h \ - fr30-opc.h opintl.h $(INCDIR)/libiberty.h + fr30-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h fr30-dis.lo: fr30-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h \ - $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + fr30-desc.h $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h fr30-ibld.lo: fr30-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h \ $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -569,10 +570,11 @@ frv-asm.lo: frv-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h frv-desc.lo: frv-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h frv-desc.h $(INCDIR)/opcode/cgen.h \ - frv-opc.h opintl.h $(INCDIR)/libiberty.h + frv-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h frv-dis.lo: frv-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h frv-desc.h \ - $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + frv-desc.h $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h frv-ibld.lo: frv-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h frv-desc.h \ $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -582,7 +584,7 @@ frv-opc.lo: frv-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/reloc-macros.h h8300-dis.lo: h8300-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/h8300.h $(INCDIR)/dis-asm.h $(BFD_H) \ - $(INCDIR)/symcat.h opintl.h + $(INCDIR)/symcat.h opintl.h $(INCDIR)/libiberty.h h8500-dis.lo: h8500-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ h8500-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ opintl.h @@ -620,7 +622,7 @@ ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \ ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \ ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \ - ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c + ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c ../intl/libintl.h ia64-asmtab.lo: ia64-asmtab.c ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ @@ -628,26 +630,44 @@ ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h ip2k-desc.lo: ip2k-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ - ip2k-opc.h opintl.h $(INCDIR)/libiberty.h + ip2k-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h ip2k-dis.lo: ip2k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h \ - $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + ip2k-desc.h $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h ip2k-ibld.lo: ip2k-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h \ $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h $(INCDIR)/safe-ctype.h ip2k-opc.lo: ip2k-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ - ip2k-opc.h $(INCDIR)/libiberty.h + ip2k-opc.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +iq2000-asm.lo: iq2000-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h opintl.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +iq2000-desc.lo: iq2000-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h opintl.h $(INCDIR)/libiberty.h +iq2000-dis.lo: iq2000-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h \ + $(INCDIR)/opcode/cgen.h iq2000-opc.h opintl.h +iq2000-ibld.lo: iq2000-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h \ + $(INCDIR)/opcode/cgen.h iq2000-opc.h opintl.h $(INCDIR)/safe-ctype.h +iq2000-opc.lo: iq2000-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h $(INCDIR)/libiberty.h m32r-asm.lo: m32r-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h $(INCDIR)/opcode/cgen.h \ m32r-opc.h opintl.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h m32r-desc.lo: m32r-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h $(INCDIR)/opcode/cgen.h \ - m32r-opc.h opintl.h $(INCDIR)/libiberty.h + m32r-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h m32r-dis.lo: m32r-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h \ - $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + m32r-desc.h $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h m32r-ibld.lo: m32r-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h \ $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -669,14 +689,14 @@ m68k-opc.lo: m68k-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/m68k.h m88k-dis.lo: m88k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/m88k.h \ - opintl.h + opintl.h $(INCDIR)/libiberty.h mcore-dis.lo: mcore-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ mcore-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h mips-dis.lo: mips-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/mips.h \ - opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/opcode/mips.h opintl.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h mips-opc.lo: mips-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/mips.h mips16-opc.lo: mips16-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ @@ -704,10 +724,12 @@ openrisc-asm.lo: openrisc-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h openrisc-desc.lo: openrisc-desc.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \ - $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h $(INCDIR)/libiberty.h + $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h openrisc-dis.lo: openrisc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \ - $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + openrisc-desc.h $(INCDIR)/opcode/cgen.h openrisc-opc.h \ + opintl.h openrisc-ibld.lo: openrisc-ibld.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ openrisc-desc.h $(INCDIR)/opcode/cgen.h openrisc-opc.h \ @@ -744,7 +766,8 @@ sh64-dis.lo: sh64-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \ sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/elf32-sh64.h sh64-opc.lo: sh64-opc.c sh64-opc.h sparc-dis.lo: sparc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h $(BFD_H) \ @@ -781,11 +804,12 @@ xstormy16-asm.lo: xstormy16-asm.c sysdep.h config.h \ $(INCDIR)/xregex2.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h xstormy16-desc.lo: xstormy16-desc.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h xstormy16-desc.h \ - $(INCDIR)/opcode/cgen.h xstormy16-opc.h opintl.h $(INCDIR)/libiberty.h + $(INCDIR)/opcode/cgen.h xstormy16-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h xstormy16-dis.lo: xstormy16-dis.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ - xstormy16-desc.h $(INCDIR)/opcode/cgen.h xstormy16-opc.h \ - opintl.h + $(INCDIR)/libiberty.h xstormy16-desc.h $(INCDIR)/opcode/cgen.h \ + xstormy16-opc.h opintl.h xstormy16-ibld.lo: xstormy16-ibld.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ xstormy16-desc.h $(INCDIR)/opcode/cgen.h xstormy16-opc.h \ @@ -795,5 +819,6 @@ xstormy16-opc.lo: xstormy16-opc.c sysdep.h config.h \ $(INCDIR)/opcode/cgen.h xstormy16-opc.h $(INCDIR)/libiberty.h z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h z8k-opc.h -z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h +z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index e935fd4..4939324 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -404,8 +404,8 @@ noinst_LIBRARIES = libopcodes.a POTFILES = $(HFILES) $(CFILES) CLEANFILES = \ - stamp-ip2k stamp-iq2000 stamp-m32r stamp-fr30 stamp-frv stamp-openrisc \ - stamp-xstormy16 \ + stamp-ip2k stamp-m32r stamp-fr30 stamp-frv stamp-openrisc \ + stamp-iq2000 stamp-xstormy16 \ libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2 @@ -425,8 +425,6 @@ CGENDEPS = \ CGEN_CPUS = fr30 frv ip2k m32r openrisc xstormy16 @CGEN_MAINT_TRUE@IP2K_DEPS = @CGEN_MAINT_TRUE@stamp-ip2k @CGEN_MAINT_FALSE@IP2K_DEPS = -@CGEN_MAINT_TRUE@IQ2000_DEPS = @CGEN_MAINT_TRUE@stamp-ip2000 -@CGEN_MAINT_FALSE@IQ2000_DEPS = @CGEN_MAINT_TRUE@M32R_DEPS = @CGEN_MAINT_TRUE@stamp-m32r @CGEN_MAINT_FALSE@M32R_DEPS = @CGEN_MAINT_TRUE@FR30_DEPS = @CGEN_MAINT_TRUE@stamp-fr30 @@ -435,6 +433,8 @@ CGEN_CPUS = fr30 frv ip2k m32r openrisc xstormy16 @CGEN_MAINT_FALSE@FRV_DEPS = @CGEN_MAINT_TRUE@OPENRISC_DEPS = @CGEN_MAINT_TRUE@stamp-openrisc @CGEN_MAINT_FALSE@OPENRISC_DEPS = +@CGEN_MAINT_TRUE@IQ2000_DEPS = @CGEN_MAINT_TRUE@stamp-iq2000 +@CGEN_MAINT_FALSE@IQ2000_DEPS = @CGEN_MAINT_TRUE@XSTORMY16_DEPS = @CGEN_MAINT_TRUE@stamp-xstormy16 @CGEN_MAINT_FALSE@XSTORMY16_DEPS = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -465,7 +465,7 @@ acinclude.m4 aclocal.m4 config.in configure configure.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES) OBJECTS = libopcodes.a.$(OBJEXT) $(libopcodes_la_OBJECTS) @@ -891,12 +891,6 @@ $(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k- stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc $(MAKE) run-cgen arch=ip2k prefix=ip2k options= extrafiles= -$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS) - @true -stamp-iq2000: $(CGENDEPS) $(CPUDIR)/iq2000.cpu $(CPUDIR)/iq2000.opc \ - $(CPUDIR)/iq2000m.cpu $(CPUDIR)/iq10.cpu - $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= extrafiles= - $(srcdir)/m32r-desc.h $(srcdir)/m32r-desc.c $(srcdir)/m32r-opc.h $(srcdir)/m32r-opc.c $(srcdir)/m32r-ibld.c $(srcdir)/m32r-opinst.c $(srcdir)/m32r-asm.c $(srcdir)/m32r-dis.c: $(M32R_DEPS) @true stamp-m32r: $(CGENDEPS) $(CPUDIR)/m32r.cpu $(CPUDIR)/m32r.opc @@ -917,6 +911,12 @@ $(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(s stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc $(MAKE) run-cgen arch=openrisc prefix=openrisc options= extrafiles= +$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS) + @true +stamp-iq2000: $(CGENDEPS) $(CPUDIR)/iq2000.cpu $(CPUDIR)/iq2000.opc \ + $(CPUDIR)/iq2000m.cpu $(CPUDIR)/iq10.cpu + $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= extrafiles= + $(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS) @true stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc @@ -1014,7 +1014,7 @@ arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/reloc-macros.h avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \ - $(INCDIR)/opcode/avr.h + $(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(BFD_H) \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h opintl.h @@ -1049,10 +1049,11 @@ fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h fr30-desc.lo: fr30-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h $(INCDIR)/opcode/cgen.h \ - fr30-opc.h opintl.h $(INCDIR)/libiberty.h + fr30-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h fr30-dis.lo: fr30-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h \ - $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + fr30-desc.h $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h fr30-ibld.lo: fr30-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h fr30-desc.h \ $(INCDIR)/opcode/cgen.h fr30-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -1065,10 +1066,11 @@ frv-asm.lo: frv-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h frv-desc.lo: frv-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h frv-desc.h $(INCDIR)/opcode/cgen.h \ - frv-opc.h opintl.h $(INCDIR)/libiberty.h + frv-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h frv-dis.lo: frv-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h frv-desc.h \ - $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + frv-desc.h $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h frv-ibld.lo: frv-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h frv-desc.h \ $(INCDIR)/opcode/cgen.h frv-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -1078,7 +1080,7 @@ frv-opc.lo: frv-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/reloc-macros.h h8300-dis.lo: h8300-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/h8300.h $(INCDIR)/dis-asm.h $(BFD_H) \ - $(INCDIR)/symcat.h opintl.h + $(INCDIR)/symcat.h opintl.h $(INCDIR)/libiberty.h h8500-dis.lo: h8500-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ h8500-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ opintl.h @@ -1116,7 +1118,7 @@ ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \ ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \ ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \ - ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c + ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c ../intl/libintl.h ia64-asmtab.lo: ia64-asmtab.c ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ @@ -1124,43 +1126,44 @@ ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h ip2k-desc.lo: ip2k-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ - ip2k-opc.h opintl.h $(INCDIR)/libiberty.h + ip2k-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h ip2k-dis.lo: ip2k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h \ - $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + ip2k-desc.h $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h ip2k-ibld.lo: ip2k-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h \ $(INCDIR)/opcode/cgen.h ip2k-opc.h opintl.h $(INCDIR)/safe-ctype.h ip2k-opc.lo: ip2k-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \ - ip2k-opc.h $(INCDIR)/libiberty.h -iq2000-asm.lo: iq2000-asm.c sysdep.h config.h $(BFD_H) \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h iq2000-desc.h \ - $(INCDIR)/opcode/cgen.h iq2000-opc.h opintl.h -iq2000-desc.lo: iq2000-desc.c sysdep.h config.h $(BFD_H) \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h iq2000-desc.h \ + ip2k-opc.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +iq2000-asm.lo: iq2000-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h opintl.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +iq2000-desc.lo: iq2000-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h opintl.h $(INCDIR)/libiberty.h +iq2000-dis.lo: iq2000-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h \ $(INCDIR)/opcode/cgen.h iq2000-opc.h opintl.h -iq2000-dis.lo: iq2000-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \ - $(BFD_H) $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ - iq2000-opc.h opintl.h -iq2000-ibld.lo: iq2000-ibld.c sysdep.h config.h $(INCDIR)/dis-asm.h \ - $(BFD_H) $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ - iq2000-opc.h opintl.h -iq2000-opc.lo: iq2000-opc.c sysdep.h config.h $(BFD_H) \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h iq2000-desc.h \ - $(INCDIR)/opcode/cgen.h iq2000-opc.h +iq2000-ibld.lo: iq2000-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h \ + $(INCDIR)/opcode/cgen.h iq2000-opc.h opintl.h $(INCDIR)/safe-ctype.h +iq2000-opc.lo: iq2000-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/symcat.h iq2000-desc.h $(INCDIR)/opcode/cgen.h \ + iq2000-opc.h $(INCDIR)/libiberty.h m32r-asm.lo: m32r-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h $(INCDIR)/opcode/cgen.h \ m32r-opc.h opintl.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h m32r-desc.lo: m32r-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h $(INCDIR)/opcode/cgen.h \ - m32r-opc.h opintl.h $(INCDIR)/libiberty.h + m32r-opc.h opintl.h $(INCDIR)/libiberty.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h m32r-dis.lo: m32r-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h \ - $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + m32r-desc.h $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h m32r-ibld.lo: m32r-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h m32r-desc.h \ $(INCDIR)/opcode/cgen.h m32r-opc.h opintl.h $(INCDIR)/safe-ctype.h @@ -1182,14 +1185,14 @@ m68k-opc.lo: m68k-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/m68k.h m88k-dis.lo: m88k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/m88k.h \ - opintl.h + opintl.h $(INCDIR)/libiberty.h mcore-dis.lo: mcore-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ mcore-opc.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h mips-dis.lo: mips-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/mips.h \ - opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/opcode/mips.h opintl.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h mips-opc.lo: mips-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/mips.h mips16-opc.lo: mips16-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ @@ -1217,10 +1220,12 @@ openrisc-asm.lo: openrisc-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h openrisc-desc.lo: openrisc-desc.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \ - $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h $(INCDIR)/libiberty.h + $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h openrisc-dis.lo: openrisc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \ - $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + openrisc-desc.h $(INCDIR)/opcode/cgen.h openrisc-opc.h \ + opintl.h openrisc-ibld.lo: openrisc-ibld.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ openrisc-desc.h $(INCDIR)/opcode/cgen.h openrisc-opc.h \ @@ -1257,7 +1262,8 @@ sh64-dis.lo: sh64-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \ sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/elf32-sh64.h sh64-opc.lo: sh64-opc.c sh64-opc.h sparc-dis.lo: sparc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h $(BFD_H) \ @@ -1294,11 +1300,12 @@ xstormy16-asm.lo: xstormy16-asm.c sysdep.h config.h \ $(INCDIR)/xregex2.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h xstormy16-desc.lo: xstormy16-desc.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h xstormy16-desc.h \ - $(INCDIR)/opcode/cgen.h xstormy16-opc.h opintl.h $(INCDIR)/libiberty.h + $(INCDIR)/opcode/cgen.h xstormy16-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h xstormy16-dis.lo: xstormy16-dis.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ - xstormy16-desc.h $(INCDIR)/opcode/cgen.h xstormy16-opc.h \ - opintl.h + $(INCDIR)/libiberty.h xstormy16-desc.h $(INCDIR)/opcode/cgen.h \ + xstormy16-opc.h opintl.h xstormy16-ibld.lo: xstormy16-ibld.c sysdep.h config.h \ $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ xstormy16-desc.h $(INCDIR)/opcode/cgen.h xstormy16-opc.h \ @@ -1308,7 +1315,8 @@ xstormy16-opc.lo: xstormy16-opc.c sysdep.h config.h \ $(INCDIR)/opcode/cgen.h xstormy16-opc.h $(INCDIR)/libiberty.h z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h z8k-opc.h -z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h +z8kgen.lo: z8kgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/opcodes/alpha-opc.c b/opcodes/alpha-opc.c index 6cf7d4c..8dc10e4 100644 --- a/opcodes/alpha-opc.c +++ b/opcodes/alpha-opc.c @@ -533,9 +533,13 @@ const struct alpha_opcode alpha_opcodes[] = { { "halt", SPCD(0x00,0x0000), BASE, ARG_NONE }, { "draina", SPCD(0x00,0x0002), BASE, ARG_NONE }, { "bpt", SPCD(0x00,0x0080), BASE, ARG_NONE }, + { "bugchk", SPCD(0x00,0x0081), BASE, ARG_NONE }, { "callsys", SPCD(0x00,0x0083), BASE, ARG_NONE }, { "chmk", SPCD(0x00,0x0083), BASE, ARG_NONE }, { "imb", SPCD(0x00,0x0086), BASE, ARG_NONE }, + { "rduniq", SPCD(0x00,0x009e), BASE, ARG_NONE }, + { "wruniq", SPCD(0x00,0x009f), BASE, ARG_NONE }, + { "gentrap", SPCD(0x00,0x00aa), BASE, ARG_NONE }, { "call_pal", PCD(0x00), BASE, ARG_PCD }, { "pal", PCD(0x00), BASE, ARG_PCD }, /* alias */ diff --git a/opcodes/po/POTFILES.in b/opcodes/po/POTFILES.in index 861e410..9a14a1d 100644 --- a/opcodes/po/POTFILES.in +++ b/opcodes/po/POTFILES.in @@ -61,6 +61,13 @@ ip2k-dis.c ip2k-ibld.c ip2k-opc.c ip2k-opc.h +iq2000-asm.c +iq2000-desc.c +iq2000-desc.h +iq2000-dis.c +iq2000-ibld.c +iq2000-opc.c +iq2000-opc.h m10200-dis.c m10200-opc.c m10300-dis.c diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c index 966a10e..a23110f 100644 --- a/opcodes/sh-dis.c +++ b/opcodes/sh-dis.c @@ -1,20 +1,20 @@ /* Disassemble SH instructions. - Copyright 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is 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 #include "sysdep.h" @@ -315,6 +315,9 @@ print_insn_sh (memaddr, info) case bfd_mach_sh2: target_arch = arch_sh2; break; + case bfd_mach_sh2e: + target_arch = arch_sh2e; + break; case bfd_mach_sh_dsp: target_arch = arch_sh_dsp; break; diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h index 21f64dd..f415e5e 100644 --- a/opcodes/sh-opc.h +++ b/opcodes/sh-opc.h @@ -1,167 +1,176 @@ /* Definitions for SH opcodes. - Copyright 1993, 1994, 1995, 1997, 1999, 2000 + Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2003 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -typedef enum { - HEX_0, - HEX_1, - HEX_2, - HEX_3, - HEX_4, - HEX_5, - HEX_6, - HEX_7, - HEX_8, - HEX_9, - HEX_A, - HEX_B, - HEX_C, - HEX_D, - HEX_E, - HEX_F, - REG_N, - REG_M, - SDT_REG_N, - REG_NM, - REG_B, - BRANCH_12, - BRANCH_8, - IMM0_4, - IMM0_4BY2, - IMM0_4BY4, - IMM1_4, - IMM1_4BY2, - IMM1_4BY4, - PCRELIMM_8BY2, - PCRELIMM_8BY4, - IMM0_8, - IMM0_8BY2, - IMM0_8BY4, - IMM1_8, - IMM1_8BY2, - IMM1_8BY4, - PPI, - NOPX, - NOPY, - MOVX, - MOVY, - PSH, - PMUL, - PPI3, - PDC, - PPIC, - REPEAT -} sh_nibble_type; - -typedef enum { - A_END, - A_BDISP12, - A_BDISP8, - A_DEC_M, - A_DEC_N, - A_DISP_GBR, - A_PC, - A_DISP_PC, - A_DISP_PC_ABS, - A_DISP_REG_M, - A_DISP_REG_N, - A_GBR, - A_IMM, - A_INC_M, - A_INC_N, - A_IND_M, - A_IND_N, - A_PMOD_N, - A_PMODY_N, - A_IND_R0_REG_M, - A_IND_R0_REG_N, - A_MACH, - A_MACL, - A_PR, - A_R0, - A_R0_GBR, - A_REG_M, - A_REG_N, - A_REG_B, - A_SR, - A_VBR, - A_MOD, - A_RE, - A_RS, - A_DSR, - DSP_REG_M, - DSP_REG_N, - DSP_REG_X, - DSP_REG_Y, - DSP_REG_E, - DSP_REG_F, - DSP_REG_G, - A_A0, - A_X0, - A_X1, - A_Y0, - A_Y1, - A_SSR, - A_SPC, - A_SGR, - A_DBR, - F_REG_N, - F_REG_M, - D_REG_N, - D_REG_M, - X_REG_N, /* Only used for argument parsing */ - X_REG_M, /* Only used for argument parsing */ - DX_REG_N, - DX_REG_M, - V_REG_N, - V_REG_M, - XMTRX_M4, - F_FR0, - FPUL_N, - FPUL_M, - FPSCR_N, - FPSCR_M -} sh_arg_type; - -typedef enum { - A_A1_NUM = 5, - A_A0_NUM = 7, - A_X0_NUM, A_X1_NUM, A_Y0_NUM, A_Y1_NUM, - A_M0_NUM, A_A1G_NUM, A_M1_NUM, A_A0G_NUM -} sh_dsp_reg_nums; + 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. */ + +typedef enum + { + HEX_0, + HEX_1, + HEX_2, + HEX_3, + HEX_4, + HEX_5, + HEX_6, + HEX_7, + HEX_8, + HEX_9, + HEX_A, + HEX_B, + HEX_C, + HEX_D, + HEX_E, + HEX_F, + REG_N, + REG_M, + SDT_REG_N, + REG_NM, + REG_B, + BRANCH_12, + BRANCH_8, + IMM0_4, + IMM0_4BY2, + IMM0_4BY4, + IMM1_4, + IMM1_4BY2, + IMM1_4BY4, + PCRELIMM_8BY2, + PCRELIMM_8BY4, + IMM0_8, + IMM0_8BY2, + IMM0_8BY4, + IMM1_8, + IMM1_8BY2, + IMM1_8BY4, + PPI, + NOPX, + NOPY, + MOVX, + MOVY, + PSH, + PMUL, + PPI3, + PDC, + PPIC, + REPEAT + } +sh_nibble_type; + +typedef enum + { + A_END, + A_BDISP12, + A_BDISP8, + A_DEC_M, + A_DEC_N, + A_DISP_GBR, + A_PC, + A_DISP_PC, + A_DISP_PC_ABS, + A_DISP_REG_M, + A_DISP_REG_N, + A_GBR, + A_IMM, + A_INC_M, + A_INC_N, + A_IND_M, + A_IND_N, + A_PMOD_N, + A_PMODY_N, + A_IND_R0_REG_M, + A_IND_R0_REG_N, + A_MACH, + A_MACL, + A_PR, + A_R0, + A_R0_GBR, + A_REG_M, + A_REG_N, + A_REG_B, + A_SR, + A_VBR, + A_MOD, + A_RE, + A_RS, + A_DSR, + DSP_REG_M, + DSP_REG_N, + DSP_REG_X, + DSP_REG_Y, + DSP_REG_E, + DSP_REG_F, + DSP_REG_G, + A_A0, + A_X0, + A_X1, + A_Y0, + A_Y1, + A_SSR, + A_SPC, + A_SGR, + A_DBR, + F_REG_N, + F_REG_M, + D_REG_N, + D_REG_M, + X_REG_N, /* Only used for argument parsing. */ + X_REG_M, /* Only used for argument parsing. */ + DX_REG_N, + DX_REG_M, + V_REG_N, + V_REG_M, + XMTRX_M4, + F_FR0, + FPUL_N, + FPUL_M, + FPSCR_N, + FPSCR_M + } +sh_arg_type; + +typedef enum + { + A_A1_NUM = 5, + A_A0_NUM = 7, + A_X0_NUM, A_X1_NUM, A_Y0_NUM, A_Y1_NUM, + A_M0_NUM, A_A1G_NUM, A_M1_NUM, A_A0G_NUM + } +sh_dsp_reg_nums; #define arch_sh1 0x0001 #define arch_sh2 0x0002 #define arch_sh3 0x0004 #define arch_sh3e 0x0008 #define arch_sh4 0x0010 +#define arch_sh2e 0x0020 #define arch_sh_dsp 0x0100 #define arch_sh3_dsp 0x0200 -#define arch_sh1_up (arch_sh1 | arch_sh2_up) -#define arch_sh2_up (arch_sh2 | arch_sh3_up | arch_sh_dsp) -#define arch_sh3_up (arch_sh3 | arch_sh3e_up | arch_sh3_dsp) +#define arch_sh1_up (arch_sh1 | arch_sh2_up) +#define arch_sh2_up (arch_sh2 | arch_sh2e_up | arch_sh3_up | arch_sh_dsp) +#define arch_sh2e_up (arch_sh2e | arch_sh3e_up) +#define arch_sh3_up (arch_sh3 | arch_sh3e_up | arch_sh3_dsp) #define arch_sh3e_up (arch_sh3e | arch_sh4_up) -#define arch_sh4_up arch_sh4 +#define arch_sh4_up arch_sh4 #define arch_sh_dsp_up (arch_sh_dsp | arch_sh3_dsp_up) #define arch_sh3_dsp_up arch_sh3_dsp -typedef struct { +typedef struct +{ char *name; sh_arg_type arg[4]; sh_nibble_type nibbles[4]; @@ -170,8 +179,8 @@ typedef struct { #ifdef DEFINE_TABLE -const sh_opcode_info sh_table[] = { - +const sh_opcode_info sh_table[] = + { /* 0111nnnni8*1.... add #, */{"add",{A_IMM,A_REG_N},{HEX_7,REG_N,IMM0_8}, arch_sh1_up}, /* 0011nnnnmmmm1100 add , */{"add",{ A_REG_M,A_REG_N},{HEX_3,REG_N,REG_M,HEX_C}, arch_sh1_up}, @@ -306,9 +315,9 @@ const sh_opcode_info sh_table[] = { /* 0100nnnn10111010 lds ,Y1 */{"lds",{A_REG_N,A_Y1},{HEX_4,REG_N,HEX_B,HEX_A}, arch_sh_dsp_up}, -/* 0100nnnn01011010 lds ,FPUL */{"lds",{A_REG_M,FPUL_N},{HEX_4,REG_M,HEX_5,HEX_A}, arch_sh3e_up}, - -/* 0100nnnn01101010 lds ,FPSCR */{"lds",{A_REG_M,FPSCR_N},{HEX_4,REG_M,HEX_6,HEX_A}, arch_sh3e_up}, +/* 0100nnnn01011010 lds ,FPUL */{"lds",{A_REG_M,FPUL_N},{HEX_4,REG_M,HEX_5,HEX_A}, arch_sh2e_up}, + +/* 0100nnnn01101010 lds ,FPSCR */{"lds",{A_REG_M,FPSCR_N},{HEX_4,REG_M,HEX_6,HEX_A}, arch_sh2e_up}, /* 0100nnnn00000110 lds.l @+,MACH*/{"lds.l",{A_INC_N,A_MACH},{HEX_4,REG_N,HEX_0,HEX_6}, arch_sh1_up}, @@ -328,9 +337,9 @@ const sh_opcode_info sh_table[] = { /* 0100nnnn10110110 lds.l @+,Y1 */{"lds.l",{A_INC_N,A_Y1},{HEX_4,REG_N,HEX_B,HEX_6}, arch_sh_dsp_up}, -/* 0100nnnn01010110 lds.l @+,FPUL*/{"lds.l",{A_INC_M,FPUL_N},{HEX_4,REG_M,HEX_5,HEX_6}, arch_sh3e_up}, - -/* 0100nnnn01100110 lds.l @+,FPSCR*/{"lds.l",{A_INC_M,FPSCR_N},{HEX_4,REG_M,HEX_6,HEX_6}, arch_sh3e_up}, +/* 0100nnnn01010110 lds.l @+,FPUL*/{"lds.l",{A_INC_M,FPUL_N},{HEX_4,REG_M,HEX_5,HEX_6}, arch_sh2e_up}, + +/* 0100nnnn01100110 lds.l @+,FPSCR*/{"lds.l",{A_INC_M,FPSCR_N},{HEX_4,REG_M,HEX_6,HEX_6}, arch_sh2e_up}, /* 0000000000111000 ldtlb */{"ldtlb",{0},{HEX_0,HEX_0,HEX_3,HEX_8}, arch_sh3_up}, @@ -551,9 +560,9 @@ const sh_opcode_info sh_table[] = { /* 0000nnnn10111010 sts Y1, */{"sts",{A_Y1,A_REG_N},{HEX_0,REG_N,HEX_B,HEX_A}, arch_sh_dsp_up}, -/* 0000nnnn01011010 sts FPUL, */{"sts",{FPUL_M,A_REG_N},{HEX_0,REG_N,HEX_5,HEX_A}, arch_sh3e_up}, - -/* 0000nnnn01101010 sts FPSCR, */{"sts",{FPSCR_M,A_REG_N},{HEX_0,REG_N,HEX_6,HEX_A}, arch_sh3e_up}, +/* 0000nnnn01011010 sts FPUL, */{"sts",{FPUL_M,A_REG_N},{HEX_0,REG_N,HEX_5,HEX_A}, arch_sh2e_up}, + +/* 0000nnnn01101010 sts FPSCR, */{"sts",{FPSCR_M,A_REG_N},{HEX_0,REG_N,HEX_6,HEX_A}, arch_sh2e_up}, /* 0100nnnn00000010 sts.l MACH,@-*/{"sts.l",{A_MACH,A_DEC_N},{HEX_4,REG_N,HEX_0,HEX_2}, arch_sh1_up}, @@ -573,9 +582,9 @@ const sh_opcode_info sh_table[] = { /* 0100nnnn10110110 sts.l Y1,@- */{"sts.l",{A_Y1,A_DEC_N},{HEX_4,REG_N,HEX_B,HEX_2}, arch_sh_dsp_up}, -/* 0100nnnn01010010 sts.l FPUL,@-*/{"sts.l",{FPUL_M,A_DEC_N},{HEX_4,REG_N,HEX_5,HEX_2}, arch_sh3e_up}, - -/* 0100nnnn01100010 sts.l FPSCR,@-*/{"sts.l",{FPSCR_M,A_DEC_N},{HEX_4,REG_N,HEX_6,HEX_2}, arch_sh3e_up}, +/* 0100nnnn01010010 sts.l FPUL,@-*/{"sts.l",{FPUL_M,A_DEC_N},{HEX_4,REG_N,HEX_5,HEX_2}, arch_sh2e_up}, + +/* 0100nnnn01100010 sts.l FPSCR,@-*/{"sts.l",{FPSCR_M,A_DEC_N},{HEX_4,REG_N,HEX_6,HEX_2}, arch_sh2e_up}, /* 0011nnnnmmmm1000 sub , */{"sub",{ A_REG_M,A_REG_N},{HEX_3,REG_N,REG_M,HEX_8}, arch_sh1_up}, @@ -736,57 +745,57 @@ const sh_opcode_info sh_table[] = { /* 11111101xxyynnnn plds ,MACL */ {"plds", {DSP_REG_N,A_MACL},{PPI,PPIC,HEX_F,HEX_D}, arch_sh_dsp_up}, -/* 1111nnnn01011101 fabs */{"fabs",{F_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh3e_up}, +/* 1111nnnn01011101 fabs */{"fabs",{F_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh2e_up}, /* 1111nnnn01011101 fabs */{"fabs",{D_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh4_up}, -/* 1111nnnnmmmm0000 fadd ,*/{"fadd",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh3e_up}, +/* 1111nnnnmmmm0000 fadd ,*/{"fadd",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh2e_up}, /* 1111nnn0mmm00000 fadd ,*/{"fadd",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh4_up}, -/* 1111nnnnmmmm0100 fcmp/eq ,*/{"fcmp/eq",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_4}, arch_sh3e_up}, +/* 1111nnnnmmmm0100 fcmp/eq ,*/{"fcmp/eq",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_4}, arch_sh2e_up}, /* 1111nnn0mmm00100 fcmp/eq ,*/{"fcmp/eq",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_4}, arch_sh4_up}, -/* 1111nnnnmmmm0101 fcmp/gt ,*/{"fcmp/gt",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh3e_up}, +/* 1111nnnnmmmm0101 fcmp/gt ,*/{"fcmp/gt",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh2e_up}, /* 1111nnn0mmm00101 fcmp/gt ,*/{"fcmp/gt",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh4_up}, /* 1111nnn010111101 fcnvds ,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_B,HEX_D}, arch_sh4_up}, /* 1111nnn010101101 fcnvsd FPUL,*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_A,HEX_D}, arch_sh4_up}, -/* 1111nnnnmmmm0011 fdiv ,*/{"fdiv",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh3e_up}, +/* 1111nnnnmmmm0011 fdiv ,*/{"fdiv",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh2e_up}, /* 1111nnn0mmm00011 fdiv ,*/{"fdiv",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh4_up}, /* 1111nnmm11101101 fipr ,*/{"fipr",{V_REG_M,V_REG_N},{HEX_F,REG_NM,HEX_E,HEX_D}, arch_sh4_up}, -/* 1111nnnn10001101 fldi0 */{"fldi0",{F_REG_N},{HEX_F,REG_N,HEX_8,HEX_D}, arch_sh3e_up}, +/* 1111nnnn10001101 fldi0 */{"fldi0",{F_REG_N},{HEX_F,REG_N,HEX_8,HEX_D}, arch_sh2e_up}, -/* 1111nnnn10011101 fldi1 */{"fldi1",{F_REG_N},{HEX_F,REG_N,HEX_9,HEX_D}, arch_sh3e_up}, +/* 1111nnnn10011101 fldi1 */{"fldi1",{F_REG_N},{HEX_F,REG_N,HEX_9,HEX_D}, arch_sh2e_up}, -/* 1111nnnn00011101 flds ,FPUL*/{"flds",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_1,HEX_D}, arch_sh3e_up}, +/* 1111nnnn00011101 flds ,FPUL*/{"flds",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_1,HEX_D}, arch_sh2e_up}, -/* 1111nnnn00101101 float FPUL,*/{"float",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh3e_up}, +/* 1111nnnn00101101 float FPUL,*/{"float",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh2e_up}, /* 1111nnnn00101101 float FPUL,*/{"float",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh4_up}, -/* 1111nnnnmmmm1110 fmac FR0,,*/{"fmac",{F_FR0,F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_E}, arch_sh3e_up}, +/* 1111nnnnmmmm1110 fmac FR0,,*/{"fmac",{F_FR0,F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_E}, arch_sh2e_up}, -/* 1111nnnnmmmm1100 fmov ,*/{"fmov",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh3e_up}, +/* 1111nnnnmmmm1100 fmov ,*/{"fmov",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh2e_up}, /* 1111nnnnmmmm1100 fmov ,*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh4_up}, -/* 1111nnnnmmmm1000 fmov @,*/{"fmov",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh3e_up}, +/* 1111nnnnmmmm1000 fmov @,*/{"fmov",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up}, /* 1111nnnnmmmm1000 fmov @,*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up}, -/* 1111nnnnmmmm1010 fmov ,@*/{"fmov",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh3e_up}, +/* 1111nnnnmmmm1010 fmov ,@*/{"fmov",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh2e_up}, /* 1111nnnnmmmm1010 fmov ,@*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up}, -/* 1111nnnnmmmm1001 fmov @+,*/{"fmov",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh3e_up}, +/* 1111nnnnmmmm1001 fmov @+,*/{"fmov",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh2e_up}, /* 1111nnnnmmmm1001 fmov @+,*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up}, -/* 1111nnnnmmmm1011 fmov ,@-*/{"fmov",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh3e_up}, +/* 1111nnnnmmmm1011 fmov ,@-*/{"fmov",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh2e_up}, /* 1111nnnnmmmm1011 fmov ,@-*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up}, -/* 1111nnnnmmmm0110 fmov @(R0,),*/{"fmov",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh3e_up}, +/* 1111nnnnmmmm0110 fmov @(R0,),*/{"fmov",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh2e_up}, /* 1111nnnnmmmm0110 fmov @(R0,),*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up}, -/* 1111nnnnmmmm0111 fmov ,@(R0,)*/{"fmov",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh3e_up}, +/* 1111nnnnmmmm0111 fmov ,@(R0,)*/{"fmov",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh2e_up}, /* 1111nnnnmmmm0111 fmov ,@(R0,)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up}, /* 1111nnnnmmmm1000 fmov.d @,*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up}, @@ -801,22 +810,22 @@ const sh_opcode_info sh_table[] = { /* 1111nnnnmmmm0111 fmov.d ,@(R0,)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up}, -/* 1111nnnnmmmm1000 fmov.s @,*/{"fmov.s",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh3e_up}, +/* 1111nnnnmmmm1000 fmov.s @,*/{"fmov.s",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up}, -/* 1111nnnnmmmm1010 fmov.s ,@*/{"fmov.s",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh3e_up}, +/* 1111nnnnmmmm1010 fmov.s ,@*/{"fmov.s",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh2e_up}, -/* 1111nnnnmmmm1001 fmov.s @+,*/{"fmov.s",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh3e_up}, +/* 1111nnnnmmmm1001 fmov.s @+,*/{"fmov.s",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh2e_up}, -/* 1111nnnnmmmm1011 fmov.s ,@-*/{"fmov.s",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh3e_up}, +/* 1111nnnnmmmm1011 fmov.s ,@-*/{"fmov.s",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh2e_up}, -/* 1111nnnnmmmm0110 fmov.s @(R0,),*/{"fmov.s",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh3e_up}, +/* 1111nnnnmmmm0110 fmov.s @(R0,),*/{"fmov.s",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh2e_up}, -/* 1111nnnnmmmm0111 fmov.s ,@(R0,)*/{"fmov.s",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh3e_up}, +/* 1111nnnnmmmm0111 fmov.s ,@(R0,)*/{"fmov.s",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh2e_up}, -/* 1111nnnnmmmm0010 fmul ,*/{"fmul",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_2}, arch_sh3e_up}, +/* 1111nnnnmmmm0010 fmul ,*/{"fmul",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_2}, arch_sh2e_up}, /* 1111nnn0mmm00010 fmul ,*/{"fmul",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_2}, arch_sh4_up}, -/* 1111nnnn01001101 fneg */{"fneg",{F_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh3e_up}, +/* 1111nnnn01001101 fneg */{"fneg",{F_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh2e_up}, /* 1111nnnn01001101 fneg */{"fneg",{D_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh4_up}, /* 1111101111111101 frchg */{"frchg",{0},{HEX_F,HEX_B,HEX_F,HEX_D}, arch_sh4_up}, @@ -826,12 +835,12 @@ const sh_opcode_info sh_table[] = { /* 1111nnnn01101101 fsqrt */{"fsqrt",{F_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh3e_up}, /* 1111nnnn01101101 fsqrt */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up}, -/* 1111nnnn00001101 fsts FPUL,*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}, arch_sh3e_up}, +/* 1111nnnn00001101 fsts FPUL,*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}, arch_sh2e_up}, -/* 1111nnnnmmmm0001 fsub ,*/{"fsub",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_1}, arch_sh3e_up}, +/* 1111nnnnmmmm0001 fsub ,*/{"fsub",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_1}, arch_sh2e_up}, /* 1111nnn0mmm00001 fsub ,*/{"fsub",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_1}, arch_sh4_up}, -/* 1111nnnn00111101 ftrc ,FPUL*/{"ftrc",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh3e_up}, +/* 1111nnnn00111101 ftrc ,FPUL*/{"ftrc",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh2e_up}, /* 1111nnnn00111101 ftrc ,FPUL*/{"ftrc",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh4_up}, /* 1111nn0111111101 ftrv XMTRX_M4,*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_NM,HEX_F,HEX_D}, arch_sh4_up}, diff --git a/opcodes/sh64-dis.c b/opcodes/sh64-dis.c index 631678c..063c261 100644 --- a/opcodes/sh64-dis.c +++ b/opcodes/sh64-dis.c @@ -1,5 +1,5 @@ /* Disassemble SH64 instructions. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ /* We need to refer to the ELF header structure. */ #include "elf-bfd.h" #include "elf/sh.h" +#include "elf32-sh64.h" #define ELF_MODE32_CODE_LABEL_P(SYM) \ (((elf_symbol_type *) (SYM))->internal_elf_sym.st_other & STO_SH5_ISA32) diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index 47ebb31..c68df38 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -1,20 +1,20 @@ /* Print SPARC instructions. Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2002 Free Software Foundation, Inc. + 2000, 2002, 2003 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is 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 @@ -46,7 +46,8 @@ static const struct sparc_opcode **sorted_opcodes; static int opcode_bits[4] = { 0x01c00000, 0x0, 0x01f80000, 0x01f80000 }; #define HASH_INSN(INSN) \ ((((INSN) >> 24) & 0xc0) | (((INSN) & opcode_bits[((INSN) >> 30) & 3]) >> 19)) -struct opcode_hash { +struct opcode_hash +{ struct opcode_hash *next; const struct sparc_opcode *opcode; }; @@ -257,7 +258,7 @@ print_insn_sparc (memaddr, info) } /* On SPARClite variants such as DANlite (sparc86x), instructions - are always big-endian even when the machine is in little-endian mode. */ + are always big-endian even when the machine is in little-endian mode. */ if (info->endian == BFD_ENDIAN_BIG || info->mach == bfd_mach_sparc_sparclite) getword = bfd_getb32; else @@ -265,10 +266,10 @@ print_insn_sparc (memaddr, info) insn = getword (buffer); - info->insn_info_valid = 1; /* We do return this info */ - info->insn_type = dis_nonbranch; /* Assume non branch insn */ - info->branch_delay_insns = 0; /* Assume no delay */ - info->target = 0; /* Assume no target known */ + info->insn_info_valid = 1; /* We do return this info. */ + info->insn_type = dis_nonbranch; /* Assume non branch insn. */ + info->branch_delay_insns = 0; /* Assume no delay. */ + info->target = 0; /* Assume no target known. */ for (op = opcode_hash_table[HASH_INSN (insn)]; op; op = op->next) { @@ -316,32 +317,34 @@ print_insn_sparc (memaddr, info) if (opcode->args[0] != ',') (*info->fprintf_func) (stream, " "); + for (s = opcode->args; *s != '\0'; ++s) { while (*s == ',') { (*info->fprintf_func) (stream, ","); ++s; - switch (*s) { - case 'a': - (*info->fprintf_func) (stream, "a"); - is_annulled = 1; - ++s; - continue; - case 'N': - (*info->fprintf_func) (stream, "pn"); - ++s; - continue; - - case 'T': - (*info->fprintf_func) (stream, "pt"); - ++s; - continue; - - default: - break; - } /* switch on arg */ - } /* while there are comma started args */ + switch (*s) + { + case 'a': + (*info->fprintf_func) (stream, "a"); + is_annulled = 1; + ++s; + continue; + case 'N': + (*info->fprintf_func) (stream, "pn"); + ++s; + continue; + + case 'T': + (*info->fprintf_func) (stream, "pt"); + ++s; + continue; + + default: + break; + } + } (*info->fprintf_func) (stream, " "); @@ -682,26 +685,33 @@ print_insn_sparc (memaddr, info) unsigned long prev_insn; int errcode; - errcode = - (*info->read_memory_func) + if (memaddr >= 4) + errcode = + (*info->read_memory_func) (memaddr - 4, buffer, sizeof (buffer), info); + else + errcode = 1; + prev_insn = getword (buffer); if (errcode == 0) { /* If it is a delayed branch, we need to look at the instruction before the delayed branch. This handles - sequences such as + sequences such as: sethi %o1, %hi(_foo), %o1 call _printf - or %o1, %lo(_foo), %o1 - */ + or %o1, %lo(_foo), %o1 */ if (is_delayed_branch (prev_insn)) { - errcode = (*info->read_memory_func) - (memaddr - 8, buffer, sizeof (buffer), info); + if (memaddr >= 8) + errcode = (*info->read_memory_func) + (memaddr - 8, buffer, sizeof (buffer), info); + else + errcode = 1; + prev_insn = getword (buffer); } } @@ -746,7 +756,7 @@ print_insn_sparc (memaddr, info) } } - info->insn_type = dis_noninsn; /* Mark as non-valid instruction */ + info->insn_type = dis_noninsn; /* Mark as non-valid instruction. */ (*info->fprintf_func) (stream, _("unknown")); return sizeof (buffer); } diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index 1c2df78..7323018 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,3 +1,8 @@ +2003-01-09 Michael Chastain + + From Chet Ramey, , the readline maintainer: + * display.c: Fix perverse screen refresh with UTF-8. + 2003-01-08 Chris Demetriou * config.guess: Update to 2003-01-03 version. diff --git a/readline/display.c b/readline/display.c index dec0de3..e151cf2 100644 --- a/readline/display.c +++ b/readline/display.c @@ -74,7 +74,7 @@ static void insert_some_chars PARAMS((char *, int, int)); static void cr PARAMS((void)); #if defined (HANDLE_MULTIBYTE) -static int _rl_col_width PARAMS((char *, int, int)); +static int _rl_col_width PARAMS((const char *, int, int)); static int *_rl_wrapped_line; #else # define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s)) @@ -1352,9 +1352,9 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) { _rl_output_some_chars (nfd + lendiff, temp - lendiff); #if 0 - _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff; -#else _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff); +#else + _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff); #endif } } @@ -1514,8 +1514,15 @@ _rl_move_cursor_relative (new, data) #if defined (HANDLE_MULTIBYTE) /* If we have multibyte characters, NEW is indexed by the buffer point in a multibyte string, but _rl_last_c_pos is the display position. In - this case, NEW's display position is not obvious. */ - if ((MB_CUR_MAX == 1 || rl_byte_oriented ) && _rl_last_c_pos == new) return; + this case, NEW's display position is not obvious and must be + calculated. */ + if (MB_CUR_MAX == 1 || rl_byte_oriented) + { + if (_rl_last_c_pos == new) + return; + } + else if (_rl_last_c_pos == _rl_col_width (data, 0, new)) + return; #else if (_rl_last_c_pos == new) return; #endif @@ -1598,11 +1605,7 @@ _rl_move_cursor_relative (new, data) #endif { if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - { - tputs (_rl_term_cr, 1, _rl_output_character_function); - for (i = 0; i < new; i++) - putc (data[i], rl_outstream); - } + _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new)); else _rl_backspace (_rl_last_c_pos - new); } @@ -2144,7 +2147,7 @@ _rl_current_display_line () scan from the beginning of the string to take the state into account. */ static int _rl_col_width (str, start, end) - char *str; + const char *str; int start, end; { wchar_t wc; @@ -2220,4 +2223,3 @@ _rl_col_width (str, start, end) return width; } #endif /* HANDLE_MULTIBYTE */ - diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index a397330..ca21f15 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2003-01-10 Ben Elliston + + * README.Cygnus: Rename from this .. + * README: .. to this. + 2002-09-27 Andrew Cagney * wrapper.c (sim_open): Add support for -m. @@ -62,31 +67,9 @@ CRm is 1. (write_cp13_reg): Allow bit 0 of reg 1 of CRm 1 to be written to. -2002-05-20 Nick Clifton - - * Makefile.in (SWI_TARGET_SWITCHES): Define. - * armos.c (swi_mask): Define. Initialise to supporting all - SWI emulations. - (ARMul_OSInit): For XScale targets, only support the ANGEL - SWI interface. (This is at the request if Intel). - (ARMul_OSHandleSWI): Examine swi_mask to see if a particular - SWI call should be emulated. - Do not fall through from AngelSWI_Reason_WriteC. - Propagate exit code from RedBoot Exit SWI. - * rdi-dgb.h (swi_mask): Prototype. - (SWI_MASK_DEMON, SWI_MASK_ANGEL, SWI_MASK_REDBOOT): Define. - * wrapper.c: Include run-sim.h. - (sim_target_parse_command_line): New function. Look for and - handle --swi-support switch. - (sim_target_parse_arg_array): New function. Process an argv - array for parsing by sim_target_parse_command_line. - (sim_target_display_usage): New function. Describe syntax of - --swi-suppoort switch. - (sim_open): Add call to sim_target_parse_arg_array). - 2002-05-17 Nick Clifton - * Makefile.in (SWI_TARGET_SWITCHES): Define. + * Makefile.in (SIM_TARGET_SWITCHES): Define. * armos.c (swi_mask): Define. Initialise to supporting all SWI emulations. (ARMul_OSInit): For XScale targets, only support the ANGEL diff --git a/sim/arm/README.Cygnus b/sim/arm/README similarity index 100% rename from sim/arm/README.Cygnus rename to sim/arm/README diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 2a91af9..62fd073 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,12 @@ +2003-01-31 Kazu Hirata + + * compile.c (sim_resume): Fix the handling of bxor. + +2003-01-16 Michael Snyder + + * compile.c: Change K&R function definitions to ISO. + (fetch): Make static, and eliminate unused parameter 'n'. + 2002-12-26 Kazu Hirata * compile.c: Fix formatting. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 3d9e3c8..e845899 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -127,19 +127,19 @@ int h8300smode = 0; static int memory_size; static int -get_now () +get_now (void) { return time (0); /* WinXX HAS UNIX like 'time', so why not using it? */ } static int -now_persec () +now_persec (void) { return 1; } static int -bitfrom (x) +bitfrom (int x) { switch (x & SIZE) { @@ -155,7 +155,7 @@ bitfrom (x) } static unsigned int -lvalue (x, rn) +lvalue (int x, int rn) { switch (x / 4) { @@ -175,11 +175,7 @@ lvalue (x, rn) } static unsigned int -decode (addr, data, dst) - int addr; - unsigned char *data; - decoded_inst *dst; - +decode (int addr, unsigned char *data, decoded_inst *dst) { int rs = 0; int rd = 0; @@ -481,7 +477,7 @@ decode (addr, data, dst) } static void -compile (pc) +compile (int pc) { int idx; @@ -550,9 +546,8 @@ static unsigned int *lreg[18]; #define SET_MEMORY_B(x,y) \ (x < memory_size ? (cpu.memory[(x)] = y) : (cpu.eightbit[x & 0xff] = y)) -int -fetch (arg, n) - ea_type *arg; +static int +fetch (ea_type *arg) { int rn = arg->reg; int abs = arg->literal; @@ -634,9 +629,7 @@ fetch (arg, n) static void -store (arg, n) - ea_type *arg; - int n; +store (ea_type *arg, int n) { int rn = arg->reg; int abs = arg->literal; @@ -710,7 +703,7 @@ static union littleendian; static void -init_pointers () +init_pointers (void) { static int init; @@ -785,11 +778,7 @@ init_pointers () } static void -control_c (sig, code, scp, addr) - int sig; - int code; - char *scp; - char *addr; +control_c (int sig) { cpu.state = SIM_STATE_STOPPED; cpu.exception = SIGINT; @@ -805,10 +794,7 @@ control_c (sig, code, scp, addr) #define I (intMaskBit != 0) static int -mop (code, bsize, sign) - decoded_inst *code; - int bsize; - int sign; +mop (decoded_inst *code, int bsize, int sign) { int multiplier; int multiplicand; @@ -938,8 +924,7 @@ case O (name, SB): \ } int -sim_stop (sd) - SIM_DESC sd; +sim_stop (SIM_DESC sd) { cpu.state = SIM_STATE_STOPPED; cpu.exception = SIGINT; @@ -969,8 +954,7 @@ sim_stop (sd) #define TICK_REGNUM 13 void -sim_resume (sd, step, siggnal) - SIM_DESC sd; +sim_resume (SIM_DESC sd, int step, int siggnal) { static int init1; int cycles = 0; @@ -1521,7 +1505,7 @@ sim_resume (sd, step, siggnal) OBITOP (O_BIAND, 1, 0, c = !(ea & m) && C); OBITOP (O_BOR, 1, 0, c = (ea & m) || C); OBITOP (O_BIOR, 1, 0, c = !(ea & m) || C); - OBITOP (O_BXOR, 1, 0, c = (ea & m) != C); + OBITOP (O_BXOR, 1, 0, c = ((ea & m) != 0) != C); OBITOP (O_BIXOR, 1, 0, c = !(ea & m) != C); #define MOP(bsize, signed) \ @@ -1887,19 +1871,14 @@ sim_resume (sd, step, siggnal) } int -sim_trace (sd) - SIM_DESC sd; +sim_trace (SIM_DESC sd) { /* FIXME: Unfinished. */ abort (); } int -sim_write (sd, addr, buffer, size) - SIM_DESC sd; - SIM_ADDR addr; - unsigned char *buffer; - int size; +sim_write (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) { int i; @@ -1920,11 +1899,7 @@ sim_write (sd, addr, buffer, size) } int -sim_read (sd, addr, buffer, size) - SIM_DESC sd; - SIM_ADDR addr; - unsigned char *buffer; - int size; +sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) { init_pointers (); if (addr < 0) @@ -1938,11 +1913,7 @@ sim_read (sd, addr, buffer, size) int -sim_store_register (sd, rn, value, length) - SIM_DESC sd; - int rn; - unsigned char *value; - int length; +sim_store_register (SIM_DESC sd, int rn, unsigned char *value, int length) { int longval; int shortval; @@ -1991,11 +1962,7 @@ sim_store_register (sd, rn, value, length) } int -sim_fetch_register (sd, rn, buf, length) - SIM_DESC sd; - int rn; - unsigned char *buf; - int length; +sim_fetch_register (SIM_DESC sd, int rn, unsigned char *buf, int length) { int v; int longreg = 0; @@ -2056,10 +2023,7 @@ sim_fetch_register (sd, rn, buf, length) } void -sim_stop_reason (sd, reason, sigrc) - SIM_DESC sd; - enum sim_stop *reason; - int *sigrc; +sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc) { #if 0 /* FIXME: This should work but we can't use it. grep for SLEEP above. */ @@ -2079,14 +2043,13 @@ sim_stop_reason (sd, reason, sigrc) /* FIXME: Rename to sim_set_mem_size. */ void -sim_size (n) - int n; +sim_size (int n) { /* Memory size is fixed. */ } void -sim_set_simcache_size (n) +sim_set_simcache_size (int n) { if (cpu.cache) free (cpu.cache); @@ -2099,9 +2062,7 @@ sim_set_simcache_size (n) void -sim_info (sd, verbose) - SIM_DESC sd; - int verbose; +sim_info (SIM_DESC sd, int verbose) { double timetaken = (double) cpu.ticks / (double) now_persec (); double virttime = cpu.cycles / 10.0e6; @@ -2149,8 +2110,7 @@ sim_info (sd, verbose) FLAG is non-zero for the H8/300H. */ void -set_h8300h (h_flag, s_flag) - int h_flag, s_flag; +set_h8300h (int h_flag, int s_flag) { /* FIXME: Much of the code in sim_load can be moved to sim_open. This function being replaced by a sim_open:ARGV configuration @@ -2160,11 +2120,10 @@ set_h8300h (h_flag, s_flag) } SIM_DESC -sim_open (kind, ptr, abfd, argv) - SIM_OPEN_KIND kind; - struct host_callback_struct *ptr; - struct _bfd *abfd; - char **argv; +sim_open (SIM_OPEN_KIND kind, + struct host_callback_struct *ptr, + struct _bfd *abfd, + char **argv) { /* FIXME: Much of the code in sim_load can be moved here. */ @@ -2176,9 +2135,7 @@ sim_open (kind, ptr, abfd, argv) } void -sim_close (sd, quitting) - SIM_DESC sd; - int quitting; +sim_close (SIM_DESC sd, int quitting) { /* Nothing to do. */ } @@ -2186,11 +2143,7 @@ sim_close (sd, quitting) /* Called by gdb to load a program into memory. */ SIM_RC -sim_load (sd, prog, abfd, from_tty) - SIM_DESC sd; - char *prog; - bfd *abfd; - int from_tty; +sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty) { bfd *prog_bfd; @@ -2272,11 +2225,7 @@ sim_load (sd, prog, abfd, from_tty) } SIM_RC -sim_create_inferior (sd, abfd, argv, env) - SIM_DESC sd; - struct _bfd *abfd; - char **argv; - char **env; +sim_create_inferior (SIM_DESC sd, struct _bfd *abfd, char **argv, char **env) { if (abfd != NULL) cpu.pc = bfd_get_start_address (abfd); @@ -2286,17 +2235,14 @@ sim_create_inferior (sd, abfd, argv, env) } void -sim_do_command (sd, cmd) - SIM_DESC sd; - char *cmd; +sim_do_command (SIM_DESC sd, char *cmd) { (*sim_callback->printf_filtered) (sim_callback, "This simulator does not accept any commands.\n"); } void -sim_set_callbacks (ptr) - struct host_callback_struct *ptr; +sim_set_callbacks (struct host_callback_struct *ptr) { sim_callback = ptr; } diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 0f84f0b..0482ab2 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,11 @@ +2003-01-14 Chris Demetriou + + * mips.igen (LUXC1, SUXC1): New, for mipsV and mips64. + +2003-01-14 Chris Demetriou + + * mips.igen (EI, DI): Remove. + 2003-01-05 Richard Sandiford * Makefile.in (tmp-run-multi): Fix mips16 filter. diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen index fece487..81fb200 100644 --- a/sim/mips/mips.igen +++ b/sim/mips/mips.igen @@ -4271,6 +4271,22 @@ } +010011,5.BASE,5.INDEX,5.0,5.FD,000101:COP1X:64,f::LUXC1 +"luxc1 f, r(r)" +*mipsV: +*mips64: +{ + address_word base = GPR[BASE]; + address_word index = GPR[INDEX]; + address_word vaddr = base + index; + check_fpu (SD_); + check_u64 (SD_, instruction_0); + /* Arrange for the bottom 3 bits of (base + index) to be 0. */ + if ((vaddr & 0x7) != 0) + index -= (vaddr & 0x7); + COP_LD (1, FD, do_load (SD_, AccessLength_DOUBLEWORD, base, index)); +} + 110001,5.BASE,5.FT,16.OFFSET:COP1:32,f::LWC1 "lwc1 f, (r)" @@ -4743,6 +4759,24 @@ } +010011,5.BASE,5.INDEX,5.FS,00000,001101:COP1X:64,f::SUXC1 +"suxc1 f, r(r)" +*mipsV: +*mips64: +{ + unsigned64 v; + address_word base = GPR[BASE]; + address_word index = GPR[INDEX]; + address_word vaddr = base + index; + check_fpu (SD_); + check_u64 (SD_, instruction_0); + /* Arrange for the bottom 3 bits of (base + index) to be 0. */ + if ((vaddr & 0x7) != 0) + index -= (vaddr & 0x7); + do_store (SD_, AccessLength_DOUBLEWORD, base, index, COP_SD (1, FS)); +} + + 010001,10,3.FMT,00000,5.FS,5.FD,000100:COP1:32,f::SQRT.fmt "sqrt.%s f, f" *mipsII: @@ -4994,17 +5028,6 @@ } -010000,1,0000000000000000000,111001:COP0:32::DI -"di" -*mipsI: -*mipsII: -*mipsIII: -*mipsIV: -*mipsV: -*vr4100: -*vr5000: - - 010000,00001,5.RT,5.RD,00000000000:COP0:64::DMFC0 "dmfc0 r, r" *mipsIII: @@ -5029,18 +5052,6 @@ } -010000,1,0000000000000000000,111000:COP0:32::EI -"ei" -*mipsI: -*mipsII: -*mipsIII: -*mipsIV: -*mipsV: -*mips64: -*vr4100: -*vr5000: - - 010000,1,0000000000000000000,011000:COP0:32::ERET "eret" *mipsIII: