summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authornobody <>2003-05-21 19:52:40 +0000
committernobody <>2003-05-21 19:52:40 +0000
commit3b246c09d7eda95c2f3cdfa3edd4b633850bbdd1 (patch)
tree2e1d6a58fdef4e9da0c4aceb20543c1b401483d8 /gdb
parentb41719d9f61907f1c810753438454c6f5656347b (diff)
downloadbinutils-gdb-3b246c09d7eda95c2f3cdfa3edd4b633850bbdd1.tar.gz
This commit was manufactured by cvs2svn to create branchcagney_fileio-20030521-branchpoint
'cagney_fileio-20030521-branch'. Sprout from jimb-ppc64-linux-20030509-branch 2003-05-09 16:41:43 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'jimb-' Cherrypick from master 2003-05-21 19:52:39 UTC Andrew Cagney <cagney@redhat.com> '2003-05-21 Andrew Cagney <cagney@redhat.com>': ChangeLog Makefile.in Makefile.tpl bfd/ChangeLog bfd/archures.c bfd/bfd-in.h bfd/bfd-in2.h bfd/bfd.c bfd/config.bfd bfd/configure bfd/configure.host bfd/configure.in bfd/cpu-h8300.c bfd/cpu-m68hc12.c bfd/elf-bfd.h bfd/elf.c bfd/elf32-h8300.c bfd/elf32-i386.c bfd/elf32-i860.c bfd/elf32-m68hc1x.c bfd/elf32-m68k.c bfd/elf32-mips.c bfd/elf32-ppc.c bfd/elf32-sh.c bfd/elf32-xstormy16.c bfd/elf64-ppc.c bfd/elfcode.h bfd/elflink.c bfd/elflink.h bfd/elfxx-target.h bfd/version.h config.guess config.sub config/ChangeLog config/acinclude.m4 config/acx.m4 configure configure.in etc/ChangeLog etc/configure.texi gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/TODO gdb/ada-exp.y gdb/ada-lang.c gdb/ada-lang.h gdb/ada-valprint.c gdb/alpha-tdep.c gdb/arch-utils.c gdb/arch-utils.h gdb/arm-linux-tdep.c gdb/arm-tdep.c gdb/avr-tdep.c gdb/block.c gdb/block.h gdb/blockframe.c gdb/c-exp.y gdb/c-lang.c gdb/c-valprint.c gdb/coffread.c gdb/config/djgpp/fnchange.lst gdb/config/i386/tm-linux.h gdb/config/ia64/tm-ia64.h gdb/config/m68k/nm-sun3.h gdb/config/m68k/tm-linux.h gdb/config/m68k/tm-m68k.h gdb/config/m68k/tm-sun3.h gdb/config/mips/tm-irix5.h gdb/config/mips/tm-irix6.h gdb/config/mips/tm-mips.h gdb/config/nm-gnu.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/s390/tm-s390.h gdb/config/sparc/nm-nbsd.h gdb/config/sparc/nm-sun4os4.h gdb/config/sparc/nm-sun4sol2.h gdb/config/sparc/tm-sp64.h gdb/config/sparc/tm-sparc.h gdb/cp-namespace.c gdb/cp-support.h gdb/cp-valprint.c gdb/cris-tdep.c gdb/dbxread.c gdb/defs.h gdb/disasm.h gdb/doc/ChangeLog gdb/doc/Makefile.in gdb/doc/gdbint.texinfo gdb/dummy-frame.c gdb/dummy-frame.h gdb/dwarf2expr.c gdb/dwarf2loc.c gdb/dwarf2read.c gdb/dwarfread.c gdb/f-exp.y gdb/f-lang.c gdb/findvar.c gdb/frame.c gdb/frame.h gdb/frv-tdep.c gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-v3-abi.c gdb/h8300-tdep.c gdb/hppa-tdep.c gdb/hpread.c gdb/hpux-thread.c gdb/i386-linux-tdep.c gdb/i386-tdep.c gdb/i386-tdep.h gdb/ia64-tdep.c gdb/irix4-nat.c gdb/irix5-nat.c gdb/jv-exp.y gdb/jv-lang.c gdb/jv-valprint.c gdb/language.c gdb/language.h gdb/linespec.c gdb/m2-exp.y gdb/m2-lang.c gdb/m3-nat.c gdb/m68hc11-tdep.c gdb/m68k-tdep.c gdb/m68klinux-tdep.c gdb/mcore-tdep.c gdb/mdebugread.c gdb/mem-break.c gdb/mi/ChangeLog gdb/mi/mi-cmd-stack.c gdb/mi/mi-main.c gdb/mi/mi-symbol-cmds.c gdb/minsyms.c gdb/mips-nat.c gdb/mips-tdep.c gdb/mn10300-tdep.c gdb/monitor.c gdb/nlmread.c gdb/ns32k-tdep.c gdb/nto-tdep.c gdb/objc-exp.y gdb/objc-lang.c gdb/objfiles.c gdb/p-exp.y gdb/p-lang.c gdb/p-valprint.c gdb/parse.c gdb/ppc-sysv-tdep.c gdb/printcmd.c gdb/proc-api.c gdb/regcache.c gdb/regcache.h gdb/remote-array.c gdb/remote-mips.c gdb/remote-sds.c gdb/remote-vx.c gdb/remote.c gdb/rs6000-tdep.c gdb/s390-tdep.c gdb/scm-lang.c gdb/ser-pipe.c gdb/ser-tcp.c gdb/ser-unix.c gdb/sh-tdep.c gdb/source.c gdb/sparc-tdep.c gdb/stabsread.c gdb/stack.c gdb/symfile.c gdb/symfile.h gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/gdb.c++/namespace.cc gdb/testsuite/gdb.c++/namespace.exp gdb/testsuite/gdb.c++/namespace1.cc gdb/testsuite/gdb.c++/rtti.exp gdb/testsuite/gdb.c++/rtti.h gdb/testsuite/gdb.c++/rtti1.cc gdb/testsuite/gdb.c++/rtti2.cc gdb/testsuite/gdb.threads/linux-dp.exp gdb/v850-tdep.c gdb/valops.c gdb/value.h gdb/values.c gdb/vax-tdep.c gdb/version.in gdb/x86-64-tdep.c gdb/xcoffread.c gdb/xstormy16-tdep.c include/ChangeLog include/bfdlink.h include/elf/ChangeLog include/elf/common.h include/elf/external.h include/elf/h8.h include/elf/internal.h include/libiberty.h include/opcode/ChangeLog include/opcode/i860.h include/opcode/m68hc11.h libiberty/ChangeLog libiberty/config.table libiberty/functions.texi libiberty/hex.c opcodes/ChangeLog opcodes/Makefile.am opcodes/Makefile.in opcodes/configure opcodes/configure.in opcodes/disassemble.c opcodes/i860-dis.c opcodes/po/ro.po readline/ChangeLog.gdb readline/support/config.guess readline/support/config.sub sim/mips/ChangeLog sim/mips/Makefile.in sim/ppc/ChangeLog sim/ppc/Makefile.in sim/testsuite/ChangeLog sim/testsuite/sim/h8300/ChangeLog sim/testsuite/sim/h8300/addb.s sim/testsuite/sim/h8300/addl.s sim/testsuite/sim/h8300/addw.s sim/testsuite/sim/h8300/allinsn.exp sim/testsuite/sim/h8300/andb.s sim/testsuite/sim/h8300/andl.s sim/testsuite/sim/h8300/andw.s sim/testsuite/sim/h8300/bra.s sim/testsuite/sim/h8300/cmpb.s sim/testsuite/sim/h8300/cmpl.s sim/testsuite/sim/h8300/cmpw.s sim/testsuite/sim/h8300/extl.s sim/testsuite/sim/h8300/extw.s sim/testsuite/sim/h8300/ldc.s sim/testsuite/sim/h8300/ldm.s sim/testsuite/sim/h8300/mova.s sim/testsuite/sim/h8300/movb.s sim/testsuite/sim/h8300/movl.s sim/testsuite/sim/h8300/movw.s sim/testsuite/sim/h8300/neg.s sim/testsuite/sim/h8300/not.s sim/testsuite/sim/h8300/orb.s sim/testsuite/sim/h8300/orl.s sim/testsuite/sim/h8300/orw.s sim/testsuite/sim/h8300/rotr.s sim/testsuite/sim/h8300/rotxr.s sim/testsuite/sim/h8300/shar.s sim/testsuite/sim/h8300/shlr.s sim/testsuite/sim/h8300/stc.s sim/testsuite/sim/h8300/subb.s sim/testsuite/sim/h8300/subl.s sim/testsuite/sim/h8300/subw.s sim/testsuite/sim/h8300/xorb.s sim/testsuite/sim/h8300/xorl.s sim/testsuite/sim/h8300/xorw.s sim/v850/ChangeLog sim/v850/Makefile.in Delete: gdb/mi/mi-cmd-symbol.c sim/testsuite/sim/h8300/add.b.s sim/testsuite/sim/h8300/add.l.s sim/testsuite/sim/h8300/add.w.s sim/testsuite/sim/h8300/and.b.s sim/testsuite/sim/h8300/and.l.s sim/testsuite/sim/h8300/and.w.s sim/testsuite/sim/h8300/cmp.b.s sim/testsuite/sim/h8300/cmp.l.s sim/testsuite/sim/h8300/cmp.w.s sim/testsuite/sim/h8300/ext.l.s sim/testsuite/sim/h8300/ext.w.s sim/testsuite/sim/h8300/mov.b.s sim/testsuite/sim/h8300/mov.l.s sim/testsuite/sim/h8300/mov.w.s sim/testsuite/sim/h8300/or.b.s sim/testsuite/sim/h8300/or.l.s sim/testsuite/sim/h8300/or.w.s sim/testsuite/sim/h8300/sub.b.s sim/testsuite/sim/h8300/sub.l.s sim/testsuite/sim/h8300/sub.w.s sim/testsuite/sim/h8300/xor.b.s sim/testsuite/sim/h8300/xor.l.s sim/testsuite/sim/h8300/xor.w.s
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog414
-rw-r--r--gdb/MAINTAINERS5
-rw-r--r--gdb/Makefile.in30
-rw-r--r--gdb/NEWS4
-rw-r--r--gdb/TODO4
-rw-r--r--gdb/ada-exp.y4
-rw-r--r--gdb/ada-lang.c100
-rw-r--r--gdb/ada-lang.h4
-rw-r--r--gdb/ada-valprint.c3
-rw-r--r--gdb/alpha-tdep.c16
-rw-r--r--gdb/arch-utils.c43
-rw-r--r--gdb/arch-utils.h5
-rw-r--r--gdb/arm-linux-tdep.c4
-rw-r--r--gdb/arm-tdep.c12
-rw-r--r--gdb/avr-tdep.c19
-rw-r--r--gdb/block.c72
-rw-r--r--gdb/block.h8
-rw-r--r--gdb/blockframe.c2
-rw-r--r--gdb/c-exp.y18
-rw-r--r--gdb/c-lang.c10
-rw-r--r--gdb/c-valprint.c2
-rw-r--r--gdb/coffread.c10
-rw-r--r--gdb/config/djgpp/fnchange.lst10
-rw-r--r--gdb/config/i386/tm-linux.h2
-rw-r--r--gdb/config/ia64/tm-ia64.h2
-rw-r--r--gdb/config/m68k/nm-sun3.h2
-rw-r--r--gdb/config/m68k/tm-linux.h69
-rw-r--r--gdb/config/m68k/tm-m68k.h2
-rw-r--r--gdb/config/m68k/tm-sun3.h4
-rw-r--r--gdb/config/mips/tm-irix5.h4
-rw-r--r--gdb/config/mips/tm-irix6.h4
-rw-r--r--gdb/config/mips/tm-mips.h2
-rw-r--r--gdb/config/nm-gnu.h2
-rw-r--r--gdb/config/pa/tm-hppa.h3
-rw-r--r--gdb/config/pa/tm-hppa64.h14
-rw-r--r--gdb/config/s390/tm-s390.h4
-rw-r--r--gdb/config/sparc/nm-nbsd.h2
-rw-r--r--gdb/config/sparc/nm-sun4os4.h2
-rw-r--r--gdb/config/sparc/nm-sun4sol2.h2
-rw-r--r--gdb/config/sparc/tm-sp64.h4
-rw-r--r--gdb/config/sparc/tm-sparc.h10
-rw-r--r--gdb/cp-namespace.c191
-rw-r--r--gdb/cp-support.h18
-rw-r--r--gdb/cp-valprint.c3
-rw-r--r--gdb/cris-tdep.c4
-rw-r--r--gdb/dbxread.c20
-rw-r--r--gdb/defs.h2
-rw-r--r--gdb/disasm.h1
-rw-r--r--gdb/doc/ChangeLog22
-rw-r--r--gdb/doc/Makefile.in8
-rw-r--r--gdb/doc/gdbint.texinfo48
-rw-r--r--gdb/dummy-frame.c6
-rw-r--r--gdb/dummy-frame.h4
-rw-r--r--gdb/dwarf2expr.c26
-rw-r--r--gdb/dwarf2loc.c6
-rw-r--r--gdb/dwarf2read.c30
-rw-r--r--gdb/dwarfread.c28
-rw-r--r--gdb/f-exp.y2
-rw-r--r--gdb/f-lang.c4
-rw-r--r--gdb/findvar.c20
-rw-r--r--gdb/frame.c17
-rw-r--r--gdb/frame.h1
-rw-r--r--gdb/frv-tdep.c4
-rw-r--r--gdb/gdbarch.c35
-rw-r--r--gdb/gdbarch.h17
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/gdbtypes.c18
-rw-r--r--gdb/gdbtypes.h4
-rw-r--r--gdb/gnu-v3-abi.c2
-rw-r--r--gdb/h8300-tdep.c2
-rw-r--r--gdb/hppa-tdep.c22
-rw-r--r--gdb/hpread.c58
-rw-r--r--gdb/hpux-thread.c2
-rw-r--r--gdb/i386-linux-tdep.c2
-rw-r--r--gdb/i386-tdep.c4
-rw-r--r--gdb/i386-tdep.h2
-rw-r--r--gdb/ia64-tdep.c116
-rw-r--r--gdb/irix4-nat.c2
-rw-r--r--gdb/irix5-nat.c2
-rw-r--r--gdb/jv-exp.y2
-rw-r--r--gdb/jv-lang.c8
-rw-r--r--gdb/jv-valprint.c1
-rw-r--r--gdb/language.c14
-rw-r--r--gdb/language.h21
-rw-r--r--gdb/linespec.c20
-rw-r--r--gdb/m2-exp.y10
-rw-r--r--gdb/m2-lang.c3
-rw-r--r--gdb/m3-nat.c2
-rw-r--r--gdb/m68hc11-tdep.c2
-rw-r--r--gdb/m68k-tdep.c6
-rw-r--r--gdb/m68klinux-tdep.c99
-rw-r--r--gdb/mcore-tdep.c2
-rw-r--r--gdb/mdebugread.c78
-rw-r--r--gdb/mem-break.c47
-rw-r--r--gdb/mi/ChangeLog13
-rw-r--r--gdb/mi/mi-cmd-stack.c2
-rw-r--r--gdb/mi/mi-main.c6
-rw-r--r--gdb/mi/mi-symbol-cmds.c (renamed from gdb/mi/mi-cmd-symbol.c)0
-rw-r--r--gdb/minsyms.c10
-rw-r--r--gdb/mips-nat.c27
-rw-r--r--gdb/mips-tdep.c62
-rw-r--r--gdb/mn10300-tdep.c2
-rw-r--r--gdb/monitor.c2
-rw-r--r--gdb/nlmread.c2
-rw-r--r--gdb/ns32k-tdep.c4
-rw-r--r--gdb/nto-tdep.c15
-rw-r--r--gdb/objc-exp.y10
-rw-r--r--gdb/objc-lang.c7
-rw-r--r--gdb/objfiles.c4
-rw-r--r--gdb/p-exp.y16
-rw-r--r--gdb/p-lang.c4
-rw-r--r--gdb/p-valprint.c3
-rw-r--r--gdb/parse.c8
-rw-r--r--gdb/ppc-sysv-tdep.c4
-rw-r--r--gdb/printcmd.c4
-rw-r--r--gdb/proc-api.c10
-rw-r--r--gdb/regcache.c23
-rw-r--r--gdb/regcache.h1
-rw-r--r--gdb/remote-array.c11
-rw-r--r--gdb/remote-mips.c14
-rw-r--r--gdb/remote-sds.c6
-rw-r--r--gdb/remote-vx.c2
-rw-r--r--gdb/remote.c29
-rw-r--r--gdb/rs6000-tdep.c13
-rw-r--r--gdb/s390-tdep.c10
-rw-r--r--gdb/scm-lang.c6
-rw-r--r--gdb/ser-pipe.c2
-rw-r--r--gdb/ser-tcp.c2
-rw-r--r--gdb/ser-unix.c2
-rw-r--r--gdb/sh-tdep.c12
-rw-r--r--gdb/source.c2
-rw-r--r--gdb/sparc-tdep.c26
-rw-r--r--gdb/stabsread.c56
-rw-r--r--gdb/stack.c2
-rw-r--r--gdb/symfile.c8
-rw-r--r--gdb/symfile.h4
-rw-r--r--gdb/symmisc.c26
-rw-r--r--gdb/symtab.c642
-rw-r--r--gdb/symtab.h114
-rw-r--r--gdb/target.h13
-rw-r--r--gdb/testsuite/ChangeLog25
-rw-r--r--gdb/testsuite/gdb.c++/namespace.cc70
-rw-r--r--gdb/testsuite/gdb.c++/namespace.exp43
-rw-r--r--gdb/testsuite/gdb.c++/namespace1.cc31
-rw-r--r--gdb/testsuite/gdb.c++/rtti.exp127
-rw-r--r--gdb/testsuite/gdb.c++/rtti.h48
-rw-r--r--gdb/testsuite/gdb.c++/rtti1.cc67
-rw-r--r--gdb/testsuite/gdb.c++/rtti2.cc36
-rw-r--r--gdb/testsuite/gdb.threads/linux-dp.exp36
-rw-r--r--gdb/v850-tdep.c4
-rw-r--r--gdb/valops.c6
-rw-r--r--gdb/value.h320
-rw-r--r--gdb/values.c4
-rw-r--r--gdb/vax-tdep.c254
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/x86-64-tdep.c4
-rw-r--r--gdb/xcoffread.c22
-rw-r--r--gdb/xstormy16-tdep.c6
158 files changed, 2682 insertions, 1669 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9c58b41c498..9cf50e6ec02 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,417 @@
+2003-05-20 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-nat.c (REGISTER_PTRACE_ADDR): Convert macro to function
+ register_ptrace_addr(). Fix all callers.
+
+2003-05-21 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.in (m68k-tdep.o, m68klinux-tdep.o): Update
+ dependencies.
+ * m68k-tdep.c (m68k_gdbarch_init): Call gdbarch_init_osabi at the
+ end.
+ * m68klinux-tdep.c (m68k_linux_init_abi): New function.
+ (_initialize_m68k_linux_tdep): New function.
+ (m68k_linux_frame_saved_pc): Make static.
+ (m68k_linux_extract_return_value): Likewise.
+ (m68k_linux_store_return_value): Likewise.
+ (m68k_linux_extract_struct_value_address): Likewise.
+ * config/m68k/tm-linux.h (DEPRECATED_EXTRACT_RETURN_VALUE):
+ Remove.
+ (DEPRECATED_STORE_RETURN_VALUE): Remove.
+ (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
+ (DEPRECATED_FRAME_SAVED_PC): Remove.
+
+2003-05-20 Kris Warkentin <kewarken@qnx.com>
+
+ * nto-tdep.c (fetch_core_registers): Match gdb's idea of
+ regset numbering rather than our own.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/rtti*.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ Partial fix for PR c++/827.
+ * cp-support.h: Include symtab.h.
+ Declare cp_lookup_symbol_nonlocal, cp_lookup_symbol_namespace.
+ * cp-namespace.c: Update contributors.
+ (cp_lookup_symbol_nonlocal): New.
+ (lookup_namespace_scope, cp_lookup_symbol_namespace)
+ (lookup_symbol_file): Ditto.
+ * c-lang.c (cplus_language_defn): Use cp_lookup_symbol_nonlocal.
+ * block.h: Declare block_scope, block_using, block_global_block.
+ * block.c (block_scope): New.
+ (block_using, block_global_block): Ditto.
+ * Makefile.in (cp_support_h): Depend on symtab_h.
+ * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/namespace1.cc.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * language.h (struct language_defn): Add 'la_value_of_this'
+ and 'la_lookup_symbol_nonlocal' members.
+ * symtab.h: Declare basic_lookup_symbol_nonlocal,
+ lookup_symbol_static, lookup_symbol_global,
+ lookup_symbol_aux_block.
+ * symtab.c (lookup_symbol_aux): Call language hooks to determine
+ if we should search fields of this and how to do static/global
+ lookup.
+ (lookup_symbol_aux_block): Make extern.
+ (basic_lookup_symbol_nonlocal): New.
+ (lookup_symbol_static, lookup_symbol_global): Ditto.
+ * ada-lang.c (ada_language_defn): Set 'la_value_of_this' and
+ 'la_lookup_symbol_nonlocal' members.
+ * c-lang.c (c_language_defn, cplus_language_defn)
+ (asm_language_defn, minimal_language_defn): Ditto.
+ * jv-lang.c (java_language_defn): Ditto.
+ * language.c (unknown_language_defn, auto_language_defn)
+ (local_language_defn): Ditto.
+ * m2-lang.c (m2_language_defn): Ditto.
+ * objc-lang.c (objc_language_defn): Ditto.
+ * scm-lang.c (scm_language_defn): Ditto.
+ * f-lang.c (f_language_defn): Ditto, and include value.h as well.
+ * p-lang.c (pascal_language_defn): Ditto for both.
+ * Makefile.in (f-lang.o): Depend on value_h.
+ (p-lang.o): Ditto.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * block.h: Declare block_static_block.
+ * block.c (block_static_block): New.
+ * symtab.c (lookup_symbol_aux): Remove 'static_block' argument to
+ lookup_symbol_aux_local, calling block_static_block instead.
+ (lookup_symbol_aux_local): Delete 'static_block' argument.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * symtab.c (lookup_symbol_aux): Delete #if 0 hunk.
+
+2003-05-19 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map): Fix
+ register numbers mapping.
+
+2003-05-18 Adam Fedor <fedor@gnu.org>
+
+ * symtab.c (completion_list_objc_symbol): New function.
+ (make_symbol_completion_list): Use it to add ObjC symbols
+ when looking though the list.
+ (language_search_unquoted_string): New function.
+ (make_file_symbol_completion_list): Use it.
+
+2003-05-18 Andreas Schwab <schwab@suse.de>
+
+ * Makefile (m68klinux-nat.o, m68klinux-tdep.o): Update
+ dependencies.
+ * config/m68k/tm-linux.h (DEPRECATED_EXTRACT_RETURN_VALUE): Define
+ as m68k_linux_extract_return_value.
+ (DEPRECATED_STORE_RETURN_VALUE): Define as
+ m68k_linux_store_return_value.
+ (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Define as
+ m68k_linux_extract_struct_value_address.
+ * m68klinux-tdep.c (m68k_linux_sigtramp_saved_pc): Use
+ get_next_frame, get_frame_base, get_frame_pc.
+ (m68k_linux_frame_saved_pc): Use get_frame_base.
+ (m68k_linux_extract_return_value): New function.
+ (m68k_linux_store_return_value): New function.
+ (m68k_linux_extract_struct_value_address): New function.
+ * config/m68k/tm-m68k.h: Declare m68k_get_longjmp_target.
+
+ * c-exp.y (typebase): Remove duplicate occurence of
+ `SIGNED_KEYWORD LONG LONG'. Use builtin_type_long_long instead
+ of lookup_signed_typename.
+
+2003-05-18 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2loc.c (find_location_expression): Change type of second
+ argument to `size_t *'.
+ (loclist_read_variable, loclist_tracepoint_var_ref): Use size_t
+ for size variable.
+
+2003-05-18 David Carlton <carlton@bactrian.org>
+
+ * symtab.c (lookup_symbol_aux): Rename 'mangled_name' argument to
+ 'linkage_name'. Add comment.
+ (lookup_symbol_aux_local): Rename 'mangled_name' argument to
+ 'linkage_name'.
+ (lookup_symbol_aux_block, lookup_symbol_aux_symtabs)
+ (lookup_symbol_aux_psymtabs, lookup_symbol_aux_minsyms)
+ (lookup_block_symbol): Ditto.
+
+2003-05-16 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_REGISTER_BYTES): Rename REGISTER_BYTES.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * arm-linux-tdep.c (arm_linux_extract_return_value): Delete reference.
+ * TODO (REGISTER_BYTES): Delete reference.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * x86-64-tdep.c (x86_64_init_abi): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update.
+ (ns32k_gdbarch_init_32382): Update.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Update.
+ * mcore-tdep.c (mcore_gdbarch_init): Update.
+ * m68k-tdep.c (m68k_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * i386-tdep.c (i386_gdbarch_init): Update.
+ * i386-linux-tdep.c (i386_linux_init_abi): Update.
+ * hppa-tdep.c (hppa_gdbarch_init): Update.
+ * h8300-tdep.c (h8300_gdbarch_init): Update.
+ * frv-tdep.c (frv_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * avr-tdep.c (avr_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_pop_frame): Update.
+ * rs6000-tdep.c (rs6000_pop_frame): Update.
+ * remote.c (init_remote_state): Update.
+ (remote_prepare_to_store): Update.
+ * remote-vx.c (vx_prepare_to_store): Update.
+ * remote-sds.c (sds_fetch_registers): Update.
+ (sds_prepare_to_store): Update.
+ * remote-array.c: Update.
+ * regcache.c (init_legacy_regcache_descr): Update.
+ (init_regcache_descr): Update.
+ * mips-tdep.c (mips_eabi_extract_return_value): Update.
+ (mips_o64_extract_return_value): Update.
+ * irix5-nat.c (fetch_core_registers): Update.
+ * irix4-nat.c (fetch_core_registers): Update.
+ * i386-tdep.h: Update.
+ * hppa-tdep.c (pa_do_registers_info): Update.
+ (pa_do_strcat_registers_info): Update.
+ * cris-tdep.c (cris_register_bytes_ok): Update.
+ * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update.
+ * config/sparc/tm-sparc.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/sparc/nm-sun4sol2.h (CHILD_PREPARE_TO_STORE): Update.
+ * config/sparc/nm-sun4os4.h (CHILD_PREPARE_TO_STORE): Update.
+ * config/sparc/nm-nbsd.h (CHILD_PREPARE_TO_STORE): Update.
+ * config/sparc/tm-sp64.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/s390/tm-s390.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/pa/tm-hppa64.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/mips/tm-mips.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/mips/tm-irix6.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/mips/tm-irix5.h (DEPRECATED_REGISTER_BYTES): Update.
+ * config/m68k/tm-sun3.h (DEPRECATED_REGISTER_BYTES): Update.
+ (REGISTER_BYTES_OK): Update.
+ * config/m68k/nm-sun3.h (CHILD_PREPARE_TO_STORE): Update.
+ * config/ia64/tm-ia64.h (DEPRECATED_REGISTER_BYTES): Update.
+
+2003-05-16 Ian Lance Taylor <ian@airs.com>
+
+ * vax-tdep.c (INVALID_FLOAT, MAXLEN, NOPCODES): Don't define.
+ (vax_print_insn, print_insn_arg): Remove static functions.
+ (vax_gdbarch_init): Call set_gdbarch_print_insn with
+ print_insn_vax from opcodes library.
+ (_initialize_vax_tdep): Don't set deprecated_tm_print_insn.
+
+2003-05-15 Andrew Cagney <cagney@redhat.com>
+
+ * arch-utils.h (legacy_breakpoint_from_pc): Delete declaration.
+ * target.h (memory_breakpoint_from_pc): Delete declaration.
+ * mem-break.c (memory_breakpoint_from_pc): Delete function.
+ * arch-utils.c (legacy_breakpoint_from_pc): Delete function.
+ * monitor.c (monitor_insert_breakpoint): Use
+ gdbarch_breakpoint_from_pc instead of memory_breakpoint_from_pc.
+ * gdbarch.sh (BREAKPOINT_FROM_PC): Do not provide a default.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * sparc-tdep.c (sparc_breakpoint_from_pc): New function.
+ (sparc_gdbarch_init): Set breakpoint_from_pc to
+ sparc_breakpoint_from_pc.
+ * config/sparc/tm-sparc.h (BREAKPOINT): Delete macro.
+ (BREAKPOINT_FROM_PC): Define.
+ (sparc_breakpoint_from_pc): Declare.
+ * hppa-tdep.c (hppa_breakpoint_from_pc): New function.
+ * config/pa/tm-hppa.h (hppa_breakpoint_from_pc): Declare.
+ (BREAKPOINT_FROM_PC): Define.
+ (BREAKPOINT): Delete macro.
+ * target.h: Update comment.
+ * s390-tdep.c (s390_gdbarch_init): Update comments.
+ * remote.c: Update comments.
+ * remote-mips.c: Update comments.
+ * proc-api.c (write_with_trace): Do not check for a breakpoint.
+ * mem-break.c: Update comment.
+ * ia64-tdep.c (IA64_BREAKPOINT): Rename BREAKPOINT.
+ (ia64_memory_insert_breakpoint): Update.
+ * config/sparc/tm-sparc.h: Update comment.
+ * config/pa/tm-hppa64.h: Update comment.
+ * rs6000-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro.
+ (rs6000_breakpoint_from_pc): Update.
+ * mips-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro.
+ (PMON_BIG_BREAKPOINT, PMON_LITTLE_BREAKPOINT): Delete macro.
+ (IDT_LITTLE_BREAKPOINT, IDT_LITTLE_BREAKPOINT): Delete macro.
+ (MIPS16_LITTLE_BREAKPOINT, MIPS16_BIG_BREAKPOINT): Delete macro.
+ (mips_breakpoint_from_pc): Update.
+ (mips_dump_tdep): Update.
+
+ * symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Delete macro.
+ * minsyms.c (lookup_minimal_symbol): Inline
+ DEPRECATED_SYMBOL_MATCHES_NAME. Replace STREQ with strcmp.
+
+ * c-lang.c (c_printstr): Delete "extern inspect_it" declaration.
+ * p-valprint.c (pascal_object_print_value_fields): Ditto.
+ * p-lang.c (pascal_printstr): Ditto.
+ * objc-lang.c (objc_printstr): Ditto.
+ * m2-lang.c (m2_printstr): Ditto.
+ * jv-valprint.c (java_print_value_fields): Ditto.
+ * f-lang.c (f_printstr): Ditto.
+ * cp-valprint.c (cp_print_value_fields): Ditto. Include "valprint.h".
+ * ada-valprint.c (inspect_it, repeat_count_threshold): Ditto, and
+ for repeat_count_threshold.
+ * Makefile.in (cp-valprint.o): Update dependencies.
+
+2003-05-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c: Increase max_skip_non_prologue_insns to 40.
+ (examine_prologue): Support looking through leaf functions, knowing
+ they start with mov r2,r12. Support skipping over indirect stores
+ of the input registers. Upon hitting a non-nop branch instruction
+ or predicated instruction, bail out by setting lim_pc to the current
+ pc value in the loop. At the end, if the lim_pc value is still
+ beyond our calculated value and we have trust_limit set,
+ use the lim_pc value.
+
+2003-05-15 Andrew Cagney <cagney@redhat.com>
+
+ * dummy-frame.h (deprecated_find_dummy_frame_regcache): Rename
+ generic_find_dummy_frame.
+ * dummy-frame.c (deprecated_find_dummy_frame_regcache): Update.
+ (deprecated_generic_find_dummy_frame): Update.
+ (deprecated_read_register_dummy): Update.
+ * frame.c (deprecated_generic_get_saved_register): Update.
+
+2003-05-15 Theodore A. Roth <troth@openavr.org>
+
+ * avr-tdep.c (avr_breakpoint_from_pc): New function.
+ (avr_gdbarch_init): Set breakpoint_from_pc method.
+
+2003-05-15 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (build_regcache): Set deprecated_register_valid
+ directly.
+ (deprecated_grub_regcache_for_register_valid): Delete function.
+ * regcache.h (deprecated_grub_regcache_for_register_valid): Delete
+ declaration.
+
+2003-05-15 David Carlton <carlton@bactrian.org>
+
+ Committed by Elena Zannoni <ezannoni@redhat.com>
+ * symtab.c (lookup_symbol_aux): Delete calls to
+ lookup_symbol_aux_minsyms.
+ (lookup_symbol_aux_minsyms): Comment out function and
+ prototype. Delete lookup by mangled name.
+
+2003-05-14 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2expr.c (new_dwarf_expr_context): Set ``stack_len'' to
+ correctly indicate an empty stack and ``stack_allocated'' to the
+ indicate the number of elements initially allocated.
+ (dwarf_expr_grow_stack): Simplify method for computing new
+ stack size. Don't loop infinitely if ``stack_len'' is zero.
+ (execute_stack_op): Move ``ctx->in_reg'' initialization
+ out of loop. Allow DW_OP_reg0 ... DW_OP_reg31 and DW_OP_regx to
+ be used in conjuction with DW_OP_piece. Revise error message
+ accordingly.
+
+2003-05-14 Theodore A. Roth <troth@openavr.org>
+
+ * MAINTAINERS: Update my email address.
+ * avr-tdep.c: Ditto.
+
+2003-05-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.h (enum domain_enum): Rename from namespace_enum.
+ (UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
+ VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
+ Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
+ LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
+ TYPES_NAMESPACE, METHODS_NAMESPACE.
+ (SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
+ (struct symbol, struct partial_symbol): Rename field
+ 'namespace_enum namespace' to 'domain_enum domain'.
+ (PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
+ Delete old define kludge for namespace.
+
+ * ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
+ blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
+ dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
+ gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
+ language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
+ mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
+ p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
+ stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
+ valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
+ occurrences of the above.
+
+2003-05-14 Ian Lance Taylor <ian@airs.com>
+
+ * Makefile.in (install-only): Use $(SHELL) when running
+ mkinstalldirs.
+
+2003-05-13 Ian Lance Taylor <ian@airs.com>
+
+ * MAINTAINERS (write after approval): Add myself.
+
+ * ser-pipe.c (_initialize_ser_pipe): Correct call to memset--swap
+ second and third arguments.
+ * ser-tcp.c (_initialize_ser_tcp): Likewise.
+ * ser-unix.c (_initialize_ser_hardwire): Likewise.
+
+2003-05-13 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (store_address): Delete declaration.
+ findvar.c (store_address): Delete function.
+ * arm-tdep.c (arm_push_dummy_call): Replace store_address with
+ store_unsigned_integer.
+ * xstormy16-tdep.c (xstormy16_address_to_pointer): Ditto.
+ * v850-tdep.c (v850_push_arguments): Ditto.
+ * sparc-tdep.c (sparc_get_saved_register): Ditto.
+ * sh-tdep.c (sh64_get_saved_register): Ditto.
+ * rs6000-tdep.c (rs6000_push_arguments): Ditto.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): Ditto.
+ * mips-tdep.c (mips_eabi_push_arguments): Ditto.
+ (mips_get_saved_register): Ditto.
+ * ia64-tdep.c (ia64_get_saved_register): Ditto.
+ (find_func_descr, ia64_push_arguments): Ditto.
+ * i386-tdep.c (i386_push_arguments): Ditto.
+ * hpux-thread.c (hpux_thread_fetch_registers): Ditto.
+ * frv-tdep.c (frv_push_arguments): Ditto.
+ * frame.c (legacy_saved_regs_prev_register): Ditto.
+ (deprecated_generic_get_saved_register): Ditto.
+ * findvar.c (unsigned_address_to_pointer): Ditto.
+ * dwarf2read.c (dwarf2_const_value): Ditto.
+ * arm-linux-tdep.c (arm_linux_push_arguments): Ditto.
+ * alpha-tdep.c (alpha_push_arguments): Ditto.
+
+2003-05-12 J. Brobecker <brobecker@gnat.com>
+
+ * NEWS: Mention that the hppa-hpux port has been partially
+ multiarched (32bit ABIT only, so far).
+
+2003-05-11 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (mi-symbol-cmds.o): Rename mi-cmd-symbol.
+ * config/djgpp/fnchange.lst: Rename include/xtensa-isa-internal.h,
+ include/xtensa-isa.h, sim/testsuite/sim/arm/misaligned1.ms,
+ sim/testsuite/sim/arm/misaligned2.ms, and
+ sim/testsuite/sim/arm/misaligned3.ms.
+ * disasm.h (struct ui_file): Add opaque struct declaration.
+ * config/pa/tm-hppa64.h (struct type, struct frame_info): Ditto.
+ * frame.h (struct ui_file): Ditto.
+
+2003-05-11 Mark Kettenis <kettenis@gnu.org>
+
+ * value.h: Pretty print.
+
+2003-05-10 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-linux.h (I386_GNULINUX_TARGET): Remove define.
+
2003-05-08 Andrew Cagney <cagney@redhat.com>
* regcache.h (max_register_size): Delete declaration.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 15a0ea826c1..08af70eac6f 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -67,7 +67,7 @@ maintainer works with the native maintainer when resolving API issues.
Richard Earnshaw rearnsha@arm.com
avr --target=avr ,-Werror
- Theodore A. Roth troth@verinet.com
+ Theodore A. Roth troth@openavr.org
cris --target=cris-elf ,-Werror
Orjan Friberg orjanf@axis.com
@@ -368,7 +368,7 @@ David O'Brien obrien@freebsd.org
Alexandre Oliva aoliva@redhat.com
Tom Rix trix@redhat.com
Bob Rossi bob_rossi@cox.net
-Theodore A. Roth troth@verinet.com
+Theodore A. Roth troth@openavr.org
Ian Roxborough irox@redhat.com
Grace Sainsbury graces@redhat.com
Mark Salter msalter@redhat.com
@@ -383,6 +383,7 @@ Stephen P. Smith ischis2@cox.net
Jackie Smith Cashion jsmith@redhat.com
Michael Snyder msnyder@redhat.com
Petr Sorfa petrs@caldera.com
+Ian Lance Taylor ian@airs.com
Gary Thomas gthomas@redhat.com
Jason Thorpe thorpej@wasabisystems.com
Tom Tromey tromey@redhat.com
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 43d544dab14..38be4f6aadb 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -168,14 +168,14 @@ SUBDIR_CLI_UNINSTALL=
SUBDIR_MI_OBS = \
mi-out.o mi-console.o \
mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
- mi-cmd-file.o mi-cmd-disas.o mi-cmd-symbol.o \
+ mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o \
mi-interp.o \
mi-main.o mi-parse.o mi-getopt.o
SUBDIR_MI_SRCS = \
mi/mi-out.c mi/mi-console.c \
mi/mi-cmds.c mi/mi-cmd-env.c \
mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
- mi/mi-cmd-file.c mi/mi-cmd-disas.c mi/mi-cmd-symbol.c \
+ mi/mi-cmd-file.c mi/mi-cmd-disas.c mi/mi-symbol-cmds.c \
mi/mi-interp.c \
mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
SUBDIR_MI_DEPS =
@@ -626,7 +626,7 @@ complaints_h = complaints.h
completer_h = completer.h
config_h = config.h
cp_abi_h = cp-abi.h
-cp_support_h = cp-support.h
+cp_support_h = cp-support.h $(symtab_h)
dcache_h = dcache.h
defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \
$(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \
@@ -935,10 +935,10 @@ install-only: $(CONFIG_INSTALL)
else \
true ; \
fi ; \
- $(srcdir)/../mkinstalldirs $(bindir) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(bindir) ; \
$(INSTALL_PROGRAM) gdb$(EXEEXT) \
$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
- $(srcdir)/../mkinstalldirs \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
$(DESTDIR)$(man1dir) ; \
$(INSTALL_DATA) $(srcdir)/gdb.1 \
$(DESTDIR)$(man1dir)/$$transformed_name.1
@@ -1628,7 +1628,7 @@ cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \
cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \
$(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \
- $(cp_abi_h)
+ $(cp_abi_h) $(valprint_h)
cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \
$(monitor_h) $(serial_h) $(regcache_h) $(m68k_tdep_h)
cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \
@@ -1703,7 +1703,7 @@ expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(block_h)
f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \
- $(valprint_h)
+ $(valprint_h) $(value_h)
f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(f_lang_h) $(gdb_string_h)
@@ -1918,12 +1918,12 @@ m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) \
m68k-stub.o: m68k-stub.c
m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \
$(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \
- $(arch_utils_h) $(gregset_h) $(m68k_tdep_h)
+ $(arch_utils_h) $(gregset_h) $(osabi_h) $(m68k_tdep_h)
m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \
- $(language_h) $(gdbcore_h) $(regcache_h) $(gdb_stat_h) \
- $(floatformat_h) $(target_h) $(gregset_h) $(m68k_tdep_h)
+ $(language_h) $(gdbcore_h) $(gdb_string_h) $(regcache_h) \
+ $(m68k_tdep_h) $(gdb_stat_h) $(floatformat_h) $(target_h)
m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
- $(target_h)
+ $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_h) $(m68k_tdep_t)
m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(regcache_h)
m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h)
@@ -2022,7 +2022,7 @@ osabi.o: osabi.c $(defs_h) $(gdb_string_h) $(osabi_h) $(elf_bfd_h) \
$(gdbcmd_h) $(command_h) $(arch_utils_h)
p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \
- $(valprint_h)
+ $(valprint_h) $(value_h)
p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h)
@@ -2576,9 +2576,6 @@ mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(inferior_h) $(value_h) \
mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \
$(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(block_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
-mi-cmd-symbol.o: $(srcdir)/mi/mi-cmd-symbol.c $(defs_h) \
- $(mi_cmds_h) $(ui_out_h) $(symtab_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-symbol.c
mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \
$(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c
@@ -2606,6 +2603,9 @@ mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h)
mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \
$(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c
+mi-symbol-cmds.o: $(srcdir)/mi/mi-symbol-cmds.c $(defs_h) \
+ $(mi_cmds_h) $(ui_out_h) $(symtab_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-symbol-cmds.c
#
# rdi-share sub-directory
diff --git a/gdb/NEWS b/gdb/NEWS
index 8f711957965..98aab4fe1e8 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -30,6 +30,10 @@ Fix for gdb/672: update changelist is now output in mi list format.
Fix for gdb/702: a -var-assign that updates the value now shows up
in a subsequent -var-update.
+* Multi-arched targets.
+
+HP/PA HPUX11, 32bit ABI (partial) hppa*-*-hpux* except hppa*64*-*-hpux11*
+
* OBSOLETE configurations and files
Configurations that have been declared obsolete in this release have
diff --git a/gdb/TODO b/gdb/TODO
index 2a9c665e223..1ef9c22b0f2 100644
--- a/gdb/TODO
+++ b/gdb/TODO
@@ -171,10 +171,6 @@ Deprecate, if not delete, the following:
how it relates to rawreg and the
regnum is clear.
- REGISTER_BYTES
- The size of the cache can be computed
- on the fly.
-
--
Obsolete the targets:
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 70e6e089dd5..8d9bc045b8c 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -840,7 +840,7 @@ write_object_renaming (orig_left_context, renaming)
parser-defs.h, implemented in parse.c */
strncpy (name, expr, suffix-expr);
name[suffix-expr] = '\000';
- sym = lookup_symbol (name, orig_left_context, VAR_NAMESPACE, 0, NULL);
+ sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
/* if (sym == NULL)
error ("Could not find renamed variable: %s", ada_demangle (name));
*/
@@ -893,7 +893,7 @@ write_object_renaming (orig_left_context, renaming)
suffix = end;
index_sym =
- lookup_symbol (index_name, NULL, VAR_NAMESPACE, 0, NULL);
+ lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
if (index_sym == NULL)
error ("Could not find %s", index_name);
write_var_from_sym (NULL, block_found, sym);
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index b047442d6f3..12bda8049cf 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -90,7 +90,7 @@ static struct value *make_array_descriptor (struct type *, struct value *,
CORE_ADDR *);
static void ada_add_block_symbols (struct block *, const char *,
- namespace_enum, struct objfile *, int);
+ domain_enum, struct objfile *, int);
static void fill_in_ada_prototype (struct symbol *);
@@ -100,7 +100,7 @@ static void add_defn_to_vec (struct symbol *, struct block *);
static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab
*, const char *, int,
- namespace_enum, int);
+ domain_enum, int);
static struct symtab *symtab_for_sym (struct symbol *);
@@ -189,7 +189,7 @@ static struct value *value_pos_atr (struct value *);
static struct value *value_val_atr (struct type *, struct value *);
-static struct symbol *standard_lookup (const char *, namespace_enum);
+static struct symbol *standard_lookup (const char *, domain_enum);
extern void markTimeStart (int index);
extern void markTimeStop (int index);
@@ -705,7 +705,7 @@ ada_match_name (const char *sym_name, const char *name, int wild)
int
ada_suppress_symbol_printing (struct symbol *sym)
{
- if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE)
+ if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN)
return 1;
else
return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym));
@@ -1232,7 +1232,7 @@ decode_packed_array_type (struct type *type)
/* NOTE: Use ada_lookup_symbol_list because of bug in some versions
* of gcc (Solaris, e.g.). FIXME when compiler is fixed. */
n = ada_lookup_symbol_list (name, get_selected_block (NULL),
- VAR_NAMESPACE, &syms, &blocks);
+ VAR_DOMAIN, &syms, &blocks);
for (i = 0; i < n; i += 1)
if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF
&& STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i]))))
@@ -2151,7 +2151,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name,
exp->elts[pc + 1].block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&candidate_syms,
&candidate_blocks);
@@ -2253,7 +2253,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name,
exp->elts[pc + 4].block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&candidate_syms,
&candidate_blocks);
if (n_candidates == 1)
@@ -2307,7 +2307,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
n_candidates =
ada_lookup_symbol_list (ada_mangle (ada_op_name (op)),
- (struct block *) NULL, VAR_NAMESPACE,
+ (struct block *) NULL, VAR_DOMAIN,
&candidate_syms, &candidate_blocks);
i =
ada_resolve_function (candidate_syms, candidate_blocks,
@@ -3175,14 +3175,14 @@ static struct symbol **defn_symbols = NULL;
static struct block **defn_blocks = NULL;
/* Return the result of a standard (literal, C-like) lookup of NAME in
- * given NAMESPACE. */
+ * given DOMAIN. */
static struct symbol *
-standard_lookup (const char *name, namespace_enum namespace)
+standard_lookup (const char *name, domain_enum domain)
{
struct symbol *sym;
struct symtab *symtab;
- sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, &symtab);
+ sym = lookup_symbol (name, (struct block *) NULL, domain, 0, &symtab);
return sym;
}
@@ -3231,7 +3231,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
{
if (sym0 == sym1)
return 1;
- if (SYMBOL_NAMESPACE (sym0) != SYMBOL_NAMESPACE (sym1)
+ if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1)
|| SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1))
return 0;
@@ -3293,13 +3293,13 @@ add_defn_to_vec (struct symbol *sym, struct block *block)
ndefns += 1;
}
-/* Look, in partial_symtab PST, for symbol NAME in given namespace.
+/* Look, in partial_symtab PST, for symbol NAME in given domain.
Check the global symbols if GLOBAL, the static symbols if not. Do
wild-card match if WILD. */
static struct partial_symbol *
ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
- int global, namespace_enum namespace, int wild)
+ int global, domain_enum domain, int wild)
{
struct partial_symbol **start;
int name_len = strlen (name);
@@ -3321,7 +3321,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace &&
+ if (SYMBOL_DOMAIN (psym) == domain &&
wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym)))
return psym;
}
@@ -3355,7 +3355,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace)
+ if (SYMBOL_DOMAIN (psym) == domain)
{
int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len);
@@ -3397,7 +3397,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace)
+ if (SYMBOL_DOMAIN (psym) == domain)
{
int cmp;
@@ -3507,7 +3507,7 @@ ada_lookup_minimal_symbol (const char *name)
}
/* For all subprograms that statically enclose the subprogram of the
- * selected frame, add symbols matching identifier NAME in NAMESPACE
+ * selected frame, add symbols matching identifier NAME in DOMAIN
* and their blocks to vectors *defn_symbols and *defn_blocks, as for
* ada_add_block_symbols (q.v.). If WILD, treat as NAME with a
* wildcard prefix. At the moment, this function uses a heuristic to
@@ -3516,7 +3516,7 @@ ada_lookup_minimal_symbol (const char *name)
* frame as a static link, and then searches up the call stack for a
* frame with that same local-variable base. */
static void
-add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace,
+add_symbols_from_enclosing_procs (const char *name, domain_enum domain,
int wild_match)
{
#ifdef i386
@@ -3535,7 +3535,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace,
DEPRECATED_SYMBOL_NAME (static_link) = "";
SYMBOL_LANGUAGE (static_link) = language_unknown;
SYMBOL_CLASS (static_link) = LOC_LOCAL;
- SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (static_link) = VAR_DOMAIN;
SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void);
SYMBOL_VALUE (static_link) =
-(long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
@@ -3566,7 +3566,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace,
block = get_frame_block (frame, 0);
while (block != NULL && block_function (block) != NULL && ndefns == 0)
{
- ada_add_block_symbols (block, name, namespace, NULL, wild_match);
+ ada_add_block_symbols (block, name, domain, NULL, wild_match);
block = BLOCK_SUPERBLOCK (block);
}
@@ -3632,7 +3632,7 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms)
return nsyms;
}
-/* Find symbols in NAMESPACE matching NAME, in BLOCK0 and enclosing
+/* Find symbols in DOMAIN matching NAME, in BLOCK0 and enclosing
scope and in global scopes, returning the number of matches. Sets
*SYMS to point to a vector of matching symbols, with *BLOCKS
pointing to the vector of corresponding blocks in which those
@@ -3645,7 +3645,7 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms)
int
ada_lookup_symbol_list (const char *name, struct block *block0,
- namespace_enum namespace, struct symbol ***syms,
+ domain_enum domain, struct symbol ***syms,
struct block ***blocks)
{
struct symbol *sym;
@@ -3671,7 +3671,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
block = block0;
while (block != NULL)
{
- ada_add_block_symbols (block, name, namespace, NULL, wild_match);
+ ada_add_block_symbols (block, name, domain, NULL, wild_match);
/* If we found a non-function match, assume that's the one. */
if (is_nonfunction (defn_symbols, ndefns))
@@ -3697,10 +3697,10 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
- if (namespace == VAR_NAMESPACE)
+ if (domain == VAR_DOMAIN)
{
ALL_MSYMBOLS (objfile, msymbol)
{
@@ -3720,13 +3720,13 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
ada_add_block_symbols (block,
DEPRECATED_SYMBOL_NAME (msymbol),
- namespace, objfile, wild_match);
+ domain, objfile, wild_match);
if (ndefns == old_ndefns)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
ada_add_block_symbols (block,
DEPRECATED_SYMBOL_NAME (msymbol),
- namespace, objfile,
+ domain, objfile,
wild_match);
}
}
@@ -3739,14 +3739,14 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
{
QUIT;
if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match))
+ && ada_lookup_partial_symbol (ps, name, 1, domain, wild_match))
{
s = PSYMTAB_TO_SYMTAB (ps);
if (!s->primary)
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
}
@@ -3764,21 +3764,21 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
ALL_PSYMTABS (objfile, ps)
{
QUIT;
if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match))
+ && ada_lookup_partial_symbol (ps, name, 0, domain, wild_match))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
if (!s->primary)
continue;
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace,
+ ada_add_block_symbols (block, name, domain,
objfile, wild_match);
}
}
@@ -3789,7 +3789,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0,
rare. */
if (ndefns == 0)
{
- add_symbols_from_enclosing_procs (name, namespace, wild_match);
+ add_symbols_from_enclosing_procs (name, domain, wild_match);
if (ndefns > 0)
goto done;
}
@@ -3806,7 +3806,7 @@ done:
return ndefns;
}
-/* Return a symbol in NAMESPACE matching NAME, in BLOCK0 and enclosing
+/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
* scope and in global scopes, or NULL if none. NAME is folded to
* lower case first, unless it is surrounded in single quotes.
* Otherwise, the result is as for ada_lookup_symbol_list, but is
@@ -3814,14 +3814,14 @@ done:
struct symbol *
ada_lookup_symbol (const char *name, struct block *block0,
- namespace_enum namespace)
+ domain_enum domain)
{
struct symbol **candidate_syms;
struct block **candidate_blocks;
int n_candidates;
n_candidates = ada_lookup_symbol_list (name,
- block0, namespace,
+ block0, domain,
&candidate_syms, &candidate_blocks);
if (n_candidates == 0)
@@ -3937,7 +3937,7 @@ wild_match (const char *patn, int patn_len, const char *name)
}
-/* Add symbols from BLOCK matching identifier NAME in NAMESPACE to
+/* Add symbols from BLOCK matching identifier NAME in DOMAIN to
vector *defn_symbols, updating *defn_symbols (if necessary), *SZ (the size of
the vector *defn_symbols), and *ndefns (the number of symbols
currently stored in *defn_symbols). If WILD, treat as NAME with a
@@ -3945,7 +3945,7 @@ wild_match (const char *patn, int patn_len, const char *name)
static void
ada_add_block_symbols (struct block *block, const char *name,
- namespace_enum namespace, struct objfile *objfile,
+ domain_enum domain, struct objfile *objfile,
int wild)
{
int i;
@@ -3964,7 +3964,7 @@ ada_add_block_symbols (struct block *block, const char *name,
struct symbol *sym;
ALL_BLOCK_SYMBOLS (block, i, sym)
{
- if (SYMBOL_NAMESPACE (sym) == namespace &&
+ if (SYMBOL_DOMAIN (sym) == domain &&
wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym)))
{
switch (SYMBOL_CLASS (sym))
@@ -4016,7 +4016,7 @@ ada_add_block_symbols (struct block *block, const char *name,
for (; i < BLOCK_BUCKETS (block); i += 1)
for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next)
{
- if (SYMBOL_NAMESPACE (sym) == namespace)
+ if (SYMBOL_DOMAIN (sym) == domain)
{
int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len);
@@ -4093,7 +4093,7 @@ ada_add_block_symbols (struct block *block, const char *name,
{
struct symbol *sym = BLOCK_SYM (block, i);
- if (SYMBOL_NAMESPACE (sym) == namespace)
+ if (SYMBOL_DOMAIN (sym) == domain)
{
int cmp;
@@ -4388,10 +4388,10 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
n_matches = 0;
if (lower_name != NULL)
n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block,
- VAR_NAMESPACE, &symbols, &blocks);
+ VAR_DOMAIN, &symbols, &blocks);
if (n_matches == 0)
n_matches = ada_lookup_symbol_list (unquoted_name, block,
- VAR_NAMESPACE, &symbols, &blocks);
+ VAR_DOMAIN, &symbols, &blocks);
if (n_matches == 0 && line_num >= 0)
error ("No line number information found for %s.", unquoted_name);
else if (n_matches == 0)
@@ -4637,7 +4637,7 @@ nearest_line_number_in_linetable (struct linetable *linetable, int line_num)
else
{
struct symbol *sym =
- standard_lookup (func_name, VAR_NAMESPACE);
+ standard_lookup (func_name, VAR_DOMAIN);
if (is_plausible_func_for_line (sym, line_num))
best = item->line;
else
@@ -4711,7 +4711,7 @@ find_next_line_in_linetable (struct linetable *linetable, int line_num,
if (item->line == line_num)
{
struct symbol *sym =
- standard_lookup (func_name, VAR_NAMESPACE);
+ standard_lookup (func_name, VAR_DOMAIN);
if (is_plausible_func_for_line (sym, starting_line))
return i;
else
@@ -5855,11 +5855,11 @@ ada_find_any_type (const char *name)
{
struct symbol *sym;
- sym = standard_lookup (name, VAR_NAMESPACE);
+ sym = standard_lookup (name, VAR_DOMAIN);
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
return SYMBOL_TYPE (sym);
- sym = standard_lookup (name, STRUCT_NAMESPACE);
+ sym = standard_lookup (name, STRUCT_DOMAIN);
if (sym != NULL)
return SYMBOL_TYPE (sym);
@@ -7821,7 +7821,7 @@ get_var_value (char *name, char *err_msg)
int nsyms;
nsyms =
- ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE,
+ ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_DOMAIN,
&syms, &blocks);
if (nsyms != 1)
@@ -8082,6 +8082,8 @@ const struct language_defn ada_language_defn = {
ada_val_print, /* Print a value using appropriate syntax */
ada_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
#if 0
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 3f00b9ac313..ae863bd0557 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -223,13 +223,13 @@ extern struct type *ada_index_type (struct type *, int);
extern struct value *ada_array_bound (struct value *, int, int);
extern int ada_lookup_symbol_list (const char *, struct block *,
- namespace_enum, struct symbol ***,
+ domain_enum, struct symbol ***,
struct block ***);
extern char *ada_fold_name (const char *);
extern struct symbol *ada_lookup_symbol (const char *, struct block *,
- namespace_enum);
+ domain_enum);
extern struct minimal_symbol *ada_lookup_minimal_symbol (const char *);
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 5b90c0683cd..11c42bf9e67 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -46,9 +46,6 @@ struct ada_val_print_args
enum val_prettyprint pretty;
};
-extern int inspect_it;
-extern unsigned int repeat_count_threshold;
-
static void print_record (struct type *, char *, struct ui_file *, int,
int, enum val_prettyprint);
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index c1648b48b48..ad7ca747507 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -849,7 +849,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
symbol reading. */
sym = NULL;
else
- sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE,
+ sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN,
0, NULL);
}
@@ -1146,7 +1146,9 @@ alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len);
if (struct_return)
{
- store_address (raw_buffer, sizeof (CORE_ADDR), struct_addr);
+ /* NOTE: cagney/2003-05-09: Using sizeof CORE_ADDR here is just
+ wrong. */
+ store_unsigned_integer (raw_buffer, sizeof (CORE_ADDR), struct_addr);
write_memory (sp, raw_buffer, sizeof (CORE_ADDR));
}
@@ -1226,7 +1228,7 @@ alpha_push_dummy_frame (void)
registers follow in ascending order.
The PC is saved immediately below the SP. */
save_address = sp + PROC_REG_OFFSET (proc_desc);
- store_address (raw_buffer, 8, read_register (ALPHA_RA_REGNUM));
+ store_unsigned_integer (raw_buffer, 8, read_register (ALPHA_RA_REGNUM));
write_memory (save_address, raw_buffer, 8);
save_address += 8;
mask = PROC_REG_MASK (proc_desc) & 0xffffffffL;
@@ -1235,12 +1237,12 @@ alpha_push_dummy_frame (void)
{
if (ireg == ALPHA_RA_REGNUM)
continue;
- store_address (raw_buffer, 8, read_register (ireg));
+ store_unsigned_integer (raw_buffer, 8, read_register (ireg));
write_memory (save_address, raw_buffer, 8);
save_address += 8;
}
- store_address (raw_buffer, 8, read_register (PC_REGNUM));
+ store_unsigned_integer (raw_buffer, 8, read_register (PC_REGNUM));
write_memory (sp - 8, raw_buffer, 8);
/* Save floating point registers. */
@@ -1249,7 +1251,7 @@ alpha_push_dummy_frame (void)
for (ireg = 0; mask; ireg++, mask >>= 1)
if (mask & 1)
{
- store_address (raw_buffer, 8, read_register (ireg + FP0_REGNUM));
+ store_unsigned_integer (raw_buffer, 8, read_register (ireg + FP0_REGNUM));
write_memory (save_address, raw_buffer, 8);
save_address += 8;
}
@@ -1810,7 +1812,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, alpha_register_name);
set_gdbarch_deprecated_register_size (gdbarch, ALPHA_REGISTER_SIZE);
- set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
+ set_gdbarch_deprecated_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, alpha_register_byte);
set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE);
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 2f555ff6fa8..48f7f7ebe05 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -48,49 +48,6 @@
#include "floatformat.h"
-/* Use the program counter to determine the contents and size
- of a breakpoint instruction. If no target-dependent macro
- BREAKPOINT_FROM_PC has been defined to implement this function,
- assume that the breakpoint doesn't depend on the PC, and
- use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros.
- Return a pointer to a string of bytes that encode a breakpoint
- instruction, stores the length of the string to *lenptr,
- and optionally adjust the pc to point to the correct memory location
- for inserting the breakpoint. */
-
-const unsigned char *
-legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
-{
- /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
- breakpoint. On some machines, breakpoints are handled by the
- target environment and we don't have to worry about them here. */
-#ifdef BIG_BREAKPOINT
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- {
- static unsigned char big_break_insn[] = BIG_BREAKPOINT;
- *lenptr = sizeof (big_break_insn);
- return big_break_insn;
- }
-#endif
-#ifdef LITTLE_BREAKPOINT
- if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
- {
- static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
- *lenptr = sizeof (little_break_insn);
- return little_break_insn;
- }
-#endif
-#ifdef BREAKPOINT
- {
- static unsigned char break_insn[] = BREAKPOINT;
- *lenptr = sizeof (break_insn);
- return break_insn;
- }
-#endif
- *lenptr = 0;
- return NULL;
-}
-
/* Implementation of extract return value that grubs around in the
register cache. */
void
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index cf515a4f76d..27f219b0be9 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -40,11 +40,6 @@ extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy);
being passed */
extern gdbarch_frame_num_args_ftype frame_num_args_unknown;
-/* Implementation of breakpoint from PC using any of the deprecated
- macros BREAKPOINT, LITTLE_BREAKPOINT, BIG_BREAPOINT. For legacy
- targets that don't yet implement their own breakpoint_from_pc(). */
-extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc;
-
/* Implementation of extract return value that grubs around in the
register cache. */
extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 60c8ae492a9..a2ea4935303 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -73,7 +73,7 @@ LONGEST arm_linux_call_dummy_words[] =
hidden behind the regcache abstraction. */
static void
arm_linux_extract_return_value (struct type *type,
- char regbuf[REGISTER_BYTES],
+ char regbuf[],
char *valbuf)
{
/* ScottB: This needs to be looked at to handle the different
@@ -195,7 +195,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
CORE_ADDR regval = extract_address (val, len);
if (arm_pc_is_thumb (regval))
- store_address (val, len, MAKE_THUMB_ADDR (regval));
+ store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval));
}
/* Copy the argument to general registers or the stack in
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index d2e3ef598a0..c0e2408c886 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -443,7 +443,7 @@ arm_skip_prologue (CORE_ADDR pc)
struct symbol *sym;
/* Found a function. */
- sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
+ sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL);
if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{
/* Don't use this trick for assembly source files. */
@@ -1468,7 +1468,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
if (arm_pc_is_thumb (regval))
{
val = alloca (len);
- store_address (val, len, MAKE_THUMB_ADDR (regval));
+ store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval));
}
}
@@ -2976,10 +2976,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
set_gdbarch_register_byte (gdbarch, arm_register_byte);
- set_gdbarch_register_bytes (gdbarch,
- (NUM_GREGS * INT_REGISTER_RAW_SIZE
- + NUM_FREGS * FP_REGISTER_RAW_SIZE
- + NUM_SREGS * STATUS_REGISTER_SIZE));
+ set_gdbarch_deprecated_register_bytes (gdbarch,
+ (NUM_GREGS * INT_REGISTER_RAW_SIZE
+ + NUM_FREGS * FP_REGISTER_RAW_SIZE
+ + NUM_SREGS * STATUS_REGISTER_SIZE));
set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS);
set_gdbarch_register_raw_size (gdbarch, arm_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, arm_register_virtual_size);
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 386b3861629..4ade2ab41ec 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Contributed by Theodore A. Roth, troth@verinet.com */
+/* Contributed by Theodore A. Roth, troth@openavr.org */
/* Portions of this file were taken from the original gdb-4.18 patch developed
by Denis Chertykov, denisc@overta.ru */
@@ -331,7 +331,7 @@ avr_pointer_to_address (struct type *type, const void *buf)
fprintf_unfiltered (gdb_stderr, "CODE_SPACE ---->> ptr->addr: 0x%lx\n",
addr);
fprintf_unfiltered (gdb_stderr,
- "+++ If you see this, please send me an email <troth@verinet.com>\n");
+ "+++ If you see this, please send me an email <troth@openavr.org>\n");
}
/* Is it a code address? */
@@ -1091,6 +1091,18 @@ avr_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
+/* Not all avr devices support the BREAK insn. Those that don't should treat
+ it as a NOP. Thus, it should be ok. Since the avr is currently a remote
+ only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
+
+const unsigned char *
+avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+{
+ static unsigned char avr_break_insn [] = { 0x98, 0x95 };
+ *lenptr = sizeof (avr_break_insn);
+ return avr_break_insn;
+}
+
/* Initialize the gdbarch structure for the AVR's. */
static struct gdbarch *
@@ -1159,7 +1171,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, avr_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 1);
- set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
+ set_gdbarch_deprecated_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
set_gdbarch_register_byte (gdbarch, avr_register_byte);
set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
@@ -1189,6 +1201,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_remote_translate_xfer_address (gdbarch,
diff --git a/gdb/block.c b/gdb/block.c
index 7bfd8663848..3396c8aa96c 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -155,8 +155,25 @@ block_for_pc (register CORE_ADDR pc)
return block_for_pc_sect (pc, find_pc_mapped_section (pc));
}
-/* Now come some functions designed to deal with C++ namespace
- issues. */
+/* Now come some functions designed to deal with C++ namespace issues.
+ The accessors are safe to use even in the non-C++ case. */
+
+/* This returns the namespace that BLOCK is enclosed in, or "" if it
+ isn't enclosed in a namespace at all. This travels the chain of
+ superblocks looking for a scope, if necessary. */
+
+const char *
+block_scope (const struct block *block)
+{
+ for (; block != NULL; block = BLOCK_SUPERBLOCK (block))
+ {
+ if (BLOCK_NAMESPACE (block) != NULL
+ && BLOCK_NAMESPACE (block)->scope != NULL)
+ return BLOCK_NAMESPACE (block)->scope;
+ }
+
+ return "";
+}
/* Set BLOCK's scope member to SCOPE; if needed, allocate memory via
OBSTACK. (It won't make a copy of SCOPE, however, so that already
@@ -171,6 +188,27 @@ block_set_scope (struct block *block, const char *scope,
BLOCK_NAMESPACE (block)->scope = scope;
}
+/* This returns the first using directives associated to BLOCK, if
+ any. */
+
+/* FIXME: carlton/2003-04-23: This uses the fact that we currently
+ only have using directives in static blocks, because we only
+ generate using directives from anonymous namespaces. Eventually,
+ when we support using directives everywhere, we'll want to replace
+ this by some iterator functions. */
+
+struct using_direct *
+block_using (const struct block *block)
+{
+ const struct block *static_block = block_static_block (block);
+
+ if (static_block == NULL
+ || BLOCK_NAMESPACE (static_block) == NULL)
+ return NULL;
+ else
+ return BLOCK_NAMESPACE (static_block)->using;
+}
+
/* Set BLOCK's using member to USING; if needed, allocate memory via
OBSTACK. (It won't make a copy of USING, however, so that already
has to be allocated correctly.) */
@@ -199,3 +237,33 @@ block_initialize_namespace (struct block *block, struct obstack *obstack)
BLOCK_NAMESPACE (block)->using = NULL;
}
}
+
+/* Return the static block associated to BLOCK. Return NULL if block
+ is NULL or if block is a global block. */
+
+const struct block *
+block_static_block (const struct block *block)
+{
+ if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)
+ return NULL;
+
+ while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
+ block = BLOCK_SUPERBLOCK (block);
+
+ return block;
+}
+
+/* Return the static block associated to BLOCK. Return NULL if block
+ is NULL. */
+
+const struct block *
+block_global_block (const struct block *block)
+{
+ if (block == NULL)
+ return NULL;
+
+ while (BLOCK_SUPERBLOCK (block) != NULL)
+ block = BLOCK_SUPERBLOCK (block);
+
+ return block;
+}
diff --git a/gdb/block.h b/gdb/block.h
index 2fef52adc96..442fa4a86e4 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -200,11 +200,19 @@ extern struct block *block_for_pc (CORE_ADDR);
extern struct block *block_for_pc_sect (CORE_ADDR, asection *);
+extern const char *block_scope (const struct block *block);
+
extern void block_set_scope (struct block *block, const char *scope,
struct obstack *obstack);
+extern struct using_direct *block_using (const struct block *block);
+
extern void block_set_using (struct block *block,
struct using_direct *using,
struct obstack *obstack);
+extern const struct block *block_static_block (const struct block *block);
+
+extern const struct block *block_global_block (const struct block *block);
+
#endif /* BLOCK_H */
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index fce25e469a7..3c713763a71 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -97,7 +97,7 @@ inside_main_func (CORE_ADDR pc)
{
struct symbol *mainsym;
- mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
+ mainsym = lookup_symbol (main_name (), NULL, VAR_DOMAIN, NULL, NULL);
if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
{
symfile_objfile->ei.main_func_lowpc =
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index cd4e8d0ae8d..34f7729eb5f 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1,6 +1,6 @@
/* YACC parser for C expressions, for GDB.
Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000
+ 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
This file is part of GDB.
@@ -567,7 +567,7 @@ block : BLOCKNAME
block : block COLONCOLON name
{ struct symbol *tem
= lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.",
@@ -578,7 +578,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name
{ struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym == 0)
error ("No symbol \"%s\" in specified context.",
@@ -637,7 +637,7 @@ variable: qualified_name
sym =
lookup_symbol (name, (const struct block *) NULL,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym)
{
@@ -831,6 +831,8 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = builtin_type_long_long; }
| SIGNED_KEYWORD LONG LONG
{ $$ = builtin_type_long_long; }
+ | SIGNED_KEYWORD LONG LONG INT_KEYWORD
+ { $$ = builtin_type_long_long; }
| UNSIGNED LONG LONG
{ $$ = builtin_type_unsigned_long_long; }
| UNSIGNED LONG LONG INT_KEYWORD
@@ -839,10 +841,6 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = builtin_type_unsigned_long_long; }
| LONG LONG UNSIGNED INT_KEYWORD
{ $$ = builtin_type_unsigned_long_long; }
- | SIGNED_KEYWORD LONG LONG
- { $$ = lookup_signed_typename ("long long"); }
- | SIGNED_KEYWORD LONG LONG INT_KEYWORD
- { $$ = lookup_signed_typename ("long long"); }
| SHORT INT_KEYWORD
{ $$ = builtin_type_short; }
| SHORT SIGNED_KEYWORD INT_KEYWORD
@@ -1661,7 +1659,7 @@ yylex ()
int hextype;
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
current_language->la_language == language_cplus
? &is_a_field_of_this : (int *) NULL,
(struct symtab **) NULL);
@@ -1749,7 +1747,7 @@ yylex ()
memcpy (tmp1, namestart, p - namestart);
tmp1[p - namestart] = '\0';
cur_sym = lookup_symbol (ncopy, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (cur_sym)
{
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index fbdf0054afa..bdbbb54172c 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -32,6 +32,7 @@
#include "charset.h"
#include "gdb_string.h"
#include "demangle.h"
+#include "cp-support.h"
extern void _initialize_c_language (void);
static void c_emit_char (int c, struct ui_file * stream, int quoter);
@@ -91,7 +92,6 @@ c_printstr (struct ui_file *stream, char *string, unsigned int length,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- extern int inspect_it;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C
@@ -554,6 +554,8 @@ const struct language_defn c_language_defn =
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ NULL, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -608,6 +610,8 @@ const struct language_defn cplus_language_defn =
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
cplus_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -639,6 +643,8 @@ const struct language_defn asm_language_defn =
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ NULL, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -675,6 +681,8 @@ const struct language_defn minimal_language_defn =
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ NULL, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index a07717af165..848f7ac8ade 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -219,7 +219,7 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
if (msymbol != NULL)
wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
- VAR_NAMESPACE, &is_this_fld, &s);
+ VAR_DOMAIN, &is_this_fld, &s);
if (wsym)
{
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 0f36b9509d1..6daf7b4acc5 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1425,7 +1425,7 @@ patch_opaque_types (struct symtab *s)
but search the whole chain, as there may be several syms
from different files with the same name. */
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF &&
- SYMBOL_NAMESPACE (real_sym) == VAR_NAMESPACE &&
+ SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN &&
TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR &&
TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
@@ -1487,7 +1487,7 @@ process_coff_symbol (register struct coff_symbol *cs,
/* default assumptions */
SYMBOL_VALUE (sym) = cs->c_value;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_SECTION (sym) = cs_to_section (cs, objfile);
if (ISFCN (cs->c_type))
@@ -1609,7 +1609,7 @@ process_coff_symbol (register struct coff_symbol *cs,
case C_TPDEF:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* If type has no name, give it one */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
@@ -1669,7 +1669,7 @@ process_coff_symbol (register struct coff_symbol *cs,
case C_UNTAG:
case C_ENTAG:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
@@ -2079,7 +2079,7 @@ coff_read_enum_type (int index, int length, int lastsym)
obsavestring (name, strlen (name),
&current_objfile->symbol_obstack);
SYMBOL_CLASS (sym) = LOC_CONST;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = ms->c_value;
add_symbol_to_list (sym, symlist);
nsyms++;
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index 9e87a63343e..386fcf09fe4 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -244,6 +244,7 @@
@V@/gdb/testsuite/gdb.c++/misc.cc @V@/gdb/testsuite/gdb.cxx/misc.cc
@V@/gdb/testsuite/gdb.c++/misc.exp @V@/gdb/testsuite/gdb.cxx/misc.exp
@V@/gdb/testsuite/gdb.c++/namespace.cc @V@/gdb/testsuite/gdb.cxx/namespace.cc
+@V@/gdb/testsuite/gdb.c++/namespace1.cc @V@/gdb/testsuite/gdb.cxx/namesp1.cc
@V@/gdb/testsuite/gdb.c++/namespace.exp @V@/gdb/testsuite/gdb.cxx/namespace.exp
@V@/gdb/testsuite/gdb.c++/overload.cc @V@/gdb/testsuite/gdb.cxx/overload.cc
@V@/gdb/testsuite/gdb.c++/overload.exp @V@/gdb/testsuite/gdb.cxx/overload.exp
@@ -260,6 +261,10 @@
@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++/rtti.exp @V@/gdb/testsuite/gdb.cxx/rtti.exp
+@V@/gdb/testsuite/gdb.c++/rtti.h @V@/gdb/testsuite/gdb.cxx/rtti.h
+@V@/gdb/testsuite/gdb.c++/rtti1.cc @V@/gdb/testsuite/gdb.cxx/rtti1.cc
+@V@/gdb/testsuite/gdb.c++/rtti2.cc @V@/gdb/testsuite/gdb.cxx/rtti2.cc
@V@/gdb/testsuite/gdb.c++/templates.cc @V@/gdb/testsuite/gdb.cxx/templates.cc
@V@/gdb/testsuite/gdb.c++/templates.exp @V@/gdb/testsuite/gdb.cxx/templates.exp
@V@/gdb/testsuite/gdb.c++/try_catch.cc @V@/gdb/testsuite/gdb.cxx/try_catch.cc
@@ -281,6 +286,8 @@
@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h
@V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c
@V@/gdb/x86-64-linux-nat.c @V@/gdb/x8664-lnat.c
+@V@/include/xtensa-isa-internal.h @V@/include/xt-internal.h
+@V@/include/xtensa-isa.h @V@/include/xt-isa.h
@V@/intl/intlh.inst.in @V@/intl/intlh_inst.in
@V@/intl/po2tbl.sed.in @V@/intl/po2tblsed.in
@V@/itcl/itcl/itclConfig.sh.in @V@/itcl/itcl/itclConfig.sh-in
@@ -446,6 +453,9 @@
@V@/sim/testsuite/d10v-elf/t-ae-st2w-ip.s @V@/sim/testsuite/d10v-elf/t-st2-ip.s
@V@/sim/testsuite/d10v-elf/t-ae-st2w-is.s @V@/sim/testsuite/d10v-elf/t-st2-is.s
@V@/sim/testsuite/d30v-elf/ls-ld4bhu.S @V@/sim/testsuite/d30v-elf/ls-ld4bu.S
+@V@/sim/testsuite/sim/arm/misaligned1.ms @V@/sim/testsuite/sim/arm/mis1.ms
+@V@/sim/testsuite/sim/arm/misaligned2.ms @V@/sim/testsuite/sim/arm/mis2.ms
+@V@/sim/testsuite/sim/arm/misaligned3.ms @V@/sim/testsuite/sim/arm/mis3.ms
@V@/tcl/cygwin/tclConfig.sh.in @V@/tcl/cygwin/tclConfig.sh-in
@V@/tcl/doc/ExprLongObj.3 @V@/tcl/doc/ExprLObj.3
@V@/tcl/mac/tclMacBOAAppInit.c @V@/tcl/mac/tclBOAAppInit.c
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index ca46cb5a40b..799678ed8f0 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -23,8 +23,6 @@
#ifndef TM_LINUX_H
#define TM_LINUX_H
-#define I386_GNULINUX_TARGET
-
#include "i386/tm-i386.h"
#include "config/tm-linux.h"
diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h
index feeef09bb0c..2445395974d 100644
--- a/gdb/config/ia64/tm-ia64.h
+++ b/gdb/config/ia64/tm-ia64.h
@@ -50,7 +50,7 @@
need 8 bytes for each register, plus an additional 8 bytes for each
of the 128 floating point registers. */
-#define REGISTER_BYTES (NUM_REGS*8+128*8)
+#define DEPRECATED_REGISTER_BYTES (NUM_REGS*8+128*8)
/* Index within `registers' of the first byte of the space for
register N. */
diff --git a/gdb/config/m68k/nm-sun3.h b/gdb/config/m68k/nm-sun3.h
index b2fecb29e97..3c5d47ebb82 100644
--- a/gdb/config/m68k/nm-sun3.h
+++ b/gdb/config/m68k/nm-sun3.h
@@ -31,4 +31,4 @@
/* We have to grab the regs since we store all regs at once. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h
index cc20c62a4b0..636df0bb733 100644
--- a/gdb/config/m68k/tm-linux.h
+++ b/gdb/config/m68k/tm-linux.h
@@ -1,6 +1,6 @@
/* Definitions to target GDB to GNU/Linux on m680x0.
- Copyright 1996, 1998, 1999, 2000, 2002 Free Software Foundation,
+ Copyright 1996, 1998, 1999, 2000, 2002, 2003 Free Software Foundation,
Inc.
This file is part of GDB.
@@ -20,8 +20,10 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "config/tm-linux.h"
+#include "m68k/tm-m68k.h"
+
#include "regcache.h"
-#include "m68k-tdep.h"
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
@@ -29,65 +31,6 @@
#define START_INFERIOR_TRAPS_EXPECTED 2
-/* The following definitions are appropriate when using the ELF
- format, where floating point values are returned in fp0, pointer
- values in a0 and other values in d0. */
-
-/* Extract from an array REGBUF containing the (raw) register state a
- function return value of type TYPE, and copy that, in virtual
- format, into VALBUF. */
-
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
-{ \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- { \
- REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
- ((char *) (REGBUF) \
- + REGISTER_BYTE (FP0_REGNUM)), \
- VALBUF); \
- } \
- else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
- memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM), \
- TYPE_LENGTH (TYPE)); \
- else \
- memcpy (VALBUF, \
- ((char *) (REGBUF) \
- + (TYPE_LENGTH (TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH (TYPE))), \
- TYPE_LENGTH (TYPE)); \
-}
-
-/* Write into appropriate registers a function return value of type
- TYPE, given in virtual format. */
-
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
-{ \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- { \
- char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
- REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buffer); \
- deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
- raw_buffer, TYPE_LENGTH (TYPE)); \
- } \
- else \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
- deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM), VALBUF, \
- TYPE_LENGTH (TYPE)); \
- deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \
- } \
-}
-
-#include "config/tm-linux.h"
-#include "m68k/tm-m68k.h"
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM)))
-
/* Offsets (in target ints) into jmp_buf. */
#define JB_ELEMENT_SIZE 4
@@ -100,9 +43,5 @@
#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
-#undef DEPRECATED_FRAME_SAVED_PC
-#define DEPRECATED_FRAME_SAVED_PC(frame) m68k_linux_frame_saved_pc (frame)
-extern CORE_ADDR m68k_linux_frame_saved_pc (struct frame_info *);
-
#define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc)
extern int m68k_linux_in_sigtramp (CORE_ADDR pc);
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index 523cc4a0193..cb72c982f80 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -22,3 +22,5 @@
#include "regcache.h"
#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
+extern int m68k_get_longjmp_target (CORE_ADDR *);
diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h
index aafba6a9928..6e978cf5bdf 100644
--- a/gdb/config/m68k/tm-sun3.h
+++ b/gdb/config/m68k/tm-sun3.h
@@ -28,12 +28,12 @@
<machine/reg.h>. */
/* a&d, pc,sr, fp, fpstat, fpflags */
-#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
+#define DEPRECATED_REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
#define NUM_REGS 31
#define REGISTER_BYTES_OK(b) \
- ((b) == REGISTER_BYTES \
+ ((b) == DEPRECATED_REGISTER_BYTES \
|| (b) == REGISTER_BYTES_FP \
|| (b) == REGISTER_BYTES_NOFP)
diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h
index 2a1af87aa15..d3dfdc46903 100644
--- a/gdb/config/mips/tm-irix5.h
+++ b/gdb/config/mips/tm-irix5.h
@@ -30,8 +30,8 @@
* Irix 6 (n32 ABI) has 32-bit GP regs and 64-bit FP regs
*/
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE)
+#undef DEPRECATED_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE)
#undef REGISTER_BYTE
#define REGISTER_BYTE(N) \
diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h
index 59d3c584ded..812aed5a25d 100644
--- a/gdb/config/mips/tm-irix6.h
+++ b/gdb/config/mips/tm-irix6.h
@@ -62,8 +62,8 @@
#define FCRIR_REGNUM 70 /* FP implementation/revision */
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE)
+#undef DEPRECATED_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE)
#undef REGISTER_BYTE
#define REGISTER_BYTE(N) \
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index f9aebbe1f5a..540db163080 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -106,7 +106,7 @@ extern int mips_step_skips_delay (CORE_ADDR);
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE)
+#define DEPRECATED_REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE)
/* Index within `registers' of the first byte of the space for
register N. */
diff --git a/gdb/config/nm-gnu.h b/gdb/config/nm-gnu.h
index 1dedb57f0a7..73a41803cf8 100644
--- a/gdb/config/nm-gnu.h
+++ b/gdb/config/nm-gnu.h
@@ -30,7 +30,7 @@
extern char *gnu_target_pid_to_str (int pid);
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
/* Don't do wait_for_inferior on attach. */
#define ATTACH_NO_WAIT
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 7daa6f5eadf..988b790561f 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -60,7 +60,8 @@ struct inferior_status;
/* Sequence of bytes for breakpoint instruction. */
-#define BREAKPOINT {0x00, 0x01, 0x00, 0x04}
+const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr);
+#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) hppa_breakpoint_from_pc ((PCPTR), (LENPTR))
#define BREAKPOINT32 0x10004
extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 81bf7caeb08..6d39ed0c6a4 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -21,6 +21,9 @@ 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. */
+struct type;
+struct frame_info;
+
/* PA 64-bit specific definitions. Override those which are in
tm-hppa.h */
@@ -94,9 +97,8 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
#define STACK_ALIGN(sp) hppa_stack_align (sp)
#endif
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always.
+/* Amount PC must be decremented by after a breakpoint. This is often
+ the number of bytes returned by BREAKPOINT_FROM_PC but not always.
Not on the PA-RISC */
@@ -150,7 +152,7 @@ extern int hppa_register_raw_size (int reg_nr);
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#if !GDB_MULTI_ARCH
-#define REGISTER_BYTES (NUM_REGS * 4)
+#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 4)
#endif
#if !GDB_MULTI_ARCH
@@ -375,8 +377,8 @@ extern CORE_ADDR hppa_target_read_fp (void);
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (NUM_REGS * 8)
+#undef DEPRECATED_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 8)
/* Index within `registers' of the first byte of the space for
register N. */
diff --git a/gdb/config/s390/tm-s390.h b/gdb/config/s390/tm-s390.h
index 37bf770e94f..c8a6e8d0323 100644
--- a/gdb/config/s390/tm-s390.h
+++ b/gdb/config/s390/tm-s390.h
@@ -95,7 +95,7 @@ int s390x_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390x_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (1)
#define DEPRECATED_REGISTER_SIZE (8)
-#define REGISTER_BYTES S390X_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES S390X_REGISTER_BYTES
#else /* CONFIG_ARCH_S390X */
@@ -103,7 +103,7 @@ int s390_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (0)
#define DEPRECATED_REGISTER_SIZE (4)
-#define REGISTER_BYTES S390_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES S390_REGISTER_BYTES
#endif /* CONFIG_ARCH_S390X */
diff --git a/gdb/config/sparc/nm-nbsd.h b/gdb/config/sparc/nm-nbsd.h
index 41341c635d2..7ffd72e9101 100644
--- a/gdb/config/sparc/nm-nbsd.h
+++ b/gdb/config/sparc/nm-nbsd.h
@@ -30,6 +30,6 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
#endif /* NM_NBSD_H */
diff --git a/gdb/config/sparc/nm-sun4os4.h b/gdb/config/sparc/nm-sun4os4.h
index cee2a3d242d..e77330c51d4 100644
--- a/gdb/config/sparc/nm-sun4os4.h
+++ b/gdb/config/sparc/nm-sun4os4.h
@@ -30,7 +30,7 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
/* Return sizeof user struct to callers in less machine dependent routines */
diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h
index 8ad58a145e0..6f37162d7a8 100644
--- a/gdb/config/sparc/nm-sun4sol2.h
+++ b/gdb/config/sparc/nm-sun4sol2.h
@@ -26,7 +26,7 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
/* Solaris PSRVADDR support does not seem to include a place for nPC. */
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index b371d1297b3..8baa66a2193 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -360,8 +360,8 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int);
register state, the array `registers'.
Some of the registers aren't 64 bits, but it's a lot simpler just to assume
they all are (since most of them are). */
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (32*8+32*8+45*8)
+#undef DEPRECATED_REGISTER_BYTES
+#define DEPRECATED_REGISTER_BYTES (32*8+32*8+45*8)
/* Index within `registers' of the first byte of the space for
register N. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index a44b04ed251..ab18477fab9 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -164,9 +164,8 @@ extern int sparc_intreg_size (void);
#define FUNCTION_START_OFFSET 0
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
+/* Amount PC must be decremented by after a breakpoint. This is often
+ the number of bytes returned by BREAKPOINT_FROM_PC but not always. */
#define DECR_PC_AFTER_BREAK 0
@@ -205,7 +204,7 @@ extern int sparc_intreg_size (void);
other hand, that is likely to be confusing or worse for flat
frames. */
-#define REGISTER_BYTES (32*4+32*4+8*4)
+#define DEPRECATED_REGISTER_BYTES (32*4+32*4+8*4)
/* Index within `registers' of the first byte of the space for
register N. */
@@ -361,7 +360,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
/* Sequence of bytes for breakpoint instruction (ta 1). */
-#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
+extern const unsigned char *sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len);
+#define BREAKPOINT_FROM_PC(PC,LEN) sparc_breakpoint_from_pc ((PC), (LEN))
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 7205cf73838..a4c7b8d3570 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -1,7 +1,7 @@
/* Helper routines for C++ support in GDB.
Copyright 2003 Free Software Foundation, Inc.
- Contributed by David Carlton.
+ Contributed by David Carlton and by Kealia, Inc.
This file is part of GDB.
@@ -52,6 +52,21 @@ static struct using_direct *cp_add_using (const char *name,
static struct using_direct *cp_copy_usings (struct using_direct *using,
struct obstack *obstack);
+static struct symbol *lookup_namespace_scope (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab,
+ const char *scope,
+ int scope_len);
+
+static struct symbol *lookup_symbol_file (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab,
+ int anonymous_namespace);
+
/* Set up support for dealing with C++ namespace info in the current
symtab. */
@@ -264,3 +279,177 @@ cp_copy_usings (struct using_direct *using,
return retval;
}
}
+
+/* The C++-specific version of name lookup for static and global
+ names. This makes sure that names get looked for in all namespaces
+ that are in scope. NAME is the natural name of the symbol that
+ we're looking for, LINKAGE_NAME (which is optional) is its linkage
+ name, BLOCK is the block that we're searching within, DOMAIN says
+ what kind of symbols we're looking for, and if SYMTAB is non-NULL,
+ we should store the symtab where we found the symbol in it. */
+
+struct symbol *
+cp_lookup_symbol_nonlocal (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab)
+{
+ return lookup_namespace_scope (name, linkage_name, block, domain,
+ symtab, block_scope (block), 0);
+}
+
+/* Lookup NAME at namespace scope (or, in C terms, in static and
+ global variables). SCOPE is the namespace that the current
+ function is defined within; only consider namespaces whose length
+ is at least SCOPE_LEN. Other arguments are as in
+ cp_lookup_symbol_nonlocal.
+
+ For example, if we're within a function A::B::f and looking for a
+ symbol f, this will get called with NAME = "f", SCOPE = "A::B", and
+ SCOPE_LEN = 0. It then calls itself with NAME and SCOPE the same,
+ but with SCOPE_LEN = 1. And then it calls itself with NAME and
+ SCOPE the same, but with SCOPE_LEN = 4. This third call looks for
+ "A::B::x"; if it doesn't find it, then the second call looks for
+ "A::x", and if that call fails, then the first call looks for
+ "x". */
+
+static struct symbol *
+lookup_namespace_scope (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab,
+ const char *scope,
+ int scope_len)
+{
+ char *namespace;
+
+ if (scope[scope_len] != '\0')
+ {
+ /* Recursively search for names in child namespaces first. */
+
+ struct symbol *sym;
+ int new_scope_len = scope_len;
+
+ /* If the current scope is followed by "::", skip past that. */
+ if (new_scope_len != 0)
+ {
+ gdb_assert (scope[new_scope_len] == ':');
+ new_scope_len += 2;
+ }
+ new_scope_len += cp_find_first_component (scope + new_scope_len);
+ sym = lookup_namespace_scope (name, linkage_name, block,
+ domain, symtab,
+ scope, new_scope_len);
+ if (sym != NULL)
+ return sym;
+ }
+
+ /* Okay, we didn't find a match in our children, so look for the
+ name in the current namespace. */
+
+ namespace = alloca (scope_len + 1);
+ strncpy (namespace, scope, scope_len);
+ namespace[scope_len] = '\0';
+ return cp_lookup_symbol_namespace (namespace, name, linkage_name,
+ block, domain, symtab);
+}
+
+/* Look up NAME in the C++ namespace NAMESPACE, applying the using
+ directives that are active in BLOCK. Other arguments are as in
+ cp_lookup_symbol_nonlocal. */
+
+struct symbol *
+cp_lookup_symbol_namespace (const char *namespace,
+ const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab)
+{
+ const struct using_direct *current;
+ struct symbol *sym;
+
+ /* First, go through the using directives. If any of them add new
+ names to the namespace we're searching in, see if we can find a
+ match by applying them. */
+
+ for (current = block_using (block);
+ current != NULL;
+ current = current->next)
+ {
+ if (strcmp (namespace, current->outer) == 0)
+ {
+ sym = cp_lookup_symbol_namespace (current->inner,
+ name,
+ linkage_name,
+ block,
+ domain,
+ symtab);
+ if (sym != NULL)
+ return sym;
+ }
+ }
+
+ /* We didn't find anything by applying any of the using directives
+ that are still applicable; so let's see if we've got a match
+ using the current namespace. */
+
+ if (namespace[0] == '\0')
+ {
+ return lookup_symbol_file (name, linkage_name, block,
+ domain, symtab, 0);
+ }
+ else
+ {
+ char *concatenated_name
+ = alloca (strlen (namespace) + 2 + strlen (name) + 1);
+ strcpy (concatenated_name, namespace);
+ strcat (concatenated_name, "::");
+ strcat (concatenated_name, name);
+ sym = lookup_symbol_file (concatenated_name, linkage_name,
+ block, domain, symtab,
+ cp_is_anonymous (namespace));
+ return sym;
+ }
+}
+
+/* Look up NAME in BLOCK's static block and in global blocks. If
+ ANONYMOUS_NAMESPACE is nonzero, the symbol in question is located
+ within an anonymous namespace. Other arguments are as in
+ cp_lookup_symbol_nonlocal. */
+
+static struct symbol *
+lookup_symbol_file (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab,
+ int anonymous_namespace)
+{
+ struct symbol *sym = NULL;
+
+ sym = lookup_symbol_static (name, linkage_name, block, domain, symtab);
+ if (sym != NULL)
+ return sym;
+
+ if (anonymous_namespace)
+ {
+ /* Symbols defined in anonymous namespaces have external linkage
+ but should be treated as local to a single file nonetheless.
+ So we only search the current file's global block. */
+
+ const struct block *global_block = block_global_block (block);
+
+ if (global_block != NULL)
+ return lookup_symbol_aux_block (name, linkage_name, global_block,
+ domain, symtab);
+ else
+ return NULL;
+ }
+ else
+ {
+ return lookup_symbol_global (name, linkage_name, domain, symtab);
+ }
+}
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 76e842b5d1f..952d6a2b17b 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -24,11 +24,14 @@
#ifndef CP_SUPPORT_H
#define CP_SUPPORT_H
+/* We need this for 'domain_enum', alas... */
+
+#include "symtab.h"
+
/* Opaque declarations. */
struct obstack;
struct block;
-struct symbol;
/* This struct is designed to store data from using directives. It
says that names from namespace INNER should be visible within
@@ -78,4 +81,17 @@ extern void cp_set_block_scope (const struct symbol *symbol,
extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
+extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab);
+
+extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
+ const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab);
+
#endif /* CP_SUPPORT_H */
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 9a32e9c80b9..60a20934312 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -34,6 +34,7 @@
#include "c-lang.h"
#include "target.h"
#include "cp-abi.h"
+#include "valprint.h"
/* Indication of presence of HP-compiled object files */
extern int hp_som_som_object_present; /* defined in symtab.c */
@@ -266,8 +267,6 @@ cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
fprintf_filtered (stream, "<No data fields>");
else
{
- extern int inspect_it;
-
if (dont_print_statmem == 0)
{
/* If we're at top level, carve out a completely fresh
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index ff2d6d22abf..2fbfde53b0e 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1042,7 +1042,7 @@ cris_register_name (int regno)
int
cris_register_bytes_ok (long bytes)
{
- return (bytes == REGISTER_BYTES);
+ return (bytes == DEPRECATED_REGISTER_BYTES);
}
/* Extract from an array regbuf containing the raw register state a function
@@ -4235,7 +4235,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS version");
}
- set_gdbarch_register_bytes (gdbarch, register_bytes);
+ set_gdbarch_deprecated_register_bytes (gdbarch, register_bytes);
/* Returns the register offset for the first byte of register regno's space
in the saved register state. */
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index d8135539b16..752efdd7ed7 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1762,7 +1762,7 @@ read_dbx_symtab (struct objfile *objfile)
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, nlist.n_value,
psymtab_language, objfile);
@@ -1772,7 +1772,7 @@ read_dbx_symtab (struct objfile *objfile)
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, nlist.n_value,
psymtab_language, objfile);
@@ -1790,7 +1790,7 @@ read_dbx_symtab (struct objfile *objfile)
&& namestring[0] != ' '))
{
add_psymbol_to_list (namestring, p - namestring,
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
psymtab_language, objfile);
@@ -1798,7 +1798,7 @@ read_dbx_symtab (struct objfile *objfile)
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
psymtab_language, objfile);
@@ -1814,7 +1814,7 @@ read_dbx_symtab (struct objfile *objfile)
// OBSOLETE {
// OBSOLETE /* Also a typedef with the same name. */
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
-// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
+// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF,
// OBSOLETE &objfile->static_psymbols,
// OBSOLETE nlist.n_value, 0,
// OBSOLETE psymtab_language, objfile);
@@ -1826,7 +1826,7 @@ read_dbx_symtab (struct objfile *objfile)
if (p != namestring) /* a name is there, not just :T... */
{
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
psymtab_language, objfile);
@@ -1888,7 +1888,7 @@ read_dbx_symtab (struct objfile *objfile)
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
add_psymbol_to_list (p, q - p,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
0, psymtab_language, objfile);
/* Point past the name. */
@@ -1905,7 +1905,7 @@ read_dbx_symtab (struct objfile *objfile)
case 'c':
/* Constant, e.g. from "const" in Pascal. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, nlist.n_value,
0, psymtab_language, objfile);
continue;
@@ -1966,7 +1966,7 @@ read_dbx_symtab (struct objfile *objfile)
textlow_not_set = 0;
}
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, nlist.n_value,
psymtab_language, objfile);
@@ -2031,7 +2031,7 @@ read_dbx_symtab (struct objfile *objfile)
textlow_not_set = 0;
}
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, nlist.n_value,
psymtab_language, objfile);
diff --git a/gdb/defs.h b/gdb/defs.h
index d4427830639..a90ef9ef7c0 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1134,8 +1134,6 @@ extern void store_signed_integer (void *, int, LONGEST);
extern void store_unsigned_integer (void *, int, ULONGEST);
-extern void store_address (void *, int, LONGEST);
-
extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
diff --git a/gdb/disasm.h b/gdb/disasm.h
index e4674d87d2d..b5dbb840d24 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -22,6 +22,7 @@
#define DISASM_H
struct ui_out;
+struct ui_file;
extern void gdb_disassembly (struct ui_out *uiout,
char *file_string,
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index e5258378b61..2cd0984205b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,25 @@
+2003-05-21 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ references to "extract_address" and "store_address".
+
+2003-05-16 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ REGISTER_BYTES with DEPRECATED_REGISTER_BYTES. Fix typo,
+ DEPRECATED_REGISTER_SIZE instead of REGISTER_BYTE.
+
+2003-05-14 Theodore A. Roth <troth@openavr.org>
+
+ * gdbint.texinfo (Breakpoint Handling): Correct a double negative.
+
+2003-05-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in (gdb-cfg.texi): Replace $$LN_S with $(LN_S).
+ (gdb.dvi): Likewise.
+ (gdb.pdf): Likewise.
+ (links2roff): Likewise.
+
2003-05-08 Jim Blandy <jimb@redhat.com>
* gdb.texinfo (Dump/Restore Files): Update documentation for
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 52213143688..fcdabc5bf1a 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -245,7 +245,7 @@ GDBvn.texi : ${gdbdir}/version.in
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- (test "$$LN_S" = "ln -s" && \
+ (test "$(LN_S)" = "ln -s" && \
ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -268,7 +268,7 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
# GDB MANUAL: TeX dvi file
gdb.dvi: ${GDB_DOC_FILES}
if [ ! -f ./GDBvn.texi ]; then \
- (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
+ (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
rm -f $(GDB_TEX_TMPS)
@@ -279,7 +279,7 @@ gdb.ps: gdb.dvi
gdb.pdf: ${GDB_DOC_FILES}
if [ ! -f ./GDBvn.texi ]; then \
- (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
+ (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
rm -f $(GDB_TEX_TMPS)
@@ -306,7 +306,7 @@ gdb.info: ${GDB_DOC_FILES}
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
if [ ! -f gdb.texinfo ]; then \
- (test "$$LN_S" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
+ (test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
ln $(GDB_DOC_SOURCE_INCLUDES) . || \
cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
fi
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 28cdc82242a..90b25750ca7 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -288,7 +288,7 @@ A third possibility is that the target already has the ability to do
breakpoints somehow; for instance, a ROM monitor may do its own
software breakpoints. So although these are not literally ``hardware
breakpoints'', from @value{GDBN}'s point of view they work the same;
-@value{GDBN} need not do nothing more than set the breakpoint and wait
+@value{GDBN} need not do anything more than set the breakpoint and wait
for something to happen.
Since they depend on hardware resources, hardware breakpoints may be
@@ -2601,35 +2601,6 @@ This function performs architecture-specific conversions as described
above for @code{store_typed_address}.
@end deftypefun
-
-@value{GDBN} also provides functions that do the same tasks, but assume
-that pointers are simply byte addresses; they aren't sensitive to the
-current architecture, beyond knowing the appropriate endianness.
-
-@deftypefun CORE_ADDR extract_address (void *@var{addr}, int len)
-Extract a @var{len}-byte number from @var{addr} in the appropriate
-endianness for the current architecture, and return it. Note that
-@var{addr} refers to @value{GDBN}'s memory, not the inferior's.
-
-This function should only be used in architecture-specific code; it
-doesn't have enough information to turn bits into a true address in the
-appropriate way for the current architecture. If you can, use
-@code{extract_typed_address} instead.
-@end deftypefun
-
-@deftypefun void store_address (void *@var{addr}, int @var{len}, LONGEST @var{val})
-Store @var{val} at @var{addr} as a @var{len}-byte integer, in the
-appropriate endianness for the current architecture. Note that
-@var{addr} refers to a buffer in @value{GDBN}'s memory, not the
-inferior's.
-
-This function should only be used in architecture-specific code; it
-doesn't have enough information to turn a true address into bits in the
-appropriate way for the current architecture. If you can, use
-@code{store_typed_address} instead.
-@end deftypefun
-
-
Here are some macros which architectures can define to indicate the
relationship between pointers and addresses. These have default
definitions, appropriate for architectures on which all pointers are
@@ -3088,9 +3059,9 @@ reason.
@item DEPRECATED_CALL_DUMMY_WORDS
@findex DEPRECATED_CALL_DUMMY_WORDS
Pointer to an array of @code{LONGEST} words of data containing
-host-byte-ordered @code{REGISTER_BYTES} sized values that partially
-specify the sequence of instructions needed for an inferior function
-call.
+host-byte-ordered @code{DEPRECATED_REGISTER_SIZE} sized values that
+partially specify the sequence of instructions needed for an inferior
+function call.
Should be deprecated in favor of a macro that uses target-byte-ordered
data.
@@ -3746,10 +3717,13 @@ This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS},
@findex DEPRECATED_PUSH_DUMMY_FRAME
Used in @samp{call_function_by_hand} to create an artificial stack frame.
-@item REGISTER_BYTES
-@findex REGISTER_BYTES
-The total amount of space needed to store @value{GDBN}'s copy of the machine's
-register state.
+@item DEPRECATED_REGISTER_BYTES
+@findex DEPRECATED_REGISTER_BYTES
+The total amount of space needed to store @value{GDBN}'s copy of the
+machine's register state.
+
+This is no longer needed. @value{GDBN} instead computes the size of the
+register buffer at run-time.
@item REGISTER_NAME(@var{i})
@findex REGISTER_NAME
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index e16056c4412..ca11bd675f0 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -111,7 +111,7 @@ find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
}
struct regcache *
-generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+deprecated_find_dummy_frame_regcache (CORE_ADDR pc, CORE_ADDR fp)
{
struct dummy_frame *dummy = find_dummy_frame (pc, fp);
if (dummy != NULL)
@@ -123,7 +123,7 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
char *
deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
- struct regcache *regcache = generic_find_dummy_frame (pc, fp);
+ struct regcache *regcache = deprecated_find_dummy_frame_regcache (pc, fp);
if (regcache == NULL)
return NULL;
return deprecated_grub_regcache_for_registers (regcache);
@@ -176,7 +176,7 @@ pc_in_dummy_frame (CORE_ADDR pc)
CORE_ADDR
deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
{
- struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
+ struct regcache *dummy_regs = deprecated_find_dummy_frame_regcache (pc, fp);
if (dummy_regs)
{
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index 3d38cc436cc..ae090e3598d 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -81,6 +81,6 @@ extern int pc_in_dummy_frame (CORE_ADDR pc);
deprecated_generic_get_saved_register. Eliminate that function and
this, to, can go. */
-extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc,
- CORE_ADDR fp);
+extern struct regcache *deprecated_find_dummy_frame_regcache (CORE_ADDR pc,
+ CORE_ADDR fp);
#endif /* !defined (DUMMY_FRAME_H) */
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 35e76f3cd40..410cd54c622 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -39,8 +39,9 @@ new_dwarf_expr_context (void)
{
struct dwarf_expr_context *retval;
retval = xcalloc (1, sizeof (struct dwarf_expr_context));
- retval->stack_len = 10;
- retval->stack = xmalloc (10 * sizeof (CORE_ADDR));
+ retval->stack_len = 0;
+ retval->stack_allocated = 10;
+ retval->stack = xmalloc (retval->stack_allocated * sizeof (CORE_ADDR));
return retval;
}
@@ -61,12 +62,10 @@ dwarf_expr_grow_stack (struct dwarf_expr_context *ctx, size_t need)
{
if (ctx->stack_len + need > ctx->stack_allocated)
{
- size_t templen = ctx->stack_len * 2;
- while (templen < (ctx->stack_len + need))
- templen *= 2;
+ size_t newlen = ctx->stack_len + need + 10;
ctx->stack = xrealloc (ctx->stack,
- templen * sizeof (CORE_ADDR));
- ctx->stack_allocated = templen;
+ newlen * sizeof (CORE_ADDR));
+ ctx->stack_allocated = newlen;
}
}
@@ -228,6 +227,8 @@ static void
execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
unsigned char *op_end)
{
+ ctx->in_reg = 0;
+
while (op_ptr < op_end)
{
enum dwarf_location_atom op = *op_ptr++;
@@ -236,8 +237,6 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
LONGEST offset;
int bytes_read;
- ctx->in_reg = 0;
-
switch (op)
{
case DW_OP_lit0:
@@ -355,10 +354,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
case DW_OP_reg29:
case DW_OP_reg30:
case DW_OP_reg31:
- /* NOTE: in the presence of DW_OP_piece this check is incorrect. */
- if (op_ptr != op_end)
+ if (op_ptr != op_end && *op_ptr != DW_OP_piece)
error ("DWARF-2 expression error: DW_OP_reg operations must be "
- "used alone.");
+ "used either alone or in conjuction with DW_OP_piece.");
result = op - DW_OP_reg0;
ctx->in_reg = 1;
@@ -367,9 +365,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
case DW_OP_regx:
op_ptr = read_uleb128 (op_ptr, op_end, &reg);
- if (op_ptr != op_end)
+ if (op_ptr != op_end && *op_ptr != DW_OP_piece)
error ("DWARF-2 expression error: DW_OP_reg operations must be "
- "used alone.");
+ "used either alone or in conjuction with DW_OP_piece.");
result = reg;
ctx->in_reg = 1;
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index c236c11f37c..2bb4f268a0b 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -50,7 +50,7 @@
static char *
find_location_expression (struct dwarf2_loclist_baton *baton,
- int *locexpr_length, CORE_ADDR pc)
+ size_t *locexpr_length, CORE_ADDR pc)
{
CORE_ADDR base_address = baton->base_address;
CORE_ADDR low, high;
@@ -448,7 +448,7 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame)
struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
struct value *val;
unsigned char *data;
- int size;
+ size_t size;
data = find_location_expression (dlbaton, &size,
frame ? get_frame_pc (frame) : 0);
@@ -490,7 +490,7 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
{
struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
unsigned char *data;
- int size;
+ size_t size;
data = find_location_expression (dlbaton, &size, ax->scope);
if (data == NULL)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a0a2f9beaaa..8f927f0f0ea 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1503,7 +1503,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
/*prim_record_minimal_symbol (pdi->name, pdi->lowpc + baseaddr,
mst_text, objfile); */
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, pdi->lowpc + baseaddr, cu_language, objfile);
}
@@ -1512,7 +1512,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
/*prim_record_minimal_symbol (pdi->name, pdi->lowpc + baseaddr,
mst_file_text, objfile); */
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, pdi->lowpc + baseaddr, cu_language, objfile);
}
@@ -1537,7 +1537,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
addr = decode_locdesc (pdi->locdesc, objfile, cu_header);
if (pdi->locdesc || pdi->has_type)
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, addr + baseaddr, cu_language, objfile);
}
@@ -1550,7 +1550,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
/*prim_record_minimal_symbol (pdi->name, addr + baseaddr,
mst_file_data, objfile); */
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, addr + baseaddr, cu_language, objfile);
}
@@ -1558,7 +1558,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
case DW_TAG_typedef:
case DW_TAG_base_type:
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, (CORE_ADDR) 0, cu_language, objfile);
break;
@@ -1571,7 +1571,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
if (pdi->has_children == 0)
return;
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, (CORE_ADDR) 0, cu_language, objfile);
@@ -1579,14 +1579,14 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
{
/* For C++, these implicitly act as typedefs as well. */
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, (CORE_ADDR) 0, cu_language, objfile);
}
break;
case DW_TAG_enumerator:
add_psymbol_to_list (pdi->name, strlen (pdi->name),
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols,
0, (CORE_ADDR) 0, cu_language, objfile);
break;
@@ -5122,7 +5122,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
/* Default assumptions.
Use the passed type or decode it from the die. */
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_STATIC;
if (type != NULL)
SYMBOL_TYPE (sym) = type;
@@ -5252,7 +5252,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
case DW_TAG_union_type:
case DW_TAG_enumeration_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
add_symbol_to_list (sym, list_in_scope);
/* The semantics of C++ state that "struct foo { ... }" also
@@ -5264,7 +5264,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
obstack_alloc (&objfile->symbol_obstack,
sizeof (struct symbol));
*typedef_sym = *sym;
- SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) =
obsavestring (DEPRECATED_SYMBOL_NAME (sym),
@@ -5276,7 +5276,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
case DW_TAG_typedef:
case DW_TAG_base_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, list_in_scope);
break;
case DW_TAG_enumerator:
@@ -5319,8 +5319,10 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
(sym)));
SYMBOL_VALUE_BYTES (sym) = (char *)
obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size);
- store_address (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size,
- DW_ADDR (attr));
+ /* NOTE: cagney/2003-05-09: In-lined store_address call with
+ it's body - store_unsigned_integer. */
+ store_unsigned_integer (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size,
+ DW_ADDR (attr));
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
break;
case DW_FORM_block1:
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 40c89e37a9c..bbfecbc29f5 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1589,7 +1589,7 @@ read_enumeration (struct dieinfo *dip, char *thisdie, char *enddie,
of the enumeration and return a type pointer for the enumeration.
At the same time, for each member of the enumeration, create a
- symbol for it with namespace VAR_NAMESPACE and class LOC_CONST,
+ symbol for it with domain VAR_DOMAIN and class LOC_CONST,
and give it the type of the enumeration itself.
NOTES
@@ -1679,7 +1679,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile)
DEPRECATED_SYMBOL_NAME (sym) = create_name (list->field.name,
&objfile->symbol_obstack);
SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = type;
SYMBOL_VALUE (sym) = FIELD_BITPOS (list->field);
@@ -2447,7 +2447,7 @@ add_enum_psymbol (struct dieinfo *dip, struct objfile *objfile)
while (scan < listend)
{
scan += TARGET_FT_LONG_SIZE (objfile);
- add_psymbol_to_list (scan, strlen (scan), VAR_NAMESPACE, LOC_CONST,
+ add_psymbol_to_list (scan, strlen (scan), VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0, 0, cu_language,
objfile);
scan += strlen (scan) + 1;
@@ -2479,31 +2479,31 @@ add_partial_symbol (struct dieinfo *dip, struct objfile *objfile)
{
case TAG_global_subroutine:
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, dip->at_low_pc, cu_language, objfile);
break;
case TAG_global_variable:
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, 0, cu_language, objfile);
break;
case TAG_subroutine:
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, dip->at_low_pc, cu_language, objfile);
break;
case TAG_local_variable:
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, 0, cu_language, objfile);
break;
case TAG_typedef:
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, 0, cu_language, objfile);
break;
@@ -2515,14 +2515,14 @@ add_partial_symbol (struct dieinfo *dip, struct objfile *objfile)
if (!dip->has_at_byte_size)
break;
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, 0, cu_language, objfile);
if (cu_language == language_cplus)
{
/* For C++, these implicitly act as typedefs as well. */
add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, 0, cu_language, objfile);
}
@@ -2821,7 +2821,7 @@ new_symbol (struct dieinfo *dip, struct objfile *objfile)
OBJSTAT (objfile, n_syms++);
memset (sym, 0, sizeof (struct symbol));
/* default assumptions */
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_TYPE (sym) = decode_die_type (dip);
@@ -2927,12 +2927,12 @@ new_symbol (struct dieinfo *dip, struct objfile *objfile)
case TAG_union_type:
case TAG_enumeration_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
add_symbol_to_list (sym, list_in_scope);
break;
case TAG_typedef:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, list_in_scope);
break;
default:
@@ -2984,7 +2984,7 @@ synthesize_typedef (struct dieinfo *dip, struct objfile *objfile,
SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
SYMBOL_TYPE (sym) = type;
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, list_in_scope);
}
}
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index a9504c18418..396b1db1f92 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1141,7 +1141,7 @@ yylex ()
int hextype;
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
current_language->la_language == language_cplus
? &is_a_field_of_this : NULL,
NULL);
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 2a4eac3f119..9ed2d6f1505 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -30,6 +30,7 @@
#include "language.h"
#include "f-lang.h"
#include "valprint.h"
+#include "value.h"
/* The built-in types of F77. FIXME: integer*4 is missing, plain
logical is missing (builtin_type_logical is logical*4). */
@@ -167,7 +168,6 @@ f_printstr (struct ui_file *stream, char *string, unsigned int length,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- extern int inspect_it;
if (length == 0)
{
@@ -473,6 +473,8 @@ const struct language_defn f_language_defn =
f_val_print, /* Print a value using appropriate syntax */
c_value_print, /* FIXME */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%o", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/findvar.c b/gdb/findvar.c
index ca371d21e03..c9623bf2c4d 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -252,24 +252,6 @@ store_unsigned_integer (void *addr, int len, ULONGEST val)
}
}
-/* Store the address VAL as a LEN-byte value in target byte order at
- ADDR. ADDR is a buffer in the GDB process, not in the inferior.
-
- This function should only be used by target-specific code. It
- assumes that a pointer has the same representation as that thing's
- address represented as an integer. Some machines use word
- addresses, or similarly munged things, for certain types of
- pointers, so that assumption doesn't hold everywhere.
-
- Common code should use store_typed_address instead, or something else
- based on ADDRESS_TO_POINTER. */
-void
-store_address (void *addr, int len, LONGEST val)
-{
- store_unsigned_integer (addr, len, val);
-}
-
-
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
@@ -365,7 +347,7 @@ signed_pointer_to_address (struct type *type, const void *buf)
void
unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
{
- store_address (buf, TYPE_LENGTH (type), addr);
+ store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
}
void
diff --git a/gdb/frame.c b/gdb/frame.c
index a664b97999b..fe863d69d33 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -983,8 +983,10 @@ legacy_saved_regs_prev_register (struct frame_info *next_frame,
*addrp = 0;
*realnump = -1;
if (bufferp != NULL)
- store_address (bufferp, REGISTER_RAW_SIZE (regnum),
- get_frame_saved_regs (frame)[regnum]);
+ /* NOTE: cagney/2003-05-09: In-lined store_address with
+ it's body - store_unsigned_integer. */
+ store_unsigned_integer (bufferp, REGISTER_RAW_SIZE (regnum),
+ get_frame_saved_regs (frame)[regnum]);
}
else
{
@@ -1110,8 +1112,8 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
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)),
+ (deprecated_find_dummy_frame_regcache (get_frame_pc (frame),
+ get_frame_base (frame)),
regnum, raw_buffer);
return;
}
@@ -1125,8 +1127,11 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
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]);
+ /* NOTE: cagney/2003-05-09: In-line store_address
+ with it's body - store_unsigned_integer. */
+ store_unsigned_integer (raw_buffer,
+ REGISTER_RAW_SIZE (regnum),
+ get_frame_saved_regs (frame)[regnum]);
}
else
{
diff --git a/gdb/frame.h b/gdb/frame.h
index a8f05f35f8b..0abb08ed9ca 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -28,6 +28,7 @@ struct frame_unwind;
struct frame_base;
struct block;
struct gdbarch;
+struct ui_file;
/* A legacy unwinder to prop up architectures using the old style
saved regs array. */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index ce02b7fc6a8..c26af4d28ee 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -843,7 +843,7 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
{
- store_address (valbuf, 4, VALUE_ADDRESS (arg));
+ store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (arg));
typecode = TYPE_CODE_PTR;
len = 4;
val = valbuf;
@@ -1058,7 +1058,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, frv_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, frv_num_regs * 4);
set_gdbarch_register_byte (gdbarch, frv_register_byte);
set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index db9e76e9671..976ce59ae13 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -168,7 +168,7 @@ struct gdbarch
gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
gdbarch_register_name_ftype *register_name;
int deprecated_register_size;
- int register_bytes;
+ int deprecated_register_bytes;
gdbarch_register_byte_ftype *register_byte;
gdbarch_register_raw_size_ftype *register_raw_size;
int deprecated_max_register_raw_size;
@@ -540,7 +540,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->store_return_value = legacy_store_return_value;
current_gdbarch->use_struct_convention = generic_use_struct_convention;
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
- current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
current_gdbarch->decr_pc_after_break = -1;
@@ -701,7 +700,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->inner_than == 0))
fprintf_unfiltered (log, "\n\tinner_than");
- /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->breakpoint_from_pc == 0))
+ fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
/* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
@@ -1479,6 +1480,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_push_return_address
/*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
#endif
+#ifdef DEPRECATED_REGISTER_BYTES
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
+ XSTRING (DEPRECATED_REGISTER_BYTES));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
+ DEPRECATED_REGISTER_BYTES);
+#endif
#ifdef DEPRECATED_REGISTER_SIZE
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
@@ -2011,14 +2020,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->register_byte
/*REGISTER_BYTE ()*/);
#endif
-#ifdef REGISTER_BYTES
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTES # %s\n",
- XSTRING (REGISTER_BYTES));
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTES = %d\n",
- REGISTER_BYTES);
-#endif
#ifdef REGISTER_BYTES_OK_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -3301,19 +3302,19 @@ set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
}
int
-gdbarch_register_bytes (struct gdbarch *gdbarch)
+gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
- return gdbarch->register_bytes;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_bytes called\n");
+ return gdbarch->deprecated_register_bytes;
}
void
-set_gdbarch_register_bytes (struct gdbarch *gdbarch,
- int register_bytes)
+set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch,
+ int deprecated_register_bytes)
{
- gdbarch->register_bytes = register_bytes;
+ gdbarch->deprecated_register_bytes = deprecated_register_bytes;
}
int
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 1a8e386e1a0..e80836f2a33 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -730,13 +730,13 @@ extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int d
#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
#endif
-extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
-extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
-#error "Non multi-arch definition of REGISTER_BYTES"
+extern int gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int deprecated_register_bytes);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTES)
+#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTES"
#endif
-#if !defined (REGISTER_BYTES)
-#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
+#if !defined (DEPRECATED_REGISTER_BYTES)
+#define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch))
#endif
/* NOTE: cagney/2002-05-02: This function with predicate has a valid
@@ -2163,11 +2163,6 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_
#endif
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
-#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
-#endif
-
typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 16165a9858a..f6106e4f372 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -473,7 +473,7 @@ f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0
v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
-v::REGISTER_BYTES:int:register_bytes
+v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes
# NOTE: cagney/2002-05-02: 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
@@ -591,7 +591,7 @@ F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int f
f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0
f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
-f:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0
+f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
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
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 67567d9809c..3b8e62faa87 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1058,7 +1058,7 @@ lookup_typename (char *name, struct block *block, int noerr)
register struct symbol *sym;
register struct type *tmp;
- sym = lookup_symbol (name, block, VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ sym = lookup_symbol (name, block, VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
{
tmp = lookup_primitive_typename (name);
@@ -1111,7 +1111,7 @@ lookup_struct (char *name, struct block *block)
{
register struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
if (sym == NULL)
@@ -1134,7 +1134,7 @@ lookup_union (char *name, struct block *block)
register struct symbol *sym;
struct type *t;
- sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
if (sym == NULL)
@@ -1165,7 +1165,7 @@ lookup_enum (char *name, struct block *block)
{
register struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
if (sym == NULL)
{
@@ -1191,7 +1191,7 @@ lookup_template_type (char *name, struct type *type, struct block *block)
strcat (nam, TYPE_NAME (type));
strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */
- sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ sym = lookup_symbol (nam, block, VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym == NULL)
{
@@ -1386,7 +1386,7 @@ check_typedef (struct type *type)
name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the
- TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
+ TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN
as appropriate? (this code was written before TYPE_NAME and
TYPE_TAG_NAME were separate). */
if (name == NULL)
@@ -1394,7 +1394,7 @@ check_typedef (struct type *type)
stub_noname_complaint ();
return type;
}
- sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
if (sym)
TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
@@ -1430,7 +1430,7 @@ check_typedef (struct type *type)
{
char *name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the
- TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
+ TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN
as appropriate? (this code was written before TYPE_NAME and
TYPE_TAG_NAME were separate). */
struct symbol *sym;
@@ -1439,7 +1439,7 @@ check_typedef (struct type *type)
stub_noname_complaint ();
return type;
}
- sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL);
+ sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL);
if (sym)
make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
}
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 2d2561e40ae..847e23aba84 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -281,7 +281,7 @@ struct main_type
/* Name of this type, or NULL if none.
This is used for printing only, except by poorly designed C++ code.
- For looking up a name, look for a symbol in the VAR_NAMESPACE. */
+ For looking up a name, look for a symbol in the VAR_DOMAIN. */
char *name;
@@ -292,7 +292,7 @@ struct main_type
with this feature.
This is used for printing only, except by poorly designed C++ code.
- For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
+ For looking up a name, look for a symbol in the STRUCT_DOMAIN.
One more legitimate use is that if TYPE_FLAG_STUB is set, this is
the name to use to look for definitions in other files. */
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 7e66ee9a81c..da2a2d60450 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -255,7 +255,7 @@ gnuv3_rtti_type (struct value *value,
class_name = vtable_symbol_name + 11;
/* Try to look up the class name as a type name. */
- class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0);
+ class_symbol = lookup_symbol (class_name, 0, STRUCT_DOMAIN, 0, 0);
if (! class_symbol)
{
warning ("can't find class named `%s', as given by C++ RTTI", class_name);
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 3e12afdb7ff..0559805da03 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1105,7 +1105,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, h8300_register_name);
set_gdbarch_deprecated_register_size (gdbarch, BINWORD);
- set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
+ set_gdbarch_deprecated_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
set_gdbarch_register_byte (gdbarch, h8300_register_byte);
set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, h8300h_reg_size);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index d524bae33c1..e8d62db6579 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -642,6 +642,14 @@ find_unwind_entry (CORE_ADDR pc)
return NULL;
}
+const unsigned char *
+hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static const char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
+ (*len) = sizeof (breakpoint);
+ return breakpoint;
+}
+
/* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c.
@@ -1973,10 +1981,10 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
args = alloca (sizeof (struct value *) * 8); /* 6 for the arguments and one null one??? */
funcval = find_function_in_inferior ("__d_shl_get");
- get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_NAMESPACE, NULL, NULL);
+ get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_DOMAIN, NULL, NULL);
buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
- symbol2 = lookup_symbol ("__shldp", NULL, VAR_NAMESPACE, NULL, NULL);
+ symbol2 = lookup_symbol ("__shldp", NULL, VAR_DOMAIN, NULL, NULL);
endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
namelen = strlen (DEPRECATED_SYMBOL_NAME (function));
value_return_addr = endo_buff_addr + namelen;
@@ -2529,7 +2537,7 @@ hppa_alignof (struct type *type)
void
pa_do_registers_info (int regnum, int fpregs)
{
- char raw_regs[REGISTER_BYTES];
+ char *raw_regs = alloca (DEPRECATED_REGISTER_BYTES);
int i;
/* Make a copy of gdb's save area (may cause actual
@@ -2573,7 +2581,7 @@ void
pa_do_strcat_registers_info (int regnum, int fpregs, struct ui_file *stream,
enum precision_type precision)
{
- char raw_regs[REGISTER_BYTES];
+ char *raw_regs = alloca (DEPRECATED_REGISTER_BYTES);
int i;
/* Make a copy of gdb's save area (may cause actual
@@ -4345,7 +4353,7 @@ initialize_hp_cxx_exception_support (void)
/* Next look for the catch enable flag provided in end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
- VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym) /* sometimes present in debug info */
{
eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
@@ -4371,7 +4379,7 @@ initialize_hp_cxx_exception_support (void)
/* Next look for the catch enable flag provided end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
- VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym) /* sometimes present in debug info */
{
eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
@@ -4997,7 +5005,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
set_gdbarch_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
set_gdbarch_register_raw_size (gdbarch, hppa_register_raw_size);
- set_gdbarch_register_bytes (gdbarch, hppa_num_regs * 4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, hppa_num_regs * 4);
set_gdbarch_register_byte (gdbarch, hppa_register_byte);
set_gdbarch_register_virtual_size (gdbarch, hppa_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 606ccfeba7c..958507f748a 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -789,7 +789,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
strlen (rtn_name),
rtn_dem_name,
strlen (rtn_dem_name),
- VAR_NAMESPACE,
+ VAR_DOMAIN,
LOC_BLOCK, /* "I am a routine" */
&objfile->global_psymbols,
(qPD[curr_pd].adrStart + /* Starting address of rtn */
@@ -802,7 +802,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
strlen (rtn_name),
rtn_dem_name,
strlen (rtn_dem_name),
- VAR_NAMESPACE,
+ VAR_DOMAIN,
LOC_BLOCK, /* "I am a routine" */
&objfile->static_psymbols,
(qPD[curr_pd].adrStart + /* Starting address of rtn */
@@ -2061,12 +2061,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
set_namestring (dn_bufp, &namestring, objfile);
if (dn_bufp->dfunc.global)
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols, valu,
0, language_unknown, objfile);
else
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols, valu,
0, language_unknown, objfile);
within_function = 1;
@@ -2082,12 +2082,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
set_namestring (dn_bufp, &namestring, objfile);
if (dn_bufp->ddocfunc.global)
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols, valu,
0, language_unknown, objfile);
else
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols, valu,
0, language_unknown, objfile);
within_function = 1;
@@ -2128,7 +2128,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
{
/* Variables, typedefs an the like. */
enum address_class storage;
- namespace_enum namespace;
+ domain_enum domain;
/* Don't add locals to the partial symbol table. */
if (within_function
@@ -2136,11 +2136,11 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|| dn_bufp->dblock.kind == DNTT_TYPE_DVAR))
continue;
- /* TAGDEFs go into the structure namespace. */
+ /* TAGDEFs go into the structure domain. */
if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF)
- namespace = STRUCT_NAMESPACE;
+ domain = STRUCT_DOMAIN;
else
- namespace = VAR_NAMESPACE;
+ domain = VAR_DOMAIN;
/* What kind of "storage" does this use? */
if (dn_bufp->dblock.kind == DNTT_TYPE_SVAR)
@@ -2178,7 +2178,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
if (dn_bufp->dsvar.global)
{
add_psymbol_to_list (namestring, strlen (namestring),
- namespace, storage,
+ domain, storage,
&objfile->global_psymbols,
valu,
0, language_unknown, objfile);
@@ -2186,18 +2186,18 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
else
{
add_psymbol_to_list (namestring, strlen (namestring),
- namespace, storage,
+ domain, storage,
&objfile->static_psymbols,
valu,
0, language_unknown, objfile);
}
/* For TAGDEF's, the above code added the tagname to the
- struct namespace. This will cause tag "t" to be found
+ struct domain. This will cause tag "t" to be found
on a reference of the form "(struct t) x". But for
C++ classes, "t" will also be a typename, which we
want to find on a reference of the form "ptype t".
- Therefore, we also add "t" to the var namespace.
+ Therefore, we also add "t" to the var domain.
Do the same for enum's due to the way aCC generates
debug info for these (see more extended comment
in hp-symtab-read.c).
@@ -2216,7 +2216,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
if (global)
{
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, storage,
+ VAR_DOMAIN, storage,
&objfile->global_psymbols,
dn_bufp->dsvar.location,
0, language_unknown, objfile);
@@ -2224,7 +2224,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
else
{
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, storage,
+ VAR_DOMAIN, storage,
&objfile->static_psymbols,
dn_bufp->dsvar.location,
0, language_unknown, objfile);
@@ -2249,12 +2249,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
}
if (dn_bufp->dconst.global)
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->global_psymbols, 0,
0, language_unknown, objfile);
else
add_psymbol_to_list (namestring, strlen (namestring),
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
0, language_unknown, objfile);
continue;
@@ -3133,7 +3133,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
&objfile->symbol_obstack);
SYMBOL_CLASS (sym) = LOC_CONST;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = memp->dmember.value;
add_symbol_to_list (sym, symlist);
nsyms++;
@@ -3248,7 +3248,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
SYMBOL_CLASS (sym) = LOC_REF_ARG;
else
SYMBOL_CLASS (sym) = LOC_ARG;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (paramp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = paramp->dfparam.location;
@@ -3427,7 +3427,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
SYMBOL_CLASS (sym) = LOC_REF_ARG;
else
SYMBOL_CLASS (sym) = LOC_ARG;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (paramp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = paramp->dfparam.location;
@@ -5100,7 +5100,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
memset (sym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack);
SYMBOL_LANGUAGE (sym) = language_auto;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_LINE (sym) = 0;
SYMBOL_VALUE (sym) = 0;
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
@@ -5660,7 +5660,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
/* DNTT_TYPE_IMPORT is not handled */
case DNTT_TYPE_LABEL:
- SYMBOL_NAMESPACE (sym) = LABEL_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
break;
case DNTT_TYPE_FPARAM:
@@ -5695,7 +5695,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
SYMBOL_CLASS (sym) = LOC_REF_ARG;
else
SYMBOL_CLASS (sym) = LOC_ARG;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (dn_bufp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
@@ -5811,9 +5811,9 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
case DNTT_TYPE_TYPEDEF:
/* A typedef. We do want to process these, since a name is
- * added to the namespace for the typedef'ed name.
+ * added to the domain for the typedef'ed name.
*/
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile);
if (dn_bufp->dtype.global)
add_symbol_to_list (sym, &global_symbols);
@@ -5828,10 +5828,10 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
int global = dn_bufp->dtag.global;
/* Structure, union, enum, template, or class tag definition */
/* We do want to process these, since a name is
- * added to the namespace for the tag name (and if C++ class,
+ * added to the domain for the tag name (and if C++ class,
* for the typename also).
*/
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
/* The tag contains in its "type" field a pointer to the
* DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, DNTT_TYPE_ENUM,
@@ -5888,7 +5888,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
memset (newsym, 0, sizeof (struct symbol));
DEPRECATED_SYMBOL_NAME (newsym) = name;
SYMBOL_LANGUAGE (newsym) = language_auto;
- SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (newsym) = VAR_DOMAIN;
SYMBOL_LINE (newsym) = 0;
SYMBOL_VALUE (newsym) = 0;
SYMBOL_CLASS (newsym) = LOC_TYPEDEF;
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index 7a7b74174a1..02f5acd9a90 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -294,7 +294,7 @@ hpux_thread_fetch_registers (int regno)
/* Flags must be 0 to avoid bogus value for SS_INSYSCALL */
memset (buf, '\000', REGISTER_RAW_SIZE (regno));
else if (regno == SP_REGNUM)
- store_address (buf, sizeof sp, sp);
+ store_unsigned_integer (buf, sizeof sp, sp);
else if (regno == PC_REGNUM)
read_memory (sp - 20, buf, REGISTER_RAW_SIZE (regno));
else
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 2fe4d0481a9..afff5485edc 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -461,7 +461,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1);
set_gdbarch_register_name (gdbarch, i386_linux_register_name);
set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p);
- set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4);
tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 5cf63b46f86..0428c13dabb 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -864,7 +864,7 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
char buf[4];
sp -= 4;
- store_address (buf, 4, struct_addr);
+ store_unsigned_integer (buf, 4, struct_addr);
write_memory (sp, buf, 4);
}
@@ -1487,7 +1487,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, i386_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
+ set_gdbarch_deprecated_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
set_gdbarch_register_type (gdbarch, i386_register_type);
set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 1e0b40506a8..1b569d924dd 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -148,7 +148,7 @@ extern int i386_mxcsr_regnum_p (int regnum);
/* Sizes of individual register sets. These cover the entire register
file, so summing up the sizes of those portions actually present
- yields REGISTER_BYTES. */
+ yields DEPRECATED_REGISTER_BYTES. */
#define I386_SIZEOF_GREGS (I386_NUM_GREGS * 4)
#define I386_SIZEOF_FREGS (8 * 10 + 8 * 4)
#define I386_SIZEOF_XREGS (8 * 16 + 4)
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index ce9b26c8e2e..a898f5211ab 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -543,9 +543,9 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
using the pattern seen below. */
#if 0
-#define BREAKPOINT 0x00002000040LL
+#define IA64_BREAKPOINT 0x00002000040LL
#endif
-#define BREAKPOINT 0x00003333300LL
+#define IA64_BREAKPOINT 0x00003333300LL
static int
ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
@@ -573,7 +573,7 @@ ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
instr = slotN_contents (bundle, slotnum);
memcpy(contents_cache, &instr, sizeof(instr));
- replace_slotN_contents (bundle, BREAKPOINT, slotnum);
+ replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum);
if (val == 0)
target_write_memory (addr, bundle, BUNDLE_LEN);
@@ -737,7 +737,7 @@ ia64_frame_saved_pc (struct frame_info *frame)
/* Limit the number of skipped non-prologue instructions since examining
of the prologue is expensive. */
-static int max_skip_non_prologue_insns = 10;
+static int max_skip_non_prologue_insns = 40;
/* Given PC representing the starting address of a function, and
LIM_PC which is the (sloppy) limit to which to scan when looking
@@ -825,10 +825,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
CORE_ADDR spill_addr = 0;
char instores[8];
char infpstores[8];
+ char reg_contents[256];
int trust_limit;
+ int frameless = 0;
memset (instores, 0, sizeof instores);
memset (infpstores, 0, sizeof infpstores);
+ memset (reg_contents, 0, sizeof reg_contents);
if (frame && !get_frame_saved_regs (frame))
{
@@ -843,13 +846,14 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
return get_frame_extra_info (frame)->after_prologue;
lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit);
-
- /* Must start with an alloc instruction */
next_pc = fetch_instruction (pc, &it, &instr);
+
+ /* We want to check if we have a recognizable function start before we
+ look ahead for a prologue. */
if (pc < lim_pc && next_pc
&& it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL))
{
- /* alloc */
+ /* alloc - start of a regular function. */
int sor = (int) ((instr & 0x00078000000LL) >> 27);
int sol = (int) ((instr & 0x00007f00000LL) >> 20);
int sof = (int) ((instr & 0x000000fe000LL) >> 13);
@@ -864,9 +868,35 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
}
else
{
- pc = lim_pc; /* Frameless: We're done early. */
- if (trust_limit)
- last_prologue_pc = lim_pc;
+ /* Look for a leaf routine. */
+ if (pc < lim_pc && next_pc
+ && (it == I || it == M)
+ && ((instr & 0x1ee00000000LL) == 0x10800000000LL))
+ {
+ /* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */
+ int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
+ | ((instr & 0x001f8000000LL) >> 20)
+ | ((instr & 0x000000fe000LL) >> 13));
+ int rM = (int) ((instr & 0x00007f00000LL) >> 20);
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && rN == 2 && imm == 0 && rM == 12 && fp_reg == 0)
+ {
+ /* mov r2, r12 - beginning of leaf routine */
+ fp_reg = rN;
+ frameless = 1;
+ last_prologue_pc = next_pc;
+ }
+ }
+
+ /* If we don't recognize a regular function or leaf routine, we are
+ done. */
+ if (!fp_reg)
+ {
+ pc = lim_pc;
+ if (trust_limit)
+ last_prologue_pc = lim_pc;
+ }
}
/* Loop, looking for prologue instructions, keeping track of
@@ -882,6 +912,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
{
/* Exit loop upon hitting a non-nop branch instruction
or a predicated instruction. */
+ if (trust_limit)
+ lim_pc = pc;
break;
}
else if (it == I && ((instr & 0x1eff8000000LL) == 0x00188000000LL))
@@ -941,6 +973,20 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
spill_reg = rN;
last_prologue_pc = next_pc;
}
+ else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM] &&
+ rN < 256 && imm == 0)
+ {
+ /* mov rN, rM where rM is an input register */
+ reg_contents[rN] = rM;
+ last_prologue_pc = next_pc;
+ }
+ else if (frameless && qp == 0 && rN == fp_reg && imm == 0 &&
+ rM == 2)
+ {
+ /* mov r12, r2 */
+ last_prologue_pc = next_pc;
+ break;
+ }
}
else if (it == M
&& ( ((instr & 0x1efc0000000LL) == 0x0eec0000000LL)
@@ -1006,6 +1052,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
int rN = (int) ((instr & 0x00007f00000LL) >> 20);
int rM = (int) ((instr & 0x000000fe000LL) >> 13);
int qp = (int) (instr & 0x0000000003fLL);
+ int indirect = rM < 256 ? reg_contents[rM] : 0;
if (qp == 0 && rN == spill_reg && spill_addr != 0
&& (rM == unat_save_reg || rM == pr_save_reg))
{
@@ -1040,6 +1087,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
instores[rM-32] = 1;
last_prologue_pc = next_pc;
}
+ else if (qp == 0 && 32 <= indirect && indirect < 40 &&
+ !instores[indirect-32])
+ {
+ /* Allow an indirect store of an input register. */
+ instores[indirect-32] = 1;
+ last_prologue_pc = next_pc;
+ }
}
else if (it == M && ((instr & 0x1ff08000000LL) == 0x08c00000000LL))
{
@@ -1054,11 +1108,19 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
register is permitted. */
int rM = (int) ((instr & 0x000000fe000LL) >> 13);
int qp = (int) (instr & 0x0000000003fLL);
+ int indirect = rM < 256 ? reg_contents[rM] : 0;
if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32])
{
instores[rM-32] = 1;
last_prologue_pc = next_pc;
}
+ else if (qp == 0 && 32 <= indirect && indirect < 40 &&
+ !instores[indirect-32])
+ {
+ /* Allow an indirect store of an input register. */
+ instores[indirect-32] = 1;
+ last_prologue_pc = next_pc;
+ }
}
else if (it == M && ((instr & 0x1ff88000000LL) == 0x0cc80000000LL))
{
@@ -1147,6 +1209,10 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
get_frame_extra_info (frame)->fp_reg = fp_reg;
}
+ /* Try and trust the lim_pc value whenever possible. */
+ if (trust_limit && lim_pc >= last_prologue_pc)
+ return lim_pc;
+
return last_prologue_pc;
}
@@ -1239,13 +1305,13 @@ ia64_get_saved_register (char *raw_buffer,
if (regnum == SP_REGNUM && get_next_frame (frame))
{
/* Handle SP values for all frames but the topmost. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- get_frame_base (frame));
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_base (frame));
}
else if (regnum == IA64_BSP_REGNUM)
{
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- get_frame_extra_info (frame)->bsp);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_extra_info (frame)->bsp);
}
else if (regnum == IA64_VFP_REGNUM)
{
@@ -1255,7 +1321,7 @@ ia64_get_saved_register (char *raw_buffer,
still provide a value since we know the size of the frame */
CORE_ADDR vfp = (get_frame_base (frame)
+ get_frame_extra_info (frame)->mem_stack_frame_size);
- store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
{
@@ -1338,7 +1404,7 @@ ia64_get_saved_register (char *raw_buffer,
{
pc = read_pc ();
}
- store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc);
}
else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM)
{
@@ -1769,8 +1835,8 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr)
if (global_pointer == 0)
global_pointer = read_register (IA64_GR1_REGNUM);
- store_address (buf, 8, faddr);
- store_address (buf + 8, 8, global_pointer);
+ store_unsigned_integer (buf, 8, faddr);
+ store_unsigned_integer (buf + 8, 8, global_pointer);
write_memory (fdesc, buf, 16);
}
@@ -1862,9 +1928,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
char val_buf[8];
- store_address (val_buf, 8,
- find_func_descr (extract_address (VALUE_CONTENTS (arg), 8),
- &funcdescaddr));
+ store_unsigned_integer (val_buf, 8,
+ find_func_descr (extract_address (VALUE_CONTENTS (arg), 8),
+ &funcdescaddr));
if (slotnum < rseslots)
write_memory (rse_address_add (bsp, slotnum), val_buf, 8);
else
@@ -1920,9 +1986,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Store the struct return value in r8 if necessary. */
if (struct_return)
{
- store_address (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)],
- REGISTER_RAW_SIZE (IA64_GR8_REGNUM),
- struct_addr);
+ store_unsigned_integer (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)],
+ REGISTER_RAW_SIZE (IA64_GR8_REGNUM),
+ struct_addr);
}
/* Sync gdb's idea of what the registers are with the target. */
@@ -2176,7 +2242,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, ia64_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 8);
- set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
+ set_gdbarch_deprecated_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
set_gdbarch_register_byte (gdbarch, ia64_register_byte);
set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
index 63ca71e6bc6..76354954443 100644
--- a/gdb/irix4-nat.c
+++ b/gdb/irix4-nat.c
@@ -178,7 +178,7 @@ static void
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- if (core_reg_size != REGISTER_BYTES)
+ if (core_reg_size != DEPRECATED_REGISTER_BYTES)
{
warning ("wrong size gregset struct in core file");
return;
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 9e4f2100f66..6128a04a450 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -196,7 +196,7 @@ static void
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- if (core_reg_size == REGISTER_BYTES)
+ if (core_reg_size == DEPRECATED_REGISTER_BYTES)
{
memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
}
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 565881d9142..7fe020d5ae6 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -1235,7 +1235,7 @@ push_variable (name)
char *tmp = copy_name (name);
int is_a_field_of_this = 0;
struct symbol *sym;
- sym = lookup_symbol (tmp, expression_context_block, VAR_NAMESPACE,
+ sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN,
&is_a_field_of_this, (struct symtab **) NULL);
if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
{
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index a44452b29b5..a2a44f0543e 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -170,7 +170,7 @@ add_class_symbol (struct type *type, CORE_ADDR addr)
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
/* SYMBOL_VALUE (sym) = valu; */
SYMBOL_TYPE (sym) = type;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
SYMBOL_VALUE_ADDRESS (sym) = addr;
return sym;
}
@@ -180,7 +180,7 @@ struct type *
java_lookup_class (char *name)
{
struct symbol *sym;
- sym = lookup_symbol (name, expression_context_block, STRUCT_NAMESPACE,
+ sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN,
(int *) 0, (struct symtab **) NULL);
if (sym != NULL)
return SYMBOL_TYPE (sym);
@@ -588,7 +588,7 @@ get_java_object_type (void)
if (java_object_type == NULL)
{
struct symbol *sym;
- sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_NAMESPACE,
+ sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_DOMAIN,
(int *) 0, (struct symtab **) NULL);
if (sym == NULL)
error ("cannot find java.lang.Object");
@@ -1063,6 +1063,8 @@ const struct language_defn java_language_defn =
java_val_print, /* Print a value using appropriate syntax */
java_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
java_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index f25cd09905f..8620175bbba 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -301,7 +301,6 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
fprintf_filtered (stream, "<No data fields>");
else
{
- extern int inspect_it;
int fields_seen = 0;
for (i = n_baseclasses; i < len; i++)
diff --git a/gdb/language.c b/gdb/language.c
index 0a650940444..eb203dc587c 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -935,7 +935,7 @@ lang_bool_type (void)
switch (current_language->la_language)
{
case language_fortran:
- sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL);
+ sym = lookup_symbol ("logical", NULL, VAR_DOMAIN, NULL, NULL);
if (sym)
{
type = SYMBOL_TYPE (sym);
@@ -946,9 +946,9 @@ lang_bool_type (void)
case language_cplus:
case language_pascal:
if (current_language->la_language==language_cplus)
- {sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);}
+ {sym = lookup_symbol ("bool", NULL, VAR_DOMAIN, NULL, NULL);}
else
- {sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);}
+ {sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL);}
if (sym)
{
type = SYMBOL_TYPE (sym);
@@ -957,7 +957,7 @@ lang_bool_type (void)
}
return builtin_type_bool;
case language_java:
- sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);
+ sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL);
if (sym)
{
type = SYMBOL_TYPE (sym);
@@ -1479,6 +1479,8 @@ const struct language_defn unknown_language_defn =
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
unk_lang_trampoline, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
unk_lang_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -1511,6 +1513,8 @@ const struct language_defn auto_language_defn =
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
unk_lang_trampoline, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
unk_lang_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -1542,6 +1546,8 @@ const struct language_defn local_language_defn =
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
unk_lang_trampoline, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
unk_lang_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/language.h b/gdb/language.h
index f55c9f0a2f9..a1a73a575e9 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -211,6 +211,27 @@ struct language_defn
if it isn't a language tramp for this language. */
CORE_ADDR (*skip_trampoline) (CORE_ADDR pc);
+ /* Now come some hooks for lookup_symbol. */
+
+ /* If this is non-NULL, lookup_symbol will do the 'field_of_this'
+ check, using this function to find the value of this. */
+
+ /* FIXME: carlton/2003-05-19: Audit all the language_defn structs
+ to make sure we're setting this appropriately: I'm sure it
+ could be NULL in more languages. */
+
+ struct value *(*la_value_of_this) (int complain);
+
+ /* This is a function that lookup_symbol will call when it gets to
+ the part of symbol lookup where C looks up static and global
+ variables. */
+
+ struct symbol *(*la_lookup_symbol_nonlocal) (const char *,
+ const char *,
+ const struct block *,
+ const domain_enum,
+ struct symtab **);
+
/* Return demangled language symbol, or NULL. */
char *(*la_demangle) (const char *mangled, int options);
diff --git a/gdb/linespec.c b/gdb/linespec.c
index ea52a803620..bda41c78940 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -194,7 +194,7 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr)
the class, then the loop can't do any good. */
if (class_name
&& (lookup_symbol (class_name, (struct block *) NULL,
- STRUCT_NAMESPACE, (int *) NULL,
+ STRUCT_DOMAIN, (int *) NULL,
(struct symtab **) NULL)))
{
int method_counter;
@@ -255,7 +255,7 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr)
continue;
sym_arr[i1] = lookup_symbol (phys_name,
- NULL, VAR_NAMESPACE,
+ NULL, VAR_DOMAIN,
(int *) NULL,
(struct symtab **) NULL);
if (sym_arr[i1])
@@ -301,7 +301,7 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr)
/* If this method is actually defined, include it in the
list. */
sym_arr[i1] = lookup_symbol (phys_name,
- NULL, VAR_NAMESPACE,
+ NULL, VAR_DOMAIN,
(int *) NULL,
(struct symtab **) NULL);
if (sym_arr[i1])
@@ -682,7 +682,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
copy = (char *) alloca (p - *argptr + 1);
memcpy (copy, *argptr, p - *argptr);
copy[p - *argptr] = '\000';
- sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
+ sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab);
if (sym)
{
*argptr = (*p == '\'') ? p + 1 : p;
@@ -1214,7 +1214,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
/* 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);
+ sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab);
if (sym)
return symbol_found (funfirstline, canonical, copy, sym,
NULL, sym_symtab);
@@ -1253,7 +1253,7 @@ lookup_prefix_sym (char **argptr, char *p)
p++;
*argptr = p;
- return lookup_symbol (copy, 0, STRUCT_NAMESPACE, 0,
+ return lookup_symbol (copy, 0, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
}
@@ -1343,7 +1343,7 @@ collect_methods (char *copy, struct type *t,
sym_arr[i1] =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index),
- NULL, VAR_NAMESPACE, (int *) NULL,
+ NULL, VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym_arr[i1])
i1++;
@@ -1521,7 +1521,7 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
convenience variable. */
/* Look up entire name as a symbol first. */
- sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
+ sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab);
file_symtab = (struct symtab *) 0;
need_canonical = 1;
/* Symbol was found --> jump to normal symbol processing. */
@@ -1579,7 +1579,7 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab),
STATIC_BLOCK)
: get_selected_block (0)),
- VAR_NAMESPACE, 0, &sym_symtab);
+ VAR_DOMAIN, 0, &sym_symtab);
if (sym != NULL)
return symbol_found (funfirstline, canonical, copy, sym,
@@ -1631,7 +1631,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy,
{
struct blockvector *bv = BLOCKVECTOR (sym_symtab);
struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL)
+ if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL)
build_canonical_line_spec (values.sals, copy, canonical);
}
return values;
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index b318bcc7915..37cf694b879 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -541,7 +541,7 @@ block : fblock
fblock : BLOCKNAME
{ struct symbol *sym
= lookup_symbol (copy_name ($1), expression_context_block,
- VAR_NAMESPACE, 0, NULL);
+ VAR_DOMAIN, 0, NULL);
$$ = sym;}
;
@@ -550,7 +550,7 @@ fblock : BLOCKNAME
fblock : block COLONCOLON BLOCKNAME
{ struct symbol *tem
= lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
+ VAR_DOMAIN, 0, NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.",
copy_name ($3));
@@ -574,7 +574,7 @@ variable: INTERNAL_VAR
variable: block COLONCOLON NAME
{ struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
+ VAR_DOMAIN, 0, NULL);
if (sym == 0)
error ("No symbol \"%s\" in specified context.",
copy_name ($3));
@@ -593,7 +593,7 @@ variable: NAME
sym = lookup_symbol (copy_name ($1),
expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&is_a_field_of_this,
NULL);
if (sym)
@@ -1018,7 +1018,7 @@ yylex ()
if (lookup_partial_symtab (tmp))
return BLOCKNAME;
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE, 0, NULL);
+ VAR_DOMAIN, 0, NULL);
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
return BLOCKNAME;
if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 4932cdfebd4..528484f0f27 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -116,7 +116,6 @@ m2_printstr (struct ui_file *stream, char *string, unsigned int length,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- extern int inspect_it;
if (length == 0)
{
@@ -427,6 +426,8 @@ const struct language_defn m2_language_defn =
m2_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"%loB", "", "o", "B"}, /* Octal format info */
diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c
index 93ef57a5f20..9e3f93b94aa 100644
--- a/gdb/m3-nat.c
+++ b/gdb/m3-nat.c
@@ -2434,7 +2434,7 @@
// OBSOLETE
// OBSOLETE sym = lookup_symbol (name,
// OBSOLETE (struct block *) NULL,
-// OBSOLETE VAR_NAMESPACE,
+// OBSOLETE VAR_DOMAIN,
// OBSOLETE (int *) NULL,
// OBSOLETE (struct symtab **) NULL);
// OBSOLETE
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index fb174206e2c..5d6e51e756b 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1374,7 +1374,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_deprecated_fp_regnum (gdbarch, SOFT_FP_REGNUM);
set_gdbarch_register_name (gdbarch, m68hc11_register_name);
set_gdbarch_deprecated_register_size (gdbarch, 2);
- set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
+ set_gdbarch_deprecated_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type);
set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index aabb13ab597..087d0bb2633 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -29,6 +29,7 @@
#include "inferior.h"
#include "regcache.h"
#include "arch-utils.h"
+#include "osabi.h"
#include "m68k-tdep.h"
@@ -1029,7 +1030,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_byte (gdbarch, m68k_register_byte);
set_gdbarch_num_regs (gdbarch, 29);
set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
- set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
+ set_gdbarch_deprecated_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM);
set_gdbarch_deprecated_fp_regnum (gdbarch, M68K_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM);
@@ -1052,6 +1053,9 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
return gdbarch;
}
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index afd2d2d5011..8b9193d2cc3 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -1,6 +1,6 @@
/* Motorola m68k target-dependent support for GNU/Linux.
- Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation,
+ Copyright 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation,
Inc.
This file is part of GDB.
@@ -24,7 +24,10 @@
#include "gdbcore.h"
#include "frame.h"
#include "target.h"
-
+#include "gdb_string.h"
+#include "gdbtypes.h"
+#include "osabi.h"
+#include "m68k-tdep.h"
/* Check whether insn1 and insn2 are parts of a signal trampoline. */
@@ -66,8 +69,8 @@ m68k_linux_in_sigtramp (CORE_ADDR pc)
if (IS_RT_SIGTRAMP (insn0, insn1))
return 2;
- insn0 = (insn0 << 16) | (insn1 >> 16);
- insn1 = (insn1 << 16) | (insn2 >> 16);
+ insn0 = ((insn0 << 16) & 0xffffffff) | (insn1 >> 16);
+ insn1 = ((insn1 << 16) & 0xffffffff) | (insn2 >> 16);
if (IS_SIGTRAMP (insn0, insn1))
return 1;
if (IS_RT_SIGTRAMP (insn0, insn1))
@@ -93,9 +96,9 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
/* Get sigcontext address, it is the third parameter on the stack. */
- if (frame->next)
+ if (get_next_frame (frame))
sigcontext_addr
- = read_memory_unsigned_integer (FRAME_ARGS_ADDRESS (frame->next)
+ = read_memory_unsigned_integer (get_frame_base (get_next_frame (frame))
+ FRAME_ARGS_SKIP
+ sigcontext_offs,
ptrbytes);
@@ -107,7 +110,7 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
/* Don't cause a memory_error when accessing sigcontext in case the
stack layout has changed or the stack is corrupt. */
- if (m68k_linux_in_sigtramp (frame->pc) == 2)
+ if (m68k_linux_in_sigtramp (get_frame_pc (frame)) == 2)
target_read_memory (sigcontext_addr + UCONTEXT_PC_OFFSET, buf, ptrbytes);
else
target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
@@ -116,11 +119,89 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
/* Return the saved program counter for FRAME. */
-CORE_ADDR
+static CORE_ADDR
m68k_linux_frame_saved_pc (struct frame_info *frame)
{
if (get_frame_type (frame) == SIGTRAMP_FRAME)
return m68k_linux_sigtramp_saved_pc (frame);
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
+}
+
+/* The following definitions are appropriate when using the ELF
+ format, where floating point values are returned in fp0, pointer
+ values in a0 and other values in d0. */
+
+/* Extract from an array REGBUF containing the (raw) register state a
+ function return value of type TYPE, and copy that, in virtual
+ format, into VALBUF. */
+
+static void
+m68k_linux_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, type,
+ regbuf + REGISTER_BYTE (FP0_REGNUM),
+ valbuf);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ memcpy (valbuf, regbuf + REGISTER_BYTE (M68K_A0_REGNUM),
+ TYPE_LENGTH (type));
+ else
+ memcpy (valbuf,
+ regbuf + (TYPE_LENGTH (type) >= 4 ? 0 : 4 - TYPE_LENGTH (type)),
+ TYPE_LENGTH (type));
+}
+
+/* Write into appropriate registers a function return value of type
+ TYPE, given in virtual format. */
+
+static void
+m68k_linux_store_return_value (struct type *type, char *valbuf)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)];
+ REGISTER_CONVERT_TO_RAW (type, FP0_REGNUM, valbuf, raw_buffer);
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ raw_buffer, TYPE_LENGTH (type));
+ }
+ else
+ {
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM),
+ valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (type));
+ }
+}
+
+/* Extract from an array REGBUF containing the (raw) register state
+ the address in which a function should return its structure value,
+ as a CORE_ADDR. */
+
+static CORE_ADDR
+m68k_linux_extract_struct_value_address (char *regbuf)
+{
+ return *(CORE_ADDR *) (regbuf + REGISTER_BYTE (M68K_A0_REGNUM));
+}
+
+static void
+m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ set_gdbarch_deprecated_frame_saved_pc (gdbarch,
+ m68k_linux_frame_saved_pc);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ m68k_linux_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch,
+ m68k_linux_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
+ m68k_linux_extract_struct_value_address);
+}
+
+void
+_initialize_m68k_linux_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_LINUX,
+ m68k_linux_init_abi);
}
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 484c1ec9d22..ea97ec297e4 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -1110,7 +1110,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_virtual_size (gdbarch, mcore_register_size);
set_gdbarch_register_raw_size (gdbarch, mcore_register_size);
set_gdbarch_register_byte (gdbarch, mcore_register_byte);
- set_gdbarch_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS);
+ set_gdbarch_deprecated_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS);
set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS);
set_gdbarch_pc_regnum (gdbarch, 64);
set_gdbarch_sp_regnum (gdbarch, 0);
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 84b1afa5a7b..379a3636bbe 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -295,7 +295,7 @@ static struct blockvector *new_bvect (int);
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
int, char *);
-static struct symbol *mylookup_symbol (char *, struct block *, namespace_enum,
+static struct symbol *mylookup_symbol (char *, struct block *, domain_enum,
enum address_class);
static struct block *shrink_block (struct block *, struct symtab *);
@@ -691,7 +691,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_VALUE (s) = svalue;
data: /* Common code for symbols describing data */
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = class;
add_symbol (s, b);
@@ -714,7 +714,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
name = "this"; /* FIXME, not alloc'd in obstack */
s = new_symbol (name);
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
switch (sh->sc)
{
case scRegister:
@@ -743,7 +743,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case stLabel: /* label, goes into current block */
s = new_symbol (name);
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; /* so that it can be used */
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */
SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
SYMBOL_TYPE (s) = mdebug_type_int;
@@ -785,7 +785,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
break;
}
s = new_symbol (name);
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_BLOCK;
/* Type of the return value */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
@@ -1111,7 +1111,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
&current_objfile->symbol_obstack);
SYMBOL_CLASS (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
- SYMBOL_NAMESPACE (enum_sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
SYMBOL_VALUE (enum_sym) = tsym.value;
if (SYMBOL_VALUE (enum_sym) < 0)
unsigned_enum = 0;
@@ -1141,7 +1141,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
}
s = new_symbol (name);
- SYMBOL_NAMESPACE (s) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (s) = STRUCT_DOMAIN;
SYMBOL_CLASS (s) = LOC_TYPEDEF;
SYMBOL_VALUE (s) = 0;
SYMBOL_TYPE (s) = t;
@@ -1197,7 +1197,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
/* Make up special symbol to contain procedure specific info */
s = new_symbol (MIPS_EFI_SYMBOL_NAME);
- SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE;
+ SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
SYMBOL_TYPE (s) = mdebug_type_void;
e = ((struct mips_extra_func_info *)
@@ -1342,7 +1342,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (has_opaque_xref (cur_fdr, sh))
break;
s = new_symbol (name);
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_TYPEDEF;
SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
SYMBOL_TYPE (s) = t;
@@ -1925,19 +1925,19 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
the same name exists, lookup_symbol will eventually read in the symtab
for the global function and clobber cur_fdr. */
FDR *save_cur_fdr = cur_fdr;
- s = lookup_symbol (sh_name, NULL, VAR_NAMESPACE, 0, NULL);
+ s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0, NULL);
cur_fdr = save_cur_fdr;
#else
s = mylookup_symbol
(sh_name,
BLOCKVECTOR_BLOCK (BLOCKVECTOR (search_symtab), STATIC_BLOCK),
- VAR_NAMESPACE,
+ VAR_DOMAIN,
LOC_BLOCK);
#endif
}
else
s = mylookup_symbol (sh_name, top_stack->cur_block,
- VAR_NAMESPACE, LOC_BLOCK);
+ VAR_DOMAIN, LOC_BLOCK);
if (s != 0)
{
@@ -1951,7 +1951,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
#else
/* FIXME -- delete. We can't do symbol allocation now; it's all done. */
s = new_symbol (sh_name);
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_BLOCK;
/* Donno its type, hope int is ok */
SYMBOL_TYPE (s) = lookup_function_type (mdebug_type_int);
@@ -1969,7 +1969,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
#endif
}
- i = mylookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, LOC_CONST);
+ i = mylookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, LOC_CONST);
if (i)
{
@@ -3001,7 +3001,7 @@ parse_partial_symbols (struct objfile *objfile)
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, sh.value,
psymtab_language, objfile);
@@ -3011,7 +3011,7 @@ parse_partial_symbols (struct objfile *objfile)
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, sh.value,
psymtab_language, objfile);
@@ -3029,7 +3029,7 @@ parse_partial_symbols (struct objfile *objfile)
&& namestring[0] != ' '))
{
add_psymbol_to_list (namestring, p - namestring,
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
sh.value, 0,
psymtab_language, objfile);
@@ -3037,7 +3037,7 @@ parse_partial_symbols (struct objfile *objfile)
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
sh.value, 0,
psymtab_language, objfile);
@@ -3053,7 +3053,7 @@ parse_partial_symbols (struct objfile *objfile)
// OBSOLETE {
// OBSOLETE /* Also a typedef with the same name. */
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
-// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
+// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF,
// OBSOLETE &objfile->static_psymbols,
// OBSOLETE sh.value, 0,
// OBSOLETE psymtab_language, objfile);
@@ -3065,7 +3065,7 @@ parse_partial_symbols (struct objfile *objfile)
if (p != namestring) /* a name is there, not just :T... */
{
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
sh.value, 0,
psymtab_language, objfile);
@@ -3127,7 +3127,7 @@ parse_partial_symbols (struct objfile *objfile)
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
add_psymbol_to_list (p, q - p,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
0, psymtab_language, objfile);
/* Point past the name. */
@@ -3144,7 +3144,7 @@ parse_partial_symbols (struct objfile *objfile)
case 'c':
/* Constant, e.g. from "const" in Pascal. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, sh.value,
0, psymtab_language, objfile);
continue;
@@ -3161,7 +3161,7 @@ parse_partial_symbols (struct objfile *objfile)
}
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, sh.value,
psymtab_language, objfile);
@@ -3182,7 +3182,7 @@ parse_partial_symbols (struct objfile *objfile)
}
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, sh.value,
psymtab_language, objfile);
@@ -3417,12 +3417,12 @@ parse_partial_symbols (struct objfile *objfile)
symbol table. */
if (sh.st == stProc)
add_psymbol_to_list (name, strlen (name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, sh.value, psymtab_language, objfile);
else
add_psymbol_to_list (name, strlen (name),
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, sh.value, psymtab_language, objfile);
@@ -3491,7 +3491,7 @@ parse_partial_symbols (struct objfile *objfile)
&& sh.index != cur_sdx + 2)
{
add_psymbol_to_list (name, strlen (name),
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
0, (CORE_ADDR) 0,
psymtab_language, objfile);
@@ -3532,7 +3532,7 @@ parse_partial_symbols (struct objfile *objfile)
}
/* Use this gdb symbol */
add_psymbol_to_list (name, strlen (name),
- VAR_NAMESPACE, class,
+ VAR_DOMAIN, class,
&objfile->static_psymbols,
0, sh.value, psymtab_language, objfile);
skip:
@@ -3608,7 +3608,7 @@ parse_partial_symbols (struct objfile *objfile)
}
name = debug_info->ssext + psh->iss;
add_psymbol_to_list (name, strlen (name),
- VAR_NAMESPACE, class,
+ VAR_DOMAIN, class,
&objfile->global_psymbols,
0, svalue,
psymtab_language, objfile);
@@ -3778,7 +3778,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
/* Note that the value doesn't matter for enum constants
in psymtabs, just in symtabs. */
add_psymbol_to_list (name, strlen (name),
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
(CORE_ADDR) 0, psymtab_language, objfile);
ext_sym += external_sym_size;
@@ -3971,7 +3971,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
struct symbol *s = new_symbol (MIPS_EFI_SYMBOL_NAME);
memset (e, 0, sizeof (struct mips_extra_func_info));
- SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE;
+ SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
SYMBOL_TYPE (s) = mdebug_type_void;
SYMBOL_VALUE (s) = (long) e;
@@ -4455,7 +4455,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod
static struct symbol *
mylookup_symbol (char *name, register struct block *block,
- namespace_enum namespace, enum address_class class)
+ domain_enum domain, enum address_class class)
{
int i, inc;
struct symbol *sym;
@@ -4464,7 +4464,7 @@ mylookup_symbol (char *name, register struct block *block,
ALL_BLOCK_SYMBOLS (block, i, sym)
{
if (DEPRECATED_SYMBOL_NAME (sym)[0] == inc
- && SYMBOL_NAMESPACE (sym) == namespace
+ && SYMBOL_DOMAIN (sym) == domain
&& SYMBOL_CLASS (sym) == class
&& strcmp (DEPRECATED_SYMBOL_NAME (sym), name) == 0)
return sym;
@@ -4472,7 +4472,7 @@ mylookup_symbol (char *name, register struct block *block,
block = BLOCK_SUPERBLOCK (block);
if (block)
- return mylookup_symbol (name, block, namespace, class);
+ return mylookup_symbol (name, block, domain, class);
return 0;
}
@@ -4866,16 +4866,16 @@ fixup_sigtramp (void)
/* We have to handle the following cases here:
a) The Mips library has a sigtramp label within sigvec.
b) Irix has a _sigtramp which we want to use, but it also has sigvec. */
- s = lookup_symbol ("sigvec", 0, VAR_NAMESPACE, 0, NULL);
+ s = lookup_symbol ("sigvec", 0, VAR_DOMAIN, 0, NULL);
if (s != 0)
{
b0 = SYMBOL_BLOCK_VALUE (s);
- s = lookup_symbol ("sigtramp", b0, VAR_NAMESPACE, 0, NULL);
+ s = lookup_symbol ("sigtramp", b0, VAR_DOMAIN, 0, NULL);
}
if (s == 0)
{
/* No sigvec or no sigtramp inside sigvec, try _sigtramp. */
- s = lookup_symbol ("_sigtramp", 0, VAR_NAMESPACE, 0, NULL);
+ s = lookup_symbol ("_sigtramp", 0, VAR_DOMAIN, 0, NULL);
}
/* But maybe this program uses its own version of sigvec */
@@ -4901,7 +4901,7 @@ fixup_sigtramp (void)
* needed info. Note we make it a nested procedure of sigvec,
* which is the way the (assembly) code is actually written.
*/
- SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_BLOCK;
SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL,
st->objfile);
@@ -4945,7 +4945,7 @@ fixup_sigtramp (void)
current_objfile = st->objfile; /* Keep new_symbol happy */
s = new_symbol (MIPS_EFI_SYMBOL_NAME);
SYMBOL_VALUE (s) = (long) e;
- SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE;
+ SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
SYMBOL_TYPE (s) = mdebug_type_void;
current_objfile = NULL;
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index 9cf638e4c62..96750c8b8f6 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -24,7 +24,8 @@
#include "defs.h"
-/* This file is only useful if BREAKPOINT is set. If not, we punt. */
+/* This file is only useful if BREAKPOINT_FROM_PC is set. If not, we
+ punt. */
#include "symtab.h"
#include "breakpoint.h"
@@ -32,50 +33,6 @@
#include "target.h"
-/* Use the program counter to determine the contents and size
- of a breakpoint instruction. If no target-dependent macro
- BREAKPOINT_FROM_PC has been defined to implement this function,
- assume that the breakpoint doesn't depend on the PC, and
- use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros.
- Return a pointer to a string of bytes that encode a breakpoint
- instruction, stores the length of the string to *lenptr,
- and optionally adjust the pc to point to the correct memory location
- for inserting the breakpoint. */
-
-const unsigned char *
-memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
-{
- /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
- breakpoint. On some machines, breakpoints are handled by the
- target environment and we don't have to worry about them here. */
-#ifdef BIG_BREAKPOINT
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- {
- static unsigned char big_break_insn[] = BIG_BREAKPOINT;
- *lenptr = sizeof (big_break_insn);
- return big_break_insn;
- }
-#endif
-#ifdef LITTLE_BREAKPOINT
- if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
- {
- static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
- *lenptr = sizeof (little_break_insn);
- return little_break_insn;
- }
-#endif
-#ifdef BREAKPOINT
- {
- static unsigned char break_insn[] = BREAKPOINT;
- *lenptr = sizeof (break_insn);
- return break_insn;
- }
-#endif
- *lenptr = 0;
- return NULL;
-}
-
-
/* Insert a breakpoint on targets that don't have any better breakpoint
support. We read the contents of the target location and stash it,
then overwrite it with a breakpoint instruction. ADDR is the target
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 1580d1fc997..3b0124c2c3d 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,16 @@
+2003-05-16 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (mi_setup_architecture_data):
+
+2003-05-12 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
+ VAR_DOMAIN.
+
+2003-05-11 Andrew Cagney <cagney@redhat.com>
+
+ * mi-symbol-cmds.c: Rename "mi-cmd-symbol.c", avoid 8.3 problem.
+
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 0a76291878f..1f6a9a1aa73 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -280,7 +280,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
struct symbol *sym2;
if (!locals)
sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
- block, VAR_NAMESPACE,
+ block, VAR_DOMAIN,
(int *) NULL,
(struct symtab **) NULL);
else
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 6158c8ff439..0e9cb248a10 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1472,9 +1472,9 @@ mi_load_progress (const char *section_name,
void
mi_setup_architecture_data (void)
{
- /* don't trust REGISTER_BYTES to be zero. */
- old_regs = xmalloc (REGISTER_BYTES + 1);
- memset (old_regs, 0, REGISTER_BYTES + 1);
+ /* don't trust DEPRECATED_REGISTER_BYTES to be zero. */
+ old_regs = xmalloc (DEPRECATED_REGISTER_BYTES + 1);
+ memset (old_regs, 0, DEPRECATED_REGISTER_BYTES + 1);
}
void
diff --git a/gdb/mi/mi-cmd-symbol.c b/gdb/mi/mi-symbol-cmds.c
index 1d86d21d517..1d86d21d517 100644
--- a/gdb/mi/mi-cmd-symbol.c
+++ b/gdb/mi/mi-symbol-cmds.c
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 1f6cb388800..fa7209d2bc6 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -189,7 +189,15 @@ lookup_minimal_symbol (register const char *name, const char *sfile,
while (msymbol != NULL && found_symbol == NULL)
{
- if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name))
+ /* FIXME: carlton/2003-02-27: This is an unholy
+ mixture of linkage names and natural names. If
+ you want to test the linkage names with strcmp,
+ do that. If you want to test the natural names
+ with strcmp_iw, use SYMBOL_MATCHES_NATURAL_NAME. */
+ if (strcmp (DEPRECATED_SYMBOL_NAME (msymbol), (name)) == 0
+ || (SYMBOL_DEMANGLED_NAME (msymbol) != NULL
+ && strcmp_iw (SYMBOL_DEMANGLED_NAME (msymbol),
+ (name)) == 0))
{
switch (MSYMBOL_TYPE (msymbol))
{
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index 1a29c3e317a..e370534f38c 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -51,16 +51,19 @@
/* Map gdb internal register number to ptrace ``address''.
These ``addresses'' are defined in DECstation <sys/ptrace.h> */
-#define REGISTER_PTRACE_ADDR(regno) \
- (regno < 32 ? GPR_BASE + regno \
- : regno == PC_REGNUM ? PC \
- : regno == CAUSE_REGNUM ? CAUSE \
- : regno == HI_REGNUM ? MMHI \
- : regno == LO_REGNUM ? MMLO \
- : regno == FCRCS_REGNUM ? FPC_CSR \
- : regno == FCRIR_REGNUM ? FPC_EIR \
- : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \
- : 0)
+static int
+register_ptrace_addr (int regno)
+{
+ return (regno < 32 ? GPR_BASE + regno
+ : regno == PC_REGNUM ? PC
+ : regno == CAUSE_REGNUM ? CAUSE
+ : regno == HI_REGNUM ? MMHI
+ : regno == LO_REGNUM ? MMLO
+ : regno == FCRCS_REGNUM ? FPC_CSR
+ : regno == FCRIR_REGNUM ? FPC_EIR
+ : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM)
+ : 0);
+}
static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
@@ -79,7 +82,7 @@ fetch_inferior_registers (int regno)
for (regno = 1; regno < NUM_REGS; regno++)
{
- regaddr = REGISTER_PTRACE_ADDR (regno);
+ regaddr = register_ptrace_addr (regno);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
{
*(int *) &buf[i] = ptrace (PT_READ_U, PIDGET (inferior_ptid),
@@ -111,7 +114,7 @@ store_inferior_registers (int regno)
|| regno == FCRIR_REGNUM || regno == DEPRECATED_FP_REGNUM
|| (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM))
return;
- regaddr = REGISTER_PTRACE_ADDR (regno);
+ regaddr = register_ptrace_addr (regno);
errno = 0;
ptrace (PT_WRITE_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr,
read_register (regno));
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index bf19ed8d999..23a5911f1c6 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -2389,7 +2389,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
return NULL;
}
- sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, 0, NULL);
+ sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0, NULL);
/* If we never found a PDR for this function in symbol reading, then
examine prologues to find the information. */
@@ -2767,7 +2767,7 @@ mips_eabi_push_arguments (int nargs,
if (len > MIPS_SAVED_REGSIZE
&& (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
{
- store_address (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg));
+ store_unsigned_integer (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg));
typecode = TYPE_CODE_PTR;
len = MIPS_SAVED_REGSIZE;
val = valbuf;
@@ -4561,7 +4561,7 @@ return_value_location (struct type *valtype,
static void
mips_eabi_extract_return_value (struct type *valtype,
- char regbuf[REGISTER_BYTES],
+ char regbuf[],
char *valbuf)
{
struct return_value_word lo;
@@ -4580,7 +4580,7 @@ mips_eabi_extract_return_value (struct type *valtype,
static void
mips_o64_extract_return_value (struct type *valtype,
- char regbuf[REGISTER_BYTES],
+ char regbuf[],
char *valbuf)
{
struct return_value_word lo;
@@ -5119,19 +5119,6 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
return print_insn_little_mips (memaddr, info);
}
-/* Old-style breakpoint macros.
- The IDT board uses an unusual breakpoint value, and sometimes gets
- confused when it sees the usual MIPS breakpoint instruction. */
-
-#define BIG_BREAKPOINT {0, 0x5, 0, 0xd}
-#define LITTLE_BREAKPOINT {0xd, 0, 0x5, 0}
-#define PMON_BIG_BREAKPOINT {0, 0, 0, 0xd}
-#define PMON_LITTLE_BREAKPOINT {0xd, 0, 0, 0}
-#define IDT_BIG_BREAKPOINT {0, 0, 0x0a, 0xd}
-#define IDT_LITTLE_BREAKPOINT {0xd, 0x0a, 0, 0}
-#define MIPS16_BIG_BREAKPOINT {0xe8, 0xa5}
-#define MIPS16_LITTLE_BREAKPOINT {0xa5, 0xe8}
-
/* This function implements the BREAKPOINT_FROM_PC macro. It uses the program
counter value to determine whether a 16- or 32-bit breakpoint should be
used. It returns a pointer to a string of bytes that encode a breakpoint
@@ -5146,17 +5133,19 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (pc_is_mips16 (*pcptr))
{
- static unsigned char mips16_big_breakpoint[] =
- MIPS16_BIG_BREAKPOINT;
+ static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5};
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_big_breakpoint);
return mips16_big_breakpoint;
}
else
{
- static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
- static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT;
- static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT;
+ /* The IDT board uses an unusual breakpoint value, and
+ sometimes gets confused when it sees the usual MIPS
+ breakpoint instruction. */
+ static unsigned char big_breakpoint[] = {0, 0x5, 0, 0xd};
+ static unsigned char pmon_big_breakpoint[] = {0, 0, 0, 0xd};
+ static unsigned char idt_big_breakpoint[] = {0, 0, 0x0a, 0xd};
*lenptr = sizeof (big_breakpoint);
@@ -5174,19 +5163,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (pc_is_mips16 (*pcptr))
{
- static unsigned char mips16_little_breakpoint[] =
- MIPS16_LITTLE_BREAKPOINT;
+ static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8};
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_little_breakpoint);
return mips16_little_breakpoint;
}
else
{
- static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
- static unsigned char pmon_little_breakpoint[] =
- PMON_LITTLE_BREAKPOINT;
- static unsigned char idt_little_breakpoint[] =
- IDT_LITTLE_BREAKPOINT;
+ static unsigned char little_breakpoint[] = {0xd, 0, 0x5, 0};
+ static unsigned char pmon_little_breakpoint[] = {0xd, 0, 0, 0};
+ static unsigned char idt_little_breakpoint[] = {0xd, 0x0a, 0, 0};
*lenptr = sizeof (little_breakpoint);
@@ -5442,7 +5428,7 @@ mips_get_saved_register (char *raw_buffer,
/* Only MIPS_SAVED_REGSIZE bytes of GP registers are
saved. */
LONGEST val = read_memory_integer ((*addrp), MIPS_SAVED_REGSIZE);
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), val);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), val);
}
}
}
@@ -6138,8 +6124,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: BADVADDR_REGNUM = %d\n",
BADVADDR_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: BIG_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: CAUSE_REGNUM = %d\n",
CAUSE_REGNUM);
fprintf_unfiltered (file,
@@ -6170,10 +6154,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: HI_REGNUM = %d\n",
HI_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: IDT_BIG_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: IDT_LITTLE_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: IGNORE_HELPER_CALL # %s\n",
XSTRING (IGNORE_HELPER_CALL (PC)));
fprintf_unfiltered (file,
@@ -6188,8 +6168,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: LAST_EMBED_REGNUM = %d\n",
LAST_EMBED_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: LITTLE_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: LO_REGNUM = %d\n",
LO_REGNUM);
#ifdef MACHINE_CPROC_FP_OFFSET
@@ -6210,13 +6188,9 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n");
fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS16_BIG_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: MIPS16_INSTLEN = %d\n",
MIPS16_INSTLEN);
fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS16_LITTLE_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\n");
fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_EFI_SYMBOL_NAME = multi-arch!!\n");
@@ -6240,10 +6214,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: OP_LDGPR = used?\n");
fprintf_unfiltered (file,
- "mips_dump_tdep: PMON_BIG_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: PMON_LITTLE_BREAKPOINT = delete?\n");
- fprintf_unfiltered (file,
"mips_dump_tdep: PRID_REGNUM = %d\n",
PRID_REGNUM);
fprintf_unfiltered (file,
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 1d580342758..c7bc58c35fa 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1147,7 +1147,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_num_regs (gdbarch, num_regs);
set_gdbarch_register_name (gdbarch, register_name);
set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
+ set_gdbarch_deprecated_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size);
set_gdbarch_register_byte (gdbarch, mn10300_register_byte);
diff --git a/gdb/monitor.c b/gdb/monitor.c
index ede61bb6998..eabbbd938cc 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2098,7 +2098,7 @@ monitor_insert_breakpoint (CORE_ADDR addr, char *shadow)
addr = ADDR_BITS_REMOVE (addr);
/* Determine appropriate breakpoint size for this address. */
- bp = memory_breakpoint_from_pc (&addr, &bplen);
+ bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen);
for (i = 0; i < current_monitor->num_breakpoints; i++)
{
diff --git a/gdb/nlmread.c b/gdb/nlmread.c
index 10af4c5c88c..4e9c87d3ff0 100644
--- a/gdb/nlmread.c
+++ b/gdb/nlmread.c
@@ -200,7 +200,7 @@ nlm_symfile_read (struct objfile *objfile, int mainline)
stabsect_build_psymtabs (objfile, mainline, ".stab",
".stabstr", ".text");
- mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
+ mainsym = lookup_symbol (main_name (), NULL, VAR_DOMAIN, NULL, NULL);
if (mainsym
&& SYMBOL_CLASS (mainsym) == LOC_BLOCK)
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index ef2752d0b77..46c175c4b02 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -512,7 +512,7 @@ ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch)
set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32082);
set_gdbarch_register_name (gdbarch, ns32k_register_name_32082);
- set_gdbarch_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082);
+ set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082);
set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32082);
}
@@ -522,7 +522,7 @@ ns32k_gdbarch_init_32382 (struct gdbarch *gdbarch)
set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32382);
set_gdbarch_register_name (gdbarch, ns32k_register_name_32382);
- set_gdbarch_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382);
+ set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382);
set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32382);
}
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 5003ea069eb..94f156e571b 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -269,27 +269,20 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
nto_regset_t regset;
-
- nto_init_solib_absolute_prefix ();
-
- if (which == NTO_REG_GENERAL)
+
+/* See corelow.c:get_core_registers for values of WHICH. */
+ if (which == 0)
{
memcpy ((char *) &regset, core_reg_sect,
min (core_reg_size, sizeof (regset)));
nto_supply_gregset ((char *) &regset);
}
- else if (which == NTO_REG_FLOAT)
+ else if (which == 2)
{
memcpy ((char *) &regset, core_reg_sect,
min (core_reg_size, sizeof (regset)));
nto_supply_fpregset ((char *) &regset);
}
- else if (which == NTO_REG_ALT)
- {
- memcpy ((char *) &regset, core_reg_sect,
- min (core_reg_size, sizeof (regset)));
- nto_supply_altregset ((char *) &regset);
- }
}
void
diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y
index 002600de9cb..40dc5b8ab66 100644
--- a/gdb/objc-exp.y
+++ b/gdb/objc-exp.y
@@ -634,7 +634,7 @@ block : BLOCKNAME
block : block COLONCOLON name
{ struct symbol *tem
= lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.",
@@ -645,7 +645,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name
{ struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym == 0)
error ("No symbol \"%s\" in specified context.",
@@ -705,7 +705,7 @@ variable: qualified_name
sym =
lookup_symbol (name, (const struct block *) NULL,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym)
{
@@ -1659,7 +1659,7 @@ yylex ()
need_this = (int *) NULL;
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
need_this,
(struct symtab **) NULL);
/* Call lookup_symtab, not lookup_partial_symtab, in case there
@@ -1738,7 +1738,7 @@ yylex ()
tmp1[p - namestart] = '\0';
cur_sym = lookup_symbol (ncopy,
expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (cur_sym)
{
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 368e3366e0e..0b98a96b3e6 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -116,7 +116,7 @@ lookup_struct_typedef (char *name, struct block *block, int noerr)
{
register struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
if (sym == NULL)
@@ -372,7 +372,6 @@ objc_printstr (struct ui_file *stream, char *string,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- extern int inspect_it;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in
@@ -702,6 +701,8 @@ const struct language_defn objc_language_defn = {
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
objc_skip_trampoline, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
objc_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
@@ -1461,7 +1462,7 @@ char *find_imps (struct symtab *symtab, struct block *block,
if (tmp == NULL)
return NULL;
- sym = lookup_symbol (selector, block, VAR_NAMESPACE, 0, &sym_symtab);
+ sym = lookup_symbol (selector, block, VAR_DOMAIN, 0, &sym_symtab);
if (sym != NULL)
{
if (syms)
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 59e03b93e9b..e695ebef78f 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -667,7 +667,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
fixup_symbol_section (sym, objfile);
/* The RS6000 code from which this was taken skipped
- any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
+ any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN.
But I'm leaving out that test, on the theory that
they can't possibly pass the tests below. */
if ((SYMBOL_CLASS (sym) == LOC_LABEL
@@ -682,7 +682,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
/* Relocate Extra Function Info for ecoff. */
else if (SYMBOL_CLASS (sym) == LOC_CONST
- && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE
+ && SYMBOL_DOMAIN (sym) == LABEL_DOMAIN
&& strcmp (DEPRECATED_SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0)
ecoff_relocate_efi (sym, ANOFFSET (delta,
s->block_line_section));
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 896a06b539f..282d25a065d 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -559,7 +559,7 @@ block : BLOCKNAME
block : block COLONCOLON name
{ struct symbol *tem
= lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.",
@@ -570,7 +570,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name
{ struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym == 0)
error ("No symbol \"%s\" in specified context.",
@@ -607,7 +607,7 @@ variable: qualified_name
sym =
lookup_symbol (name, (const struct block *) NULL,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym)
{
@@ -1396,7 +1396,7 @@ yylex ()
static const char this_name[] = "this";
if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL))
return THIS;
}
@@ -1437,7 +1437,7 @@ yylex ()
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&is_a_field_of_this,
(struct symtab **) NULL);
/* second chance uppercased (as Free Pascal does). */
@@ -1454,7 +1454,7 @@ yylex ()
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&is_a_field_of_this,
(struct symtab **) NULL);
if (sym || is_a_field_of_this || is_a_field)
@@ -1484,7 +1484,7 @@ yylex ()
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&is_a_field_of_this,
(struct symtab **) NULL);
if (sym || is_a_field_of_this || is_a_field)
@@ -1581,7 +1581,7 @@ yylex ()
memcpy (tmp1, namestart, p - namestart);
tmp1[p - namestart] = '\0';
cur_sym = lookup_symbol (ncopy, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (cur_sym)
{
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 827fa0e22ea..59e196aa4b3 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -28,6 +28,7 @@
#include "language.h"
#include "p-lang.h"
#include "valprint.h"
+#include "value.h"
#include <ctype.h>
extern void _initialize_pascal_language (void);
@@ -161,7 +162,6 @@ pascal_printstr (struct ui_file *stream, char *string, unsigned int length,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- extern int inspect_it;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C
@@ -462,6 +462,8 @@ const struct language_defn pascal_language_defn =
pascal_val_print, /* Print a value using appropriate syntax */
pascal_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "%", "b", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 1f41422bd7c..84189dd2894 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -227,7 +227,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
if (msymbol != NULL)
wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
- VAR_NAMESPACE, &is_this_fld, &s);
+ VAR_DOMAIN, &is_this_fld, &s);
if (wsym)
{
@@ -755,7 +755,6 @@ pascal_object_print_value_fields (struct type *type, char *valaddr,
fprintf_filtered (stream, "<No data fields>");
else
{
- extern int inspect_it;
int fields_seen = 0;
if (dont_print_statmem == 0)
diff --git a/gdb/parse.c b/gdb/parse.c
index d4a6a051937..5db165ad4e0 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -472,7 +472,7 @@ write_dollar_variable (struct stoken str)
symbol table lookup performance is awful, to put it mildly. */
sym = lookup_symbol (copy_name (str), (struct block *) NULL,
- VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
+ VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
if (sym)
{
write_exp_elt_opcode (OP_VAR_VALUE);
@@ -647,17 +647,17 @@ parse_nested_classes_for_hpacc (char *name, int len, char **token,
if (!done)
{
/* More tokens to process, so this must be a class/namespace */
- sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
+ sym_class = lookup_symbol (prefix, 0, STRUCT_DOMAIN,
0, (struct symtab **) NULL);
}
else
{
/* No more tokens, so try as a variable first */
- sym_var = lookup_symbol (prefix, 0, VAR_NAMESPACE,
+ sym_var = lookup_symbol (prefix, 0, VAR_DOMAIN,
0, (struct symtab **) NULL);
/* If failed, try as class/namespace */
if (!sym_var)
- sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
+ sym_class = lookup_symbol (prefix, 0, STRUCT_DOMAIN,
0, (struct symtab **) NULL);
}
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 9894a5883e2..6e8216cdc22 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -180,7 +180,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
write_register (SP_REGNUM, sp);
/* write the backchain */
- store_address (old_sp_buf, 4, saved_sp);
+ store_unsigned_integer (old_sp_buf, 4, saved_sp);
write_memory (sp, old_sp_buf, 4);
argoffset = 8;
@@ -261,7 +261,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
|| TYPE_CODE (type) == TYPE_CODE_UNION)
{
write_memory (sp + structoffset, val, len);
- store_address (val_buf, 4, sp + structoffset);
+ store_unsigned_integer (val_buf, 4, sp + structoffset);
structoffset += round2 (len, 8);
}
else
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 018d7731548..11fd1df9468 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1076,7 +1076,7 @@ address_info (char *exp, int from_tty)
if (exp == 0)
error ("Argument required.");
- sym = lookup_symbol (exp, get_selected_block (0), VAR_NAMESPACE,
+ sym = lookup_symbol (exp, get_selected_block (0), VAR_DOMAIN,
&is_a_field_of_this, (struct symtab **) NULL);
if (sym == NULL)
{
@@ -1844,7 +1844,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
struct symbol *nsym;
nsym = lookup_symbol
(DEPRECATED_SYMBOL_NAME (sym),
- b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
+ b, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER)
{
/* There is a LOC_ARG/LOC_REGISTER pair. This means that
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index 2d4fe814c94..208b984a74b 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -574,16 +574,6 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
break;
default:
{
-#ifdef BREAKPOINT
- static unsigned char break_insn[] = BREAKPOINT;
-
- if (len == sizeof (break_insn) &&
- memcmp (arg, &break_insn, len) == 0)
- fprintf (procfs_file ? procfs_file : stdout,
- "write (<breakpoint at 0x%08lx>) \n",
- (unsigned long) lseek_offset);
- else
-#endif
if (rw_table[i].name)
fprintf (procfs_file ? procfs_file : stdout,
"write (%s) %s\n",
diff --git a/gdb/regcache.c b/gdb/regcache.c
index acf3044fa3c..09b48f01054 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -120,12 +120,13 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
}
/* Compute the real size of the register buffer. Start out by
- trusting REGISTER_BYTES, but then adjust it upwards should that
- be found to not be sufficient. */
- /* FIXME: cagney/2002-11-05: Instead of using REGISTER_BYTES, this
- code should, as is done in init_regcache_descr(), compute the
- total number of register bytes using the accumulated offsets. */
- descr->sizeof_cooked_registers = REGISTER_BYTES; /* OK use. */
+ trusting DEPRECATED_REGISTER_BYTES, but then adjust it upwards
+ should that be found to not be sufficient. */
+ /* FIXME: cagney/2002-11-05: Instead of using the macro
+ DEPRECATED_REGISTER_BYTES, this code should, as is done in
+ init_regcache_descr(), compute the total number of register bytes
+ using the accumulated offsets. */
+ descr->sizeof_cooked_registers = DEPRECATED_REGISTER_BYTES; /* OK */
for (i = 0; i < descr->nr_cooked_registers; i++)
{
long regend;
@@ -243,7 +244,7 @@ init_regcache_descr (struct gdbarch *gdbarch)
gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
#endif
}
- /* gdb_assert (descr->sizeof_raw_registers == REGISTER_BYTES (i)); */
+ /* gdb_assert (descr->sizeof_raw_registers == DEPRECATED_REGISTER_BYTES (i)); */
return descr;
}
@@ -499,12 +500,6 @@ deprecated_grub_regcache_for_registers (struct regcache *regcache)
return regcache->registers;
}
-char *
-deprecated_grub_regcache_for_register_valid (struct regcache *regcache)
-{
- return regcache->register_valid_p;
-}
-
/* Global structure containing the current regcache. */
/* FIXME: cagney/2002-05-11: The two global arrays registers[] and
deprecated_register_valid[] currently point into this structure. */
@@ -1424,7 +1419,7 @@ build_regcache (void)
current_regcache = regcache_xmalloc (current_gdbarch);
current_regcache->readonly_p = 0;
deprecated_registers = deprecated_grub_regcache_for_registers (current_regcache);
- deprecated_register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
+ deprecated_register_valid = current_regcache->register_valid_p;
}
static void
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 5d77095810b..f84820519af 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -196,7 +196,6 @@ extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache
parameterized with FRAME or REGCACHE. */
extern char *deprecated_grub_regcache_for_registers (struct regcache *);
-extern char *deprecated_grub_regcache_for_register_valid (struct regcache *);
extern void deprecated_read_register_gen (int regnum, char *myaddr);
extern void deprecated_write_register_gen (int regnum, char *myaddr);
extern void deprecated_read_register_bytes (int regbyte, char *myaddr,
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index 8df964771a2..ff568813856 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -80,11 +80,12 @@ FILE *log_file;
#endif
static int timeout = 30;
-/* Having this larger than 400 causes us to be incompatible with m68k-stub.c
- and i386-stub.c. Normally, no one would notice because it only matters
- for writing large chunks of memory (e.g. in downloads). Also, this needs
- to be more than 400 if required to hold the registers (see below, where
- we round it up based on REGISTER_BYTES). */
+/* Having this larger than 400 causes us to be incompatible with
+ m68k-stub.c and i386-stub.c. Normally, no one would notice because
+ it only matters for writing large chunks of memory (e.g. in
+ downloads). Also, this needs to be more than 400 if required to
+ hold the registers (see below, where we round it up based on
+ DEPRECATED_REGISTER_BYTES). */
#define PBUFSIZ 400
/*
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index d1e3705a4c8..e2908499fea 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -2251,13 +2251,13 @@ mips_mourn_inferior (void)
/* We can write a breakpoint and read the shadow contents in one
operation. */
-/* Insert a breakpoint. On targets that don't have built-in breakpoint
- support, 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 (this
- is accomplished via BREAKPOINT_MAX). */
+/* Insert a breakpoint. On targets that don't have built-in
+ breakpoint support, 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 the breakpoint
+ length returned by BREAKPOINT_FROM_PC. */
static int
mips_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index ac97cde930d..ae397e617d9 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -473,10 +473,10 @@ sds_fetch_registers (int regno)
{
unsigned char buf[PBUFSIZ];
int i, retlen;
- char regs[REGISTER_BYTES];
+ char *regs = alloca (DEPRECATED_REGISTER_BYTES);
/* Unimplemented registers read as all bits zero. */
- memset (regs, 0, REGISTER_BYTES);
+ memset (regs, 0, DEPRECATED_REGISTER_BYTES);
buf[0] = 18;
buf[1] = 1;
@@ -509,7 +509,7 @@ static void
sds_prepare_to_store (void)
{
/* Make sure the entire registers array is valid. */
- deprecated_read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, (char *) NULL, DEPRECATED_REGISTER_BYTES);
}
/* Store register REGNO, or all registers if REGNO == -1, from the contents
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
index d9650e3426f..b3fb7f2b796 100644
--- a/gdb/remote-vx.c
+++ b/gdb/remote-vx.c
@@ -466,7 +466,7 @@ static void
vx_prepare_to_store (void)
{
/* Fetch all registers, if any of them are not yet fetched. */
- deprecated_read_register_bytes (0, NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES);
}
/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
diff --git a/gdb/remote.c b/gdb/remote.c
index 20becee27d6..40be8e6badc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -263,7 +263,7 @@ init_remote_state (struct gdbarch *gdbarch)
/* Start out by having the remote protocol mimic the existing
behavour - just copy in the description of the register cache. */
- rs->sizeof_g_packet = REGISTER_BYTES; /* OK use. */
+ rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; /* OK */
/* Assume a 1:1 regnum<->pnum table. */
rs->regs = xcalloc (NUM_REGS + NUM_PSEUDO_REGS, sizeof (struct packet_reg));
@@ -3529,7 +3529,7 @@ remote_prepare_to_store (void)
forcing the register cache to read its and not the target
registers. */
deprecated_read_register_bytes (0, (char *) NULL,
- REGISTER_BYTES); /* OK use. */
+ DEPRECATED_REGISTER_BYTES); /* OK */
break;
case PACKET_ENABLE:
break;
@@ -4624,11 +4624,12 @@ extended_remote_async_create_inferior (char *exec_file, char *args, char **env)
}
-/* On some machines, e.g. 68k, we may use a different breakpoint instruction
- than other targets; in those use REMOTE_BREAKPOINT instead of just
- BREAKPOINT. Also, bi-endian targets may define LITTLE_REMOTE_BREAKPOINT
- and BIG_REMOTE_BREAKPOINT. If none of these are defined, we just call
- the standard routines that are in mem-break.c. */
+/* On some machines, e.g. 68k, we may use a different breakpoint
+ instruction than other targets; in those use REMOTE_BREAKPOINT
+ instead of just BREAKPOINT_FROM_PC. Also, bi-endian targets may
+ define LITTLE_REMOTE_BREAKPOINT and BIG_REMOTE_BREAKPOINT. If none
+ of these are defined, we just call the standard routines that are
+ in mem-break.c. */
/* FIXME, these ought to be done in a more dynamic fashion. For instance,
the choice of breakpoint instruction affects target program design and
@@ -4652,13 +4653,13 @@ static unsigned char little_break_insn[] = LITTLE_REMOTE_BREAKPOINT;
#endif /* REMOTE_BREAKPOINT */
-/* Insert a breakpoint on targets that don't have any better breakpoint
- support. 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 (this
- is accomplished via BREAKPOINT_MAX). */
+/* Insert a breakpoint on targets that don't have any better
+ breakpoint support. 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 the number
+ of bytes returned by BREAKPOINT_FROM_PC. */
static int
remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 0b239bd4180..977669753d1 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -305,14 +305,11 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
/* Sequence of bytes for breakpoint instruction. */
-#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 }
-#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d }
-
const static unsigned char *
rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
- static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
- static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
+ static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
+ static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
*bp_size = 4;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return big_breakpoint;
@@ -984,7 +981,7 @@ rs6000_pop_frame (void)
}
/* Make sure that all registers are valid. */
- deprecated_read_register_bytes (0, NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES);
/* Figure out previous %pc value. If the function is frameless, it is
still in the link register, otherwise walk the frames and retrieve the
@@ -1269,7 +1266,7 @@ ran_out_of_registers_for_arguments:
write_register (SP_REGNUM, sp);
/* set back chain properly */
- store_address (tmp_buffer, 4, saved_sp);
+ store_unsigned_integer (tmp_buffer, 4, saved_sp);
write_memory (sp, tmp_buffer, 4);
target_store_registers (-1);
@@ -2879,7 +2876,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
set_gdbarch_register_name (gdbarch, rs6000_register_name);
set_gdbarch_deprecated_register_size (gdbarch, wordsize);
- set_gdbarch_register_bytes (gdbarch, off);
+ set_gdbarch_deprecated_register_bytes (gdbarch, off);
set_gdbarch_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index f836c1b0516..c7dce06a17b 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1825,9 +1825,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_struct_return (gdbarch, s390_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value);
set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value);
- /* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
+ /* Amount PC must be decremented by after a breakpoint. This is
+ often the number of bytes returned by BREAKPOINT_FROM_PC but not
+ always. */
set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
/* Stack grows downward. */
@@ -1888,7 +1888,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_virtual_type (gdbarch, s390_register_virtual_type);
set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove);
- set_gdbarch_register_bytes (gdbarch, S390_REGISTER_BYTES);
+ set_gdbarch_deprecated_register_bytes (gdbarch, S390_REGISTER_BYTES);
break;
case bfd_mach_s390_64:
set_gdbarch_deprecated_register_size (gdbarch, 8);
@@ -1900,7 +1900,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
- set_gdbarch_register_bytes (gdbarch, S390X_REGISTER_BYTES);
+ set_gdbarch_deprecated_register_bytes (gdbarch, S390X_REGISTER_BYTES);
set_gdbarch_address_class_type_flags (gdbarch,
s390_address_class_type_flags);
set_gdbarch_address_class_type_flags_to_name (gdbarch,
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 1af501d5829..0a59ea94aeb 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -167,7 +167,7 @@ scm_lookup_name (char *str)
if (in_eval_c ()
&& (sym = lookup_symbol ("env",
expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL)) != NULL)
args[2] = value_of_variable (sym, expression_context_block);
else
@@ -181,7 +181,7 @@ scm_lookup_name (char *str)
sym = lookup_symbol (str,
expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
+ VAR_DOMAIN, (int *) NULL,
(struct symtab **) NULL);
if (sym)
return value_of_variable (sym, NULL);
@@ -252,6 +252,8 @@ const struct language_defn scm_language_defn =
scm_val_print, /* Print a value using appropriate syntax */
scm_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"#o%lo", "#o", "o", ""}, /* Octal format info */
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index bca0e54e4ba..38f8e78949a 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -138,7 +138,7 @@ void
_initialize_ser_pipe (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
- memset (ops, sizeof (struct serial_ops), 0);
+ memset (ops, 0, sizeof (struct serial_ops));
ops->name = "pipe";
ops->next = 0;
ops->open = pipe_open;
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index c6ae19dab02..a9a87143cb3 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -208,7 +208,7 @@ void
_initialize_ser_tcp (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
- memset (ops, sizeof (struct serial_ops), 0);
+ memset (ops, 0, sizeof (struct serial_ops));
ops->name = "tcp";
ops->next = 0;
ops->open = net_open;
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index f7ab28ae750..e7a5d93cef5 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -1337,7 +1337,7 @@ void
_initialize_ser_hardwire (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
- memset (ops, sizeof (struct serial_ops), 0);
+ memset (ops, 0, sizeof (struct serial_ops));
ops->name = "hardwire";
ops->next = 0;
ops->open = hardwire_open;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 0ef65de2c02..cbaaa3689d4 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1873,8 +1873,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
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]);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_saved_regs (frame)[regnum]);
}
else
{ /* any other register */
@@ -4368,7 +4368,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_fp_regnum (gdbarch, 14);
set_gdbarch_pc_regnum (gdbarch, 16);
set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4);
set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
set_gdbarch_deprecated_frame_chain (gdbarch, sh_frame_chain);
@@ -4587,9 +4587,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
ISA16(compact) or ISA32(media). */
set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
- set_gdbarch_register_bytes (gdbarch,
- ((SIM_SH64_NR_FP_REGS + 1) * 4)
- + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
+ set_gdbarch_deprecated_register_bytes (gdbarch,
+ ((SIM_SH64_NR_FP_REGS + 1) * 4)
+ + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
sh_register_name = sh_sh64_register_name;
sh_show_regs = sh64_show_regs;
diff --git a/gdb/source.c b/gdb/source.c
index c2269fadcd5..ae94addb613 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -239,7 +239,7 @@ select_source_symtab (register struct symtab *s)
/* Make the default place to list be the function `main'
if one exists. */
- if (lookup_symbol (main_name (), 0, VAR_NAMESPACE, 0, NULL))
+ if (lookup_symbol (main_name (), 0, VAR_DOMAIN, 0, NULL))
{
sals = decode_line_spec (main_name (), 1);
sal = sals.sals[0];
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 7f0ae4b2046..6735b0814ee 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -151,6 +151,14 @@ int deferred_stores = 0; /* Accumulated stores we want to do eventually. */
#endif
+const unsigned char *
+sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static const char breakpoint[] = {0x91, 0xd0, 0x20, 0x01};
+ (*len) = sizeof (breakpoint);
+ return breakpoint;
+}
+
/* Fetch a single instruction. Even on bi-endian machines
such as sparc86x, instructions are always big-endian. */
@@ -859,7 +867,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (raw_buffer != NULL)
{
/* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame));
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame));
}
if (addrp != NULL)
*addrp = 0;
@@ -967,7 +975,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (raw_buffer != NULL)
{
/* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), addr);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), addr);
}
if (addrp != NULL)
*addrp = 0;
@@ -1261,7 +1269,7 @@ sparc_pop_frame (void)
int regnum;
fsr = alloca (NUM_REGS * sizeof (CORE_ADDR));
- raw_buffer = alloca (REGISTER_BYTES);
+ raw_buffer = alloca (DEPRECATED_REGISTER_BYTES);
sparc_frame_find_saved_regs (frame, &fsr[0]);
if (SPARC_HAS_FPU)
{
@@ -3153,7 +3161,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* First set settings that are common for all sparc architectures. */
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
- set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc);
+ set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);
@@ -3373,7 +3381,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sparc:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_num_regs (gdbarch, 72);
- set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
#if 0
@@ -3409,7 +3417,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sparc_v8plus:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_num_regs (gdbarch, 72);
- set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->print_insn_mach = bfd_mach_sparc;
@@ -3421,7 +3429,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sparc_v8plusa:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_num_regs (gdbarch, 72);
- set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
#if 0
@@ -3445,7 +3453,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sparc_v9:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
set_gdbarch_num_regs (gdbarch, 125);
- set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
+ set_gdbarch_deprecated_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
#if 0
@@ -3457,7 +3465,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sparc_v9a:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
set_gdbarch_num_regs (gdbarch, 125);
- set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
+ set_gdbarch_deprecated_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
#if 0
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index cf7a21bf6de..e0c88aa8f50 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -418,7 +418,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
DEPRECATED_SYMBOL_NAME (sym) =
obsavestring (name, pp - name, &objfile->symbol_obstack);
@@ -677,7 +677,7 @@ read_type_number (register char **pp, register int *typenums)
// OBSOLETE return 1;
// OBSOLETE }
// OBSOLETE /* FIXME! attach base info to type */
-// OBSOLETE bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name */
+// OBSOLETE bsym = lookup_symbol (bname, 0, STRUCT_DOMAIN, 0, 0); /*demangled_name */
// OBSOLETE if (bsym)
// OBSOLETE {
// OBSOLETE new->field.type = SYMBOL_TYPE (bsym);
@@ -750,7 +750,7 @@ read_type_number (register char **pp, register int *typenums)
// OBSOLETE sublist_count++;
// OBSOLETE fname++;
// OBSOLETE }
-// OBSOLETE ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */
+// OBSOLETE ref_func = lookup_symbol (fname, 0, VAR_DOMAIN, 0, 0); /* demangled name */
// OBSOLETE if (!ref_func)
// OBSOLETE {
// OBSOLETE complaint (&symfile_complaints,
@@ -946,7 +946,7 @@ read_type_number (register char **pp, register int *typenums)
// 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 (DEPRECATED_SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0);
+// OBSOLETE ref_sym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), 0, STRUCT_DOMAIN, 0, 0);
// OBSOLETE type = SYMBOL_TYPE (ref_sym);
@@ -1379,7 +1379,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
{
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &file_symbols);
return sym;
}
@@ -1472,7 +1472,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = error_type (&p, objfile);
}
}
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &file_symbols);
return sym;
@@ -1480,7 +1480,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* The name of a caught exception. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_LABEL;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE_ADDRESS (sym) = valu;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -1489,7 +1489,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* A static function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &file_symbols);
/* fall into process_function_types. */
@@ -1560,7 +1560,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* A global function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &global_symbols);
goto process_function_types;
@@ -1571,7 +1571,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
These definitions appear at the end of the namelist. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* Don't add symbol references to global_sym_chain.
Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated.
@@ -1593,7 +1593,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_LOCAL;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -1613,7 +1613,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_CLASS (sym) = LOC_ARG;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
@@ -1725,7 +1725,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_PRINT_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -1741,7 +1741,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_PRINT_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (within_function)
{
/* Sun cc uses a pair of symbols, one 'p' and one 'r' with the same
@@ -1812,7 +1812,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
}
}
#endif
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &file_symbols);
break;
@@ -1827,7 +1827,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* C++ vagaries: we may have a type which is derived from
a base type which did not have its name defined when the
derived class was output. We fill in the derived class's
@@ -1928,7 +1928,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_TAG_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
@@ -1942,7 +1942,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
*typedef_sym = *sym;
SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (typedef_sym) = valu;
- SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
@@ -1967,7 +1967,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
}
}
#endif
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -1976,7 +1976,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REF_ARG;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -1992,7 +1992,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_PRINT_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
@@ -2004,7 +2004,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_LOCAL;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
break;
#if 0 /* OBSOLETE CFront */
@@ -2027,7 +2027,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
// 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 SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
// OBSOLETE /* Don't add to list - we'll delete it later when
// OBSOLETE we add the continuation to the real sym */
// OBSOLETE return sym;
@@ -2038,7 +2038,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_VALUE (sym) = 0;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &file_symbols);
break;
}
@@ -2393,7 +2393,7 @@ again:
struct symbol *sym = ppt->symbol[i];
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE
+ && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
&& STREQ (DEPRECATED_SYMBOL_NAME (sym), type_name))
{
@@ -4068,7 +4068,7 @@ attach_fn_fields_to_type (struct field_info *fip, register struct type *type)
// 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 ref_static = lookup_symbol (sname, 0, VAR_DOMAIN, 0, 0); /*demangled_name */
// OBSOLETE if (!ref_static)
// OBSOLETE {
// OBSOLETE complaint (&symfile_complaints,
@@ -4500,7 +4500,7 @@ read_enum_type (register char **pp, register struct type *type,
DEPRECATED_SYMBOL_NAME (sym) = name;
SYMBOL_LANGUAGE (sym) = current_subfile->language;
SYMBOL_CLASS (sym) = LOC_CONST;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = n;
if (n < 0)
unsigned_enum = 0;
@@ -5187,7 +5187,7 @@ cleanup_undefined_types (void)
struct symbol *sym = ppt->symbol[i];
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE
+ && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) ==
TYPE_CODE (*type))
&& STREQ (DEPRECATED_SYMBOL_NAME (sym), typename))
diff --git a/gdb/stack.c b/gdb/stack.c
index 0a0aaac2a75..e865270a812 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1332,7 +1332,7 @@ print_frame_arg_vars (register struct frame_info *fi,
are not combined in symbol-reading. */
sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
- b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
+ b, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
print_variable_value (sym2, fi, stream);
fprintf_filtered (stream, "\n");
break;
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 7d7886a2921..8bb3b371339 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2640,7 +2640,7 @@ start_psymtab_common (struct objfile *objfile,
Since one arg is a struct, we pass in a ptr and deref it (sigh). */
void
-add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
+add_psymbol_to_list (char *name, int namelength, domain_enum domain,
enum address_class class,
struct psymbol_allocation_list *list, long val, /* Value as a long */
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
@@ -2667,7 +2667,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
}
SYMBOL_SECTION (&psymbol) = 0;
SYMBOL_LANGUAGE (&psymbol) = language;
- PSYMBOL_NAMESPACE (&psymbol) = namespace;
+ PSYMBOL_DOMAIN (&psymbol) = domain;
PSYMBOL_CLASS (&psymbol) = class;
SYMBOL_SET_NAMES (&psymbol, buf, namelength, objfile);
@@ -2690,7 +2690,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
void
add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
- int dem_namelength, namespace_enum namespace,
+ int dem_namelength, domain_enum domain,
enum address_class class,
struct psymbol_allocation_list *list, long val, /* Value as a long */
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
@@ -2735,7 +2735,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
}
SYMBOL_SECTION (&psymbol) = 0;
SYMBOL_LANGUAGE (&psymbol) = language;
- PSYMBOL_NAMESPACE (&psymbol) = namespace;
+ PSYMBOL_DOMAIN (&psymbol) = domain;
PSYMBOL_CLASS (&psymbol) = class;
SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 0e2f1ef096b..04b0d89605b 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -149,12 +149,12 @@ extern void extend_psymbol_list (struct psymbol_allocation_list *,
/* #include "demangle.h" */
extern void
-add_psymbol_to_list (char *, int, namespace_enum, enum address_class,
+add_psymbol_to_list (char *, int, domain_enum, enum address_class,
struct psymbol_allocation_list *, long, CORE_ADDR,
enum language, struct objfile *);
extern void
-add_psymbol_with_dem_name_to_list (char *, int, char *, int, namespace_enum,
+add_psymbol_with_dem_name_to_list (char *, int, char *, int, domain_enum,
enum address_class,
struct psymbol_allocation_list *,
long, CORE_ADDR,
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 636b1d9c1ba..3b57e5fa41d 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -599,7 +599,7 @@ print_symbol (void *args)
struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
print_spaces (depth, outfile);
- if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
+ if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN)
{
fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol));
print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
@@ -611,7 +611,7 @@ print_symbol (void *args)
fprintf_filtered (outfile, "\n");
return 1;
}
- if (SYMBOL_NAMESPACE (symbol) == STRUCT_NAMESPACE)
+ if (SYMBOL_DOMAIN (symbol) == STRUCT_DOMAIN)
{
if (TYPE_TAG_NAME (SYMBOL_TYPE (symbol)))
{
@@ -838,22 +838,22 @@ print_partial_symbols (struct partial_symbol **p, int count, char *what,
fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p));
}
fputs_filtered (", ", outfile);
- switch (SYMBOL_NAMESPACE (*p))
+ switch (SYMBOL_DOMAIN (*p))
{
- case UNDEF_NAMESPACE:
- fputs_filtered ("undefined namespace, ", outfile);
+ case UNDEF_DOMAIN:
+ fputs_filtered ("undefined domain, ", outfile);
break;
- case VAR_NAMESPACE:
+ case VAR_DOMAIN:
/* This is the usual thing -- don't print it */
break;
- case STRUCT_NAMESPACE:
- fputs_filtered ("struct namespace, ", outfile);
+ case STRUCT_DOMAIN:
+ fputs_filtered ("struct domain, ", outfile);
break;
- case LABEL_NAMESPACE:
- fputs_filtered ("label namespace, ", outfile);
+ case LABEL_DOMAIN:
+ fputs_filtered ("label domain, ", outfile);
break;
default:
- fputs_filtered ("<invalid namespace>, ", outfile);
+ fputs_filtered ("<invalid domain>, ", outfile);
break;
}
switch (SYMBOL_CLASS (*p))
@@ -1151,7 +1151,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
while (length--)
{
sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
- NULL, SYMBOL_NAMESPACE (*psym));
+ NULL, SYMBOL_DOMAIN (*psym));
if (!sym)
{
printf_filtered ("Static symbol `");
@@ -1168,7 +1168,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
while (length--)
{
sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
- NULL, SYMBOL_NAMESPACE (*psym));
+ NULL, SYMBOL_DOMAIN (*psym));
if (!sym)
{
printf_filtered ("Global symbol `");
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 2c46f9d6751..1e1b5def91b 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -79,50 +79,44 @@ char *operator_chars (char *p, char **end);
static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
const char *,
const char *, int,
- namespace_enum);
+ domain_enum);
static struct symbol *lookup_symbol_aux (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const struct block *block,
- const namespace_enum namespace,
+ const domain_enum domain,
int *is_a_field_of_this,
struct symtab **symtab);
static
struct symbol *lookup_symbol_aux_local (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const struct block *block,
- const namespace_enum namespace,
- struct symtab **symtab,
- const struct block **static_block);
-
-static
-struct symbol *lookup_symbol_aux_block (const char *name,
- const char *mangled_name,
- const struct block *block,
- const namespace_enum namespace,
+ const domain_enum domain,
struct symtab **symtab);
static
struct symbol *lookup_symbol_aux_symtabs (int block_index,
const char *name,
- const char *mangled_name,
- const namespace_enum namespace,
+ const char *linkage_name,
+ const domain_enum domain,
struct symtab **symtab);
static
struct symbol *lookup_symbol_aux_psymtabs (int block_index,
const char *name,
- const char *mangled_name,
- const namespace_enum namespace,
+ const char *linkage_name,
+ const domain_enum domain,
struct symtab **symtab);
+#if 0
static
struct symbol *lookup_symbol_aux_minsyms (const char *name,
- const char *mangled_name,
- const namespace_enum namespace,
+ const char *linkage_name,
+ const domain_enum domain,
int *is_a_field_of_this,
struct symtab **symtab);
+#endif
static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr);
@@ -134,12 +128,12 @@ static void fixup_section (struct general_symbol_info *, struct objfile *);
static int file_matches (char *, char **, int);
-static void print_symbol_info (namespace_enum,
+static void print_symbol_info (domain_enum,
struct symtab *, struct symbol *, int, char *);
static void print_msymbol_info (struct minimal_symbol *);
-static void symtab_symbol_info (char *, namespace_enum, int);
+static void symtab_symbol_info (char *, domain_enum, int);
static void overload_list_add_symbol (struct symbol *sym, char *oload_name);
@@ -779,7 +773,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
pp++)
{
p = *pp;
- if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
+ if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
&& SYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
&& (SYMBOL_VALUE_ADDRESS (p) > best_pc
@@ -803,7 +797,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
pp++)
{
p = *pp;
- if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
+ if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
&& SYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
&& (SYMBOL_VALUE_ADDRESS (p) > best_pc
@@ -878,7 +872,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
}
/* Find the definition for a specified symbol name NAME
- in namespace NAMESPACE, visible from lexical block BLOCK.
+ in domain DOMAIN, visible from lexical block BLOCK.
Returns the struct symbol pointer, or zero if no symbol is found.
If SYMTAB is non-NULL, store the symbol table in which the
symbol was found there, or NULL if not found.
@@ -900,7 +894,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
struct symbol *
lookup_symbol (const char *name, const struct block *block,
- const namespace_enum namespace, int *is_a_field_of_this,
+ const domain_enum domain, int *is_a_field_of_this,
struct symtab **symtab)
{
char *demangled_name = NULL;
@@ -938,80 +932,40 @@ lookup_symbol (const char *name, const struct block *block,
}
returnval = lookup_symbol_aux (modified_name, mangled_name, block,
- namespace, is_a_field_of_this, symtab);
+ domain, is_a_field_of_this, symtab);
if (needtofreename)
xfree (demangled_name);
return returnval;
}
+/* Behave like lookup_symbol_aux except that NAME is the natural name
+ of the symbol that we're looking for and, if LINKAGE_NAME is
+ non-NULL, ensure that the symbol's linkage name matches as
+ well. */
+
static struct symbol *
-lookup_symbol_aux (const char *name, const char *mangled_name,
- const struct block *block, const namespace_enum namespace,
+lookup_symbol_aux (const char *name, const char *linkage_name,
+ const struct block *block, const domain_enum domain,
int *is_a_field_of_this, struct symtab **symtab)
{
struct symbol *sym;
- const struct block *static_block;
/* Search specified block and its superiors. Don't search
STATIC_BLOCK or GLOBAL_BLOCK. */
- sym = lookup_symbol_aux_local (name, mangled_name, block, namespace,
- symtab, &static_block);
+ sym = lookup_symbol_aux_local (name, linkage_name, block, domain,
+ symtab);
if (sym != NULL)
return sym;
-#if 0
- /* NOTE: carlton/2002-11-05: At the time that this code was
- #ifdeffed out, the value of 'block' was always NULL at this
- point, hence the bemused comments below. */
-
- /* FIXME: this code is never executed--block is always NULL at this
- point. What is it trying to do, anyway? We already should have
- checked the STATIC_BLOCK above (it is the superblock of top-level
- blocks). Why is VAR_NAMESPACE special-cased? */
- /* Don't need to mess with the psymtabs; if we have a block,
- that file is read in. If we don't, then we deal later with
- all the psymtab stuff that needs checking. */
- /* Note (RT): The following never-executed code looks unnecessary to me also.
- * If we change the code to use the original (passed-in)
- * value of 'block', we could cause it to execute, but then what
- * would it do? The STATIC_BLOCK of the symtab containing the passed-in
- * 'block' was already searched by the above code. And the STATIC_BLOCK's
- * of *other* symtabs (those files not containing 'block' lexically)
- * should not contain 'block' address-wise. So we wouldn't expect this
- * code to find any 'sym''s that were not found above. I vote for
- * deleting the following paragraph of code.
- */
- if (namespace == VAR_NAMESPACE && block != NULL)
- {
- struct block *b;
- /* Find the right symtab. */
- ALL_SYMTABS (objfile, s)
- {
- bv = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- if (BLOCK_START (b) <= BLOCK_START (block)
- && BLOCK_END (b) > BLOCK_START (block))
- {
- sym = lookup_block_symbol (b, name, mangled_name, VAR_NAMESPACE);
- if (sym)
- {
- block_found = b;
- if (symtab != NULL)
- *symtab = s;
- return fixup_symbol_section (sym, objfile);
- }
- }
- }
- }
-#endif /* 0 */
+ /* If requested to do so by the caller and if appropriate for the
+ current language, check to see if NAME is a field of `this'. */
- /* C++/Java/Objective-C: If requested to do so by the caller,
- check to see if NAME is a field of `this'. */
- if (is_a_field_of_this)
+ if (current_language->la_value_of_this != NULL
+ && is_a_field_of_this != NULL)
{
- struct value *v = value_of_this (0);
+ struct value *v = current_language->la_value_of_this (0);
*is_a_field_of_this = 0;
if (v && check_field (v, name))
@@ -1023,65 +977,12 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
}
}
- /* If there's a static block to search, search it next. */
-
- /* NOTE: carlton/2002-12-05: There is a question as to whether or
- not it would be appropriate to search the current global block
- here as well. (That's what this code used to do before the
- is_a_field_of_this check was moved up.) On the one hand, it's
- redundant with the lookup_symbol_aux_symtabs search that happens
- next. On the other hand, if decode_line_1 is passed an argument
- like filename:var, then the user presumably wants 'var' to be
- searched for in filename. On the third hand, there shouldn't be
- multiple global variables all of which are named 'var', and it's
- not like decode_line_1 has ever restricted its search to only
- global variables in a single filename. All in all, only
- searching the static block here seems best: it's correct and it's
- cleanest. */
-
- /* NOTE: carlton/2002-12-05: There's also a possible performance
- issue here: if you usually search for global symbols in the
- current file, then it would be slightly better to search the
- current global block before searching all the symtabs. But there
- are other factors that have a much greater effect on performance
- than that one, so I don't think we should worry about that for
- now. */
-
- if (static_block != NULL)
- {
- sym = lookup_symbol_aux_block (name, mangled_name, static_block,
- namespace, symtab);
- if (sym != NULL)
- return sym;
- }
+ /* Now do whatever is appropriate for the current language to look
+ up static and global variables. */
- /* Now search all global blocks. Do the symtab's first, then
- check the psymtab's. If a psymtab indicates the existence
- of the desired name as a global, then do psymtab-to-symtab
- conversion on the fly and return the found symbol. */
-
- sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, mangled_name,
- namespace, symtab);
- if (sym != NULL)
- return sym;
-
-#ifndef HPUXHPPA
-
- /* Check for the possibility of the symbol being a function or
- a mangled variable that is stored in one of the minimal symbol tables.
- Eventually, all global symbols might be resolved in this way. */
-
- sym = lookup_symbol_aux_minsyms (name, mangled_name,
- namespace, is_a_field_of_this,
- symtab);
-
- if (sym != NULL)
- return sym;
-
-#endif
-
- sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, mangled_name,
- namespace, symtab);
+ sym = current_language->la_lookup_symbol_nonlocal (name, linkage_name,
+ block, domain,
+ symtab);
if (sym != NULL)
return sym;
@@ -1091,91 +992,59 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
desired name as a file-level static, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, mangled_name,
- namespace, symtab);
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name,
+ domain, symtab);
if (sym != NULL)
return sym;
- sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, mangled_name,
- namespace, symtab);
+ sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name,
+ domain, symtab);
if (sym != NULL)
return sym;
-#ifdef HPUXHPPA
-
- /* Check for the possibility of the symbol being a function or
- a global variable that is stored in one of the minimal symbol tables.
- The "minimal symbol table" is built from linker-supplied info.
-
- RT: I moved this check to last, after the complete search of
- the global (p)symtab's and static (p)symtab's. For HP-generated
- symbol tables, this check was causing a premature exit from
- lookup_symbol with NULL return, and thus messing up symbol lookups
- of things like "c::f". It seems to me a check of the minimal
- symbol table ought to be a last resort in any case. I'm vaguely
- worried about the comment below which talks about FORTRAN routines "foo_"
- though... is it saying we need to do the "minsym" check before
- the static check in this case?
- */
-
-
- sym = lookup_symbol_aux_minsyms (name, mangled_name,
- namespace, is_a_field_of_this,
- symtab);
-
- if (sym != NULL)
- return sym;
-
-#endif
-
if (symtab != NULL)
*symtab = NULL;
return NULL;
}
/* Check to see if the symbol is defined in BLOCK or its superiors.
- Don't search STATIC_BLOCK or GLOBAL_BLOCK. If we don't find a
- match, store the address of STATIC_BLOCK in static_block. */
+ Don't search STATIC_BLOCK or GLOBAL_BLOCK. */
static struct symbol *
-lookup_symbol_aux_local (const char *name, const char *mangled_name,
+lookup_symbol_aux_local (const char *name, const char *linkage_name,
const struct block *block,
- const namespace_enum namespace,
- struct symtab **symtab,
- const struct block **static_block)
+ const domain_enum domain,
+ struct symtab **symtab)
{
struct symbol *sym;
-
+ const struct block *static_block = block_static_block (block);
+
/* Check if either no block is specified or it's a global block. */
- if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)
- {
- *static_block = NULL;
- return NULL;
- }
+ if (static_block == NULL)
+ return NULL;
- while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
+ while (block != static_block)
{
- sym = lookup_symbol_aux_block (name, mangled_name, block, namespace,
+ sym = lookup_symbol_aux_block (name, linkage_name, block, domain,
symtab);
if (sym != NULL)
return sym;
block = BLOCK_SUPERBLOCK (block);
}
- /* We've reached the static block. */
+ /* We've reached the static block without finding a result. */
- *static_block = block;
return NULL;
}
/* Look up a symbol in a block; if found, locate its symtab, fixup the
symbol, and set block_found appropriately. */
-static struct symbol *
-lookup_symbol_aux_block (const char *name, const char *mangled_name,
+struct symbol *
+lookup_symbol_aux_block (const char *name, const char *linkage_name,
const struct block *block,
- const namespace_enum namespace,
+ const domain_enum domain,
struct symtab **symtab)
{
struct symbol *sym;
@@ -1184,7 +1053,7 @@ lookup_symbol_aux_block (const char *name, const char *mangled_name,
struct block *b;
struct symtab *s = NULL;
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (sym)
{
block_found = block;
@@ -1217,8 +1086,8 @@ lookup_symbol_aux_block (const char *name, const char *mangled_name,
static struct symbol *
lookup_symbol_aux_symtabs (int block_index,
- const char *name, const char *mangled_name,
- const namespace_enum namespace,
+ const char *name, const char *linkage_name,
+ const domain_enum domain,
struct symtab **symtab)
{
struct symbol *sym;
@@ -1231,7 +1100,7 @@ lookup_symbol_aux_symtabs (int block_index,
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (sym)
{
block_found = block;
@@ -1251,8 +1120,8 @@ lookup_symbol_aux_symtabs (int block_index,
static struct symbol *
lookup_symbol_aux_psymtabs (int block_index, const char *name,
- const char *mangled_name,
- const namespace_enum namespace,
+ const char *linkage_name,
+ const domain_enum domain,
struct symtab **symtab)
{
struct symbol *sym;
@@ -1266,13 +1135,13 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
ALL_PSYMTABS (objfile, ps)
{
if (!ps->readin
- && lookup_partial_symbol (ps, name, mangled_name,
- psymtab_index, namespace))
+ && lookup_partial_symbol (ps, name, linkage_name,
+ psymtab_index, domain))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort try
@@ -1289,7 +1158,7 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
block = BLOCKVECTOR_BLOCK (bv,
block_index == GLOBAL_BLOCK ?
STATIC_BLOCK : GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (!sym)
error ("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>).",
block_index == GLOBAL_BLOCK ? "global" : "static",
@@ -1304,6 +1173,7 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
return NULL;
}
+#if 0
/* Check for the possibility of the symbol being a function or a
mangled variable that is stored in one of the minimal symbol
tables. Eventually, all global symbols might be resolved in this
@@ -1317,10 +1187,15 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
some additional conditions held as well, and it caused problems
with HP-generated symbol tables. */
+/* NOTE: carlton/2003-05-14: This function was once used as part of
+ lookup_symbol. It is currently unnecessary for correctness
+ reasons, however, and using it doesn't seem to be any faster than
+ using lookup_symbol_aux_psymtabs, so I'm commenting it out. */
+
static struct symbol *
lookup_symbol_aux_minsyms (const char *name,
- const char *mangled_name,
- const namespace_enum namespace,
+ const char *linkage_name,
+ const domain_enum domain,
int *is_a_field_of_this,
struct symtab **symtab)
{
@@ -1330,7 +1205,7 @@ lookup_symbol_aux_minsyms (const char *name,
struct minimal_symbol *msymbol;
struct symtab *s;
- if (namespace == VAR_NAMESPACE)
+ if (domain == VAR_DOMAIN)
{
msymbol = lookup_minimal_symbol (name, NULL, NULL);
@@ -1364,14 +1239,14 @@ lookup_symbol_aux_minsyms (const char *name,
to be clearly the wrong thing to pass as the
unmangled name. */
sym =
- lookup_block_symbol (block, name, mangled_name, namespace);
+ lookup_block_symbol (block, name, linkage_name, domain);
/* We kept static functions in minimal symbol table as well as
in static scope. We want to find them in the symbol table. */
if (!sym)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, name,
- mangled_name, namespace);
+ linkage_name, domain);
}
/* NOTE: carlton/2002-12-04: The following comment was
@@ -1417,21 +1292,99 @@ lookup_symbol_aux_minsyms (const char *name,
*symtab = s;
return fixup_symbol_section (sym, s->objfile);
}
- else if (MSYMBOL_TYPE (msymbol) != mst_text
- && MSYMBOL_TYPE (msymbol) != mst_file_text
- && !STREQ (name, DEPRECATED_SYMBOL_NAME (msymbol)))
- {
- /* This is a mangled variable, look it up by its
- mangled name. */
- return lookup_symbol_aux (DEPRECATED_SYMBOL_NAME (msymbol), mangled_name,
- NULL, namespace, is_a_field_of_this,
- symtab);
- }
}
}
return NULL;
}
+#endif /* 0 */
+
+/* A default version of lookup_symbol_nonlocal for use by languages
+ that can't think of anything better to do. This implements the C
+ lookup rules. */
+
+struct symbol *
+basic_lookup_symbol_nonlocal (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab)
+{
+ struct symbol *sym;
+
+ /* NOTE: carlton/2003-05-19: The comments below were written when
+ this (or what turned into this) was part of lookup_symbol_aux;
+ I'm much less worried about these questions now, since these
+ decisions have turned out well, but I leave these comments here
+ for posterity. */
+
+ /* NOTE: carlton/2002-12-05: There is a question as to whether or
+ not it would be appropriate to search the current global block
+ here as well. (That's what this code used to do before the
+ is_a_field_of_this check was moved up.) On the one hand, it's
+ redundant with the lookup_symbol_aux_symtabs search that happens
+ next. On the other hand, if decode_line_1 is passed an argument
+ like filename:var, then the user presumably wants 'var' to be
+ searched for in filename. On the third hand, there shouldn't be
+ multiple global variables all of which are named 'var', and it's
+ not like decode_line_1 has ever restricted its search to only
+ global variables in a single filename. All in all, only
+ searching the static block here seems best: it's correct and it's
+ cleanest. */
+
+ /* NOTE: carlton/2002-12-05: There's also a possible performance
+ issue here: if you usually search for global symbols in the
+ current file, then it would be slightly better to search the
+ current global block before searching all the symtabs. But there
+ are other factors that have a much greater effect on performance
+ than that one, so I don't think we should worry about that for
+ now. */
+
+ sym = lookup_symbol_static (name, linkage_name, block, domain, symtab);
+ if (sym != NULL)
+ return sym;
+
+ return lookup_symbol_global (name, linkage_name, domain, symtab);
+}
+
+/* Lookup a symbol in the static block associated to BLOCK, if there
+ is one; do nothing if BLOCK is NULL or a global block. */
+
+struct symbol *
+lookup_symbol_static (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab)
+{
+ const struct block *static_block = block_static_block (block);
+
+ if (static_block != NULL)
+ return lookup_symbol_aux_block (name, linkage_name, static_block,
+ domain, symtab);
+ else
+ return NULL;
+}
+
+/* Lookup a symbol in all files' global blocks (searching psymtabs if
+ necessary). */
+
+struct symbol *
+lookup_symbol_global (const char *name,
+ const char *linkage_name,
+ const domain_enum domain,
+ struct symtab **symtab)
+{
+ struct symbol *sym;
+
+ sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name,
+ domain, symtab);
+ if (sym != NULL)
+ return sym;
+
+ return lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name,
+ domain, symtab);
+}
/* Look, in partial_symtab PST, for symbol whose natural name is NAME.
If LINKAGE_NAME is non-NULL, check in addition that the symbol's
@@ -1441,7 +1394,7 @@ lookup_symbol_aux_minsyms (const char *name,
static struct partial_symbol *
lookup_partial_symbol (struct partial_symtab *pst, const char *name,
const char *linkage_name, int global,
- namespace_enum namespace)
+ domain_enum domain)
{
struct partial_symbol *temp;
struct partial_symbol **start, **psym;
@@ -1465,7 +1418,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
pointing at the earliest partial symbol whose name might be
correct. At that point *all* partial symbols with an
appropriate name will be checked against the correct
- namespace. */
+ domain. */
bottom = start;
top = start + length - 1;
@@ -1497,7 +1450,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (*top,name)))
{
- if (SYMBOL_NAMESPACE (*top) == namespace)
+ if (SYMBOL_DOMAIN (*top) == domain)
{
return (*top);
}
@@ -1512,7 +1465,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
for (psym = start; psym < start + length; psym++)
{
- if (namespace == SYMBOL_NAMESPACE (*psym))
+ if (domain == SYMBOL_DOMAIN (*psym))
{
if (linkage_name != NULL
? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0
@@ -1527,12 +1480,12 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
return (NULL);
}
-/* Look up a type named NAME in the struct_namespace. The type returned
+/* Look up a type named NAME in the struct_domain. The type returned
must not be opaque -- i.e., must have at least one field defined
This code was modelled on lookup_symbol -- the parts not relevant to looking
up types were just left out. In particular it's assumed here that types
- are available in struct_namespace and only at file-static or global blocks. */
+ are available in struct_domain and only at file-static or global blocks. */
struct type *
@@ -1554,7 +1507,7 @@ lookup_transparent_type (const char *name)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
@@ -1564,12 +1517,12 @@ lookup_transparent_type (const char *name)
ALL_PSYMTABS (objfile, ps)
{
if (!ps->readin && lookup_partial_symbol (ps, name, NULL,
- 1, STRUCT_NAMESPACE))
+ 1, STRUCT_DOMAIN))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -1578,7 +1531,7 @@ lookup_transparent_type (const char *name)
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -1602,7 +1555,7 @@ lookup_transparent_type (const char *name)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
@@ -1611,12 +1564,12 @@ lookup_transparent_type (const char *name)
ALL_PSYMTABS (objfile, ps)
{
- if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_NAMESPACE))
+ if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_DOMAIN))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -1625,7 +1578,7 @@ lookup_transparent_type (const char *name)
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -1652,7 +1605,7 @@ find_main_psymtab (void)
ALL_PSYMTABS (objfile, pst)
{
- if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_NAMESPACE))
+ if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_DOMAIN))
{
return (pst);
}
@@ -1660,7 +1613,7 @@ find_main_psymtab (void)
return (NULL);
}
-/* Search BLOCK for symbol NAME in NAMESPACE.
+/* Search BLOCK for symbol NAME in DOMAIN.
Note that if NAME is the demangled form of a C++ symbol, we will fail
to find a match during the binary search of the non-encoded names, but
@@ -1671,14 +1624,14 @@ find_main_psymtab (void)
symbol (language_cplus or language_objc set) has both the encoded and
non-encoded names tested for a match.
- If MANGLED_NAME is non-NULL, verify that any symbol we find has this
+ If LINKAGE_NAME is non-NULL, verify that any symbol we find has this
particular mangled name.
*/
struct symbol *
lookup_block_symbol (register const struct block *block, const char *name,
- const char *mangled_name,
- const namespace_enum namespace)
+ const char *linkage_name,
+ const domain_enum domain)
{
register int bot, top, inc;
register struct symbol *sym;
@@ -1692,9 +1645,9 @@ lookup_block_symbol (register const struct block *block, const char *name,
hash_index = hash_index % BLOCK_BUCKETS (block);
for (sym = BLOCK_BUCKET (block, hash_index); sym; sym = sym->hash_next)
{
- if (SYMBOL_NAMESPACE (sym) == namespace
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ if (SYMBOL_DOMAIN (sym) == domain
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
return sym;
}
@@ -1749,9 +1702,9 @@ lookup_block_symbol (register const struct block *block, const char *name,
/* Now scan forward until we run out of symbols, find one whose
name is greater than NAME, or find one we want. If there is
- more than one symbol with the right name and namespace, we
+ more than one symbol with the right name and domain, we
return the first one; I believe it is now impossible for us
- to encounter two symbols with the same name and namespace
+ to encounter two symbols with the same name and domain
here, because blocks containing argument symbols are no
longer sorted. The exception is for C++, where multiple functions
(cloned constructors / destructors, in particular) can have
@@ -1762,9 +1715,9 @@ lookup_block_symbol (register const struct block *block, const char *name,
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAMESPACE (sym) == namespace
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ if (SYMBOL_DOMAIN (sym) == domain
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
{
return sym;
@@ -1797,9 +1750,9 @@ lookup_block_symbol (register const struct block *block, const char *name,
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAMESPACE (sym) == namespace
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ if (SYMBOL_DOMAIN (sym) == domain
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
{
/* If SYM has aliases, then use any alias that is active
@@ -2868,10 +2821,10 @@ sort_search_symbols (struct symbol_search *prevtail, int nfound)
returning the results in *MATCHES.
Only symbols of KIND are searched:
- FUNCTIONS_NAMESPACE - search all functions
- TYPES_NAMESPACE - search all type names
- METHODS_NAMESPACE - search all methods NOT IMPLEMENTED
- VARIABLES_NAMESPACE - search all symbols, excluding functions, type names,
+ FUNCTIONS_DOMAIN - search all functions
+ TYPES_DOMAIN - search all type names
+ METHODS_DOMAIN - search all methods NOT IMPLEMENTED
+ VARIABLES_DOMAIN - search all symbols, excluding functions, type names,
and constants (enums)
free_search_symbols should be called when *MATCHES is no longer needed.
@@ -2880,7 +2833,7 @@ sort_search_symbols (struct symbol_search *prevtail, int nfound)
separately alphabetized.
*/
void
-search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
+search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
struct symbol_search **matches)
{
register struct symtab *s;
@@ -2917,13 +2870,13 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
struct symbol_search *tail;
struct cleanup *old_chain = NULL;
- if (kind < VARIABLES_NAMESPACE)
- error ("must search on specific namespace");
+ if (kind < VARIABLES_DOMAIN)
+ error ("must search on specific domain");
- ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
- ourtype2 = types2[(int) (kind - VARIABLES_NAMESPACE)];
- ourtype3 = types3[(int) (kind - VARIABLES_NAMESPACE)];
- ourtype4 = types4[(int) (kind - VARIABLES_NAMESPACE)];
+ ourtype = types[(int) (kind - VARIABLES_DOMAIN)];
+ ourtype2 = types2[(int) (kind - VARIABLES_DOMAIN)];
+ ourtype3 = types3[(int) (kind - VARIABLES_DOMAIN)];
+ ourtype4 = types4[(int) (kind - VARIABLES_DOMAIN)];
sr = *matches = NULL;
tail = NULL;
@@ -3005,11 +2958,11 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
if (file_matches (ps->filename, files, nfiles)
&& ((regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (*psym)) != 0)
- && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
+ && ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
&& SYMBOL_CLASS (*psym) != LOC_BLOCK)
- || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)
- || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)
- || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK))))
+ || (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK)
+ || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)
+ || (kind == METHODS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK))))
{
PSYMTAB_TO_SYMTAB (ps);
keep_going = 0;
@@ -3032,7 +2985,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
any matching symbols without debug info.
*/
- if (nfiles == 0 && (kind == VARIABLES_NAMESPACE || kind == FUNCTIONS_NAMESPACE))
+ if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN))
{
ALL_MSYMBOLS (objfile, msymbol)
{
@@ -3052,10 +3005,10 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
function lookup_symbol_minsym that found the
symbol associated to a given minimal symbol (if
any). */
- if (kind == FUNCTIONS_NAMESPACE
+ if (kind == FUNCTIONS_DOMAIN
|| lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
(struct block *) NULL,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
0, (struct symtab **) NULL) == NULL)
found_misc = 1;
}
@@ -3084,12 +3037,12 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
if (file_matches (s->filename, files, nfiles)
&& ((regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (sym)) != 0)
- && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (sym) != LOC_TYPEDEF
+ && ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST)
- || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK)
- || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK))))
+ || (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ || (kind == TYPES_DOMAIN && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ || (kind == METHODS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK))))
{
/* match */
psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
@@ -3128,7 +3081,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
/* If there are no eyes, avoid all contact. I mean, if there are
no debug symbols, then print directly from the msymbol_vector. */
- if (found_misc || kind != FUNCTIONS_NAMESPACE)
+ if (found_misc || kind != FUNCTIONS_DOMAIN)
{
ALL_MSYMBOLS (objfile, msymbol)
{
@@ -3141,12 +3094,12 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
|| re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0)
{
/* Functions: Look up by address. */
- if (kind != FUNCTIONS_NAMESPACE ||
+ if (kind != FUNCTIONS_DOMAIN ||
(0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
{
/* Variables/Absolutes: Look up by name */
if (lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
- (struct block *) NULL, VAR_NAMESPACE,
+ (struct block *) NULL, VAR_DOMAIN,
0, (struct symtab **) NULL) == NULL)
{
/* match */
@@ -3181,7 +3134,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
regarding the match to gdb_stdout.
*/
static void
-print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
+print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
int block, char *last)
{
if (last == NULL || strcmp (last, s->filename) != 0)
@@ -3191,17 +3144,17 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
fputs_filtered (":\n", gdb_stdout);
}
- if (kind != TYPES_NAMESPACE && block == STATIC_BLOCK)
+ if (kind != TYPES_DOMAIN && block == STATIC_BLOCK)
printf_filtered ("static ");
/* Typedef that is not a C++ class */
- if (kind == TYPES_NAMESPACE
- && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
+ if (kind == TYPES_DOMAIN
+ && SYMBOL_DOMAIN (sym) != STRUCT_DOMAIN)
typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
/* variable, func, or typedef-that-is-c++-class */
- else if (kind < TYPES_NAMESPACE ||
- (kind == TYPES_NAMESPACE &&
- SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE))
+ else if (kind < TYPES_DOMAIN ||
+ (kind == TYPES_DOMAIN &&
+ SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN))
{
type_print (SYMBOL_TYPE (sym),
(SYMBOL_CLASS (sym) == LOC_TYPEDEF
@@ -3237,7 +3190,7 @@ print_msymbol_info (struct minimal_symbol *msymbol)
matches.
*/
static void
-symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty)
+symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
{
static char *classnames[]
=
@@ -3255,7 +3208,7 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty)
printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
: "All defined %ss:\n",
- classnames[(int) (kind - VARIABLES_NAMESPACE)], regexp);
+ classnames[(int) (kind - VARIABLES_DOMAIN)], regexp);
for (p = symbols; p != NULL; p = p->next)
{
@@ -3287,20 +3240,20 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty)
static void
variables_info (char *regexp, int from_tty)
{
- symtab_symbol_info (regexp, VARIABLES_NAMESPACE, from_tty);
+ symtab_symbol_info (regexp, VARIABLES_DOMAIN, from_tty);
}
static void
functions_info (char *regexp, int from_tty)
{
- symtab_symbol_info (regexp, FUNCTIONS_NAMESPACE, from_tty);
+ symtab_symbol_info (regexp, FUNCTIONS_DOMAIN, from_tty);
}
static void
types_info (char *regexp, int from_tty)
{
- symtab_symbol_info (regexp, TYPES_NAMESPACE, from_tty);
+ symtab_symbol_info (regexp, TYPES_DOMAIN, from_tty);
}
/* Breakpoint all functions matching regular expression. */
@@ -3318,7 +3271,7 @@ rbreak_command (char *regexp, int from_tty)
struct symbol_search *p;
struct cleanup *old_chain;
- search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss);
+ search_symbols (regexp, FUNCTIONS_DOMAIN, 0, (char **) NULL, &ss);
old_chain = make_cleanup_free_search_symbols (ss);
for (p = ss; p != NULL; p = p->next)
@@ -3333,7 +3286,7 @@ rbreak_command (char *regexp, int from_tty)
strcat (string, DEPRECATED_SYMBOL_NAME (p->symbol));
strcat (string, "'");
break_command (string, from_tty);
- print_symbol_info (FUNCTIONS_NAMESPACE,
+ print_symbol_info (FUNCTIONS_DOMAIN,
p->symtab,
p->symbol,
p->block,
@@ -3423,6 +3376,112 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
}
}
+/* ObjC: In case we are completing on a selector, look as the msymbol
+ again and feed all the selectors into the mill. */
+
+static void
+completion_list_objc_symbol (struct minimal_symbol *msymbol, char *sym_text,
+ int sym_text_len, char *text, char *word)
+{
+ static char *tmp = NULL;
+ static unsigned int tmplen = 0;
+
+ char *method, *category, *selector;
+ char *tmp2 = NULL;
+
+ method = SYMBOL_NATURAL_NAME (msymbol);
+
+ /* Is it a method? */
+ if ((method[0] != '-') && (method[0] != '+'))
+ return;
+
+ if (sym_text[0] == '[')
+ /* Complete on shortened method method. */
+ completion_list_add_name (method + 1, sym_text, sym_text_len, text, word);
+
+ while ((strlen (method) + 1) >= tmplen)
+ {
+ if (tmplen == 0)
+ tmplen = 1024;
+ else
+ tmplen *= 2;
+ tmp = xrealloc (tmp, tmplen);
+ }
+ selector = strchr (method, ' ');
+ if (selector != NULL)
+ selector++;
+
+ category = strchr (method, '(');
+
+ if ((category != NULL) && (selector != NULL))
+ {
+ memcpy (tmp, method, (category - method));
+ tmp[category - method] = ' ';
+ memcpy (tmp + (category - method) + 1, selector, strlen (selector) + 1);
+ completion_list_add_name (tmp, sym_text, sym_text_len, text, word);
+ if (sym_text[0] == '[')
+ completion_list_add_name (tmp + 1, sym_text, sym_text_len, text, word);
+ }
+
+ if (selector != NULL)
+ {
+ /* Complete on selector only. */
+ strcpy (tmp, selector);
+ tmp2 = strchr (tmp, ']');
+ if (tmp2 != NULL)
+ *tmp2 = '\0';
+
+ completion_list_add_name (tmp, sym_text, sym_text_len, text, word);
+ }
+}
+
+/* Break the non-quoted text based on the characters which are in
+ symbols. FIXME: This should probably be language-specific. */
+
+static char *
+language_search_unquoted_string (char *text, char *p)
+{
+ for (; p > text; --p)
+ {
+ if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0')
+ continue;
+ else
+ {
+ if ((current_language->la_language == language_objc))
+ {
+ if (p[-1] == ':') /* might be part of a method name */
+ continue;
+ else if (p[-1] == '[' && (p[-2] == '-' || p[-2] == '+'))
+ p -= 2; /* beginning of a method name */
+ else if (p[-1] == ' ' || p[-1] == '(' || p[-1] == ')')
+ { /* might be part of a method name */
+ char *t = p;
+
+ /* Seeing a ' ' or a '(' is not conclusive evidence
+ that we are in the middle of a method name. However,
+ finding "-[" or "+[" should be pretty un-ambiguous.
+ Unfortunately we have to find it now to decide. */
+
+ while (t > text)
+ if (isalnum (t[-1]) || t[-1] == '_' ||
+ t[-1] == ' ' || t[-1] == ':' ||
+ t[-1] == '(' || t[-1] == ')')
+ --t;
+ else
+ break;
+
+ if (t[-1] == '[' && (t[-2] == '-' || t[-2] == '+'))
+ p = t - 2; /* method name detected */
+ /* else we leave with p unchanged */
+ }
+ }
+ break;
+ }
+ }
+ return p;
+}
+
+
/* Return a NULL terminated array of all symbols (regardless of class)
which begin by matching TEXT. If the answer is no symbols, then
the return value is an array which contains only a NULL pointer.
@@ -3545,6 +3604,8 @@ make_symbol_completion_list (char *text, char *word)
{
QUIT;
COMPLETION_LIST_ADD_SYMBOL (msymbol, sym_text, sym_text_len, text, word);
+
+ completion_list_objc_symbol (msymbol, sym_text, sym_text_len, text, word);
}
/* Search upwards from currently selected frame (so that we can
@@ -3562,6 +3623,7 @@ make_symbol_completion_list (char *text, char *word)
ALL_BLOCK_SYMBOLS (b, i, sym)
{
+ QUIT;
COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
{
@@ -3667,16 +3729,8 @@ make_file_symbol_completion_list (char *text, char *word, char *srcfile)
}
else
{
- /* It is not a quoted string. Break it based on the characters
- which are in symbols. */
- while (p > text)
- {
- if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0')
- --p;
- else
- break;
- }
- sym_text = p;
+ /* Not a quoted string. */
+ sym_text = language_search_unquoted_string (text, p);
}
}
@@ -4102,9 +4156,9 @@ make_symbol_overload_list (struct symbol *fsym)
if (ps->readin)
continue;
- if ((lookup_partial_symbol (ps, oload_name, NULL, 1, VAR_NAMESPACE)
+ if ((lookup_partial_symbol (ps, oload_name, NULL, 1, VAR_DOMAIN)
!= NULL)
- || (lookup_partial_symbol (ps, oload_name, NULL, 0, VAR_NAMESPACE)
+ || (lookup_partial_symbol (ps, oload_name, NULL, 0, VAR_DOMAIN)
!= NULL))
PSYMTAB_TO_SYMTAB (ps);
}
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4330b962257..26ea51ea4d2 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -219,16 +219,6 @@ extern char *symbol_demangled_name (struct general_symbol_info *symbol);
"foo :: bar (int, long)".
Evaluates to zero if the match fails, or nonzero if it succeeds. */
-/* FIXME: carlton/2003-02-27: This is an unholy mixture of linkage
- names and natural names. If you want to test the linkage names
- with strcmp, do that. If you want to test the natural names with
- strcmp_iw, use SYMBOL_MATCHES_NATURAL_NAME. */
-
-#define DEPRECATED_SYMBOL_MATCHES_NAME(symbol, name) \
- (STREQ (DEPRECATED_SYMBOL_NAME (symbol), (name)) \
- || (SYMBOL_DEMANGLED_NAME (symbol) != NULL \
- && strcmp_iw (SYMBOL_DEMANGLED_NAME (symbol), (name)) == 0))
-
/* Macro that tests a symbol for a match against a specified name
string. It tests against SYMBOL_NATURAL_NAME, and it ignores
whitespace and trailing parentheses. (See strcmp_iw for details
@@ -328,50 +318,50 @@ struct minimal_symbol
/* Represent one symbol name; a variable, constant, function or typedef. */
-/* Different name spaces for symbols. Looking up a symbol specifies a
- namespace and ignores symbol definitions in other name spaces. */
+/* Different name domains for symbols. Looking up a symbol specifies a
+ domain and ignores symbol definitions in other name domains. */
typedef enum
{
- /* UNDEF_NAMESPACE is used when a namespace has not been discovered or
+ /* UNDEF_DOMAIN is used when a domain has not been discovered or
none of the following apply. This usually indicates an error either
in the symbol information or in gdb's handling of symbols. */
- UNDEF_NAMESPACE,
+ UNDEF_DOMAIN,
- /* VAR_NAMESPACE is the usual namespace. In C, this contains variables,
+ /* VAR_DOMAIN is the usual domain. In C, this contains variables,
function names, typedef names and enum type values. */
- VAR_NAMESPACE,
+ VAR_DOMAIN,
- /* STRUCT_NAMESPACE is used in C to hold struct, union and enum type names.
+ /* STRUCT_DOMAIN is used in C to hold struct, union and enum type names.
Thus, if `struct foo' is used in a C program, it produces a symbol named
- `foo' in the STRUCT_NAMESPACE. */
+ `foo' in the STRUCT_DOMAIN. */
- STRUCT_NAMESPACE,
+ STRUCT_DOMAIN,
- /* LABEL_NAMESPACE may be used for names of labels (for gotos);
+ /* LABEL_DOMAIN may be used for names of labels (for gotos);
currently it is not used and labels are not recorded at all. */
- LABEL_NAMESPACE,
+ LABEL_DOMAIN,
- /* Searching namespaces. These overlap with VAR_NAMESPACE, providing
+ /* Searching domains. These overlap with VAR_DOMAIN, providing
some granularity with the search_symbols function. */
- /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
- METHODS_NAMESPACE */
- VARIABLES_NAMESPACE,
+ /* Everything in VAR_DOMAIN minus FUNCTIONS_-, TYPES_-, and
+ METHODS_DOMAIN */
+ VARIABLES_DOMAIN,
/* All functions -- for some reason not methods, though. */
- FUNCTIONS_NAMESPACE,
+ FUNCTIONS_DOMAIN,
/* All defined types */
- TYPES_NAMESPACE,
+ TYPES_DOMAIN,
/* All class methods -- why is this separated out? */
- METHODS_NAMESPACE
+ METHODS_DOMAIN
}
-namespace_enum;
+domain_enum;
/* An address-class says where to find the value of a symbol. */
@@ -427,8 +417,8 @@ enum address_class
LOC_LOCAL,
- /* Value not used; definition in SYMBOL_TYPE. Symbols in the namespace
- STRUCT_NAMESPACE all have this class. */
+ /* Value not used; definition in SYMBOL_TYPE. Symbols in the domain
+ STRUCT_DOMAIN all have this class. */
LOC_TYPEDEF,
@@ -593,14 +583,9 @@ struct symbol
struct type *type;
- /* Name space code. */
+ /* Domain code. */
-#ifdef __MFC4__
- /* FIXME: don't conflict with C++'s namespace */
- /* would be safer to do a global change for all namespace identifiers. */
-#define namespace _namespace
-#endif
- namespace_enum namespace BYTE_BITFIELD;
+ domain_enum domain BYTE_BITFIELD;
/* Address class */
@@ -656,7 +641,7 @@ struct symbol
};
-#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace
+#define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_CLASS(symbol) (symbol)->aclass
#define SYMBOL_TYPE(symbol) (symbol)->type
#define SYMBOL_LINE(symbol) (symbol)->line
@@ -667,7 +652,7 @@ struct symbol
#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.loc.baton
#define SYMBOL_LOCATION_FUNCS(symbol) (symbol)->aux_value.loc.funcs
-/* A partial_symbol records the name, namespace, and address class of
+/* A partial_symbol records the name, domain, and address class of
symbols whose types we have not parsed yet. For functions, it also
contains their memory address, so we can find them from a PC value.
Each partial_symbol sits in a partial_symtab, all of which are chained
@@ -683,7 +668,7 @@ struct partial_symbol
/* Name space code. */
- namespace_enum namespace BYTE_BITFIELD;
+ domain_enum domain BYTE_BITFIELD;
/* Address class (for info_symbols) */
@@ -691,7 +676,7 @@ struct partial_symbol
};
-#define PSYMBOL_NAMESPACE(psymbol) (psymbol)->namespace
+#define PSYMBOL_DOMAIN(psymbol) (psymbol)->domain
#define PSYMBOL_CLASS(psymbol) (psymbol)->aclass
@@ -1000,14 +985,53 @@ extern struct symtab *lookup_symtab (const char *);
/* lookup a symbol by name (optional block, optional symtab) */
extern struct symbol *lookup_symbol (const char *, const struct block *,
- const namespace_enum, int *,
+ const domain_enum, int *,
struct symtab **);
+/* A default version of lookup_symbol_nonlocal for use by languages
+ that can't think of anything better to do. */
+
+extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
+ const char *,
+ const struct block *,
+ const domain_enum,
+ struct symtab **);
+
+/* Some helper functions for languages that need to write their own
+ lookup_symbol_nonlocal functions. */
+
+/* Lookup a symbol in the static block associated to BLOCK, if there
+ is one; do nothing if BLOCK is NULL or a global block. */
+
+extern struct symbol *lookup_symbol_static (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab);
+
+/* Lookup a symbol in all files' global blocks (searching psymtabs if
+ necessary). */
+
+extern struct symbol *lookup_symbol_global (const char *name,
+ const char *linkage_name,
+ const domain_enum domain,
+ struct symtab **symtab);
+
+/* Lookup a symbol within the block BLOCK. This, unlike
+ lookup_symbol_block, will set SYMTAB and BLOCK_FOUND correctly, and
+ will fix up the symbol if necessary. */
+
+extern struct symbol *lookup_symbol_aux_block (const char *name,
+ const char *linkage_name,
+ const struct block *block,
+ const domain_enum domain,
+ struct symtab **symtab);
+
/* lookup a symbol by name, within a specified block */
extern struct symbol *lookup_block_symbol (const struct block *, const char *,
const char *,
- const namespace_enum);
+ const domain_enum);
/* lookup a [struct, union, enum] by name, within a specified block */
@@ -1320,7 +1344,7 @@ struct symbol_search
struct symbol_search *next;
};
-extern void search_symbols (char *, namespace_enum, int, char **,
+extern void search_symbols (char *, domain_enum, int, char **,
struct symbol_search **);
extern void free_search_symbols (struct symbol_search *);
extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search
diff --git a/gdb/target.h b/gdb/target.h
index e757b6701d9..cd822799ed6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -552,11 +552,11 @@ extern void print_section_info (struct target_ops *, bfd *);
#define target_files_info() \
(*current_target.to_files_info) (&current_target)
-/* Insert a breakpoint at address ADDR in the target machine.
- SAVE 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. Result is 0 for success, or
- an errno value. */
+/* Insert a breakpoint at address ADDR in the target machine. SAVE is
+ a pointer to memory allocated for saving the target contents. It
+ is guaranteed by the caller to be long enough to save the number of
+ breakpoint bytes indicated by BREAKPOINT_FROM_PC. Result is 0 for
+ success, or an errno value. */
#define target_insert_breakpoint(addr, save) \
(*current_target.to_insert_breakpoint) (addr, save)
@@ -1126,9 +1126,6 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *);
extern int default_memory_insert_breakpoint (CORE_ADDR, char *);
-extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr,
- int *lenptr);
-
/* From target.c */
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 22ac56a3c1c..8f118767d4d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2003-05-20 David Carlton <carlton@math.stanford.edu>
+
+ * gdb.c++/namespace1.cc: Actually do 'cvs add' before committing
+ this time.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * gdb.c++/rtti.exp: New file, containing tests for PR c++/488.
+ * gdb.c++/rtti.h, gdb.c++/rtti1.cc, gdb.c++/rtti2.cc: Ditto.
+
+2003-05-19 David Carlton <carlton@bactrian.org>
+
+ * gdb.c++/namespace.exp: Add namespace scope and anonymous
+ namespace tests.
+ Bump copyright date.
+ * gdb.c++/namespace.cc: Add anonymous namespace and namespace C.
+ (main): Call C::D::marker2.
+ * gdb.c++/namespace1.cc: New file.
+
+2003-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Roland McGrath <roland@redhat.com>
+ * gdb.threads/linux-dp.exp: Account for fact that in nptl model
+ there is no manager thread.
+
2003-05-08 Jeff Johnston <jjohnstn@redhat.com>
* gdb.threads/schedlock.exp: Remove assumption that all threads
diff --git a/gdb/testsuite/gdb.c++/namespace.cc b/gdb/testsuite/gdb.c++/namespace.cc
index 7667266c278..7b9a173d819 100644
--- a/gdb/testsuite/gdb.c++/namespace.cc
+++ b/gdb/testsuite/gdb.c++/namespace.cc
@@ -68,6 +68,70 @@ void marker1(void)
return;
}
+namespace
+{
+ int X = 9;
+
+ namespace G
+ {
+ int Xg = 10;
+ }
+}
+
+namespace C
+{
+ int c = 1;
+ int shadow = 12;
+
+ namespace
+ {
+ int cX = 6;
+
+ namespace F
+ {
+ int cXf = 7;
+ }
+ }
+
+ namespace C
+ {
+ int cc = 2;
+ }
+
+ namespace D
+ {
+ int cd = 3;
+ int shadow = 13;
+
+ namespace E
+ {
+ int cde = 5;
+ }
+
+ void marker2 (void)
+ {
+ // NOTE: carlton/2003-04-23: I'm listing the expressions that I
+ // plan to have GDB try to print out, just to make sure that the
+ // compiler and I agree which ones should be legal! It's easy
+ // to screw up when testing the boundaries of namespace stuff.
+ c;
+ //cc;
+ C::cc;
+ cd;
+ E::cde;
+ shadow;
+ cX;
+ F::cXf;
+ X;
+ G::Xg;
+ //cXOtherFile;
+ //XOtherFile;
+
+ return;
+ }
+
+ }
+}
int main ()
{
@@ -95,9 +159,5 @@ int main ()
marker1();
+ C::D::marker2 ();
}
-
-
-
-
-
diff --git a/gdb/testsuite/gdb.c++/namespace.exp b/gdb/testsuite/gdb.c++/namespace.exp
index 3e502c4b50a..f4efaf64d23 100644
--- a/gdb/testsuite/gdb.c++/namespace.exp
+++ b/gdb/testsuite/gdb.c++/namespace.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright 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
@@ -39,20 +39,26 @@ if { [skip_cplus_tests] } { continue }
set testfile "namespace"
set srcfile ${testfile}.cc
+set objfile ${objdir}/${subdir}/${testfile}.o
+set srcfile1 ${testfile}1.cc
+set objfile1 ${objdir}/${subdir}/${testfile}1.o
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info ${binfile}] {
return -1;
}
-
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will a
-utomatically fail."
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${objfile1}" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if { [gdb_compile "${objfile} ${objfile1}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
gdb_exit
gdb_start
@@ -186,3 +192,28 @@ gdb_expect {
timeout { fail "(timeout) break BBB::Class::xyzq" }
}
+# Test to see if the appropriate namespaces are in scope when trying
+# to print out stuff from within a function defined within a
+# namespace.
+
+if ![runto "C::D::marker2"] then {
+ perror "couldn't run to marker2"
+ continue
+}
+
+gdb_test "print c" "\\$\[0-9\].* = 1"
+gdb_test "print cc" "No symbol \"cc\" in current context."
+gdb_test "print 'C::cc'" "\\$\[0-9\].* = 2"
+gdb_test "print cd" "\\$\[0-9\].* = 3"
+gdb_test "print 'E::cde'" "\\$\[0-9\].* = 5"
+gdb_test "print shadow" "\\$\[0-9\].* = 13"
+gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
+
+# Some anonymous namespace tests.
+
+gdb_test "print cX" "\\$\[0-9\].* = 6"
+gdb_test "print 'F::cXf'" "\\$\[0-9\].* = 7"
+gdb_test "print X" "\\$\[0-9\].* = 9"
+gdb_test "print 'G::Xg'" "\\$\[0-9\].* = 10"
+gdb_test "print cXOtherFile" "No symbol \"cXOtherFile\" in current context."
+gdb_test "print XOtherFile" "No symbol \"XOtherFile\" in current context."
diff --git a/gdb/testsuite/gdb.c++/namespace1.cc b/gdb/testsuite/gdb.c++/namespace1.cc
new file mode 100644
index 00000000000..4a5900a8b3d
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/namespace1.cc
@@ -0,0 +1,31 @@
+/* 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 */
+
+namespace C
+{
+ namespace {
+ int cXOtherFile = 29;
+ };
+
+ int cOtherFile = 316;
+}
+
+namespace {
+ int XOtherFile = 317;
+}
diff --git a/gdb/testsuite/gdb.c++/rtti.exp b/gdb/testsuite/gdb.c++/rtti.exp
new file mode 100644
index 00000000000..f99637a28a9
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/rtti.exp
@@ -0,0 +1,127 @@
+# 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.
+
+# This file is part of the gdb testsuite.
+
+# This contains tests for GDB's use of RTTI information. This stems
+# from a bug reported in PR gdb/488 and other places, which leads to
+# statements like 'warning: can't find class named 'C::D', as given by
+# C++ RTTI'. It arises from GDB not knowing about classes that are
+# defined in namespaces.
+
+# NOTE: carlton/2003-05-16: I suspect it could arise from nested class
+# issues, too, and even once we fix that, there might be situations
+# (involving templates, in particular) where this problem triggers
+# because GDB and GCC have different ideas what a class is called.
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "rtti"
+set srcfile1 "${srcdir}/${subdir}/${testfile}1.cc"
+set objfile1 "${objdir}/${subdir}/${testfile}1.o"
+set srcfile2 "${srcdir}/${subdir}/${testfile}2.cc"
+set objfile2 "${objdir}/${subdir}/${testfile}2.o"
+set binfile ${objdir}/${subdir}/${testfile}
+
+# gdb_get_line_number needs this to be called srcfile.
+set srcfile "${srcfile1}"
+
+if { [gdb_compile "${srcfile1}" "${objfile1}" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcfile2}" "${objfile2}" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${objfile1} ${objfile2}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# First, run to after we've constructed the object:
+
+gdb_breakpoint [gdb_get_line_number "constructs-done"]
+gdb_continue_to_breakpoint "end of constructors"
+
+gdb_test_multiple "print *e1" "print *e1" {
+ -re "warning: can't find class named `n1::D1', as given by C\\+\\+ RTTI.*$gdb_prompt $" {
+ kfail "gdb/488" "print *e1"
+ }
+ -re "\\$\[0-9\]* = {<n1::Base1> = .*}\r\n$gdb_prompt $" {
+ pass "print *e1"
+ }
+ -re "\\$\[0-9\]* = {<Base1> = .*}\r\n$gdb_prompt $" {
+ # NOTE: carlton/2003-05-16: If code is compiled by GCC2, we
+ # don't print the warning (for no particular reason), but we
+ # still call the class via the wrong name; PR gdb/57 is our
+ # catch-all PR for nested type problems.
+ kfail "gdb/57" "print *e1"
+ }
+}
+
+# NOTE: carlton/2003-05-16: This test fails on my branch with an
+# "<incomplete type>" message because, within rtt1.cc, GDB has no way
+# of knowing that the class is called 'n2::D2' instead of just 'D2'.
+# This is an artifical test case, though: if we were using these
+# classes in a more substantial way, G++ would emit more debug info.
+# As is, I don't think there's anything that GDB can do about this
+# case until G++ starts emitting DW_TAG_namespace info; when that part
+# of the branch gets merged in, then we'll probably want to convert
+# that fail branch to an xfail.
+
+gdb_test_multiple "print *e2" "print *e2" {
+ -re "warning: can't find class named `n2::D2', as given by C\\+\\+ RTTI.*$gdb_prompt $" {
+ kfail "gdb/488" "print *e2"
+ }
+ -re "\\$\[0-9\]* = <incomplete type>\r\n$gdb_prompt $" {
+ # See above NOTE.
+ fail "print *e2"
+ }
+ -re "\\$\[0-9\]* = {<n2::Base2> = .*}\r\n$gdb_prompt $" {
+ pass "print *e2"
+ }
+ -re "\\$\[0-9\]* = {<Base2> = .*}\r\n$gdb_prompt $" {
+ kfail "gdb/57" "print *e2"
+ }
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/rtti.h b/gdb/testsuite/gdb.c++/rtti.h
new file mode 100644
index 00000000000..879896d0dc8
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/rtti.h
@@ -0,0 +1,48 @@
+/* Code to go along with tests in rtti.exp.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
+ 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. */
+
+namespace n2 {
+
+ class C2;
+
+ class Base2 {
+ public:
+ virtual ~Base2() { }
+ };
+
+
+ class C2: public Base2 {
+ public:
+ };
+
+ class D2 : public C2{
+ public:
+ D2(C2 *, C2 *);
+
+ C2* expr_1_;
+ C2* expr_2_;
+ };
+
+ extern C2 *create2();
+}
diff --git a/gdb/testsuite/gdb.c++/rtti1.cc b/gdb/testsuite/gdb.c++/rtti1.cc
new file mode 100644
index 00000000000..6e9d862bb13
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/rtti1.cc
@@ -0,0 +1,67 @@
+/* Code to go along with tests in rtti.exp.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
+ 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 "rtti.h"
+
+namespace n1 {
+
+ class C1;
+
+ class Base1 {
+ public:
+ virtual ~Base1() { }
+ };
+
+
+ class C1: public Base1 {
+ public:
+ };
+
+ class D1 : public C1{
+ public:
+ D1(C1 *, C1 *);
+
+ C1* expr_1_;
+ C1* expr_2_;
+ };
+
+ D1::D1(C1 *expr_1, C1 *expr_2)
+ : expr_1_(expr_1), expr_2_(expr_2) { }
+
+ C1 *create1() {
+ return new D1(0, 0);
+ }
+
+} // n1
+
+int main()
+{
+ using namespace n1;
+ using namespace n2;
+
+ C1 *e1 = create1();
+ C2 *e2 = create2();
+
+ return 0; // constructs-done
+}
diff --git a/gdb/testsuite/gdb.c++/rtti2.cc b/gdb/testsuite/gdb.c++/rtti2.cc
new file mode 100644
index 00000000000..8bb1ed6c99f
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/rtti2.cc
@@ -0,0 +1,36 @@
+/* Code to go along with tests in rtti.exp.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
+ 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 "rtti.h"
+
+namespace n2 {
+
+ D2::D2(C2 *expr_1, C2 *expr_2)
+ : expr_1_(expr_1), expr_2_(expr_2) { }
+
+ C2 *create2() {
+ return new D2(0, 0);
+ }
+
+}
diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp
index 6d48b0dd141..e6baffecddb 100644
--- a/gdb/testsuite/gdb.threads/linux-dp.exp
+++ b/gdb/testsuite/gdb.threads/linux-dp.exp
@@ -64,11 +64,23 @@ gdb_test "info threads" "" "info threads 1"
# Try stepping over the thread creation function.
gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: create philosopher"]
+set expect_manager -1
for {set i 0} {$i < 5} {incr i} {
gdb_continue_to_breakpoint "about to create philosopher: $i"
send_gdb "next\n"
gdb_expect {
+ -re "\\\[New .*\\\].*\\\[New .*\\\].*$gdb_prompt $" {
+ # Two threads are created the first time in LinuxThreads,
+ # where the second is the manager thread. In NPTL, there is none.
+ if {$i == 0} {
+ set expect_manager 1
+ }
+ pass "create philosopher: $i"
+ }
-re "\\\[New .*\\\].*$gdb_prompt $" {
+ if {$i == 0} {
+ set expect_manager 0
+ }
pass "create philosopher: $i"
}
-re "Program received signal.*(Unknown signal|SIGUSR|Real-time event).*$gdb_prompt $" {
@@ -87,15 +99,25 @@ for {set i 0} {$i < 5} {incr i} {
}
}
+if {$expect_manager} {
+ set nthreads 7
+} else {
+ set nthreads 6
+}
+
# Run until there are some threads.
gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"]
gdb_continue_to_breakpoint "main thread's sleep"
-gdb_test "info threads" "7 Thread .*6 Thread .*5 Thread .*4 Thread .*3 Thread .*2 Thread .*1 Thread .*" "info threads 2"
+set info_threads_ptn ""
+for {set i $nthreads} {$i > 0} {incr i -1} {
+ append info_threads_ptn "$i Thread .*"
+}
+gdb_test "info threads" $info_threads_ptn "info threads 2"
# Try setting a thread-specific breakpoint.
gdb_breakpoint "print_philosopher thread 5"
gdb_continue_to_breakpoint "thread 5's print"
-gdb_test "where" "print_philosopher.*philosopher.*pthread_start_thread.*" \
+gdb_test "where" "print_philosopher.*philosopher.* from .*libpthread.*" \
"first thread-specific breakpoint hit"
# Make sure it's catching the right thread. Try hitting the
@@ -154,7 +176,7 @@ proc check_philosopher_stack {thread seen_name} {
global gdb_prompt
upvar $seen_name seen
global main_seen
- global manager_seen
+ global expect_manager manager_seen
set name "philosopher is distinct: $thread"
set interesting 0
@@ -216,7 +238,7 @@ proc check_philosopher_stack {thread seen_name} {
set any_interesting 0
array set seen {}
unset seen
-for {set i 1} {$i <= 7} {incr i} {
+for {set i 1} {$i <= $nthreads} {incr i} {
if [check_philosopher_stack $i seen] {
set any_interesting 1
}
@@ -227,3 +249,9 @@ if {$any_interesting} {
} else {
fail "found an interesting thread"
}
+
+if {$manager_seen == $expect_manager} {
+ pass "manager thread found (not found) when expected"
+} else {
+ fail "manager thread found (not found) when expected"
+}
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 1828d1c74df..0f896a49fb3 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -958,7 +958,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (!v850_type_is_scalar (VALUE_TYPE (*args))
&& TYPE_LENGTH (VALUE_TYPE (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS)
{
- store_address (valbuf, 4, VALUE_ADDRESS (*args));
+ store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (*args));
len = 4;
val = valbuf;
}
@@ -1230,7 +1230,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, v850_register_name);
set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size);
- set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
+ set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, v850_register_byte);
set_gdbarch_register_raw_size (gdbarch, v850_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, v850_reg_size);
diff --git a/gdb/valops.c b/gdb/valops.c
index e54969c3743..3e8589481f7 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -87,7 +87,7 @@ struct value *
find_function_in_inferior (const char *name)
{
register struct symbol *sym;
- sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
+ sym = lookup_symbol (name, 0, VAR_DOMAIN, 0, NULL);
if (sym != NULL)
{
if (SYMBOL_CLASS (sym) != LOC_BLOCK)
@@ -2350,7 +2350,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
else
{
struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
- 0, VAR_NAMESPACE, 0, NULL);
+ 0, VAR_DOMAIN, 0, NULL);
if (s == NULL)
{
v = 0;
@@ -2510,7 +2510,7 @@ value_of_local (const char *name, int complain)
/* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
symbol instead of the LOC_ARG one (if both exist). */
- sym = lookup_block_symbol (b, name, NULL, VAR_NAMESPACE);
+ sym = lookup_block_symbol (b, name, NULL, VAR_DOMAIN);
if (sym == NULL)
{
if (complain)
diff --git a/gdb/value.h b/gdb/value.h
index 54854e5f563..254c82f1cb2 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1,4 +1,5 @@
/* Definitions for values of C expressions, for GDB.
+
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
@@ -23,105 +24,109 @@
#if !defined (VALUE_H)
#define VALUE_H 1
-struct ui_file;
+#include "doublest.h"
+
+struct block;
struct expression;
+struct regcache;
struct symbol;
struct type;
-struct regcache;
-struct block;
-
-#include "doublest.h"
+struct ui_file;
-/*
- * The structure which defines the type of a value. It should never
- * be possible for a program lval value to survive over a call to the inferior
- * (ie to be put into the history list or an internal variable).
- */
+/* The structure which defines the type of a value. It should never
+ be possible for a program lval value to survive over a call to the
+ inferior (i.e. to be put into the history list or an internal
+ variable). */
struct value
+{
+ /* Type of value; either not an lval, or one of the various
+ different possible kinds of lval. */
+ enum lval_type lval;
+
+ /* Is it modifiable? Only relevant if lval != not_lval. */
+ int modifiable;
+
+ /* Location of value (if lval). */
+ union
{
- /* Type of value; either not an lval, or one of the various
- different possible kinds of lval. */
- enum lval_type lval;
- /* Is it modifiable? Only relevant if lval != not_lval. */
- int modifiable;
- /* Location of value (if lval). */
- union
- {
- /* If lval == lval_memory, this is the address in the inferior.
- If lval == lval_register, this is the byte offset into the
- registers structure. */
- CORE_ADDR address;
- /* Pointer to internal variable. */
- struct internalvar *internalvar;
- /* Number of register. Only used with
- lval_reg_frame_relative. */
- int regnum;
- }
- location;
- /* Describes offset of a value within lval of a structure in bytes.
- If lval == lval_memory, this is an offset to the address.
- If lval == lval_register, this is a further offset from
- location.address within the registers structure.
- Note also the member embedded_offset below. */
- int offset;
- /* Only used for bitfields; number of bits contained in them. */
- int bitsize;
- /* Only used for bitfields; position of start of field.
- For BITS_BIG_ENDIAN=0 targets, it is the position of the LSB.
- For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */
+ /* If lval == lval_memory, this is the address in the inferior.
+ If lval == lval_register, this is the byte offset into the
+ registers structure. */
+ CORE_ADDR address;
+
+ /* Pointer to internal variable. */
+ struct internalvar *internalvar;
+
+ /* Number of register. Only used with lval_reg_frame_relative. */
+ int regnum;
+ } location;
+
+ /* Describes offset of a value within lval of a structure in bytes.
+ If lval == lval_memory, this is an offset to the address.
+ If lval == lval_register, this is a further offset from
+ location.address within the registers structure.
+ Note also the member embedded_offset below. */
+ int offset;
+
+ /* Only used for bitfields; number of bits contained in them. */
+ int bitsize;
+
+ /* Only used for bitfields; position of start of field.
+ For BITS_BIG_ENDIAN=0 targets, it is the position of the LSB.
+ For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */
int bitpos;
- /* Frame value is relative to. In practice, this address is only
- used if the value is stored in several registers in other than
- the current frame, and these registers have not all been saved
- at the same place in memory. This will be described in the
- lval enum above as "lval_reg_frame_relative". */
- CORE_ADDR frame_addr;
-
- /* Type of the value. */
- struct type *type;
-
- /* If a value represents a C++ object, then the `type' field gives
- the object's compile-time type. If the object actually belongs
- to some class derived from `type', perhaps with other base
- classes and additional members, then `type' is just a subobject
- of the real thing, and the full object is probably larger than
- `type' would suggest.
-
- If `type' is a dynamic class (i.e. one with a vtable), then GDB
- can actually determine the object's run-time type by looking at
- the run-time type information in the vtable. When this
- information is available, we may elect to read in the entire
- object, for several reasons:
-
- - When printing the value, the user would probably rather see
- the full object, not just the limited portion apparent from
- the compile-time type.
-
- - If `type' has virtual base classes, then even printing
- `type' alone may require reaching outside the `type'
- portion of the object to wherever the virtual base class
- has been stored.
-
- When we store the entire object, `enclosing_type' is the
- run-time type --- the complete object --- and `embedded_offset'
- is the offset of `type' within that larger type, in bytes. The
- VALUE_CONTENTS macro takes `embedded_offset' into account, so
- most GDB code continues to see the `type' portion of the value,
- just as the inferior would.
-
- If `type' is a pointer to an object, then `enclosing_type' is a
- pointer to the object's run-time type, and `pointed_to_offset'
- is the offset in bytes from the full object to the pointed-to
- object --- that is, the value `embedded_offset' would have if
- we followed the pointer and fetched the complete object. (I
- don't really see the point. Why not just determine the
- run-time type when you indirect, and avoid the special case?
- The contents don't matter until you indirect anyway.)
-
- If we're not doing anything fancy, `enclosing_type' is equal to
- `type', and `embedded_offset' is zero, so everything works
- normally. */
+
+ /* Frame value is relative to. In practice, this address is only
+ used if the value is stored in several registers in other than
+ the current frame, and these registers have not all been saved
+ at the same place in memory. This will be described in the
+ lval enum above as "lval_reg_frame_relative". */
+ CORE_ADDR frame_addr;
+
+ /* Type of the value. */
+ struct type *type;
+
+ /* If a value represents a C++ object, then the `type' field gives
+ the object's compile-time type. If the object actually belongs
+ to some class derived from `type', perhaps with other base
+ classes and additional members, then `type' is just a subobject
+ of the real thing, and the full object is probably larger than
+ `type' would suggest.
+
+ If `type' is a dynamic class (i.e. one with a vtable), then GDB
+ can actually determine the object's run-time type by looking at
+ the run-time type information in the vtable. When this
+ information is available, we may elect to read in the entire
+ object, for several reasons:
+
+ - When printing the value, the user would probably rather see the
+ full object, not just the limited portion apparent from the
+ compile-time type.
+
+ - If `type' has virtual base classes, then even printing `type'
+ alone may require reaching outside the `type' portion of the
+ object to wherever the virtual base class has been stored.
+
+ When we store the entire object, `enclosing_type' is the run-time
+ type -- the complete object -- and `embedded_offset' is the
+ offset of `type' within that larger type, in bytes. The
+ VALUE_CONTENTS macro takes `embedded_offset' into account, so
+ most GDB code continues to see the `type' portion of the value,
+ just as the inferior would.
+
+ If `type' is a pointer to an object, then `enclosing_type' is a
+ pointer to the object's run-time type, and `pointed_to_offset' is
+ the offset in bytes from the full object to the pointed-to object
+ -- that is, the value `embedded_offset' would have if we
+ followed the pointer and fetched the complete object. (I don't
+ really see the point. Why not just determine the run-time type
+ when you indirect, and avoid the special case? The contents
+ don't matter until you indirect anyway.)
+
+ If we're not doing anything fancy, `enclosing_type' is equal to
+ `type', and `embedded_offset' is zero, so everything works
+ normally. */
struct type *enclosing_type;
int embedded_offset;
int pointed_to_offset;
@@ -134,10 +139,11 @@ struct value
/* Register number if the value is from a register. */
short regno;
- /* If zero, contents of this value are in the contents field.
- If nonzero, contents are in inferior memory at address
- in the location.address field plus the offset field
- (and the lval field should be lval_memory).
+
+ /* If zero, contents of this value are in the contents field. If
+ nonzero, contents are in inferior memory at address in the
+ location.address field plus the offset field (and the lval
+ field should be lval_memory).
WARNING: This field is used by the code which handles
watchpoints (see breakpoint.c) to decide whether a particular
@@ -150,53 +156,59 @@ struct value
lazy flag is set and reset, be sure to consider this use as
well! */
char lazy;
+
/* If nonzero, this is the value of a variable which does not
actually exist in the program. */
char optimized_out;
+
/* The BFD section associated with this value. */
asection *bfd_section;
+
/* Actual contents of the value. For use of this value; setting
it uses the stuff above. Not valid if lazy is nonzero.
Target byte-order. We force it to be aligned properly for any
possible value. Note that a value therefore extends beyond
what is declared here. */
union
- {
- long contents[1];
- DOUBLEST force_doublest_align;
- LONGEST force_longest_align;
- CORE_ADDR force_core_addr_align;
- void *force_pointer_align;
- }
- aligner;
- /* Do not add any new members here -- contents above will trash them */
- };
+ {
+ long contents[1];
+ DOUBLEST force_doublest_align;
+ LONGEST force_longest_align;
+ CORE_ADDR force_core_addr_align;
+ void *force_pointer_align;
+ } aligner;
+ /* Do not add any new members here -- contents above will trash them. */
+};
#define VALUE_TYPE(val) (val)->type
#define VALUE_ENCLOSING_TYPE(val) (val)->enclosing_type
#define VALUE_LAZY(val) (val)->lazy
+
/* VALUE_CONTENTS and VALUE_CONTENTS_RAW both return the address of
- the gdb buffer used to hold a copy of the contents of the lval.
- VALUE_CONTENTS is used when the contents of the buffer are needed --
- it uses value_fetch_lazy() to load the buffer from the process being
- debugged if it hasn't already been loaded. VALUE_CONTENTS_RAW is
- used when data is being stored into the buffer, or when it is
- certain that the contents of the buffer are valid.
+ the gdb buffer used to hold a copy of the contents of the lval.
+ VALUE_CONTENTS is used when the contents of the buffer are needed
+ -- it uses value_fetch_lazy() to load the buffer from the process
+ being debugged if it hasn't already been loaded.
+ VALUE_CONTENTS_RAW is used when data is being stored into the
+ buffer, or when it is certain that the contents of the buffer are
+ valid.
+
Note: The contents pointer is adjusted by the offset required to
get to the real subobject, if the value happens to represent
- something embedded in a larger run-time object. */
+ something embedded in a larger run-time object. */
-#define VALUE_CONTENTS_RAW(val) ((char *) (val)->aligner.contents + (val)->embedded_offset)
-#define VALUE_CONTENTS(val) ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)),\
- VALUE_CONTENTS_RAW(val))
+#define VALUE_CONTENTS_RAW(val) \
+ ((char *) (val)->aligner.contents + (val)->embedded_offset)
+#define VALUE_CONTENTS(val) \
+ ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)), VALUE_CONTENTS_RAW(val))
/* The ALL variants of the above two macros do not adjust the returned
- pointer by the embedded_offset value. */
+ pointer by the embedded_offset value. */
#define VALUE_CONTENTS_ALL_RAW(val) ((char *) (val)->aligner.contents)
-#define VALUE_CONTENTS_ALL(val) ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)),\
- VALUE_CONTENTS_ALL_RAW(val))
-
+#define VALUE_CONTENTS_ALL(val) \
+ ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)), \
+ VALUE_CONTENTS_ALL_RAW(val))
extern int value_fetch_lazy (struct value *val);
@@ -215,16 +227,17 @@ extern int value_fetch_lazy (struct value *val);
#define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)
#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
-/* Convert a REF to the object referenced. */
+/* Convert a REF to the object referenced. */
-#define COERCE_REF(arg) \
-do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\
- if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
- arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
- unpack_pointer (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg)), \
- VALUE_BFD_SECTION (arg)); \
- } while (0)
+#define COERCE_REF(arg) \
+ do { \
+ struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg)); \
+ if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
+ arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
+ unpack_pointer (VALUE_TYPE (arg), \
+ VALUE_CONTENTS (arg)), \
+ VALUE_BFD_SECTION (arg)); \
+ } while (0)
/* If ARG is an array, convert it to a pointer.
If ARG is an enum, convert it to an integer.
@@ -232,17 +245,18 @@ do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\
References are dereferenced. */
-#define COERCE_ARRAY(arg) \
-do { COERCE_REF(arg); \
- if (current_language->c_style_arrays \
- && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \
- arg = value_coerce_array (arg); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \
- arg = value_coerce_function (arg); \
-} while (0)
+#define COERCE_ARRAY(arg) \
+ do { \
+ COERCE_REF(arg); \
+ if (current_language->c_style_arrays \
+ && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \
+ arg = value_coerce_array (arg); \
+ if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \
+ arg = value_coerce_function (arg); \
+ } while (0)
-#define COERCE_NUMBER(arg) \
- do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0)
+#define COERCE_NUMBER(arg) \
+ do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0)
/* NOTE: cagney/2002-12-17: This macro was handling a chill language
problem but that language has gone away. */
@@ -250,22 +264,23 @@ do { COERCE_REF(arg); \
/* If ARG is an enum, convert it to an integer. */
-#define COERCE_ENUM(arg) { \
- if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \
- arg = value_cast (builtin_type_unsigned_int, arg); \
-}
+#define COERCE_ENUM(arg) \
+ do { \
+ if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \
+ arg = value_cast (builtin_type_unsigned_int, arg); \
+ } while (0)
/* Internal variables (variables for convenience of use of debugger)
are recorded as a chain of these structures. */
struct internalvar
- {
- struct internalvar *next;
- char *name;
- struct value *value;
- };
+{
+ struct internalvar *next;
+ char *name;
+ struct value *value;
+};
-/* Pointer to member function. Depends on compiler implementation. */
+/* Pointer to member function. Depends on compiler implementation. */
#define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000)
#define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET))
@@ -282,32 +297,23 @@ struct fn_field;
extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
extern LONGEST value_as_long (struct value *val);
-
extern DOUBLEST value_as_double (struct value *val);
-
extern CORE_ADDR value_as_address (struct value *val);
extern LONGEST unpack_long (struct type *type, const char *valaddr);
-
extern DOUBLEST unpack_double (struct type *type, const char *valaddr,
int *invp);
-
extern CORE_ADDR unpack_pointer (struct type *type, const char *valaddr);
-
extern LONGEST unpack_field_as_long (struct type *type, const char *valaddr,
int fieldno);
extern struct value *value_from_longest (struct type *type, LONGEST num);
-
extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
-
extern struct value *value_from_double (struct type *type, DOUBLEST num);
-
extern struct value *value_from_string (char *string);
extern struct value *value_at (struct type *type, CORE_ADDR addr,
asection * sect);
-
extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
asection * sect);
diff --git a/gdb/values.c b/gdb/values.c
index 88c6a61037b..db667669ff5 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -794,7 +794,7 @@ value_static_field (struct type *type, int fieldno)
else
{
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
- struct symbol *sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
+ struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0, NULL);
if (sym == NULL)
{
/* With some compilers, e.g. HP aCC, static data members are reported
@@ -968,7 +968,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
struct symbol *sym;
struct minimal_symbol *msym;
- sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
+ sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0, NULL);
if (sym != NULL)
{
msym = NULL;
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 54ca48dd58a..814fedd8543 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -50,32 +50,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype
vax_extract_struct_value_address;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the Vax. */
-
-/* FIXME: cagney/2002-01-19: The macro below was originally defined in
- tm-vax.h and used in values.c. Two problems. Firstly this is a
- very non-portable and secondly it is wrong. The VAX should be
- using floatformat and associated methods to identify and handle
- invalid floating-point values. Adding to the poor target's woes
- there is no floatformat_vax_{f,d} and no TARGET_FLOAT_FORMAT
- et.al.. */
-
-/* FIXME: cagney/2002-01-19: It turns out that the only thing that
- uses this macro is the vax disassembler code (so how old is this
- target?). This target should instead be using the opcodes
- disassembler. That allowing the macro to be eliminated. */
-
-#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
-
-/* Vax instructions are never longer than this. */
-#define MAXLEN 62
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof votstrs / sizeof votstrs[0])
-
-static unsigned char *print_insn_arg ();
static const char *
vax_register_name (int regno)
@@ -373,228 +347,6 @@ vax_saved_pc_after_call (struct frame_info *frame)
return (DEPRECATED_FRAME_SAVED_PC(frame));
}
-/* Print the vax instruction at address MEMADDR in debugged memory,
- from disassembler info INFO.
- Returns length of the instruction, in bytes. */
-
-static int
-vax_print_insn (CORE_ADDR memaddr, disassemble_info *info)
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register unsigned char *p;
- const char *d;
-
- int status = (*info->read_memory_func) (memaddr, buffer, MAXLEN, info);
- if (status != 0)
- {
- (*info->memory_error_func) (status, memaddr, info);
- return -1;
- }
-
- for (i = 0; i < NOPCODES; i++)
- if (votstrs[i].detail.code == buffer[0]
- || votstrs[i].detail.code == *(unsigned short *) buffer)
- break;
-
- /* Handle undefined instructions. */
- if (i == NOPCODES)
- {
- (*info->fprintf_func) (info->stream, "0%o", buffer[0]);
- return 1;
- }
-
- (*info->fprintf_func) (info->stream, "%s", votstrs[i].name);
-
- /* Point at first byte of argument data,
- and at descriptor for first argument. */
- p = buffer + 1 + (votstrs[i].detail.code >= 0x100);
- d = votstrs[i].detail.args;
-
- if (*d)
- (*info->fprintf_func) (info->stream, " ");
-
- while (*d)
- {
- p = print_insn_arg (d, p, memaddr + (p - buffer), info);
- d += 2;
- if (*d)
- (*info->fprintf_func) (info->stream, ",");
- }
- return p - buffer;
-}
-
-static unsigned char *
-print_insn_arg (char *d, register char *p, CORE_ADDR addr,
- disassemble_info *info)
-{
- register int regnum = *p & 0xf;
- float floatlitbuf;
-
- if (*d == 'b')
- {
- if (d[1] == 'b')
- (*info->fprintf_func) (info->stream, "0x%x", addr + *p++ + 1);
- else
- {
- (*info->fprintf_func) (info->stream, "0x%x", addr + *(short *) p + 2);
- p += 2;
- }
- }
- else
- switch ((*p++ >> 4) & 0xf)
- {
- case 0:
- case 1:
- case 2:
- case 3: /* Literal mode */
- if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
- {
- *(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
- (*info->fprintf_func) (info->stream, "$%f", floatlitbuf);
- }
- else
- (*info->fprintf_func) (info->stream, "$%d", p[-1] & 0x3f);
- break;
-
- case 4: /* Indexed */
- p = (char *) print_insn_arg (d, p, addr + 1, info);
- (*info->fprintf_func) (info->stream, "[%s]", REGISTER_NAME (regnum));
- break;
-
- case 5: /* Register */
- (*info->fprintf_func) (info->stream, REGISTER_NAME (regnum));
- break;
-
- case 7: /* Autodecrement */
- (*info->fprintf_func) (info->stream, "-");
- case 6: /* Register deferred */
- (*info->fprintf_func) (info->stream, "(%s)", REGISTER_NAME (regnum));
- break;
-
- case 9: /* Autoincrement deferred */
- (*info->fprintf_func) (info->stream, "@");
- if (regnum == PC_REGNUM)
- {
- (*info->fprintf_func) (info->stream, "#");
- info->target = *(long *) p;
- (*info->print_address_func) (info->target, info);
- p += 4;
- break;
- }
- case 8: /* Autoincrement */
- if (regnum == PC_REGNUM)
- {
- (*info->fprintf_func) (info->stream, "#");
- switch (d[1])
- {
- case 'b':
- (*info->fprintf_func) (info->stream, "%d", *p++);
- break;
-
- case 'w':
- (*info->fprintf_func) (info->stream, "%d", *(short *) p);
- p += 2;
- break;
-
- case 'l':
- (*info->fprintf_func) (info->stream, "%d", *(long *) p);
- p += 4;
- break;
-
- case 'q':
- (*info->fprintf_func) (info->stream, "0x%x%08x",
- ((long *) p)[1], ((long *) p)[0]);
- p += 8;
- break;
-
- case 'o':
- (*info->fprintf_func) (info->stream, "0x%x%08x%08x%08x",
- ((long *) p)[3], ((long *) p)[2],
- ((long *) p)[1], ((long *) p)[0]);
- p += 16;
- break;
-
- case 'f':
- if (INVALID_FLOAT (p, 4))
- (*info->fprintf_func) (info->stream,
- "<<invalid float 0x%x>>",
- *(int *) p);
- else
- (*info->fprintf_func) (info->stream, "%f", *(float *) p);
- p += 4;
- break;
-
- case 'd':
- if (INVALID_FLOAT (p, 8))
- (*info->fprintf_func) (info->stream,
- "<<invalid float 0x%x%08x>>",
- ((long *) p)[1], ((long *) p)[0]);
- else
- (*info->fprintf_func) (info->stream, "%f", *(double *) p);
- p += 8;
- break;
-
- case 'g':
- (*info->fprintf_func) (info->stream, "g-float");
- p += 8;
- break;
-
- case 'h':
- (*info->fprintf_func) (info->stream, "h-float");
- p += 16;
- break;
-
- }
- }
- else
- (*info->fprintf_func) (info->stream, "(%s)+", REGISTER_NAME (regnum));
- break;
-
- case 11: /* Byte displacement deferred */
- (*info->fprintf_func) (info->stream, "@");
- case 10: /* Byte displacement */
- if (regnum == PC_REGNUM)
- {
- info->target = addr + *p + 2;
- (*info->print_address_func) (info->target, info);
- }
- else
- (*info->fprintf_func) (info->stream, "%d(%s)", *p, REGISTER_NAME (regnum));
- p += 1;
- break;
-
- case 13: /* Word displacement deferred */
- (*info->fprintf_func) (info->stream, "@");
- case 12: /* Word displacement */
- if (regnum == PC_REGNUM)
- {
- info->target = addr + *(short *) p + 3;
- (*info->print_address_func) (info->target, info);
- }
- else
- (*info->fprintf_func) (info->stream, "%d(%s)",
- *(short *) p, REGISTER_NAME (regnum));
- p += 2;
- break;
-
- case 15: /* Long displacement deferred */
- (*info->fprintf_func) (info->stream, "@");
- case 14: /* Long displacement */
- if (regnum == PC_REGNUM)
- {
- info->target = addr + *(short *) p + 5;
- (*info->print_address_func) (info->target, info);
- }
- else
- (*info->fprintf_func) (info->stream, "%d(%s)",
- *(long *) p, REGISTER_NAME (regnum));
- p += 4;
- }
-
- return (unsigned char *) p;
-}
-
/* Initialize the current architecture based on INFO. If possible, re-use an
architecture from ARCHES, which is a list of architectures already created
during this debugging session.
@@ -627,7 +379,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, vax_register_name);
set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
- set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES);
+ set_gdbarch_deprecated_register_bytes (gdbarch, VAX_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, vax_register_byte);
set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
@@ -687,6 +439,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
+ set_gdbarch_print_insn (gdbarch, print_insn_vax);
+
return (gdbarch);
}
@@ -694,6 +448,4 @@ void
_initialize_vax_tdep (void)
{
gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
-
- deprecated_tm_print_insn = vax_print_insn;
}
diff --git a/gdb/version.in b/gdb/version.in
index f67ef295d96..8379ea398ec 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2003-05-09-cvs
+2003-05-21-cvs
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 7dd5f1e11d2..121c85eef39 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -112,7 +112,7 @@ static struct register_info x86_64_register_info_table[] = {
numbering to GDB's one. Dwarf-2 numbering is
defined in x86-64 ABI, section 3.6. */
static int x86_64_dwarf2gdb_regno_map[] = {
- 0, 1, 2, 3, /* RAX - RDX */
+ 0, 3, 2, 1, /* RAX, RDX, RCX, RBX */
4, 5, 6, 7, /* RSI, RDI, RBP, RSP */
8, 9, 10, 11, /* R8 - R11 */
12, 13, 14, 15, /* R12 - R15 */
@@ -961,7 +961,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
SIZEOF_SSE_REGS) */
for (i = 0, sum = 0; i < X86_64_NUM_REGS; i++)
sum += x86_64_register_info_table[i].size;
- set_gdbarch_register_bytes (gdbarch, sum);
+ set_gdbarch_deprecated_register_bytes (gdbarch, sum);
set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
set_gdbarch_register_byte (gdbarch, x86_64_register_byte);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index dd6541a1529..5a0b2862fef 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1469,7 +1469,7 @@ process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile)
/* default assumptions */
SYMBOL_VALUE_ADDRESS (sym) = cs->c_value + off;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_SECTION (sym) = secnum_to_section (cs->c_secnum, objfile);
if (ISFCN (cs->c_type))
@@ -2593,7 +2593,7 @@ scan_xcoff_symtab (struct objfile *objfile)
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, symbol.n_value,
psymtab_language, objfile);
@@ -2604,7 +2604,7 @@ scan_xcoff_symtab (struct objfile *objfile)
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
+ VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, symbol.n_value,
psymtab_language, objfile);
@@ -2622,7 +2622,7 @@ scan_xcoff_symtab (struct objfile *objfile)
&& namestring[0] != ' '))
{
add_psymbol_to_list (namestring, p - namestring,
- STRUCT_NAMESPACE, LOC_TYPEDEF,
+ STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
symbol.n_value, 0,
psymtab_language, objfile);
@@ -2630,7 +2630,7 @@ scan_xcoff_symtab (struct objfile *objfile)
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
symbol.n_value, 0,
psymtab_language, objfile);
@@ -2646,7 +2646,7 @@ scan_xcoff_symtab (struct objfile *objfile)
// OBSOLETE {
// OBSOLETE /* Also a typedef with the same name. */
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
-// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
+// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF,
// OBSOLETE &objfile->static_psymbols,
// OBSOLETE symbol.n_value, 0,
// OBSOLETE psymtab_language, objfile);
@@ -2659,7 +2659,7 @@ scan_xcoff_symtab (struct objfile *objfile)
if (p != namestring) /* a name is there, not just :T... */
{
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
+ VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
symbol.n_value, 0,
psymtab_language, objfile);
@@ -2721,7 +2721,7 @@ scan_xcoff_symtab (struct objfile *objfile)
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
add_psymbol_to_list (p, q - p,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
0, psymtab_language, objfile);
/* Point past the name. */
@@ -2739,7 +2739,7 @@ scan_xcoff_symtab (struct objfile *objfile)
case 'c':
/* Constant, e.g. from "const" in Pascal. */
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
+ VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, symbol.n_value,
0, psymtab_language, objfile);
continue;
@@ -2756,7 +2756,7 @@ scan_xcoff_symtab (struct objfile *objfile)
}
symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, symbol.n_value,
psymtab_language, objfile);
@@ -2777,7 +2777,7 @@ scan_xcoff_symtab (struct objfile *objfile)
}
symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
+ VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, symbol.n_value,
psymtab_language, objfile);
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index d6aa0183e1e..f792423a544 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -648,7 +648,7 @@ xstormy16_skip_prologue (CORE_ADDR pc)
return plg_end;
/* Found a function. */
- sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
+ sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL);
/* Don't use line number debug info for assembly source files. */
if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{
@@ -985,7 +985,7 @@ xstormy16_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
if (addr2)
addr = addr2;
}
- store_address (buf, TYPE_LENGTH (type), addr);
+ store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
}
static CORE_ADDR
@@ -1039,7 +1039,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, xstormy16_register_name);
set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
- set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
+ set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size);